Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

157673 Zeilen
6.0 MiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package compute provides access to the Compute Engine API.
  6. //
  7. // For product documentation, see: https://developers.google.com/compute/docs/reference/latest/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/compute/v0.alpha"
  14. // ...
  15. // ctx := context.Background()
  16. // computeService, err := compute.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // computeService, err := compute.NewService(ctx, option.WithScopes(compute.DevstorageReadWriteScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // computeService, err := compute.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // computeService, err := compute.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package compute // import "google.golang.org/api/compute/v0.alpha"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "compute:alpha"
  71. const apiName = "compute"
  72. const apiVersion = "alpha"
  73. const basePath = "https://www.googleapis.com/compute/alpha/projects/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your data across Google Cloud Platform services
  77. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  78. // View and manage your Google Compute Engine resources
  79. ComputeScope = "https://www.googleapis.com/auth/compute"
  80. // View your Google Compute Engine resources
  81. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  82. // Manage your data and permissions in Google Cloud Storage
  83. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  84. // View your data in Google Cloud Storage
  85. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  86. // Manage your data in Google Cloud Storage
  87. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  88. )
  89. // NewService creates a new Service.
  90. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  91. scopesOption := option.WithScopes(
  92. "https://www.googleapis.com/auth/cloud-platform",
  93. "https://www.googleapis.com/auth/compute",
  94. "https://www.googleapis.com/auth/compute.readonly",
  95. "https://www.googleapis.com/auth/devstorage.full_control",
  96. "https://www.googleapis.com/auth/devstorage.read_only",
  97. "https://www.googleapis.com/auth/devstorage.read_write",
  98. )
  99. // NOTE: prepend, so we don't override user-specified scopes.
  100. opts = append([]option.ClientOption{scopesOption}, opts...)
  101. client, endpoint, err := htransport.NewClient(ctx, opts...)
  102. if err != nil {
  103. return nil, err
  104. }
  105. s, err := New(client)
  106. if err != nil {
  107. return nil, err
  108. }
  109. if endpoint != "" {
  110. s.BasePath = endpoint
  111. }
  112. return s, nil
  113. }
  114. // New creates a new Service. It uses the provided http.Client for requests.
  115. //
  116. // Deprecated: please use NewService instead.
  117. // To provide a custom HTTP client, use option.WithHTTPClient.
  118. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  119. func New(client *http.Client) (*Service, error) {
  120. if client == nil {
  121. return nil, errors.New("client is nil")
  122. }
  123. s := &Service{client: client, BasePath: basePath}
  124. s.AcceleratorTypes = NewAcceleratorTypesService(s)
  125. s.Addresses = NewAddressesService(s)
  126. s.Allocations = NewAllocationsService(s)
  127. s.Autoscalers = NewAutoscalersService(s)
  128. s.BackendBuckets = NewBackendBucketsService(s)
  129. s.BackendServices = NewBackendServicesService(s)
  130. s.DiskTypes = NewDiskTypesService(s)
  131. s.Disks = NewDisksService(s)
  132. s.ExternalVpnGateways = NewExternalVpnGatewaysService(s)
  133. s.Firewalls = NewFirewallsService(s)
  134. s.ForwardingRules = NewForwardingRulesService(s)
  135. s.GlobalAddresses = NewGlobalAddressesService(s)
  136. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  137. s.GlobalOperations = NewGlobalOperationsService(s)
  138. s.GlobalOrganizationOperations = NewGlobalOrganizationOperationsService(s)
  139. s.HealthChecks = NewHealthChecksService(s)
  140. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  141. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  142. s.Images = NewImagesService(s)
  143. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  144. s.InstanceGroups = NewInstanceGroupsService(s)
  145. s.InstanceTemplates = NewInstanceTemplatesService(s)
  146. s.Instances = NewInstancesService(s)
  147. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  148. s.InterconnectLocations = NewInterconnectLocationsService(s)
  149. s.Interconnects = NewInterconnectsService(s)
  150. s.LicenseCodes = NewLicenseCodesService(s)
  151. s.Licenses = NewLicensesService(s)
  152. s.MachineImages = NewMachineImagesService(s)
  153. s.MachineTypes = NewMachineTypesService(s)
  154. s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s)
  155. s.Networks = NewNetworksService(s)
  156. s.NodeGroups = NewNodeGroupsService(s)
  157. s.NodeTemplates = NewNodeTemplatesService(s)
  158. s.NodeTypes = NewNodeTypesService(s)
  159. s.OrganizationSecurityPolicies = NewOrganizationSecurityPoliciesService(s)
  160. s.Projects = NewProjectsService(s)
  161. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  162. s.RegionBackendServices = NewRegionBackendServicesService(s)
  163. s.RegionCommitments = NewRegionCommitmentsService(s)
  164. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  165. s.RegionDisks = NewRegionDisksService(s)
  166. s.RegionHealthCheckServices = NewRegionHealthCheckServicesService(s)
  167. s.RegionHealthChecks = NewRegionHealthChecksService(s)
  168. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  169. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  170. s.RegionNotificationEndpoints = NewRegionNotificationEndpointsService(s)
  171. s.RegionOperations = NewRegionOperationsService(s)
  172. s.RegionSslCertificates = NewRegionSslCertificatesService(s)
  173. s.RegionTargetHttpProxies = NewRegionTargetHttpProxiesService(s)
  174. s.RegionTargetHttpsProxies = NewRegionTargetHttpsProxiesService(s)
  175. s.RegionUrlMaps = NewRegionUrlMapsService(s)
  176. s.Regions = NewRegionsService(s)
  177. s.ResourcePolicies = NewResourcePoliciesService(s)
  178. s.Routers = NewRoutersService(s)
  179. s.Routes = NewRoutesService(s)
  180. s.SecurityPolicies = NewSecurityPoliciesService(s)
  181. s.Snapshots = NewSnapshotsService(s)
  182. s.SslCertificates = NewSslCertificatesService(s)
  183. s.SslPolicies = NewSslPoliciesService(s)
  184. s.Subnetworks = NewSubnetworksService(s)
  185. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  186. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  187. s.TargetInstances = NewTargetInstancesService(s)
  188. s.TargetPools = NewTargetPoolsService(s)
  189. s.TargetSslProxies = NewTargetSslProxiesService(s)
  190. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  191. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  192. s.UrlMaps = NewUrlMapsService(s)
  193. s.VpnGateways = NewVpnGatewaysService(s)
  194. s.VpnTunnels = NewVpnTunnelsService(s)
  195. s.ZoneOperations = NewZoneOperationsService(s)
  196. s.Zones = NewZonesService(s)
  197. return s, nil
  198. }
  199. type Service struct {
  200. client *http.Client
  201. BasePath string // API endpoint base URL
  202. UserAgent string // optional additional User-Agent fragment
  203. AcceleratorTypes *AcceleratorTypesService
  204. Addresses *AddressesService
  205. Allocations *AllocationsService
  206. Autoscalers *AutoscalersService
  207. BackendBuckets *BackendBucketsService
  208. BackendServices *BackendServicesService
  209. DiskTypes *DiskTypesService
  210. Disks *DisksService
  211. ExternalVpnGateways *ExternalVpnGatewaysService
  212. Firewalls *FirewallsService
  213. ForwardingRules *ForwardingRulesService
  214. GlobalAddresses *GlobalAddressesService
  215. GlobalForwardingRules *GlobalForwardingRulesService
  216. GlobalOperations *GlobalOperationsService
  217. GlobalOrganizationOperations *GlobalOrganizationOperationsService
  218. HealthChecks *HealthChecksService
  219. HttpHealthChecks *HttpHealthChecksService
  220. HttpsHealthChecks *HttpsHealthChecksService
  221. Images *ImagesService
  222. InstanceGroupManagers *InstanceGroupManagersService
  223. InstanceGroups *InstanceGroupsService
  224. InstanceTemplates *InstanceTemplatesService
  225. Instances *InstancesService
  226. InterconnectAttachments *InterconnectAttachmentsService
  227. InterconnectLocations *InterconnectLocationsService
  228. Interconnects *InterconnectsService
  229. LicenseCodes *LicenseCodesService
  230. Licenses *LicensesService
  231. MachineImages *MachineImagesService
  232. MachineTypes *MachineTypesService
  233. NetworkEndpointGroups *NetworkEndpointGroupsService
  234. Networks *NetworksService
  235. NodeGroups *NodeGroupsService
  236. NodeTemplates *NodeTemplatesService
  237. NodeTypes *NodeTypesService
  238. OrganizationSecurityPolicies *OrganizationSecurityPoliciesService
  239. Projects *ProjectsService
  240. RegionAutoscalers *RegionAutoscalersService
  241. RegionBackendServices *RegionBackendServicesService
  242. RegionCommitments *RegionCommitmentsService
  243. RegionDiskTypes *RegionDiskTypesService
  244. RegionDisks *RegionDisksService
  245. RegionHealthCheckServices *RegionHealthCheckServicesService
  246. RegionHealthChecks *RegionHealthChecksService
  247. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  248. RegionInstanceGroups *RegionInstanceGroupsService
  249. RegionNotificationEndpoints *RegionNotificationEndpointsService
  250. RegionOperations *RegionOperationsService
  251. RegionSslCertificates *RegionSslCertificatesService
  252. RegionTargetHttpProxies *RegionTargetHttpProxiesService
  253. RegionTargetHttpsProxies *RegionTargetHttpsProxiesService
  254. RegionUrlMaps *RegionUrlMapsService
  255. Regions *RegionsService
  256. ResourcePolicies *ResourcePoliciesService
  257. Routers *RoutersService
  258. Routes *RoutesService
  259. SecurityPolicies *SecurityPoliciesService
  260. Snapshots *SnapshotsService
  261. SslCertificates *SslCertificatesService
  262. SslPolicies *SslPoliciesService
  263. Subnetworks *SubnetworksService
  264. TargetHttpProxies *TargetHttpProxiesService
  265. TargetHttpsProxies *TargetHttpsProxiesService
  266. TargetInstances *TargetInstancesService
  267. TargetPools *TargetPoolsService
  268. TargetSslProxies *TargetSslProxiesService
  269. TargetTcpProxies *TargetTcpProxiesService
  270. TargetVpnGateways *TargetVpnGatewaysService
  271. UrlMaps *UrlMapsService
  272. VpnGateways *VpnGatewaysService
  273. VpnTunnels *VpnTunnelsService
  274. ZoneOperations *ZoneOperationsService
  275. Zones *ZonesService
  276. }
  277. func (s *Service) userAgent() string {
  278. if s.UserAgent == "" {
  279. return googleapi.UserAgent
  280. }
  281. return googleapi.UserAgent + " " + s.UserAgent
  282. }
  283. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  284. rs := &AcceleratorTypesService{s: s}
  285. return rs
  286. }
  287. type AcceleratorTypesService struct {
  288. s *Service
  289. }
  290. func NewAddressesService(s *Service) *AddressesService {
  291. rs := &AddressesService{s: s}
  292. return rs
  293. }
  294. type AddressesService struct {
  295. s *Service
  296. }
  297. func NewAllocationsService(s *Service) *AllocationsService {
  298. rs := &AllocationsService{s: s}
  299. return rs
  300. }
  301. type AllocationsService struct {
  302. s *Service
  303. }
  304. func NewAutoscalersService(s *Service) *AutoscalersService {
  305. rs := &AutoscalersService{s: s}
  306. return rs
  307. }
  308. type AutoscalersService struct {
  309. s *Service
  310. }
  311. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  312. rs := &BackendBucketsService{s: s}
  313. return rs
  314. }
  315. type BackendBucketsService struct {
  316. s *Service
  317. }
  318. func NewBackendServicesService(s *Service) *BackendServicesService {
  319. rs := &BackendServicesService{s: s}
  320. return rs
  321. }
  322. type BackendServicesService struct {
  323. s *Service
  324. }
  325. func NewDiskTypesService(s *Service) *DiskTypesService {
  326. rs := &DiskTypesService{s: s}
  327. return rs
  328. }
  329. type DiskTypesService struct {
  330. s *Service
  331. }
  332. func NewDisksService(s *Service) *DisksService {
  333. rs := &DisksService{s: s}
  334. return rs
  335. }
  336. type DisksService struct {
  337. s *Service
  338. }
  339. func NewExternalVpnGatewaysService(s *Service) *ExternalVpnGatewaysService {
  340. rs := &ExternalVpnGatewaysService{s: s}
  341. return rs
  342. }
  343. type ExternalVpnGatewaysService struct {
  344. s *Service
  345. }
  346. func NewFirewallsService(s *Service) *FirewallsService {
  347. rs := &FirewallsService{s: s}
  348. return rs
  349. }
  350. type FirewallsService struct {
  351. s *Service
  352. }
  353. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  354. rs := &ForwardingRulesService{s: s}
  355. return rs
  356. }
  357. type ForwardingRulesService struct {
  358. s *Service
  359. }
  360. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  361. rs := &GlobalAddressesService{s: s}
  362. return rs
  363. }
  364. type GlobalAddressesService struct {
  365. s *Service
  366. }
  367. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  368. rs := &GlobalForwardingRulesService{s: s}
  369. return rs
  370. }
  371. type GlobalForwardingRulesService struct {
  372. s *Service
  373. }
  374. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  375. rs := &GlobalOperationsService{s: s}
  376. return rs
  377. }
  378. type GlobalOperationsService struct {
  379. s *Service
  380. }
  381. func NewGlobalOrganizationOperationsService(s *Service) *GlobalOrganizationOperationsService {
  382. rs := &GlobalOrganizationOperationsService{s: s}
  383. return rs
  384. }
  385. type GlobalOrganizationOperationsService struct {
  386. s *Service
  387. }
  388. func NewHealthChecksService(s *Service) *HealthChecksService {
  389. rs := &HealthChecksService{s: s}
  390. return rs
  391. }
  392. type HealthChecksService struct {
  393. s *Service
  394. }
  395. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  396. rs := &HttpHealthChecksService{s: s}
  397. return rs
  398. }
  399. type HttpHealthChecksService struct {
  400. s *Service
  401. }
  402. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  403. rs := &HttpsHealthChecksService{s: s}
  404. return rs
  405. }
  406. type HttpsHealthChecksService struct {
  407. s *Service
  408. }
  409. func NewImagesService(s *Service) *ImagesService {
  410. rs := &ImagesService{s: s}
  411. return rs
  412. }
  413. type ImagesService struct {
  414. s *Service
  415. }
  416. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  417. rs := &InstanceGroupManagersService{s: s}
  418. return rs
  419. }
  420. type InstanceGroupManagersService struct {
  421. s *Service
  422. }
  423. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  424. rs := &InstanceGroupsService{s: s}
  425. return rs
  426. }
  427. type InstanceGroupsService struct {
  428. s *Service
  429. }
  430. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  431. rs := &InstanceTemplatesService{s: s}
  432. return rs
  433. }
  434. type InstanceTemplatesService struct {
  435. s *Service
  436. }
  437. func NewInstancesService(s *Service) *InstancesService {
  438. rs := &InstancesService{s: s}
  439. return rs
  440. }
  441. type InstancesService struct {
  442. s *Service
  443. }
  444. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  445. rs := &InterconnectAttachmentsService{s: s}
  446. return rs
  447. }
  448. type InterconnectAttachmentsService struct {
  449. s *Service
  450. }
  451. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  452. rs := &InterconnectLocationsService{s: s}
  453. return rs
  454. }
  455. type InterconnectLocationsService struct {
  456. s *Service
  457. }
  458. func NewInterconnectsService(s *Service) *InterconnectsService {
  459. rs := &InterconnectsService{s: s}
  460. return rs
  461. }
  462. type InterconnectsService struct {
  463. s *Service
  464. }
  465. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  466. rs := &LicenseCodesService{s: s}
  467. return rs
  468. }
  469. type LicenseCodesService struct {
  470. s *Service
  471. }
  472. func NewLicensesService(s *Service) *LicensesService {
  473. rs := &LicensesService{s: s}
  474. return rs
  475. }
  476. type LicensesService struct {
  477. s *Service
  478. }
  479. func NewMachineImagesService(s *Service) *MachineImagesService {
  480. rs := &MachineImagesService{s: s}
  481. return rs
  482. }
  483. type MachineImagesService struct {
  484. s *Service
  485. }
  486. func NewMachineTypesService(s *Service) *MachineTypesService {
  487. rs := &MachineTypesService{s: s}
  488. return rs
  489. }
  490. type MachineTypesService struct {
  491. s *Service
  492. }
  493. func NewNetworkEndpointGroupsService(s *Service) *NetworkEndpointGroupsService {
  494. rs := &NetworkEndpointGroupsService{s: s}
  495. return rs
  496. }
  497. type NetworkEndpointGroupsService struct {
  498. s *Service
  499. }
  500. func NewNetworksService(s *Service) *NetworksService {
  501. rs := &NetworksService{s: s}
  502. return rs
  503. }
  504. type NetworksService struct {
  505. s *Service
  506. }
  507. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  508. rs := &NodeGroupsService{s: s}
  509. return rs
  510. }
  511. type NodeGroupsService struct {
  512. s *Service
  513. }
  514. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  515. rs := &NodeTemplatesService{s: s}
  516. return rs
  517. }
  518. type NodeTemplatesService struct {
  519. s *Service
  520. }
  521. func NewNodeTypesService(s *Service) *NodeTypesService {
  522. rs := &NodeTypesService{s: s}
  523. return rs
  524. }
  525. type NodeTypesService struct {
  526. s *Service
  527. }
  528. func NewOrganizationSecurityPoliciesService(s *Service) *OrganizationSecurityPoliciesService {
  529. rs := &OrganizationSecurityPoliciesService{s: s}
  530. return rs
  531. }
  532. type OrganizationSecurityPoliciesService struct {
  533. s *Service
  534. }
  535. func NewProjectsService(s *Service) *ProjectsService {
  536. rs := &ProjectsService{s: s}
  537. return rs
  538. }
  539. type ProjectsService struct {
  540. s *Service
  541. }
  542. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  543. rs := &RegionAutoscalersService{s: s}
  544. return rs
  545. }
  546. type RegionAutoscalersService struct {
  547. s *Service
  548. }
  549. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  550. rs := &RegionBackendServicesService{s: s}
  551. return rs
  552. }
  553. type RegionBackendServicesService struct {
  554. s *Service
  555. }
  556. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  557. rs := &RegionCommitmentsService{s: s}
  558. return rs
  559. }
  560. type RegionCommitmentsService struct {
  561. s *Service
  562. }
  563. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  564. rs := &RegionDiskTypesService{s: s}
  565. return rs
  566. }
  567. type RegionDiskTypesService struct {
  568. s *Service
  569. }
  570. func NewRegionDisksService(s *Service) *RegionDisksService {
  571. rs := &RegionDisksService{s: s}
  572. return rs
  573. }
  574. type RegionDisksService struct {
  575. s *Service
  576. }
  577. func NewRegionHealthCheckServicesService(s *Service) *RegionHealthCheckServicesService {
  578. rs := &RegionHealthCheckServicesService{s: s}
  579. return rs
  580. }
  581. type RegionHealthCheckServicesService struct {
  582. s *Service
  583. }
  584. func NewRegionHealthChecksService(s *Service) *RegionHealthChecksService {
  585. rs := &RegionHealthChecksService{s: s}
  586. return rs
  587. }
  588. type RegionHealthChecksService struct {
  589. s *Service
  590. }
  591. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  592. rs := &RegionInstanceGroupManagersService{s: s}
  593. return rs
  594. }
  595. type RegionInstanceGroupManagersService struct {
  596. s *Service
  597. }
  598. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  599. rs := &RegionInstanceGroupsService{s: s}
  600. return rs
  601. }
  602. type RegionInstanceGroupsService struct {
  603. s *Service
  604. }
  605. func NewRegionNotificationEndpointsService(s *Service) *RegionNotificationEndpointsService {
  606. rs := &RegionNotificationEndpointsService{s: s}
  607. return rs
  608. }
  609. type RegionNotificationEndpointsService struct {
  610. s *Service
  611. }
  612. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  613. rs := &RegionOperationsService{s: s}
  614. return rs
  615. }
  616. type RegionOperationsService struct {
  617. s *Service
  618. }
  619. func NewRegionSslCertificatesService(s *Service) *RegionSslCertificatesService {
  620. rs := &RegionSslCertificatesService{s: s}
  621. return rs
  622. }
  623. type RegionSslCertificatesService struct {
  624. s *Service
  625. }
  626. func NewRegionTargetHttpProxiesService(s *Service) *RegionTargetHttpProxiesService {
  627. rs := &RegionTargetHttpProxiesService{s: s}
  628. return rs
  629. }
  630. type RegionTargetHttpProxiesService struct {
  631. s *Service
  632. }
  633. func NewRegionTargetHttpsProxiesService(s *Service) *RegionTargetHttpsProxiesService {
  634. rs := &RegionTargetHttpsProxiesService{s: s}
  635. return rs
  636. }
  637. type RegionTargetHttpsProxiesService struct {
  638. s *Service
  639. }
  640. func NewRegionUrlMapsService(s *Service) *RegionUrlMapsService {
  641. rs := &RegionUrlMapsService{s: s}
  642. return rs
  643. }
  644. type RegionUrlMapsService struct {
  645. s *Service
  646. }
  647. func NewRegionsService(s *Service) *RegionsService {
  648. rs := &RegionsService{s: s}
  649. return rs
  650. }
  651. type RegionsService struct {
  652. s *Service
  653. }
  654. func NewResourcePoliciesService(s *Service) *ResourcePoliciesService {
  655. rs := &ResourcePoliciesService{s: s}
  656. return rs
  657. }
  658. type ResourcePoliciesService struct {
  659. s *Service
  660. }
  661. func NewRoutersService(s *Service) *RoutersService {
  662. rs := &RoutersService{s: s}
  663. return rs
  664. }
  665. type RoutersService struct {
  666. s *Service
  667. }
  668. func NewRoutesService(s *Service) *RoutesService {
  669. rs := &RoutesService{s: s}
  670. return rs
  671. }
  672. type RoutesService struct {
  673. s *Service
  674. }
  675. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  676. rs := &SecurityPoliciesService{s: s}
  677. return rs
  678. }
  679. type SecurityPoliciesService struct {
  680. s *Service
  681. }
  682. func NewSnapshotsService(s *Service) *SnapshotsService {
  683. rs := &SnapshotsService{s: s}
  684. return rs
  685. }
  686. type SnapshotsService struct {
  687. s *Service
  688. }
  689. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  690. rs := &SslCertificatesService{s: s}
  691. return rs
  692. }
  693. type SslCertificatesService struct {
  694. s *Service
  695. }
  696. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  697. rs := &SslPoliciesService{s: s}
  698. return rs
  699. }
  700. type SslPoliciesService struct {
  701. s *Service
  702. }
  703. func NewSubnetworksService(s *Service) *SubnetworksService {
  704. rs := &SubnetworksService{s: s}
  705. return rs
  706. }
  707. type SubnetworksService struct {
  708. s *Service
  709. }
  710. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  711. rs := &TargetHttpProxiesService{s: s}
  712. return rs
  713. }
  714. type TargetHttpProxiesService struct {
  715. s *Service
  716. }
  717. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  718. rs := &TargetHttpsProxiesService{s: s}
  719. return rs
  720. }
  721. type TargetHttpsProxiesService struct {
  722. s *Service
  723. }
  724. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  725. rs := &TargetInstancesService{s: s}
  726. return rs
  727. }
  728. type TargetInstancesService struct {
  729. s *Service
  730. }
  731. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  732. rs := &TargetPoolsService{s: s}
  733. return rs
  734. }
  735. type TargetPoolsService struct {
  736. s *Service
  737. }
  738. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  739. rs := &TargetSslProxiesService{s: s}
  740. return rs
  741. }
  742. type TargetSslProxiesService struct {
  743. s *Service
  744. }
  745. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  746. rs := &TargetTcpProxiesService{s: s}
  747. return rs
  748. }
  749. type TargetTcpProxiesService struct {
  750. s *Service
  751. }
  752. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  753. rs := &TargetVpnGatewaysService{s: s}
  754. return rs
  755. }
  756. type TargetVpnGatewaysService struct {
  757. s *Service
  758. }
  759. func NewUrlMapsService(s *Service) *UrlMapsService {
  760. rs := &UrlMapsService{s: s}
  761. return rs
  762. }
  763. type UrlMapsService struct {
  764. s *Service
  765. }
  766. func NewVpnGatewaysService(s *Service) *VpnGatewaysService {
  767. rs := &VpnGatewaysService{s: s}
  768. return rs
  769. }
  770. type VpnGatewaysService struct {
  771. s *Service
  772. }
  773. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  774. rs := &VpnTunnelsService{s: s}
  775. return rs
  776. }
  777. type VpnTunnelsService struct {
  778. s *Service
  779. }
  780. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  781. rs := &ZoneOperationsService{s: s}
  782. return rs
  783. }
  784. type ZoneOperationsService struct {
  785. s *Service
  786. }
  787. func NewZonesService(s *Service) *ZonesService {
  788. rs := &ZonesService{s: s}
  789. return rs
  790. }
  791. type ZonesService struct {
  792. s *Service
  793. }
  794. // AcceleratorConfig: A specification of the type and number of
  795. // accelerator cards attached to the instance.
  796. type AcceleratorConfig struct {
  797. // AcceleratorCount: The number of the guest accelerator cards exposed
  798. // to this instance.
  799. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  800. // AcceleratorType: Full or partial URL of the accelerator type resource
  801. // to attach to this instance. For example:
  802. // projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-
  803. // p100 If you are creating an instance template, specify only the
  804. // accelerator name. See GPUs on Compute Engine for a full list of
  805. // accelerator types.
  806. AcceleratorType string `json:"acceleratorType,omitempty"`
  807. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  808. // unconditionally include in API requests. By default, fields with
  809. // empty values are omitted from API requests. However, any non-pointer,
  810. // non-interface field appearing in ForceSendFields will be sent to the
  811. // server regardless of whether the field is empty or not. This may be
  812. // used to include empty fields in Patch requests.
  813. ForceSendFields []string `json:"-"`
  814. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  815. // include in API requests with the JSON null value. By default, fields
  816. // with empty values are omitted from API requests. However, any field
  817. // with an empty value appearing in NullFields will be sent to the
  818. // server as null. It is an error if a field in this list has a
  819. // non-empty value. This may be used to include null fields in Patch
  820. // requests.
  821. NullFields []string `json:"-"`
  822. }
  823. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  824. type NoMethod AcceleratorConfig
  825. raw := NoMethod(*s)
  826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  827. }
  828. // AcceleratorType: An Accelerator Type resource. (== resource_for
  829. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  830. type AcceleratorType struct {
  831. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  832. // format.
  833. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  834. // Deprecated: [Output Only] The deprecation status associated with this
  835. // accelerator type.
  836. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  837. // Description: [Output Only] An optional textual description of the
  838. // resource.
  839. Description string `json:"description,omitempty"`
  840. // Id: [Output Only] The unique identifier for the resource. This
  841. // identifier is defined by the server.
  842. Id uint64 `json:"id,omitempty,string"`
  843. // Kind: [Output Only] The type of the resource. Always
  844. // compute#acceleratorType for accelerator types.
  845. Kind string `json:"kind,omitempty"`
  846. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  847. // allowed per instance.
  848. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  849. // Name: [Output Only] Name of the resource.
  850. Name string `json:"name,omitempty"`
  851. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  852. // resource.
  853. SelfLink string `json:"selfLink,omitempty"`
  854. // SelfLinkWithId: [Output Only] Server-defined URL for this resource's
  855. // resource id.
  856. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  857. // Zone: [Output Only] The name of the zone where the accelerator type
  858. // resides, such as us-central1-a. You must specify this field as part
  859. // of the HTTP request URL. It is not settable as a field in the request
  860. // body.
  861. Zone string `json:"zone,omitempty"`
  862. // ServerResponse contains the HTTP response code and headers from the
  863. // server.
  864. googleapi.ServerResponse `json:"-"`
  865. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  866. // to unconditionally include in API requests. By default, fields with
  867. // empty values are omitted from API requests. However, any non-pointer,
  868. // non-interface field appearing in ForceSendFields will be sent to the
  869. // server regardless of whether the field is empty or not. This may be
  870. // used to include empty fields in Patch requests.
  871. ForceSendFields []string `json:"-"`
  872. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  873. // include in API requests with the JSON null value. By default, fields
  874. // with empty values are omitted from API requests. However, any field
  875. // with an empty value appearing in NullFields will be sent to the
  876. // server as null. It is an error if a field in this list has a
  877. // non-empty value. This may be used to include null fields in Patch
  878. // requests.
  879. NullFields []string `json:"-"`
  880. }
  881. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  882. type NoMethod AcceleratorType
  883. raw := NoMethod(*s)
  884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  885. }
  886. type AcceleratorTypeAggregatedList struct {
  887. // Id: [Output Only] Unique identifier for the resource; defined by the
  888. // server.
  889. Id string `json:"id,omitempty"`
  890. // Items: A list of AcceleratorTypesScopedList resources.
  891. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  892. // Kind: [Output Only] Type of resource. Always
  893. // compute#acceleratorTypeAggregatedList for aggregated lists of
  894. // accelerator types.
  895. Kind string `json:"kind,omitempty"`
  896. // NextPageToken: [Output Only] This token allows you to get the next
  897. // page of results for list requests. If the number of results is larger
  898. // than maxResults, use the nextPageToken as a value for the query
  899. // parameter pageToken in the next list request. Subsequent list
  900. // requests will have their own nextPageToken to continue paging through
  901. // the results.
  902. NextPageToken string `json:"nextPageToken,omitempty"`
  903. // SelfLink: [Output Only] Server-defined URL for this resource.
  904. SelfLink string `json:"selfLink,omitempty"`
  905. // Warning: [Output Only] Informational warning message.
  906. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  907. // ServerResponse contains the HTTP response code and headers from the
  908. // server.
  909. googleapi.ServerResponse `json:"-"`
  910. // ForceSendFields is a list of field names (e.g. "Id") to
  911. // unconditionally include in API requests. By default, fields with
  912. // empty values are omitted from API requests. However, any non-pointer,
  913. // non-interface field appearing in ForceSendFields will be sent to the
  914. // server regardless of whether the field is empty or not. This may be
  915. // used to include empty fields in Patch requests.
  916. ForceSendFields []string `json:"-"`
  917. // NullFields is a list of field names (e.g. "Id") to include in API
  918. // requests with the JSON null value. By default, fields with empty
  919. // values are omitted from API requests. However, any field with an
  920. // empty value appearing in NullFields will be sent to the server as
  921. // null. It is an error if a field in this list has a non-empty value.
  922. // This may be used to include null fields in Patch requests.
  923. NullFields []string `json:"-"`
  924. }
  925. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  926. type NoMethod AcceleratorTypeAggregatedList
  927. raw := NoMethod(*s)
  928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  929. }
  930. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  931. // warning message.
  932. type AcceleratorTypeAggregatedListWarning struct {
  933. // Code: [Output Only] A warning code, if applicable. For example,
  934. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  935. // the response.
  936. //
  937. // Possible values:
  938. // "CLEANUP_FAILED"
  939. // "DEPRECATED_RESOURCE_USED"
  940. // "DEPRECATED_TYPE_USED"
  941. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  942. // "EXPERIMENTAL_TYPE_USED"
  943. // "EXTERNAL_API_WARNING"
  944. // "FIELD_VALUE_OVERRIDEN"
  945. // "INJECTED_KERNELS_DEPRECATED"
  946. // "MISSING_TYPE_DEPENDENCY"
  947. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  948. // "NEXT_HOP_CANNOT_IP_FORWARD"
  949. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  950. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  951. // "NEXT_HOP_NOT_RUNNING"
  952. // "NOT_CRITICAL_ERROR"
  953. // "NO_RESULTS_ON_PAGE"
  954. // "REQUIRED_TOS_AGREEMENT"
  955. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  956. // "RESOURCE_NOT_DELETED"
  957. // "SCHEMA_VALIDATION_IGNORED"
  958. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  959. // "UNDECLARED_PROPERTIES"
  960. // "UNREACHABLE"
  961. Code string `json:"code,omitempty"`
  962. // Data: [Output Only] Metadata about this warning in key: value format.
  963. // For example:
  964. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  965. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  966. // Message: [Output Only] A human-readable description of the warning
  967. // code.
  968. Message string `json:"message,omitempty"`
  969. // ForceSendFields is a list of field names (e.g. "Code") to
  970. // unconditionally include in API requests. By default, fields with
  971. // empty values are omitted from API requests. However, any non-pointer,
  972. // non-interface field appearing in ForceSendFields will be sent to the
  973. // server regardless of whether the field is empty or not. This may be
  974. // used to include empty fields in Patch requests.
  975. ForceSendFields []string `json:"-"`
  976. // NullFields is a list of field names (e.g. "Code") to include in API
  977. // requests with the JSON null value. By default, fields with empty
  978. // values are omitted from API requests. However, any field with an
  979. // empty value appearing in NullFields will be sent to the server as
  980. // null. It is an error if a field in this list has a non-empty value.
  981. // This may be used to include null fields in Patch requests.
  982. NullFields []string `json:"-"`
  983. }
  984. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  985. type NoMethod AcceleratorTypeAggregatedListWarning
  986. raw := NoMethod(*s)
  987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  988. }
  989. type AcceleratorTypeAggregatedListWarningData struct {
  990. // Key: [Output Only] A key that provides more detail on the warning
  991. // being returned. For example, for warnings where there are no results
  992. // in a list request for a particular zone, this key might be scope and
  993. // the key value might be the zone name. Other examples might be a key
  994. // indicating a deprecated resource and a suggested replacement, or a
  995. // warning about invalid network settings (for example, if an instance
  996. // attempts to perform IP forwarding but is not enabled for IP
  997. // forwarding).
  998. Key string `json:"key,omitempty"`
  999. // Value: [Output Only] A warning data value corresponding to the key.
  1000. Value string `json:"value,omitempty"`
  1001. // ForceSendFields is a list of field names (e.g. "Key") to
  1002. // unconditionally include in API requests. By default, fields with
  1003. // empty values are omitted from API requests. However, any non-pointer,
  1004. // non-interface field appearing in ForceSendFields will be sent to the
  1005. // server regardless of whether the field is empty or not. This may be
  1006. // used to include empty fields in Patch requests.
  1007. ForceSendFields []string `json:"-"`
  1008. // NullFields is a list of field names (e.g. "Key") to include in API
  1009. // requests with the JSON null value. By default, fields with empty
  1010. // values are omitted from API requests. However, any field with an
  1011. // empty value appearing in NullFields will be sent to the server as
  1012. // null. It is an error if a field in this list has a non-empty value.
  1013. // This may be used to include null fields in Patch requests.
  1014. NullFields []string `json:"-"`
  1015. }
  1016. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1017. type NoMethod AcceleratorTypeAggregatedListWarningData
  1018. raw := NoMethod(*s)
  1019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1020. }
  1021. // AcceleratorTypeList: Contains a list of accelerator types.
  1022. type AcceleratorTypeList struct {
  1023. // Id: [Output Only] Unique identifier for the resource; defined by the
  1024. // server.
  1025. Id string `json:"id,omitempty"`
  1026. // Items: A list of AcceleratorType resources.
  1027. Items []*AcceleratorType `json:"items,omitempty"`
  1028. // Kind: [Output Only] Type of resource. Always
  1029. // compute#acceleratorTypeList for lists of accelerator types.
  1030. Kind string `json:"kind,omitempty"`
  1031. // NextPageToken: [Output Only] This token allows you to get the next
  1032. // page of results for list requests. If the number of results is larger
  1033. // than maxResults, use the nextPageToken as a value for the query
  1034. // parameter pageToken in the next list request. Subsequent list
  1035. // requests will have their own nextPageToken to continue paging through
  1036. // the results.
  1037. NextPageToken string `json:"nextPageToken,omitempty"`
  1038. // SelfLink: [Output Only] Server-defined URL for this resource.
  1039. SelfLink string `json:"selfLink,omitempty"`
  1040. // Warning: [Output Only] Informational warning message.
  1041. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  1042. // ServerResponse contains the HTTP response code and headers from the
  1043. // server.
  1044. googleapi.ServerResponse `json:"-"`
  1045. // ForceSendFields is a list of field names (e.g. "Id") to
  1046. // unconditionally include in API requests. By default, fields with
  1047. // empty values are omitted from API requests. However, any non-pointer,
  1048. // non-interface field appearing in ForceSendFields will be sent to the
  1049. // server regardless of whether the field is empty or not. This may be
  1050. // used to include empty fields in Patch requests.
  1051. ForceSendFields []string `json:"-"`
  1052. // NullFields is a list of field names (e.g. "Id") to include in API
  1053. // requests with the JSON null value. By default, fields with empty
  1054. // values are omitted from API requests. However, any field with an
  1055. // empty value appearing in NullFields will be sent to the server as
  1056. // null. It is an error if a field in this list has a non-empty value.
  1057. // This may be used to include null fields in Patch requests.
  1058. NullFields []string `json:"-"`
  1059. }
  1060. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  1061. type NoMethod AcceleratorTypeList
  1062. raw := NoMethod(*s)
  1063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1064. }
  1065. // AcceleratorTypeListWarning: [Output Only] Informational warning
  1066. // message.
  1067. type AcceleratorTypeListWarning struct {
  1068. // Code: [Output Only] A warning code, if applicable. For example,
  1069. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1070. // the response.
  1071. //
  1072. // Possible values:
  1073. // "CLEANUP_FAILED"
  1074. // "DEPRECATED_RESOURCE_USED"
  1075. // "DEPRECATED_TYPE_USED"
  1076. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1077. // "EXPERIMENTAL_TYPE_USED"
  1078. // "EXTERNAL_API_WARNING"
  1079. // "FIELD_VALUE_OVERRIDEN"
  1080. // "INJECTED_KERNELS_DEPRECATED"
  1081. // "MISSING_TYPE_DEPENDENCY"
  1082. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1083. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1084. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1085. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1086. // "NEXT_HOP_NOT_RUNNING"
  1087. // "NOT_CRITICAL_ERROR"
  1088. // "NO_RESULTS_ON_PAGE"
  1089. // "REQUIRED_TOS_AGREEMENT"
  1090. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1091. // "RESOURCE_NOT_DELETED"
  1092. // "SCHEMA_VALIDATION_IGNORED"
  1093. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1094. // "UNDECLARED_PROPERTIES"
  1095. // "UNREACHABLE"
  1096. Code string `json:"code,omitempty"`
  1097. // Data: [Output Only] Metadata about this warning in key: value format.
  1098. // For example:
  1099. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1100. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  1101. // Message: [Output Only] A human-readable description of the warning
  1102. // code.
  1103. Message string `json:"message,omitempty"`
  1104. // ForceSendFields is a list of field names (e.g. "Code") to
  1105. // unconditionally include in API requests. By default, fields with
  1106. // empty values are omitted from API requests. However, any non-pointer,
  1107. // non-interface field appearing in ForceSendFields will be sent to the
  1108. // server regardless of whether the field is empty or not. This may be
  1109. // used to include empty fields in Patch requests.
  1110. ForceSendFields []string `json:"-"`
  1111. // NullFields is a list of field names (e.g. "Code") to include in API
  1112. // requests with the JSON null value. By default, fields with empty
  1113. // values are omitted from API requests. However, any field with an
  1114. // empty value appearing in NullFields will be sent to the server as
  1115. // null. It is an error if a field in this list has a non-empty value.
  1116. // This may be used to include null fields in Patch requests.
  1117. NullFields []string `json:"-"`
  1118. }
  1119. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  1120. type NoMethod AcceleratorTypeListWarning
  1121. raw := NoMethod(*s)
  1122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1123. }
  1124. type AcceleratorTypeListWarningData struct {
  1125. // Key: [Output Only] A key that provides more detail on the warning
  1126. // being returned. For example, for warnings where there are no results
  1127. // in a list request for a particular zone, this key might be scope and
  1128. // the key value might be the zone name. Other examples might be a key
  1129. // indicating a deprecated resource and a suggested replacement, or a
  1130. // warning about invalid network settings (for example, if an instance
  1131. // attempts to perform IP forwarding but is not enabled for IP
  1132. // forwarding).
  1133. Key string `json:"key,omitempty"`
  1134. // Value: [Output Only] A warning data value corresponding to the key.
  1135. Value string `json:"value,omitempty"`
  1136. // ForceSendFields is a list of field names (e.g. "Key") to
  1137. // unconditionally include in API requests. By default, fields with
  1138. // empty values are omitted from API requests. However, any non-pointer,
  1139. // non-interface field appearing in ForceSendFields will be sent to the
  1140. // server regardless of whether the field is empty or not. This may be
  1141. // used to include empty fields in Patch requests.
  1142. ForceSendFields []string `json:"-"`
  1143. // NullFields is a list of field names (e.g. "Key") to include in API
  1144. // requests with the JSON null value. By default, fields with empty
  1145. // values are omitted from API requests. However, any field with an
  1146. // empty value appearing in NullFields will be sent to the server as
  1147. // null. It is an error if a field in this list has a non-empty value.
  1148. // This may be used to include null fields in Patch requests.
  1149. NullFields []string `json:"-"`
  1150. }
  1151. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  1152. type NoMethod AcceleratorTypeListWarningData
  1153. raw := NoMethod(*s)
  1154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1155. }
  1156. type AcceleratorTypesScopedList struct {
  1157. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  1158. // in this scope.
  1159. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  1160. // Warning: [Output Only] An informational warning that appears when the
  1161. // accelerator types list is empty.
  1162. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  1163. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  1164. // unconditionally include in API requests. By default, fields with
  1165. // empty values are omitted from API requests. However, any non-pointer,
  1166. // non-interface field appearing in ForceSendFields will be sent to the
  1167. // server regardless of whether the field is empty or not. This may be
  1168. // used to include empty fields in Patch requests.
  1169. ForceSendFields []string `json:"-"`
  1170. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  1171. // include in API requests with the JSON null value. By default, fields
  1172. // with empty values are omitted from API requests. However, any field
  1173. // with an empty value appearing in NullFields will be sent to the
  1174. // server as null. It is an error if a field in this list has a
  1175. // non-empty value. This may be used to include null fields in Patch
  1176. // requests.
  1177. NullFields []string `json:"-"`
  1178. }
  1179. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  1180. type NoMethod AcceleratorTypesScopedList
  1181. raw := NoMethod(*s)
  1182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1183. }
  1184. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  1185. // warning that appears when the accelerator types list is empty.
  1186. type AcceleratorTypesScopedListWarning struct {
  1187. // Code: [Output Only] A warning code, if applicable. For example,
  1188. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1189. // the response.
  1190. //
  1191. // Possible values:
  1192. // "CLEANUP_FAILED"
  1193. // "DEPRECATED_RESOURCE_USED"
  1194. // "DEPRECATED_TYPE_USED"
  1195. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1196. // "EXPERIMENTAL_TYPE_USED"
  1197. // "EXTERNAL_API_WARNING"
  1198. // "FIELD_VALUE_OVERRIDEN"
  1199. // "INJECTED_KERNELS_DEPRECATED"
  1200. // "MISSING_TYPE_DEPENDENCY"
  1201. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1202. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1203. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1204. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1205. // "NEXT_HOP_NOT_RUNNING"
  1206. // "NOT_CRITICAL_ERROR"
  1207. // "NO_RESULTS_ON_PAGE"
  1208. // "REQUIRED_TOS_AGREEMENT"
  1209. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1210. // "RESOURCE_NOT_DELETED"
  1211. // "SCHEMA_VALIDATION_IGNORED"
  1212. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1213. // "UNDECLARED_PROPERTIES"
  1214. // "UNREACHABLE"
  1215. Code string `json:"code,omitempty"`
  1216. // Data: [Output Only] Metadata about this warning in key: value format.
  1217. // For example:
  1218. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1219. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1220. // Message: [Output Only] A human-readable description of the warning
  1221. // code.
  1222. Message string `json:"message,omitempty"`
  1223. // ForceSendFields is a list of field names (e.g. "Code") to
  1224. // unconditionally include in API requests. By default, fields with
  1225. // empty values are omitted from API requests. However, any non-pointer,
  1226. // non-interface field appearing in ForceSendFields will be sent to the
  1227. // server regardless of whether the field is empty or not. This may be
  1228. // used to include empty fields in Patch requests.
  1229. ForceSendFields []string `json:"-"`
  1230. // NullFields is a list of field names (e.g. "Code") to include in API
  1231. // requests with the JSON null value. By default, fields with empty
  1232. // values are omitted from API requests. However, any field with an
  1233. // empty value appearing in NullFields will be sent to the server as
  1234. // null. It is an error if a field in this list has a non-empty value.
  1235. // This may be used to include null fields in Patch requests.
  1236. NullFields []string `json:"-"`
  1237. }
  1238. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1239. type NoMethod AcceleratorTypesScopedListWarning
  1240. raw := NoMethod(*s)
  1241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1242. }
  1243. type AcceleratorTypesScopedListWarningData struct {
  1244. // Key: [Output Only] A key that provides more detail on the warning
  1245. // being returned. For example, for warnings where there are no results
  1246. // in a list request for a particular zone, this key might be scope and
  1247. // the key value might be the zone name. Other examples might be a key
  1248. // indicating a deprecated resource and a suggested replacement, or a
  1249. // warning about invalid network settings (for example, if an instance
  1250. // attempts to perform IP forwarding but is not enabled for IP
  1251. // forwarding).
  1252. Key string `json:"key,omitempty"`
  1253. // Value: [Output Only] A warning data value corresponding to the key.
  1254. Value string `json:"value,omitempty"`
  1255. // ForceSendFields is a list of field names (e.g. "Key") to
  1256. // unconditionally include in API requests. By default, fields with
  1257. // empty values are omitted from API requests. However, any non-pointer,
  1258. // non-interface field appearing in ForceSendFields will be sent to the
  1259. // server regardless of whether the field is empty or not. This may be
  1260. // used to include empty fields in Patch requests.
  1261. ForceSendFields []string `json:"-"`
  1262. // NullFields is a list of field names (e.g. "Key") to include in API
  1263. // requests with the JSON null value. By default, fields with empty
  1264. // values are omitted from API requests. However, any field with an
  1265. // empty value appearing in NullFields will be sent to the server as
  1266. // null. It is an error if a field in this list has a non-empty value.
  1267. // This may be used to include null fields in Patch requests.
  1268. NullFields []string `json:"-"`
  1269. }
  1270. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1271. type NoMethod AcceleratorTypesScopedListWarningData
  1272. raw := NoMethod(*s)
  1273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1274. }
  1275. // AccessConfig: An access configuration attached to an instance's
  1276. // network interface. Only one access config per instance is supported.
  1277. type AccessConfig struct {
  1278. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1279. // for access configs.
  1280. Kind string `json:"kind,omitempty"`
  1281. // Name: The name of this access configuration. The default and
  1282. // recommended name is External NAT but you can use any arbitrary string
  1283. // you would like. For example, My external IP or Network Access.
  1284. Name string `json:"name,omitempty"`
  1285. // NatIP: An external IP address associated with this instance. Specify
  1286. // an unused static external IP address available to the project or
  1287. // leave this field undefined to use an IP from a shared ephemeral IP
  1288. // address pool. If you specify a static external IP address, it must
  1289. // live in the same region as the zone of the instance.
  1290. NatIP string `json:"natIP,omitempty"`
  1291. // NetworkTier: This signifies the networking tier used for configuring
  1292. // this access configuration and can only take the following values:
  1293. // PREMIUM, STANDARD.
  1294. //
  1295. // If an AccessConfig is specified without a valid external IP address,
  1296. // an ephemeral IP will be created with this networkTier.
  1297. //
  1298. // If an AccessConfig with a valid external IP address is specified, it
  1299. // must match that of the networkTier associated with the Address
  1300. // resource owning that IP.
  1301. //
  1302. // Possible values:
  1303. // "PREMIUM"
  1304. // "SELECT"
  1305. // "STANDARD"
  1306. NetworkTier string `json:"networkTier,omitempty"`
  1307. // PublicDnsName: [Output Only] The public DNS domain name for the
  1308. // instance.
  1309. PublicDnsName string `json:"publicDnsName,omitempty"`
  1310. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1311. // This field can only be set when the set_public_ptr field is enabled.
  1312. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1313. // SetPublicDns: Specifies whether a public DNS ?A? record should be
  1314. // created for the external IP address of this access configuration.
  1315. SetPublicDns bool `json:"setPublicDns,omitempty"`
  1316. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1317. // created to map the external IP address of the instance to a DNS
  1318. // domain name.
  1319. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1320. // Type: The type of configuration. The default and only option is
  1321. // ONE_TO_ONE_NAT.
  1322. //
  1323. // Possible values:
  1324. // "ONE_TO_ONE_NAT" (default)
  1325. Type string `json:"type,omitempty"`
  1326. // ForceSendFields is a list of field names (e.g. "Kind") to
  1327. // unconditionally include in API requests. By default, fields with
  1328. // empty values are omitted from API requests. However, any non-pointer,
  1329. // non-interface field appearing in ForceSendFields will be sent to the
  1330. // server regardless of whether the field is empty or not. This may be
  1331. // used to include empty fields in Patch requests.
  1332. ForceSendFields []string `json:"-"`
  1333. // NullFields is a list of field names (e.g. "Kind") to include in API
  1334. // requests with the JSON null value. By default, fields with empty
  1335. // values are omitted from API requests. However, any field with an
  1336. // empty value appearing in NullFields will be sent to the server as
  1337. // null. It is an error if a field in this list has a non-empty value.
  1338. // This may be used to include null fields in Patch requests.
  1339. NullFields []string `json:"-"`
  1340. }
  1341. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1342. type NoMethod AccessConfig
  1343. raw := NoMethod(*s)
  1344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1345. }
  1346. // Address: A reserved address resource. (== resource_for beta.addresses
  1347. // ==) (== resource_for v1.addresses ==) (== resource_for
  1348. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1349. type Address struct {
  1350. // Address: The static IP address represented by this resource.
  1351. Address string `json:"address,omitempty"`
  1352. // AddressType: The type of address to reserve, either INTERNAL or
  1353. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1354. //
  1355. // Possible values:
  1356. // "DNS_FORWARDING"
  1357. // "EXTERNAL"
  1358. // "INTERNAL"
  1359. // "UNSPECIFIED_TYPE"
  1360. AddressType string `json:"addressType,omitempty"`
  1361. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1362. // format.
  1363. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1364. // Description: An optional description of this resource. Provide this
  1365. // property when you create the resource.
  1366. Description string `json:"description,omitempty"`
  1367. // Id: [Output Only] The unique identifier for the resource. This
  1368. // identifier is defined by the server.
  1369. Id uint64 `json:"id,omitempty,string"`
  1370. // IpVersion: The IP Version that will be used by this address. Valid
  1371. // options are IPV4 or IPV6. This can only be specified for a global
  1372. // address.
  1373. //
  1374. // Possible values:
  1375. // "IPV4"
  1376. // "IPV6"
  1377. // "UNSPECIFIED_VERSION"
  1378. IpVersion string `json:"ipVersion,omitempty"`
  1379. // Kind: [Output Only] Type of the resource. Always compute#address for
  1380. // addresses.
  1381. Kind string `json:"kind,omitempty"`
  1382. // LabelFingerprint: A fingerprint for the labels being applied to this
  1383. // Address, which is essentially a hash of the labels set used for
  1384. // optimistic locking. The fingerprint is initially generated by Compute
  1385. // Engine and changes after every request to modify or update labels.
  1386. // You must always provide an up-to-date fingerprint hash in order to
  1387. // update or change labels, otherwise the request will fail with error
  1388. // 412 conditionNotMet.
  1389. //
  1390. // To see the latest fingerprint, make a get() request to retrieve an
  1391. // Address.
  1392. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  1393. // Labels: Labels to apply to this Address resource. These can be later
  1394. // modified by the setLabels method. Each label key/value must comply
  1395. // with RFC1035. Label values may be empty.
  1396. Labels map[string]string `json:"labels,omitempty"`
  1397. // Name: Name of the resource. Provided by the client when the resource
  1398. // is created. The name must be 1-63 characters long, and comply with
  1399. // RFC1035. Specifically, the name must be 1-63 characters long and
  1400. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1401. // the first character must be a lowercase letter, and all following
  1402. // characters must be a dash, lowercase letter, or digit, except the
  1403. // last character, which cannot be a dash.
  1404. Name string `json:"name,omitempty"`
  1405. // Network: The URL of the network in which to reserve the address. This
  1406. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1407. Network string `json:"network,omitempty"`
  1408. // NetworkTier: This signifies the networking tier used for configuring
  1409. // this Address and can only take the following values: PREMIUM,
  1410. // STANDARD. Global forwarding rules can only be Premium Tier. Regional
  1411. // forwarding rules can be either Premium or Standard Tier. Standard
  1412. // Tier addresses applied to regional forwarding rules can be used with
  1413. // any external load balancer. Regional forwarding rules in Premium Tier
  1414. // can only be used with a Network load balancer.
  1415. //
  1416. // If this field is not specified, it is assumed to be PREMIUM.
  1417. //
  1418. // Possible values:
  1419. // "PREMIUM"
  1420. // "SELECT"
  1421. // "STANDARD"
  1422. NetworkTier string `json:"networkTier,omitempty"`
  1423. // PrefixLength: The prefix length if the resource reprensents an IP
  1424. // range.
  1425. PrefixLength int64 `json:"prefixLength,omitempty"`
  1426. // Purpose: The purpose of resource, only used with INTERNAL type.
  1427. //
  1428. // Possible values:
  1429. // "DNS_RESOLVER"
  1430. // "GCE_ENDPOINT"
  1431. // "NAT_AUTO"
  1432. // "VPC_PEERING"
  1433. Purpose string `json:"purpose,omitempty"`
  1434. // Region: [Output Only] URL of the region where the regional address
  1435. // resides. This field is not applicable to global addresses. You must
  1436. // specify this field as part of the HTTP request URL. You cannot set
  1437. // this field in the request body.
  1438. Region string `json:"region,omitempty"`
  1439. // SelfLink: [Output Only] Server-defined URL for the resource.
  1440. SelfLink string `json:"selfLink,omitempty"`
  1441. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  1442. // with the resource id.
  1443. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  1444. // Status: [Output Only] The status of the address, which can be one of
  1445. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1446. // currently in the process of being reserved. A RESERVED address is
  1447. // currently reserved and available to use. An IN_USE address is
  1448. // currently being used by another resource and is not available.
  1449. //
  1450. // Possible values:
  1451. // "IN_USE"
  1452. // "RESERVED"
  1453. // "RESERVING"
  1454. Status string `json:"status,omitempty"`
  1455. // Subnetwork: The URL of the subnetwork in which to reserve the
  1456. // address. If an IP address is specified, it must be within the
  1457. // subnetwork's IP range. This field can only be used with INTERNAL type
  1458. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1459. Subnetwork string `json:"subnetwork,omitempty"`
  1460. // Users: [Output Only] The URLs of the resources that are using this
  1461. // address.
  1462. Users []string `json:"users,omitempty"`
  1463. // ServerResponse contains the HTTP response code and headers from the
  1464. // server.
  1465. googleapi.ServerResponse `json:"-"`
  1466. // ForceSendFields is a list of field names (e.g. "Address") to
  1467. // unconditionally include in API requests. By default, fields with
  1468. // empty values are omitted from API requests. However, any non-pointer,
  1469. // non-interface field appearing in ForceSendFields will be sent to the
  1470. // server regardless of whether the field is empty or not. This may be
  1471. // used to include empty fields in Patch requests.
  1472. ForceSendFields []string `json:"-"`
  1473. // NullFields is a list of field names (e.g. "Address") to include in
  1474. // API requests with the JSON null value. By default, fields with empty
  1475. // values are omitted from API requests. However, any field with an
  1476. // empty value appearing in NullFields will be sent to the server as
  1477. // null. It is an error if a field in this list has a non-empty value.
  1478. // This may be used to include null fields in Patch requests.
  1479. NullFields []string `json:"-"`
  1480. }
  1481. func (s *Address) MarshalJSON() ([]byte, error) {
  1482. type NoMethod Address
  1483. raw := NoMethod(*s)
  1484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1485. }
  1486. type AddressAggregatedList struct {
  1487. // Id: [Output Only] Unique identifier for the resource; defined by the
  1488. // server.
  1489. Id string `json:"id,omitempty"`
  1490. // Items: A list of AddressesScopedList resources.
  1491. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1492. // Kind: [Output Only] Type of resource. Always
  1493. // compute#addressAggregatedList for aggregated lists of addresses.
  1494. Kind string `json:"kind,omitempty"`
  1495. // NextPageToken: [Output Only] This token allows you to get the next
  1496. // page of results for list requests. If the number of results is larger
  1497. // than maxResults, use the nextPageToken as a value for the query
  1498. // parameter pageToken in the next list request. Subsequent list
  1499. // requests will have their own nextPageToken to continue paging through
  1500. // the results.
  1501. NextPageToken string `json:"nextPageToken,omitempty"`
  1502. // SelfLink: [Output Only] Server-defined URL for this resource.
  1503. SelfLink string `json:"selfLink,omitempty"`
  1504. // Warning: [Output Only] Informational warning message.
  1505. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1506. // ServerResponse contains the HTTP response code and headers from the
  1507. // server.
  1508. googleapi.ServerResponse `json:"-"`
  1509. // ForceSendFields is a list of field names (e.g. "Id") to
  1510. // unconditionally include in API requests. By default, fields with
  1511. // empty values are omitted from API requests. However, any non-pointer,
  1512. // non-interface field appearing in ForceSendFields will be sent to the
  1513. // server regardless of whether the field is empty or not. This may be
  1514. // used to include empty fields in Patch requests.
  1515. ForceSendFields []string `json:"-"`
  1516. // NullFields is a list of field names (e.g. "Id") to include in API
  1517. // requests with the JSON null value. By default, fields with empty
  1518. // values are omitted from API requests. However, any field with an
  1519. // empty value appearing in NullFields will be sent to the server as
  1520. // null. It is an error if a field in this list has a non-empty value.
  1521. // This may be used to include null fields in Patch requests.
  1522. NullFields []string `json:"-"`
  1523. }
  1524. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1525. type NoMethod AddressAggregatedList
  1526. raw := NoMethod(*s)
  1527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1528. }
  1529. // AddressAggregatedListWarning: [Output Only] Informational warning
  1530. // message.
  1531. type AddressAggregatedListWarning struct {
  1532. // Code: [Output Only] A warning code, if applicable. For example,
  1533. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1534. // the response.
  1535. //
  1536. // Possible values:
  1537. // "CLEANUP_FAILED"
  1538. // "DEPRECATED_RESOURCE_USED"
  1539. // "DEPRECATED_TYPE_USED"
  1540. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1541. // "EXPERIMENTAL_TYPE_USED"
  1542. // "EXTERNAL_API_WARNING"
  1543. // "FIELD_VALUE_OVERRIDEN"
  1544. // "INJECTED_KERNELS_DEPRECATED"
  1545. // "MISSING_TYPE_DEPENDENCY"
  1546. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1547. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1548. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1549. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1550. // "NEXT_HOP_NOT_RUNNING"
  1551. // "NOT_CRITICAL_ERROR"
  1552. // "NO_RESULTS_ON_PAGE"
  1553. // "REQUIRED_TOS_AGREEMENT"
  1554. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1555. // "RESOURCE_NOT_DELETED"
  1556. // "SCHEMA_VALIDATION_IGNORED"
  1557. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1558. // "UNDECLARED_PROPERTIES"
  1559. // "UNREACHABLE"
  1560. Code string `json:"code,omitempty"`
  1561. // Data: [Output Only] Metadata about this warning in key: value format.
  1562. // For example:
  1563. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1564. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1565. // Message: [Output Only] A human-readable description of the warning
  1566. // code.
  1567. Message string `json:"message,omitempty"`
  1568. // ForceSendFields is a list of field names (e.g. "Code") to
  1569. // unconditionally include in API requests. By default, fields with
  1570. // empty values are omitted from API requests. However, any non-pointer,
  1571. // non-interface field appearing in ForceSendFields will be sent to the
  1572. // server regardless of whether the field is empty or not. This may be
  1573. // used to include empty fields in Patch requests.
  1574. ForceSendFields []string `json:"-"`
  1575. // NullFields is a list of field names (e.g. "Code") to include in API
  1576. // requests with the JSON null value. By default, fields with empty
  1577. // values are omitted from API requests. However, any field with an
  1578. // empty value appearing in NullFields will be sent to the server as
  1579. // null. It is an error if a field in this list has a non-empty value.
  1580. // This may be used to include null fields in Patch requests.
  1581. NullFields []string `json:"-"`
  1582. }
  1583. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1584. type NoMethod AddressAggregatedListWarning
  1585. raw := NoMethod(*s)
  1586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1587. }
  1588. type AddressAggregatedListWarningData struct {
  1589. // Key: [Output Only] A key that provides more detail on the warning
  1590. // being returned. For example, for warnings where there are no results
  1591. // in a list request for a particular zone, this key might be scope and
  1592. // the key value might be the zone name. Other examples might be a key
  1593. // indicating a deprecated resource and a suggested replacement, or a
  1594. // warning about invalid network settings (for example, if an instance
  1595. // attempts to perform IP forwarding but is not enabled for IP
  1596. // forwarding).
  1597. Key string `json:"key,omitempty"`
  1598. // Value: [Output Only] A warning data value corresponding to the key.
  1599. Value string `json:"value,omitempty"`
  1600. // ForceSendFields is a list of field names (e.g. "Key") to
  1601. // unconditionally include in API requests. By default, fields with
  1602. // empty values are omitted from API requests. However, any non-pointer,
  1603. // non-interface field appearing in ForceSendFields will be sent to the
  1604. // server regardless of whether the field is empty or not. This may be
  1605. // used to include empty fields in Patch requests.
  1606. ForceSendFields []string `json:"-"`
  1607. // NullFields is a list of field names (e.g. "Key") to include in API
  1608. // requests with the JSON null value. By default, fields with empty
  1609. // values are omitted from API requests. However, any field with an
  1610. // empty value appearing in NullFields will be sent to the server as
  1611. // null. It is an error if a field in this list has a non-empty value.
  1612. // This may be used to include null fields in Patch requests.
  1613. NullFields []string `json:"-"`
  1614. }
  1615. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1616. type NoMethod AddressAggregatedListWarningData
  1617. raw := NoMethod(*s)
  1618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1619. }
  1620. // AddressList: Contains a list of addresses.
  1621. type AddressList struct {
  1622. // Id: [Output Only] Unique identifier for the resource; defined by the
  1623. // server.
  1624. Id string `json:"id,omitempty"`
  1625. // Items: A list of Address resources.
  1626. Items []*Address `json:"items,omitempty"`
  1627. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1628. // lists of addresses.
  1629. Kind string `json:"kind,omitempty"`
  1630. // NextPageToken: [Output Only] This token allows you to get the next
  1631. // page of results for list requests. If the number of results is larger
  1632. // than maxResults, use the nextPageToken as a value for the query
  1633. // parameter pageToken in the next list request. Subsequent list
  1634. // requests will have their own nextPageToken to continue paging through
  1635. // the results.
  1636. NextPageToken string `json:"nextPageToken,omitempty"`
  1637. // SelfLink: [Output Only] Server-defined URL for this resource.
  1638. SelfLink string `json:"selfLink,omitempty"`
  1639. // Warning: [Output Only] Informational warning message.
  1640. Warning *AddressListWarning `json:"warning,omitempty"`
  1641. // ServerResponse contains the HTTP response code and headers from the
  1642. // server.
  1643. googleapi.ServerResponse `json:"-"`
  1644. // ForceSendFields is a list of field names (e.g. "Id") to
  1645. // unconditionally include in API requests. By default, fields with
  1646. // empty values are omitted from API requests. However, any non-pointer,
  1647. // non-interface field appearing in ForceSendFields will be sent to the
  1648. // server regardless of whether the field is empty or not. This may be
  1649. // used to include empty fields in Patch requests.
  1650. ForceSendFields []string `json:"-"`
  1651. // NullFields is a list of field names (e.g. "Id") to include in API
  1652. // requests with the JSON null value. By default, fields with empty
  1653. // values are omitted from API requests. However, any field with an
  1654. // empty value appearing in NullFields will be sent to the server as
  1655. // null. It is an error if a field in this list has a non-empty value.
  1656. // This may be used to include null fields in Patch requests.
  1657. NullFields []string `json:"-"`
  1658. }
  1659. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1660. type NoMethod AddressList
  1661. raw := NoMethod(*s)
  1662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1663. }
  1664. // AddressListWarning: [Output Only] Informational warning message.
  1665. type AddressListWarning struct {
  1666. // Code: [Output Only] A warning code, if applicable. For example,
  1667. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1668. // the response.
  1669. //
  1670. // Possible values:
  1671. // "CLEANUP_FAILED"
  1672. // "DEPRECATED_RESOURCE_USED"
  1673. // "DEPRECATED_TYPE_USED"
  1674. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1675. // "EXPERIMENTAL_TYPE_USED"
  1676. // "EXTERNAL_API_WARNING"
  1677. // "FIELD_VALUE_OVERRIDEN"
  1678. // "INJECTED_KERNELS_DEPRECATED"
  1679. // "MISSING_TYPE_DEPENDENCY"
  1680. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1681. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1682. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1683. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1684. // "NEXT_HOP_NOT_RUNNING"
  1685. // "NOT_CRITICAL_ERROR"
  1686. // "NO_RESULTS_ON_PAGE"
  1687. // "REQUIRED_TOS_AGREEMENT"
  1688. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1689. // "RESOURCE_NOT_DELETED"
  1690. // "SCHEMA_VALIDATION_IGNORED"
  1691. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1692. // "UNDECLARED_PROPERTIES"
  1693. // "UNREACHABLE"
  1694. Code string `json:"code,omitempty"`
  1695. // Data: [Output Only] Metadata about this warning in key: value format.
  1696. // For example:
  1697. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1698. Data []*AddressListWarningData `json:"data,omitempty"`
  1699. // Message: [Output Only] A human-readable description of the warning
  1700. // code.
  1701. Message string `json:"message,omitempty"`
  1702. // ForceSendFields is a list of field names (e.g. "Code") to
  1703. // unconditionally include in API requests. By default, fields with
  1704. // empty values are omitted from API requests. However, any non-pointer,
  1705. // non-interface field appearing in ForceSendFields will be sent to the
  1706. // server regardless of whether the field is empty or not. This may be
  1707. // used to include empty fields in Patch requests.
  1708. ForceSendFields []string `json:"-"`
  1709. // NullFields is a list of field names (e.g. "Code") to include in API
  1710. // requests with the JSON null value. By default, fields with empty
  1711. // values are omitted from API requests. However, any field with an
  1712. // empty value appearing in NullFields will be sent to the server as
  1713. // null. It is an error if a field in this list has a non-empty value.
  1714. // This may be used to include null fields in Patch requests.
  1715. NullFields []string `json:"-"`
  1716. }
  1717. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1718. type NoMethod AddressListWarning
  1719. raw := NoMethod(*s)
  1720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1721. }
  1722. type AddressListWarningData struct {
  1723. // Key: [Output Only] A key that provides more detail on the warning
  1724. // being returned. For example, for warnings where there are no results
  1725. // in a list request for a particular zone, this key might be scope and
  1726. // the key value might be the zone name. Other examples might be a key
  1727. // indicating a deprecated resource and a suggested replacement, or a
  1728. // warning about invalid network settings (for example, if an instance
  1729. // attempts to perform IP forwarding but is not enabled for IP
  1730. // forwarding).
  1731. Key string `json:"key,omitempty"`
  1732. // Value: [Output Only] A warning data value corresponding to the key.
  1733. Value string `json:"value,omitempty"`
  1734. // ForceSendFields is a list of field names (e.g. "Key") to
  1735. // unconditionally include in API requests. By default, fields with
  1736. // empty values are omitted from API requests. However, any non-pointer,
  1737. // non-interface field appearing in ForceSendFields will be sent to the
  1738. // server regardless of whether the field is empty or not. This may be
  1739. // used to include empty fields in Patch requests.
  1740. ForceSendFields []string `json:"-"`
  1741. // NullFields is a list of field names (e.g. "Key") to include in API
  1742. // requests with the JSON null value. By default, fields with empty
  1743. // values are omitted from API requests. However, any field with an
  1744. // empty value appearing in NullFields will be sent to the server as
  1745. // null. It is an error if a field in this list has a non-empty value.
  1746. // This may be used to include null fields in Patch requests.
  1747. NullFields []string `json:"-"`
  1748. }
  1749. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1750. type NoMethod AddressListWarningData
  1751. raw := NoMethod(*s)
  1752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1753. }
  1754. type AddressesScopedList struct {
  1755. // Addresses: [Output Only] A list of addresses contained in this scope.
  1756. Addresses []*Address `json:"addresses,omitempty"`
  1757. // Warning: [Output Only] Informational warning which replaces the list
  1758. // of addresses when the list is empty.
  1759. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1760. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1761. // unconditionally include in API requests. By default, fields with
  1762. // empty values are omitted from API requests. However, any non-pointer,
  1763. // non-interface field appearing in ForceSendFields will be sent to the
  1764. // server regardless of whether the field is empty or not. This may be
  1765. // used to include empty fields in Patch requests.
  1766. ForceSendFields []string `json:"-"`
  1767. // NullFields is a list of field names (e.g. "Addresses") to include in
  1768. // API requests with the JSON null value. By default, fields with empty
  1769. // values are omitted from API requests. However, any field with an
  1770. // empty value appearing in NullFields will be sent to the server as
  1771. // null. It is an error if a field in this list has a non-empty value.
  1772. // This may be used to include null fields in Patch requests.
  1773. NullFields []string `json:"-"`
  1774. }
  1775. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1776. type NoMethod AddressesScopedList
  1777. raw := NoMethod(*s)
  1778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1779. }
  1780. // AddressesScopedListWarning: [Output Only] Informational warning which
  1781. // replaces the list of addresses when the list is empty.
  1782. type AddressesScopedListWarning struct {
  1783. // Code: [Output Only] A warning code, if applicable. For example,
  1784. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1785. // the response.
  1786. //
  1787. // Possible values:
  1788. // "CLEANUP_FAILED"
  1789. // "DEPRECATED_RESOURCE_USED"
  1790. // "DEPRECATED_TYPE_USED"
  1791. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1792. // "EXPERIMENTAL_TYPE_USED"
  1793. // "EXTERNAL_API_WARNING"
  1794. // "FIELD_VALUE_OVERRIDEN"
  1795. // "INJECTED_KERNELS_DEPRECATED"
  1796. // "MISSING_TYPE_DEPENDENCY"
  1797. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1798. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1799. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1800. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1801. // "NEXT_HOP_NOT_RUNNING"
  1802. // "NOT_CRITICAL_ERROR"
  1803. // "NO_RESULTS_ON_PAGE"
  1804. // "REQUIRED_TOS_AGREEMENT"
  1805. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1806. // "RESOURCE_NOT_DELETED"
  1807. // "SCHEMA_VALIDATION_IGNORED"
  1808. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1809. // "UNDECLARED_PROPERTIES"
  1810. // "UNREACHABLE"
  1811. Code string `json:"code,omitempty"`
  1812. // Data: [Output Only] Metadata about this warning in key: value format.
  1813. // For example:
  1814. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1815. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1816. // Message: [Output Only] A human-readable description of the warning
  1817. // code.
  1818. Message string `json:"message,omitempty"`
  1819. // ForceSendFields is a list of field names (e.g. "Code") to
  1820. // unconditionally include in API requests. By default, fields with
  1821. // empty values are omitted from API requests. However, any non-pointer,
  1822. // non-interface field appearing in ForceSendFields will be sent to the
  1823. // server regardless of whether the field is empty or not. This may be
  1824. // used to include empty fields in Patch requests.
  1825. ForceSendFields []string `json:"-"`
  1826. // NullFields is a list of field names (e.g. "Code") to include in API
  1827. // requests with the JSON null value. By default, fields with empty
  1828. // values are omitted from API requests. However, any field with an
  1829. // empty value appearing in NullFields will be sent to the server as
  1830. // null. It is an error if a field in this list has a non-empty value.
  1831. // This may be used to include null fields in Patch requests.
  1832. NullFields []string `json:"-"`
  1833. }
  1834. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1835. type NoMethod AddressesScopedListWarning
  1836. raw := NoMethod(*s)
  1837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1838. }
  1839. type AddressesScopedListWarningData struct {
  1840. // Key: [Output Only] A key that provides more detail on the warning
  1841. // being returned. For example, for warnings where there are no results
  1842. // in a list request for a particular zone, this key might be scope and
  1843. // the key value might be the zone name. Other examples might be a key
  1844. // indicating a deprecated resource and a suggested replacement, or a
  1845. // warning about invalid network settings (for example, if an instance
  1846. // attempts to perform IP forwarding but is not enabled for IP
  1847. // forwarding).
  1848. Key string `json:"key,omitempty"`
  1849. // Value: [Output Only] A warning data value corresponding to the key.
  1850. Value string `json:"value,omitempty"`
  1851. // ForceSendFields is a list of field names (e.g. "Key") to
  1852. // unconditionally include in API requests. By default, fields with
  1853. // empty values are omitted from API requests. However, any non-pointer,
  1854. // non-interface field appearing in ForceSendFields will be sent to the
  1855. // server regardless of whether the field is empty or not. This may be
  1856. // used to include empty fields in Patch requests.
  1857. ForceSendFields []string `json:"-"`
  1858. // NullFields is a list of field names (e.g. "Key") to include in API
  1859. // requests with the JSON null value. By default, fields with empty
  1860. // values are omitted from API requests. However, any field with an
  1861. // empty value appearing in NullFields will be sent to the server as
  1862. // null. It is an error if a field in this list has a non-empty value.
  1863. // This may be used to include null fields in Patch requests.
  1864. NullFields []string `json:"-"`
  1865. }
  1866. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1867. type NoMethod AddressesScopedListWarningData
  1868. raw := NoMethod(*s)
  1869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1870. }
  1871. // AliasIpRange: An alias IP range attached to an instance's network
  1872. // interface.
  1873. type AliasIpRange struct {
  1874. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1875. // This IP CIDR range must belong to the specified subnetwork and cannot
  1876. // contain IP addresses reserved by system or used by other network
  1877. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1878. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1879. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1880. // SubnetworkRangeName: Optional subnetwork secondary range name
  1881. // specifying the secondary range from which to allocate the IP CIDR
  1882. // range for this alias IP range. If left unspecified, the primary range
  1883. // of the subnetwork will be used.
  1884. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1885. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1886. // unconditionally include in API requests. By default, fields with
  1887. // empty values are omitted from API requests. However, any non-pointer,
  1888. // non-interface field appearing in ForceSendFields will be sent to the
  1889. // server regardless of whether the field is empty or not. This may be
  1890. // used to include empty fields in Patch requests.
  1891. ForceSendFields []string `json:"-"`
  1892. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1893. // in API requests with the JSON null value. By default, fields with
  1894. // empty values are omitted from API requests. However, any field with
  1895. // an empty value appearing in NullFields will be sent to the server as
  1896. // null. It is an error if a field in this list has a non-empty value.
  1897. // This may be used to include null fields in Patch requests.
  1898. NullFields []string `json:"-"`
  1899. }
  1900. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1901. type NoMethod AliasIpRange
  1902. raw := NoMethod(*s)
  1903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1904. }
  1905. // Allocation: Allocation resource
  1906. type Allocation struct {
  1907. // Commitment: [OutputOnly] Full or partial url for parent commitment
  1908. // for allocations which are tied to a commitment.
  1909. Commitment string `json:"commitment,omitempty"`
  1910. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1911. // format.
  1912. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1913. // Description: An optional description of this resource. Provide this
  1914. // property when you create the resource.
  1915. Description string `json:"description,omitempty"`
  1916. // Id: [Output Only] The unique identifier for the resource. This
  1917. // identifier is defined by the server.
  1918. Id uint64 `json:"id,omitempty,string"`
  1919. // Kind: [Output Only] Type of the resource. Always compute#allocations
  1920. // for allocations.
  1921. Kind string `json:"kind,omitempty"`
  1922. // Name: The name of the resource, provided by the client when initially
  1923. // creating the resource. The resource name must be 1-63 characters
  1924. // long, and comply with RFC1035. Specifically, the name must be 1-63
  1925. // characters long and match the regular expression
  1926. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  1927. // a lowercase letter, and all following characters must be a dash,
  1928. // lowercase letter, or digit, except the last character, which cannot
  1929. // be a dash.
  1930. Name string `json:"name,omitempty"`
  1931. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  1932. // resource.
  1933. SelfLink string `json:"selfLink,omitempty"`
  1934. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  1935. // with the resource id.
  1936. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  1937. // SpecificAllocation: Allocation for instances with specific machine
  1938. // shapes.
  1939. SpecificAllocation *AllocationSpecificSKUAllocation `json:"specificAllocation,omitempty"`
  1940. // SpecificAllocationRequired: Indicates whether the allocation can be
  1941. // consumed by VMs with "any allocation" defined. If the field is set,
  1942. // then only VMs that target the allocation by name using
  1943. // --allocation-affinity can consume this allocation.
  1944. SpecificAllocationRequired bool `json:"specificAllocationRequired,omitempty"`
  1945. // Zone: Zone in which the allocation resides, must be provided if
  1946. // allocation is created with commitment creation.
  1947. Zone string `json:"zone,omitempty"`
  1948. // ServerResponse contains the HTTP response code and headers from the
  1949. // server.
  1950. googleapi.ServerResponse `json:"-"`
  1951. // ForceSendFields is a list of field names (e.g. "Commitment") to
  1952. // unconditionally include in API requests. By default, fields with
  1953. // empty values are omitted from API requests. However, any non-pointer,
  1954. // non-interface field appearing in ForceSendFields will be sent to the
  1955. // server regardless of whether the field is empty or not. This may be
  1956. // used to include empty fields in Patch requests.
  1957. ForceSendFields []string `json:"-"`
  1958. // NullFields is a list of field names (e.g. "Commitment") to include in
  1959. // API requests with the JSON null value. By default, fields with empty
  1960. // values are omitted from API requests. However, any field with an
  1961. // empty value appearing in NullFields will be sent to the server as
  1962. // null. It is an error if a field in this list has a non-empty value.
  1963. // This may be used to include null fields in Patch requests.
  1964. NullFields []string `json:"-"`
  1965. }
  1966. func (s *Allocation) MarshalJSON() ([]byte, error) {
  1967. type NoMethod Allocation
  1968. raw := NoMethod(*s)
  1969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1970. }
  1971. // AllocationAffinity: AllocationAffinity is the configuration of
  1972. // desired allocation which this instance could take capacity from.
  1973. type AllocationAffinity struct {
  1974. // Possible values:
  1975. // "ANY_ALLOCATION"
  1976. // "NO_ALLOCATION"
  1977. // "SPECIFIC_ALLOCATION"
  1978. // "UNSPECIFIED"
  1979. ConsumeAllocationType string `json:"consumeAllocationType,omitempty"`
  1980. // Key: Corresponds to the label key of allocation resource.
  1981. Key string `json:"key,omitempty"`
  1982. // Values: Corresponds to the label values of allocation resource.
  1983. Values []string `json:"values,omitempty"`
  1984. // ForceSendFields is a list of field names (e.g.
  1985. // "ConsumeAllocationType") to unconditionally include in API requests.
  1986. // By default, fields with empty values are omitted from API requests.
  1987. // However, any non-pointer, non-interface field appearing in
  1988. // ForceSendFields will be sent to the server regardless of whether the
  1989. // field is empty or not. This may be used to include empty fields in
  1990. // Patch requests.
  1991. ForceSendFields []string `json:"-"`
  1992. // NullFields is a list of field names (e.g. "ConsumeAllocationType") to
  1993. // include in API requests with the JSON null value. By default, fields
  1994. // with empty values are omitted from API requests. However, any field
  1995. // with an empty value appearing in NullFields will be sent to the
  1996. // server as null. It is an error if a field in this list has a
  1997. // non-empty value. This may be used to include null fields in Patch
  1998. // requests.
  1999. NullFields []string `json:"-"`
  2000. }
  2001. func (s *AllocationAffinity) MarshalJSON() ([]byte, error) {
  2002. type NoMethod AllocationAffinity
  2003. raw := NoMethod(*s)
  2004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2005. }
  2006. // AllocationAggregatedList: Contains a list of allocations.
  2007. type AllocationAggregatedList struct {
  2008. // Id: [Output Only] Unique identifier for the resource; defined by the
  2009. // server.
  2010. Id string `json:"id,omitempty"`
  2011. // Items: A list of Allocation resources.
  2012. Items map[string]AllocationsScopedList `json:"items,omitempty"`
  2013. // Kind: Type of resource.
  2014. Kind string `json:"kind,omitempty"`
  2015. // NextPageToken: [Output Only] This token allows you to get the next
  2016. // page of results for list requests. If the number of results is larger
  2017. // than maxResults, use the nextPageToken as a value for the query
  2018. // parameter pageToken in the next list request. Subsequent list
  2019. // requests will have their own nextPageToken to continue paging through
  2020. // the results.
  2021. NextPageToken string `json:"nextPageToken,omitempty"`
  2022. // SelfLink: [Output Only] Server-defined URL for this resource.
  2023. SelfLink string `json:"selfLink,omitempty"`
  2024. // Warning: [Output Only] Informational warning message.
  2025. Warning *AllocationAggregatedListWarning `json:"warning,omitempty"`
  2026. // ServerResponse contains the HTTP response code and headers from the
  2027. // server.
  2028. googleapi.ServerResponse `json:"-"`
  2029. // ForceSendFields is a list of field names (e.g. "Id") to
  2030. // unconditionally include in API requests. By default, fields with
  2031. // empty values are omitted from API requests. However, any non-pointer,
  2032. // non-interface field appearing in ForceSendFields will be sent to the
  2033. // server regardless of whether the field is empty or not. This may be
  2034. // used to include empty fields in Patch requests.
  2035. ForceSendFields []string `json:"-"`
  2036. // NullFields is a list of field names (e.g. "Id") to include in API
  2037. // requests with the JSON null value. By default, fields with empty
  2038. // values are omitted from API requests. However, any field with an
  2039. // empty value appearing in NullFields will be sent to the server as
  2040. // null. It is an error if a field in this list has a non-empty value.
  2041. // This may be used to include null fields in Patch requests.
  2042. NullFields []string `json:"-"`
  2043. }
  2044. func (s *AllocationAggregatedList) MarshalJSON() ([]byte, error) {
  2045. type NoMethod AllocationAggregatedList
  2046. raw := NoMethod(*s)
  2047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2048. }
  2049. // AllocationAggregatedListWarning: [Output Only] Informational warning
  2050. // message.
  2051. type AllocationAggregatedListWarning struct {
  2052. // Code: [Output Only] A warning code, if applicable. For example,
  2053. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2054. // the response.
  2055. //
  2056. // Possible values:
  2057. // "CLEANUP_FAILED"
  2058. // "DEPRECATED_RESOURCE_USED"
  2059. // "DEPRECATED_TYPE_USED"
  2060. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2061. // "EXPERIMENTAL_TYPE_USED"
  2062. // "EXTERNAL_API_WARNING"
  2063. // "FIELD_VALUE_OVERRIDEN"
  2064. // "INJECTED_KERNELS_DEPRECATED"
  2065. // "MISSING_TYPE_DEPENDENCY"
  2066. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2067. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2068. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2069. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2070. // "NEXT_HOP_NOT_RUNNING"
  2071. // "NOT_CRITICAL_ERROR"
  2072. // "NO_RESULTS_ON_PAGE"
  2073. // "REQUIRED_TOS_AGREEMENT"
  2074. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2075. // "RESOURCE_NOT_DELETED"
  2076. // "SCHEMA_VALIDATION_IGNORED"
  2077. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2078. // "UNDECLARED_PROPERTIES"
  2079. // "UNREACHABLE"
  2080. Code string `json:"code,omitempty"`
  2081. // Data: [Output Only] Metadata about this warning in key: value format.
  2082. // For example:
  2083. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2084. Data []*AllocationAggregatedListWarningData `json:"data,omitempty"`
  2085. // Message: [Output Only] A human-readable description of the warning
  2086. // code.
  2087. Message string `json:"message,omitempty"`
  2088. // ForceSendFields is a list of field names (e.g. "Code") to
  2089. // unconditionally include in API requests. By default, fields with
  2090. // empty values are omitted from API requests. However, any non-pointer,
  2091. // non-interface field appearing in ForceSendFields will be sent to the
  2092. // server regardless of whether the field is empty or not. This may be
  2093. // used to include empty fields in Patch requests.
  2094. ForceSendFields []string `json:"-"`
  2095. // NullFields is a list of field names (e.g. "Code") to include in API
  2096. // requests with the JSON null value. By default, fields with empty
  2097. // values are omitted from API requests. However, any field with an
  2098. // empty value appearing in NullFields will be sent to the server as
  2099. // null. It is an error if a field in this list has a non-empty value.
  2100. // This may be used to include null fields in Patch requests.
  2101. NullFields []string `json:"-"`
  2102. }
  2103. func (s *AllocationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2104. type NoMethod AllocationAggregatedListWarning
  2105. raw := NoMethod(*s)
  2106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2107. }
  2108. type AllocationAggregatedListWarningData struct {
  2109. // Key: [Output Only] A key that provides more detail on the warning
  2110. // being returned. For example, for warnings where there are no results
  2111. // in a list request for a particular zone, this key might be scope and
  2112. // the key value might be the zone name. Other examples might be a key
  2113. // indicating a deprecated resource and a suggested replacement, or a
  2114. // warning about invalid network settings (for example, if an instance
  2115. // attempts to perform IP forwarding but is not enabled for IP
  2116. // forwarding).
  2117. Key string `json:"key,omitempty"`
  2118. // Value: [Output Only] A warning data value corresponding to the key.
  2119. Value string `json:"value,omitempty"`
  2120. // ForceSendFields is a list of field names (e.g. "Key") to
  2121. // unconditionally include in API requests. By default, fields with
  2122. // empty values are omitted from API requests. However, any non-pointer,
  2123. // non-interface field appearing in ForceSendFields will be sent to the
  2124. // server regardless of whether the field is empty or not. This may be
  2125. // used to include empty fields in Patch requests.
  2126. ForceSendFields []string `json:"-"`
  2127. // NullFields is a list of field names (e.g. "Key") to include in API
  2128. // requests with the JSON null value. By default, fields with empty
  2129. // values are omitted from API requests. However, any field with an
  2130. // empty value appearing in NullFields will be sent to the server as
  2131. // null. It is an error if a field in this list has a non-empty value.
  2132. // This may be used to include null fields in Patch requests.
  2133. NullFields []string `json:"-"`
  2134. }
  2135. func (s *AllocationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2136. type NoMethod AllocationAggregatedListWarningData
  2137. raw := NoMethod(*s)
  2138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2139. }
  2140. type AllocationList struct {
  2141. // Id: [Output Only] The unique identifier for the resource. This
  2142. // identifier is defined by the server.
  2143. Id string `json:"id,omitempty"`
  2144. // Items: [Output Only] A list of Allocation resources.
  2145. Items []*Allocation `json:"items,omitempty"`
  2146. // Kind: [Output Only] Type of resource.Always compute#allocationsList
  2147. // for listsof allocations
  2148. Kind string `json:"kind,omitempty"`
  2149. // NextPageToken: [Output Only] This token allows you to get the next
  2150. // page of results for list requests. If the number of results is larger
  2151. // than maxResults, use the nextPageToken as a value for the query
  2152. // parameter pageToken in the next list request. Subsequent list
  2153. // requests will have their own nextPageToken to continue paging through
  2154. // the results.
  2155. NextPageToken string `json:"nextPageToken,omitempty"`
  2156. // SelfLink: [Output Only] Server-defined URL for this resource.
  2157. SelfLink string `json:"selfLink,omitempty"`
  2158. // Warning: [Output Only] Informational warning message.
  2159. Warning *AllocationListWarning `json:"warning,omitempty"`
  2160. // ServerResponse contains the HTTP response code and headers from the
  2161. // server.
  2162. googleapi.ServerResponse `json:"-"`
  2163. // ForceSendFields is a list of field names (e.g. "Id") to
  2164. // unconditionally include in API requests. By default, fields with
  2165. // empty values are omitted from API requests. However, any non-pointer,
  2166. // non-interface field appearing in ForceSendFields will be sent to the
  2167. // server regardless of whether the field is empty or not. This may be
  2168. // used to include empty fields in Patch requests.
  2169. ForceSendFields []string `json:"-"`
  2170. // NullFields is a list of field names (e.g. "Id") to include in API
  2171. // requests with the JSON null value. By default, fields with empty
  2172. // values are omitted from API requests. However, any field with an
  2173. // empty value appearing in NullFields will be sent to the server as
  2174. // null. It is an error if a field in this list has a non-empty value.
  2175. // This may be used to include null fields in Patch requests.
  2176. NullFields []string `json:"-"`
  2177. }
  2178. func (s *AllocationList) MarshalJSON() ([]byte, error) {
  2179. type NoMethod AllocationList
  2180. raw := NoMethod(*s)
  2181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2182. }
  2183. // AllocationListWarning: [Output Only] Informational warning message.
  2184. type AllocationListWarning struct {
  2185. // Code: [Output Only] A warning code, if applicable. For example,
  2186. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2187. // the response.
  2188. //
  2189. // Possible values:
  2190. // "CLEANUP_FAILED"
  2191. // "DEPRECATED_RESOURCE_USED"
  2192. // "DEPRECATED_TYPE_USED"
  2193. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2194. // "EXPERIMENTAL_TYPE_USED"
  2195. // "EXTERNAL_API_WARNING"
  2196. // "FIELD_VALUE_OVERRIDEN"
  2197. // "INJECTED_KERNELS_DEPRECATED"
  2198. // "MISSING_TYPE_DEPENDENCY"
  2199. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2200. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2201. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2202. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2203. // "NEXT_HOP_NOT_RUNNING"
  2204. // "NOT_CRITICAL_ERROR"
  2205. // "NO_RESULTS_ON_PAGE"
  2206. // "REQUIRED_TOS_AGREEMENT"
  2207. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2208. // "RESOURCE_NOT_DELETED"
  2209. // "SCHEMA_VALIDATION_IGNORED"
  2210. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2211. // "UNDECLARED_PROPERTIES"
  2212. // "UNREACHABLE"
  2213. Code string `json:"code,omitempty"`
  2214. // Data: [Output Only] Metadata about this warning in key: value format.
  2215. // For example:
  2216. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2217. Data []*AllocationListWarningData `json:"data,omitempty"`
  2218. // Message: [Output Only] A human-readable description of the warning
  2219. // code.
  2220. Message string `json:"message,omitempty"`
  2221. // ForceSendFields is a list of field names (e.g. "Code") to
  2222. // unconditionally include in API requests. By default, fields with
  2223. // empty values are omitted from API requests. However, any non-pointer,
  2224. // non-interface field appearing in ForceSendFields will be sent to the
  2225. // server regardless of whether the field is empty or not. This may be
  2226. // used to include empty fields in Patch requests.
  2227. ForceSendFields []string `json:"-"`
  2228. // NullFields is a list of field names (e.g. "Code") to include in API
  2229. // requests with the JSON null value. By default, fields with empty
  2230. // values are omitted from API requests. However, any field with an
  2231. // empty value appearing in NullFields will be sent to the server as
  2232. // null. It is an error if a field in this list has a non-empty value.
  2233. // This may be used to include null fields in Patch requests.
  2234. NullFields []string `json:"-"`
  2235. }
  2236. func (s *AllocationListWarning) MarshalJSON() ([]byte, error) {
  2237. type NoMethod AllocationListWarning
  2238. raw := NoMethod(*s)
  2239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2240. }
  2241. type AllocationListWarningData struct {
  2242. // Key: [Output Only] A key that provides more detail on the warning
  2243. // being returned. For example, for warnings where there are no results
  2244. // in a list request for a particular zone, this key might be scope and
  2245. // the key value might be the zone name. Other examples might be a key
  2246. // indicating a deprecated resource and a suggested replacement, or a
  2247. // warning about invalid network settings (for example, if an instance
  2248. // attempts to perform IP forwarding but is not enabled for IP
  2249. // forwarding).
  2250. Key string `json:"key,omitempty"`
  2251. // Value: [Output Only] A warning data value corresponding to the key.
  2252. Value string `json:"value,omitempty"`
  2253. // ForceSendFields is a list of field names (e.g. "Key") to
  2254. // unconditionally include in API requests. By default, fields with
  2255. // empty values are omitted from API requests. However, any non-pointer,
  2256. // non-interface field appearing in ForceSendFields will be sent to the
  2257. // server regardless of whether the field is empty or not. This may be
  2258. // used to include empty fields in Patch requests.
  2259. ForceSendFields []string `json:"-"`
  2260. // NullFields is a list of field names (e.g. "Key") to include in API
  2261. // requests with the JSON null value. By default, fields with empty
  2262. // values are omitted from API requests. However, any field with an
  2263. // empty value appearing in NullFields will be sent to the server as
  2264. // null. It is an error if a field in this list has a non-empty value.
  2265. // This may be used to include null fields in Patch requests.
  2266. NullFields []string `json:"-"`
  2267. }
  2268. func (s *AllocationListWarningData) MarshalJSON() ([]byte, error) {
  2269. type NoMethod AllocationListWarningData
  2270. raw := NoMethod(*s)
  2271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2272. }
  2273. // AllocationSpecificSKUAllocation: This allocation type allows to pre
  2274. // allocate specific instance configuration.
  2275. type AllocationSpecificSKUAllocation struct {
  2276. // Count: Specifies number of resources that are allocated.
  2277. Count int64 `json:"count,omitempty,string"`
  2278. // InUseCount: [OutputOnly] Indicates how many resource are in use.
  2279. InUseCount int64 `json:"inUseCount,omitempty,string"`
  2280. // InstanceProperties: The instance properties for this specific sku
  2281. // allocation.
  2282. InstanceProperties *AllocationSpecificSKUAllocationAllocatedInstanceProperties `json:"instanceProperties,omitempty"`
  2283. // ForceSendFields is a list of field names (e.g. "Count") to
  2284. // unconditionally include in API requests. By default, fields with
  2285. // empty values are omitted from API requests. However, any non-pointer,
  2286. // non-interface field appearing in ForceSendFields will be sent to the
  2287. // server regardless of whether the field is empty or not. This may be
  2288. // used to include empty fields in Patch requests.
  2289. ForceSendFields []string `json:"-"`
  2290. // NullFields is a list of field names (e.g. "Count") to include in API
  2291. // requests with the JSON null value. By default, fields with empty
  2292. // values are omitted from API requests. However, any field with an
  2293. // empty value appearing in NullFields will be sent to the server as
  2294. // null. It is an error if a field in this list has a non-empty value.
  2295. // This may be used to include null fields in Patch requests.
  2296. NullFields []string `json:"-"`
  2297. }
  2298. func (s *AllocationSpecificSKUAllocation) MarshalJSON() ([]byte, error) {
  2299. type NoMethod AllocationSpecificSKUAllocation
  2300. raw := NoMethod(*s)
  2301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2302. }
  2303. // AllocationSpecificSKUAllocationAllocatedInstanceProperties:
  2304. // Properties of the SKU instances being reserved.
  2305. type AllocationSpecificSKUAllocationAllocatedInstanceProperties struct {
  2306. // GuestAccelerators: Specifies accelerator type and count.
  2307. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  2308. // LocalSsds: Specifies amount of local ssd to reserve with each
  2309. // instance. The type of disk is local-ssd.
  2310. LocalSsds []*AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk `json:"localSsds,omitempty"`
  2311. // MachineType: Specifies type of machine (name only) which has fixed
  2312. // number of vCPUs and fixed amount of memory. This also includes
  2313. // specifying custom machine type following
  2314. // custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
  2315. MachineType string `json:"machineType,omitempty"`
  2316. // MinCpuPlatform: Minimum cpu platform the allocation.
  2317. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  2318. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  2319. // to unconditionally include in API requests. By default, fields with
  2320. // empty values are omitted from API requests. However, any non-pointer,
  2321. // non-interface field appearing in ForceSendFields will be sent to the
  2322. // server regardless of whether the field is empty or not. This may be
  2323. // used to include empty fields in Patch requests.
  2324. ForceSendFields []string `json:"-"`
  2325. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  2326. // include in API requests with the JSON null value. By default, fields
  2327. // with empty values are omitted from API requests. However, any field
  2328. // with an empty value appearing in NullFields will be sent to the
  2329. // server as null. It is an error if a field in this list has a
  2330. // non-empty value. This may be used to include null fields in Patch
  2331. // requests.
  2332. NullFields []string `json:"-"`
  2333. }
  2334. func (s *AllocationSpecificSKUAllocationAllocatedInstanceProperties) MarshalJSON() ([]byte, error) {
  2335. type NoMethod AllocationSpecificSKUAllocationAllocatedInstanceProperties
  2336. raw := NoMethod(*s)
  2337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2338. }
  2339. type AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk struct {
  2340. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2341. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2342. // Interface: Specifies the disk interface to use for attaching this
  2343. // disk, which is either SCSI or NVME. The default is SCSI. For
  2344. // performance characteristics of SCSI over NVMe, see Local SSD
  2345. // performance.
  2346. //
  2347. // Possible values:
  2348. // "NVDIMM"
  2349. // "NVME"
  2350. // "SCSI"
  2351. Interface string `json:"interface,omitempty"`
  2352. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  2353. // unconditionally include in API requests. By default, fields with
  2354. // empty values are omitted from API requests. However, any non-pointer,
  2355. // non-interface field appearing in ForceSendFields will be sent to the
  2356. // server regardless of whether the field is empty or not. This may be
  2357. // used to include empty fields in Patch requests.
  2358. ForceSendFields []string `json:"-"`
  2359. // NullFields is a list of field names (e.g. "DiskSizeGb") to include in
  2360. // API requests with the JSON null value. By default, fields with empty
  2361. // values are omitted from API requests. However, any field with an
  2362. // empty value appearing in NullFields will be sent to the server as
  2363. // null. It is an error if a field in this list has a non-empty value.
  2364. // This may be used to include null fields in Patch requests.
  2365. NullFields []string `json:"-"`
  2366. }
  2367. func (s *AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk) MarshalJSON() ([]byte, error) {
  2368. type NoMethod AllocationSpecificSKUAllocationAllocatedInstancePropertiesAllocatedDisk
  2369. raw := NoMethod(*s)
  2370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2371. }
  2372. type AllocationsResizeRequest struct {
  2373. // SpecificSkuCount: Number of allocated resources can be resized with
  2374. // minimum = 1 and maximum = 1000.
  2375. SpecificSkuCount int64 `json:"specificSkuCount,omitempty,string"`
  2376. // ForceSendFields is a list of field names (e.g. "SpecificSkuCount") to
  2377. // unconditionally include in API requests. By default, fields with
  2378. // empty values are omitted from API requests. However, any non-pointer,
  2379. // non-interface field appearing in ForceSendFields will be sent to the
  2380. // server regardless of whether the field is empty or not. This may be
  2381. // used to include empty fields in Patch requests.
  2382. ForceSendFields []string `json:"-"`
  2383. // NullFields is a list of field names (e.g. "SpecificSkuCount") to
  2384. // include in API requests with the JSON null value. By default, fields
  2385. // with empty values are omitted from API requests. However, any field
  2386. // with an empty value appearing in NullFields will be sent to the
  2387. // server as null. It is an error if a field in this list has a
  2388. // non-empty value. This may be used to include null fields in Patch
  2389. // requests.
  2390. NullFields []string `json:"-"`
  2391. }
  2392. func (s *AllocationsResizeRequest) MarshalJSON() ([]byte, error) {
  2393. type NoMethod AllocationsResizeRequest
  2394. raw := NoMethod(*s)
  2395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2396. }
  2397. type AllocationsScopedList struct {
  2398. // Allocations: A list of allocations contained in this scope.
  2399. Allocations []*Allocation `json:"allocations,omitempty"`
  2400. // Warning: Informational warning which replaces the list of allocations
  2401. // when the list is empty.
  2402. Warning *AllocationsScopedListWarning `json:"warning,omitempty"`
  2403. // ForceSendFields is a list of field names (e.g. "Allocations") to
  2404. // unconditionally include in API requests. By default, fields with
  2405. // empty values are omitted from API requests. However, any non-pointer,
  2406. // non-interface field appearing in ForceSendFields will be sent to the
  2407. // server regardless of whether the field is empty or not. This may be
  2408. // used to include empty fields in Patch requests.
  2409. ForceSendFields []string `json:"-"`
  2410. // NullFields is a list of field names (e.g. "Allocations") to include
  2411. // in API requests with the JSON null value. By default, fields with
  2412. // empty values are omitted from API requests. However, any field with
  2413. // an empty value appearing in NullFields will be sent to the server as
  2414. // null. It is an error if a field in this list has a non-empty value.
  2415. // This may be used to include null fields in Patch requests.
  2416. NullFields []string `json:"-"`
  2417. }
  2418. func (s *AllocationsScopedList) MarshalJSON() ([]byte, error) {
  2419. type NoMethod AllocationsScopedList
  2420. raw := NoMethod(*s)
  2421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2422. }
  2423. // AllocationsScopedListWarning: Informational warning which replaces
  2424. // the list of allocations when the list is empty.
  2425. type AllocationsScopedListWarning struct {
  2426. // Code: [Output Only] A warning code, if applicable. For example,
  2427. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2428. // the response.
  2429. //
  2430. // Possible values:
  2431. // "CLEANUP_FAILED"
  2432. // "DEPRECATED_RESOURCE_USED"
  2433. // "DEPRECATED_TYPE_USED"
  2434. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2435. // "EXPERIMENTAL_TYPE_USED"
  2436. // "EXTERNAL_API_WARNING"
  2437. // "FIELD_VALUE_OVERRIDEN"
  2438. // "INJECTED_KERNELS_DEPRECATED"
  2439. // "MISSING_TYPE_DEPENDENCY"
  2440. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2441. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2442. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2443. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2444. // "NEXT_HOP_NOT_RUNNING"
  2445. // "NOT_CRITICAL_ERROR"
  2446. // "NO_RESULTS_ON_PAGE"
  2447. // "REQUIRED_TOS_AGREEMENT"
  2448. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2449. // "RESOURCE_NOT_DELETED"
  2450. // "SCHEMA_VALIDATION_IGNORED"
  2451. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2452. // "UNDECLARED_PROPERTIES"
  2453. // "UNREACHABLE"
  2454. Code string `json:"code,omitempty"`
  2455. // Data: [Output Only] Metadata about this warning in key: value format.
  2456. // For example:
  2457. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2458. Data []*AllocationsScopedListWarningData `json:"data,omitempty"`
  2459. // Message: [Output Only] A human-readable description of the warning
  2460. // code.
  2461. Message string `json:"message,omitempty"`
  2462. // ForceSendFields is a list of field names (e.g. "Code") to
  2463. // unconditionally include in API requests. By default, fields with
  2464. // empty values are omitted from API requests. However, any non-pointer,
  2465. // non-interface field appearing in ForceSendFields will be sent to the
  2466. // server regardless of whether the field is empty or not. This may be
  2467. // used to include empty fields in Patch requests.
  2468. ForceSendFields []string `json:"-"`
  2469. // NullFields is a list of field names (e.g. "Code") to include in API
  2470. // requests with the JSON null value. By default, fields with empty
  2471. // values are omitted from API requests. However, any field with an
  2472. // empty value appearing in NullFields will be sent to the server as
  2473. // null. It is an error if a field in this list has a non-empty value.
  2474. // This may be used to include null fields in Patch requests.
  2475. NullFields []string `json:"-"`
  2476. }
  2477. func (s *AllocationsScopedListWarning) MarshalJSON() ([]byte, error) {
  2478. type NoMethod AllocationsScopedListWarning
  2479. raw := NoMethod(*s)
  2480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2481. }
  2482. type AllocationsScopedListWarningData struct {
  2483. // Key: [Output Only] A key that provides more detail on the warning
  2484. // being returned. For example, for warnings where there are no results
  2485. // in a list request for a particular zone, this key might be scope and
  2486. // the key value might be the zone name. Other examples might be a key
  2487. // indicating a deprecated resource and a suggested replacement, or a
  2488. // warning about invalid network settings (for example, if an instance
  2489. // attempts to perform IP forwarding but is not enabled for IP
  2490. // forwarding).
  2491. Key string `json:"key,omitempty"`
  2492. // Value: [Output Only] A warning data value corresponding to the key.
  2493. Value string `json:"value,omitempty"`
  2494. // ForceSendFields is a list of field names (e.g. "Key") to
  2495. // unconditionally include in API requests. By default, fields with
  2496. // empty values are omitted from API requests. However, any non-pointer,
  2497. // non-interface field appearing in ForceSendFields will be sent to the
  2498. // server regardless of whether the field is empty or not. This may be
  2499. // used to include empty fields in Patch requests.
  2500. ForceSendFields []string `json:"-"`
  2501. // NullFields is a list of field names (e.g. "Key") to include in API
  2502. // requests with the JSON null value. By default, fields with empty
  2503. // values are omitted from API requests. However, any field with an
  2504. // empty value appearing in NullFields will be sent to the server as
  2505. // null. It is an error if a field in this list has a non-empty value.
  2506. // This may be used to include null fields in Patch requests.
  2507. NullFields []string `json:"-"`
  2508. }
  2509. func (s *AllocationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  2510. type NoMethod AllocationsScopedListWarningData
  2511. raw := NoMethod(*s)
  2512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2513. }
  2514. // AttachedDisk: An instance-attached disk resource.
  2515. type AttachedDisk struct {
  2516. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  2517. // instance is deleted (but not when the disk is detached from the
  2518. // instance).
  2519. AutoDelete bool `json:"autoDelete,omitempty"`
  2520. // Boot: Indicates that this is a boot disk. The virtual machine will
  2521. // use the first partition of the disk for its root filesystem.
  2522. Boot bool `json:"boot,omitempty"`
  2523. // DeviceName: Specifies a unique device name of your choice that is
  2524. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  2525. // system running within the instance. This name can be used to
  2526. // reference the device for mounting, resizing, and so on, from within
  2527. // the instance.
  2528. //
  2529. // If not specified, the server chooses a default device name to apply
  2530. // to this disk, in the form persistent-disk-x, where x is a number
  2531. // assigned by Google Compute Engine. This field is only applicable for
  2532. // persistent disks.
  2533. DeviceName string `json:"deviceName,omitempty"`
  2534. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  2535. // customer-supplied encryption key.
  2536. //
  2537. // If you are creating a new disk, this field encrypts the new disk
  2538. // using an encryption key that you provide. If you are attaching an
  2539. // existing disk that is already encrypted, this field decrypts the disk
  2540. // using the customer-supplied encryption key.
  2541. //
  2542. // If you encrypt a disk using a customer-supplied key, you must provide
  2543. // the same key again when you attempt to use this resource at a later
  2544. // time. For example, you must provide the key when you create a
  2545. // snapshot or an image from the disk or when you attach the disk to a
  2546. // virtual machine instance.
  2547. //
  2548. // If you do not provide an encryption key, then the disk will be
  2549. // encrypted using an automatically generated key and you do not need to
  2550. // provide a key to use the disk later.
  2551. //
  2552. // Instance templates do not store customer-supplied encryption keys, so
  2553. // you cannot use your own keys to encrypt disks in a managed instance
  2554. // group.
  2555. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  2556. // DiskSizeGb: The size of the disk in base-2 GB. This supersedes
  2557. // disk_size_gb in InitializeParams.
  2558. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2559. // GuestOsFeatures: A list of features to enable on the guest operating
  2560. // system. Applicable only for bootable images. Read Enabling guest
  2561. // operating system features to see a list of available options.
  2562. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  2563. // Index: [Output Only] A zero-based index to this disk, where 0 is
  2564. // reserved for the boot disk. If you have many disks attached to an
  2565. // instance, each disk would have a unique index number.
  2566. Index int64 `json:"index,omitempty"`
  2567. // InitializeParams: [Input Only] Specifies the parameters for a new
  2568. // disk that will be created alongside the new instance. Use
  2569. // initialization parameters to create boot disks or local SSDs attached
  2570. // to the new instance.
  2571. //
  2572. // This property is mutually exclusive with the source property; you can
  2573. // only define one or the other, but not both.
  2574. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  2575. // Interface: Specifies the disk interface to use for attaching this
  2576. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  2577. // disks must always use SCSI and the request will fail if you attempt
  2578. // to attach a persistent disk in any other format than SCSI. Local SSDs
  2579. // can use either NVME or SCSI. For performance characteristics of SCSI
  2580. // over NVMe, see Local SSD performance.
  2581. //
  2582. // Possible values:
  2583. // "NVDIMM"
  2584. // "NVME"
  2585. // "SCSI"
  2586. Interface string `json:"interface,omitempty"`
  2587. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  2588. // for attached disks.
  2589. Kind string `json:"kind,omitempty"`
  2590. // Licenses: [Output Only] Any valid publicly visible licenses.
  2591. Licenses []string `json:"licenses,omitempty"`
  2592. // Mode: The mode in which to attach this disk, either READ_WRITE or
  2593. // READ_ONLY. If not specified, the default is to attach the disk in
  2594. // READ_WRITE mode.
  2595. //
  2596. // Possible values:
  2597. // "READ_ONLY"
  2598. // "READ_WRITE"
  2599. Mode string `json:"mode,omitempty"`
  2600. // SavedState: For LocalSSD disks on VM Instances in STOPPED or
  2601. // SUSPENDED state, this field is set to PRESERVED if the LocalSSD data
  2602. // has been saved to a persistent location by customer request. (see the
  2603. // discard_local_ssd option on Stop/Suspend). Read-only in the api.
  2604. //
  2605. // Possible values:
  2606. // "DISK_SAVED_STATE_UNSPECIFIED"
  2607. // "PRESERVED"
  2608. SavedState string `json:"savedState,omitempty"`
  2609. // Source: Specifies a valid partial or full URL to an existing
  2610. // Persistent Disk resource. When creating a new instance, one of
  2611. // initializeParams.sourceImage or disks.source is required except for
  2612. // local SSD.
  2613. //
  2614. // If desired, you can also attach existing non-root persistent disks
  2615. // using this property. This field is only applicable for persistent
  2616. // disks.
  2617. //
  2618. // Note that for InstanceTemplate, specify the disk name, not the URL
  2619. // for the disk.
  2620. Source string `json:"source,omitempty"`
  2621. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  2622. // If not specified, the default is PERSISTENT.
  2623. //
  2624. // Possible values:
  2625. // "PERSISTENT"
  2626. // "SCRATCH"
  2627. Type string `json:"type,omitempty"`
  2628. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  2629. // unconditionally include in API requests. By default, fields with
  2630. // empty values are omitted from API requests. However, any non-pointer,
  2631. // non-interface field appearing in ForceSendFields will be sent to the
  2632. // server regardless of whether the field is empty or not. This may be
  2633. // used to include empty fields in Patch requests.
  2634. ForceSendFields []string `json:"-"`
  2635. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  2636. // API requests with the JSON null value. By default, fields with empty
  2637. // values are omitted from API requests. However, any field with an
  2638. // empty value appearing in NullFields will be sent to the server as
  2639. // null. It is an error if a field in this list has a non-empty value.
  2640. // This may be used to include null fields in Patch requests.
  2641. NullFields []string `json:"-"`
  2642. }
  2643. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  2644. type NoMethod AttachedDisk
  2645. raw := NoMethod(*s)
  2646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2647. }
  2648. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  2649. // for a new disk that will be created alongside the new instance. Use
  2650. // initialization parameters to create boot disks or local SSDs attached
  2651. // to the new instance.
  2652. //
  2653. // This property is mutually exclusive with the source property; you can
  2654. // only define one or the other, but not both.
  2655. type AttachedDiskInitializeParams struct {
  2656. // Description: An optional description. Provide this property when
  2657. // creating the disk.
  2658. Description string `json:"description,omitempty"`
  2659. // DiskName: Specifies the disk name. If not specified, the default is
  2660. // to use the name of the instance. If the disk with the instance name
  2661. // exists already in the given zone/region, a new name will be
  2662. // automatically generated.
  2663. DiskName string `json:"diskName,omitempty"`
  2664. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  2665. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  2666. // DiskType: Specifies the disk type to use to create the instance. If
  2667. // not specified, the default is pd-standard, specified using the full
  2668. // URL. For
  2669. // example:
  2670. // https://www.googleapis.com/compute/v1/projects/project/zones/
  2671. // zone/diskTypes/pd-standard
  2672. //
  2673. //
  2674. // Other values include pd-ssd and local-ssd. If you define this field,
  2675. // you can provide either the full or partial URL. For example, the
  2676. // following are valid values:
  2677. // -
  2678. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  2679. // - projects/project/zones/zone/diskTypes/diskType
  2680. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  2681. // is the name of the disk type, not URL.
  2682. DiskType string `json:"diskType,omitempty"`
  2683. // GuestOsFeatures: A list of features to enable on the guest operating
  2684. // system. Applicable only for bootable images. Read Enabling guest
  2685. // operating system features to see a list of available options.
  2686. //
  2687. // Guest OS features are applied by merging
  2688. // initializeParams.guestOsFeatures and disks.guestOsFeatures
  2689. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  2690. // Labels: Labels to apply to this disk. These can be later modified by
  2691. // the disks.setLabels method. This field is only applicable for
  2692. // persistent disks.
  2693. Labels map[string]string `json:"labels,omitempty"`
  2694. // ReplicaZones: URLs of the zones where the disk should be replicated
  2695. // to. Only applicable for regional resources.
  2696. ReplicaZones []string `json:"replicaZones,omitempty"`
  2697. // SourceImage: The source image to create this disk. When creating a
  2698. // new instance, one of initializeParams.sourceImage or disks.source is
  2699. // required except for local SSD.
  2700. //
  2701. // To create a disk with one of the public operating system images,
  2702. // specify the image by its family name. For example, specify
  2703. // family/debian-9 to use the latest Debian 9
  2704. // image:
  2705. // projects/debian-cloud/global/images/family/debian-9
  2706. //
  2707. //
  2708. // Alternati
  2709. // vely, use a specific version of a public operating system
  2710. // image:
  2711. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  2712. //
  2713. //
  2714. //
  2715. // To create a disk with a custom image that you created, specify the
  2716. // image name in the following
  2717. // format:
  2718. // global/images/my-custom-image
  2719. //
  2720. //
  2721. // You can also specify a custom image by its image family, which
  2722. // returns the latest version of the image in that family. Replace the
  2723. // image name with
  2724. // family/family-name:
  2725. // global/images/family/my-image-family
  2726. //
  2727. //
  2728. // If the source image is deleted later, this field will not be set.
  2729. SourceImage string `json:"sourceImage,omitempty"`
  2730. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  2731. // source image. Required if the source image is protected by a
  2732. // customer-supplied encryption key.
  2733. //
  2734. // Instance templates do not store customer-supplied encryption keys, so
  2735. // you cannot create disks for instances in a managed instance group if
  2736. // the source images are encrypted with your own keys.
  2737. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  2738. // SourceSnapshot: The source snapshot to create this disk. When
  2739. // creating a new instance, one of initializeParams.sourceSnapshot or
  2740. // disks.source is required except for local SSD.
  2741. //
  2742. // To create a disk with a snapshot that you created, specify the
  2743. // snapshot name in the following
  2744. // format:
  2745. // global/snapshots/my-backup
  2746. //
  2747. //
  2748. // If the source snapshot is deleted later, this field will not be set.
  2749. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  2750. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  2751. // the source snapshot.
  2752. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  2753. // ForceSendFields is a list of field names (e.g. "Description") to
  2754. // unconditionally include in API requests. By default, fields with
  2755. // empty values are omitted from API requests. However, any non-pointer,
  2756. // non-interface field appearing in ForceSendFields will be sent to the
  2757. // server regardless of whether the field is empty or not. This may be
  2758. // used to include empty fields in Patch requests.
  2759. ForceSendFields []string `json:"-"`
  2760. // NullFields is a list of field names (e.g. "Description") to include
  2761. // in API requests with the JSON null value. By default, fields with
  2762. // empty values are omitted from API requests. However, any field with
  2763. // an empty value appearing in NullFields will be sent to the server as
  2764. // null. It is an error if a field in this list has a non-empty value.
  2765. // This may be used to include null fields in Patch requests.
  2766. NullFields []string `json:"-"`
  2767. }
  2768. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  2769. type NoMethod AttachedDiskInitializeParams
  2770. raw := NoMethod(*s)
  2771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2772. }
  2773. // AuditConfig: Specifies the audit configuration for a service. The
  2774. // configuration determines which permission types are logged, and what
  2775. // identities, if any, are exempted from logging. An AuditConfig must
  2776. // have one or more AuditLogConfigs.
  2777. //
  2778. // If there are AuditConfigs for both `allServices` and a specific
  2779. // service, the union of the two AuditConfigs is used for that service:
  2780. // the log_types specified in each AuditConfig are enabled, and the
  2781. // exempted_members in each AuditLogConfig are exempted.
  2782. //
  2783. // Example Policy with multiple AuditConfigs:
  2784. //
  2785. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  2786. // [ { "log_type": "DATA_READ", "exempted_members": [
  2787. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  2788. // "log_type": "ADMIN_READ", } ] }, { "service":
  2789. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  2790. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  2791. // "user:bar@gmail.com" ] } ] } ] }
  2792. //
  2793. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  2794. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  2795. // logging, and bar@gmail.com from DATA_WRITE logging.
  2796. type AuditConfig struct {
  2797. // AuditLogConfigs: The configuration for logging of each type of
  2798. // permission.
  2799. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  2800. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2801. // Service: Specifies a service that will be enabled for audit logging.
  2802. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  2803. // `allServices` is a special value that covers all services.
  2804. Service string `json:"service,omitempty"`
  2805. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  2806. // unconditionally include in API requests. By default, fields with
  2807. // empty values are omitted from API requests. However, any non-pointer,
  2808. // non-interface field appearing in ForceSendFields will be sent to the
  2809. // server regardless of whether the field is empty or not. This may be
  2810. // used to include empty fields in Patch requests.
  2811. ForceSendFields []string `json:"-"`
  2812. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2813. // include in API requests with the JSON null value. By default, fields
  2814. // with empty values are omitted from API requests. However, any field
  2815. // with an empty value appearing in NullFields will be sent to the
  2816. // server as null. It is an error if a field in this list has a
  2817. // non-empty value. This may be used to include null fields in Patch
  2818. // requests.
  2819. NullFields []string `json:"-"`
  2820. }
  2821. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  2822. type NoMethod AuditConfig
  2823. raw := NoMethod(*s)
  2824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2825. }
  2826. // AuditLogConfig: Provides the configuration for logging a type of
  2827. // permissions. Example:
  2828. //
  2829. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  2830. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  2831. // "DATA_WRITE", } ] }
  2832. //
  2833. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  2834. // foo@gmail.com from DATA_READ logging.
  2835. type AuditLogConfig struct {
  2836. // ExemptedMembers: Specifies the identities that do not cause logging
  2837. // for this type of permission. Follows the same format of
  2838. // [Binding.members][].
  2839. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2840. // LogType: The log type that this config enables.
  2841. //
  2842. // Possible values:
  2843. // "ADMIN_READ"
  2844. // "DATA_READ"
  2845. // "DATA_WRITE"
  2846. // "LOG_TYPE_UNSPECIFIED"
  2847. LogType string `json:"logType,omitempty"`
  2848. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2849. // unconditionally include in API requests. By default, fields with
  2850. // empty values are omitted from API requests. However, any non-pointer,
  2851. // non-interface field appearing in ForceSendFields will be sent to the
  2852. // server regardless of whether the field is empty or not. This may be
  2853. // used to include empty fields in Patch requests.
  2854. ForceSendFields []string `json:"-"`
  2855. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2856. // include in API requests with the JSON null value. By default, fields
  2857. // with empty values are omitted from API requests. However, any field
  2858. // with an empty value appearing in NullFields will be sent to the
  2859. // server as null. It is an error if a field in this list has a
  2860. // non-empty value. This may be used to include null fields in Patch
  2861. // requests.
  2862. NullFields []string `json:"-"`
  2863. }
  2864. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2865. type NoMethod AuditLogConfig
  2866. raw := NoMethod(*s)
  2867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2868. }
  2869. // AuthenticationPolicy: The authentication settings for the backend
  2870. // service.
  2871. type AuthenticationPolicy struct {
  2872. // Origins: List of authentication methods that can be used for origin
  2873. // authentication. Similar to peers, these will be evaluated in order
  2874. // the first valid one will be used to set origin identity. If none of
  2875. // these methods pass, the request will be rejected with authentication
  2876. // failed error (401). Leave the list empty if origin authentication is
  2877. // not required.
  2878. Origins []*OriginAuthenticationMethod `json:"origins,omitempty"`
  2879. // Peers: List of authentication methods that can be used for peer
  2880. // authentication. They will be evaluated in order the first valid one
  2881. // will be used to set peer identity. If none of these methods pass, the
  2882. // request will be rejected with authentication failed error (401).
  2883. // Leave the list empty if peer authentication is not required.
  2884. Peers []*PeerAuthenticationMethod `json:"peers,omitempty"`
  2885. // PrincipalBinding: Define whether peer or origin identity should be
  2886. // used for principal. Default value is USE_PEER. If peer (or origin)
  2887. // identity is not available, either because peer/origin authentication
  2888. // is not defined, or failed, principal will be left unset. In other
  2889. // words, binding rule does not affect the decision to accept or reject
  2890. // request. This field can be set to one of the following: USE_PEER:
  2891. // Principal will be set to the identity from peer authentication.
  2892. // USE_ORIGIN: Principal will be set to the identity from origin
  2893. // authentication.
  2894. //
  2895. // Possible values:
  2896. // "INVALID"
  2897. // "USE_ORIGIN"
  2898. // "USE_PEER"
  2899. PrincipalBinding string `json:"principalBinding,omitempty"`
  2900. // ServerTlsContext: Configures the mechanism to obtain server-side
  2901. // security certificates and identity information.
  2902. ServerTlsContext *TlsContext `json:"serverTlsContext,omitempty"`
  2903. // ForceSendFields is a list of field names (e.g. "Origins") to
  2904. // unconditionally include in API requests. By default, fields with
  2905. // empty values are omitted from API requests. However, any non-pointer,
  2906. // non-interface field appearing in ForceSendFields will be sent to the
  2907. // server regardless of whether the field is empty or not. This may be
  2908. // used to include empty fields in Patch requests.
  2909. ForceSendFields []string `json:"-"`
  2910. // NullFields is a list of field names (e.g. "Origins") to include in
  2911. // API requests with the JSON null value. By default, fields with empty
  2912. // values are omitted from API requests. However, any field with an
  2913. // empty value appearing in NullFields will be sent to the server as
  2914. // null. It is an error if a field in this list has a non-empty value.
  2915. // This may be used to include null fields in Patch requests.
  2916. NullFields []string `json:"-"`
  2917. }
  2918. func (s *AuthenticationPolicy) MarshalJSON() ([]byte, error) {
  2919. type NoMethod AuthenticationPolicy
  2920. raw := NoMethod(*s)
  2921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2922. }
  2923. // AuthorizationConfig: Authorization configuration provides
  2924. // service-level and method-level access control for a service.
  2925. type AuthorizationConfig struct {
  2926. // Policies: List of RbacPolicies.
  2927. Policies []*RbacPolicy `json:"policies,omitempty"`
  2928. // ForceSendFields is a list of field names (e.g. "Policies") to
  2929. // unconditionally include in API requests. By default, fields with
  2930. // empty values are omitted from API requests. However, any non-pointer,
  2931. // non-interface field appearing in ForceSendFields will be sent to the
  2932. // server regardless of whether the field is empty or not. This may be
  2933. // used to include empty fields in Patch requests.
  2934. ForceSendFields []string `json:"-"`
  2935. // NullFields is a list of field names (e.g. "Policies") to include in
  2936. // API requests with the JSON null value. By default, fields with empty
  2937. // values are omitted from API requests. However, any field with an
  2938. // empty value appearing in NullFields will be sent to the server as
  2939. // null. It is an error if a field in this list has a non-empty value.
  2940. // This may be used to include null fields in Patch requests.
  2941. NullFields []string `json:"-"`
  2942. }
  2943. func (s *AuthorizationConfig) MarshalJSON() ([]byte, error) {
  2944. type NoMethod AuthorizationConfig
  2945. raw := NoMethod(*s)
  2946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2947. }
  2948. // AuthorizationLoggingOptions: Authorization-related information used
  2949. // by Cloud Audit Logging.
  2950. type AuthorizationLoggingOptions struct {
  2951. // PermissionType: The type of the permission that was checked.
  2952. //
  2953. // Possible values:
  2954. // "ADMIN_READ"
  2955. // "ADMIN_WRITE"
  2956. // "DATA_READ"
  2957. // "DATA_WRITE"
  2958. // "PERMISSION_TYPE_UNSPECIFIED"
  2959. PermissionType string `json:"permissionType,omitempty"`
  2960. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2961. // unconditionally include in API requests. By default, fields with
  2962. // empty values are omitted from API requests. However, any non-pointer,
  2963. // non-interface field appearing in ForceSendFields will be sent to the
  2964. // server regardless of whether the field is empty or not. This may be
  2965. // used to include empty fields in Patch requests.
  2966. ForceSendFields []string `json:"-"`
  2967. // NullFields is a list of field names (e.g. "PermissionType") to
  2968. // include in API requests with the JSON null value. By default, fields
  2969. // with empty values are omitted from API requests. However, any field
  2970. // with an empty value appearing in NullFields will be sent to the
  2971. // server as null. It is an error if a field in this list has a
  2972. // non-empty value. This may be used to include null fields in Patch
  2973. // requests.
  2974. NullFields []string `json:"-"`
  2975. }
  2976. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2977. type NoMethod AuthorizationLoggingOptions
  2978. raw := NoMethod(*s)
  2979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2980. }
  2981. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2982. // to automatically scale virtual machine instances in managed instance
  2983. // groups according to an autoscaling policy that you define. For more
  2984. // information, read Autoscaling Groups of Instances. (== resource_for
  2985. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2986. // resource_for beta.regionAutoscalers ==) (== resource_for
  2987. // v1.regionAutoscalers ==)
  2988. type Autoscaler struct {
  2989. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2990. // algorithm. You can define one or more of the policies for an
  2991. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2992. // loadBalancingUtilization.
  2993. //
  2994. // If none of these are specified, the default will be to autoscale
  2995. // based on cpuUtilization to 0.6 or 60%.
  2996. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2997. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2998. // format.
  2999. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3000. // Description: An optional description of this resource. Provide this
  3001. // property when you create the resource.
  3002. Description string `json:"description,omitempty"`
  3003. // Id: [Output Only] The unique identifier for the resource. This
  3004. // identifier is defined by the server.
  3005. Id uint64 `json:"id,omitempty,string"`
  3006. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  3007. // for autoscalers.
  3008. Kind string `json:"kind,omitempty"`
  3009. // Name: Name of the resource. Provided by the client when the resource
  3010. // is created. The name must be 1-63 characters long, and comply with
  3011. // RFC1035. Specifically, the name must be 1-63 characters long and
  3012. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3013. // the first character must be a lowercase letter, and all following
  3014. // characters must be a dash, lowercase letter, or digit, except the
  3015. // last character, which cannot be a dash.
  3016. Name string `json:"name,omitempty"`
  3017. // RecommendedSize: [Output Only] Target recommended MIG size (number of
  3018. // instances) computed by autoscaler. Autoscaler calculates recommended
  3019. // MIG size even when autoscaling policy mode is different from ON. This
  3020. // field is empty when autoscaler is not connected to the existing
  3021. // managed instance group or autoscaler did not generate its prediction.
  3022. RecommendedSize int64 `json:"recommendedSize,omitempty"`
  3023. // Region: [Output Only] URL of the region where the instance group
  3024. // resides (for autoscalers living in regional scope).
  3025. Region string `json:"region,omitempty"`
  3026. // SelfLink: [Output Only] Server-defined URL for the resource.
  3027. SelfLink string `json:"selfLink,omitempty"`
  3028. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  3029. // with the resource id.
  3030. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  3031. // Status: [Output Only] The status of the autoscaler configuration.
  3032. //
  3033. // Possible values:
  3034. // "ACTIVE"
  3035. // "DELETING"
  3036. // "ERROR"
  3037. // "PENDING"
  3038. Status string `json:"status,omitempty"`
  3039. // StatusDetails: [Output Only] Human-readable details about the current
  3040. // state of the autoscaler. Read the documentation for Commonly returned
  3041. // status messages for examples of status messages you might encounter.
  3042. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  3043. // Target: URL of the managed instance group that this autoscaler will
  3044. // scale.
  3045. Target string `json:"target,omitempty"`
  3046. // Zone: [Output Only] URL of the zone where the instance group resides
  3047. // (for autoscalers living in zonal scope).
  3048. Zone string `json:"zone,omitempty"`
  3049. // ServerResponse contains the HTTP response code and headers from the
  3050. // server.
  3051. googleapi.ServerResponse `json:"-"`
  3052. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  3053. // to unconditionally include in API requests. By default, fields with
  3054. // empty values are omitted from API requests. However, any non-pointer,
  3055. // non-interface field appearing in ForceSendFields will be sent to the
  3056. // server regardless of whether the field is empty or not. This may be
  3057. // used to include empty fields in Patch requests.
  3058. ForceSendFields []string `json:"-"`
  3059. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  3060. // include in API requests with the JSON null value. By default, fields
  3061. // with empty values are omitted from API requests. However, any field
  3062. // with an empty value appearing in NullFields will be sent to the
  3063. // server as null. It is an error if a field in this list has a
  3064. // non-empty value. This may be used to include null fields in Patch
  3065. // requests.
  3066. NullFields []string `json:"-"`
  3067. }
  3068. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  3069. type NoMethod Autoscaler
  3070. raw := NoMethod(*s)
  3071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3072. }
  3073. type AutoscalerAggregatedList struct {
  3074. // Id: [Output Only] Unique identifier for the resource; defined by the
  3075. // server.
  3076. Id string `json:"id,omitempty"`
  3077. // Items: A list of AutoscalersScopedList resources.
  3078. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  3079. // Kind: [Output Only] Type of resource. Always
  3080. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  3081. Kind string `json:"kind,omitempty"`
  3082. // NextPageToken: [Output Only] This token allows you to get the next
  3083. // page of results for list requests. If the number of results is larger
  3084. // than maxResults, use the nextPageToken as a value for the query
  3085. // parameter pageToken in the next list request. Subsequent list
  3086. // requests will have their own nextPageToken to continue paging through
  3087. // the results.
  3088. NextPageToken string `json:"nextPageToken,omitempty"`
  3089. // SelfLink: [Output Only] Server-defined URL for this resource.
  3090. SelfLink string `json:"selfLink,omitempty"`
  3091. // Warning: [Output Only] Informational warning message.
  3092. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  3093. // ServerResponse contains the HTTP response code and headers from the
  3094. // server.
  3095. googleapi.ServerResponse `json:"-"`
  3096. // ForceSendFields is a list of field names (e.g. "Id") to
  3097. // unconditionally include in API requests. By default, fields with
  3098. // empty values are omitted from API requests. However, any non-pointer,
  3099. // non-interface field appearing in ForceSendFields will be sent to the
  3100. // server regardless of whether the field is empty or not. This may be
  3101. // used to include empty fields in Patch requests.
  3102. ForceSendFields []string `json:"-"`
  3103. // NullFields is a list of field names (e.g. "Id") to include in API
  3104. // requests with the JSON null value. By default, fields with empty
  3105. // values are omitted from API requests. However, any field with an
  3106. // empty value appearing in NullFields will be sent to the server as
  3107. // null. It is an error if a field in this list has a non-empty value.
  3108. // This may be used to include null fields in Patch requests.
  3109. NullFields []string `json:"-"`
  3110. }
  3111. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  3112. type NoMethod AutoscalerAggregatedList
  3113. raw := NoMethod(*s)
  3114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3115. }
  3116. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  3117. // message.
  3118. type AutoscalerAggregatedListWarning struct {
  3119. // Code: [Output Only] A warning code, if applicable. For example,
  3120. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3121. // the response.
  3122. //
  3123. // Possible values:
  3124. // "CLEANUP_FAILED"
  3125. // "DEPRECATED_RESOURCE_USED"
  3126. // "DEPRECATED_TYPE_USED"
  3127. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3128. // "EXPERIMENTAL_TYPE_USED"
  3129. // "EXTERNAL_API_WARNING"
  3130. // "FIELD_VALUE_OVERRIDEN"
  3131. // "INJECTED_KERNELS_DEPRECATED"
  3132. // "MISSING_TYPE_DEPENDENCY"
  3133. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3134. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3135. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3136. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3137. // "NEXT_HOP_NOT_RUNNING"
  3138. // "NOT_CRITICAL_ERROR"
  3139. // "NO_RESULTS_ON_PAGE"
  3140. // "REQUIRED_TOS_AGREEMENT"
  3141. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3142. // "RESOURCE_NOT_DELETED"
  3143. // "SCHEMA_VALIDATION_IGNORED"
  3144. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3145. // "UNDECLARED_PROPERTIES"
  3146. // "UNREACHABLE"
  3147. Code string `json:"code,omitempty"`
  3148. // Data: [Output Only] Metadata about this warning in key: value format.
  3149. // For example:
  3150. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3151. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  3152. // Message: [Output Only] A human-readable description of the warning
  3153. // code.
  3154. Message string `json:"message,omitempty"`
  3155. // ForceSendFields is a list of field names (e.g. "Code") to
  3156. // unconditionally include in API requests. By default, fields with
  3157. // empty values are omitted from API requests. However, any non-pointer,
  3158. // non-interface field appearing in ForceSendFields will be sent to the
  3159. // server regardless of whether the field is empty or not. This may be
  3160. // used to include empty fields in Patch requests.
  3161. ForceSendFields []string `json:"-"`
  3162. // NullFields is a list of field names (e.g. "Code") to include in API
  3163. // requests with the JSON null value. By default, fields with empty
  3164. // values are omitted from API requests. However, any field with an
  3165. // empty value appearing in NullFields will be sent to the server as
  3166. // null. It is an error if a field in this list has a non-empty value.
  3167. // This may be used to include null fields in Patch requests.
  3168. NullFields []string `json:"-"`
  3169. }
  3170. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  3171. type NoMethod AutoscalerAggregatedListWarning
  3172. raw := NoMethod(*s)
  3173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3174. }
  3175. type AutoscalerAggregatedListWarningData struct {
  3176. // Key: [Output Only] A key that provides more detail on the warning
  3177. // being returned. For example, for warnings where there are no results
  3178. // in a list request for a particular zone, this key might be scope and
  3179. // the key value might be the zone name. Other examples might be a key
  3180. // indicating a deprecated resource and a suggested replacement, or a
  3181. // warning about invalid network settings (for example, if an instance
  3182. // attempts to perform IP forwarding but is not enabled for IP
  3183. // forwarding).
  3184. Key string `json:"key,omitempty"`
  3185. // Value: [Output Only] A warning data value corresponding to the key.
  3186. Value string `json:"value,omitempty"`
  3187. // ForceSendFields is a list of field names (e.g. "Key") to
  3188. // unconditionally include in API requests. By default, fields with
  3189. // empty values are omitted from API requests. However, any non-pointer,
  3190. // non-interface field appearing in ForceSendFields will be sent to the
  3191. // server regardless of whether the field is empty or not. This may be
  3192. // used to include empty fields in Patch requests.
  3193. ForceSendFields []string `json:"-"`
  3194. // NullFields is a list of field names (e.g. "Key") to include in API
  3195. // requests with the JSON null value. By default, fields with empty
  3196. // values are omitted from API requests. However, any field with an
  3197. // empty value appearing in NullFields will be sent to the server as
  3198. // null. It is an error if a field in this list has a non-empty value.
  3199. // This may be used to include null fields in Patch requests.
  3200. NullFields []string `json:"-"`
  3201. }
  3202. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3203. type NoMethod AutoscalerAggregatedListWarningData
  3204. raw := NoMethod(*s)
  3205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3206. }
  3207. // AutoscalerList: Contains a list of Autoscaler resources.
  3208. type AutoscalerList struct {
  3209. // Id: [Output Only] Unique identifier for the resource; defined by the
  3210. // server.
  3211. Id string `json:"id,omitempty"`
  3212. // Items: A list of Autoscaler resources.
  3213. Items []*Autoscaler `json:"items,omitempty"`
  3214. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  3215. // for lists of autoscalers.
  3216. Kind string `json:"kind,omitempty"`
  3217. // NextPageToken: [Output Only] This token allows you to get the next
  3218. // page of results for list requests. If the number of results is larger
  3219. // than maxResults, use the nextPageToken as a value for the query
  3220. // parameter pageToken in the next list request. Subsequent list
  3221. // requests will have their own nextPageToken to continue paging through
  3222. // the results.
  3223. NextPageToken string `json:"nextPageToken,omitempty"`
  3224. // SelfLink: [Output Only] Server-defined URL for this resource.
  3225. SelfLink string `json:"selfLink,omitempty"`
  3226. // Warning: [Output Only] Informational warning message.
  3227. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  3228. // ServerResponse contains the HTTP response code and headers from the
  3229. // server.
  3230. googleapi.ServerResponse `json:"-"`
  3231. // ForceSendFields is a list of field names (e.g. "Id") to
  3232. // unconditionally include in API requests. By default, fields with
  3233. // empty values are omitted from API requests. However, any non-pointer,
  3234. // non-interface field appearing in ForceSendFields will be sent to the
  3235. // server regardless of whether the field is empty or not. This may be
  3236. // used to include empty fields in Patch requests.
  3237. ForceSendFields []string `json:"-"`
  3238. // NullFields is a list of field names (e.g. "Id") to include in API
  3239. // requests with the JSON null value. By default, fields with empty
  3240. // values are omitted from API requests. However, any field with an
  3241. // empty value appearing in NullFields will be sent to the server as
  3242. // null. It is an error if a field in this list has a non-empty value.
  3243. // This may be used to include null fields in Patch requests.
  3244. NullFields []string `json:"-"`
  3245. }
  3246. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  3247. type NoMethod AutoscalerList
  3248. raw := NoMethod(*s)
  3249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3250. }
  3251. // AutoscalerListWarning: [Output Only] Informational warning message.
  3252. type AutoscalerListWarning struct {
  3253. // Code: [Output Only] A warning code, if applicable. For example,
  3254. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3255. // the response.
  3256. //
  3257. // Possible values:
  3258. // "CLEANUP_FAILED"
  3259. // "DEPRECATED_RESOURCE_USED"
  3260. // "DEPRECATED_TYPE_USED"
  3261. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3262. // "EXPERIMENTAL_TYPE_USED"
  3263. // "EXTERNAL_API_WARNING"
  3264. // "FIELD_VALUE_OVERRIDEN"
  3265. // "INJECTED_KERNELS_DEPRECATED"
  3266. // "MISSING_TYPE_DEPENDENCY"
  3267. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3268. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3269. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3270. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3271. // "NEXT_HOP_NOT_RUNNING"
  3272. // "NOT_CRITICAL_ERROR"
  3273. // "NO_RESULTS_ON_PAGE"
  3274. // "REQUIRED_TOS_AGREEMENT"
  3275. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3276. // "RESOURCE_NOT_DELETED"
  3277. // "SCHEMA_VALIDATION_IGNORED"
  3278. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3279. // "UNDECLARED_PROPERTIES"
  3280. // "UNREACHABLE"
  3281. Code string `json:"code,omitempty"`
  3282. // Data: [Output Only] Metadata about this warning in key: value format.
  3283. // For example:
  3284. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3285. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  3286. // Message: [Output Only] A human-readable description of the warning
  3287. // code.
  3288. Message string `json:"message,omitempty"`
  3289. // ForceSendFields is a list of field names (e.g. "Code") to
  3290. // unconditionally include in API requests. By default, fields with
  3291. // empty values are omitted from API requests. However, any non-pointer,
  3292. // non-interface field appearing in ForceSendFields will be sent to the
  3293. // server regardless of whether the field is empty or not. This may be
  3294. // used to include empty fields in Patch requests.
  3295. ForceSendFields []string `json:"-"`
  3296. // NullFields is a list of field names (e.g. "Code") to include in API
  3297. // requests with the JSON null value. By default, fields with empty
  3298. // values are omitted from API requests. However, any field with an
  3299. // empty value appearing in NullFields will be sent to the server as
  3300. // null. It is an error if a field in this list has a non-empty value.
  3301. // This may be used to include null fields in Patch requests.
  3302. NullFields []string `json:"-"`
  3303. }
  3304. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  3305. type NoMethod AutoscalerListWarning
  3306. raw := NoMethod(*s)
  3307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3308. }
  3309. type AutoscalerListWarningData struct {
  3310. // Key: [Output Only] A key that provides more detail on the warning
  3311. // being returned. For example, for warnings where there are no results
  3312. // in a list request for a particular zone, this key might be scope and
  3313. // the key value might be the zone name. Other examples might be a key
  3314. // indicating a deprecated resource and a suggested replacement, or a
  3315. // warning about invalid network settings (for example, if an instance
  3316. // attempts to perform IP forwarding but is not enabled for IP
  3317. // forwarding).
  3318. Key string `json:"key,omitempty"`
  3319. // Value: [Output Only] A warning data value corresponding to the key.
  3320. Value string `json:"value,omitempty"`
  3321. // ForceSendFields is a list of field names (e.g. "Key") to
  3322. // unconditionally include in API requests. By default, fields with
  3323. // empty values are omitted from API requests. However, any non-pointer,
  3324. // non-interface field appearing in ForceSendFields will be sent to the
  3325. // server regardless of whether the field is empty or not. This may be
  3326. // used to include empty fields in Patch requests.
  3327. ForceSendFields []string `json:"-"`
  3328. // NullFields is a list of field names (e.g. "Key") to include in API
  3329. // requests with the JSON null value. By default, fields with empty
  3330. // values are omitted from API requests. However, any field with an
  3331. // empty value appearing in NullFields will be sent to the server as
  3332. // null. It is an error if a field in this list has a non-empty value.
  3333. // This may be used to include null fields in Patch requests.
  3334. NullFields []string `json:"-"`
  3335. }
  3336. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  3337. type NoMethod AutoscalerListWarningData
  3338. raw := NoMethod(*s)
  3339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3340. }
  3341. type AutoscalerStatusDetails struct {
  3342. // Message: The status message.
  3343. Message string `json:"message,omitempty"`
  3344. // Type: The type of error returned.
  3345. //
  3346. // Possible values:
  3347. // "ALL_INSTANCES_UNHEALTHY"
  3348. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  3349. // "CAPPED_AT_MAX_NUM_REPLICAS"
  3350. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  3351. // "CUSTOM_METRIC_INVALID"
  3352. // "MIN_EQUALS_MAX"
  3353. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  3354. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  3355. // "MORE_THAN_ONE_BACKEND_SERVICE"
  3356. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  3357. // "REGION_RESOURCE_STOCKOUT"
  3358. // "SCALING_TARGET_DOES_NOT_EXIST"
  3359. // "UNKNOWN"
  3360. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  3361. // "ZONE_RESOURCE_STOCKOUT"
  3362. Type string `json:"type,omitempty"`
  3363. // ForceSendFields is a list of field names (e.g. "Message") to
  3364. // unconditionally include in API requests. By default, fields with
  3365. // empty values are omitted from API requests. However, any non-pointer,
  3366. // non-interface field appearing in ForceSendFields will be sent to the
  3367. // server regardless of whether the field is empty or not. This may be
  3368. // used to include empty fields in Patch requests.
  3369. ForceSendFields []string `json:"-"`
  3370. // NullFields is a list of field names (e.g. "Message") to include in
  3371. // API requests with the JSON null value. By default, fields with empty
  3372. // values are omitted from API requests. However, any field with an
  3373. // empty value appearing in NullFields will be sent to the server as
  3374. // null. It is an error if a field in this list has a non-empty value.
  3375. // This may be used to include null fields in Patch requests.
  3376. NullFields []string `json:"-"`
  3377. }
  3378. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  3379. type NoMethod AutoscalerStatusDetails
  3380. raw := NoMethod(*s)
  3381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3382. }
  3383. type AutoscalersScopedList struct {
  3384. // Autoscalers: [Output Only] A list of autoscalers contained in this
  3385. // scope.
  3386. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  3387. // Warning: [Output Only] Informational warning which replaces the list
  3388. // of autoscalers when the list is empty.
  3389. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  3390. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  3391. // unconditionally include in API requests. By default, fields with
  3392. // empty values are omitted from API requests. However, any non-pointer,
  3393. // non-interface field appearing in ForceSendFields will be sent to the
  3394. // server regardless of whether the field is empty or not. This may be
  3395. // used to include empty fields in Patch requests.
  3396. ForceSendFields []string `json:"-"`
  3397. // NullFields is a list of field names (e.g. "Autoscalers") to include
  3398. // in API requests with the JSON null value. By default, fields with
  3399. // empty values are omitted from API requests. However, any field with
  3400. // an empty value appearing in NullFields will be sent to the server as
  3401. // null. It is an error if a field in this list has a non-empty value.
  3402. // This may be used to include null fields in Patch requests.
  3403. NullFields []string `json:"-"`
  3404. }
  3405. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  3406. type NoMethod AutoscalersScopedList
  3407. raw := NoMethod(*s)
  3408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3409. }
  3410. // AutoscalersScopedListWarning: [Output Only] Informational warning
  3411. // which replaces the list of autoscalers when the list is empty.
  3412. type AutoscalersScopedListWarning struct {
  3413. // Code: [Output Only] A warning code, if applicable. For example,
  3414. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3415. // the response.
  3416. //
  3417. // Possible values:
  3418. // "CLEANUP_FAILED"
  3419. // "DEPRECATED_RESOURCE_USED"
  3420. // "DEPRECATED_TYPE_USED"
  3421. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3422. // "EXPERIMENTAL_TYPE_USED"
  3423. // "EXTERNAL_API_WARNING"
  3424. // "FIELD_VALUE_OVERRIDEN"
  3425. // "INJECTED_KERNELS_DEPRECATED"
  3426. // "MISSING_TYPE_DEPENDENCY"
  3427. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3428. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3429. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3430. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3431. // "NEXT_HOP_NOT_RUNNING"
  3432. // "NOT_CRITICAL_ERROR"
  3433. // "NO_RESULTS_ON_PAGE"
  3434. // "REQUIRED_TOS_AGREEMENT"
  3435. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3436. // "RESOURCE_NOT_DELETED"
  3437. // "SCHEMA_VALIDATION_IGNORED"
  3438. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3439. // "UNDECLARED_PROPERTIES"
  3440. // "UNREACHABLE"
  3441. Code string `json:"code,omitempty"`
  3442. // Data: [Output Only] Metadata about this warning in key: value format.
  3443. // For example:
  3444. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3445. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  3446. // Message: [Output Only] A human-readable description of the warning
  3447. // code.
  3448. Message string `json:"message,omitempty"`
  3449. // ForceSendFields is a list of field names (e.g. "Code") to
  3450. // unconditionally include in API requests. By default, fields with
  3451. // empty values are omitted from API requests. However, any non-pointer,
  3452. // non-interface field appearing in ForceSendFields will be sent to the
  3453. // server regardless of whether the field is empty or not. This may be
  3454. // used to include empty fields in Patch requests.
  3455. ForceSendFields []string `json:"-"`
  3456. // NullFields is a list of field names (e.g. "Code") to include in API
  3457. // requests with the JSON null value. By default, fields with empty
  3458. // values are omitted from API requests. However, any field with an
  3459. // empty value appearing in NullFields will be sent to the server as
  3460. // null. It is an error if a field in this list has a non-empty value.
  3461. // This may be used to include null fields in Patch requests.
  3462. NullFields []string `json:"-"`
  3463. }
  3464. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  3465. type NoMethod AutoscalersScopedListWarning
  3466. raw := NoMethod(*s)
  3467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3468. }
  3469. type AutoscalersScopedListWarningData struct {
  3470. // Key: [Output Only] A key that provides more detail on the warning
  3471. // being returned. For example, for warnings where there are no results
  3472. // in a list request for a particular zone, this key might be scope and
  3473. // the key value might be the zone name. Other examples might be a key
  3474. // indicating a deprecated resource and a suggested replacement, or a
  3475. // warning about invalid network settings (for example, if an instance
  3476. // attempts to perform IP forwarding but is not enabled for IP
  3477. // forwarding).
  3478. Key string `json:"key,omitempty"`
  3479. // Value: [Output Only] A warning data value corresponding to the key.
  3480. Value string `json:"value,omitempty"`
  3481. // ForceSendFields is a list of field names (e.g. "Key") to
  3482. // unconditionally include in API requests. By default, fields with
  3483. // empty values are omitted from API requests. However, any non-pointer,
  3484. // non-interface field appearing in ForceSendFields will be sent to the
  3485. // server regardless of whether the field is empty or not. This may be
  3486. // used to include empty fields in Patch requests.
  3487. ForceSendFields []string `json:"-"`
  3488. // NullFields is a list of field names (e.g. "Key") to include in API
  3489. // requests with the JSON null value. By default, fields with empty
  3490. // values are omitted from API requests. However, any field with an
  3491. // empty value appearing in NullFields will be sent to the server as
  3492. // null. It is an error if a field in this list has a non-empty value.
  3493. // This may be used to include null fields in Patch requests.
  3494. NullFields []string `json:"-"`
  3495. }
  3496. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  3497. type NoMethod AutoscalersScopedListWarningData
  3498. raw := NoMethod(*s)
  3499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3500. }
  3501. // AutoscalingPolicy: Cloud Autoscaler policy.
  3502. type AutoscalingPolicy struct {
  3503. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  3504. // wait before it starts collecting information from a new instance.
  3505. // This prevents the autoscaler from collecting information when the
  3506. // instance is initializing, during which the collected usage would not
  3507. // be reliable. The default time autoscaler waits is 60
  3508. // seconds.
  3509. //
  3510. // Virtual machine initialization times might vary because of numerous
  3511. // factors. We recommend that you test how long an instance may take to
  3512. // initialize. To do this, create an instance and time the startup
  3513. // process.
  3514. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  3515. // CpuUtilization: Defines the CPU utilization policy that allows the
  3516. // autoscaler to scale based on the average CPU utilization of a managed
  3517. // instance group.
  3518. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  3519. // CustomMetricUtilizations: Configuration parameters of autoscaling
  3520. // based on a custom metric.
  3521. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  3522. // LoadBalancingUtilization: Configuration parameters of autoscaling
  3523. // based on load balancer.
  3524. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  3525. // MaxNumReplicas: The maximum number of instances that the autoscaler
  3526. // can scale up to. This is required when creating or updating an
  3527. // autoscaler. The maximum number of replicas should not be lower than
  3528. // minimal number of replicas.
  3529. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  3530. // MinNumReplicas: The minimum number of replicas that the autoscaler
  3531. // can scale down to. This cannot be less than 0. If not provided,
  3532. // autoscaler will choose a default value depending on maximum number of
  3533. // instances allowed.
  3534. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  3535. // Mode: Defines operating mode for this policy.
  3536. //
  3537. // Possible values:
  3538. // "OFF"
  3539. // "ON"
  3540. // "ONLY_DOWN"
  3541. // "ONLY_UP"
  3542. Mode string `json:"mode,omitempty"`
  3543. // QueueBasedScaling: Configuration parameters of autoscaling based on
  3544. // queuing system.
  3545. QueueBasedScaling *AutoscalingPolicyQueueBasedScaling `json:"queueBasedScaling,omitempty"`
  3546. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  3547. // to unconditionally include in API requests. By default, fields with
  3548. // empty values are omitted from API requests. However, any non-pointer,
  3549. // non-interface field appearing in ForceSendFields will be sent to the
  3550. // server regardless of whether the field is empty or not. This may be
  3551. // used to include empty fields in Patch requests.
  3552. ForceSendFields []string `json:"-"`
  3553. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  3554. // include in API requests with the JSON null value. By default, fields
  3555. // with empty values are omitted from API requests. However, any field
  3556. // with an empty value appearing in NullFields will be sent to the
  3557. // server as null. It is an error if a field in this list has a
  3558. // non-empty value. This may be used to include null fields in Patch
  3559. // requests.
  3560. NullFields []string `json:"-"`
  3561. }
  3562. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  3563. type NoMethod AutoscalingPolicy
  3564. raw := NoMethod(*s)
  3565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3566. }
  3567. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  3568. type AutoscalingPolicyCpuUtilization struct {
  3569. // UtilizationTarget: The target CPU utilization that the autoscaler
  3570. // should maintain. Must be a float value in the range (0, 1]. If not
  3571. // specified, the default is 0.6.
  3572. //
  3573. // If the CPU level is below the target utilization, the autoscaler
  3574. // scales down the number of instances until it reaches the minimum
  3575. // number of instances you specified or until the average CPU of your
  3576. // instances reaches the target utilization.
  3577. //
  3578. // If the average CPU is above the target utilization, the autoscaler
  3579. // scales up until it reaches the maximum number of instances you
  3580. // specified or until the average utilization reaches the target
  3581. // utilization.
  3582. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3583. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3584. // to unconditionally include in API requests. By default, fields with
  3585. // empty values are omitted from API requests. However, any non-pointer,
  3586. // non-interface field appearing in ForceSendFields will be sent to the
  3587. // server regardless of whether the field is empty or not. This may be
  3588. // used to include empty fields in Patch requests.
  3589. ForceSendFields []string `json:"-"`
  3590. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3591. // include in API requests with the JSON null value. By default, fields
  3592. // with empty values are omitted from API requests. However, any field
  3593. // with an empty value appearing in NullFields will be sent to the
  3594. // server as null. It is an error if a field in this list has a
  3595. // non-empty value. This may be used to include null fields in Patch
  3596. // requests.
  3597. NullFields []string `json:"-"`
  3598. }
  3599. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  3600. type NoMethod AutoscalingPolicyCpuUtilization
  3601. raw := NoMethod(*s)
  3602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3603. }
  3604. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  3605. type NoMethod AutoscalingPolicyCpuUtilization
  3606. var s1 struct {
  3607. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3608. *NoMethod
  3609. }
  3610. s1.NoMethod = (*NoMethod)(s)
  3611. if err := json.Unmarshal(data, &s1); err != nil {
  3612. return err
  3613. }
  3614. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3615. return nil
  3616. }
  3617. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  3618. // policy.
  3619. type AutoscalingPolicyCustomMetricUtilization struct {
  3620. // Filter: A filter string, compatible with a Stackdriver Monitoring
  3621. // filter string for TimeSeries.list API call. This filter is used to
  3622. // select a specific TimeSeries for the purpose of autoscaling and to
  3623. // determine whether the metric is exporting per-instance or per-group
  3624. // data.
  3625. //
  3626. // For the filter to be valid for autoscaling purposes, the following
  3627. // rules apply:
  3628. // - You can only use the AND operator for joining selectors.
  3629. // - You can only use direct equality comparison operator (=) without
  3630. // any functions for each selector.
  3631. // - You can specify the metric in both the filter string and in the
  3632. // metric field. However, if specified in both places, the metric must
  3633. // be identical.
  3634. // - The monitored resource type determines what kind of values are
  3635. // expected for the metric. If it is a gce_instance, the autoscaler
  3636. // expects the metric to include a separate TimeSeries for each instance
  3637. // in a group. In such a case, you cannot filter on resource labels.
  3638. // If the resource type is any other value, the autoscaler expects this
  3639. // metric to contain values that apply to the entire autoscaled instance
  3640. // group and resource label filtering can be performed to point
  3641. // autoscaler at the correct TimeSeries to scale upon. This is called a
  3642. // per-group metric for the purpose of autoscaling.
  3643. //
  3644. // If not specified, the type defaults to gce_instance.
  3645. //
  3646. // You should provide a filter that is selective enough to pick just one
  3647. // TimeSeries for the autoscaled group or for each of the instances (if
  3648. // you are using gce_instance resource type). If multiple TimeSeries are
  3649. // returned upon the query execution, the autoscaler will sum their
  3650. // respective values to obtain its scaling value.
  3651. Filter string `json:"filter,omitempty"`
  3652. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  3653. // The metric cannot have negative values.
  3654. //
  3655. // The metric must have a value type of INT64 or DOUBLE.
  3656. Metric string `json:"metric,omitempty"`
  3657. // SingleInstanceAssignment: If scaling is based on a per-group metric
  3658. // value that represents the total amount of work to be done or resource
  3659. // usage, set this value to an amount assigned for a single instance of
  3660. // the scaled group. Autoscaler will keep the number of instances
  3661. // proportional to the value of this metric, the metric itself should
  3662. // not change value due to group resizing.
  3663. //
  3664. // A good metric to use with the target is for example
  3665. // pubsub.googleapis.com/subscription/num_undelivered_messages or a
  3666. // custom metric exporting the total number of requests coming to your
  3667. // instances.
  3668. //
  3669. // A bad example would be a metric exporting an average or median
  3670. // latency, since this value can't include a chunk assignable to a
  3671. // single instance, it could be better used with utilization_target
  3672. // instead.
  3673. SingleInstanceAssignment float64 `json:"singleInstanceAssignment,omitempty"`
  3674. // UtilizationTarget: The target value of the metric that autoscaler
  3675. // should maintain. This must be a positive value. A utilization metric
  3676. // scales number of virtual machines handling requests to increase or
  3677. // decrease proportionally to the metric.
  3678. //
  3679. // For example, a good metric to use as a utilization_target is
  3680. // compute.googleapis.com/instance/network/received_bytes_count. The
  3681. // autoscaler will work to keep this value constant for each of the
  3682. // instances.
  3683. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3684. // UtilizationTargetType: Defines how target utilization value is
  3685. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  3686. // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
  3687. //
  3688. // Possible values:
  3689. // "DELTA_PER_MINUTE"
  3690. // "DELTA_PER_SECOND"
  3691. // "GAUGE"
  3692. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  3693. // ForceSendFields is a list of field names (e.g. "Filter") to
  3694. // unconditionally include in API requests. By default, fields with
  3695. // empty values are omitted from API requests. However, any non-pointer,
  3696. // non-interface field appearing in ForceSendFields will be sent to the
  3697. // server regardless of whether the field is empty or not. This may be
  3698. // used to include empty fields in Patch requests.
  3699. ForceSendFields []string `json:"-"`
  3700. // NullFields is a list of field names (e.g. "Filter") to include in API
  3701. // requests with the JSON null value. By default, fields with empty
  3702. // values are omitted from API requests. However, any field with an
  3703. // empty value appearing in NullFields will be sent to the server as
  3704. // null. It is an error if a field in this list has a non-empty value.
  3705. // This may be used to include null fields in Patch requests.
  3706. NullFields []string `json:"-"`
  3707. }
  3708. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  3709. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3710. raw := NoMethod(*s)
  3711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3712. }
  3713. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  3714. type NoMethod AutoscalingPolicyCustomMetricUtilization
  3715. var s1 struct {
  3716. SingleInstanceAssignment gensupport.JSONFloat64 `json:"singleInstanceAssignment"`
  3717. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3718. *NoMethod
  3719. }
  3720. s1.NoMethod = (*NoMethod)(s)
  3721. if err := json.Unmarshal(data, &s1); err != nil {
  3722. return err
  3723. }
  3724. s.SingleInstanceAssignment = float64(s1.SingleInstanceAssignment)
  3725. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3726. return nil
  3727. }
  3728. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  3729. // of autoscaling based on load balancing.
  3730. type AutoscalingPolicyLoadBalancingUtilization struct {
  3731. // UtilizationTarget: Fraction of backend capacity utilization (set in
  3732. // HTTP(S) load balancing configuration) that autoscaler should
  3733. // maintain. Must be a positive float value. If not defined, the default
  3734. // is 0.8.
  3735. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  3736. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  3737. // to unconditionally include in API requests. By default, fields with
  3738. // empty values are omitted from API requests. However, any non-pointer,
  3739. // non-interface field appearing in ForceSendFields will be sent to the
  3740. // server regardless of whether the field is empty or not. This may be
  3741. // used to include empty fields in Patch requests.
  3742. ForceSendFields []string `json:"-"`
  3743. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  3744. // include in API requests with the JSON null value. By default, fields
  3745. // with empty values are omitted from API requests. However, any field
  3746. // with an empty value appearing in NullFields will be sent to the
  3747. // server as null. It is an error if a field in this list has a
  3748. // non-empty value. This may be used to include null fields in Patch
  3749. // requests.
  3750. NullFields []string `json:"-"`
  3751. }
  3752. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  3753. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3754. raw := NoMethod(*s)
  3755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3756. }
  3757. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  3758. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  3759. var s1 struct {
  3760. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  3761. *NoMethod
  3762. }
  3763. s1.NoMethod = (*NoMethod)(s)
  3764. if err := json.Unmarshal(data, &s1); err != nil {
  3765. return err
  3766. }
  3767. s.UtilizationTarget = float64(s1.UtilizationTarget)
  3768. return nil
  3769. }
  3770. // AutoscalingPolicyQueueBasedScaling: Configuration parameters of
  3771. // autoscaling based on queuing system.
  3772. type AutoscalingPolicyQueueBasedScaling struct {
  3773. // AcceptableBacklogPerInstance: Scaling based on the average number of
  3774. // tasks in the queue per each active instance. The autoscaler keeps the
  3775. // average number of tasks per instance below this number, based on data
  3776. // collected in the last couple of minutes. The autoscaler will also
  3777. // take into account incoming tasks when calculating when to scale.
  3778. AcceptableBacklogPerInstance float64 `json:"acceptableBacklogPerInstance,omitempty"`
  3779. // CloudPubSub: Configuration for Cloud Pub/Sub subscription queue.
  3780. CloudPubSub *AutoscalingPolicyQueueBasedScalingCloudPubSub `json:"cloudPubSub,omitempty"`
  3781. // SingleWorkerThroughputPerSec: The scaling algorithm will also
  3782. // calculate throughput estimates on its own; if you explicitly provide
  3783. // this value, the autoscaler will take into account your value as well
  3784. // as automatic estimates when deciding how to scale.
  3785. SingleWorkerThroughputPerSec float64 `json:"singleWorkerThroughputPerSec,omitempty"`
  3786. // ForceSendFields is a list of field names (e.g.
  3787. // "AcceptableBacklogPerInstance") to unconditionally include in API
  3788. // requests. By default, fields with empty values are omitted from API
  3789. // requests. However, any non-pointer, non-interface field appearing in
  3790. // ForceSendFields will be sent to the server regardless of whether the
  3791. // field is empty or not. This may be used to include empty fields in
  3792. // Patch requests.
  3793. ForceSendFields []string `json:"-"`
  3794. // NullFields is a list of field names (e.g.
  3795. // "AcceptableBacklogPerInstance") to include in API requests with the
  3796. // JSON null value. By default, fields with empty values are omitted
  3797. // from API requests. However, any field with an empty value appearing
  3798. // in NullFields will be sent to the server as null. It is an error if a
  3799. // field in this list has a non-empty value. This may be used to include
  3800. // null fields in Patch requests.
  3801. NullFields []string `json:"-"`
  3802. }
  3803. func (s *AutoscalingPolicyQueueBasedScaling) MarshalJSON() ([]byte, error) {
  3804. type NoMethod AutoscalingPolicyQueueBasedScaling
  3805. raw := NoMethod(*s)
  3806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3807. }
  3808. func (s *AutoscalingPolicyQueueBasedScaling) UnmarshalJSON(data []byte) error {
  3809. type NoMethod AutoscalingPolicyQueueBasedScaling
  3810. var s1 struct {
  3811. AcceptableBacklogPerInstance gensupport.JSONFloat64 `json:"acceptableBacklogPerInstance"`
  3812. SingleWorkerThroughputPerSec gensupport.JSONFloat64 `json:"singleWorkerThroughputPerSec"`
  3813. *NoMethod
  3814. }
  3815. s1.NoMethod = (*NoMethod)(s)
  3816. if err := json.Unmarshal(data, &s1); err != nil {
  3817. return err
  3818. }
  3819. s.AcceptableBacklogPerInstance = float64(s1.AcceptableBacklogPerInstance)
  3820. s.SingleWorkerThroughputPerSec = float64(s1.SingleWorkerThroughputPerSec)
  3821. return nil
  3822. }
  3823. // AutoscalingPolicyQueueBasedScalingCloudPubSub: Configuration
  3824. // parameters for scaling based on Cloud Pub/Sub subscription queue.
  3825. type AutoscalingPolicyQueueBasedScalingCloudPubSub struct {
  3826. // Subscription: Cloud Pub/Sub subscription used for scaling. Provide
  3827. // the partial URL (starting with projects/) or just the subscription
  3828. // name. The subscription must be assigned to the topic specified in
  3829. // topicName and must be in a pull configuration. The subscription must
  3830. // belong to the same project as the Autoscaler.
  3831. Subscription string `json:"subscription,omitempty"`
  3832. // Topic: Cloud Pub/Sub topic used for scaling. Provide the partial URL
  3833. // or partial URL (starting with projects/) or just the topic name. The
  3834. // topic must belong to the same project as the Autoscaler resource.
  3835. Topic string `json:"topic,omitempty"`
  3836. // ForceSendFields is a list of field names (e.g. "Subscription") to
  3837. // unconditionally include in API requests. By default, fields with
  3838. // empty values are omitted from API requests. However, any non-pointer,
  3839. // non-interface field appearing in ForceSendFields will be sent to the
  3840. // server regardless of whether the field is empty or not. This may be
  3841. // used to include empty fields in Patch requests.
  3842. ForceSendFields []string `json:"-"`
  3843. // NullFields is a list of field names (e.g. "Subscription") to include
  3844. // in API requests with the JSON null value. By default, fields with
  3845. // empty values are omitted from API requests. However, any field with
  3846. // an empty value appearing in NullFields will be sent to the server as
  3847. // null. It is an error if a field in this list has a non-empty value.
  3848. // This may be used to include null fields in Patch requests.
  3849. NullFields []string `json:"-"`
  3850. }
  3851. func (s *AutoscalingPolicyQueueBasedScalingCloudPubSub) MarshalJSON() ([]byte, error) {
  3852. type NoMethod AutoscalingPolicyQueueBasedScalingCloudPubSub
  3853. raw := NoMethod(*s)
  3854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3855. }
  3856. // Backend: Message containing information of one individual backend.
  3857. type Backend struct {
  3858. // BalancingMode: Specifies the balancing mode for this backend. For
  3859. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  3860. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  3861. // TCP/SSL).
  3862. //
  3863. // For Internal Load Balancing, the default and only supported mode is
  3864. // CONNECTION.
  3865. //
  3866. // Possible values:
  3867. // "CONNECTION"
  3868. // "RATE"
  3869. // "UTILIZATION"
  3870. BalancingMode string `json:"balancingMode,omitempty"`
  3871. // CapacityScaler: A multiplier applied to the group's maximum servicing
  3872. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  3873. // 1, which means the group will serve up to 100% of its configured
  3874. // capacity (depending on balancingMode). A setting of 0 means the group
  3875. // is completely drained, offering 0% of its available Capacity. Valid
  3876. // range is [0.0,1.0].
  3877. //
  3878. // This cannot be used for internal load balancing.
  3879. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  3880. // Description: An optional description of this resource. Provide this
  3881. // property when you create the resource.
  3882. Description string `json:"description,omitempty"`
  3883. // Failover: This field designates whether this is a failover backend.
  3884. // More than one failover backend can be configured for a given
  3885. // BackendService.
  3886. Failover bool `json:"failover,omitempty"`
  3887. // Group: The fully-qualified URL of an Instance Group or Network
  3888. // Endpoint Group resource. In case of instance group this defines the
  3889. // list of instances that serve traffic. Member virtual machine
  3890. // instances from each instance group must live in the same zone as the
  3891. // instance group itself. No two backends in a backend service are
  3892. // allowed to use same Instance Group resource.
  3893. //
  3894. // For Network Endpoint Groups this defines list of endpoints. All
  3895. // endpoints of Network Endpoint Group must be hosted on instances
  3896. // located in the same zone as the Network Endpoint Group.
  3897. //
  3898. // Backend service can not contain mix of Instance Group and Network
  3899. // Endpoint Group backends.
  3900. //
  3901. // Note that you must specify an Instance Group or Network Endpoint
  3902. // Group resource using the fully-qualified URL, rather than a partial
  3903. // URL.
  3904. //
  3905. // When the BackendService has load balancing scheme INTERNAL, the
  3906. // instance group must be within the same region as the BackendService.
  3907. // Network Endpoint Groups are not supported for INTERNAL load balancing
  3908. // scheme.
  3909. Group string `json:"group,omitempty"`
  3910. // MaxConnections: The max number of simultaneous connections for the
  3911. // group. Can be used with either CONNECTION or UTILIZATION balancing
  3912. // modes. For CONNECTION mode, either maxConnections or
  3913. // maxConnectionsPerInstance must be set.
  3914. //
  3915. // This cannot be used for internal load balancing.
  3916. MaxConnections int64 `json:"maxConnections,omitempty"`
  3917. // MaxConnectionsPerEndpoint: The max number of simultaneous connections
  3918. // that a single backend network endpoint can handle. This is used to
  3919. // calculate the capacity of the group. Can be used in either CONNECTION
  3920. // or UTILIZATION balancing modes. For CONNECTION mode, either
  3921. // maxConnections or maxConnectionsPerEndpoint must be set.
  3922. //
  3923. // This cannot be used for internal load balancing.
  3924. MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
  3925. // MaxConnectionsPerInstance: The max number of simultaneous connections
  3926. // that a single backend instance can handle. This is used to calculate
  3927. // the capacity of the group. Can be used in either CONNECTION or
  3928. // UTILIZATION balancing modes. For CONNECTION mode, either
  3929. // maxConnections or maxConnectionsPerInstance must be set.
  3930. //
  3931. // This cannot be used for internal load balancing.
  3932. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  3933. // MaxRate: The max requests per second (RPS) of the group. Can be used
  3934. // with either RATE or UTILIZATION balancing modes, but required if RATE
  3935. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  3936. // set.
  3937. //
  3938. // This cannot be used for internal load balancing.
  3939. MaxRate int64 `json:"maxRate,omitempty"`
  3940. // MaxRatePerEndpoint: The max requests per second (RPS) that a single
  3941. // backend network endpoint can handle. This is used to calculate the
  3942. // capacity of the group. Can be used in either balancing mode. For RATE
  3943. // mode, either maxRate or maxRatePerEndpoint must be set.
  3944. //
  3945. // This cannot be used for internal load balancing.
  3946. MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
  3947. // MaxRatePerInstance: The max requests per second (RPS) that a single
  3948. // backend instance can handle. This is used to calculate the capacity
  3949. // of the group. Can be used in either balancing mode. For RATE mode,
  3950. // either maxRate or maxRatePerInstance must be set.
  3951. //
  3952. // This cannot be used for internal load balancing.
  3953. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  3954. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  3955. // defines the CPU utilization target for the group. The default is 0.8.
  3956. // Valid range is [0.0, 1.0].
  3957. //
  3958. // This cannot be used for internal load balancing.
  3959. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  3960. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  3961. // unconditionally include in API requests. By default, fields with
  3962. // empty values are omitted from API requests. However, any non-pointer,
  3963. // non-interface field appearing in ForceSendFields will be sent to the
  3964. // server regardless of whether the field is empty or not. This may be
  3965. // used to include empty fields in Patch requests.
  3966. ForceSendFields []string `json:"-"`
  3967. // NullFields is a list of field names (e.g. "BalancingMode") to include
  3968. // in API requests with the JSON null value. By default, fields with
  3969. // empty values are omitted from API requests. However, any field with
  3970. // an empty value appearing in NullFields will be sent to the server as
  3971. // null. It is an error if a field in this list has a non-empty value.
  3972. // This may be used to include null fields in Patch requests.
  3973. NullFields []string `json:"-"`
  3974. }
  3975. func (s *Backend) MarshalJSON() ([]byte, error) {
  3976. type NoMethod Backend
  3977. raw := NoMethod(*s)
  3978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3979. }
  3980. func (s *Backend) UnmarshalJSON(data []byte) error {
  3981. type NoMethod Backend
  3982. var s1 struct {
  3983. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  3984. MaxRatePerEndpoint gensupport.JSONFloat64 `json:"maxRatePerEndpoint"`
  3985. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  3986. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  3987. *NoMethod
  3988. }
  3989. s1.NoMethod = (*NoMethod)(s)
  3990. if err := json.Unmarshal(data, &s1); err != nil {
  3991. return err
  3992. }
  3993. s.CapacityScaler = float64(s1.CapacityScaler)
  3994. s.MaxRatePerEndpoint = float64(s1.MaxRatePerEndpoint)
  3995. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  3996. s.MaxUtilization = float64(s1.MaxUtilization)
  3997. return nil
  3998. }
  3999. // BackendBucket: A BackendBucket resource. This resource defines a
  4000. // Cloud Storage bucket.
  4001. type BackendBucket struct {
  4002. // BucketName: Cloud Storage bucket name.
  4003. BucketName string `json:"bucketName,omitempty"`
  4004. // CdnPolicy: Cloud CDN configuration for this BackendBucket.
  4005. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  4006. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4007. // format.
  4008. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4009. // Description: An optional textual description of the resource;
  4010. // provided by the client when the resource is created.
  4011. Description string `json:"description,omitempty"`
  4012. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  4013. EnableCdn bool `json:"enableCdn,omitempty"`
  4014. // Id: [Output Only] Unique identifier for the resource; defined by the
  4015. // server.
  4016. Id uint64 `json:"id,omitempty,string"`
  4017. // Kind: Type of the resource.
  4018. Kind string `json:"kind,omitempty"`
  4019. // Name: Name of the resource. Provided by the client when the resource
  4020. // is created. The name must be 1-63 characters long, and comply with
  4021. // RFC1035. Specifically, the name must be 1-63 characters long and
  4022. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4023. // the first character must be a lowercase letter, and all following
  4024. // characters must be a dash, lowercase letter, or digit, except the
  4025. // last character, which cannot be a dash.
  4026. Name string `json:"name,omitempty"`
  4027. // SelfLink: [Output Only] Server-defined URL for the resource.
  4028. SelfLink string `json:"selfLink,omitempty"`
  4029. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  4030. // with the resource id.
  4031. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  4032. // ServerResponse contains the HTTP response code and headers from the
  4033. // server.
  4034. googleapi.ServerResponse `json:"-"`
  4035. // ForceSendFields is a list of field names (e.g. "BucketName") to
  4036. // unconditionally include in API requests. By default, fields with
  4037. // empty values are omitted from API requests. However, any non-pointer,
  4038. // non-interface field appearing in ForceSendFields will be sent to the
  4039. // server regardless of whether the field is empty or not. This may be
  4040. // used to include empty fields in Patch requests.
  4041. ForceSendFields []string `json:"-"`
  4042. // NullFields is a list of field names (e.g. "BucketName") to include in
  4043. // API requests with the JSON null value. By default, fields with empty
  4044. // values are omitted from API requests. However, any field with an
  4045. // empty value appearing in NullFields will be sent to the server as
  4046. // null. It is an error if a field in this list has a non-empty value.
  4047. // This may be used to include null fields in Patch requests.
  4048. NullFields []string `json:"-"`
  4049. }
  4050. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  4051. type NoMethod BackendBucket
  4052. raw := NoMethod(*s)
  4053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4054. }
  4055. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  4056. // for a backend bucket.
  4057. type BackendBucketCdnPolicy struct {
  4058. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  4059. // signed URL request will be considered fresh. After this time period,
  4060. // the response will be revalidated before being served. Defaults to 1hr
  4061. // (3600s). When serving responses to signed URL requests, Cloud CDN
  4062. // will internally behave as though all responses from this backend had
  4063. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  4064. // existing Cache-Control header. The actual headers served in responses
  4065. // will not be altered.
  4066. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  4067. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  4068. // request URLs.
  4069. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  4070. // ForceSendFields is a list of field names (e.g.
  4071. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  4072. // requests. By default, fields with empty values are omitted from API
  4073. // requests. However, any non-pointer, non-interface field appearing in
  4074. // ForceSendFields will be sent to the server regardless of whether the
  4075. // field is empty or not. This may be used to include empty fields in
  4076. // Patch requests.
  4077. ForceSendFields []string `json:"-"`
  4078. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  4079. // to include in API requests with the JSON null value. By default,
  4080. // fields with empty values are omitted from API requests. However, any
  4081. // field with an empty value appearing in NullFields will be sent to the
  4082. // server as null. It is an error if a field in this list has a
  4083. // non-empty value. This may be used to include null fields in Patch
  4084. // requests.
  4085. NullFields []string `json:"-"`
  4086. }
  4087. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  4088. type NoMethod BackendBucketCdnPolicy
  4089. raw := NoMethod(*s)
  4090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4091. }
  4092. // BackendBucketList: Contains a list of BackendBucket resources.
  4093. type BackendBucketList struct {
  4094. // Id: [Output Only] Unique identifier for the resource; defined by the
  4095. // server.
  4096. Id string `json:"id,omitempty"`
  4097. // Items: A list of BackendBucket resources.
  4098. Items []*BackendBucket `json:"items,omitempty"`
  4099. // Kind: Type of resource.
  4100. Kind string `json:"kind,omitempty"`
  4101. // NextPageToken: [Output Only] This token allows you to get the next
  4102. // page of results for list requests. If the number of results is larger
  4103. // than maxResults, use the nextPageToken as a value for the query
  4104. // parameter pageToken in the next list request. Subsequent list
  4105. // requests will have their own nextPageToken to continue paging through
  4106. // the results.
  4107. NextPageToken string `json:"nextPageToken,omitempty"`
  4108. // SelfLink: [Output Only] Server-defined URL for this resource.
  4109. SelfLink string `json:"selfLink,omitempty"`
  4110. // Warning: [Output Only] Informational warning message.
  4111. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  4112. // ServerResponse contains the HTTP response code and headers from the
  4113. // server.
  4114. googleapi.ServerResponse `json:"-"`
  4115. // ForceSendFields is a list of field names (e.g. "Id") to
  4116. // unconditionally include in API requests. By default, fields with
  4117. // empty values are omitted from API requests. However, any non-pointer,
  4118. // non-interface field appearing in ForceSendFields will be sent to the
  4119. // server regardless of whether the field is empty or not. This may be
  4120. // used to include empty fields in Patch requests.
  4121. ForceSendFields []string `json:"-"`
  4122. // NullFields is a list of field names (e.g. "Id") to include in API
  4123. // requests with the JSON null value. By default, fields with empty
  4124. // values are omitted from API requests. However, any field with an
  4125. // empty value appearing in NullFields will be sent to the server as
  4126. // null. It is an error if a field in this list has a non-empty value.
  4127. // This may be used to include null fields in Patch requests.
  4128. NullFields []string `json:"-"`
  4129. }
  4130. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  4131. type NoMethod BackendBucketList
  4132. raw := NoMethod(*s)
  4133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4134. }
  4135. // BackendBucketListWarning: [Output Only] Informational warning
  4136. // message.
  4137. type BackendBucketListWarning struct {
  4138. // Code: [Output Only] A warning code, if applicable. For example,
  4139. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4140. // the response.
  4141. //
  4142. // Possible values:
  4143. // "CLEANUP_FAILED"
  4144. // "DEPRECATED_RESOURCE_USED"
  4145. // "DEPRECATED_TYPE_USED"
  4146. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4147. // "EXPERIMENTAL_TYPE_USED"
  4148. // "EXTERNAL_API_WARNING"
  4149. // "FIELD_VALUE_OVERRIDEN"
  4150. // "INJECTED_KERNELS_DEPRECATED"
  4151. // "MISSING_TYPE_DEPENDENCY"
  4152. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4153. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4154. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4155. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4156. // "NEXT_HOP_NOT_RUNNING"
  4157. // "NOT_CRITICAL_ERROR"
  4158. // "NO_RESULTS_ON_PAGE"
  4159. // "REQUIRED_TOS_AGREEMENT"
  4160. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4161. // "RESOURCE_NOT_DELETED"
  4162. // "SCHEMA_VALIDATION_IGNORED"
  4163. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4164. // "UNDECLARED_PROPERTIES"
  4165. // "UNREACHABLE"
  4166. Code string `json:"code,omitempty"`
  4167. // Data: [Output Only] Metadata about this warning in key: value format.
  4168. // For example:
  4169. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4170. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  4171. // Message: [Output Only] A human-readable description of the warning
  4172. // code.
  4173. Message string `json:"message,omitempty"`
  4174. // ForceSendFields is a list of field names (e.g. "Code") to
  4175. // unconditionally include in API requests. By default, fields with
  4176. // empty values are omitted from API requests. However, any non-pointer,
  4177. // non-interface field appearing in ForceSendFields will be sent to the
  4178. // server regardless of whether the field is empty or not. This may be
  4179. // used to include empty fields in Patch requests.
  4180. ForceSendFields []string `json:"-"`
  4181. // NullFields is a list of field names (e.g. "Code") to include in API
  4182. // requests with the JSON null value. By default, fields with empty
  4183. // values are omitted from API requests. However, any field with an
  4184. // empty value appearing in NullFields will be sent to the server as
  4185. // null. It is an error if a field in this list has a non-empty value.
  4186. // This may be used to include null fields in Patch requests.
  4187. NullFields []string `json:"-"`
  4188. }
  4189. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  4190. type NoMethod BackendBucketListWarning
  4191. raw := NoMethod(*s)
  4192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4193. }
  4194. type BackendBucketListWarningData struct {
  4195. // Key: [Output Only] A key that provides more detail on the warning
  4196. // being returned. For example, for warnings where there are no results
  4197. // in a list request for a particular zone, this key might be scope and
  4198. // the key value might be the zone name. Other examples might be a key
  4199. // indicating a deprecated resource and a suggested replacement, or a
  4200. // warning about invalid network settings (for example, if an instance
  4201. // attempts to perform IP forwarding but is not enabled for IP
  4202. // forwarding).
  4203. Key string `json:"key,omitempty"`
  4204. // Value: [Output Only] A warning data value corresponding to the key.
  4205. Value string `json:"value,omitempty"`
  4206. // ForceSendFields is a list of field names (e.g. "Key") to
  4207. // unconditionally include in API requests. By default, fields with
  4208. // empty values are omitted from API requests. However, any non-pointer,
  4209. // non-interface field appearing in ForceSendFields will be sent to the
  4210. // server regardless of whether the field is empty or not. This may be
  4211. // used to include empty fields in Patch requests.
  4212. ForceSendFields []string `json:"-"`
  4213. // NullFields is a list of field names (e.g. "Key") to include in API
  4214. // requests with the JSON null value. By default, fields with empty
  4215. // values are omitted from API requests. However, any field with an
  4216. // empty value appearing in NullFields will be sent to the server as
  4217. // null. It is an error if a field in this list has a non-empty value.
  4218. // This may be used to include null fields in Patch requests.
  4219. NullFields []string `json:"-"`
  4220. }
  4221. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  4222. type NoMethod BackendBucketListWarningData
  4223. raw := NoMethod(*s)
  4224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4225. }
  4226. // BackendService: A BackendService resource. This resource defines a
  4227. // group of backend virtual machines and their serving capacity. (==
  4228. // resource_for v1.backendService ==) (== resource_for
  4229. // beta.backendService ==)
  4230. type BackendService struct {
  4231. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  4232. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  4233. // non-persistent and lasts only until the end of the browser session
  4234. // (or equivalent). The maximum allowed value for TTL is one day.
  4235. //
  4236. // When the load balancing scheme is INTERNAL, this field is not used.
  4237. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  4238. // AppEngineBackend: Directs request to an App Engine app.
  4239. // cloudFunctionBackend and backends[] must be empty if this is set.
  4240. AppEngineBackend *BackendServiceAppEngineBackend `json:"appEngineBackend,omitempty"`
  4241. // Backends: The list of backends that serve this BackendService.
  4242. Backends []*Backend `json:"backends,omitempty"`
  4243. // CdnPolicy: Cloud CDN configuration for this BackendService.
  4244. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  4245. // CircuitBreakers: Settings controlling the volume of connections to a
  4246. // backend service.
  4247. //
  4248. // This field is applicable to either:
  4249. // - A regional backend service with the service_protocol set to HTTP,
  4250. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  4251. //
  4252. // - A global backend service with the load_balancing_scheme set to
  4253. // INTERNAL_SELF_MANAGED.
  4254. CircuitBreakers *CircuitBreakers `json:"circuitBreakers,omitempty"`
  4255. // CloudFunctionBackend: Directs request to a cloud function.
  4256. // appEngineBackend and backends[] must be empty if this is set.
  4257. CloudFunctionBackend *BackendServiceCloudFunctionBackend `json:"cloudFunctionBackend,omitempty"`
  4258. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  4259. // ConsistentHash: Consistent Hash-based load balancing can be used to
  4260. // provide soft session affinity based on HTTP headers, cookies or other
  4261. // properties. This load balancing policy is applicable only for HTTP
  4262. // connections. The affinity to a particular destination host will be
  4263. // lost when one or more hosts are added/removed from the destination
  4264. // service. This field specifies parameters that control consistent
  4265. // hashing. This field is only applicable when localityLbPolicy is set
  4266. // to MAGLEV or RING_HASH.
  4267. //
  4268. // This field is applicable to either:
  4269. // - A regional backend service with the service_protocol set to HTTP,
  4270. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  4271. //
  4272. // - A global backend service with the load_balancing_scheme set to
  4273. // INTERNAL_SELF_MANAGED.
  4274. ConsistentHash *ConsistentHashLoadBalancerSettings `json:"consistentHash,omitempty"`
  4275. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4276. // format.
  4277. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4278. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  4279. // add to proxied requests.
  4280. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  4281. // Description: An optional description of this resource. Provide this
  4282. // property when you create the resource.
  4283. Description string `json:"description,omitempty"`
  4284. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  4285. //
  4286. // When the load balancing scheme is INTERNAL, this field is not used.
  4287. EnableCDN bool `json:"enableCDN,omitempty"`
  4288. FailoverPolicy *BackendServiceFailoverPolicy `json:"failoverPolicy,omitempty"`
  4289. // Fingerprint: Fingerprint of this resource. A hash of the contents
  4290. // stored in this object. This field is used in optimistic locking. This
  4291. // field will be ignored when inserting a BackendService. An up-to-date
  4292. // fingerprint must be provided in order to update the BackendService,
  4293. // otherwise the request will fail with error 412 conditionNotMet.
  4294. //
  4295. // To see the latest fingerprint, make a get() request to retrieve a
  4296. // BackendService.
  4297. Fingerprint string `json:"fingerprint,omitempty"`
  4298. // HealthChecks: The list of URLs to the HttpHealthCheck or
  4299. // HttpsHealthCheck resource for health checking this BackendService.
  4300. // Currently at most one health check can be specified, and a health
  4301. // check is required for Compute Engine backend services. A health check
  4302. // must not be specified for App Engine backend and Cloud Function
  4303. // backend.
  4304. //
  4305. // For internal load balancing, a URL to a HealthCheck resource must be
  4306. // specified instead.
  4307. HealthChecks []string `json:"healthChecks,omitempty"`
  4308. Iap *BackendServiceIAP `json:"iap,omitempty"`
  4309. // Id: [Output Only] The unique identifier for the resource. This
  4310. // identifier is defined by the server.
  4311. Id uint64 `json:"id,omitempty,string"`
  4312. // Kind: [Output Only] Type of resource. Always compute#backendService
  4313. // for backend services.
  4314. Kind string `json:"kind,omitempty"`
  4315. // LoadBalancingScheme: Indicates whether the backend service will be
  4316. // used with internal or external load balancing. A backend service
  4317. // created for one type of load balancing cannot be used with the other.
  4318. // Possible values are INTERNAL and EXTERNAL.
  4319. //
  4320. // Possible values:
  4321. // "EXTERNAL"
  4322. // "INTERNAL"
  4323. // "INTERNAL_MANAGED"
  4324. // "INTERNAL_SELF_MANAGED"
  4325. // "INVALID_LOAD_BALANCING_SCHEME"
  4326. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  4327. // LocalityLbPolicy: The load balancing algorithm used within the scope
  4328. // of the locality. The possible values are:
  4329. // - ROUND_ROBIN: This is a simple policy in which each healthy backend
  4330. // is selected in round robin order. This is the default.
  4331. // - LEAST_REQUEST: An O(1) algorithm which selects two random healthy
  4332. // hosts and picks the host which has fewer active requests.
  4333. // - RING_HASH: The ring/modulo hash load balancer implements consistent
  4334. // hashing to backends. The algorithm has the property that the
  4335. // addition/removal of a host from a set of N hosts only affects 1/N of
  4336. // the requests.
  4337. // - RANDOM: The load balancer selects a random healthy host.
  4338. // - ORIGINAL_DESTINATION: Backend host is selected based on the client
  4339. // connection metadata, i.e., connections are opened to the same address
  4340. // as the destination address of the incoming connection before the
  4341. // connection was redirected to the load balancer.
  4342. // - MAGLEV: used as a drop in replacement for the ring hash load
  4343. // balancer. Maglev is not as stable as ring hash but has faster table
  4344. // lookup build times and host selection times. For more information
  4345. // about Maglev, refer to https://ai.google/research/pubs/pub44824
  4346. //
  4347. //
  4348. // This field is applicable to either:
  4349. // - A regional backend service with the service_protocol set to HTTP,
  4350. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  4351. //
  4352. // - A global backend service with the load_balancing_scheme set to
  4353. // INTERNAL_SELF_MANAGED.
  4354. //
  4355. // Possible values:
  4356. // "INVALID_LB_POLICY"
  4357. // "LEAST_REQUEST"
  4358. // "MAGLEV"
  4359. // "ORINGINAL_DESTINATION"
  4360. // "RANDOM"
  4361. // "RING_HASH"
  4362. // "ROUND_ROBIN"
  4363. LocalityLbPolicy string `json:"localityLbPolicy,omitempty"`
  4364. // LogConfig: This field denotes the logging options for the load
  4365. // balancer traffic served by this backend service. If logging is
  4366. // enabled, logs will be exported to Stackdriver.
  4367. LogConfig *BackendServiceLogConfig `json:"logConfig,omitempty"`
  4368. // Name: Name of the resource. Provided by the client when the resource
  4369. // is created. The name must be 1-63 characters long, and comply with
  4370. // RFC1035. Specifically, the name must be 1-63 characters long and
  4371. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4372. // the first character must be a lowercase letter, and all following
  4373. // characters must be a dash, lowercase letter, or digit, except the
  4374. // last character, which cannot be a dash.
  4375. Name string `json:"name,omitempty"`
  4376. // OutlierDetection: Settings controlling eviction of unhealthy hosts
  4377. // from the load balancing pool. This field is applicable to either:
  4378. // - A regional backend service with the service_protocol set to HTTP,
  4379. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  4380. //
  4381. // - A global backend service with the load_balancing_scheme set to
  4382. // INTERNAL_SELF_MANAGED.
  4383. OutlierDetection *OutlierDetection `json:"outlierDetection,omitempty"`
  4384. // Port: Deprecated in favor of portName. The TCP port to connect on the
  4385. // backend. The default value is 80.
  4386. //
  4387. // This cannot be used for internal load balancing.
  4388. Port int64 `json:"port,omitempty"`
  4389. // PortName: Name of backend port. The same name should appear in the
  4390. // instance groups referenced by this service. Required when the load
  4391. // balancing scheme is EXTERNAL.
  4392. //
  4393. // When the load balancing scheme is INTERNAL, this field is not used.
  4394. PortName string `json:"portName,omitempty"`
  4395. // Protocol: The protocol this BackendService uses to communicate with
  4396. // backends.
  4397. //
  4398. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  4399. // HTTP.
  4400. //
  4401. // For internal load balancing, the possible values are TCP and UDP, and
  4402. // the default is TCP.
  4403. //
  4404. // Possible values:
  4405. // "HTTP"
  4406. // "HTTP2"
  4407. // "HTTPS"
  4408. // "SSL"
  4409. // "TCP"
  4410. // "UDP"
  4411. Protocol string `json:"protocol,omitempty"`
  4412. // Region: [Output Only] URL of the region where the regional backend
  4413. // service resides. This field is not applicable to global backend
  4414. // services. You must specify this field as part of the HTTP request
  4415. // URL. It is not settable as a field in the request body.
  4416. Region string `json:"region,omitempty"`
  4417. // SecurityPolicy: [Output Only] The resource URL for the security
  4418. // policy associated with this backend service.
  4419. SecurityPolicy string `json:"securityPolicy,omitempty"`
  4420. // SecuritySettings: This field specifies the security policy that
  4421. // applies to this backend service. This field is applicable to either:
  4422. //
  4423. // - A regional backend service with the service_protocol set to HTTP,
  4424. // HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED.
  4425. //
  4426. // - A global backend service with the load_balancing_scheme set to
  4427. // INTERNAL_SELF_MANAGED.
  4428. SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"`
  4429. // SelfLink: [Output Only] Server-defined URL for the resource.
  4430. SelfLink string `json:"selfLink,omitempty"`
  4431. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  4432. // with the resource id.
  4433. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  4434. // SessionAffinity: Type of session affinity to use. The default is
  4435. // NONE.
  4436. //
  4437. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  4438. // or GENERATED_COOKIE.
  4439. //
  4440. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  4441. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  4442. //
  4443. // When the protocol is UDP, this field is not used.
  4444. //
  4445. // Possible values:
  4446. // "CLIENT_IP"
  4447. // "CLIENT_IP_PORT_PROTO"
  4448. // "CLIENT_IP_PROTO"
  4449. // "GENERATED_COOKIE"
  4450. // "HEADER_FIELD"
  4451. // "HTTP_COOKIE"
  4452. // "NONE"
  4453. SessionAffinity string `json:"sessionAffinity,omitempty"`
  4454. // TimeoutSec: How many seconds to wait for the backend before
  4455. // considering it a failed request. Default is 30 seconds.
  4456. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  4457. // ServerResponse contains the HTTP response code and headers from the
  4458. // server.
  4459. googleapi.ServerResponse `json:"-"`
  4460. // ForceSendFields is a list of field names (e.g.
  4461. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  4462. // By default, fields with empty values are omitted from API requests.
  4463. // However, any non-pointer, non-interface field appearing in
  4464. // ForceSendFields will be sent to the server regardless of whether the
  4465. // field is empty or not. This may be used to include empty fields in
  4466. // Patch requests.
  4467. ForceSendFields []string `json:"-"`
  4468. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  4469. // include in API requests with the JSON null value. By default, fields
  4470. // with empty values are omitted from API requests. However, any field
  4471. // with an empty value appearing in NullFields will be sent to the
  4472. // server as null. It is an error if a field in this list has a
  4473. // non-empty value. This may be used to include null fields in Patch
  4474. // requests.
  4475. NullFields []string `json:"-"`
  4476. }
  4477. func (s *BackendService) MarshalJSON() ([]byte, error) {
  4478. type NoMethod BackendService
  4479. raw := NoMethod(*s)
  4480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4481. }
  4482. // BackendServiceAggregatedList: Contains a list of
  4483. // BackendServicesScopedList.
  4484. type BackendServiceAggregatedList struct {
  4485. // Id: [Output Only] Unique identifier for the resource; defined by the
  4486. // server.
  4487. Id string `json:"id,omitempty"`
  4488. // Items: A list of BackendServicesScopedList resources.
  4489. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  4490. // Kind: Type of resource.
  4491. Kind string `json:"kind,omitempty"`
  4492. // NextPageToken: [Output Only] This token allows you to get the next
  4493. // page of results for list requests. If the number of results is larger
  4494. // than maxResults, use the nextPageToken as a value for the query
  4495. // parameter pageToken in the next list request. Subsequent list
  4496. // requests will have their own nextPageToken to continue paging through
  4497. // the results.
  4498. NextPageToken string `json:"nextPageToken,omitempty"`
  4499. // SelfLink: [Output Only] Server-defined URL for this resource.
  4500. SelfLink string `json:"selfLink,omitempty"`
  4501. // Warning: [Output Only] Informational warning message.
  4502. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  4503. // ServerResponse contains the HTTP response code and headers from the
  4504. // server.
  4505. googleapi.ServerResponse `json:"-"`
  4506. // ForceSendFields is a list of field names (e.g. "Id") to
  4507. // unconditionally include in API requests. By default, fields with
  4508. // empty values are omitted from API requests. However, any non-pointer,
  4509. // non-interface field appearing in ForceSendFields will be sent to the
  4510. // server regardless of whether the field is empty or not. This may be
  4511. // used to include empty fields in Patch requests.
  4512. ForceSendFields []string `json:"-"`
  4513. // NullFields is a list of field names (e.g. "Id") to include in API
  4514. // requests with the JSON null value. By default, fields with empty
  4515. // values are omitted from API requests. However, any field with an
  4516. // empty value appearing in NullFields will be sent to the server as
  4517. // null. It is an error if a field in this list has a non-empty value.
  4518. // This may be used to include null fields in Patch requests.
  4519. NullFields []string `json:"-"`
  4520. }
  4521. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  4522. type NoMethod BackendServiceAggregatedList
  4523. raw := NoMethod(*s)
  4524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4525. }
  4526. // BackendServiceAggregatedListWarning: [Output Only] Informational
  4527. // warning message.
  4528. type BackendServiceAggregatedListWarning struct {
  4529. // Code: [Output Only] A warning code, if applicable. For example,
  4530. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4531. // the response.
  4532. //
  4533. // Possible values:
  4534. // "CLEANUP_FAILED"
  4535. // "DEPRECATED_RESOURCE_USED"
  4536. // "DEPRECATED_TYPE_USED"
  4537. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4538. // "EXPERIMENTAL_TYPE_USED"
  4539. // "EXTERNAL_API_WARNING"
  4540. // "FIELD_VALUE_OVERRIDEN"
  4541. // "INJECTED_KERNELS_DEPRECATED"
  4542. // "MISSING_TYPE_DEPENDENCY"
  4543. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4544. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4545. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4546. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4547. // "NEXT_HOP_NOT_RUNNING"
  4548. // "NOT_CRITICAL_ERROR"
  4549. // "NO_RESULTS_ON_PAGE"
  4550. // "REQUIRED_TOS_AGREEMENT"
  4551. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4552. // "RESOURCE_NOT_DELETED"
  4553. // "SCHEMA_VALIDATION_IGNORED"
  4554. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4555. // "UNDECLARED_PROPERTIES"
  4556. // "UNREACHABLE"
  4557. Code string `json:"code,omitempty"`
  4558. // Data: [Output Only] Metadata about this warning in key: value format.
  4559. // For example:
  4560. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4561. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  4562. // Message: [Output Only] A human-readable description of the warning
  4563. // code.
  4564. Message string `json:"message,omitempty"`
  4565. // ForceSendFields is a list of field names (e.g. "Code") to
  4566. // unconditionally include in API requests. By default, fields with
  4567. // empty values are omitted from API requests. However, any non-pointer,
  4568. // non-interface field appearing in ForceSendFields will be sent to the
  4569. // server regardless of whether the field is empty or not. This may be
  4570. // used to include empty fields in Patch requests.
  4571. ForceSendFields []string `json:"-"`
  4572. // NullFields is a list of field names (e.g. "Code") to include in API
  4573. // requests with the JSON null value. By default, fields with empty
  4574. // values are omitted from API requests. However, any field with an
  4575. // empty value appearing in NullFields will be sent to the server as
  4576. // null. It is an error if a field in this list has a non-empty value.
  4577. // This may be used to include null fields in Patch requests.
  4578. NullFields []string `json:"-"`
  4579. }
  4580. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4581. type NoMethod BackendServiceAggregatedListWarning
  4582. raw := NoMethod(*s)
  4583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4584. }
  4585. type BackendServiceAggregatedListWarningData struct {
  4586. // Key: [Output Only] A key that provides more detail on the warning
  4587. // being returned. For example, for warnings where there are no results
  4588. // in a list request for a particular zone, this key might be scope and
  4589. // the key value might be the zone name. Other examples might be a key
  4590. // indicating a deprecated resource and a suggested replacement, or a
  4591. // warning about invalid network settings (for example, if an instance
  4592. // attempts to perform IP forwarding but is not enabled for IP
  4593. // forwarding).
  4594. Key string `json:"key,omitempty"`
  4595. // Value: [Output Only] A warning data value corresponding to the key.
  4596. Value string `json:"value,omitempty"`
  4597. // ForceSendFields is a list of field names (e.g. "Key") to
  4598. // unconditionally include in API requests. By default, fields with
  4599. // empty values are omitted from API requests. However, any non-pointer,
  4600. // non-interface field appearing in ForceSendFields will be sent to the
  4601. // server regardless of whether the field is empty or not. This may be
  4602. // used to include empty fields in Patch requests.
  4603. ForceSendFields []string `json:"-"`
  4604. // NullFields is a list of field names (e.g. "Key") to include in API
  4605. // requests with the JSON null value. By default, fields with empty
  4606. // values are omitted from API requests. However, any field with an
  4607. // empty value appearing in NullFields will be sent to the server as
  4608. // null. It is an error if a field in this list has a non-empty value.
  4609. // This may be used to include null fields in Patch requests.
  4610. NullFields []string `json:"-"`
  4611. }
  4612. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4613. type NoMethod BackendServiceAggregatedListWarningData
  4614. raw := NoMethod(*s)
  4615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4616. }
  4617. // BackendServiceAppEngineBackend: Configuration of a App Engine
  4618. // backend.
  4619. type BackendServiceAppEngineBackend struct {
  4620. // AppEngineService: Optional. App Engine app service name.
  4621. AppEngineService string `json:"appEngineService,omitempty"`
  4622. // TargetProject: Required. Project ID of the project hosting the app.
  4623. // This is the project ID of this project. Reference to another project
  4624. // is not allowed.
  4625. TargetProject string `json:"targetProject,omitempty"`
  4626. // Version: Optional. Version of App Engine app service. When empty, App
  4627. // Engine will do its normal traffic split.
  4628. Version string `json:"version,omitempty"`
  4629. // ForceSendFields is a list of field names (e.g. "AppEngineService") to
  4630. // unconditionally include in API requests. By default, fields with
  4631. // empty values are omitted from API requests. However, any non-pointer,
  4632. // non-interface field appearing in ForceSendFields will be sent to the
  4633. // server regardless of whether the field is empty or not. This may be
  4634. // used to include empty fields in Patch requests.
  4635. ForceSendFields []string `json:"-"`
  4636. // NullFields is a list of field names (e.g. "AppEngineService") to
  4637. // include in API requests with the JSON null value. By default, fields
  4638. // with empty values are omitted from API requests. However, any field
  4639. // with an empty value appearing in NullFields will be sent to the
  4640. // server as null. It is an error if a field in this list has a
  4641. // non-empty value. This may be used to include null fields in Patch
  4642. // requests.
  4643. NullFields []string `json:"-"`
  4644. }
  4645. func (s *BackendServiceAppEngineBackend) MarshalJSON() ([]byte, error) {
  4646. type NoMethod BackendServiceAppEngineBackend
  4647. raw := NoMethod(*s)
  4648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4649. }
  4650. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  4651. // for a backend service.
  4652. type BackendServiceCdnPolicy struct {
  4653. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  4654. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  4655. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  4656. // signed URL request will be considered fresh. After this time period,
  4657. // the response will be revalidated before being served. Defaults to 1hr
  4658. // (3600s). When serving responses to signed URL requests, Cloud CDN
  4659. // will internally behave as though all responses from this backend had
  4660. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  4661. // existing Cache-Control header. The actual headers served in responses
  4662. // will not be altered.
  4663. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  4664. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  4665. // request URLs.
  4666. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  4667. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  4668. // unconditionally include in API requests. By default, fields with
  4669. // empty values are omitted from API requests. However, any non-pointer,
  4670. // non-interface field appearing in ForceSendFields will be sent to the
  4671. // server regardless of whether the field is empty or not. This may be
  4672. // used to include empty fields in Patch requests.
  4673. ForceSendFields []string `json:"-"`
  4674. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  4675. // include in API requests with the JSON null value. By default, fields
  4676. // with empty values are omitted from API requests. However, any field
  4677. // with an empty value appearing in NullFields will be sent to the
  4678. // server as null. It is an error if a field in this list has a
  4679. // non-empty value. This may be used to include null fields in Patch
  4680. // requests.
  4681. NullFields []string `json:"-"`
  4682. }
  4683. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  4684. type NoMethod BackendServiceCdnPolicy
  4685. raw := NoMethod(*s)
  4686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4687. }
  4688. // BackendServiceCloudFunctionBackend: Configuration of a Cloud Function
  4689. // backend.
  4690. type BackendServiceCloudFunctionBackend struct {
  4691. // FunctionName: Required. A cloud function name. Special value ?*?
  4692. // represents all cloud functions in the project.
  4693. FunctionName string `json:"functionName,omitempty"`
  4694. // TargetProject: Required. Project ID of the project hosting the cloud
  4695. // function.
  4696. TargetProject string `json:"targetProject,omitempty"`
  4697. // ForceSendFields is a list of field names (e.g. "FunctionName") to
  4698. // unconditionally include in API requests. By default, fields with
  4699. // empty values are omitted from API requests. However, any non-pointer,
  4700. // non-interface field appearing in ForceSendFields will be sent to the
  4701. // server regardless of whether the field is empty or not. This may be
  4702. // used to include empty fields in Patch requests.
  4703. ForceSendFields []string `json:"-"`
  4704. // NullFields is a list of field names (e.g. "FunctionName") to include
  4705. // in API requests with the JSON null value. By default, fields with
  4706. // empty values are omitted from API requests. However, any field with
  4707. // an empty value appearing in NullFields will be sent to the server as
  4708. // null. It is an error if a field in this list has a non-empty value.
  4709. // This may be used to include null fields in Patch requests.
  4710. NullFields []string `json:"-"`
  4711. }
  4712. func (s *BackendServiceCloudFunctionBackend) MarshalJSON() ([]byte, error) {
  4713. type NoMethod BackendServiceCloudFunctionBackend
  4714. raw := NoMethod(*s)
  4715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4716. }
  4717. type BackendServiceFailoverPolicy struct {
  4718. // DisableConnectionDrainOnFailover: On failover or failback, this field
  4719. // indicates whether connection drain will be honored. Setting this to
  4720. // true has the following effect: connections to the old active pool are
  4721. // not drained. Connections to the new active pool use the timeout of 10
  4722. // min (currently fixed). Setting to false has the following effect:
  4723. // both old and new connections will have a drain timeout of 10
  4724. // min.
  4725. //
  4726. // This can be set to true only if the protocol is TCP.
  4727. //
  4728. // The default is false.
  4729. DisableConnectionDrainOnFailover bool `json:"disableConnectionDrainOnFailover,omitempty"`
  4730. // DropTrafficIfUnhealthy: This option is used only when no healthy VMs
  4731. // are detected in the primary and backup instance groups. When set to
  4732. // true, traffic is dropped. When set to false, new connections are sent
  4733. // across all VMs in the primary group.
  4734. //
  4735. // The default is false.
  4736. DropTrafficIfUnhealthy bool `json:"dropTrafficIfUnhealthy,omitempty"`
  4737. // FailoverRatio: The value of the field must be in [0, 1]. If the ratio
  4738. // of the healthy VMs in the primary backend is at or below this number,
  4739. // traffic arriving at the load-balanced IP will be directed to the
  4740. // failover backend.
  4741. //
  4742. // In case where 'failoverRatio' is not set or all the VMs in the backup
  4743. // backend are unhealthy, the traffic will be directed back to the
  4744. // primary backend in the "force" mode, where traffic will be spread to
  4745. // the healthy VMs with the best effort, or to all VMs when no VM is
  4746. // healthy.
  4747. //
  4748. // This field is only used with l4 load balancing.
  4749. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  4750. // ForceSendFields is a list of field names (e.g.
  4751. // "DisableConnectionDrainOnFailover") to unconditionally include in API
  4752. // requests. By default, fields with empty values are omitted from API
  4753. // requests. However, any non-pointer, non-interface field appearing in
  4754. // ForceSendFields will be sent to the server regardless of whether the
  4755. // field is empty or not. This may be used to include empty fields in
  4756. // Patch requests.
  4757. ForceSendFields []string `json:"-"`
  4758. // NullFields is a list of field names (e.g.
  4759. // "DisableConnectionDrainOnFailover") to include in API requests with
  4760. // the JSON null value. By default, fields with empty values are omitted
  4761. // from API requests. However, any field with an empty value appearing
  4762. // in NullFields will be sent to the server as null. It is an error if a
  4763. // field in this list has a non-empty value. This may be used to include
  4764. // null fields in Patch requests.
  4765. NullFields []string `json:"-"`
  4766. }
  4767. func (s *BackendServiceFailoverPolicy) MarshalJSON() ([]byte, error) {
  4768. type NoMethod BackendServiceFailoverPolicy
  4769. raw := NoMethod(*s)
  4770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4771. }
  4772. func (s *BackendServiceFailoverPolicy) UnmarshalJSON(data []byte) error {
  4773. type NoMethod BackendServiceFailoverPolicy
  4774. var s1 struct {
  4775. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  4776. *NoMethod
  4777. }
  4778. s1.NoMethod = (*NoMethod)(s)
  4779. if err := json.Unmarshal(data, &s1); err != nil {
  4780. return err
  4781. }
  4782. s.FailoverRatio = float64(s1.FailoverRatio)
  4783. return nil
  4784. }
  4785. type BackendServiceGroupHealth struct {
  4786. // Annotations: Metadata defined as annotations on the network endpoint
  4787. // group.
  4788. Annotations map[string]string `json:"annotations,omitempty"`
  4789. // HealthStatus: Health state of the backend instances or endpoints in
  4790. // requested instance or network endpoint group, determined based on
  4791. // configured health checks.
  4792. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  4793. // Kind: [Output Only] Type of resource. Always
  4794. // compute#backendServiceGroupHealth for the health of backend services.
  4795. Kind string `json:"kind,omitempty"`
  4796. // ServerResponse contains the HTTP response code and headers from the
  4797. // server.
  4798. googleapi.ServerResponse `json:"-"`
  4799. // ForceSendFields is a list of field names (e.g. "Annotations") to
  4800. // unconditionally include in API requests. By default, fields with
  4801. // empty values are omitted from API requests. However, any non-pointer,
  4802. // non-interface field appearing in ForceSendFields will be sent to the
  4803. // server regardless of whether the field is empty or not. This may be
  4804. // used to include empty fields in Patch requests.
  4805. ForceSendFields []string `json:"-"`
  4806. // NullFields is a list of field names (e.g. "Annotations") to include
  4807. // in API requests with the JSON null value. By default, fields with
  4808. // empty values are omitted from API requests. However, any field with
  4809. // an empty value appearing in NullFields will be sent to the server as
  4810. // null. It is an error if a field in this list has a non-empty value.
  4811. // This may be used to include null fields in Patch requests.
  4812. NullFields []string `json:"-"`
  4813. }
  4814. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  4815. type NoMethod BackendServiceGroupHealth
  4816. raw := NoMethod(*s)
  4817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4818. }
  4819. // BackendServiceIAP: Identity-Aware Proxy
  4820. type BackendServiceIAP struct {
  4821. Enabled bool `json:"enabled,omitempty"`
  4822. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  4823. // Oauth2ClientInfo: [Input Only] OAuth client info required to generate
  4824. // client id to be used for IAP.
  4825. Oauth2ClientInfo *BackendServiceIAPOAuth2ClientInfo `json:"oauth2ClientInfo,omitempty"`
  4826. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  4827. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  4828. // field oauth2_client_secret above.
  4829. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  4830. // ForceSendFields is a list of field names (e.g. "Enabled") to
  4831. // unconditionally include in API requests. By default, fields with
  4832. // empty values are omitted from API requests. However, any non-pointer,
  4833. // non-interface field appearing in ForceSendFields will be sent to the
  4834. // server regardless of whether the field is empty or not. This may be
  4835. // used to include empty fields in Patch requests.
  4836. ForceSendFields []string `json:"-"`
  4837. // NullFields is a list of field names (e.g. "Enabled") to include in
  4838. // API requests with the JSON null value. By default, fields with empty
  4839. // values are omitted from API requests. However, any field with an
  4840. // empty value appearing in NullFields will be sent to the server as
  4841. // null. It is an error if a field in this list has a non-empty value.
  4842. // This may be used to include null fields in Patch requests.
  4843. NullFields []string `json:"-"`
  4844. }
  4845. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  4846. type NoMethod BackendServiceIAP
  4847. raw := NoMethod(*s)
  4848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4849. }
  4850. type BackendServiceIAPOAuth2ClientInfo struct {
  4851. // ApplicationName: Application name to be used in OAuth consent screen.
  4852. ApplicationName string `json:"applicationName,omitempty"`
  4853. // ClientName: Name of the client to be generated. Optional - If not
  4854. // provided, the name will be autogenerated by the backend.
  4855. ClientName string `json:"clientName,omitempty"`
  4856. // DeveloperEmailAddress: Developer's information to be used in OAuth
  4857. // consent screen.
  4858. DeveloperEmailAddress string `json:"developerEmailAddress,omitempty"`
  4859. // ForceSendFields is a list of field names (e.g. "ApplicationName") to
  4860. // unconditionally include in API requests. By default, fields with
  4861. // empty values are omitted from API requests. However, any non-pointer,
  4862. // non-interface field appearing in ForceSendFields will be sent to the
  4863. // server regardless of whether the field is empty or not. This may be
  4864. // used to include empty fields in Patch requests.
  4865. ForceSendFields []string `json:"-"`
  4866. // NullFields is a list of field names (e.g. "ApplicationName") to
  4867. // include in API requests with the JSON null value. By default, fields
  4868. // with empty values are omitted from API requests. However, any field
  4869. // with an empty value appearing in NullFields will be sent to the
  4870. // server as null. It is an error if a field in this list has a
  4871. // non-empty value. This may be used to include null fields in Patch
  4872. // requests.
  4873. NullFields []string `json:"-"`
  4874. }
  4875. func (s *BackendServiceIAPOAuth2ClientInfo) MarshalJSON() ([]byte, error) {
  4876. type NoMethod BackendServiceIAPOAuth2ClientInfo
  4877. raw := NoMethod(*s)
  4878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4879. }
  4880. // BackendServiceList: Contains a list of BackendService resources.
  4881. type BackendServiceList struct {
  4882. // Id: [Output Only] Unique identifier for the resource; defined by the
  4883. // server.
  4884. Id string `json:"id,omitempty"`
  4885. // Items: A list of BackendService resources.
  4886. Items []*BackendService `json:"items,omitempty"`
  4887. // Kind: [Output Only] Type of resource. Always
  4888. // compute#backendServiceList for lists of backend services.
  4889. Kind string `json:"kind,omitempty"`
  4890. // NextPageToken: [Output Only] This token allows you to get the next
  4891. // page of results for list requests. If the number of results is larger
  4892. // than maxResults, use the nextPageToken as a value for the query
  4893. // parameter pageToken in the next list request. Subsequent list
  4894. // requests will have their own nextPageToken to continue paging through
  4895. // the results.
  4896. NextPageToken string `json:"nextPageToken,omitempty"`
  4897. // SelfLink: [Output Only] Server-defined URL for this resource.
  4898. SelfLink string `json:"selfLink,omitempty"`
  4899. // Warning: [Output Only] Informational warning message.
  4900. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  4901. // ServerResponse contains the HTTP response code and headers from the
  4902. // server.
  4903. googleapi.ServerResponse `json:"-"`
  4904. // ForceSendFields is a list of field names (e.g. "Id") to
  4905. // unconditionally include in API requests. By default, fields with
  4906. // empty values are omitted from API requests. However, any non-pointer,
  4907. // non-interface field appearing in ForceSendFields will be sent to the
  4908. // server regardless of whether the field is empty or not. This may be
  4909. // used to include empty fields in Patch requests.
  4910. ForceSendFields []string `json:"-"`
  4911. // NullFields is a list of field names (e.g. "Id") to include in API
  4912. // requests with the JSON null value. By default, fields with empty
  4913. // values are omitted from API requests. However, any field with an
  4914. // empty value appearing in NullFields will be sent to the server as
  4915. // null. It is an error if a field in this list has a non-empty value.
  4916. // This may be used to include null fields in Patch requests.
  4917. NullFields []string `json:"-"`
  4918. }
  4919. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  4920. type NoMethod BackendServiceList
  4921. raw := NoMethod(*s)
  4922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4923. }
  4924. // BackendServiceListWarning: [Output Only] Informational warning
  4925. // message.
  4926. type BackendServiceListWarning struct {
  4927. // Code: [Output Only] A warning code, if applicable. For example,
  4928. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4929. // the response.
  4930. //
  4931. // Possible values:
  4932. // "CLEANUP_FAILED"
  4933. // "DEPRECATED_RESOURCE_USED"
  4934. // "DEPRECATED_TYPE_USED"
  4935. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4936. // "EXPERIMENTAL_TYPE_USED"
  4937. // "EXTERNAL_API_WARNING"
  4938. // "FIELD_VALUE_OVERRIDEN"
  4939. // "INJECTED_KERNELS_DEPRECATED"
  4940. // "MISSING_TYPE_DEPENDENCY"
  4941. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4942. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4943. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4944. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4945. // "NEXT_HOP_NOT_RUNNING"
  4946. // "NOT_CRITICAL_ERROR"
  4947. // "NO_RESULTS_ON_PAGE"
  4948. // "REQUIRED_TOS_AGREEMENT"
  4949. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4950. // "RESOURCE_NOT_DELETED"
  4951. // "SCHEMA_VALIDATION_IGNORED"
  4952. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4953. // "UNDECLARED_PROPERTIES"
  4954. // "UNREACHABLE"
  4955. Code string `json:"code,omitempty"`
  4956. // Data: [Output Only] Metadata about this warning in key: value format.
  4957. // For example:
  4958. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4959. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  4960. // Message: [Output Only] A human-readable description of the warning
  4961. // code.
  4962. Message string `json:"message,omitempty"`
  4963. // ForceSendFields is a list of field names (e.g. "Code") to
  4964. // unconditionally include in API requests. By default, fields with
  4965. // empty values are omitted from API requests. However, any non-pointer,
  4966. // non-interface field appearing in ForceSendFields will be sent to the
  4967. // server regardless of whether the field is empty or not. This may be
  4968. // used to include empty fields in Patch requests.
  4969. ForceSendFields []string `json:"-"`
  4970. // NullFields is a list of field names (e.g. "Code") to include in API
  4971. // requests with the JSON null value. By default, fields with empty
  4972. // values are omitted from API requests. However, any field with an
  4973. // empty value appearing in NullFields will be sent to the server as
  4974. // null. It is an error if a field in this list has a non-empty value.
  4975. // This may be used to include null fields in Patch requests.
  4976. NullFields []string `json:"-"`
  4977. }
  4978. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  4979. type NoMethod BackendServiceListWarning
  4980. raw := NoMethod(*s)
  4981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4982. }
  4983. type BackendServiceListWarningData struct {
  4984. // Key: [Output Only] A key that provides more detail on the warning
  4985. // being returned. For example, for warnings where there are no results
  4986. // in a list request for a particular zone, this key might be scope and
  4987. // the key value might be the zone name. Other examples might be a key
  4988. // indicating a deprecated resource and a suggested replacement, or a
  4989. // warning about invalid network settings (for example, if an instance
  4990. // attempts to perform IP forwarding but is not enabled for IP
  4991. // forwarding).
  4992. Key string `json:"key,omitempty"`
  4993. // Value: [Output Only] A warning data value corresponding to the key.
  4994. Value string `json:"value,omitempty"`
  4995. // ForceSendFields is a list of field names (e.g. "Key") to
  4996. // unconditionally include in API requests. By default, fields with
  4997. // empty values are omitted from API requests. However, any non-pointer,
  4998. // non-interface field appearing in ForceSendFields will be sent to the
  4999. // server regardless of whether the field is empty or not. This may be
  5000. // used to include empty fields in Patch requests.
  5001. ForceSendFields []string `json:"-"`
  5002. // NullFields is a list of field names (e.g. "Key") to include in API
  5003. // requests with the JSON null value. By default, fields with empty
  5004. // values are omitted from API requests. However, any field with an
  5005. // empty value appearing in NullFields will be sent to the server as
  5006. // null. It is an error if a field in this list has a non-empty value.
  5007. // This may be used to include null fields in Patch requests.
  5008. NullFields []string `json:"-"`
  5009. }
  5010. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  5011. type NoMethod BackendServiceListWarningData
  5012. raw := NoMethod(*s)
  5013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5014. }
  5015. // BackendServiceLogConfig: The available logging options for the load
  5016. // balancer traffic served by this backend service.
  5017. type BackendServiceLogConfig struct {
  5018. // Enable: This field denotes whether to enable logging for the load
  5019. // balancer traffic served by this backend service.
  5020. Enable bool `json:"enable,omitempty"`
  5021. // SampleRate: This field can only be specified if logging is enabled
  5022. // for this backend service. The value of the field must be in [0, 1].
  5023. // This configures the sampling rate of requests to the load balancer
  5024. // where 1.0 means all logged requests are reported and 0.0 means no
  5025. // logged requests are reported. The default value is 1.0.
  5026. SampleRate float64 `json:"sampleRate,omitempty"`
  5027. // ForceSendFields is a list of field names (e.g. "Enable") to
  5028. // unconditionally include in API requests. By default, fields with
  5029. // empty values are omitted from API requests. However, any non-pointer,
  5030. // non-interface field appearing in ForceSendFields will be sent to the
  5031. // server regardless of whether the field is empty or not. This may be
  5032. // used to include empty fields in Patch requests.
  5033. ForceSendFields []string `json:"-"`
  5034. // NullFields is a list of field names (e.g. "Enable") to include in API
  5035. // requests with the JSON null value. By default, fields with empty
  5036. // values are omitted from API requests. However, any field with an
  5037. // empty value appearing in NullFields will be sent to the server as
  5038. // null. It is an error if a field in this list has a non-empty value.
  5039. // This may be used to include null fields in Patch requests.
  5040. NullFields []string `json:"-"`
  5041. }
  5042. func (s *BackendServiceLogConfig) MarshalJSON() ([]byte, error) {
  5043. type NoMethod BackendServiceLogConfig
  5044. raw := NoMethod(*s)
  5045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5046. }
  5047. func (s *BackendServiceLogConfig) UnmarshalJSON(data []byte) error {
  5048. type NoMethod BackendServiceLogConfig
  5049. var s1 struct {
  5050. SampleRate gensupport.JSONFloat64 `json:"sampleRate"`
  5051. *NoMethod
  5052. }
  5053. s1.NoMethod = (*NoMethod)(s)
  5054. if err := json.Unmarshal(data, &s1); err != nil {
  5055. return err
  5056. }
  5057. s.SampleRate = float64(s1.SampleRate)
  5058. return nil
  5059. }
  5060. type BackendServiceReference struct {
  5061. BackendService string `json:"backendService,omitempty"`
  5062. // ForceSendFields is a list of field names (e.g. "BackendService") to
  5063. // unconditionally include in API requests. By default, fields with
  5064. // empty values are omitted from API requests. However, any non-pointer,
  5065. // non-interface field appearing in ForceSendFields will be sent to the
  5066. // server regardless of whether the field is empty or not. This may be
  5067. // used to include empty fields in Patch requests.
  5068. ForceSendFields []string `json:"-"`
  5069. // NullFields is a list of field names (e.g. "BackendService") to
  5070. // include in API requests with the JSON null value. By default, fields
  5071. // with empty values are omitted from API requests. However, any field
  5072. // with an empty value appearing in NullFields will be sent to the
  5073. // server as null. It is an error if a field in this list has a
  5074. // non-empty value. This may be used to include null fields in Patch
  5075. // requests.
  5076. NullFields []string `json:"-"`
  5077. }
  5078. func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
  5079. type NoMethod BackendServiceReference
  5080. raw := NoMethod(*s)
  5081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5082. }
  5083. type BackendServicesScopedList struct {
  5084. // BackendServices: A list of BackendServices contained in this scope.
  5085. BackendServices []*BackendService `json:"backendServices,omitempty"`
  5086. // Warning: Informational warning which replaces the list of backend
  5087. // services when the list is empty.
  5088. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  5089. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  5090. // unconditionally include in API requests. By default, fields with
  5091. // empty values are omitted from API requests. However, any non-pointer,
  5092. // non-interface field appearing in ForceSendFields will be sent to the
  5093. // server regardless of whether the field is empty or not. This may be
  5094. // used to include empty fields in Patch requests.
  5095. ForceSendFields []string `json:"-"`
  5096. // NullFields is a list of field names (e.g. "BackendServices") to
  5097. // include in API requests with the JSON null value. By default, fields
  5098. // with empty values are omitted from API requests. However, any field
  5099. // with an empty value appearing in NullFields will be sent to the
  5100. // server as null. It is an error if a field in this list has a
  5101. // non-empty value. This may be used to include null fields in Patch
  5102. // requests.
  5103. NullFields []string `json:"-"`
  5104. }
  5105. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  5106. type NoMethod BackendServicesScopedList
  5107. raw := NoMethod(*s)
  5108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5109. }
  5110. // BackendServicesScopedListWarning: Informational warning which
  5111. // replaces the list of backend services when the list is empty.
  5112. type BackendServicesScopedListWarning struct {
  5113. // Code: [Output Only] A warning code, if applicable. For example,
  5114. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5115. // the response.
  5116. //
  5117. // Possible values:
  5118. // "CLEANUP_FAILED"
  5119. // "DEPRECATED_RESOURCE_USED"
  5120. // "DEPRECATED_TYPE_USED"
  5121. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5122. // "EXPERIMENTAL_TYPE_USED"
  5123. // "EXTERNAL_API_WARNING"
  5124. // "FIELD_VALUE_OVERRIDEN"
  5125. // "INJECTED_KERNELS_DEPRECATED"
  5126. // "MISSING_TYPE_DEPENDENCY"
  5127. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5128. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5129. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5130. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5131. // "NEXT_HOP_NOT_RUNNING"
  5132. // "NOT_CRITICAL_ERROR"
  5133. // "NO_RESULTS_ON_PAGE"
  5134. // "REQUIRED_TOS_AGREEMENT"
  5135. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5136. // "RESOURCE_NOT_DELETED"
  5137. // "SCHEMA_VALIDATION_IGNORED"
  5138. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5139. // "UNDECLARED_PROPERTIES"
  5140. // "UNREACHABLE"
  5141. Code string `json:"code,omitempty"`
  5142. // Data: [Output Only] Metadata about this warning in key: value format.
  5143. // For example:
  5144. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5145. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  5146. // Message: [Output Only] A human-readable description of the warning
  5147. // code.
  5148. Message string `json:"message,omitempty"`
  5149. // ForceSendFields is a list of field names (e.g. "Code") to
  5150. // unconditionally include in API requests. By default, fields with
  5151. // empty values are omitted from API requests. However, any non-pointer,
  5152. // non-interface field appearing in ForceSendFields will be sent to the
  5153. // server regardless of whether the field is empty or not. This may be
  5154. // used to include empty fields in Patch requests.
  5155. ForceSendFields []string `json:"-"`
  5156. // NullFields is a list of field names (e.g. "Code") to include in API
  5157. // requests with the JSON null value. By default, fields with empty
  5158. // values are omitted from API requests. However, any field with an
  5159. // empty value appearing in NullFields will be sent to the server as
  5160. // null. It is an error if a field in this list has a non-empty value.
  5161. // This may be used to include null fields in Patch requests.
  5162. NullFields []string `json:"-"`
  5163. }
  5164. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  5165. type NoMethod BackendServicesScopedListWarning
  5166. raw := NoMethod(*s)
  5167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5168. }
  5169. type BackendServicesScopedListWarningData struct {
  5170. // Key: [Output Only] A key that provides more detail on the warning
  5171. // being returned. For example, for warnings where there are no results
  5172. // in a list request for a particular zone, this key might be scope and
  5173. // the key value might be the zone name. Other examples might be a key
  5174. // indicating a deprecated resource and a suggested replacement, or a
  5175. // warning about invalid network settings (for example, if an instance
  5176. // attempts to perform IP forwarding but is not enabled for IP
  5177. // forwarding).
  5178. Key string `json:"key,omitempty"`
  5179. // Value: [Output Only] A warning data value corresponding to the key.
  5180. Value string `json:"value,omitempty"`
  5181. // ForceSendFields is a list of field names (e.g. "Key") to
  5182. // unconditionally include in API requests. By default, fields with
  5183. // empty values are omitted from API requests. However, any non-pointer,
  5184. // non-interface field appearing in ForceSendFields will be sent to the
  5185. // server regardless of whether the field is empty or not. This may be
  5186. // used to include empty fields in Patch requests.
  5187. ForceSendFields []string `json:"-"`
  5188. // NullFields is a list of field names (e.g. "Key") to include in API
  5189. // requests with the JSON null value. By default, fields with empty
  5190. // values are omitted from API requests. However, any field with an
  5191. // empty value appearing in NullFields will be sent to the server as
  5192. // null. It is an error if a field in this list has a non-empty value.
  5193. // This may be used to include null fields in Patch requests.
  5194. NullFields []string `json:"-"`
  5195. }
  5196. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  5197. type NoMethod BackendServicesScopedListWarningData
  5198. raw := NoMethod(*s)
  5199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5200. }
  5201. // Binding: Associates `members` with a `role`.
  5202. type Binding struct {
  5203. // Condition: Unimplemented. The condition that is associated with this
  5204. // binding. NOTE: an unsatisfied condition will not allow user access
  5205. // via current binding. Different bindings, including their conditions,
  5206. // are examined independently.
  5207. Condition *Expr `json:"condition,omitempty"`
  5208. // Members: Specifies the identities requesting access for a Cloud
  5209. // Platform resource. `members` can have the following values:
  5210. //
  5211. // * `allUsers`: A special identifier that represents anyone who is on
  5212. // the internet; with or without a Google account.
  5213. //
  5214. // * `allAuthenticatedUsers`: A special identifier that represents
  5215. // anyone who is authenticated with a Google account or a service
  5216. // account.
  5217. //
  5218. // * `user:{emailid}`: An email address that represents a specific
  5219. // Google account. For example, `alice@gmail.com` .
  5220. //
  5221. //
  5222. //
  5223. // * `serviceAccount:{emailid}`: An email address that represents a
  5224. // service account. For example,
  5225. // `my-other-app@appspot.gserviceaccount.com`.
  5226. //
  5227. // * `group:{emailid}`: An email address that represents a Google group.
  5228. // For example, `admins@example.com`.
  5229. //
  5230. //
  5231. //
  5232. // * `domain:{domain}`: The G Suite domain (primary) that represents all
  5233. // the users of that domain. For example, `google.com` or `example.com`.
  5234. Members []string `json:"members,omitempty"`
  5235. // Role: Role that is assigned to `members`. For example,
  5236. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  5237. Role string `json:"role,omitempty"`
  5238. // ForceSendFields is a list of field names (e.g. "Condition") to
  5239. // unconditionally include in API requests. By default, fields with
  5240. // empty values are omitted from API requests. However, any non-pointer,
  5241. // non-interface field appearing in ForceSendFields will be sent to the
  5242. // server regardless of whether the field is empty or not. This may be
  5243. // used to include empty fields in Patch requests.
  5244. ForceSendFields []string `json:"-"`
  5245. // NullFields is a list of field names (e.g. "Condition") to include in
  5246. // API requests with the JSON null value. By default, fields with empty
  5247. // values are omitted from API requests. However, any field with an
  5248. // empty value appearing in NullFields will be sent to the server as
  5249. // null. It is an error if a field in this list has a non-empty value.
  5250. // This may be used to include null fields in Patch requests.
  5251. NullFields []string `json:"-"`
  5252. }
  5253. func (s *Binding) MarshalJSON() ([]byte, error) {
  5254. type NoMethod Binding
  5255. raw := NoMethod(*s)
  5256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5257. }
  5258. type CacheInvalidationRule struct {
  5259. // Host: If set, this invalidation rule will only apply to requests with
  5260. // a Host header matching host.
  5261. Host string `json:"host,omitempty"`
  5262. Path string `json:"path,omitempty"`
  5263. // ForceSendFields is a list of field names (e.g. "Host") to
  5264. // unconditionally include in API requests. By default, fields with
  5265. // empty values are omitted from API requests. However, any non-pointer,
  5266. // non-interface field appearing in ForceSendFields will be sent to the
  5267. // server regardless of whether the field is empty or not. This may be
  5268. // used to include empty fields in Patch requests.
  5269. ForceSendFields []string `json:"-"`
  5270. // NullFields is a list of field names (e.g. "Host") to include in API
  5271. // requests with the JSON null value. By default, fields with empty
  5272. // values are omitted from API requests. However, any field with an
  5273. // empty value appearing in NullFields will be sent to the server as
  5274. // null. It is an error if a field in this list has a non-empty value.
  5275. // This may be used to include null fields in Patch requests.
  5276. NullFields []string `json:"-"`
  5277. }
  5278. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  5279. type NoMethod CacheInvalidationRule
  5280. raw := NoMethod(*s)
  5281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5282. }
  5283. // CacheKeyPolicy: Message containing what to include in the cache key
  5284. // for a request for Cloud CDN.
  5285. type CacheKeyPolicy struct {
  5286. // IncludeHost: If true, requests to different hosts will be cached
  5287. // separately.
  5288. IncludeHost bool `json:"includeHost,omitempty"`
  5289. // IncludeProtocol: If true, http and https requests will be cached
  5290. // separately.
  5291. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  5292. // IncludeQueryString: If true, include query string parameters in the
  5293. // cache key according to query_string_whitelist and
  5294. // query_string_blacklist. If neither is set, the entire query string
  5295. // will be included. If false, the query string will be excluded from
  5296. // the cache key entirely.
  5297. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  5298. // QueryStringBlacklist: Names of query string parameters to exclude in
  5299. // cache keys. All other parameters will be included. Either specify
  5300. // query_string_whitelist or query_string_blacklist, not both. '&' and
  5301. // '=' will be percent encoded and not treated as delimiters.
  5302. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  5303. // QueryStringWhitelist: Names of query string parameters to include in
  5304. // cache keys. All other parameters will be excluded. Either specify
  5305. // query_string_whitelist or query_string_blacklist, not both. '&' and
  5306. // '=' will be percent encoded and not treated as delimiters.
  5307. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  5308. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  5309. // unconditionally include in API requests. By default, fields with
  5310. // empty values are omitted from API requests. However, any non-pointer,
  5311. // non-interface field appearing in ForceSendFields will be sent to the
  5312. // server regardless of whether the field is empty or not. This may be
  5313. // used to include empty fields in Patch requests.
  5314. ForceSendFields []string `json:"-"`
  5315. // NullFields is a list of field names (e.g. "IncludeHost") to include
  5316. // in API requests with the JSON null value. By default, fields with
  5317. // empty values are omitted from API requests. However, any field with
  5318. // an empty value appearing in NullFields will be sent to the server as
  5319. // null. It is an error if a field in this list has a non-empty value.
  5320. // This may be used to include null fields in Patch requests.
  5321. NullFields []string `json:"-"`
  5322. }
  5323. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  5324. type NoMethod CacheKeyPolicy
  5325. raw := NoMethod(*s)
  5326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5327. }
  5328. // CallCredentials: gRPC call credentials to access the SDS server.
  5329. type CallCredentials struct {
  5330. // AccessToken: The access token that is used as call credential for the
  5331. // SDS server. This field is used only if callCredentialType is
  5332. // ACCESS_TOKEN.
  5333. AccessToken string `json:"accessToken,omitempty"`
  5334. // CallCredentialType: The type of call credentials to use for GRPC
  5335. // requests to the SDS server. This field can be set to one of the
  5336. // following: ACCESS_TOKEN: An access token is used as call credentials
  5337. // for the SDS server. GCE_VM: The local GCE VM service account
  5338. // credentials are used to access the SDS server. JWT_SERVICE_TOKEN: The
  5339. // user provisioned service account credentials are used to access the
  5340. // SDS server. FROM_PLUGIN: Custom authenticator credentials are used to
  5341. // access the SDS server.
  5342. //
  5343. // Possible values:
  5344. // "ACCESS_TOKEN"
  5345. // "FROM_PLUGIN"
  5346. // "GCE_VM"
  5347. // "INVALID"
  5348. // "JWT_SERVICE_ACCOUNT"
  5349. CallCredentialType string `json:"callCredentialType,omitempty"`
  5350. // FromPlugin: Custom authenticator credentials.
  5351. FromPlugin *MetadataCredentialsFromPlugin `json:"fromPlugin,omitempty"`
  5352. // JwtServiceAccount: This service account credentials are used as call
  5353. // credentials for the SDS server. This field is used only if
  5354. // callCredentialType is JWT_SERVICE_ACCOUNT.
  5355. JwtServiceAccount *ServiceAccountJwtAccessCredentials `json:"jwtServiceAccount,omitempty"`
  5356. // ForceSendFields is a list of field names (e.g. "AccessToken") to
  5357. // unconditionally include in API requests. By default, fields with
  5358. // empty values are omitted from API requests. However, any non-pointer,
  5359. // non-interface field appearing in ForceSendFields will be sent to the
  5360. // server regardless of whether the field is empty or not. This may be
  5361. // used to include empty fields in Patch requests.
  5362. ForceSendFields []string `json:"-"`
  5363. // NullFields is a list of field names (e.g. "AccessToken") to include
  5364. // in API requests with the JSON null value. By default, fields with
  5365. // empty values are omitted from API requests. However, any field with
  5366. // an empty value appearing in NullFields will be sent to the server as
  5367. // null. It is an error if a field in this list has a non-empty value.
  5368. // This may be used to include null fields in Patch requests.
  5369. NullFields []string `json:"-"`
  5370. }
  5371. func (s *CallCredentials) MarshalJSON() ([]byte, error) {
  5372. type NoMethod CallCredentials
  5373. raw := NoMethod(*s)
  5374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5375. }
  5376. // ChannelCredentials: gRPC channel credentials to access the SDS
  5377. // server.
  5378. type ChannelCredentials struct {
  5379. // Certificates: The call credentials to access the SDS server.
  5380. Certificates *TlsCertificatePaths `json:"certificates,omitempty"`
  5381. // ChannelCredentialType: The channel credentials to access the SDS
  5382. // server. This field can be set to one of the following: CERTIFICATES:
  5383. // Use TLS certificates to access the SDS server. GCE_VM: Use local GCE
  5384. // VM credentials to access the SDS server.
  5385. //
  5386. // Possible values:
  5387. // "CERTIFICATES"
  5388. // "GCE_VM"
  5389. // "INVALID"
  5390. ChannelCredentialType string `json:"channelCredentialType,omitempty"`
  5391. // ForceSendFields is a list of field names (e.g. "Certificates") to
  5392. // unconditionally include in API requests. By default, fields with
  5393. // empty values are omitted from API requests. However, any non-pointer,
  5394. // non-interface field appearing in ForceSendFields will be sent to the
  5395. // server regardless of whether the field is empty or not. This may be
  5396. // used to include empty fields in Patch requests.
  5397. ForceSendFields []string `json:"-"`
  5398. // NullFields is a list of field names (e.g. "Certificates") to include
  5399. // in API requests with the JSON null value. By default, fields with
  5400. // empty values are omitted from API requests. However, any field with
  5401. // an empty value appearing in NullFields will be sent to the server as
  5402. // null. It is an error if a field in this list has a non-empty value.
  5403. // This may be used to include null fields in Patch requests.
  5404. NullFields []string `json:"-"`
  5405. }
  5406. func (s *ChannelCredentials) MarshalJSON() ([]byte, error) {
  5407. type NoMethod ChannelCredentials
  5408. raw := NoMethod(*s)
  5409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5410. }
  5411. // CircuitBreakers: Settings controlling the volume of connections to a
  5412. // backend service.
  5413. type CircuitBreakers struct {
  5414. // ConnectTimeout: The timeout for new network connections to hosts.
  5415. ConnectTimeout *Duration `json:"connectTimeout,omitempty"`
  5416. // MaxConnections: The maximum number of connections to the backend
  5417. // cluster. If not specified, the default is 1024.
  5418. MaxConnections int64 `json:"maxConnections,omitempty"`
  5419. // MaxPendingRequests: The maximum number of pending requests allowed to
  5420. // the backend cluster. If not specified, the default is 1024.
  5421. MaxPendingRequests int64 `json:"maxPendingRequests,omitempty"`
  5422. // MaxRequests: The maximum number of parallel requests that allowed to
  5423. // the backend cluster. If not specified, the default is 1024.
  5424. MaxRequests int64 `json:"maxRequests,omitempty"`
  5425. // MaxRequestsPerConnection: Maximum requests for a single backend
  5426. // connection. This parameter is respected by both the HTTP/1.1 and
  5427. // HTTP/2 implementations. If not specified, there is no limit. Setting
  5428. // this parameter to 1 will effectively disable keep alive.
  5429. MaxRequestsPerConnection int64 `json:"maxRequestsPerConnection,omitempty"`
  5430. // MaxRetries: The maximum number of parallel retries allowed to the
  5431. // backend cluster. If not specified, the default is 3.
  5432. MaxRetries int64 `json:"maxRetries,omitempty"`
  5433. // ForceSendFields is a list of field names (e.g. "ConnectTimeout") to
  5434. // unconditionally include in API requests. By default, fields with
  5435. // empty values are omitted from API requests. However, any non-pointer,
  5436. // non-interface field appearing in ForceSendFields will be sent to the
  5437. // server regardless of whether the field is empty or not. This may be
  5438. // used to include empty fields in Patch requests.
  5439. ForceSendFields []string `json:"-"`
  5440. // NullFields is a list of field names (e.g. "ConnectTimeout") to
  5441. // include in API requests with the JSON null value. By default, fields
  5442. // with empty values are omitted from API requests. However, any field
  5443. // with an empty value appearing in NullFields will be sent to the
  5444. // server as null. It is an error if a field in this list has a
  5445. // non-empty value. This may be used to include null fields in Patch
  5446. // requests.
  5447. NullFields []string `json:"-"`
  5448. }
  5449. func (s *CircuitBreakers) MarshalJSON() ([]byte, error) {
  5450. type NoMethod CircuitBreakers
  5451. raw := NoMethod(*s)
  5452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5453. }
  5454. // ClientTlsSettings: The client side authentication settings for
  5455. // connection originating from the backend service.
  5456. type ClientTlsSettings struct {
  5457. // ClientTlsContext: Configures the mechanism to obtain client-side
  5458. // security certificates and identity information. This field is only
  5459. // applicable when mode is set to MUTUAL.
  5460. ClientTlsContext *TlsContext `json:"clientTlsContext,omitempty"`
  5461. // Mode: Indicates whether connections to this port should be secured
  5462. // using TLS. The value of this field determines how TLS is enforced.
  5463. // This can be set to one of the following values: DISABLE: Do not setup
  5464. // a TLS connection to the backends. SIMPLE: Originate a TLS connection
  5465. // to the backends. MUTUAL: Secure connections to the backends using
  5466. // mutual TLS by presenting client certificates for authentication.
  5467. //
  5468. // Possible values:
  5469. // "DISABLE"
  5470. // "INVALID"
  5471. // "MUTUAL"
  5472. // "SIMPLE"
  5473. Mode string `json:"mode,omitempty"`
  5474. // Sni: SNI string to present to the server during TLS handshake. This
  5475. // field is applicable only when mode is SIMPLE or MUTUAL.
  5476. Sni string `json:"sni,omitempty"`
  5477. // SubjectAltNames: A list of alternate names to verify the subject
  5478. // identity in the certificate.If specified, the proxy will verify that
  5479. // the server certificate's subject alt name matches one of the
  5480. // specified values. This field is applicable only when mode is SIMPLE
  5481. // or MUTUAL.
  5482. SubjectAltNames []string `json:"subjectAltNames,omitempty"`
  5483. // ForceSendFields is a list of field names (e.g. "ClientTlsContext") to
  5484. // unconditionally include in API requests. By default, fields with
  5485. // empty values are omitted from API requests. However, any non-pointer,
  5486. // non-interface field appearing in ForceSendFields will be sent to the
  5487. // server regardless of whether the field is empty or not. This may be
  5488. // used to include empty fields in Patch requests.
  5489. ForceSendFields []string `json:"-"`
  5490. // NullFields is a list of field names (e.g. "ClientTlsContext") to
  5491. // include in API requests with the JSON null value. By default, fields
  5492. // with empty values are omitted from API requests. However, any field
  5493. // with an empty value appearing in NullFields will be sent to the
  5494. // server as null. It is an error if a field in this list has a
  5495. // non-empty value. This may be used to include null fields in Patch
  5496. // requests.
  5497. NullFields []string `json:"-"`
  5498. }
  5499. func (s *ClientTlsSettings) MarshalJSON() ([]byte, error) {
  5500. type NoMethod ClientTlsSettings
  5501. raw := NoMethod(*s)
  5502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5503. }
  5504. // Commitment: Represents a Commitment resource. Creating a Commitment
  5505. // resource means that you are purchasing a committed use contract with
  5506. // an explicit start and end time. You can create commitments based on
  5507. // vCPUs and memory usage and receive discounted rates. For full
  5508. // details, read Signing Up for Committed Use Discounts.
  5509. //
  5510. // Committed use discounts are subject to Google Cloud Platform's
  5511. // Service Specific Terms. By purchasing a committed use discount, you
  5512. // agree to these terms. Committed use discounts will not renew, so you
  5513. // must purchase a new commitment to continue receiving discounts. (==
  5514. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  5515. type Commitment struct {
  5516. // Allocations: List of allocations for this commitment.
  5517. Allocations []*Allocation `json:"allocations,omitempty"`
  5518. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5519. // format.
  5520. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5521. // Description: An optional description of this resource. Provide this
  5522. // property when you create the resource.
  5523. Description string `json:"description,omitempty"`
  5524. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  5525. // format.
  5526. EndTimestamp string `json:"endTimestamp,omitempty"`
  5527. // Id: [Output Only] The unique identifier for the resource. This
  5528. // identifier is defined by the server.
  5529. Id uint64 `json:"id,omitempty,string"`
  5530. // Kind: [Output Only] Type of the resource. Always compute#commitment
  5531. // for commitments.
  5532. Kind string `json:"kind,omitempty"`
  5533. // Name: Name of the resource. Provided by the client when the resource
  5534. // is created. The name must be 1-63 characters long, and comply with
  5535. // RFC1035. Specifically, the name must be 1-63 characters long and
  5536. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5537. // the first character must be a lowercase letter, and all following
  5538. // characters must be a dash, lowercase letter, or digit, except the
  5539. // last character, which cannot be a dash.
  5540. Name string `json:"name,omitempty"`
  5541. // Plan: The plan for this commitment, which determines duration and
  5542. // discount rate. The currently supported plans are TWELVE_MONTH (1
  5543. // year), and THIRTY_SIX_MONTH (3 years).
  5544. //
  5545. // Possible values:
  5546. // "INVALID"
  5547. // "THIRTY_SIX_MONTH"
  5548. // "TWELVE_MONTH"
  5549. Plan string `json:"plan,omitempty"`
  5550. // Region: [Output Only] URL of the region where this commitment may be
  5551. // used.
  5552. Region string `json:"region,omitempty"`
  5553. // Resources: A list of commitment amounts for particular resources.
  5554. // Note that VCPU and MEMORY resource commitments must occur together.
  5555. Resources []*ResourceCommitment `json:"resources,omitempty"`
  5556. // SelfLink: [Output Only] Server-defined URL for the resource.
  5557. SelfLink string `json:"selfLink,omitempty"`
  5558. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  5559. // with the resource id.
  5560. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  5561. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  5562. // format.
  5563. StartTimestamp string `json:"startTimestamp,omitempty"`
  5564. // Status: [Output Only] Status of the commitment with regards to
  5565. // eventual expiration (each commitment has an end date defined). One of
  5566. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  5567. //
  5568. // Possible values:
  5569. // "ACTIVE"
  5570. // "CREATING"
  5571. // "EXPIRED"
  5572. // "NOT_YET_ACTIVE"
  5573. Status string `json:"status,omitempty"`
  5574. // StatusMessage: [Output Only] An optional, human-readable explanation
  5575. // of the status.
  5576. StatusMessage string `json:"statusMessage,omitempty"`
  5577. // Type: The type of commitment, which affects the discount rate and the
  5578. // eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that
  5579. // will only apply to memory optimized machines.
  5580. //
  5581. // Possible values:
  5582. // "GENERAL_PURPOSE"
  5583. // "MEMORY_OPTIMIZED"
  5584. // "TYPE_UNSPECIFIED"
  5585. Type string `json:"type,omitempty"`
  5586. // ServerResponse contains the HTTP response code and headers from the
  5587. // server.
  5588. googleapi.ServerResponse `json:"-"`
  5589. // ForceSendFields is a list of field names (e.g. "Allocations") to
  5590. // unconditionally include in API requests. By default, fields with
  5591. // empty values are omitted from API requests. However, any non-pointer,
  5592. // non-interface field appearing in ForceSendFields will be sent to the
  5593. // server regardless of whether the field is empty or not. This may be
  5594. // used to include empty fields in Patch requests.
  5595. ForceSendFields []string `json:"-"`
  5596. // NullFields is a list of field names (e.g. "Allocations") to include
  5597. // in API requests with the JSON null value. By default, fields with
  5598. // empty values are omitted from API requests. However, any field with
  5599. // an empty value appearing in NullFields will be sent to the server as
  5600. // null. It is an error if a field in this list has a non-empty value.
  5601. // This may be used to include null fields in Patch requests.
  5602. NullFields []string `json:"-"`
  5603. }
  5604. func (s *Commitment) MarshalJSON() ([]byte, error) {
  5605. type NoMethod Commitment
  5606. raw := NoMethod(*s)
  5607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5608. }
  5609. type CommitmentAggregatedList struct {
  5610. // Id: [Output Only] Unique identifier for the resource; defined by the
  5611. // server.
  5612. Id string `json:"id,omitempty"`
  5613. // Items: A list of CommitmentsScopedList resources.
  5614. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  5615. // Kind: [Output Only] Type of resource. Always
  5616. // compute#commitmentAggregatedList for aggregated lists of commitments.
  5617. Kind string `json:"kind,omitempty"`
  5618. // NextPageToken: [Output Only] This token allows you to get the next
  5619. // page of results for list requests. If the number of results is larger
  5620. // than maxResults, use the nextPageToken as a value for the query
  5621. // parameter pageToken in the next list request. Subsequent list
  5622. // requests will have their own nextPageToken to continue paging through
  5623. // the results.
  5624. NextPageToken string `json:"nextPageToken,omitempty"`
  5625. // SelfLink: [Output Only] Server-defined URL for this resource.
  5626. SelfLink string `json:"selfLink,omitempty"`
  5627. // Warning: [Output Only] Informational warning message.
  5628. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  5629. // ServerResponse contains the HTTP response code and headers from the
  5630. // server.
  5631. googleapi.ServerResponse `json:"-"`
  5632. // ForceSendFields is a list of field names (e.g. "Id") to
  5633. // unconditionally include in API requests. By default, fields with
  5634. // empty values are omitted from API requests. However, any non-pointer,
  5635. // non-interface field appearing in ForceSendFields will be sent to the
  5636. // server regardless of whether the field is empty or not. This may be
  5637. // used to include empty fields in Patch requests.
  5638. ForceSendFields []string `json:"-"`
  5639. // NullFields is a list of field names (e.g. "Id") to include in API
  5640. // requests with the JSON null value. By default, fields with empty
  5641. // values are omitted from API requests. However, any field with an
  5642. // empty value appearing in NullFields will be sent to the server as
  5643. // null. It is an error if a field in this list has a non-empty value.
  5644. // This may be used to include null fields in Patch requests.
  5645. NullFields []string `json:"-"`
  5646. }
  5647. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  5648. type NoMethod CommitmentAggregatedList
  5649. raw := NoMethod(*s)
  5650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5651. }
  5652. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  5653. // message.
  5654. type CommitmentAggregatedListWarning struct {
  5655. // Code: [Output Only] A warning code, if applicable. For example,
  5656. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5657. // the response.
  5658. //
  5659. // Possible values:
  5660. // "CLEANUP_FAILED"
  5661. // "DEPRECATED_RESOURCE_USED"
  5662. // "DEPRECATED_TYPE_USED"
  5663. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5664. // "EXPERIMENTAL_TYPE_USED"
  5665. // "EXTERNAL_API_WARNING"
  5666. // "FIELD_VALUE_OVERRIDEN"
  5667. // "INJECTED_KERNELS_DEPRECATED"
  5668. // "MISSING_TYPE_DEPENDENCY"
  5669. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5670. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5671. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5672. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5673. // "NEXT_HOP_NOT_RUNNING"
  5674. // "NOT_CRITICAL_ERROR"
  5675. // "NO_RESULTS_ON_PAGE"
  5676. // "REQUIRED_TOS_AGREEMENT"
  5677. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5678. // "RESOURCE_NOT_DELETED"
  5679. // "SCHEMA_VALIDATION_IGNORED"
  5680. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5681. // "UNDECLARED_PROPERTIES"
  5682. // "UNREACHABLE"
  5683. Code string `json:"code,omitempty"`
  5684. // Data: [Output Only] Metadata about this warning in key: value format.
  5685. // For example:
  5686. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5687. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  5688. // Message: [Output Only] A human-readable description of the warning
  5689. // code.
  5690. Message string `json:"message,omitempty"`
  5691. // ForceSendFields is a list of field names (e.g. "Code") to
  5692. // unconditionally include in API requests. By default, fields with
  5693. // empty values are omitted from API requests. However, any non-pointer,
  5694. // non-interface field appearing in ForceSendFields will be sent to the
  5695. // server regardless of whether the field is empty or not. This may be
  5696. // used to include empty fields in Patch requests.
  5697. ForceSendFields []string `json:"-"`
  5698. // NullFields is a list of field names (e.g. "Code") to include in API
  5699. // requests with the JSON null value. By default, fields with empty
  5700. // values are omitted from API requests. However, any field with an
  5701. // empty value appearing in NullFields will be sent to the server as
  5702. // null. It is an error if a field in this list has a non-empty value.
  5703. // This may be used to include null fields in Patch requests.
  5704. NullFields []string `json:"-"`
  5705. }
  5706. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5707. type NoMethod CommitmentAggregatedListWarning
  5708. raw := NoMethod(*s)
  5709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5710. }
  5711. type CommitmentAggregatedListWarningData struct {
  5712. // Key: [Output Only] A key that provides more detail on the warning
  5713. // being returned. For example, for warnings where there are no results
  5714. // in a list request for a particular zone, this key might be scope and
  5715. // the key value might be the zone name. Other examples might be a key
  5716. // indicating a deprecated resource and a suggested replacement, or a
  5717. // warning about invalid network settings (for example, if an instance
  5718. // attempts to perform IP forwarding but is not enabled for IP
  5719. // forwarding).
  5720. Key string `json:"key,omitempty"`
  5721. // Value: [Output Only] A warning data value corresponding to the key.
  5722. Value string `json:"value,omitempty"`
  5723. // ForceSendFields is a list of field names (e.g. "Key") to
  5724. // unconditionally include in API requests. By default, fields with
  5725. // empty values are omitted from API requests. However, any non-pointer,
  5726. // non-interface field appearing in ForceSendFields will be sent to the
  5727. // server regardless of whether the field is empty or not. This may be
  5728. // used to include empty fields in Patch requests.
  5729. ForceSendFields []string `json:"-"`
  5730. // NullFields is a list of field names (e.g. "Key") to include in API
  5731. // requests with the JSON null value. By default, fields with empty
  5732. // values are omitted from API requests. However, any field with an
  5733. // empty value appearing in NullFields will be sent to the server as
  5734. // null. It is an error if a field in this list has a non-empty value.
  5735. // This may be used to include null fields in Patch requests.
  5736. NullFields []string `json:"-"`
  5737. }
  5738. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5739. type NoMethod CommitmentAggregatedListWarningData
  5740. raw := NoMethod(*s)
  5741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5742. }
  5743. // CommitmentList: Contains a list of Commitment resources.
  5744. type CommitmentList struct {
  5745. // Id: [Output Only] Unique identifier for the resource; defined by the
  5746. // server.
  5747. Id string `json:"id,omitempty"`
  5748. // Items: A list of Commitment resources.
  5749. Items []*Commitment `json:"items,omitempty"`
  5750. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  5751. // for lists of commitments.
  5752. Kind string `json:"kind,omitempty"`
  5753. // NextPageToken: [Output Only] This token allows you to get the next
  5754. // page of results for list requests. If the number of results is larger
  5755. // than maxResults, use the nextPageToken as a value for the query
  5756. // parameter pageToken in the next list request. Subsequent list
  5757. // requests will have their own nextPageToken to continue paging through
  5758. // the results.
  5759. NextPageToken string `json:"nextPageToken,omitempty"`
  5760. // SelfLink: [Output Only] Server-defined URL for this resource.
  5761. SelfLink string `json:"selfLink,omitempty"`
  5762. // Warning: [Output Only] Informational warning message.
  5763. Warning *CommitmentListWarning `json:"warning,omitempty"`
  5764. // ServerResponse contains the HTTP response code and headers from the
  5765. // server.
  5766. googleapi.ServerResponse `json:"-"`
  5767. // ForceSendFields is a list of field names (e.g. "Id") to
  5768. // unconditionally include in API requests. By default, fields with
  5769. // empty values are omitted from API requests. However, any non-pointer,
  5770. // non-interface field appearing in ForceSendFields will be sent to the
  5771. // server regardless of whether the field is empty or not. This may be
  5772. // used to include empty fields in Patch requests.
  5773. ForceSendFields []string `json:"-"`
  5774. // NullFields is a list of field names (e.g. "Id") to include in API
  5775. // requests with the JSON null value. By default, fields with empty
  5776. // values are omitted from API requests. However, any field with an
  5777. // empty value appearing in NullFields will be sent to the server as
  5778. // null. It is an error if a field in this list has a non-empty value.
  5779. // This may be used to include null fields in Patch requests.
  5780. NullFields []string `json:"-"`
  5781. }
  5782. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  5783. type NoMethod CommitmentList
  5784. raw := NoMethod(*s)
  5785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5786. }
  5787. // CommitmentListWarning: [Output Only] Informational warning message.
  5788. type CommitmentListWarning struct {
  5789. // Code: [Output Only] A warning code, if applicable. For example,
  5790. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5791. // the response.
  5792. //
  5793. // Possible values:
  5794. // "CLEANUP_FAILED"
  5795. // "DEPRECATED_RESOURCE_USED"
  5796. // "DEPRECATED_TYPE_USED"
  5797. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5798. // "EXPERIMENTAL_TYPE_USED"
  5799. // "EXTERNAL_API_WARNING"
  5800. // "FIELD_VALUE_OVERRIDEN"
  5801. // "INJECTED_KERNELS_DEPRECATED"
  5802. // "MISSING_TYPE_DEPENDENCY"
  5803. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5804. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5805. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5806. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5807. // "NEXT_HOP_NOT_RUNNING"
  5808. // "NOT_CRITICAL_ERROR"
  5809. // "NO_RESULTS_ON_PAGE"
  5810. // "REQUIRED_TOS_AGREEMENT"
  5811. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5812. // "RESOURCE_NOT_DELETED"
  5813. // "SCHEMA_VALIDATION_IGNORED"
  5814. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5815. // "UNDECLARED_PROPERTIES"
  5816. // "UNREACHABLE"
  5817. Code string `json:"code,omitempty"`
  5818. // Data: [Output Only] Metadata about this warning in key: value format.
  5819. // For example:
  5820. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5821. Data []*CommitmentListWarningData `json:"data,omitempty"`
  5822. // Message: [Output Only] A human-readable description of the warning
  5823. // code.
  5824. Message string `json:"message,omitempty"`
  5825. // ForceSendFields is a list of field names (e.g. "Code") to
  5826. // unconditionally include in API requests. By default, fields with
  5827. // empty values are omitted from API requests. However, any non-pointer,
  5828. // non-interface field appearing in ForceSendFields will be sent to the
  5829. // server regardless of whether the field is empty or not. This may be
  5830. // used to include empty fields in Patch requests.
  5831. ForceSendFields []string `json:"-"`
  5832. // NullFields is a list of field names (e.g. "Code") to include in API
  5833. // requests with the JSON null value. By default, fields with empty
  5834. // values are omitted from API requests. However, any field with an
  5835. // empty value appearing in NullFields will be sent to the server as
  5836. // null. It is an error if a field in this list has a non-empty value.
  5837. // This may be used to include null fields in Patch requests.
  5838. NullFields []string `json:"-"`
  5839. }
  5840. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  5841. type NoMethod CommitmentListWarning
  5842. raw := NoMethod(*s)
  5843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5844. }
  5845. type CommitmentListWarningData struct {
  5846. // Key: [Output Only] A key that provides more detail on the warning
  5847. // being returned. For example, for warnings where there are no results
  5848. // in a list request for a particular zone, this key might be scope and
  5849. // the key value might be the zone name. Other examples might be a key
  5850. // indicating a deprecated resource and a suggested replacement, or a
  5851. // warning about invalid network settings (for example, if an instance
  5852. // attempts to perform IP forwarding but is not enabled for IP
  5853. // forwarding).
  5854. Key string `json:"key,omitempty"`
  5855. // Value: [Output Only] A warning data value corresponding to the key.
  5856. Value string `json:"value,omitempty"`
  5857. // ForceSendFields is a list of field names (e.g. "Key") to
  5858. // unconditionally include in API requests. By default, fields with
  5859. // empty values are omitted from API requests. However, any non-pointer,
  5860. // non-interface field appearing in ForceSendFields will be sent to the
  5861. // server regardless of whether the field is empty or not. This may be
  5862. // used to include empty fields in Patch requests.
  5863. ForceSendFields []string `json:"-"`
  5864. // NullFields is a list of field names (e.g. "Key") to include in API
  5865. // requests with the JSON null value. By default, fields with empty
  5866. // values are omitted from API requests. However, any field with an
  5867. // empty value appearing in NullFields will be sent to the server as
  5868. // null. It is an error if a field in this list has a non-empty value.
  5869. // This may be used to include null fields in Patch requests.
  5870. NullFields []string `json:"-"`
  5871. }
  5872. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  5873. type NoMethod CommitmentListWarningData
  5874. raw := NoMethod(*s)
  5875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5876. }
  5877. type CommitmentsScopedList struct {
  5878. // Commitments: [Output Only] A list of commitments contained in this
  5879. // scope.
  5880. Commitments []*Commitment `json:"commitments,omitempty"`
  5881. // Warning: [Output Only] Informational warning which replaces the list
  5882. // of commitments when the list is empty.
  5883. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  5884. // ForceSendFields is a list of field names (e.g. "Commitments") to
  5885. // unconditionally include in API requests. By default, fields with
  5886. // empty values are omitted from API requests. However, any non-pointer,
  5887. // non-interface field appearing in ForceSendFields will be sent to the
  5888. // server regardless of whether the field is empty or not. This may be
  5889. // used to include empty fields in Patch requests.
  5890. ForceSendFields []string `json:"-"`
  5891. // NullFields is a list of field names (e.g. "Commitments") to include
  5892. // in API requests with the JSON null value. By default, fields with
  5893. // empty values are omitted from API requests. However, any field with
  5894. // an empty value appearing in NullFields will be sent to the server as
  5895. // null. It is an error if a field in this list has a non-empty value.
  5896. // This may be used to include null fields in Patch requests.
  5897. NullFields []string `json:"-"`
  5898. }
  5899. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  5900. type NoMethod CommitmentsScopedList
  5901. raw := NoMethod(*s)
  5902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5903. }
  5904. // CommitmentsScopedListWarning: [Output Only] Informational warning
  5905. // which replaces the list of commitments when the list is empty.
  5906. type CommitmentsScopedListWarning struct {
  5907. // Code: [Output Only] A warning code, if applicable. For example,
  5908. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5909. // the response.
  5910. //
  5911. // Possible values:
  5912. // "CLEANUP_FAILED"
  5913. // "DEPRECATED_RESOURCE_USED"
  5914. // "DEPRECATED_TYPE_USED"
  5915. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5916. // "EXPERIMENTAL_TYPE_USED"
  5917. // "EXTERNAL_API_WARNING"
  5918. // "FIELD_VALUE_OVERRIDEN"
  5919. // "INJECTED_KERNELS_DEPRECATED"
  5920. // "MISSING_TYPE_DEPENDENCY"
  5921. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5922. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5923. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5924. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5925. // "NEXT_HOP_NOT_RUNNING"
  5926. // "NOT_CRITICAL_ERROR"
  5927. // "NO_RESULTS_ON_PAGE"
  5928. // "REQUIRED_TOS_AGREEMENT"
  5929. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5930. // "RESOURCE_NOT_DELETED"
  5931. // "SCHEMA_VALIDATION_IGNORED"
  5932. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5933. // "UNDECLARED_PROPERTIES"
  5934. // "UNREACHABLE"
  5935. Code string `json:"code,omitempty"`
  5936. // Data: [Output Only] Metadata about this warning in key: value format.
  5937. // For example:
  5938. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5939. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  5940. // Message: [Output Only] A human-readable description of the warning
  5941. // code.
  5942. Message string `json:"message,omitempty"`
  5943. // ForceSendFields is a list of field names (e.g. "Code") to
  5944. // unconditionally include in API requests. By default, fields with
  5945. // empty values are omitted from API requests. However, any non-pointer,
  5946. // non-interface field appearing in ForceSendFields will be sent to the
  5947. // server regardless of whether the field is empty or not. This may be
  5948. // used to include empty fields in Patch requests.
  5949. ForceSendFields []string `json:"-"`
  5950. // NullFields is a list of field names (e.g. "Code") to include in API
  5951. // requests with the JSON null value. By default, fields with empty
  5952. // values are omitted from API requests. However, any field with an
  5953. // empty value appearing in NullFields will be sent to the server as
  5954. // null. It is an error if a field in this list has a non-empty value.
  5955. // This may be used to include null fields in Patch requests.
  5956. NullFields []string `json:"-"`
  5957. }
  5958. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  5959. type NoMethod CommitmentsScopedListWarning
  5960. raw := NoMethod(*s)
  5961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5962. }
  5963. type CommitmentsScopedListWarningData struct {
  5964. // Key: [Output Only] A key that provides more detail on the warning
  5965. // being returned. For example, for warnings where there are no results
  5966. // in a list request for a particular zone, this key might be scope and
  5967. // the key value might be the zone name. Other examples might be a key
  5968. // indicating a deprecated resource and a suggested replacement, or a
  5969. // warning about invalid network settings (for example, if an instance
  5970. // attempts to perform IP forwarding but is not enabled for IP
  5971. // forwarding).
  5972. Key string `json:"key,omitempty"`
  5973. // Value: [Output Only] A warning data value corresponding to the key.
  5974. Value string `json:"value,omitempty"`
  5975. // ForceSendFields is a list of field names (e.g. "Key") to
  5976. // unconditionally include in API requests. By default, fields with
  5977. // empty values are omitted from API requests. However, any non-pointer,
  5978. // non-interface field appearing in ForceSendFields will be sent to the
  5979. // server regardless of whether the field is empty or not. This may be
  5980. // used to include empty fields in Patch requests.
  5981. ForceSendFields []string `json:"-"`
  5982. // NullFields is a list of field names (e.g. "Key") to include in API
  5983. // requests with the JSON null value. By default, fields with empty
  5984. // values are omitted from API requests. However, any field with an
  5985. // empty value appearing in NullFields will be sent to the server as
  5986. // null. It is an error if a field in this list has a non-empty value.
  5987. // This may be used to include null fields in Patch requests.
  5988. NullFields []string `json:"-"`
  5989. }
  5990. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  5991. type NoMethod CommitmentsScopedListWarningData
  5992. raw := NoMethod(*s)
  5993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5994. }
  5995. // Condition: A condition to be met.
  5996. type Condition struct {
  5997. // Iam: Trusted attributes supplied by the IAM system.
  5998. //
  5999. // Possible values:
  6000. // "APPROVER"
  6001. // "ATTRIBUTION"
  6002. // "AUTHORITY"
  6003. // "CREDENTIALS_TYPE"
  6004. // "JUSTIFICATION_TYPE"
  6005. // "NO_ATTR"
  6006. // "SECURITY_REALM"
  6007. Iam string `json:"iam,omitempty"`
  6008. // Op: An operator to apply the subject with.
  6009. //
  6010. // Possible values:
  6011. // "DISCHARGED"
  6012. // "EQUALS"
  6013. // "IN"
  6014. // "NOT_EQUALS"
  6015. // "NOT_IN"
  6016. // "NO_OP"
  6017. Op string `json:"op,omitempty"`
  6018. // Svc: Trusted attributes discharged by the service.
  6019. Svc string `json:"svc,omitempty"`
  6020. // Sys: Trusted attributes supplied by any service that owns resources
  6021. // and uses the IAM system for access control.
  6022. //
  6023. // Possible values:
  6024. // "IP"
  6025. // "NAME"
  6026. // "NO_ATTR"
  6027. // "REGION"
  6028. // "SERVICE"
  6029. Sys string `json:"sys,omitempty"`
  6030. // Values: The objects of the condition.
  6031. Values []string `json:"values,omitempty"`
  6032. // ForceSendFields is a list of field names (e.g. "Iam") to
  6033. // unconditionally include in API requests. By default, fields with
  6034. // empty values are omitted from API requests. However, any non-pointer,
  6035. // non-interface field appearing in ForceSendFields will be sent to the
  6036. // server regardless of whether the field is empty or not. This may be
  6037. // used to include empty fields in Patch requests.
  6038. ForceSendFields []string `json:"-"`
  6039. // NullFields is a list of field names (e.g. "Iam") to include in API
  6040. // requests with the JSON null value. By default, fields with empty
  6041. // values are omitted from API requests. However, any field with an
  6042. // empty value appearing in NullFields will be sent to the server as
  6043. // null. It is an error if a field in this list has a non-empty value.
  6044. // This may be used to include null fields in Patch requests.
  6045. NullFields []string `json:"-"`
  6046. }
  6047. func (s *Condition) MarshalJSON() ([]byte, error) {
  6048. type NoMethod Condition
  6049. raw := NoMethod(*s)
  6050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6051. }
  6052. // ConnectionDraining: Message containing connection draining
  6053. // configuration.
  6054. type ConnectionDraining struct {
  6055. // DrainingTimeoutSec: Time for which instance will be drained (not
  6056. // accept new connections, but still work to finish started).
  6057. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  6058. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  6059. // to unconditionally include in API requests. By default, fields with
  6060. // empty values are omitted from API requests. However, any non-pointer,
  6061. // non-interface field appearing in ForceSendFields will be sent to the
  6062. // server regardless of whether the field is empty or not. This may be
  6063. // used to include empty fields in Patch requests.
  6064. ForceSendFields []string `json:"-"`
  6065. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  6066. // include in API requests with the JSON null value. By default, fields
  6067. // with empty values are omitted from API requests. However, any field
  6068. // with an empty value appearing in NullFields will be sent to the
  6069. // server as null. It is an error if a field in this list has a
  6070. // non-empty value. This may be used to include null fields in Patch
  6071. // requests.
  6072. NullFields []string `json:"-"`
  6073. }
  6074. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  6075. type NoMethod ConnectionDraining
  6076. raw := NoMethod(*s)
  6077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6078. }
  6079. // ConsistentHashLoadBalancerSettings: This message defines settings for
  6080. // a consistent hash style load balancer.
  6081. type ConsistentHashLoadBalancerSettings struct {
  6082. // HttpCookie: Hash is based on HTTP Cookie. This field describes a HTTP
  6083. // cookie that will be used as the hash key for the consistent hash load
  6084. // balancer. If the cookie is not present, it will be generated. This
  6085. // field is applicable if the sessionAffinity is set to HTTP_COOKIE.
  6086. HttpCookie *ConsistentHashLoadBalancerSettingsHttpCookie `json:"httpCookie,omitempty"`
  6087. // HttpHeaderName: The hash based on the value of the specified header
  6088. // field. This field is applicable if the sessionAffinity is set to
  6089. // HEADER_FIELD.
  6090. HttpHeaderName string `json:"httpHeaderName,omitempty"`
  6091. // MinimumRingSize: The minimum number of virtual nodes to use for the
  6092. // hash ring. Defaults to 1024. Larger ring sizes result in more
  6093. // granular load distributions. If the number of hosts in the load
  6094. // balancing pool is larger than the ring size, each host will be
  6095. // assigned a single virtual node.
  6096. MinimumRingSize int64 `json:"minimumRingSize,omitempty,string"`
  6097. // ForceSendFields is a list of field names (e.g. "HttpCookie") to
  6098. // unconditionally include in API requests. By default, fields with
  6099. // empty values are omitted from API requests. However, any non-pointer,
  6100. // non-interface field appearing in ForceSendFields will be sent to the
  6101. // server regardless of whether the field is empty or not. This may be
  6102. // used to include empty fields in Patch requests.
  6103. ForceSendFields []string `json:"-"`
  6104. // NullFields is a list of field names (e.g. "HttpCookie") to include in
  6105. // API requests with the JSON null value. By default, fields with empty
  6106. // values are omitted from API requests. However, any field with an
  6107. // empty value appearing in NullFields will be sent to the server as
  6108. // null. It is an error if a field in this list has a non-empty value.
  6109. // This may be used to include null fields in Patch requests.
  6110. NullFields []string `json:"-"`
  6111. }
  6112. func (s *ConsistentHashLoadBalancerSettings) MarshalJSON() ([]byte, error) {
  6113. type NoMethod ConsistentHashLoadBalancerSettings
  6114. raw := NoMethod(*s)
  6115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6116. }
  6117. // ConsistentHashLoadBalancerSettingsHttpCookie: The information about
  6118. // the HTTP Cookie on which the hash function is based for load
  6119. // balancing policies that use a consistent hash.
  6120. type ConsistentHashLoadBalancerSettingsHttpCookie struct {
  6121. // Name: Name of the cookie.
  6122. Name string `json:"name,omitempty"`
  6123. // Path: Path to set for the cookie.
  6124. Path string `json:"path,omitempty"`
  6125. // Ttl: Lifetime of the cookie.
  6126. Ttl *Duration `json:"ttl,omitempty"`
  6127. // ForceSendFields is a list of field names (e.g. "Name") to
  6128. // unconditionally include in API requests. By default, fields with
  6129. // empty values are omitted from API requests. However, any non-pointer,
  6130. // non-interface field appearing in ForceSendFields will be sent to the
  6131. // server regardless of whether the field is empty or not. This may be
  6132. // used to include empty fields in Patch requests.
  6133. ForceSendFields []string `json:"-"`
  6134. // NullFields is a list of field names (e.g. "Name") to include in API
  6135. // requests with the JSON null value. By default, fields with empty
  6136. // values are omitted from API requests. However, any field with an
  6137. // empty value appearing in NullFields will be sent to the server as
  6138. // null. It is an error if a field in this list has a non-empty value.
  6139. // This may be used to include null fields in Patch requests.
  6140. NullFields []string `json:"-"`
  6141. }
  6142. func (s *ConsistentHashLoadBalancerSettingsHttpCookie) MarshalJSON() ([]byte, error) {
  6143. type NoMethod ConsistentHashLoadBalancerSettingsHttpCookie
  6144. raw := NoMethod(*s)
  6145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6146. }
  6147. // CorsPolicy: The specification for allowing client side cross-origin
  6148. // requests. Please see W3C Recommendation for Cross Origin Resource
  6149. // Sharing
  6150. type CorsPolicy struct {
  6151. // AllowCredentials: In response to a preflight request, setting this to
  6152. // true indicates that the actual request can include user credentials.
  6153. // This translates to the Access-Control-Allow-Credentials
  6154. // header.
  6155. // Default is false.
  6156. AllowCredentials bool `json:"allowCredentials,omitempty"`
  6157. // AllowHeaders: Specifies the content for the
  6158. // Access-Control-Allow-Headers header.
  6159. AllowHeaders []string `json:"allowHeaders,omitempty"`
  6160. // AllowMethods: Specifies the content for the
  6161. // Access-Control-Allow-Methods header.
  6162. AllowMethods []string `json:"allowMethods,omitempty"`
  6163. // AllowOriginRegexes: Specifies the regualar expression patterns that
  6164. // match allowed origins. For regular expression grammar please see
  6165. // en.cppreference.com/w/cpp/regex/ecmascript
  6166. // An origin is allowed if it matches either allow_origins or
  6167. // allow_origin_regex.
  6168. AllowOriginRegexes []string `json:"allowOriginRegexes,omitempty"`
  6169. // AllowOrigins: Specifies the list of origins that will be allowed to
  6170. // do CORS requests.
  6171. // An origin is allowed if it matches either allow_origins or
  6172. // allow_origin_regex.
  6173. AllowOrigins []string `json:"allowOrigins,omitempty"`
  6174. // Disabled: If true, specifies the CORS policy is disabled. The default
  6175. // value of false, which indicates that the CORS policy is in effect.
  6176. Disabled bool `json:"disabled,omitempty"`
  6177. // ExposeHeaders: Specifies the content for the
  6178. // Access-Control-Expose-Headers header.
  6179. ExposeHeaders []string `json:"exposeHeaders,omitempty"`
  6180. // MaxAge: Specifies how long the results of a preflight request can be
  6181. // cached. This translates to the content for the Access-Control-Max-Age
  6182. // header.
  6183. MaxAge int64 `json:"maxAge,omitempty"`
  6184. // ForceSendFields is a list of field names (e.g. "AllowCredentials") to
  6185. // unconditionally include in API requests. By default, fields with
  6186. // empty values are omitted from API requests. However, any non-pointer,
  6187. // non-interface field appearing in ForceSendFields will be sent to the
  6188. // server regardless of whether the field is empty or not. This may be
  6189. // used to include empty fields in Patch requests.
  6190. ForceSendFields []string `json:"-"`
  6191. // NullFields is a list of field names (e.g. "AllowCredentials") to
  6192. // include in API requests with the JSON null value. By default, fields
  6193. // with empty values are omitted from API requests. However, any field
  6194. // with an empty value appearing in NullFields will be sent to the
  6195. // server as null. It is an error if a field in this list has a
  6196. // non-empty value. This may be used to include null fields in Patch
  6197. // requests.
  6198. NullFields []string `json:"-"`
  6199. }
  6200. func (s *CorsPolicy) MarshalJSON() ([]byte, error) {
  6201. type NoMethod CorsPolicy
  6202. raw := NoMethod(*s)
  6203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6204. }
  6205. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  6206. type CustomerEncryptionKey struct {
  6207. // KmsKeyName: The name of the encryption key that is stored in Google
  6208. // Cloud KMS.
  6209. KmsKeyName string `json:"kmsKeyName,omitempty"`
  6210. KmsKeyServiceAccount string `json:"kmsKeyServiceAccount,omitempty"`
  6211. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  6212. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  6213. RawKey string `json:"rawKey,omitempty"`
  6214. // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped
  6215. // 2048-bit customer-supplied encryption key to either encrypt or
  6216. // decrypt this resource.
  6217. //
  6218. // The key must meet the following requirements before you can provide
  6219. // it to Compute Engine:
  6220. // - The key is wrapped using a RSA public key certificate provided by
  6221. // Google.
  6222. // - After being wrapped, the key must be encoded in RFC 4648 base64
  6223. // encoding. Gets the RSA public key certificate provided by Google
  6224. // at:
  6225. // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre
  6226. // ss.pem
  6227. RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
  6228. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  6229. // customer-supplied encryption key that protects this resource.
  6230. Sha256 string `json:"sha256,omitempty"`
  6231. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  6232. // unconditionally include in API requests. By default, fields with
  6233. // empty values are omitted from API requests. However, any non-pointer,
  6234. // non-interface field appearing in ForceSendFields will be sent to the
  6235. // server regardless of whether the field is empty or not. This may be
  6236. // used to include empty fields in Patch requests.
  6237. ForceSendFields []string `json:"-"`
  6238. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  6239. // API requests with the JSON null value. By default, fields with empty
  6240. // values are omitted from API requests. However, any field with an
  6241. // empty value appearing in NullFields will be sent to the server as
  6242. // null. It is an error if a field in this list has a non-empty value.
  6243. // This may be used to include null fields in Patch requests.
  6244. NullFields []string `json:"-"`
  6245. }
  6246. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  6247. type NoMethod CustomerEncryptionKey
  6248. raw := NoMethod(*s)
  6249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6250. }
  6251. type CustomerEncryptionKeyProtectedDisk struct {
  6252. // DiskEncryptionKey: Decrypts data associated with the disk with a
  6253. // customer-supplied encryption key.
  6254. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  6255. // Source: Specifies a valid partial or full URL to an existing
  6256. // Persistent Disk resource. This field is only applicable for
  6257. // persistent disks.
  6258. Source string `json:"source,omitempty"`
  6259. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  6260. // to unconditionally include in API requests. By default, fields with
  6261. // empty values are omitted from API requests. However, any non-pointer,
  6262. // non-interface field appearing in ForceSendFields will be sent to the
  6263. // server regardless of whether the field is empty or not. This may be
  6264. // used to include empty fields in Patch requests.
  6265. ForceSendFields []string `json:"-"`
  6266. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  6267. // include in API requests with the JSON null value. By default, fields
  6268. // with empty values are omitted from API requests. However, any field
  6269. // with an empty value appearing in NullFields will be sent to the
  6270. // server as null. It is an error if a field in this list has a
  6271. // non-empty value. This may be used to include null fields in Patch
  6272. // requests.
  6273. NullFields []string `json:"-"`
  6274. }
  6275. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  6276. type NoMethod CustomerEncryptionKeyProtectedDisk
  6277. raw := NoMethod(*s)
  6278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6279. }
  6280. // DeprecationStatus: Deprecation status for a public resource.
  6281. type DeprecationStatus struct {
  6282. // Deleted: An optional RFC3339 timestamp on or after which the state of
  6283. // this resource is intended to change to DELETED. This is only
  6284. // informational and the status will not change unless the client
  6285. // explicitly changes it.
  6286. Deleted string `json:"deleted,omitempty"`
  6287. // Deprecated: An optional RFC3339 timestamp on or after which the state
  6288. // of this resource is intended to change to DEPRECATED. This is only
  6289. // informational and the status will not change unless the client
  6290. // explicitly changes it.
  6291. Deprecated string `json:"deprecated,omitempty"`
  6292. // Obsolete: An optional RFC3339 timestamp on or after which the state
  6293. // of this resource is intended to change to OBSOLETE. This is only
  6294. // informational and the status will not change unless the client
  6295. // explicitly changes it.
  6296. Obsolete string `json:"obsolete,omitempty"`
  6297. // Replacement: The URL of the suggested replacement for a deprecated
  6298. // resource. The suggested replacement resource must be the same kind of
  6299. // resource as the deprecated resource.
  6300. Replacement string `json:"replacement,omitempty"`
  6301. // State: The deprecation state of this resource. This can be ACTIVE
  6302. // DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the
  6303. // end of life date for an image, can use ACTIVE. Operations which
  6304. // create a new resource using a DEPRECATED resource will return
  6305. // successfully, but with a warning indicating the deprecated resource
  6306. // and recommending its replacement. Operations which use OBSOLETE or
  6307. // DELETED resources will be rejected and result in an error.
  6308. //
  6309. // Possible values:
  6310. // "ACTIVE"
  6311. // "DELETED"
  6312. // "DEPRECATED"
  6313. // "OBSOLETE"
  6314. State string `json:"state,omitempty"`
  6315. // ForceSendFields is a list of field names (e.g. "Deleted") to
  6316. // unconditionally include in API requests. By default, fields with
  6317. // empty values are omitted from API requests. However, any non-pointer,
  6318. // non-interface field appearing in ForceSendFields will be sent to the
  6319. // server regardless of whether the field is empty or not. This may be
  6320. // used to include empty fields in Patch requests.
  6321. ForceSendFields []string `json:"-"`
  6322. // NullFields is a list of field names (e.g. "Deleted") to include in
  6323. // API requests with the JSON null value. By default, fields with empty
  6324. // values are omitted from API requests. However, any field with an
  6325. // empty value appearing in NullFields will be sent to the server as
  6326. // null. It is an error if a field in this list has a non-empty value.
  6327. // This may be used to include null fields in Patch requests.
  6328. NullFields []string `json:"-"`
  6329. }
  6330. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  6331. type NoMethod DeprecationStatus
  6332. raw := NoMethod(*s)
  6333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6334. }
  6335. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  6336. // resource_for v1.disks ==)
  6337. type Disk struct {
  6338. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6339. // format.
  6340. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6341. // Description: An optional description of this resource. Provide this
  6342. // property when you create the resource.
  6343. Description string `json:"description,omitempty"`
  6344. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  6345. // encryption key.
  6346. //
  6347. // After you encrypt a disk with a customer-supplied key, you must
  6348. // provide the same key if you use the disk later (e.g. to create a disk
  6349. // snapshot or an image, or to attach the disk to a virtual
  6350. // machine).
  6351. //
  6352. // Customer-supplied encryption keys do not protect access to metadata
  6353. // of the disk.
  6354. //
  6355. // If you do not provide an encryption key when creating the disk, then
  6356. // the disk will be encrypted using an automatically generated key and
  6357. // you do not need to provide a key to use the disk later.
  6358. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  6359. // GuestOsFeatures: A list of features to enable on the guest operating
  6360. // system. Applicable only for bootable images. Read Enabling guest
  6361. // operating system features to see a list of available options.
  6362. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  6363. // Id: [Output Only] The unique identifier for the resource. This
  6364. // identifier is defined by the server.
  6365. Id uint64 `json:"id,omitempty,string"`
  6366. // Kind: [Output Only] Type of the resource. Always compute#disk for
  6367. // disks.
  6368. Kind string `json:"kind,omitempty"`
  6369. // LabelFingerprint: A fingerprint for the labels being applied to this
  6370. // disk, which is essentially a hash of the labels set used for
  6371. // optimistic locking. The fingerprint is initially generated by Compute
  6372. // Engine and changes after every request to modify or update labels.
  6373. // You must always provide an up-to-date fingerprint hash in order to
  6374. // update or change labels, otherwise the request will fail with error
  6375. // 412 conditionNotMet.
  6376. //
  6377. // To see the latest fingerprint, make a get() request to retrieve a
  6378. // disk.
  6379. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6380. // Labels: Labels to apply to this disk. These can be later modified by
  6381. // the setLabels method.
  6382. Labels map[string]string `json:"labels,omitempty"`
  6383. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  6384. // text format.
  6385. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  6386. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  6387. // text format.
  6388. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  6389. // LicenseCodes: Integer license codes indicating which licenses are
  6390. // attached to this disk.
  6391. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  6392. // Licenses: A list of publicly visible licenses. Reserved for Google's
  6393. // use.
  6394. Licenses []string `json:"licenses,omitempty"`
  6395. // MultiWriter: Indicates whether or not the disk can be read/write
  6396. // attached to more than one instance.
  6397. MultiWriter bool `json:"multiWriter,omitempty"`
  6398. // Name: Name of the resource. Provided by the client when the resource
  6399. // is created. The name must be 1-63 characters long, and comply with
  6400. // RFC1035. Specifically, the name must be 1-63 characters long and
  6401. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6402. // the first character must be a lowercase letter, and all following
  6403. // characters must be a dash, lowercase letter, or digit, except the
  6404. // last character, which cannot be a dash.
  6405. Name string `json:"name,omitempty"`
  6406. // Options: Internal use only.
  6407. Options string `json:"options,omitempty"`
  6408. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  6409. // in bytes. If not present in a request, a default value is used.
  6410. // Currently supported sizes are 4096 and 16384, other sizes may be
  6411. // added in the future. If an unsupported value is requested, the error
  6412. // message will list the supported values for the caller's project.
  6413. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  6414. // Region: [Output Only] URL of the region where the disk resides. Only
  6415. // applicable for regional resources. You must specify this field as
  6416. // part of the HTTP request URL. It is not settable as a field in the
  6417. // request body.
  6418. Region string `json:"region,omitempty"`
  6419. // ReplicaZones: URLs of the zones where the disk should be replicated
  6420. // to. Only applicable for regional resources.
  6421. ReplicaZones []string `json:"replicaZones,omitempty"`
  6422. // ResourcePolicies: Resource policies applied to this disk for
  6423. // automatic snapshot creations.
  6424. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  6425. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  6426. // resource.
  6427. SelfLink string `json:"selfLink,omitempty"`
  6428. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  6429. // this field when creating a persistent disk using the sourceImage or
  6430. // sourceSnapshot parameter, or specify it alone to create an empty
  6431. // persistent disk.
  6432. //
  6433. // If you specify this field along with sourceImage or sourceSnapshot,
  6434. // the value of sizeGb must not be less than the size of the sourceImage
  6435. // or the size of the snapshot. Acceptable values are 1 to 65536,
  6436. // inclusive.
  6437. SizeGb int64 `json:"sizeGb,omitempty,string"`
  6438. // SourceImage: The source image used to create this disk. If the source
  6439. // image is deleted, this field will not be set.
  6440. //
  6441. // To create a disk with one of the public operating system images,
  6442. // specify the image by its family name. For example, specify
  6443. // family/debian-9 to use the latest Debian 9
  6444. // image:
  6445. // projects/debian-cloud/global/images/family/debian-9
  6446. //
  6447. //
  6448. // Alternati
  6449. // vely, use a specific version of a public operating system
  6450. // image:
  6451. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  6452. //
  6453. //
  6454. //
  6455. // To create a disk with a custom image that you created, specify the
  6456. // image name in the following
  6457. // format:
  6458. // global/images/my-custom-image
  6459. //
  6460. //
  6461. // You can also specify a custom image by its image family, which
  6462. // returns the latest version of the image in that family. Replace the
  6463. // image name with
  6464. // family/family-name:
  6465. // global/images/family/my-image-family
  6466. SourceImage string `json:"sourceImage,omitempty"`
  6467. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  6468. // source image. Required if the source image is protected by a
  6469. // customer-supplied encryption key.
  6470. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  6471. // SourceImageId: [Output Only] The ID value of the image used to create
  6472. // this disk. This value identifies the exact image that was used to
  6473. // create this persistent disk. For example, if you created the
  6474. // persistent disk from an image that was later deleted and recreated
  6475. // under the same name, the source image ID would identify the exact
  6476. // version of the image that was used.
  6477. SourceImageId string `json:"sourceImageId,omitempty"`
  6478. // SourceSnapshot: The source snapshot used to create this disk. You can
  6479. // provide this as a partial or full URL to the resource. For example,
  6480. // the following are valid values:
  6481. // -
  6482. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  6483. // - projects/project/global/snapshots/snapshot
  6484. // - global/snapshots/snapshot
  6485. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  6486. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  6487. // the source snapshot. Required if the source snapshot is protected by
  6488. // a customer-supplied encryption key.
  6489. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  6490. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  6491. // create this disk. This value identifies the exact snapshot that was
  6492. // used to create this persistent disk. For example, if you created the
  6493. // persistent disk from a snapshot that was later deleted and recreated
  6494. // under the same name, the source snapshot ID would identify the exact
  6495. // version of the snapshot that was used.
  6496. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  6497. // Status: [Output Only] The status of disk creation.
  6498. //
  6499. // Possible values:
  6500. // "CREATING"
  6501. // "DELETING"
  6502. // "FAILED"
  6503. // "READY"
  6504. // "RESTORING"
  6505. Status string `json:"status,omitempty"`
  6506. // StorageType: [Deprecated] Storage type of the persistent disk.
  6507. //
  6508. // Possible values:
  6509. // "HDD"
  6510. // "SSD"
  6511. StorageType string `json:"storageType,omitempty"`
  6512. // Type: URL of the disk type resource describing which disk type to use
  6513. // to create the disk. Provide this when creating the disk. For example:
  6514. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  6515. Type string `json:"type,omitempty"`
  6516. // Users: [Output Only] Links to the users of the disk (attached
  6517. // instances) in form: project/zones/zone/instances/instance
  6518. Users []string `json:"users,omitempty"`
  6519. // Zone: [Output Only] URL of the zone where the disk resides. You must
  6520. // specify this field as part of the HTTP request URL. It is not
  6521. // settable as a field in the request body.
  6522. Zone string `json:"zone,omitempty"`
  6523. // ServerResponse contains the HTTP response code and headers from the
  6524. // server.
  6525. googleapi.ServerResponse `json:"-"`
  6526. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6527. // to unconditionally include in API requests. By default, fields with
  6528. // empty values are omitted from API requests. However, any non-pointer,
  6529. // non-interface field appearing in ForceSendFields will be sent to the
  6530. // server regardless of whether the field is empty or not. This may be
  6531. // used to include empty fields in Patch requests.
  6532. ForceSendFields []string `json:"-"`
  6533. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  6534. // include in API requests with the JSON null value. By default, fields
  6535. // with empty values are omitted from API requests. However, any field
  6536. // with an empty value appearing in NullFields will be sent to the
  6537. // server as null. It is an error if a field in this list has a
  6538. // non-empty value. This may be used to include null fields in Patch
  6539. // requests.
  6540. NullFields []string `json:"-"`
  6541. }
  6542. func (s *Disk) MarshalJSON() ([]byte, error) {
  6543. type NoMethod Disk
  6544. raw := NoMethod(*s)
  6545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6546. }
  6547. type DiskAggregatedList struct {
  6548. // Id: [Output Only] Unique identifier for the resource; defined by the
  6549. // server.
  6550. Id string `json:"id,omitempty"`
  6551. // Items: A list of DisksScopedList resources.
  6552. Items map[string]DisksScopedList `json:"items,omitempty"`
  6553. // Kind: [Output Only] Type of resource. Always
  6554. // compute#diskAggregatedList for aggregated lists of persistent disks.
  6555. Kind string `json:"kind,omitempty"`
  6556. // NextPageToken: [Output Only] This token allows you to get the next
  6557. // page of results for list requests. If the number of results is larger
  6558. // than maxResults, use the nextPageToken as a value for the query
  6559. // parameter pageToken in the next list request. Subsequent list
  6560. // requests will have their own nextPageToken to continue paging through
  6561. // the results.
  6562. NextPageToken string `json:"nextPageToken,omitempty"`
  6563. // SelfLink: [Output Only] Server-defined URL for this resource.
  6564. SelfLink string `json:"selfLink,omitempty"`
  6565. // Warning: [Output Only] Informational warning message.
  6566. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  6567. // ServerResponse contains the HTTP response code and headers from the
  6568. // server.
  6569. googleapi.ServerResponse `json:"-"`
  6570. // ForceSendFields is a list of field names (e.g. "Id") to
  6571. // unconditionally include in API requests. By default, fields with
  6572. // empty values are omitted from API requests. However, any non-pointer,
  6573. // non-interface field appearing in ForceSendFields will be sent to the
  6574. // server regardless of whether the field is empty or not. This may be
  6575. // used to include empty fields in Patch requests.
  6576. ForceSendFields []string `json:"-"`
  6577. // NullFields is a list of field names (e.g. "Id") to include in API
  6578. // requests with the JSON null value. By default, fields with empty
  6579. // values are omitted from API requests. However, any field with an
  6580. // empty value appearing in NullFields will be sent to the server as
  6581. // null. It is an error if a field in this list has a non-empty value.
  6582. // This may be used to include null fields in Patch requests.
  6583. NullFields []string `json:"-"`
  6584. }
  6585. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  6586. type NoMethod DiskAggregatedList
  6587. raw := NoMethod(*s)
  6588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6589. }
  6590. // DiskAggregatedListWarning: [Output Only] Informational warning
  6591. // message.
  6592. type DiskAggregatedListWarning struct {
  6593. // Code: [Output Only] A warning code, if applicable. For example,
  6594. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6595. // the response.
  6596. //
  6597. // Possible values:
  6598. // "CLEANUP_FAILED"
  6599. // "DEPRECATED_RESOURCE_USED"
  6600. // "DEPRECATED_TYPE_USED"
  6601. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6602. // "EXPERIMENTAL_TYPE_USED"
  6603. // "EXTERNAL_API_WARNING"
  6604. // "FIELD_VALUE_OVERRIDEN"
  6605. // "INJECTED_KERNELS_DEPRECATED"
  6606. // "MISSING_TYPE_DEPENDENCY"
  6607. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6608. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6609. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6610. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6611. // "NEXT_HOP_NOT_RUNNING"
  6612. // "NOT_CRITICAL_ERROR"
  6613. // "NO_RESULTS_ON_PAGE"
  6614. // "REQUIRED_TOS_AGREEMENT"
  6615. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6616. // "RESOURCE_NOT_DELETED"
  6617. // "SCHEMA_VALIDATION_IGNORED"
  6618. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6619. // "UNDECLARED_PROPERTIES"
  6620. // "UNREACHABLE"
  6621. Code string `json:"code,omitempty"`
  6622. // Data: [Output Only] Metadata about this warning in key: value format.
  6623. // For example:
  6624. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6625. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  6626. // Message: [Output Only] A human-readable description of the warning
  6627. // code.
  6628. Message string `json:"message,omitempty"`
  6629. // ForceSendFields is a list of field names (e.g. "Code") to
  6630. // unconditionally include in API requests. By default, fields with
  6631. // empty values are omitted from API requests. However, any non-pointer,
  6632. // non-interface field appearing in ForceSendFields will be sent to the
  6633. // server regardless of whether the field is empty or not. This may be
  6634. // used to include empty fields in Patch requests.
  6635. ForceSendFields []string `json:"-"`
  6636. // NullFields is a list of field names (e.g. "Code") to include in API
  6637. // requests with the JSON null value. By default, fields with empty
  6638. // values are omitted from API requests. However, any field with an
  6639. // empty value appearing in NullFields will be sent to the server as
  6640. // null. It is an error if a field in this list has a non-empty value.
  6641. // This may be used to include null fields in Patch requests.
  6642. NullFields []string `json:"-"`
  6643. }
  6644. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6645. type NoMethod DiskAggregatedListWarning
  6646. raw := NoMethod(*s)
  6647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6648. }
  6649. type DiskAggregatedListWarningData struct {
  6650. // Key: [Output Only] A key that provides more detail on the warning
  6651. // being returned. For example, for warnings where there are no results
  6652. // in a list request for a particular zone, this key might be scope and
  6653. // the key value might be the zone name. Other examples might be a key
  6654. // indicating a deprecated resource and a suggested replacement, or a
  6655. // warning about invalid network settings (for example, if an instance
  6656. // attempts to perform IP forwarding but is not enabled for IP
  6657. // forwarding).
  6658. Key string `json:"key,omitempty"`
  6659. // Value: [Output Only] A warning data value corresponding to the key.
  6660. Value string `json:"value,omitempty"`
  6661. // ForceSendFields is a list of field names (e.g. "Key") to
  6662. // unconditionally include in API requests. By default, fields with
  6663. // empty values are omitted from API requests. However, any non-pointer,
  6664. // non-interface field appearing in ForceSendFields will be sent to the
  6665. // server regardless of whether the field is empty or not. This may be
  6666. // used to include empty fields in Patch requests.
  6667. ForceSendFields []string `json:"-"`
  6668. // NullFields is a list of field names (e.g. "Key") to include in API
  6669. // requests with the JSON null value. By default, fields with empty
  6670. // values are omitted from API requests. However, any field with an
  6671. // empty value appearing in NullFields will be sent to the server as
  6672. // null. It is an error if a field in this list has a non-empty value.
  6673. // This may be used to include null fields in Patch requests.
  6674. NullFields []string `json:"-"`
  6675. }
  6676. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6677. type NoMethod DiskAggregatedListWarningData
  6678. raw := NoMethod(*s)
  6679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6680. }
  6681. // DiskInstantiationConfig: A specification of the desired way to
  6682. // instantiate a disk in the instance template when its created from a
  6683. // source instance.
  6684. type DiskInstantiationConfig struct {
  6685. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  6686. // instance is deleted (but not when the disk is detached from the
  6687. // instance).
  6688. AutoDelete bool `json:"autoDelete,omitempty"`
  6689. // CustomImage: The custom source image to be used to restore this disk
  6690. // when instantiating this instance template.
  6691. CustomImage string `json:"customImage,omitempty"`
  6692. // DeviceName: Specifies the device name of the disk to which the
  6693. // configurations apply to.
  6694. DeviceName string `json:"deviceName,omitempty"`
  6695. // InstantiateFrom: Specifies whether to include the disk and what image
  6696. // to use. Possible values are:
  6697. // - source-image: to use the same image that was used to create the
  6698. // source instance's corresponding disk. Applicable to the boot disk and
  6699. // additional read-write disks.
  6700. // - source-image-family: to use the same image family that was used to
  6701. // create the source instance's corresponding disk. Applicable to the
  6702. // boot disk and additional read-write disks.
  6703. // - custom-image: to use a user-provided image url for disk creation.
  6704. // Applicable to the boot disk and additional read-write disks.
  6705. // - attach-read-only: to attach a read-only disk. Applicable to
  6706. // read-only disks.
  6707. // - do-not-include: to exclude a disk from the template. Applicable to
  6708. // additional read-write disks, local SSDs, and read-only disks.
  6709. //
  6710. // Possible values:
  6711. // "ATTACH_READ_ONLY"
  6712. // "BLANK"
  6713. // "CUSTOM_IMAGE"
  6714. // "DEFAULT"
  6715. // "DO_NOT_INCLUDE"
  6716. // "SOURCE_IMAGE"
  6717. // "SOURCE_IMAGE_FAMILY"
  6718. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  6719. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  6720. // unconditionally include in API requests. By default, fields with
  6721. // empty values are omitted from API requests. However, any non-pointer,
  6722. // non-interface field appearing in ForceSendFields will be sent to the
  6723. // server regardless of whether the field is empty or not. This may be
  6724. // used to include empty fields in Patch requests.
  6725. ForceSendFields []string `json:"-"`
  6726. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  6727. // API requests with the JSON null value. By default, fields with empty
  6728. // values are omitted from API requests. However, any field with an
  6729. // empty value appearing in NullFields will be sent to the server as
  6730. // null. It is an error if a field in this list has a non-empty value.
  6731. // This may be used to include null fields in Patch requests.
  6732. NullFields []string `json:"-"`
  6733. }
  6734. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  6735. type NoMethod DiskInstantiationConfig
  6736. raw := NoMethod(*s)
  6737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6738. }
  6739. // DiskList: A list of Disk resources.
  6740. type DiskList struct {
  6741. // Id: [Output Only] Unique identifier for the resource; defined by the
  6742. // server.
  6743. Id string `json:"id,omitempty"`
  6744. // Items: A list of Disk resources.
  6745. Items []*Disk `json:"items,omitempty"`
  6746. // Kind: [Output Only] Type of resource. Always compute#diskList for
  6747. // lists of disks.
  6748. Kind string `json:"kind,omitempty"`
  6749. // NextPageToken: [Output Only] This token allows you to get the next
  6750. // page of results for list requests. If the number of results is larger
  6751. // than maxResults, use the nextPageToken as a value for the query
  6752. // parameter pageToken in the next list request. Subsequent list
  6753. // requests will have their own nextPageToken to continue paging through
  6754. // the results.
  6755. NextPageToken string `json:"nextPageToken,omitempty"`
  6756. // SelfLink: [Output Only] Server-defined URL for this resource.
  6757. SelfLink string `json:"selfLink,omitempty"`
  6758. // Warning: [Output Only] Informational warning message.
  6759. Warning *DiskListWarning `json:"warning,omitempty"`
  6760. // ServerResponse contains the HTTP response code and headers from the
  6761. // server.
  6762. googleapi.ServerResponse `json:"-"`
  6763. // ForceSendFields is a list of field names (e.g. "Id") to
  6764. // unconditionally include in API requests. By default, fields with
  6765. // empty values are omitted from API requests. However, any non-pointer,
  6766. // non-interface field appearing in ForceSendFields will be sent to the
  6767. // server regardless of whether the field is empty or not. This may be
  6768. // used to include empty fields in Patch requests.
  6769. ForceSendFields []string `json:"-"`
  6770. // NullFields is a list of field names (e.g. "Id") to include in API
  6771. // requests with the JSON null value. By default, fields with empty
  6772. // values are omitted from API requests. However, any field with an
  6773. // empty value appearing in NullFields will be sent to the server as
  6774. // null. It is an error if a field in this list has a non-empty value.
  6775. // This may be used to include null fields in Patch requests.
  6776. NullFields []string `json:"-"`
  6777. }
  6778. func (s *DiskList) MarshalJSON() ([]byte, error) {
  6779. type NoMethod DiskList
  6780. raw := NoMethod(*s)
  6781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6782. }
  6783. // DiskListWarning: [Output Only] Informational warning message.
  6784. type DiskListWarning struct {
  6785. // Code: [Output Only] A warning code, if applicable. For example,
  6786. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6787. // the response.
  6788. //
  6789. // Possible values:
  6790. // "CLEANUP_FAILED"
  6791. // "DEPRECATED_RESOURCE_USED"
  6792. // "DEPRECATED_TYPE_USED"
  6793. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6794. // "EXPERIMENTAL_TYPE_USED"
  6795. // "EXTERNAL_API_WARNING"
  6796. // "FIELD_VALUE_OVERRIDEN"
  6797. // "INJECTED_KERNELS_DEPRECATED"
  6798. // "MISSING_TYPE_DEPENDENCY"
  6799. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6800. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6801. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6802. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6803. // "NEXT_HOP_NOT_RUNNING"
  6804. // "NOT_CRITICAL_ERROR"
  6805. // "NO_RESULTS_ON_PAGE"
  6806. // "REQUIRED_TOS_AGREEMENT"
  6807. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6808. // "RESOURCE_NOT_DELETED"
  6809. // "SCHEMA_VALIDATION_IGNORED"
  6810. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6811. // "UNDECLARED_PROPERTIES"
  6812. // "UNREACHABLE"
  6813. Code string `json:"code,omitempty"`
  6814. // Data: [Output Only] Metadata about this warning in key: value format.
  6815. // For example:
  6816. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6817. Data []*DiskListWarningData `json:"data,omitempty"`
  6818. // Message: [Output Only] A human-readable description of the warning
  6819. // code.
  6820. Message string `json:"message,omitempty"`
  6821. // ForceSendFields is a list of field names (e.g. "Code") to
  6822. // unconditionally include in API requests. By default, fields with
  6823. // empty values are omitted from API requests. However, any non-pointer,
  6824. // non-interface field appearing in ForceSendFields will be sent to the
  6825. // server regardless of whether the field is empty or not. This may be
  6826. // used to include empty fields in Patch requests.
  6827. ForceSendFields []string `json:"-"`
  6828. // NullFields is a list of field names (e.g. "Code") to include in API
  6829. // requests with the JSON null value. By default, fields with empty
  6830. // values are omitted from API requests. However, any field with an
  6831. // empty value appearing in NullFields will be sent to the server as
  6832. // null. It is an error if a field in this list has a non-empty value.
  6833. // This may be used to include null fields in Patch requests.
  6834. NullFields []string `json:"-"`
  6835. }
  6836. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  6837. type NoMethod DiskListWarning
  6838. raw := NoMethod(*s)
  6839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6840. }
  6841. type DiskListWarningData struct {
  6842. // Key: [Output Only] A key that provides more detail on the warning
  6843. // being returned. For example, for warnings where there are no results
  6844. // in a list request for a particular zone, this key might be scope and
  6845. // the key value might be the zone name. Other examples might be a key
  6846. // indicating a deprecated resource and a suggested replacement, or a
  6847. // warning about invalid network settings (for example, if an instance
  6848. // attempts to perform IP forwarding but is not enabled for IP
  6849. // forwarding).
  6850. Key string `json:"key,omitempty"`
  6851. // Value: [Output Only] A warning data value corresponding to the key.
  6852. Value string `json:"value,omitempty"`
  6853. // ForceSendFields is a list of field names (e.g. "Key") to
  6854. // unconditionally include in API requests. By default, fields with
  6855. // empty values are omitted from API requests. However, any non-pointer,
  6856. // non-interface field appearing in ForceSendFields will be sent to the
  6857. // server regardless of whether the field is empty or not. This may be
  6858. // used to include empty fields in Patch requests.
  6859. ForceSendFields []string `json:"-"`
  6860. // NullFields is a list of field names (e.g. "Key") to include in API
  6861. // requests with the JSON null value. By default, fields with empty
  6862. // values are omitted from API requests. However, any field with an
  6863. // empty value appearing in NullFields will be sent to the server as
  6864. // null. It is an error if a field in this list has a non-empty value.
  6865. // This may be used to include null fields in Patch requests.
  6866. NullFields []string `json:"-"`
  6867. }
  6868. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  6869. type NoMethod DiskListWarningData
  6870. raw := NoMethod(*s)
  6871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6872. }
  6873. type DiskMoveRequest struct {
  6874. // DestinationZone: The URL of the destination zone to move the disk.
  6875. // This can be a full or partial URL. For example, the following are all
  6876. // valid URLs to a zone:
  6877. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  6878. //
  6879. // - projects/project/zones/zone
  6880. // - zones/zone
  6881. DestinationZone string `json:"destinationZone,omitempty"`
  6882. // TargetDisk: The URL of the target disk to move. This can be a full or
  6883. // partial URL. For example, the following are all valid URLs to a disk:
  6884. //
  6885. // -
  6886. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  6887. // - projects/project/zones/zone/disks/disk
  6888. // - zones/zone/disks/disk
  6889. TargetDisk string `json:"targetDisk,omitempty"`
  6890. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  6891. // unconditionally include in API requests. By default, fields with
  6892. // empty values are omitted from API requests. However, any non-pointer,
  6893. // non-interface field appearing in ForceSendFields will be sent to the
  6894. // server regardless of whether the field is empty or not. This may be
  6895. // used to include empty fields in Patch requests.
  6896. ForceSendFields []string `json:"-"`
  6897. // NullFields is a list of field names (e.g. "DestinationZone") to
  6898. // include in API requests with the JSON null value. By default, fields
  6899. // with empty values are omitted from API requests. However, any field
  6900. // with an empty value appearing in NullFields will be sent to the
  6901. // server as null. It is an error if a field in this list has a
  6902. // non-empty value. This may be used to include null fields in Patch
  6903. // requests.
  6904. NullFields []string `json:"-"`
  6905. }
  6906. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  6907. type NoMethod DiskMoveRequest
  6908. raw := NoMethod(*s)
  6909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6910. }
  6911. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  6912. // (== resource_for v1.diskTypes ==)
  6913. type DiskType struct {
  6914. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6915. // format.
  6916. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6917. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  6918. // GB.
  6919. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  6920. // Deprecated: [Output Only] The deprecation status associated with this
  6921. // disk type.
  6922. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  6923. // Description: [Output Only] An optional description of this resource.
  6924. Description string `json:"description,omitempty"`
  6925. // Id: [Output Only] The unique identifier for the resource. This
  6926. // identifier is defined by the server.
  6927. Id uint64 `json:"id,omitempty,string"`
  6928. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  6929. // disk types.
  6930. Kind string `json:"kind,omitempty"`
  6931. // Name: [Output Only] Name of the resource.
  6932. Name string `json:"name,omitempty"`
  6933. // Region: [Output Only] URL of the region where the disk type resides.
  6934. // Only applicable for regional resources. You must specify this field
  6935. // as part of the HTTP request URL. It is not settable as a field in the
  6936. // request body.
  6937. Region string `json:"region,omitempty"`
  6938. // SelfLink: [Output Only] Server-defined URL for the resource.
  6939. SelfLink string `json:"selfLink,omitempty"`
  6940. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  6941. // with the resource id.
  6942. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  6943. // ValidDiskSize: [Output Only] An optional textual description of the
  6944. // valid disk size, such as "10GB-10TB".
  6945. ValidDiskSize string `json:"validDiskSize,omitempty"`
  6946. // Zone: [Output Only] URL of the zone where the disk type resides. You
  6947. // must specify this field as part of the HTTP request URL. It is not
  6948. // settable as a field in the request body.
  6949. Zone string `json:"zone,omitempty"`
  6950. // ServerResponse contains the HTTP response code and headers from the
  6951. // server.
  6952. googleapi.ServerResponse `json:"-"`
  6953. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  6954. // to unconditionally include in API requests. By default, fields with
  6955. // empty values are omitted from API requests. However, any non-pointer,
  6956. // non-interface field appearing in ForceSendFields will be sent to the
  6957. // server regardless of whether the field is empty or not. This may be
  6958. // used to include empty fields in Patch requests.
  6959. ForceSendFields []string `json:"-"`
  6960. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  6961. // include in API requests with the JSON null value. By default, fields
  6962. // with empty values are omitted from API requests. However, any field
  6963. // with an empty value appearing in NullFields will be sent to the
  6964. // server as null. It is an error if a field in this list has a
  6965. // non-empty value. This may be used to include null fields in Patch
  6966. // requests.
  6967. NullFields []string `json:"-"`
  6968. }
  6969. func (s *DiskType) MarshalJSON() ([]byte, error) {
  6970. type NoMethod DiskType
  6971. raw := NoMethod(*s)
  6972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6973. }
  6974. type DiskTypeAggregatedList struct {
  6975. // Id: [Output Only] Unique identifier for the resource; defined by the
  6976. // server.
  6977. Id string `json:"id,omitempty"`
  6978. // Items: A list of DiskTypesScopedList resources.
  6979. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  6980. // Kind: [Output Only] Type of resource. Always
  6981. // compute#diskTypeAggregatedList.
  6982. Kind string `json:"kind,omitempty"`
  6983. // NextPageToken: [Output Only] This token allows you to get the next
  6984. // page of results for list requests. If the number of results is larger
  6985. // than maxResults, use the nextPageToken as a value for the query
  6986. // parameter pageToken in the next list request. Subsequent list
  6987. // requests will have their own nextPageToken to continue paging through
  6988. // the results.
  6989. NextPageToken string `json:"nextPageToken,omitempty"`
  6990. // SelfLink: [Output Only] Server-defined URL for this resource.
  6991. SelfLink string `json:"selfLink,omitempty"`
  6992. // Warning: [Output Only] Informational warning message.
  6993. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  6994. // ServerResponse contains the HTTP response code and headers from the
  6995. // server.
  6996. googleapi.ServerResponse `json:"-"`
  6997. // ForceSendFields is a list of field names (e.g. "Id") to
  6998. // unconditionally include in API requests. By default, fields with
  6999. // empty values are omitted from API requests. However, any non-pointer,
  7000. // non-interface field appearing in ForceSendFields will be sent to the
  7001. // server regardless of whether the field is empty or not. This may be
  7002. // used to include empty fields in Patch requests.
  7003. ForceSendFields []string `json:"-"`
  7004. // NullFields is a list of field names (e.g. "Id") to include in API
  7005. // requests with the JSON null value. By default, fields with empty
  7006. // values are omitted from API requests. However, any field with an
  7007. // empty value appearing in NullFields will be sent to the server as
  7008. // null. It is an error if a field in this list has a non-empty value.
  7009. // This may be used to include null fields in Patch requests.
  7010. NullFields []string `json:"-"`
  7011. }
  7012. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  7013. type NoMethod DiskTypeAggregatedList
  7014. raw := NoMethod(*s)
  7015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7016. }
  7017. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  7018. // message.
  7019. type DiskTypeAggregatedListWarning struct {
  7020. // Code: [Output Only] A warning code, if applicable. For example,
  7021. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7022. // the response.
  7023. //
  7024. // Possible values:
  7025. // "CLEANUP_FAILED"
  7026. // "DEPRECATED_RESOURCE_USED"
  7027. // "DEPRECATED_TYPE_USED"
  7028. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7029. // "EXPERIMENTAL_TYPE_USED"
  7030. // "EXTERNAL_API_WARNING"
  7031. // "FIELD_VALUE_OVERRIDEN"
  7032. // "INJECTED_KERNELS_DEPRECATED"
  7033. // "MISSING_TYPE_DEPENDENCY"
  7034. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7035. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7036. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7037. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7038. // "NEXT_HOP_NOT_RUNNING"
  7039. // "NOT_CRITICAL_ERROR"
  7040. // "NO_RESULTS_ON_PAGE"
  7041. // "REQUIRED_TOS_AGREEMENT"
  7042. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7043. // "RESOURCE_NOT_DELETED"
  7044. // "SCHEMA_VALIDATION_IGNORED"
  7045. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7046. // "UNDECLARED_PROPERTIES"
  7047. // "UNREACHABLE"
  7048. Code string `json:"code,omitempty"`
  7049. // Data: [Output Only] Metadata about this warning in key: value format.
  7050. // For example:
  7051. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7052. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  7053. // Message: [Output Only] A human-readable description of the warning
  7054. // code.
  7055. Message string `json:"message,omitempty"`
  7056. // ForceSendFields is a list of field names (e.g. "Code") to
  7057. // unconditionally include in API requests. By default, fields with
  7058. // empty values are omitted from API requests. However, any non-pointer,
  7059. // non-interface field appearing in ForceSendFields will be sent to the
  7060. // server regardless of whether the field is empty or not. This may be
  7061. // used to include empty fields in Patch requests.
  7062. ForceSendFields []string `json:"-"`
  7063. // NullFields is a list of field names (e.g. "Code") to include in API
  7064. // requests with the JSON null value. By default, fields with empty
  7065. // values are omitted from API requests. However, any field with an
  7066. // empty value appearing in NullFields will be sent to the server as
  7067. // null. It is an error if a field in this list has a non-empty value.
  7068. // This may be used to include null fields in Patch requests.
  7069. NullFields []string `json:"-"`
  7070. }
  7071. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  7072. type NoMethod DiskTypeAggregatedListWarning
  7073. raw := NoMethod(*s)
  7074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7075. }
  7076. type DiskTypeAggregatedListWarningData struct {
  7077. // Key: [Output Only] A key that provides more detail on the warning
  7078. // being returned. For example, for warnings where there are no results
  7079. // in a list request for a particular zone, this key might be scope and
  7080. // the key value might be the zone name. Other examples might be a key
  7081. // indicating a deprecated resource and a suggested replacement, or a
  7082. // warning about invalid network settings (for example, if an instance
  7083. // attempts to perform IP forwarding but is not enabled for IP
  7084. // forwarding).
  7085. Key string `json:"key,omitempty"`
  7086. // Value: [Output Only] A warning data value corresponding to the key.
  7087. Value string `json:"value,omitempty"`
  7088. // ForceSendFields is a list of field names (e.g. "Key") to
  7089. // unconditionally include in API requests. By default, fields with
  7090. // empty values are omitted from API requests. However, any non-pointer,
  7091. // non-interface field appearing in ForceSendFields will be sent to the
  7092. // server regardless of whether the field is empty or not. This may be
  7093. // used to include empty fields in Patch requests.
  7094. ForceSendFields []string `json:"-"`
  7095. // NullFields is a list of field names (e.g. "Key") to include in API
  7096. // requests with the JSON null value. By default, fields with empty
  7097. // values are omitted from API requests. However, any field with an
  7098. // empty value appearing in NullFields will be sent to the server as
  7099. // null. It is an error if a field in this list has a non-empty value.
  7100. // This may be used to include null fields in Patch requests.
  7101. NullFields []string `json:"-"`
  7102. }
  7103. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  7104. type NoMethod DiskTypeAggregatedListWarningData
  7105. raw := NoMethod(*s)
  7106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7107. }
  7108. // DiskTypeList: Contains a list of disk types.
  7109. type DiskTypeList struct {
  7110. // Id: [Output Only] Unique identifier for the resource; defined by the
  7111. // server.
  7112. Id string `json:"id,omitempty"`
  7113. // Items: A list of DiskType resources.
  7114. Items []*DiskType `json:"items,omitempty"`
  7115. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  7116. // disk types.
  7117. Kind string `json:"kind,omitempty"`
  7118. // NextPageToken: [Output Only] This token allows you to get the next
  7119. // page of results for list requests. If the number of results is larger
  7120. // than maxResults, use the nextPageToken as a value for the query
  7121. // parameter pageToken in the next list request. Subsequent list
  7122. // requests will have their own nextPageToken to continue paging through
  7123. // the results.
  7124. NextPageToken string `json:"nextPageToken,omitempty"`
  7125. // SelfLink: [Output Only] Server-defined URL for this resource.
  7126. SelfLink string `json:"selfLink,omitempty"`
  7127. // Warning: [Output Only] Informational warning message.
  7128. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  7129. // ServerResponse contains the HTTP response code and headers from the
  7130. // server.
  7131. googleapi.ServerResponse `json:"-"`
  7132. // ForceSendFields is a list of field names (e.g. "Id") to
  7133. // unconditionally include in API requests. By default, fields with
  7134. // empty values are omitted from API requests. However, any non-pointer,
  7135. // non-interface field appearing in ForceSendFields will be sent to the
  7136. // server regardless of whether the field is empty or not. This may be
  7137. // used to include empty fields in Patch requests.
  7138. ForceSendFields []string `json:"-"`
  7139. // NullFields is a list of field names (e.g. "Id") to include in API
  7140. // requests with the JSON null value. By default, fields with empty
  7141. // values are omitted from API requests. However, any field with an
  7142. // empty value appearing in NullFields will be sent to the server as
  7143. // null. It is an error if a field in this list has a non-empty value.
  7144. // This may be used to include null fields in Patch requests.
  7145. NullFields []string `json:"-"`
  7146. }
  7147. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  7148. type NoMethod DiskTypeList
  7149. raw := NoMethod(*s)
  7150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7151. }
  7152. // DiskTypeListWarning: [Output Only] Informational warning message.
  7153. type DiskTypeListWarning struct {
  7154. // Code: [Output Only] A warning code, if applicable. For example,
  7155. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7156. // the response.
  7157. //
  7158. // Possible values:
  7159. // "CLEANUP_FAILED"
  7160. // "DEPRECATED_RESOURCE_USED"
  7161. // "DEPRECATED_TYPE_USED"
  7162. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7163. // "EXPERIMENTAL_TYPE_USED"
  7164. // "EXTERNAL_API_WARNING"
  7165. // "FIELD_VALUE_OVERRIDEN"
  7166. // "INJECTED_KERNELS_DEPRECATED"
  7167. // "MISSING_TYPE_DEPENDENCY"
  7168. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7169. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7170. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7171. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7172. // "NEXT_HOP_NOT_RUNNING"
  7173. // "NOT_CRITICAL_ERROR"
  7174. // "NO_RESULTS_ON_PAGE"
  7175. // "REQUIRED_TOS_AGREEMENT"
  7176. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7177. // "RESOURCE_NOT_DELETED"
  7178. // "SCHEMA_VALIDATION_IGNORED"
  7179. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7180. // "UNDECLARED_PROPERTIES"
  7181. // "UNREACHABLE"
  7182. Code string `json:"code,omitempty"`
  7183. // Data: [Output Only] Metadata about this warning in key: value format.
  7184. // For example:
  7185. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7186. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  7187. // Message: [Output Only] A human-readable description of the warning
  7188. // code.
  7189. Message string `json:"message,omitempty"`
  7190. // ForceSendFields is a list of field names (e.g. "Code") to
  7191. // unconditionally include in API requests. By default, fields with
  7192. // empty values are omitted from API requests. However, any non-pointer,
  7193. // non-interface field appearing in ForceSendFields will be sent to the
  7194. // server regardless of whether the field is empty or not. This may be
  7195. // used to include empty fields in Patch requests.
  7196. ForceSendFields []string `json:"-"`
  7197. // NullFields is a list of field names (e.g. "Code") to include in API
  7198. // requests with the JSON null value. By default, fields with empty
  7199. // values are omitted from API requests. However, any field with an
  7200. // empty value appearing in NullFields will be sent to the server as
  7201. // null. It is an error if a field in this list has a non-empty value.
  7202. // This may be used to include null fields in Patch requests.
  7203. NullFields []string `json:"-"`
  7204. }
  7205. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  7206. type NoMethod DiskTypeListWarning
  7207. raw := NoMethod(*s)
  7208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7209. }
  7210. type DiskTypeListWarningData struct {
  7211. // Key: [Output Only] A key that provides more detail on the warning
  7212. // being returned. For example, for warnings where there are no results
  7213. // in a list request for a particular zone, this key might be scope and
  7214. // the key value might be the zone name. Other examples might be a key
  7215. // indicating a deprecated resource and a suggested replacement, or a
  7216. // warning about invalid network settings (for example, if an instance
  7217. // attempts to perform IP forwarding but is not enabled for IP
  7218. // forwarding).
  7219. Key string `json:"key,omitempty"`
  7220. // Value: [Output Only] A warning data value corresponding to the key.
  7221. Value string `json:"value,omitempty"`
  7222. // ForceSendFields is a list of field names (e.g. "Key") to
  7223. // unconditionally include in API requests. By default, fields with
  7224. // empty values are omitted from API requests. However, any non-pointer,
  7225. // non-interface field appearing in ForceSendFields will be sent to the
  7226. // server regardless of whether the field is empty or not. This may be
  7227. // used to include empty fields in Patch requests.
  7228. ForceSendFields []string `json:"-"`
  7229. // NullFields is a list of field names (e.g. "Key") to include in API
  7230. // requests with the JSON null value. By default, fields with empty
  7231. // values are omitted from API requests. However, any field with an
  7232. // empty value appearing in NullFields will be sent to the server as
  7233. // null. It is an error if a field in this list has a non-empty value.
  7234. // This may be used to include null fields in Patch requests.
  7235. NullFields []string `json:"-"`
  7236. }
  7237. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  7238. type NoMethod DiskTypeListWarningData
  7239. raw := NoMethod(*s)
  7240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7241. }
  7242. type DiskTypesScopedList struct {
  7243. // DiskTypes: [Output Only] A list of disk types contained in this
  7244. // scope.
  7245. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  7246. // Warning: [Output Only] Informational warning which replaces the list
  7247. // of disk types when the list is empty.
  7248. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  7249. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  7250. // unconditionally include in API requests. By default, fields with
  7251. // empty values are omitted from API requests. However, any non-pointer,
  7252. // non-interface field appearing in ForceSendFields will be sent to the
  7253. // server regardless of whether the field is empty or not. This may be
  7254. // used to include empty fields in Patch requests.
  7255. ForceSendFields []string `json:"-"`
  7256. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  7257. // API requests with the JSON null value. By default, fields with empty
  7258. // values are omitted from API requests. However, any field with an
  7259. // empty value appearing in NullFields will be sent to the server as
  7260. // null. It is an error if a field in this list has a non-empty value.
  7261. // This may be used to include null fields in Patch requests.
  7262. NullFields []string `json:"-"`
  7263. }
  7264. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  7265. type NoMethod DiskTypesScopedList
  7266. raw := NoMethod(*s)
  7267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7268. }
  7269. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  7270. // replaces the list of disk types when the list is empty.
  7271. type DiskTypesScopedListWarning struct {
  7272. // Code: [Output Only] A warning code, if applicable. For example,
  7273. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7274. // the response.
  7275. //
  7276. // Possible values:
  7277. // "CLEANUP_FAILED"
  7278. // "DEPRECATED_RESOURCE_USED"
  7279. // "DEPRECATED_TYPE_USED"
  7280. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7281. // "EXPERIMENTAL_TYPE_USED"
  7282. // "EXTERNAL_API_WARNING"
  7283. // "FIELD_VALUE_OVERRIDEN"
  7284. // "INJECTED_KERNELS_DEPRECATED"
  7285. // "MISSING_TYPE_DEPENDENCY"
  7286. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7287. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7288. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7289. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7290. // "NEXT_HOP_NOT_RUNNING"
  7291. // "NOT_CRITICAL_ERROR"
  7292. // "NO_RESULTS_ON_PAGE"
  7293. // "REQUIRED_TOS_AGREEMENT"
  7294. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7295. // "RESOURCE_NOT_DELETED"
  7296. // "SCHEMA_VALIDATION_IGNORED"
  7297. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7298. // "UNDECLARED_PROPERTIES"
  7299. // "UNREACHABLE"
  7300. Code string `json:"code,omitempty"`
  7301. // Data: [Output Only] Metadata about this warning in key: value format.
  7302. // For example:
  7303. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7304. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  7305. // Message: [Output Only] A human-readable description of the warning
  7306. // code.
  7307. Message string `json:"message,omitempty"`
  7308. // ForceSendFields is a list of field names (e.g. "Code") to
  7309. // unconditionally include in API requests. By default, fields with
  7310. // empty values are omitted from API requests. However, any non-pointer,
  7311. // non-interface field appearing in ForceSendFields will be sent to the
  7312. // server regardless of whether the field is empty or not. This may be
  7313. // used to include empty fields in Patch requests.
  7314. ForceSendFields []string `json:"-"`
  7315. // NullFields is a list of field names (e.g. "Code") to include in API
  7316. // requests with the JSON null value. By default, fields with empty
  7317. // values are omitted from API requests. However, any field with an
  7318. // empty value appearing in NullFields will be sent to the server as
  7319. // null. It is an error if a field in this list has a non-empty value.
  7320. // This may be used to include null fields in Patch requests.
  7321. NullFields []string `json:"-"`
  7322. }
  7323. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  7324. type NoMethod DiskTypesScopedListWarning
  7325. raw := NoMethod(*s)
  7326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7327. }
  7328. type DiskTypesScopedListWarningData struct {
  7329. // Key: [Output Only] A key that provides more detail on the warning
  7330. // being returned. For example, for warnings where there are no results
  7331. // in a list request for a particular zone, this key might be scope and
  7332. // the key value might be the zone name. Other examples might be a key
  7333. // indicating a deprecated resource and a suggested replacement, or a
  7334. // warning about invalid network settings (for example, if an instance
  7335. // attempts to perform IP forwarding but is not enabled for IP
  7336. // forwarding).
  7337. Key string `json:"key,omitempty"`
  7338. // Value: [Output Only] A warning data value corresponding to the key.
  7339. Value string `json:"value,omitempty"`
  7340. // ForceSendFields is a list of field names (e.g. "Key") to
  7341. // unconditionally include in API requests. By default, fields with
  7342. // empty values are omitted from API requests. However, any non-pointer,
  7343. // non-interface field appearing in ForceSendFields will be sent to the
  7344. // server regardless of whether the field is empty or not. This may be
  7345. // used to include empty fields in Patch requests.
  7346. ForceSendFields []string `json:"-"`
  7347. // NullFields is a list of field names (e.g. "Key") to include in API
  7348. // requests with the JSON null value. By default, fields with empty
  7349. // values are omitted from API requests. However, any field with an
  7350. // empty value appearing in NullFields will be sent to the server as
  7351. // null. It is an error if a field in this list has a non-empty value.
  7352. // This may be used to include null fields in Patch requests.
  7353. NullFields []string `json:"-"`
  7354. }
  7355. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  7356. type NoMethod DiskTypesScopedListWarningData
  7357. raw := NoMethod(*s)
  7358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7359. }
  7360. type DisksAddResourcePoliciesRequest struct {
  7361. // ResourcePolicies: Resource policies to be added to this disk.
  7362. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  7363. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  7364. // unconditionally include in API requests. By default, fields with
  7365. // empty values are omitted from API requests. However, any non-pointer,
  7366. // non-interface field appearing in ForceSendFields will be sent to the
  7367. // server regardless of whether the field is empty or not. This may be
  7368. // used to include empty fields in Patch requests.
  7369. ForceSendFields []string `json:"-"`
  7370. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  7371. // include in API requests with the JSON null value. By default, fields
  7372. // with empty values are omitted from API requests. However, any field
  7373. // with an empty value appearing in NullFields will be sent to the
  7374. // server as null. It is an error if a field in this list has a
  7375. // non-empty value. This may be used to include null fields in Patch
  7376. // requests.
  7377. NullFields []string `json:"-"`
  7378. }
  7379. func (s *DisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  7380. type NoMethod DisksAddResourcePoliciesRequest
  7381. raw := NoMethod(*s)
  7382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7383. }
  7384. type DisksRemoveResourcePoliciesRequest struct {
  7385. // ResourcePolicies: Resource policies to be removed from this disk.
  7386. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  7387. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  7388. // unconditionally include in API requests. By default, fields with
  7389. // empty values are omitted from API requests. However, any non-pointer,
  7390. // non-interface field appearing in ForceSendFields will be sent to the
  7391. // server regardless of whether the field is empty or not. This may be
  7392. // used to include empty fields in Patch requests.
  7393. ForceSendFields []string `json:"-"`
  7394. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  7395. // include in API requests with the JSON null value. By default, fields
  7396. // with empty values are omitted from API requests. However, any field
  7397. // with an empty value appearing in NullFields will be sent to the
  7398. // server as null. It is an error if a field in this list has a
  7399. // non-empty value. This may be used to include null fields in Patch
  7400. // requests.
  7401. NullFields []string `json:"-"`
  7402. }
  7403. func (s *DisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  7404. type NoMethod DisksRemoveResourcePoliciesRequest
  7405. raw := NoMethod(*s)
  7406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7407. }
  7408. type DisksResizeRequest struct {
  7409. // SizeGb: The new size of the persistent disk, which is specified in
  7410. // GB.
  7411. SizeGb int64 `json:"sizeGb,omitempty,string"`
  7412. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  7413. // unconditionally include in API requests. By default, fields with
  7414. // empty values are omitted from API requests. However, any non-pointer,
  7415. // non-interface field appearing in ForceSendFields will be sent to the
  7416. // server regardless of whether the field is empty or not. This may be
  7417. // used to include empty fields in Patch requests.
  7418. ForceSendFields []string `json:"-"`
  7419. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  7420. // requests with the JSON null value. By default, fields with empty
  7421. // values are omitted from API requests. However, any field with an
  7422. // empty value appearing in NullFields will be sent to the server as
  7423. // null. It is an error if a field in this list has a non-empty value.
  7424. // This may be used to include null fields in Patch requests.
  7425. NullFields []string `json:"-"`
  7426. }
  7427. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  7428. type NoMethod DisksResizeRequest
  7429. raw := NoMethod(*s)
  7430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7431. }
  7432. type DisksScopedList struct {
  7433. // Disks: [Output Only] A list of disks contained in this scope.
  7434. Disks []*Disk `json:"disks,omitempty"`
  7435. // Warning: [Output Only] Informational warning which replaces the list
  7436. // of disks when the list is empty.
  7437. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  7438. // ForceSendFields is a list of field names (e.g. "Disks") to
  7439. // unconditionally include in API requests. By default, fields with
  7440. // empty values are omitted from API requests. However, any non-pointer,
  7441. // non-interface field appearing in ForceSendFields will be sent to the
  7442. // server regardless of whether the field is empty or not. This may be
  7443. // used to include empty fields in Patch requests.
  7444. ForceSendFields []string `json:"-"`
  7445. // NullFields is a list of field names (e.g. "Disks") to include in API
  7446. // requests with the JSON null value. By default, fields with empty
  7447. // values are omitted from API requests. However, any field with an
  7448. // empty value appearing in NullFields will be sent to the server as
  7449. // null. It is an error if a field in this list has a non-empty value.
  7450. // This may be used to include null fields in Patch requests.
  7451. NullFields []string `json:"-"`
  7452. }
  7453. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  7454. type NoMethod DisksScopedList
  7455. raw := NoMethod(*s)
  7456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7457. }
  7458. // DisksScopedListWarning: [Output Only] Informational warning which
  7459. // replaces the list of disks when the list is empty.
  7460. type DisksScopedListWarning struct {
  7461. // Code: [Output Only] A warning code, if applicable. For example,
  7462. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7463. // the response.
  7464. //
  7465. // Possible values:
  7466. // "CLEANUP_FAILED"
  7467. // "DEPRECATED_RESOURCE_USED"
  7468. // "DEPRECATED_TYPE_USED"
  7469. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7470. // "EXPERIMENTAL_TYPE_USED"
  7471. // "EXTERNAL_API_WARNING"
  7472. // "FIELD_VALUE_OVERRIDEN"
  7473. // "INJECTED_KERNELS_DEPRECATED"
  7474. // "MISSING_TYPE_DEPENDENCY"
  7475. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7476. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7477. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7478. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7479. // "NEXT_HOP_NOT_RUNNING"
  7480. // "NOT_CRITICAL_ERROR"
  7481. // "NO_RESULTS_ON_PAGE"
  7482. // "REQUIRED_TOS_AGREEMENT"
  7483. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7484. // "RESOURCE_NOT_DELETED"
  7485. // "SCHEMA_VALIDATION_IGNORED"
  7486. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7487. // "UNDECLARED_PROPERTIES"
  7488. // "UNREACHABLE"
  7489. Code string `json:"code,omitempty"`
  7490. // Data: [Output Only] Metadata about this warning in key: value format.
  7491. // For example:
  7492. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7493. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  7494. // Message: [Output Only] A human-readable description of the warning
  7495. // code.
  7496. Message string `json:"message,omitempty"`
  7497. // ForceSendFields is a list of field names (e.g. "Code") to
  7498. // unconditionally include in API requests. By default, fields with
  7499. // empty values are omitted from API requests. However, any non-pointer,
  7500. // non-interface field appearing in ForceSendFields will be sent to the
  7501. // server regardless of whether the field is empty or not. This may be
  7502. // used to include empty fields in Patch requests.
  7503. ForceSendFields []string `json:"-"`
  7504. // NullFields is a list of field names (e.g. "Code") to include in API
  7505. // requests with the JSON null value. By default, fields with empty
  7506. // values are omitted from API requests. However, any field with an
  7507. // empty value appearing in NullFields will be sent to the server as
  7508. // null. It is an error if a field in this list has a non-empty value.
  7509. // This may be used to include null fields in Patch requests.
  7510. NullFields []string `json:"-"`
  7511. }
  7512. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  7513. type NoMethod DisksScopedListWarning
  7514. raw := NoMethod(*s)
  7515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7516. }
  7517. type DisksScopedListWarningData struct {
  7518. // Key: [Output Only] A key that provides more detail on the warning
  7519. // being returned. For example, for warnings where there are no results
  7520. // in a list request for a particular zone, this key might be scope and
  7521. // the key value might be the zone name. Other examples might be a key
  7522. // indicating a deprecated resource and a suggested replacement, or a
  7523. // warning about invalid network settings (for example, if an instance
  7524. // attempts to perform IP forwarding but is not enabled for IP
  7525. // forwarding).
  7526. Key string `json:"key,omitempty"`
  7527. // Value: [Output Only] A warning data value corresponding to the key.
  7528. Value string `json:"value,omitempty"`
  7529. // ForceSendFields is a list of field names (e.g. "Key") to
  7530. // unconditionally include in API requests. By default, fields with
  7531. // empty values are omitted from API requests. However, any non-pointer,
  7532. // non-interface field appearing in ForceSendFields will be sent to the
  7533. // server regardless of whether the field is empty or not. This may be
  7534. // used to include empty fields in Patch requests.
  7535. ForceSendFields []string `json:"-"`
  7536. // NullFields is a list of field names (e.g. "Key") to include in API
  7537. // requests with the JSON null value. By default, fields with empty
  7538. // values are omitted from API requests. However, any field with an
  7539. // empty value appearing in NullFields will be sent to the server as
  7540. // null. It is an error if a field in this list has a non-empty value.
  7541. // This may be used to include null fields in Patch requests.
  7542. NullFields []string `json:"-"`
  7543. }
  7544. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  7545. type NoMethod DisksScopedListWarningData
  7546. raw := NoMethod(*s)
  7547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7548. }
  7549. // DisplayDevice: A set of Display Device options
  7550. type DisplayDevice struct {
  7551. // EnableDisplay: Defines whether the instance has Display enabled.
  7552. EnableDisplay bool `json:"enableDisplay,omitempty"`
  7553. // ForceSendFields is a list of field names (e.g. "EnableDisplay") to
  7554. // unconditionally include in API requests. By default, fields with
  7555. // empty values are omitted from API requests. However, any non-pointer,
  7556. // non-interface field appearing in ForceSendFields will be sent to the
  7557. // server regardless of whether the field is empty or not. This may be
  7558. // used to include empty fields in Patch requests.
  7559. ForceSendFields []string `json:"-"`
  7560. // NullFields is a list of field names (e.g. "EnableDisplay") to include
  7561. // in API requests with the JSON null value. By default, fields with
  7562. // empty values are omitted from API requests. However, any field with
  7563. // an empty value appearing in NullFields will be sent to the server as
  7564. // null. It is an error if a field in this list has a non-empty value.
  7565. // This may be used to include null fields in Patch requests.
  7566. NullFields []string `json:"-"`
  7567. }
  7568. func (s *DisplayDevice) MarshalJSON() ([]byte, error) {
  7569. type NoMethod DisplayDevice
  7570. raw := NoMethod(*s)
  7571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7572. }
  7573. type DistributionPolicy struct {
  7574. // Zones: Zones where the regional managed instance group will create
  7575. // and manage instances.
  7576. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  7577. // ForceSendFields is a list of field names (e.g. "Zones") to
  7578. // unconditionally include in API requests. By default, fields with
  7579. // empty values are omitted from API requests. However, any non-pointer,
  7580. // non-interface field appearing in ForceSendFields will be sent to the
  7581. // server regardless of whether the field is empty or not. This may be
  7582. // used to include empty fields in Patch requests.
  7583. ForceSendFields []string `json:"-"`
  7584. // NullFields is a list of field names (e.g. "Zones") to include in API
  7585. // requests with the JSON null value. By default, fields with empty
  7586. // values are omitted from API requests. However, any field with an
  7587. // empty value appearing in NullFields will be sent to the server as
  7588. // null. It is an error if a field in this list has a non-empty value.
  7589. // This may be used to include null fields in Patch requests.
  7590. NullFields []string `json:"-"`
  7591. }
  7592. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  7593. type NoMethod DistributionPolicy
  7594. raw := NoMethod(*s)
  7595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7596. }
  7597. type DistributionPolicyZoneConfiguration struct {
  7598. // Zone: The URL of the zone. The zone must exist in the region where
  7599. // the managed instance group is located.
  7600. Zone string `json:"zone,omitempty"`
  7601. // ForceSendFields is a list of field names (e.g. "Zone") to
  7602. // unconditionally include in API requests. By default, fields with
  7603. // empty values are omitted from API requests. However, any non-pointer,
  7604. // non-interface field appearing in ForceSendFields will be sent to the
  7605. // server regardless of whether the field is empty or not. This may be
  7606. // used to include empty fields in Patch requests.
  7607. ForceSendFields []string `json:"-"`
  7608. // NullFields is a list of field names (e.g. "Zone") to include in API
  7609. // requests with the JSON null value. By default, fields with empty
  7610. // values are omitted from API requests. However, any field with an
  7611. // empty value appearing in NullFields will be sent to the server as
  7612. // null. It is an error if a field in this list has a non-empty value.
  7613. // This may be used to include null fields in Patch requests.
  7614. NullFields []string `json:"-"`
  7615. }
  7616. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  7617. type NoMethod DistributionPolicyZoneConfiguration
  7618. raw := NoMethod(*s)
  7619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7620. }
  7621. // Duration: A Duration represents a fixed-length span of time
  7622. // represented as a count of seconds and fractions of seconds at
  7623. // nanosecond resolution. It is independent of any calendar and concepts
  7624. // like "day" or "month". Range is approximately 10,000 years.
  7625. type Duration struct {
  7626. // Nanos: Span of time that's a fraction of a second at nanosecond
  7627. // resolution. Durations less than one second are represented with a 0
  7628. // `seconds` field and a positive `nanos` field. Must be from 0 to
  7629. // 999,999,999 inclusive.
  7630. Nanos int64 `json:"nanos,omitempty"`
  7631. // Seconds: Span of time at a resolution of a second. Must be from 0 to
  7632. // 315,576,000,000 inclusive. Note: these bounds are computed from: 60
  7633. // sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
  7634. Seconds int64 `json:"seconds,omitempty,string"`
  7635. // ForceSendFields is a list of field names (e.g. "Nanos") to
  7636. // unconditionally include in API requests. By default, fields with
  7637. // empty values are omitted from API requests. However, any non-pointer,
  7638. // non-interface field appearing in ForceSendFields will be sent to the
  7639. // server regardless of whether the field is empty or not. This may be
  7640. // used to include empty fields in Patch requests.
  7641. ForceSendFields []string `json:"-"`
  7642. // NullFields is a list of field names (e.g. "Nanos") to include in API
  7643. // requests with the JSON null value. By default, fields with empty
  7644. // values are omitted from API requests. However, any field with an
  7645. // empty value appearing in NullFields will be sent to the server as
  7646. // null. It is an error if a field in this list has a non-empty value.
  7647. // This may be used to include null fields in Patch requests.
  7648. NullFields []string `json:"-"`
  7649. }
  7650. func (s *Duration) MarshalJSON() ([]byte, error) {
  7651. type NoMethod Duration
  7652. raw := NoMethod(*s)
  7653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7654. }
  7655. type ExchangedPeeringRoute struct {
  7656. // DestRange: The destination range of the route.
  7657. DestRange string `json:"destRange,omitempty"`
  7658. // Imported: If the peering route is imported if there is no
  7659. // confliction.
  7660. Imported bool `json:"imported,omitempty"`
  7661. // NextHopRegion: The region of peering route next hop, only applies to
  7662. // dynamic routes.
  7663. NextHopRegion string `json:"nextHopRegion,omitempty"`
  7664. // Priority: The priority of the peering route.
  7665. Priority int64 `json:"priority,omitempty"`
  7666. // Type: The type of the peering route.
  7667. //
  7668. // Possible values:
  7669. // "DYNAMIC_PEERING_ROUTE"
  7670. // "STATIC_PEERING_ROUTE"
  7671. // "SUBNET_PEERING_ROUTE"
  7672. Type string `json:"type,omitempty"`
  7673. // ForceSendFields is a list of field names (e.g. "DestRange") to
  7674. // unconditionally include in API requests. By default, fields with
  7675. // empty values are omitted from API requests. However, any non-pointer,
  7676. // non-interface field appearing in ForceSendFields will be sent to the
  7677. // server regardless of whether the field is empty or not. This may be
  7678. // used to include empty fields in Patch requests.
  7679. ForceSendFields []string `json:"-"`
  7680. // NullFields is a list of field names (e.g. "DestRange") to include in
  7681. // API requests with the JSON null value. By default, fields with empty
  7682. // values are omitted from API requests. However, any field with an
  7683. // empty value appearing in NullFields will be sent to the server as
  7684. // null. It is an error if a field in this list has a non-empty value.
  7685. // This may be used to include null fields in Patch requests.
  7686. NullFields []string `json:"-"`
  7687. }
  7688. func (s *ExchangedPeeringRoute) MarshalJSON() ([]byte, error) {
  7689. type NoMethod ExchangedPeeringRoute
  7690. raw := NoMethod(*s)
  7691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7692. }
  7693. type ExchangedPeeringRoutesList struct {
  7694. // Id: [Output Only] Unique identifier for the resource; defined by the
  7695. // server.
  7696. Id string `json:"id,omitempty"`
  7697. // Items: A list of ExchangedPeeringRoute resources.
  7698. Items []*ExchangedPeeringRoute `json:"items,omitempty"`
  7699. // Kind: [Output Only] Type of resource. Always
  7700. // compute#exchangedPeeringRoutesList for exchanged peering routes
  7701. // lists.
  7702. Kind string `json:"kind,omitempty"`
  7703. // NextPageToken: [Output Only] This token allows you to get the next
  7704. // page of results for list requests. If the number of results is larger
  7705. // than maxResults, use the nextPageToken as a value for the query
  7706. // parameter pageToken in the next list request. Subsequent list
  7707. // requests will have their own nextPageToken to continue paging through
  7708. // the results.
  7709. NextPageToken string `json:"nextPageToken,omitempty"`
  7710. // SelfLink: [Output Only] Server-defined URL for this resource.
  7711. SelfLink string `json:"selfLink,omitempty"`
  7712. // Warning: [Output Only] Informational warning message.
  7713. Warning *ExchangedPeeringRoutesListWarning `json:"warning,omitempty"`
  7714. // ServerResponse contains the HTTP response code and headers from the
  7715. // server.
  7716. googleapi.ServerResponse `json:"-"`
  7717. // ForceSendFields is a list of field names (e.g. "Id") to
  7718. // unconditionally include in API requests. By default, fields with
  7719. // empty values are omitted from API requests. However, any non-pointer,
  7720. // non-interface field appearing in ForceSendFields will be sent to the
  7721. // server regardless of whether the field is empty or not. This may be
  7722. // used to include empty fields in Patch requests.
  7723. ForceSendFields []string `json:"-"`
  7724. // NullFields is a list of field names (e.g. "Id") to include in API
  7725. // requests with the JSON null value. By default, fields with empty
  7726. // values are omitted from API requests. However, any field with an
  7727. // empty value appearing in NullFields will be sent to the server as
  7728. // null. It is an error if a field in this list has a non-empty value.
  7729. // This may be used to include null fields in Patch requests.
  7730. NullFields []string `json:"-"`
  7731. }
  7732. func (s *ExchangedPeeringRoutesList) MarshalJSON() ([]byte, error) {
  7733. type NoMethod ExchangedPeeringRoutesList
  7734. raw := NoMethod(*s)
  7735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7736. }
  7737. // ExchangedPeeringRoutesListWarning: [Output Only] Informational
  7738. // warning message.
  7739. type ExchangedPeeringRoutesListWarning struct {
  7740. // Code: [Output Only] A warning code, if applicable. For example,
  7741. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7742. // the response.
  7743. //
  7744. // Possible values:
  7745. // "CLEANUP_FAILED"
  7746. // "DEPRECATED_RESOURCE_USED"
  7747. // "DEPRECATED_TYPE_USED"
  7748. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7749. // "EXPERIMENTAL_TYPE_USED"
  7750. // "EXTERNAL_API_WARNING"
  7751. // "FIELD_VALUE_OVERRIDEN"
  7752. // "INJECTED_KERNELS_DEPRECATED"
  7753. // "MISSING_TYPE_DEPENDENCY"
  7754. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7755. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7756. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7757. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7758. // "NEXT_HOP_NOT_RUNNING"
  7759. // "NOT_CRITICAL_ERROR"
  7760. // "NO_RESULTS_ON_PAGE"
  7761. // "REQUIRED_TOS_AGREEMENT"
  7762. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7763. // "RESOURCE_NOT_DELETED"
  7764. // "SCHEMA_VALIDATION_IGNORED"
  7765. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7766. // "UNDECLARED_PROPERTIES"
  7767. // "UNREACHABLE"
  7768. Code string `json:"code,omitempty"`
  7769. // Data: [Output Only] Metadata about this warning in key: value format.
  7770. // For example:
  7771. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7772. Data []*ExchangedPeeringRoutesListWarningData `json:"data,omitempty"`
  7773. // Message: [Output Only] A human-readable description of the warning
  7774. // code.
  7775. Message string `json:"message,omitempty"`
  7776. // ForceSendFields is a list of field names (e.g. "Code") to
  7777. // unconditionally include in API requests. By default, fields with
  7778. // empty values are omitted from API requests. However, any non-pointer,
  7779. // non-interface field appearing in ForceSendFields will be sent to the
  7780. // server regardless of whether the field is empty or not. This may be
  7781. // used to include empty fields in Patch requests.
  7782. ForceSendFields []string `json:"-"`
  7783. // NullFields is a list of field names (e.g. "Code") to include in API
  7784. // requests with the JSON null value. By default, fields with empty
  7785. // values are omitted from API requests. However, any field with an
  7786. // empty value appearing in NullFields will be sent to the server as
  7787. // null. It is an error if a field in this list has a non-empty value.
  7788. // This may be used to include null fields in Patch requests.
  7789. NullFields []string `json:"-"`
  7790. }
  7791. func (s *ExchangedPeeringRoutesListWarning) MarshalJSON() ([]byte, error) {
  7792. type NoMethod ExchangedPeeringRoutesListWarning
  7793. raw := NoMethod(*s)
  7794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7795. }
  7796. type ExchangedPeeringRoutesListWarningData struct {
  7797. // Key: [Output Only] A key that provides more detail on the warning
  7798. // being returned. For example, for warnings where there are no results
  7799. // in a list request for a particular zone, this key might be scope and
  7800. // the key value might be the zone name. Other examples might be a key
  7801. // indicating a deprecated resource and a suggested replacement, or a
  7802. // warning about invalid network settings (for example, if an instance
  7803. // attempts to perform IP forwarding but is not enabled for IP
  7804. // forwarding).
  7805. Key string `json:"key,omitempty"`
  7806. // Value: [Output Only] A warning data value corresponding to the key.
  7807. Value string `json:"value,omitempty"`
  7808. // ForceSendFields is a list of field names (e.g. "Key") to
  7809. // unconditionally include in API requests. By default, fields with
  7810. // empty values are omitted from API requests. However, any non-pointer,
  7811. // non-interface field appearing in ForceSendFields will be sent to the
  7812. // server regardless of whether the field is empty or not. This may be
  7813. // used to include empty fields in Patch requests.
  7814. ForceSendFields []string `json:"-"`
  7815. // NullFields is a list of field names (e.g. "Key") to include in API
  7816. // requests with the JSON null value. By default, fields with empty
  7817. // values are omitted from API requests. However, any field with an
  7818. // empty value appearing in NullFields will be sent to the server as
  7819. // null. It is an error if a field in this list has a non-empty value.
  7820. // This may be used to include null fields in Patch requests.
  7821. NullFields []string `json:"-"`
  7822. }
  7823. func (s *ExchangedPeeringRoutesListWarningData) MarshalJSON() ([]byte, error) {
  7824. type NoMethod ExchangedPeeringRoutesListWarningData
  7825. raw := NoMethod(*s)
  7826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7827. }
  7828. // Expr: Represents an expression text. Example:
  7829. //
  7830. // title: "User account presence" description: "Determines whether the
  7831. // request has a user account" expression: "size(request.user) > 0"
  7832. type Expr struct {
  7833. // Description: An optional description of the expression. This is a
  7834. // longer text which describes the expression, e.g. when hovered over it
  7835. // in a UI.
  7836. Description string `json:"description,omitempty"`
  7837. // Expression: Textual representation of an expression in Common
  7838. // Expression Language syntax.
  7839. //
  7840. // The application context of the containing message determines which
  7841. // well-known feature set of CEL is supported.
  7842. Expression string `json:"expression,omitempty"`
  7843. // Location: An optional string indicating the location of the
  7844. // expression for error reporting, e.g. a file name and a position in
  7845. // the file.
  7846. Location string `json:"location,omitempty"`
  7847. // Title: An optional title for the expression, i.e. a short string
  7848. // describing its purpose. This can be used e.g. in UIs which allow to
  7849. // enter the expression.
  7850. Title string `json:"title,omitempty"`
  7851. // ForceSendFields is a list of field names (e.g. "Description") to
  7852. // unconditionally include in API requests. By default, fields with
  7853. // empty values are omitted from API requests. However, any non-pointer,
  7854. // non-interface field appearing in ForceSendFields will be sent to the
  7855. // server regardless of whether the field is empty or not. This may be
  7856. // used to include empty fields in Patch requests.
  7857. ForceSendFields []string `json:"-"`
  7858. // NullFields is a list of field names (e.g. "Description") to include
  7859. // in API requests with the JSON null value. By default, fields with
  7860. // empty values are omitted from API requests. However, any field with
  7861. // an empty value appearing in NullFields will be sent to the server as
  7862. // null. It is an error if a field in this list has a non-empty value.
  7863. // This may be used to include null fields in Patch requests.
  7864. NullFields []string `json:"-"`
  7865. }
  7866. func (s *Expr) MarshalJSON() ([]byte, error) {
  7867. type NoMethod Expr
  7868. raw := NoMethod(*s)
  7869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7870. }
  7871. // ExternalVpnGateway: External VPN gateway is the on-premises VPN
  7872. // gateway(s) or another cloud provider?s VPN gateway that connects to
  7873. // your Google Cloud VPN gateway. To create a highly available VPN from
  7874. // Google Cloud to your on-premises side or another Cloud provider's VPN
  7875. // gateway, you must create a external VPN gateway resource in GCP,
  7876. // which provides the information to GCP about your external VPN
  7877. // gateway.
  7878. type ExternalVpnGateway struct {
  7879. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7880. // format.
  7881. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7882. // Description: An optional description of this resource. Provide this
  7883. // property when you create the resource.
  7884. Description string `json:"description,omitempty"`
  7885. // Id: [Output Only] The unique identifier for the resource. This
  7886. // identifier is defined by the server.
  7887. Id uint64 `json:"id,omitempty,string"`
  7888. // Interfaces: List of interfaces for this external VPN gateway.
  7889. Interfaces []*ExternalVpnGatewayInterface `json:"interfaces,omitempty"`
  7890. // Kind: [Output Only] Type of the resource. Always
  7891. // compute#externalVpnGateway for externalVpnGateways.
  7892. Kind string `json:"kind,omitempty"`
  7893. // LabelFingerprint: A fingerprint for the labels being applied to this
  7894. // ExternalVpnGateway, which is essentially a hash of the labels set
  7895. // used for optimistic locking. The fingerprint is initially generated
  7896. // by Compute Engine and changes after every request to modify or update
  7897. // labels. You must always provide an up-to-date fingerprint hash in
  7898. // order to update or change labels, otherwise the request will fail
  7899. // with error 412 conditionNotMet.
  7900. //
  7901. // To see the latest fingerprint, make a get() request to retrieve an
  7902. // ExternalVpnGateway.
  7903. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  7904. // Labels: Labels to apply to this ExternalVpnGateway resource. These
  7905. // can be later modified by the setLabels method. Each label key/value
  7906. // must comply with RFC1035. Label values may be empty.
  7907. Labels map[string]string `json:"labels,omitempty"`
  7908. // Name: Name of the resource. Provided by the client when the resource
  7909. // is created. The name must be 1-63 characters long, and comply with
  7910. // RFC1035. Specifically, the name must be 1-63 characters long and
  7911. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7912. // the first character must be a lowercase letter, and all following
  7913. // characters must be a dash, lowercase letter, or digit, except the
  7914. // last character, which cannot be a dash.
  7915. Name string `json:"name,omitempty"`
  7916. // RedundancyType: Indicates the user-supplied redundancy type of this
  7917. // external VPN gateway.
  7918. //
  7919. // Possible values:
  7920. // "FOUR_IPS_REDUNDANCY"
  7921. // "SINGLE_IP_INTERNALLY_REDUNDANT"
  7922. // "TWO_IPS_REDUNDANCY"
  7923. RedundancyType string `json:"redundancyType,omitempty"`
  7924. // SelfLink: [Output Only] Server-defined URL for the resource.
  7925. SelfLink string `json:"selfLink,omitempty"`
  7926. // ServerResponse contains the HTTP response code and headers from the
  7927. // server.
  7928. googleapi.ServerResponse `json:"-"`
  7929. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  7930. // to unconditionally include in API requests. By default, fields with
  7931. // empty values are omitted from API requests. However, any non-pointer,
  7932. // non-interface field appearing in ForceSendFields will be sent to the
  7933. // server regardless of whether the field is empty or not. This may be
  7934. // used to include empty fields in Patch requests.
  7935. ForceSendFields []string `json:"-"`
  7936. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  7937. // include in API requests with the JSON null value. By default, fields
  7938. // with empty values are omitted from API requests. However, any field
  7939. // with an empty value appearing in NullFields will be sent to the
  7940. // server as null. It is an error if a field in this list has a
  7941. // non-empty value. This may be used to include null fields in Patch
  7942. // requests.
  7943. NullFields []string `json:"-"`
  7944. }
  7945. func (s *ExternalVpnGateway) MarshalJSON() ([]byte, error) {
  7946. type NoMethod ExternalVpnGateway
  7947. raw := NoMethod(*s)
  7948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7949. }
  7950. // ExternalVpnGatewayInterface: The interface for the external VPN
  7951. // gateway.
  7952. type ExternalVpnGatewayInterface struct {
  7953. // Id: The numeric ID of this interface. The allowed input values for
  7954. // this id for different redundancy types of external VPN gateway:
  7955. // SINGLE_IP_INTERNALLY_REDUNDANT - 0 TWO_IPS_REDUNDANCY - 0, 1
  7956. // FOUR_IPS_REDUNDANCY - 0, 1, 2, 3
  7957. Id int64 `json:"id,omitempty"`
  7958. // IpAddress: IP address of the interface in the external VPN gateway.
  7959. // Only IPv4 is supported. This IP address can be either from your
  7960. // on-premise gateway or another Cloud provider?s VPN gateway, it cannot
  7961. // be an IP address from Google Compute Engine.
  7962. IpAddress string `json:"ipAddress,omitempty"`
  7963. // ForceSendFields is a list of field names (e.g. "Id") to
  7964. // unconditionally include in API requests. By default, fields with
  7965. // empty values are omitted from API requests. However, any non-pointer,
  7966. // non-interface field appearing in ForceSendFields will be sent to the
  7967. // server regardless of whether the field is empty or not. This may be
  7968. // used to include empty fields in Patch requests.
  7969. ForceSendFields []string `json:"-"`
  7970. // NullFields is a list of field names (e.g. "Id") to include in API
  7971. // requests with the JSON null value. By default, fields with empty
  7972. // values are omitted from API requests. However, any field with an
  7973. // empty value appearing in NullFields will be sent to the server as
  7974. // null. It is an error if a field in this list has a non-empty value.
  7975. // This may be used to include null fields in Patch requests.
  7976. NullFields []string `json:"-"`
  7977. }
  7978. func (s *ExternalVpnGatewayInterface) MarshalJSON() ([]byte, error) {
  7979. type NoMethod ExternalVpnGatewayInterface
  7980. raw := NoMethod(*s)
  7981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7982. }
  7983. // ExternalVpnGatewayList: Response to the list request, and contains a
  7984. // list of externalVpnGateways.
  7985. type ExternalVpnGatewayList struct {
  7986. Etag string `json:"etag,omitempty"`
  7987. // Id: [Output Only] Unique identifier for the resource; defined by the
  7988. // server.
  7989. Id string `json:"id,omitempty"`
  7990. // Items: A list of ExternalVpnGateway resources.
  7991. Items []*ExternalVpnGateway `json:"items,omitempty"`
  7992. // Kind: [Output Only] Type of resource. Always
  7993. // compute#externalVpnGatewayList for lists of externalVpnGateways.
  7994. Kind string `json:"kind,omitempty"`
  7995. // NextPageToken: [Output Only] This token allows you to get the next
  7996. // page of results for list requests. If the number of results is larger
  7997. // than maxResults, use the nextPageToken as a value for the query
  7998. // parameter pageToken in the next list request. Subsequent list
  7999. // requests will have their own nextPageToken to continue paging through
  8000. // the results.
  8001. NextPageToken string `json:"nextPageToken,omitempty"`
  8002. // SelfLink: [Output Only] Server-defined URL for this resource.
  8003. SelfLink string `json:"selfLink,omitempty"`
  8004. // Warning: [Output Only] Informational warning message.
  8005. Warning *ExternalVpnGatewayListWarning `json:"warning,omitempty"`
  8006. // ServerResponse contains the HTTP response code and headers from the
  8007. // server.
  8008. googleapi.ServerResponse `json:"-"`
  8009. // ForceSendFields is a list of field names (e.g. "Etag") to
  8010. // unconditionally include in API requests. By default, fields with
  8011. // empty values are omitted from API requests. However, any non-pointer,
  8012. // non-interface field appearing in ForceSendFields will be sent to the
  8013. // server regardless of whether the field is empty or not. This may be
  8014. // used to include empty fields in Patch requests.
  8015. ForceSendFields []string `json:"-"`
  8016. // NullFields is a list of field names (e.g. "Etag") to include in API
  8017. // requests with the JSON null value. By default, fields with empty
  8018. // values are omitted from API requests. However, any field with an
  8019. // empty value appearing in NullFields will be sent to the server as
  8020. // null. It is an error if a field in this list has a non-empty value.
  8021. // This may be used to include null fields in Patch requests.
  8022. NullFields []string `json:"-"`
  8023. }
  8024. func (s *ExternalVpnGatewayList) MarshalJSON() ([]byte, error) {
  8025. type NoMethod ExternalVpnGatewayList
  8026. raw := NoMethod(*s)
  8027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8028. }
  8029. // ExternalVpnGatewayListWarning: [Output Only] Informational warning
  8030. // message.
  8031. type ExternalVpnGatewayListWarning struct {
  8032. // Code: [Output Only] A warning code, if applicable. For example,
  8033. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8034. // the response.
  8035. //
  8036. // Possible values:
  8037. // "CLEANUP_FAILED"
  8038. // "DEPRECATED_RESOURCE_USED"
  8039. // "DEPRECATED_TYPE_USED"
  8040. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8041. // "EXPERIMENTAL_TYPE_USED"
  8042. // "EXTERNAL_API_WARNING"
  8043. // "FIELD_VALUE_OVERRIDEN"
  8044. // "INJECTED_KERNELS_DEPRECATED"
  8045. // "MISSING_TYPE_DEPENDENCY"
  8046. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8047. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8048. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8049. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8050. // "NEXT_HOP_NOT_RUNNING"
  8051. // "NOT_CRITICAL_ERROR"
  8052. // "NO_RESULTS_ON_PAGE"
  8053. // "REQUIRED_TOS_AGREEMENT"
  8054. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8055. // "RESOURCE_NOT_DELETED"
  8056. // "SCHEMA_VALIDATION_IGNORED"
  8057. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8058. // "UNDECLARED_PROPERTIES"
  8059. // "UNREACHABLE"
  8060. Code string `json:"code,omitempty"`
  8061. // Data: [Output Only] Metadata about this warning in key: value format.
  8062. // For example:
  8063. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8064. Data []*ExternalVpnGatewayListWarningData `json:"data,omitempty"`
  8065. // Message: [Output Only] A human-readable description of the warning
  8066. // code.
  8067. Message string `json:"message,omitempty"`
  8068. // ForceSendFields is a list of field names (e.g. "Code") to
  8069. // unconditionally include in API requests. By default, fields with
  8070. // empty values are omitted from API requests. However, any non-pointer,
  8071. // non-interface field appearing in ForceSendFields will be sent to the
  8072. // server regardless of whether the field is empty or not. This may be
  8073. // used to include empty fields in Patch requests.
  8074. ForceSendFields []string `json:"-"`
  8075. // NullFields is a list of field names (e.g. "Code") to include in API
  8076. // requests with the JSON null value. By default, fields with empty
  8077. // values are omitted from API requests. However, any field with an
  8078. // empty value appearing in NullFields will be sent to the server as
  8079. // null. It is an error if a field in this list has a non-empty value.
  8080. // This may be used to include null fields in Patch requests.
  8081. NullFields []string `json:"-"`
  8082. }
  8083. func (s *ExternalVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  8084. type NoMethod ExternalVpnGatewayListWarning
  8085. raw := NoMethod(*s)
  8086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8087. }
  8088. type ExternalVpnGatewayListWarningData struct {
  8089. // Key: [Output Only] A key that provides more detail on the warning
  8090. // being returned. For example, for warnings where there are no results
  8091. // in a list request for a particular zone, this key might be scope and
  8092. // the key value might be the zone name. Other examples might be a key
  8093. // indicating a deprecated resource and a suggested replacement, or a
  8094. // warning about invalid network settings (for example, if an instance
  8095. // attempts to perform IP forwarding but is not enabled for IP
  8096. // forwarding).
  8097. Key string `json:"key,omitempty"`
  8098. // Value: [Output Only] A warning data value corresponding to the key.
  8099. Value string `json:"value,omitempty"`
  8100. // ForceSendFields is a list of field names (e.g. "Key") to
  8101. // unconditionally include in API requests. By default, fields with
  8102. // empty values are omitted from API requests. However, any non-pointer,
  8103. // non-interface field appearing in ForceSendFields will be sent to the
  8104. // server regardless of whether the field is empty or not. This may be
  8105. // used to include empty fields in Patch requests.
  8106. ForceSendFields []string `json:"-"`
  8107. // NullFields is a list of field names (e.g. "Key") to include in API
  8108. // requests with the JSON null value. By default, fields with empty
  8109. // values are omitted from API requests. However, any field with an
  8110. // empty value appearing in NullFields will be sent to the server as
  8111. // null. It is an error if a field in this list has a non-empty value.
  8112. // This may be used to include null fields in Patch requests.
  8113. NullFields []string `json:"-"`
  8114. }
  8115. func (s *ExternalVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  8116. type NoMethod ExternalVpnGatewayListWarningData
  8117. raw := NoMethod(*s)
  8118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8119. }
  8120. // Firewall: Represents a Firewall resource.
  8121. type Firewall struct {
  8122. // Allowed: The list of ALLOW rules specified by this firewall. Each
  8123. // rule specifies a protocol and port-range tuple that describes a
  8124. // permitted connection.
  8125. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  8126. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8127. // format.
  8128. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8129. // Denied: The list of DENY rules specified by this firewall. Each rule
  8130. // specifies a protocol and port-range tuple that describes a denied
  8131. // connection.
  8132. Denied []*FirewallDenied `json:"denied,omitempty"`
  8133. // Description: An optional description of this resource. Provide this
  8134. // property when you create the resource.
  8135. Description string `json:"description,omitempty"`
  8136. // DestinationRanges: If destination ranges are specified, the firewall
  8137. // will apply only to traffic that has destination IP address in these
  8138. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  8139. // supported.
  8140. DestinationRanges []string `json:"destinationRanges,omitempty"`
  8141. // Direction: Direction of traffic to which this firewall applies;
  8142. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  8143. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  8144. // specify sourceRanges OR sourceTags.
  8145. //
  8146. // Possible values:
  8147. // "EGRESS"
  8148. // "INGRESS"
  8149. Direction string `json:"direction,omitempty"`
  8150. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  8151. // applied to the network it is associated with. When set to true, the
  8152. // firewall rule is not enforced and the network behaves as if it did
  8153. // not exist. If this is unspecified, the firewall rule will be enabled.
  8154. Disabled bool `json:"disabled,omitempty"`
  8155. // EnableLogging: Deprecated in favor of enable in LogConfig. This field
  8156. // denotes whether to enable logging for a particular firewall rule. If
  8157. // logging is enabled, logs will be exported to Stackdriver.
  8158. EnableLogging bool `json:"enableLogging,omitempty"`
  8159. // Id: [Output Only] The unique identifier for the resource. This
  8160. // identifier is defined by the server.
  8161. Id uint64 `json:"id,omitempty,string"`
  8162. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  8163. // firewall rules.
  8164. Kind string `json:"kind,omitempty"`
  8165. // LogConfig: This field denotes the logging options for a particular
  8166. // firewall rule. If logging is enabled, logs will be exported to
  8167. // Stackdriver.
  8168. LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
  8169. // Name: Name of the resource; provided by the client when the resource
  8170. // is created. The name must be 1-63 characters long, and comply with
  8171. // RFC1035. Specifically, the name must be 1-63 characters long and
  8172. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8173. // the first character must be a lowercase letter, and all following
  8174. // characters must be a dash, lowercase letter, or digit, except the
  8175. // last character, which cannot be a dash.
  8176. Name string `json:"name,omitempty"`
  8177. // Network: URL of the network resource for this firewall rule. If not
  8178. // specified when creating a firewall rule, the default network is
  8179. // used:
  8180. // global/networks/default
  8181. // If you choose to specify this property, you can specify the network
  8182. // as a full or partial URL. For example, the following are all valid
  8183. // URLs:
  8184. // -
  8185. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  8186. // - projects/myproject/global/networks/my-network
  8187. // - global/networks/default
  8188. Network string `json:"network,omitempty"`
  8189. // Priority: Priority for this rule. This is an integer between 0 and
  8190. // 65535, both inclusive. When not specified, the value assumed is 1000.
  8191. // Relative priorities determine precedence of conflicting rules. Lower
  8192. // value of priority implies higher precedence (eg, a rule with priority
  8193. // 0 has higher precedence than a rule with priority 1). DENY rules take
  8194. // precedence over ALLOW rules having equal priority.
  8195. Priority int64 `json:"priority,omitempty"`
  8196. // SelfLink: [Output Only] Server-defined URL for the resource.
  8197. SelfLink string `json:"selfLink,omitempty"`
  8198. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  8199. // with the resource id.
  8200. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  8201. // SourceRanges: If source ranges are specified, the firewall will apply
  8202. // only to traffic that has source IP address in these ranges. These
  8203. // ranges must be expressed in CIDR format. One or both of sourceRanges
  8204. // and sourceTags may be set. If both properties are set, the firewall
  8205. // will apply to traffic that has source IP address within sourceRanges
  8206. // OR the source IP that belongs to a tag listed in the sourceTags
  8207. // property. The connection does not need to match both properties for
  8208. // the firewall to apply. Only IPv4 is supported.
  8209. SourceRanges []string `json:"sourceRanges,omitempty"`
  8210. // SourceServiceAccounts: If source service accounts are specified, the
  8211. // firewall will apply only to traffic originating from an instance with
  8212. // a service account in this list. Source service accounts cannot be
  8213. // used to control traffic to an instance's external IP address because
  8214. // service accounts are associated with an instance, not an IP address.
  8215. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  8216. // both are set, the firewall will apply to traffic that has source IP
  8217. // address within sourceRanges OR the source IP belongs to an instance
  8218. // with service account listed in sourceServiceAccount. The connection
  8219. // does not need to match both properties for the firewall to apply.
  8220. // sourceServiceAccounts cannot be used at the same time as sourceTags
  8221. // or targetTags.
  8222. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  8223. // SourceTags: If source tags are specified, the firewall rule applies
  8224. // only to traffic with source IPs that match the primary network
  8225. // interfaces of VM instances that have the tag and are in the same VPC
  8226. // network. Source tags cannot be used to control traffic to an
  8227. // instance's external IP address, it only applies to traffic between
  8228. // instances in the same virtual network. Because tags are associated
  8229. // with instances, not IP addresses. One or both of sourceRanges and
  8230. // sourceTags may be set. If both properties are set, the firewall will
  8231. // apply to traffic that has source IP address within sourceRanges OR
  8232. // the source IP that belongs to a tag listed in the sourceTags
  8233. // property. The connection does not need to match both properties for
  8234. // the firewall to apply.
  8235. SourceTags []string `json:"sourceTags,omitempty"`
  8236. // TargetServiceAccounts: A list of service accounts indicating sets of
  8237. // instances located in the network that may make network connections as
  8238. // specified in allowed[]. targetServiceAccounts cannot be used at the
  8239. // same time as targetTags or sourceTags. If neither
  8240. // targetServiceAccounts nor targetTags are specified, the firewall rule
  8241. // applies to all instances on the specified network.
  8242. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  8243. // TargetTags: A list of tags that controls which instances the firewall
  8244. // rule applies to. If targetTags are specified, then the firewall rule
  8245. // applies only to instances in the VPC network that have one of those
  8246. // tags. If no targetTags are specified, the firewall rule applies to
  8247. // all instances on the specified network.
  8248. TargetTags []string `json:"targetTags,omitempty"`
  8249. // ServerResponse contains the HTTP response code and headers from the
  8250. // server.
  8251. googleapi.ServerResponse `json:"-"`
  8252. // ForceSendFields is a list of field names (e.g. "Allowed") to
  8253. // unconditionally include in API requests. By default, fields with
  8254. // empty values are omitted from API requests. However, any non-pointer,
  8255. // non-interface field appearing in ForceSendFields will be sent to the
  8256. // server regardless of whether the field is empty or not. This may be
  8257. // used to include empty fields in Patch requests.
  8258. ForceSendFields []string `json:"-"`
  8259. // NullFields is a list of field names (e.g. "Allowed") to include in
  8260. // API requests with the JSON null value. By default, fields with empty
  8261. // values are omitted from API requests. However, any field with an
  8262. // empty value appearing in NullFields will be sent to the server as
  8263. // null. It is an error if a field in this list has a non-empty value.
  8264. // This may be used to include null fields in Patch requests.
  8265. NullFields []string `json:"-"`
  8266. }
  8267. func (s *Firewall) MarshalJSON() ([]byte, error) {
  8268. type NoMethod Firewall
  8269. raw := NoMethod(*s)
  8270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8271. }
  8272. type FirewallAllowed struct {
  8273. // IPProtocol: The IP protocol to which this rule applies. The protocol
  8274. // type is required when creating a firewall rule. This value can either
  8275. // be one of the following well known protocol strings (tcp, udp, icmp,
  8276. // esp, ah, ipip, sctp), or the IP protocol number.
  8277. IPProtocol string `json:"IPProtocol,omitempty"`
  8278. // Ports: An optional list of ports to which this rule applies. This
  8279. // field is only applicable for UDP or TCP protocol. Each entry must be
  8280. // either an integer or a range. If not specified, this rule applies to
  8281. // connections through any port.
  8282. //
  8283. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  8284. Ports []string `json:"ports,omitempty"`
  8285. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  8286. // unconditionally include in API requests. By default, fields with
  8287. // empty values are omitted from API requests. However, any non-pointer,
  8288. // non-interface field appearing in ForceSendFields will be sent to the
  8289. // server regardless of whether the field is empty or not. This may be
  8290. // used to include empty fields in Patch requests.
  8291. ForceSendFields []string `json:"-"`
  8292. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  8293. // API requests with the JSON null value. By default, fields with empty
  8294. // values are omitted from API requests. However, any field with an
  8295. // empty value appearing in NullFields will be sent to the server as
  8296. // null. It is an error if a field in this list has a non-empty value.
  8297. // This may be used to include null fields in Patch requests.
  8298. NullFields []string `json:"-"`
  8299. }
  8300. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  8301. type NoMethod FirewallAllowed
  8302. raw := NoMethod(*s)
  8303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8304. }
  8305. type FirewallDenied struct {
  8306. // IPProtocol: The IP protocol to which this rule applies. The protocol
  8307. // type is required when creating a firewall rule. This value can either
  8308. // be one of the following well known protocol strings (tcp, udp, icmp,
  8309. // esp, ah, ipip, sctp), or the IP protocol number.
  8310. IPProtocol string `json:"IPProtocol,omitempty"`
  8311. // Ports: An optional list of ports to which this rule applies. This
  8312. // field is only applicable for UDP or TCP protocol. Each entry must be
  8313. // either an integer or a range. If not specified, this rule applies to
  8314. // connections through any port.
  8315. //
  8316. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  8317. Ports []string `json:"ports,omitempty"`
  8318. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  8319. // unconditionally include in API requests. By default, fields with
  8320. // empty values are omitted from API requests. However, any non-pointer,
  8321. // non-interface field appearing in ForceSendFields will be sent to the
  8322. // server regardless of whether the field is empty or not. This may be
  8323. // used to include empty fields in Patch requests.
  8324. ForceSendFields []string `json:"-"`
  8325. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  8326. // API requests with the JSON null value. By default, fields with empty
  8327. // values are omitted from API requests. However, any field with an
  8328. // empty value appearing in NullFields will be sent to the server as
  8329. // null. It is an error if a field in this list has a non-empty value.
  8330. // This may be used to include null fields in Patch requests.
  8331. NullFields []string `json:"-"`
  8332. }
  8333. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  8334. type NoMethod FirewallDenied
  8335. raw := NoMethod(*s)
  8336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8337. }
  8338. // FirewallList: Contains a list of firewalls.
  8339. type FirewallList struct {
  8340. // Id: [Output Only] Unique identifier for the resource; defined by the
  8341. // server.
  8342. Id string `json:"id,omitempty"`
  8343. // Items: A list of Firewall resources.
  8344. Items []*Firewall `json:"items,omitempty"`
  8345. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  8346. // lists of firewalls.
  8347. Kind string `json:"kind,omitempty"`
  8348. // NextPageToken: [Output Only] This token allows you to get the next
  8349. // page of results for list requests. If the number of results is larger
  8350. // than maxResults, use the nextPageToken as a value for the query
  8351. // parameter pageToken in the next list request. Subsequent list
  8352. // requests will have their own nextPageToken to continue paging through
  8353. // the results.
  8354. NextPageToken string `json:"nextPageToken,omitempty"`
  8355. // SelfLink: [Output Only] Server-defined URL for this resource.
  8356. SelfLink string `json:"selfLink,omitempty"`
  8357. // Warning: [Output Only] Informational warning message.
  8358. Warning *FirewallListWarning `json:"warning,omitempty"`
  8359. // ServerResponse contains the HTTP response code and headers from the
  8360. // server.
  8361. googleapi.ServerResponse `json:"-"`
  8362. // ForceSendFields is a list of field names (e.g. "Id") to
  8363. // unconditionally include in API requests. By default, fields with
  8364. // empty values are omitted from API requests. However, any non-pointer,
  8365. // non-interface field appearing in ForceSendFields will be sent to the
  8366. // server regardless of whether the field is empty or not. This may be
  8367. // used to include empty fields in Patch requests.
  8368. ForceSendFields []string `json:"-"`
  8369. // NullFields is a list of field names (e.g. "Id") to include in API
  8370. // requests with the JSON null value. By default, fields with empty
  8371. // values are omitted from API requests. However, any field with an
  8372. // empty value appearing in NullFields will be sent to the server as
  8373. // null. It is an error if a field in this list has a non-empty value.
  8374. // This may be used to include null fields in Patch requests.
  8375. NullFields []string `json:"-"`
  8376. }
  8377. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  8378. type NoMethod FirewallList
  8379. raw := NoMethod(*s)
  8380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8381. }
  8382. // FirewallListWarning: [Output Only] Informational warning message.
  8383. type FirewallListWarning struct {
  8384. // Code: [Output Only] A warning code, if applicable. For example,
  8385. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8386. // the response.
  8387. //
  8388. // Possible values:
  8389. // "CLEANUP_FAILED"
  8390. // "DEPRECATED_RESOURCE_USED"
  8391. // "DEPRECATED_TYPE_USED"
  8392. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8393. // "EXPERIMENTAL_TYPE_USED"
  8394. // "EXTERNAL_API_WARNING"
  8395. // "FIELD_VALUE_OVERRIDEN"
  8396. // "INJECTED_KERNELS_DEPRECATED"
  8397. // "MISSING_TYPE_DEPENDENCY"
  8398. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8399. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8400. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8401. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8402. // "NEXT_HOP_NOT_RUNNING"
  8403. // "NOT_CRITICAL_ERROR"
  8404. // "NO_RESULTS_ON_PAGE"
  8405. // "REQUIRED_TOS_AGREEMENT"
  8406. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8407. // "RESOURCE_NOT_DELETED"
  8408. // "SCHEMA_VALIDATION_IGNORED"
  8409. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8410. // "UNDECLARED_PROPERTIES"
  8411. // "UNREACHABLE"
  8412. Code string `json:"code,omitempty"`
  8413. // Data: [Output Only] Metadata about this warning in key: value format.
  8414. // For example:
  8415. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8416. Data []*FirewallListWarningData `json:"data,omitempty"`
  8417. // Message: [Output Only] A human-readable description of the warning
  8418. // code.
  8419. Message string `json:"message,omitempty"`
  8420. // ForceSendFields is a list of field names (e.g. "Code") to
  8421. // unconditionally include in API requests. By default, fields with
  8422. // empty values are omitted from API requests. However, any non-pointer,
  8423. // non-interface field appearing in ForceSendFields will be sent to the
  8424. // server regardless of whether the field is empty or not. This may be
  8425. // used to include empty fields in Patch requests.
  8426. ForceSendFields []string `json:"-"`
  8427. // NullFields is a list of field names (e.g. "Code") to include in API
  8428. // requests with the JSON null value. By default, fields with empty
  8429. // values are omitted from API requests. However, any field with an
  8430. // empty value appearing in NullFields will be sent to the server as
  8431. // null. It is an error if a field in this list has a non-empty value.
  8432. // This may be used to include null fields in Patch requests.
  8433. NullFields []string `json:"-"`
  8434. }
  8435. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  8436. type NoMethod FirewallListWarning
  8437. raw := NoMethod(*s)
  8438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8439. }
  8440. type FirewallListWarningData struct {
  8441. // Key: [Output Only] A key that provides more detail on the warning
  8442. // being returned. For example, for warnings where there are no results
  8443. // in a list request for a particular zone, this key might be scope and
  8444. // the key value might be the zone name. Other examples might be a key
  8445. // indicating a deprecated resource and a suggested replacement, or a
  8446. // warning about invalid network settings (for example, if an instance
  8447. // attempts to perform IP forwarding but is not enabled for IP
  8448. // forwarding).
  8449. Key string `json:"key,omitempty"`
  8450. // Value: [Output Only] A warning data value corresponding to the key.
  8451. Value string `json:"value,omitempty"`
  8452. // ForceSendFields is a list of field names (e.g. "Key") to
  8453. // unconditionally include in API requests. By default, fields with
  8454. // empty values are omitted from API requests. However, any non-pointer,
  8455. // non-interface field appearing in ForceSendFields will be sent to the
  8456. // server regardless of whether the field is empty or not. This may be
  8457. // used to include empty fields in Patch requests.
  8458. ForceSendFields []string `json:"-"`
  8459. // NullFields is a list of field names (e.g. "Key") to include in API
  8460. // requests with the JSON null value. By default, fields with empty
  8461. // values are omitted from API requests. However, any field with an
  8462. // empty value appearing in NullFields will be sent to the server as
  8463. // null. It is an error if a field in this list has a non-empty value.
  8464. // This may be used to include null fields in Patch requests.
  8465. NullFields []string `json:"-"`
  8466. }
  8467. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  8468. type NoMethod FirewallListWarningData
  8469. raw := NoMethod(*s)
  8470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8471. }
  8472. // FirewallLogConfig: The available logging options for a firewall rule.
  8473. type FirewallLogConfig struct {
  8474. // Enable: This field denotes whether to enable logging for a particular
  8475. // firewall rule.
  8476. Enable bool `json:"enable,omitempty"`
  8477. // Metadata: This field can only be specified for a particular firewall
  8478. // rule if logging is enabled for that rule. This field denotes whether
  8479. // to include or exclude metadata for firewall logs.
  8480. //
  8481. // Possible values:
  8482. // "EXCLUDE_ALL_METADATA"
  8483. // "INCLUDE_ALL_METADATA"
  8484. Metadata string `json:"metadata,omitempty"`
  8485. // ForceSendFields is a list of field names (e.g. "Enable") to
  8486. // unconditionally include in API requests. By default, fields with
  8487. // empty values are omitted from API requests. However, any non-pointer,
  8488. // non-interface field appearing in ForceSendFields will be sent to the
  8489. // server regardless of whether the field is empty or not. This may be
  8490. // used to include empty fields in Patch requests.
  8491. ForceSendFields []string `json:"-"`
  8492. // NullFields is a list of field names (e.g. "Enable") to include in API
  8493. // requests with the JSON null value. By default, fields with empty
  8494. // values are omitted from API requests. However, any field with an
  8495. // empty value appearing in NullFields will be sent to the server as
  8496. // null. It is an error if a field in this list has a non-empty value.
  8497. // This may be used to include null fields in Patch requests.
  8498. NullFields []string `json:"-"`
  8499. }
  8500. func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
  8501. type NoMethod FirewallLogConfig
  8502. raw := NoMethod(*s)
  8503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8504. }
  8505. // FixedOrPercent: Encapsulates numeric value that can be either
  8506. // absolute or relative.
  8507. type FixedOrPercent struct {
  8508. // Calculated: [Output Only] Absolute value of VM instances calculated
  8509. // based on the specific mode.
  8510. //
  8511. //
  8512. // - If the value is fixed, then the caculated value is equal to the
  8513. // fixed value.
  8514. // - If the value is a percent, then the calculated value is percent/100
  8515. // * targetSize. For example, the calculated value of a 80% of a managed
  8516. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  8517. // instances. If there is a remainder, the number is rounded up.
  8518. Calculated int64 `json:"calculated,omitempty"`
  8519. // Fixed: Specifies a fixed number of VM instances. This must be a
  8520. // positive integer.
  8521. Fixed int64 `json:"fixed,omitempty"`
  8522. // Percent: Specifies a percentage of instances between 0 to 100%,
  8523. // inclusive. For example, specify 80 for 80%.
  8524. Percent int64 `json:"percent,omitempty"`
  8525. // ForceSendFields is a list of field names (e.g. "Calculated") to
  8526. // unconditionally include in API requests. By default, fields with
  8527. // empty values are omitted from API requests. However, any non-pointer,
  8528. // non-interface field appearing in ForceSendFields will be sent to the
  8529. // server regardless of whether the field is empty or not. This may be
  8530. // used to include empty fields in Patch requests.
  8531. ForceSendFields []string `json:"-"`
  8532. // NullFields is a list of field names (e.g. "Calculated") to include in
  8533. // API requests with the JSON null value. By default, fields with empty
  8534. // values are omitted from API requests. However, any field with an
  8535. // empty value appearing in NullFields will be sent to the server as
  8536. // null. It is an error if a field in this list has a non-empty value.
  8537. // This may be used to include null fields in Patch requests.
  8538. NullFields []string `json:"-"`
  8539. }
  8540. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  8541. type NoMethod FixedOrPercent
  8542. raw := NoMethod(*s)
  8543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8544. }
  8545. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  8546. // specifies which pool of target virtual machines to forward a packet
  8547. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  8548. // resource_for beta.forwardingRules ==) (== resource_for
  8549. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  8550. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  8551. // beta.regionForwardingRules ==) (== resource_for
  8552. // v1.regionForwardingRules ==)
  8553. type ForwardingRule struct {
  8554. // IPAddress: The IP address that this forwarding rule is serving on
  8555. // behalf of.
  8556. //
  8557. // Addresses are restricted based on the forwarding rule's load
  8558. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  8559. // regional).
  8560. //
  8561. // When the load balancing scheme is EXTERNAL, for global forwarding
  8562. // rules, the address must be a global IP, and for regional forwarding
  8563. // rules, the address must live in the same region as the forwarding
  8564. // rule. If this field is empty, an ephemeral IPv4 address from the same
  8565. // scope (global or regional) will be assigned. A regional forwarding
  8566. // rule supports IPv4 only. A global forwarding rule supports either
  8567. // IPv4 or IPv6.
  8568. //
  8569. // When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be
  8570. // a URL reference to an existing Address resource ( internal regional
  8571. // static IP address), with a purpose of GCE_END_POINT and address_type
  8572. // of INTERNAL.
  8573. //
  8574. // When the load balancing scheme is INTERNAL, this can only be an RFC
  8575. // 1918 IP address belonging to the network/subnet configured for the
  8576. // forwarding rule. By default, if this field is empty, an ephemeral
  8577. // internal IP address will be automatically allocated from the IP range
  8578. // of the subnet or network configured for this forwarding rule.
  8579. //
  8580. // An address can be specified either by a literal IP address or a URL
  8581. // reference to an existing Address resource. The following examples are
  8582. // all valid:
  8583. // - 100.1.2.3
  8584. // -
  8585. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  8586. // - projects/project/regions/region/addresses/address
  8587. // - regions/region/addresses/address
  8588. // - global/addresses/address
  8589. // - address
  8590. IPAddress string `json:"IPAddress,omitempty"`
  8591. // IPProtocol: The IP protocol to which this rule applies. Valid options
  8592. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  8593. //
  8594. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  8595. // valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only
  8596. // TCPis valid.
  8597. //
  8598. // Possible values:
  8599. // "AH"
  8600. // "ESP"
  8601. // "ICMP"
  8602. // "SCTP"
  8603. // "TCP"
  8604. // "UDP"
  8605. IPProtocol string `json:"IPProtocol,omitempty"`
  8606. // AllPorts: This field is used along with the backend_service field for
  8607. // internal load balancing or with the target field for internal
  8608. // TargetInstance. This field cannot be used with port or portRange
  8609. // fields.
  8610. //
  8611. // When the load balancing scheme is INTERNAL and protocol is TCP/UDP,
  8612. // specify this field to allow packets addressed to any ports will be
  8613. // forwarded to the backends configured with this forwarding rule.
  8614. AllPorts bool `json:"allPorts,omitempty"`
  8615. // AllowGlobalAccess: This field is used along with the backend_service
  8616. // field for internal load balancing or with the target field for
  8617. // internal TargetInstance. If the field is set to TRUE, clients can
  8618. // access ILB from all regions. Otherwise only allows access from
  8619. // clients in the same region as the internal load balancer.
  8620. AllowGlobalAccess bool `json:"allowGlobalAccess,omitempty"`
  8621. // BackendService: This field is only used for INTERNAL load
  8622. // balancing.
  8623. //
  8624. // For internal load balancing, this field identifies the BackendService
  8625. // resource to receive the matched traffic.
  8626. BackendService string `json:"backendService,omitempty"`
  8627. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8628. // format.
  8629. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8630. // Description: An optional description of this resource. Provide this
  8631. // property when you create the resource.
  8632. Description string `json:"description,omitempty"`
  8633. // Fingerprint: Fingerprint of this resource. A hash of the contents
  8634. // stored in this object. This field is used in optimistic locking. This
  8635. // field will be ignored when inserting a ForwardingRule. Include the
  8636. // fingerprint in patch request to ensure that you do not overwrite
  8637. // changes that were applied from another concurrent request.
  8638. //
  8639. // To see the latest fingerprint, make a get() request to retrieve a
  8640. // ForwardingRule.
  8641. Fingerprint string `json:"fingerprint,omitempty"`
  8642. // Id: [Output Only] The unique identifier for the resource. This
  8643. // identifier is defined by the server.
  8644. Id uint64 `json:"id,omitempty,string"`
  8645. // IpVersion: The IP Version that will be used by this forwarding rule.
  8646. // Valid options are IPV4 or IPV6. This can only be specified for an
  8647. // external global forwarding rule.
  8648. //
  8649. // Possible values:
  8650. // "IPV4"
  8651. // "IPV6"
  8652. // "UNSPECIFIED_VERSION"
  8653. IpVersion string `json:"ipVersion,omitempty"`
  8654. // Kind: [Output Only] Type of the resource. Always
  8655. // compute#forwardingRule for Forwarding Rule resources.
  8656. Kind string `json:"kind,omitempty"`
  8657. // LabelFingerprint: A fingerprint for the labels being applied to this
  8658. // resource, which is essentially a hash of the labels set used for
  8659. // optimistic locking. The fingerprint is initially generated by Compute
  8660. // Engine and changes after every request to modify or update labels.
  8661. // You must always provide an up-to-date fingerprint hash in order to
  8662. // update or change labels, otherwise the request will fail with error
  8663. // 412 conditionNotMet.
  8664. //
  8665. // To see the latest fingerprint, make a get() request to retrieve a
  8666. // ForwardingRule.
  8667. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8668. // Labels: Labels to apply to this resource. These can be later modified
  8669. // by the setLabels method. Each label key/value pair must comply with
  8670. // RFC1035. Label values may be empty.
  8671. Labels map[string]string `json:"labels,omitempty"`
  8672. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  8673. // used for and can only take the following values: INTERNAL,
  8674. // INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that
  8675. // this will be used for Internal Network Load Balancing (TCP, UDP). The
  8676. // value of INTERNAL_SELF_MANAGED means that this will be used for
  8677. // Internal Global HTTP(S) LB. The value of EXTERNAL means that this
  8678. // will be used for External Load Balancing (HTTP(S) LB, External
  8679. // TCP/UDP LB, SSL Proxy)
  8680. //
  8681. // Possible values:
  8682. // "EXTERNAL"
  8683. // "INTERNAL"
  8684. // "INTERNAL_MANAGED"
  8685. // "INTERNAL_SELF_MANAGED"
  8686. // "INVALID"
  8687. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  8688. // Name: Name of the resource; provided by the client when the resource
  8689. // is created. The name must be 1-63 characters long, and comply with
  8690. // RFC1035. Specifically, the name must be 1-63 characters long and
  8691. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8692. // the first character must be a lowercase letter, and all following
  8693. // characters must be a dash, lowercase letter, or digit, except the
  8694. // last character, which cannot be a dash.
  8695. Name string `json:"name,omitempty"`
  8696. // Network: This field is not used for external load balancing.
  8697. //
  8698. // For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field
  8699. // identifies the network that the load balanced IP should belong to for
  8700. // this Forwarding Rule. If this field is not specified, the default
  8701. // network will be used.
  8702. Network string `json:"network,omitempty"`
  8703. // NetworkTier: This signifies the networking tier used for configuring
  8704. // this load balancer and can only take the following values: PREMIUM ,
  8705. // STANDARD.
  8706. //
  8707. // For regional ForwardingRule, the valid values are PREMIUM and
  8708. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  8709. //
  8710. // If this field is not specified, it is assumed to be PREMIUM. If
  8711. // IPAddress is specified, this value must be equal to the networkTier
  8712. // of the Address.
  8713. //
  8714. // Possible values:
  8715. // "PREMIUM"
  8716. // "SELECT"
  8717. // "STANDARD"
  8718. NetworkTier string `json:"networkTier,omitempty"`
  8719. // PortRange: This field is used along with the target field for
  8720. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  8721. // TargetVpnGateway, TargetPool, TargetInstance.
  8722. //
  8723. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  8724. // addressed to ports in the specified range will be forwarded to
  8725. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  8726. // must have disjoint port ranges.
  8727. //
  8728. // Some types of forwarding target have constraints on the acceptable
  8729. // ports:
  8730. // - TargetHttpProxy: 80, 8080
  8731. // - TargetHttpsProxy: 443
  8732. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  8733. // 995, 1688, 1883, 5222
  8734. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  8735. // 995, 1688, 1883, 5222
  8736. // - TargetVpnGateway: 500, 4500
  8737. PortRange string `json:"portRange,omitempty"`
  8738. // Ports: This field is used along with the backend_service field for
  8739. // internal load balancing.
  8740. //
  8741. // When the load balancing scheme is INTERNAL, a list of ports can be
  8742. // configured, for example, ['80'], ['8000','9000'] etc. Only packets
  8743. // addressed to these ports will be forwarded to the backends configured
  8744. // with this forwarding rule.
  8745. //
  8746. // You may specify a maximum of up to 5 ports.
  8747. Ports []string `json:"ports,omitempty"`
  8748. // Region: [Output Only] URL of the region where the regional forwarding
  8749. // rule resides. This field is not applicable to global forwarding
  8750. // rules. You must specify this field as part of the HTTP request URL.
  8751. // It is not settable as a field in the request body.
  8752. Region string `json:"region,omitempty"`
  8753. // SelfLink: [Output Only] Server-defined URL for the resource.
  8754. SelfLink string `json:"selfLink,omitempty"`
  8755. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  8756. // with the resource id.
  8757. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  8758. // ServiceLabel: An optional prefix to the service name for this
  8759. // Forwarding Rule. If specified, will be the first label of the fully
  8760. // qualified service name.
  8761. //
  8762. // The label must be 1-63 characters long, and comply with RFC1035.
  8763. // Specifically, the label must be 1-63 characters long and match the
  8764. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  8765. // character must be a lowercase letter, and all following characters
  8766. // must be a dash, lowercase letter, or digit, except the last
  8767. // character, which cannot be a dash.
  8768. //
  8769. // This field is only used for internal load balancing.
  8770. ServiceLabel string `json:"serviceLabel,omitempty"`
  8771. // ServiceName: [Output Only] The internal fully qualified service name
  8772. // for this Forwarding Rule.
  8773. //
  8774. // This field is only used for internal load balancing.
  8775. ServiceName string `json:"serviceName,omitempty"`
  8776. // Subnetwork: This field is only used for INTERNAL load balancing.
  8777. //
  8778. // For internal load balancing, this field identifies the subnetwork
  8779. // that the load balanced IP should belong to for this Forwarding
  8780. // Rule.
  8781. //
  8782. // If the network specified is in auto subnet mode, this field is
  8783. // optional. However, if the network is in custom subnet mode, a
  8784. // subnetwork must be specified.
  8785. Subnetwork string `json:"subnetwork,omitempty"`
  8786. // Target: The URL of the target resource to receive the matched
  8787. // traffic. For regional forwarding rules, this target must live in the
  8788. // same region as the forwarding rule. For global forwarding rules, this
  8789. // target must be a global load balancing resource. The forwarded
  8790. // traffic must be of a type appropriate to the target object. For
  8791. // INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are
  8792. // valid.
  8793. Target string `json:"target,omitempty"`
  8794. // ServerResponse contains the HTTP response code and headers from the
  8795. // server.
  8796. googleapi.ServerResponse `json:"-"`
  8797. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  8798. // unconditionally include in API requests. By default, fields with
  8799. // empty values are omitted from API requests. However, any non-pointer,
  8800. // non-interface field appearing in ForceSendFields will be sent to the
  8801. // server regardless of whether the field is empty or not. This may be
  8802. // used to include empty fields in Patch requests.
  8803. ForceSendFields []string `json:"-"`
  8804. // NullFields is a list of field names (e.g. "IPAddress") to include in
  8805. // API requests with the JSON null value. By default, fields with empty
  8806. // values are omitted from API requests. However, any field with an
  8807. // empty value appearing in NullFields will be sent to the server as
  8808. // null. It is an error if a field in this list has a non-empty value.
  8809. // This may be used to include null fields in Patch requests.
  8810. NullFields []string `json:"-"`
  8811. }
  8812. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  8813. type NoMethod ForwardingRule
  8814. raw := NoMethod(*s)
  8815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8816. }
  8817. type ForwardingRuleAggregatedList struct {
  8818. // Id: [Output Only] Unique identifier for the resource; defined by the
  8819. // server.
  8820. Id string `json:"id,omitempty"`
  8821. // Items: A list of ForwardingRulesScopedList resources.
  8822. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  8823. // Kind: [Output Only] Type of resource. Always
  8824. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  8825. Kind string `json:"kind,omitempty"`
  8826. // NextPageToken: [Output Only] This token allows you to get the next
  8827. // page of results for list requests. If the number of results is larger
  8828. // than maxResults, use the nextPageToken as a value for the query
  8829. // parameter pageToken in the next list request. Subsequent list
  8830. // requests will have their own nextPageToken to continue paging through
  8831. // the results.
  8832. NextPageToken string `json:"nextPageToken,omitempty"`
  8833. // SelfLink: [Output Only] Server-defined URL for this resource.
  8834. SelfLink string `json:"selfLink,omitempty"`
  8835. // Warning: [Output Only] Informational warning message.
  8836. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  8837. // ServerResponse contains the HTTP response code and headers from the
  8838. // server.
  8839. googleapi.ServerResponse `json:"-"`
  8840. // ForceSendFields is a list of field names (e.g. "Id") to
  8841. // unconditionally include in API requests. By default, fields with
  8842. // empty values are omitted from API requests. However, any non-pointer,
  8843. // non-interface field appearing in ForceSendFields will be sent to the
  8844. // server regardless of whether the field is empty or not. This may be
  8845. // used to include empty fields in Patch requests.
  8846. ForceSendFields []string `json:"-"`
  8847. // NullFields is a list of field names (e.g. "Id") to include in API
  8848. // requests with the JSON null value. By default, fields with empty
  8849. // values are omitted from API requests. However, any field with an
  8850. // empty value appearing in NullFields will be sent to the server as
  8851. // null. It is an error if a field in this list has a non-empty value.
  8852. // This may be used to include null fields in Patch requests.
  8853. NullFields []string `json:"-"`
  8854. }
  8855. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  8856. type NoMethod ForwardingRuleAggregatedList
  8857. raw := NoMethod(*s)
  8858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8859. }
  8860. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  8861. // warning message.
  8862. type ForwardingRuleAggregatedListWarning struct {
  8863. // Code: [Output Only] A warning code, if applicable. For example,
  8864. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8865. // the response.
  8866. //
  8867. // Possible values:
  8868. // "CLEANUP_FAILED"
  8869. // "DEPRECATED_RESOURCE_USED"
  8870. // "DEPRECATED_TYPE_USED"
  8871. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8872. // "EXPERIMENTAL_TYPE_USED"
  8873. // "EXTERNAL_API_WARNING"
  8874. // "FIELD_VALUE_OVERRIDEN"
  8875. // "INJECTED_KERNELS_DEPRECATED"
  8876. // "MISSING_TYPE_DEPENDENCY"
  8877. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8878. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8879. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8880. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8881. // "NEXT_HOP_NOT_RUNNING"
  8882. // "NOT_CRITICAL_ERROR"
  8883. // "NO_RESULTS_ON_PAGE"
  8884. // "REQUIRED_TOS_AGREEMENT"
  8885. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8886. // "RESOURCE_NOT_DELETED"
  8887. // "SCHEMA_VALIDATION_IGNORED"
  8888. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8889. // "UNDECLARED_PROPERTIES"
  8890. // "UNREACHABLE"
  8891. Code string `json:"code,omitempty"`
  8892. // Data: [Output Only] Metadata about this warning in key: value format.
  8893. // For example:
  8894. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8895. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  8896. // Message: [Output Only] A human-readable description of the warning
  8897. // code.
  8898. Message string `json:"message,omitempty"`
  8899. // ForceSendFields is a list of field names (e.g. "Code") to
  8900. // unconditionally include in API requests. By default, fields with
  8901. // empty values are omitted from API requests. However, any non-pointer,
  8902. // non-interface field appearing in ForceSendFields will be sent to the
  8903. // server regardless of whether the field is empty or not. This may be
  8904. // used to include empty fields in Patch requests.
  8905. ForceSendFields []string `json:"-"`
  8906. // NullFields is a list of field names (e.g. "Code") to include in API
  8907. // requests with the JSON null value. By default, fields with empty
  8908. // values are omitted from API requests. However, any field with an
  8909. // empty value appearing in NullFields will be sent to the server as
  8910. // null. It is an error if a field in this list has a non-empty value.
  8911. // This may be used to include null fields in Patch requests.
  8912. NullFields []string `json:"-"`
  8913. }
  8914. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8915. type NoMethod ForwardingRuleAggregatedListWarning
  8916. raw := NoMethod(*s)
  8917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8918. }
  8919. type ForwardingRuleAggregatedListWarningData struct {
  8920. // Key: [Output Only] A key that provides more detail on the warning
  8921. // being returned. For example, for warnings where there are no results
  8922. // in a list request for a particular zone, this key might be scope and
  8923. // the key value might be the zone name. Other examples might be a key
  8924. // indicating a deprecated resource and a suggested replacement, or a
  8925. // warning about invalid network settings (for example, if an instance
  8926. // attempts to perform IP forwarding but is not enabled for IP
  8927. // forwarding).
  8928. Key string `json:"key,omitempty"`
  8929. // Value: [Output Only] A warning data value corresponding to the key.
  8930. Value string `json:"value,omitempty"`
  8931. // ForceSendFields is a list of field names (e.g. "Key") to
  8932. // unconditionally include in API requests. By default, fields with
  8933. // empty values are omitted from API requests. However, any non-pointer,
  8934. // non-interface field appearing in ForceSendFields will be sent to the
  8935. // server regardless of whether the field is empty or not. This may be
  8936. // used to include empty fields in Patch requests.
  8937. ForceSendFields []string `json:"-"`
  8938. // NullFields is a list of field names (e.g. "Key") to include in API
  8939. // requests with the JSON null value. By default, fields with empty
  8940. // values are omitted from API requests. However, any field with an
  8941. // empty value appearing in NullFields will be sent to the server as
  8942. // null. It is an error if a field in this list has a non-empty value.
  8943. // This may be used to include null fields in Patch requests.
  8944. NullFields []string `json:"-"`
  8945. }
  8946. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8947. type NoMethod ForwardingRuleAggregatedListWarningData
  8948. raw := NoMethod(*s)
  8949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8950. }
  8951. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  8952. type ForwardingRuleList struct {
  8953. // Id: [Output Only] Unique identifier for the resource; defined by the
  8954. // server.
  8955. Id string `json:"id,omitempty"`
  8956. // Items: A list of ForwardingRule resources.
  8957. Items []*ForwardingRule `json:"items,omitempty"`
  8958. // Kind: Type of resource.
  8959. Kind string `json:"kind,omitempty"`
  8960. // NextPageToken: [Output Only] This token allows you to get the next
  8961. // page of results for list requests. If the number of results is larger
  8962. // than maxResults, use the nextPageToken as a value for the query
  8963. // parameter pageToken in the next list request. Subsequent list
  8964. // requests will have their own nextPageToken to continue paging through
  8965. // the results.
  8966. NextPageToken string `json:"nextPageToken,omitempty"`
  8967. // SelfLink: [Output Only] Server-defined URL for this resource.
  8968. SelfLink string `json:"selfLink,omitempty"`
  8969. // Warning: [Output Only] Informational warning message.
  8970. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  8971. // ServerResponse contains the HTTP response code and headers from the
  8972. // server.
  8973. googleapi.ServerResponse `json:"-"`
  8974. // ForceSendFields is a list of field names (e.g. "Id") to
  8975. // unconditionally include in API requests. By default, fields with
  8976. // empty values are omitted from API requests. However, any non-pointer,
  8977. // non-interface field appearing in ForceSendFields will be sent to the
  8978. // server regardless of whether the field is empty or not. This may be
  8979. // used to include empty fields in Patch requests.
  8980. ForceSendFields []string `json:"-"`
  8981. // NullFields is a list of field names (e.g. "Id") to include in API
  8982. // requests with the JSON null value. By default, fields with empty
  8983. // values are omitted from API requests. However, any field with an
  8984. // empty value appearing in NullFields will be sent to the server as
  8985. // null. It is an error if a field in this list has a non-empty value.
  8986. // This may be used to include null fields in Patch requests.
  8987. NullFields []string `json:"-"`
  8988. }
  8989. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  8990. type NoMethod ForwardingRuleList
  8991. raw := NoMethod(*s)
  8992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8993. }
  8994. // ForwardingRuleListWarning: [Output Only] Informational warning
  8995. // message.
  8996. type ForwardingRuleListWarning struct {
  8997. // Code: [Output Only] A warning code, if applicable. For example,
  8998. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8999. // the response.
  9000. //
  9001. // Possible values:
  9002. // "CLEANUP_FAILED"
  9003. // "DEPRECATED_RESOURCE_USED"
  9004. // "DEPRECATED_TYPE_USED"
  9005. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9006. // "EXPERIMENTAL_TYPE_USED"
  9007. // "EXTERNAL_API_WARNING"
  9008. // "FIELD_VALUE_OVERRIDEN"
  9009. // "INJECTED_KERNELS_DEPRECATED"
  9010. // "MISSING_TYPE_DEPENDENCY"
  9011. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9012. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9013. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9014. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9015. // "NEXT_HOP_NOT_RUNNING"
  9016. // "NOT_CRITICAL_ERROR"
  9017. // "NO_RESULTS_ON_PAGE"
  9018. // "REQUIRED_TOS_AGREEMENT"
  9019. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9020. // "RESOURCE_NOT_DELETED"
  9021. // "SCHEMA_VALIDATION_IGNORED"
  9022. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9023. // "UNDECLARED_PROPERTIES"
  9024. // "UNREACHABLE"
  9025. Code string `json:"code,omitempty"`
  9026. // Data: [Output Only] Metadata about this warning in key: value format.
  9027. // For example:
  9028. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9029. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  9030. // Message: [Output Only] A human-readable description of the warning
  9031. // code.
  9032. Message string `json:"message,omitempty"`
  9033. // ForceSendFields is a list of field names (e.g. "Code") to
  9034. // unconditionally include in API requests. By default, fields with
  9035. // empty values are omitted from API requests. However, any non-pointer,
  9036. // non-interface field appearing in ForceSendFields will be sent to the
  9037. // server regardless of whether the field is empty or not. This may be
  9038. // used to include empty fields in Patch requests.
  9039. ForceSendFields []string `json:"-"`
  9040. // NullFields is a list of field names (e.g. "Code") to include in API
  9041. // requests with the JSON null value. By default, fields with empty
  9042. // values are omitted from API requests. However, any field with an
  9043. // empty value appearing in NullFields will be sent to the server as
  9044. // null. It is an error if a field in this list has a non-empty value.
  9045. // This may be used to include null fields in Patch requests.
  9046. NullFields []string `json:"-"`
  9047. }
  9048. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  9049. type NoMethod ForwardingRuleListWarning
  9050. raw := NoMethod(*s)
  9051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9052. }
  9053. type ForwardingRuleListWarningData struct {
  9054. // Key: [Output Only] A key that provides more detail on the warning
  9055. // being returned. For example, for warnings where there are no results
  9056. // in a list request for a particular zone, this key might be scope and
  9057. // the key value might be the zone name. Other examples might be a key
  9058. // indicating a deprecated resource and a suggested replacement, or a
  9059. // warning about invalid network settings (for example, if an instance
  9060. // attempts to perform IP forwarding but is not enabled for IP
  9061. // forwarding).
  9062. Key string `json:"key,omitempty"`
  9063. // Value: [Output Only] A warning data value corresponding to the key.
  9064. Value string `json:"value,omitempty"`
  9065. // ForceSendFields is a list of field names (e.g. "Key") to
  9066. // unconditionally include in API requests. By default, fields with
  9067. // empty values are omitted from API requests. However, any non-pointer,
  9068. // non-interface field appearing in ForceSendFields will be sent to the
  9069. // server regardless of whether the field is empty or not. This may be
  9070. // used to include empty fields in Patch requests.
  9071. ForceSendFields []string `json:"-"`
  9072. // NullFields is a list of field names (e.g. "Key") to include in API
  9073. // requests with the JSON null value. By default, fields with empty
  9074. // values are omitted from API requests. However, any field with an
  9075. // empty value appearing in NullFields will be sent to the server as
  9076. // null. It is an error if a field in this list has a non-empty value.
  9077. // This may be used to include null fields in Patch requests.
  9078. NullFields []string `json:"-"`
  9079. }
  9080. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  9081. type NoMethod ForwardingRuleListWarningData
  9082. raw := NoMethod(*s)
  9083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9084. }
  9085. type ForwardingRuleReference struct {
  9086. ForwardingRule string `json:"forwardingRule,omitempty"`
  9087. // ForceSendFields is a list of field names (e.g. "ForwardingRule") to
  9088. // unconditionally include in API requests. By default, fields with
  9089. // empty values are omitted from API requests. However, any non-pointer,
  9090. // non-interface field appearing in ForceSendFields will be sent to the
  9091. // server regardless of whether the field is empty or not. This may be
  9092. // used to include empty fields in Patch requests.
  9093. ForceSendFields []string `json:"-"`
  9094. // NullFields is a list of field names (e.g. "ForwardingRule") to
  9095. // include in API requests with the JSON null value. By default, fields
  9096. // with empty values are omitted from API requests. However, any field
  9097. // with an empty value appearing in NullFields will be sent to the
  9098. // server as null. It is an error if a field in this list has a
  9099. // non-empty value. This may be used to include null fields in Patch
  9100. // requests.
  9101. NullFields []string `json:"-"`
  9102. }
  9103. func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
  9104. type NoMethod ForwardingRuleReference
  9105. raw := NoMethod(*s)
  9106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9107. }
  9108. type ForwardingRulesScopedList struct {
  9109. // ForwardingRules: A list of forwarding rules contained in this scope.
  9110. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  9111. // Warning: Informational warning which replaces the list of forwarding
  9112. // rules when the list is empty.
  9113. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  9114. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  9115. // unconditionally include in API requests. By default, fields with
  9116. // empty values are omitted from API requests. However, any non-pointer,
  9117. // non-interface field appearing in ForceSendFields will be sent to the
  9118. // server regardless of whether the field is empty or not. This may be
  9119. // used to include empty fields in Patch requests.
  9120. ForceSendFields []string `json:"-"`
  9121. // NullFields is a list of field names (e.g. "ForwardingRules") to
  9122. // include in API requests with the JSON null value. By default, fields
  9123. // with empty values are omitted from API requests. However, any field
  9124. // with an empty value appearing in NullFields will be sent to the
  9125. // server as null. It is an error if a field in this list has a
  9126. // non-empty value. This may be used to include null fields in Patch
  9127. // requests.
  9128. NullFields []string `json:"-"`
  9129. }
  9130. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  9131. type NoMethod ForwardingRulesScopedList
  9132. raw := NoMethod(*s)
  9133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9134. }
  9135. // ForwardingRulesScopedListWarning: Informational warning which
  9136. // replaces the list of forwarding rules when the list is empty.
  9137. type ForwardingRulesScopedListWarning struct {
  9138. // Code: [Output Only] A warning code, if applicable. For example,
  9139. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9140. // the response.
  9141. //
  9142. // Possible values:
  9143. // "CLEANUP_FAILED"
  9144. // "DEPRECATED_RESOURCE_USED"
  9145. // "DEPRECATED_TYPE_USED"
  9146. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9147. // "EXPERIMENTAL_TYPE_USED"
  9148. // "EXTERNAL_API_WARNING"
  9149. // "FIELD_VALUE_OVERRIDEN"
  9150. // "INJECTED_KERNELS_DEPRECATED"
  9151. // "MISSING_TYPE_DEPENDENCY"
  9152. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9153. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9154. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9155. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9156. // "NEXT_HOP_NOT_RUNNING"
  9157. // "NOT_CRITICAL_ERROR"
  9158. // "NO_RESULTS_ON_PAGE"
  9159. // "REQUIRED_TOS_AGREEMENT"
  9160. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9161. // "RESOURCE_NOT_DELETED"
  9162. // "SCHEMA_VALIDATION_IGNORED"
  9163. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9164. // "UNDECLARED_PROPERTIES"
  9165. // "UNREACHABLE"
  9166. Code string `json:"code,omitempty"`
  9167. // Data: [Output Only] Metadata about this warning in key: value format.
  9168. // For example:
  9169. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9170. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  9171. // Message: [Output Only] A human-readable description of the warning
  9172. // code.
  9173. Message string `json:"message,omitempty"`
  9174. // ForceSendFields is a list of field names (e.g. "Code") to
  9175. // unconditionally include in API requests. By default, fields with
  9176. // empty values are omitted from API requests. However, any non-pointer,
  9177. // non-interface field appearing in ForceSendFields will be sent to the
  9178. // server regardless of whether the field is empty or not. This may be
  9179. // used to include empty fields in Patch requests.
  9180. ForceSendFields []string `json:"-"`
  9181. // NullFields is a list of field names (e.g. "Code") to include in API
  9182. // requests with the JSON null value. By default, fields with empty
  9183. // values are omitted from API requests. However, any field with an
  9184. // empty value appearing in NullFields will be sent to the server as
  9185. // null. It is an error if a field in this list has a non-empty value.
  9186. // This may be used to include null fields in Patch requests.
  9187. NullFields []string `json:"-"`
  9188. }
  9189. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  9190. type NoMethod ForwardingRulesScopedListWarning
  9191. raw := NoMethod(*s)
  9192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9193. }
  9194. type ForwardingRulesScopedListWarningData struct {
  9195. // Key: [Output Only] A key that provides more detail on the warning
  9196. // being returned. For example, for warnings where there are no results
  9197. // in a list request for a particular zone, this key might be scope and
  9198. // the key value might be the zone name. Other examples might be a key
  9199. // indicating a deprecated resource and a suggested replacement, or a
  9200. // warning about invalid network settings (for example, if an instance
  9201. // attempts to perform IP forwarding but is not enabled for IP
  9202. // forwarding).
  9203. Key string `json:"key,omitempty"`
  9204. // Value: [Output Only] A warning data value corresponding to the key.
  9205. Value string `json:"value,omitempty"`
  9206. // ForceSendFields is a list of field names (e.g. "Key") to
  9207. // unconditionally include in API requests. By default, fields with
  9208. // empty values are omitted from API requests. However, any non-pointer,
  9209. // non-interface field appearing in ForceSendFields will be sent to the
  9210. // server regardless of whether the field is empty or not. This may be
  9211. // used to include empty fields in Patch requests.
  9212. ForceSendFields []string `json:"-"`
  9213. // NullFields is a list of field names (e.g. "Key") to include in API
  9214. // requests with the JSON null value. By default, fields with empty
  9215. // values are omitted from API requests. However, any field with an
  9216. // empty value appearing in NullFields will be sent to the server as
  9217. // null. It is an error if a field in this list has a non-empty value.
  9218. // This may be used to include null fields in Patch requests.
  9219. NullFields []string `json:"-"`
  9220. }
  9221. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  9222. type NoMethod ForwardingRulesScopedListWarningData
  9223. raw := NoMethod(*s)
  9224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9225. }
  9226. type GlobalSetLabelsRequest struct {
  9227. // LabelFingerprint: The fingerprint of the previous set of labels for
  9228. // this resource, used to detect conflicts. The fingerprint is initially
  9229. // generated by Compute Engine and changes after every request to modify
  9230. // or update labels. You must always provide an up-to-date fingerprint
  9231. // hash when updating or changing labels, otherwise the request will
  9232. // fail with error 412 conditionNotMet. Make a get() request to the
  9233. // resource to get the latest fingerprint.
  9234. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  9235. // Labels: A list of labels to apply for this resource. Each label key &
  9236. // value must comply with RFC1035. Specifically, the name must be 1-63
  9237. // characters long and match the regular expression
  9238. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  9239. // a lowercase letter, and all following characters must be a dash,
  9240. // lowercase letter, or digit, except the last character, which cannot
  9241. // be a dash. For example, "webserver-frontend": "images". A label value
  9242. // can also be empty (e.g. "my-label": "").
  9243. Labels map[string]string `json:"labels,omitempty"`
  9244. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  9245. // unconditionally include in API requests. By default, fields with
  9246. // empty values are omitted from API requests. However, any non-pointer,
  9247. // non-interface field appearing in ForceSendFields will be sent to the
  9248. // server regardless of whether the field is empty or not. This may be
  9249. // used to include empty fields in Patch requests.
  9250. ForceSendFields []string `json:"-"`
  9251. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  9252. // include in API requests with the JSON null value. By default, fields
  9253. // with empty values are omitted from API requests. However, any field
  9254. // with an empty value appearing in NullFields will be sent to the
  9255. // server as null. It is an error if a field in this list has a
  9256. // non-empty value. This may be used to include null fields in Patch
  9257. // requests.
  9258. NullFields []string `json:"-"`
  9259. }
  9260. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  9261. type NoMethod GlobalSetLabelsRequest
  9262. raw := NoMethod(*s)
  9263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9264. }
  9265. type GlobalSetPolicyRequest struct {
  9266. // Bindings: Flatten Policy to create a backward compatible wire-format.
  9267. // Deprecated. Use 'policy' to specify bindings.
  9268. Bindings []*Binding `json:"bindings,omitempty"`
  9269. // Etag: Flatten Policy to create a backward compatible wire-format.
  9270. // Deprecated. Use 'policy' to specify the etag.
  9271. Etag string `json:"etag,omitempty"`
  9272. // Policy: REQUIRED: The complete policy to be applied to the
  9273. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  9274. // empty policy is in general a valid policy but certain services (like
  9275. // Projects) might reject them.
  9276. Policy *Policy `json:"policy,omitempty"`
  9277. // ForceSendFields is a list of field names (e.g. "Bindings") to
  9278. // unconditionally include in API requests. By default, fields with
  9279. // empty values are omitted from API requests. However, any non-pointer,
  9280. // non-interface field appearing in ForceSendFields will be sent to the
  9281. // server regardless of whether the field is empty or not. This may be
  9282. // used to include empty fields in Patch requests.
  9283. ForceSendFields []string `json:"-"`
  9284. // NullFields is a list of field names (e.g. "Bindings") to include in
  9285. // API requests with the JSON null value. By default, fields with empty
  9286. // values are omitted from API requests. However, any field with an
  9287. // empty value appearing in NullFields will be sent to the server as
  9288. // null. It is an error if a field in this list has a non-empty value.
  9289. // This may be used to include null fields in Patch requests.
  9290. NullFields []string `json:"-"`
  9291. }
  9292. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  9293. type NoMethod GlobalSetPolicyRequest
  9294. raw := NoMethod(*s)
  9295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9296. }
  9297. // GrpcServiceConfig: gRPC config to access the SDS server.
  9298. type GrpcServiceConfig struct {
  9299. // CallCredentials: The call credentials to access the SDS server.
  9300. CallCredentials *CallCredentials `json:"callCredentials,omitempty"`
  9301. // ChannelCredentials: The channel credentials to access the SDS server.
  9302. ChannelCredentials *ChannelCredentials `json:"channelCredentials,omitempty"`
  9303. // TargetUri: The target URI of the SDS server.
  9304. TargetUri string `json:"targetUri,omitempty"`
  9305. // ForceSendFields is a list of field names (e.g. "CallCredentials") to
  9306. // unconditionally include in API requests. By default, fields with
  9307. // empty values are omitted from API requests. However, any non-pointer,
  9308. // non-interface field appearing in ForceSendFields will be sent to the
  9309. // server regardless of whether the field is empty or not. This may be
  9310. // used to include empty fields in Patch requests.
  9311. ForceSendFields []string `json:"-"`
  9312. // NullFields is a list of field names (e.g. "CallCredentials") to
  9313. // include in API requests with the JSON null value. By default, fields
  9314. // with empty values are omitted from API requests. However, any field
  9315. // with an empty value appearing in NullFields will be sent to the
  9316. // server as null. It is an error if a field in this list has a
  9317. // non-empty value. This may be used to include null fields in Patch
  9318. // requests.
  9319. NullFields []string `json:"-"`
  9320. }
  9321. func (s *GrpcServiceConfig) MarshalJSON() ([]byte, error) {
  9322. type NoMethod GrpcServiceConfig
  9323. raw := NoMethod(*s)
  9324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9325. }
  9326. // GuestAttributes: A guest attributes entry.
  9327. type GuestAttributes struct {
  9328. // Kind: [Output Only] Type of the resource. Always
  9329. // compute#guestAttributes for guest attributes entry.
  9330. Kind string `json:"kind,omitempty"`
  9331. // QueryPath: The path to be queried. This can be the default namespace
  9332. // ('/') or a nested namespace ('//') or a specified key ('//')
  9333. QueryPath string `json:"queryPath,omitempty"`
  9334. // QueryValue: [Output Only] The value of the requested queried path.
  9335. QueryValue *GuestAttributesValue `json:"queryValue,omitempty"`
  9336. // SelfLink: [Output Only] Server-defined URL for this resource.
  9337. SelfLink string `json:"selfLink,omitempty"`
  9338. // VariableKey: The key to search for.
  9339. VariableKey string `json:"variableKey,omitempty"`
  9340. // VariableValue: [Output Only] The value found for the requested key.
  9341. VariableValue string `json:"variableValue,omitempty"`
  9342. // ServerResponse contains the HTTP response code and headers from the
  9343. // server.
  9344. googleapi.ServerResponse `json:"-"`
  9345. // ForceSendFields is a list of field names (e.g. "Kind") to
  9346. // unconditionally include in API requests. By default, fields with
  9347. // empty values are omitted from API requests. However, any non-pointer,
  9348. // non-interface field appearing in ForceSendFields will be sent to the
  9349. // server regardless of whether the field is empty or not. This may be
  9350. // used to include empty fields in Patch requests.
  9351. ForceSendFields []string `json:"-"`
  9352. // NullFields is a list of field names (e.g. "Kind") to include in API
  9353. // requests with the JSON null value. By default, fields with empty
  9354. // values are omitted from API requests. However, any field with an
  9355. // empty value appearing in NullFields will be sent to the server as
  9356. // null. It is an error if a field in this list has a non-empty value.
  9357. // This may be used to include null fields in Patch requests.
  9358. NullFields []string `json:"-"`
  9359. }
  9360. func (s *GuestAttributes) MarshalJSON() ([]byte, error) {
  9361. type NoMethod GuestAttributes
  9362. raw := NoMethod(*s)
  9363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9364. }
  9365. // GuestAttributesEntry: A guest attributes namespace/key/value entry.
  9366. type GuestAttributesEntry struct {
  9367. // Key: Key for the guest attribute entry.
  9368. Key string `json:"key,omitempty"`
  9369. // Namespace: Namespace for the guest attribute entry.
  9370. Namespace string `json:"namespace,omitempty"`
  9371. // Value: Value for the guest attribute entry.
  9372. Value string `json:"value,omitempty"`
  9373. // ForceSendFields is a list of field names (e.g. "Key") to
  9374. // unconditionally include in API requests. By default, fields with
  9375. // empty values are omitted from API requests. However, any non-pointer,
  9376. // non-interface field appearing in ForceSendFields will be sent to the
  9377. // server regardless of whether the field is empty or not. This may be
  9378. // used to include empty fields in Patch requests.
  9379. ForceSendFields []string `json:"-"`
  9380. // NullFields is a list of field names (e.g. "Key") to include in API
  9381. // requests with the JSON null value. By default, fields with empty
  9382. // values are omitted from API requests. However, any field with an
  9383. // empty value appearing in NullFields will be sent to the server as
  9384. // null. It is an error if a field in this list has a non-empty value.
  9385. // This may be used to include null fields in Patch requests.
  9386. NullFields []string `json:"-"`
  9387. }
  9388. func (s *GuestAttributesEntry) MarshalJSON() ([]byte, error) {
  9389. type NoMethod GuestAttributesEntry
  9390. raw := NoMethod(*s)
  9391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9392. }
  9393. // GuestAttributesValue: Array of guest attribute namespace/key/value
  9394. // tuples.
  9395. type GuestAttributesValue struct {
  9396. Items []*GuestAttributesEntry `json:"items,omitempty"`
  9397. // ForceSendFields is a list of field names (e.g. "Items") to
  9398. // unconditionally include in API requests. By default, fields with
  9399. // empty values are omitted from API requests. However, any non-pointer,
  9400. // non-interface field appearing in ForceSendFields will be sent to the
  9401. // server regardless of whether the field is empty or not. This may be
  9402. // used to include empty fields in Patch requests.
  9403. ForceSendFields []string `json:"-"`
  9404. // NullFields is a list of field names (e.g. "Items") to include in API
  9405. // requests with the JSON null value. By default, fields with empty
  9406. // values are omitted from API requests. However, any field with an
  9407. // empty value appearing in NullFields will be sent to the server as
  9408. // null. It is an error if a field in this list has a non-empty value.
  9409. // This may be used to include null fields in Patch requests.
  9410. NullFields []string `json:"-"`
  9411. }
  9412. func (s *GuestAttributesValue) MarshalJSON() ([]byte, error) {
  9413. type NoMethod GuestAttributesValue
  9414. raw := NoMethod(*s)
  9415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9416. }
  9417. // GuestOsFeature: Guest OS features.
  9418. type GuestOsFeature struct {
  9419. // Type: The ID of a supported feature. Read Enabling guest operating
  9420. // system features to see a list of available options.
  9421. //
  9422. // Possible values:
  9423. // "FEATURE_TYPE_UNSPECIFIED"
  9424. // "GVNIC"
  9425. // "MULTI_IP_SUBNET"
  9426. // "SECURE_BOOT"
  9427. // "UEFI_COMPATIBLE"
  9428. // "VIRTIO_SCSI_MULTIQUEUE"
  9429. // "WINDOWS"
  9430. Type string `json:"type,omitempty"`
  9431. // ForceSendFields is a list of field names (e.g. "Type") to
  9432. // unconditionally include in API requests. By default, fields with
  9433. // empty values are omitted from API requests. However, any non-pointer,
  9434. // non-interface field appearing in ForceSendFields will be sent to the
  9435. // server regardless of whether the field is empty or not. This may be
  9436. // used to include empty fields in Patch requests.
  9437. ForceSendFields []string `json:"-"`
  9438. // NullFields is a list of field names (e.g. "Type") to include in API
  9439. // requests with the JSON null value. By default, fields with empty
  9440. // values are omitted from API requests. However, any field with an
  9441. // empty value appearing in NullFields will be sent to the server as
  9442. // null. It is an error if a field in this list has a non-empty value.
  9443. // This may be used to include null fields in Patch requests.
  9444. NullFields []string `json:"-"`
  9445. }
  9446. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  9447. type NoMethod GuestOsFeature
  9448. raw := NoMethod(*s)
  9449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9450. }
  9451. type HTTP2HealthCheck struct {
  9452. // Host: The value of the host header in the HTTP/2 health check
  9453. // request. If left empty (default value), the IP on behalf of which
  9454. // this health check is performed will be used.
  9455. Host string `json:"host,omitempty"`
  9456. // Port: The TCP port number for the health check request. The default
  9457. // value is 443. Valid values are 1 through 65535.
  9458. Port int64 `json:"port,omitempty"`
  9459. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  9460. // both port and port_name are defined, port takes precedence.
  9461. PortName string `json:"portName,omitempty"`
  9462. // PortSpecification: Specifies how port is selected for health
  9463. // checking, can be one of following values:
  9464. // USE_FIXED_PORT: The port number in
  9465. // port
  9466. // is used for health checking.
  9467. // USE_NAMED_PORT: The
  9468. // portName
  9469. // is used for health checking.
  9470. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  9471. // each network endpoint is used for health checking. For other
  9472. // backends, the port or named port specified in the Backend Service is
  9473. // used for health checking.
  9474. //
  9475. //
  9476. // If not specified, HTTP2 health check follows behavior specified
  9477. // in
  9478. // port
  9479. // and
  9480. // portName
  9481. // fields.
  9482. //
  9483. // Possible values:
  9484. // "USE_FIXED_PORT"
  9485. // "USE_NAMED_PORT"
  9486. // "USE_SERVING_PORT"
  9487. PortSpecification string `json:"portSpecification,omitempty"`
  9488. // ProxyHeader: Specifies the type of proxy header to append before
  9489. // sending data to the backend, either NONE or PROXY_V1. The default is
  9490. // NONE.
  9491. //
  9492. // Possible values:
  9493. // "NONE"
  9494. // "PROXY_V1"
  9495. ProxyHeader string `json:"proxyHeader,omitempty"`
  9496. // RequestPath: The request path of the HTTP/2 health check request. The
  9497. // default value is /.
  9498. RequestPath string `json:"requestPath,omitempty"`
  9499. // Response: The string to match anywhere in the first 1024 bytes of the
  9500. // response body. If left empty (the default value), the status code
  9501. // determines health. The response data can only be ASCII.
  9502. Response string `json:"response,omitempty"`
  9503. // ForceSendFields is a list of field names (e.g. "Host") to
  9504. // unconditionally include in API requests. By default, fields with
  9505. // empty values are omitted from API requests. However, any non-pointer,
  9506. // non-interface field appearing in ForceSendFields will be sent to the
  9507. // server regardless of whether the field is empty or not. This may be
  9508. // used to include empty fields in Patch requests.
  9509. ForceSendFields []string `json:"-"`
  9510. // NullFields is a list of field names (e.g. "Host") to include in API
  9511. // requests with the JSON null value. By default, fields with empty
  9512. // values are omitted from API requests. However, any field with an
  9513. // empty value appearing in NullFields will be sent to the server as
  9514. // null. It is an error if a field in this list has a non-empty value.
  9515. // This may be used to include null fields in Patch requests.
  9516. NullFields []string `json:"-"`
  9517. }
  9518. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  9519. type NoMethod HTTP2HealthCheck
  9520. raw := NoMethod(*s)
  9521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9522. }
  9523. type HTTPHealthCheck struct {
  9524. // Host: The value of the host header in the HTTP health check request.
  9525. // If left empty (default value), the IP on behalf of which this health
  9526. // check is performed will be used.
  9527. Host string `json:"host,omitempty"`
  9528. // Port: The TCP port number for the health check request. The default
  9529. // value is 80. Valid values are 1 through 65535.
  9530. Port int64 `json:"port,omitempty"`
  9531. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  9532. // both port and port_name are defined, port takes precedence.
  9533. PortName string `json:"portName,omitempty"`
  9534. // PortSpecification: Specifies how port is selected for health
  9535. // checking, can be one of following values:
  9536. // USE_FIXED_PORT: The port number in
  9537. // port
  9538. // is used for health checking.
  9539. // USE_NAMED_PORT: The
  9540. // portName
  9541. // is used for health checking.
  9542. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  9543. // each network endpoint is used for health checking. For other
  9544. // backends, the port or named port specified in the Backend Service is
  9545. // used for health checking.
  9546. //
  9547. //
  9548. // If not specified, HTTP health check follows behavior specified
  9549. // in
  9550. // port
  9551. // and
  9552. // portName
  9553. // fields.
  9554. //
  9555. // Possible values:
  9556. // "USE_FIXED_PORT"
  9557. // "USE_NAMED_PORT"
  9558. // "USE_SERVING_PORT"
  9559. PortSpecification string `json:"portSpecification,omitempty"`
  9560. // ProxyHeader: Specifies the type of proxy header to append before
  9561. // sending data to the backend, either NONE or PROXY_V1. The default is
  9562. // NONE.
  9563. //
  9564. // Possible values:
  9565. // "NONE"
  9566. // "PROXY_V1"
  9567. ProxyHeader string `json:"proxyHeader,omitempty"`
  9568. // RequestPath: The request path of the HTTP health check request. The
  9569. // default value is /.
  9570. RequestPath string `json:"requestPath,omitempty"`
  9571. // Response: The string to match anywhere in the first 1024 bytes of the
  9572. // response body. If left empty (the default value), the status code
  9573. // determines health. The response data can only be ASCII.
  9574. Response string `json:"response,omitempty"`
  9575. // ForceSendFields is a list of field names (e.g. "Host") to
  9576. // unconditionally include in API requests. By default, fields with
  9577. // empty values are omitted from API requests. However, any non-pointer,
  9578. // non-interface field appearing in ForceSendFields will be sent to the
  9579. // server regardless of whether the field is empty or not. This may be
  9580. // used to include empty fields in Patch requests.
  9581. ForceSendFields []string `json:"-"`
  9582. // NullFields is a list of field names (e.g. "Host") to include in API
  9583. // requests with the JSON null value. By default, fields with empty
  9584. // values are omitted from API requests. However, any field with an
  9585. // empty value appearing in NullFields will be sent to the server as
  9586. // null. It is an error if a field in this list has a non-empty value.
  9587. // This may be used to include null fields in Patch requests.
  9588. NullFields []string `json:"-"`
  9589. }
  9590. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  9591. type NoMethod HTTPHealthCheck
  9592. raw := NoMethod(*s)
  9593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9594. }
  9595. type HTTPSHealthCheck struct {
  9596. // Host: The value of the host header in the HTTPS health check request.
  9597. // If left empty (default value), the IP on behalf of which this health
  9598. // check is performed will be used.
  9599. Host string `json:"host,omitempty"`
  9600. // Port: The TCP port number for the health check request. The default
  9601. // value is 443. Valid values are 1 through 65535.
  9602. Port int64 `json:"port,omitempty"`
  9603. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  9604. // both port and port_name are defined, port takes precedence.
  9605. PortName string `json:"portName,omitempty"`
  9606. // PortSpecification: Specifies how port is selected for health
  9607. // checking, can be one of following values:
  9608. // USE_FIXED_PORT: The port number in
  9609. // port
  9610. // is used for health checking.
  9611. // USE_NAMED_PORT: The
  9612. // portName
  9613. // is used for health checking.
  9614. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  9615. // each network endpoint is used for health checking. For other
  9616. // backends, the port or named port specified in the Backend Service is
  9617. // used for health checking.
  9618. //
  9619. //
  9620. // If not specified, HTTPS health check follows behavior specified
  9621. // in
  9622. // port
  9623. // and
  9624. // portName
  9625. // fields.
  9626. //
  9627. // Possible values:
  9628. // "USE_FIXED_PORT"
  9629. // "USE_NAMED_PORT"
  9630. // "USE_SERVING_PORT"
  9631. PortSpecification string `json:"portSpecification,omitempty"`
  9632. // ProxyHeader: Specifies the type of proxy header to append before
  9633. // sending data to the backend, either NONE or PROXY_V1. The default is
  9634. // NONE.
  9635. //
  9636. // Possible values:
  9637. // "NONE"
  9638. // "PROXY_V1"
  9639. ProxyHeader string `json:"proxyHeader,omitempty"`
  9640. // RequestPath: The request path of the HTTPS health check request. The
  9641. // default value is /.
  9642. RequestPath string `json:"requestPath,omitempty"`
  9643. // Response: The string to match anywhere in the first 1024 bytes of the
  9644. // response body. If left empty (the default value), the status code
  9645. // determines health. The response data can only be ASCII.
  9646. Response string `json:"response,omitempty"`
  9647. // ForceSendFields is a list of field names (e.g. "Host") to
  9648. // unconditionally include in API requests. By default, fields with
  9649. // empty values are omitted from API requests. However, any non-pointer,
  9650. // non-interface field appearing in ForceSendFields will be sent to the
  9651. // server regardless of whether the field is empty or not. This may be
  9652. // used to include empty fields in Patch requests.
  9653. ForceSendFields []string `json:"-"`
  9654. // NullFields is a list of field names (e.g. "Host") to include in API
  9655. // requests with the JSON null value. By default, fields with empty
  9656. // values are omitted from API requests. However, any field with an
  9657. // empty value appearing in NullFields will be sent to the server as
  9658. // null. It is an error if a field in this list has a non-empty value.
  9659. // This may be used to include null fields in Patch requests.
  9660. NullFields []string `json:"-"`
  9661. }
  9662. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  9663. type NoMethod HTTPSHealthCheck
  9664. raw := NoMethod(*s)
  9665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9666. }
  9667. // HealthCheck: An HealthCheck resource. This resource defines a
  9668. // template for how individual virtual machines should be checked for
  9669. // health, via one of the supported protocols.
  9670. type HealthCheck struct {
  9671. // CheckIntervalSec: How often (in seconds) to send a health check. The
  9672. // default value is 5 seconds.
  9673. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  9674. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  9675. // format.
  9676. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9677. // Description: An optional description of this resource. Provide this
  9678. // property when you create the resource.
  9679. Description string `json:"description,omitempty"`
  9680. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  9681. // after this many consecutive successes. The default value is 2.
  9682. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  9683. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  9684. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  9685. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  9686. // Id: [Output Only] The unique identifier for the resource. This
  9687. // identifier is defined by the server.
  9688. Id uint64 `json:"id,omitempty,string"`
  9689. // Kind: Type of the resource.
  9690. Kind string `json:"kind,omitempty"`
  9691. // Name: Name of the resource. Provided by the client when the resource
  9692. // is created. The name must be 1-63 characters long, and comply with
  9693. // RFC1035. Specifically, the name must be 1-63 characters long and
  9694. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  9695. // the first character must be a lowercase letter, and all following
  9696. // characters must be a dash, lowercase letter, or digit, except the
  9697. // last character, which cannot be a dash.
  9698. Name string `json:"name,omitempty"`
  9699. // Region: [Output Only] Region where the health check resides. Not
  9700. // applicable to global health checks.
  9701. Region string `json:"region,omitempty"`
  9702. // SelfLink: [Output Only] Server-defined URL for the resource.
  9703. SelfLink string `json:"selfLink,omitempty"`
  9704. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  9705. // with the resource id.
  9706. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  9707. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  9708. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  9709. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  9710. // The default value is 5 seconds. It is invalid for timeoutSec to have
  9711. // greater value than checkIntervalSec.
  9712. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  9713. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  9714. // HTTPS. If not specified, the default is TCP. Exactly one of the
  9715. // protocol-specific health check field must be specified, which must
  9716. // match type field.
  9717. //
  9718. // Possible values:
  9719. // "HTTP"
  9720. // "HTTP2"
  9721. // "HTTPS"
  9722. // "INVALID"
  9723. // "SSL"
  9724. // "TCP"
  9725. // "UDP"
  9726. Type string `json:"type,omitempty"`
  9727. UdpHealthCheck *UDPHealthCheck `json:"udpHealthCheck,omitempty"`
  9728. // UnhealthyThreshold: A so-far healthy instance will be marked
  9729. // unhealthy after this many consecutive failures. The default value is
  9730. // 2.
  9731. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  9732. // ServerResponse contains the HTTP response code and headers from the
  9733. // server.
  9734. googleapi.ServerResponse `json:"-"`
  9735. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  9736. // unconditionally include in API requests. By default, fields with
  9737. // empty values are omitted from API requests. However, any non-pointer,
  9738. // non-interface field appearing in ForceSendFields will be sent to the
  9739. // server regardless of whether the field is empty or not. This may be
  9740. // used to include empty fields in Patch requests.
  9741. ForceSendFields []string `json:"-"`
  9742. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  9743. // include in API requests with the JSON null value. By default, fields
  9744. // with empty values are omitted from API requests. However, any field
  9745. // with an empty value appearing in NullFields will be sent to the
  9746. // server as null. It is an error if a field in this list has a
  9747. // non-empty value. This may be used to include null fields in Patch
  9748. // requests.
  9749. NullFields []string `json:"-"`
  9750. }
  9751. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  9752. type NoMethod HealthCheck
  9753. raw := NoMethod(*s)
  9754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9755. }
  9756. // HealthCheckList: Contains a list of HealthCheck resources.
  9757. type HealthCheckList struct {
  9758. // Id: [Output Only] Unique identifier for the resource; defined by the
  9759. // server.
  9760. Id string `json:"id,omitempty"`
  9761. // Items: A list of HealthCheck resources.
  9762. Items []*HealthCheck `json:"items,omitempty"`
  9763. // Kind: Type of resource.
  9764. Kind string `json:"kind,omitempty"`
  9765. // NextPageToken: [Output Only] This token allows you to get the next
  9766. // page of results for list requests. If the number of results is larger
  9767. // than maxResults, use the nextPageToken as a value for the query
  9768. // parameter pageToken in the next list request. Subsequent list
  9769. // requests will have their own nextPageToken to continue paging through
  9770. // the results.
  9771. NextPageToken string `json:"nextPageToken,omitempty"`
  9772. // SelfLink: [Output Only] Server-defined URL for this resource.
  9773. SelfLink string `json:"selfLink,omitempty"`
  9774. // Warning: [Output Only] Informational warning message.
  9775. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  9776. // ServerResponse contains the HTTP response code and headers from the
  9777. // server.
  9778. googleapi.ServerResponse `json:"-"`
  9779. // ForceSendFields is a list of field names (e.g. "Id") to
  9780. // unconditionally include in API requests. By default, fields with
  9781. // empty values are omitted from API requests. However, any non-pointer,
  9782. // non-interface field appearing in ForceSendFields will be sent to the
  9783. // server regardless of whether the field is empty or not. This may be
  9784. // used to include empty fields in Patch requests.
  9785. ForceSendFields []string `json:"-"`
  9786. // NullFields is a list of field names (e.g. "Id") to include in API
  9787. // requests with the JSON null value. By default, fields with empty
  9788. // values are omitted from API requests. However, any field with an
  9789. // empty value appearing in NullFields will be sent to the server as
  9790. // null. It is an error if a field in this list has a non-empty value.
  9791. // This may be used to include null fields in Patch requests.
  9792. NullFields []string `json:"-"`
  9793. }
  9794. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  9795. type NoMethod HealthCheckList
  9796. raw := NoMethod(*s)
  9797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9798. }
  9799. // HealthCheckListWarning: [Output Only] Informational warning message.
  9800. type HealthCheckListWarning struct {
  9801. // Code: [Output Only] A warning code, if applicable. For example,
  9802. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9803. // the response.
  9804. //
  9805. // Possible values:
  9806. // "CLEANUP_FAILED"
  9807. // "DEPRECATED_RESOURCE_USED"
  9808. // "DEPRECATED_TYPE_USED"
  9809. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9810. // "EXPERIMENTAL_TYPE_USED"
  9811. // "EXTERNAL_API_WARNING"
  9812. // "FIELD_VALUE_OVERRIDEN"
  9813. // "INJECTED_KERNELS_DEPRECATED"
  9814. // "MISSING_TYPE_DEPENDENCY"
  9815. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9816. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9817. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9818. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9819. // "NEXT_HOP_NOT_RUNNING"
  9820. // "NOT_CRITICAL_ERROR"
  9821. // "NO_RESULTS_ON_PAGE"
  9822. // "REQUIRED_TOS_AGREEMENT"
  9823. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9824. // "RESOURCE_NOT_DELETED"
  9825. // "SCHEMA_VALIDATION_IGNORED"
  9826. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9827. // "UNDECLARED_PROPERTIES"
  9828. // "UNREACHABLE"
  9829. Code string `json:"code,omitempty"`
  9830. // Data: [Output Only] Metadata about this warning in key: value format.
  9831. // For example:
  9832. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9833. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  9834. // Message: [Output Only] A human-readable description of the warning
  9835. // code.
  9836. Message string `json:"message,omitempty"`
  9837. // ForceSendFields is a list of field names (e.g. "Code") to
  9838. // unconditionally include in API requests. By default, fields with
  9839. // empty values are omitted from API requests. However, any non-pointer,
  9840. // non-interface field appearing in ForceSendFields will be sent to the
  9841. // server regardless of whether the field is empty or not. This may be
  9842. // used to include empty fields in Patch requests.
  9843. ForceSendFields []string `json:"-"`
  9844. // NullFields is a list of field names (e.g. "Code") to include in API
  9845. // requests with the JSON null value. By default, fields with empty
  9846. // values are omitted from API requests. However, any field with an
  9847. // empty value appearing in NullFields will be sent to the server as
  9848. // null. It is an error if a field in this list has a non-empty value.
  9849. // This may be used to include null fields in Patch requests.
  9850. NullFields []string `json:"-"`
  9851. }
  9852. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  9853. type NoMethod HealthCheckListWarning
  9854. raw := NoMethod(*s)
  9855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9856. }
  9857. type HealthCheckListWarningData struct {
  9858. // Key: [Output Only] A key that provides more detail on the warning
  9859. // being returned. For example, for warnings where there are no results
  9860. // in a list request for a particular zone, this key might be scope and
  9861. // the key value might be the zone name. Other examples might be a key
  9862. // indicating a deprecated resource and a suggested replacement, or a
  9863. // warning about invalid network settings (for example, if an instance
  9864. // attempts to perform IP forwarding but is not enabled for IP
  9865. // forwarding).
  9866. Key string `json:"key,omitempty"`
  9867. // Value: [Output Only] A warning data value corresponding to the key.
  9868. Value string `json:"value,omitempty"`
  9869. // ForceSendFields is a list of field names (e.g. "Key") to
  9870. // unconditionally include in API requests. By default, fields with
  9871. // empty values are omitted from API requests. However, any non-pointer,
  9872. // non-interface field appearing in ForceSendFields will be sent to the
  9873. // server regardless of whether the field is empty or not. This may be
  9874. // used to include empty fields in Patch requests.
  9875. ForceSendFields []string `json:"-"`
  9876. // NullFields is a list of field names (e.g. "Key") to include in API
  9877. // requests with the JSON null value. By default, fields with empty
  9878. // values are omitted from API requests. However, any field with an
  9879. // empty value appearing in NullFields will be sent to the server as
  9880. // null. It is an error if a field in this list has a non-empty value.
  9881. // This may be used to include null fields in Patch requests.
  9882. NullFields []string `json:"-"`
  9883. }
  9884. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  9885. type NoMethod HealthCheckListWarningData
  9886. raw := NoMethod(*s)
  9887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9888. }
  9889. // HealthCheckReference: A full or valid partial URL to a health check.
  9890. // For example, the following are valid URLs:
  9891. // -
  9892. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  9893. // - projects/project-id/global/httpHealthChecks/health-check
  9894. // - global/httpHealthChecks/health-check
  9895. type HealthCheckReference struct {
  9896. HealthCheck string `json:"healthCheck,omitempty"`
  9897. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  9898. // unconditionally include in API requests. By default, fields with
  9899. // empty values are omitted from API requests. However, any non-pointer,
  9900. // non-interface field appearing in ForceSendFields will be sent to the
  9901. // server regardless of whether the field is empty or not. This may be
  9902. // used to include empty fields in Patch requests.
  9903. ForceSendFields []string `json:"-"`
  9904. // NullFields is a list of field names (e.g. "HealthCheck") to include
  9905. // in API requests with the JSON null value. By default, fields with
  9906. // empty values are omitted from API requests. However, any field with
  9907. // an empty value appearing in NullFields will be sent to the server as
  9908. // null. It is an error if a field in this list has a non-empty value.
  9909. // This may be used to include null fields in Patch requests.
  9910. NullFields []string `json:"-"`
  9911. }
  9912. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  9913. type NoMethod HealthCheckReference
  9914. raw := NoMethod(*s)
  9915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9916. }
  9917. // HealthCheckService: A HealthCheckService defines a set of backends on
  9918. // which to perform periodic health checks and an endpoint to which to
  9919. // send notification of changes in the health status of the backends.
  9920. type HealthCheckService struct {
  9921. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  9922. // format.
  9923. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9924. // Description: An optional description of this resource. Provide this
  9925. // property when you create the resource.
  9926. Description string `json:"description,omitempty"`
  9927. // HealthChecks: List of URLs to the HealthCheck resources. Must have at
  9928. // least one HealthCheck, and not more than 10. HealthCheck resources
  9929. // must have portSpecification=USE_SERVING_PORT. For regional
  9930. // HealthCheckService, the HealthCheck must be regional and in the same
  9931. // region. For global HealthCheckService, HealthCheck must be global.
  9932. // Mix of regional and global HealthChecks is not supported. Multiple
  9933. // regional HealthChecks must belong to the same region. Regional
  9934. // HealthChecks</code? must belong to the same region as zones of NEGs.
  9935. HealthChecks []string `json:"healthChecks,omitempty"`
  9936. // HealthStatusAggregationStrategy: Policy for how the results from
  9937. // multiple health checks for the same endpoint are aggregated.
  9938. // - NO_AGGREGATION. An EndpointHealth message is returned for each
  9939. // backend in the health check service.
  9940. // - AND. If any backend's health check reports UNHEALTHY, then
  9941. // UNHEALTHY is the HealthState of the entire health check service. If
  9942. // all backend's are healthy, the HealthState of the health check
  9943. // service is HEALTHY. .
  9944. //
  9945. // Possible values:
  9946. // "AND"
  9947. // "NO_AGGREGATION"
  9948. HealthStatusAggregationStrategy string `json:"healthStatusAggregationStrategy,omitempty"`
  9949. // Id: [Output Only] The unique identifier for the resource. This
  9950. // identifier is defined by the server.
  9951. Id uint64 `json:"id,omitempty,string"`
  9952. // Kind: [Output only] Type of the resource. Always
  9953. // compute#healthCheckServicefor health check services.
  9954. Kind string `json:"kind,omitempty"`
  9955. // Name: Name of the resource. The name must be 1-63 characters long,
  9956. // and comply with RFC1035. Specifically, the name must be 1-63
  9957. // characters long and match the regular expression
  9958. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  9959. // a lowercase letter, and all following characters must be a dash,
  9960. // lowercase letter, or digit, except the last character, which cannot
  9961. // be a dash.
  9962. Name string `json:"name,omitempty"`
  9963. // NetworkEndpointGroups: List of URLs to the NetworkEndpointGroup
  9964. // resources. Must not have more than 100. For regional
  9965. // HealthCheckService, NEGs must be in zones in the region of the
  9966. // HealthCheckService.
  9967. NetworkEndpointGroups []string `json:"networkEndpointGroups,omitempty"`
  9968. // NotificationEndpoints: List of URLs to the NotificationEndpoint
  9969. // resources. Must not have more than 10. A list of endpoints for
  9970. // receiving notifications of change in health status. For regional
  9971. // HealthCheckService, NotificationEndpoint must be regional and in the
  9972. // same region. For global HealthCheckService, NotificationEndpoint must
  9973. // be global.
  9974. NotificationEndpoints []string `json:"notificationEndpoints,omitempty"`
  9975. // Region: [Output Only] URL of the region where the health check
  9976. // service resides. This field is not applicable to global health check
  9977. // services. You must specify this field as part of the HTTP request
  9978. // URL. It is not settable as a field in the request body.
  9979. Region string `json:"region,omitempty"`
  9980. // SelfLink: [Output Only] Server-defined URL for the resource.
  9981. SelfLink string `json:"selfLink,omitempty"`
  9982. // SelfLinkWithId: [Output Only] Server-defined URL with id for the
  9983. // resource.
  9984. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  9985. // ServerResponse contains the HTTP response code and headers from the
  9986. // server.
  9987. googleapi.ServerResponse `json:"-"`
  9988. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  9989. // to unconditionally include in API requests. By default, fields with
  9990. // empty values are omitted from API requests. However, any non-pointer,
  9991. // non-interface field appearing in ForceSendFields will be sent to the
  9992. // server regardless of whether the field is empty or not. This may be
  9993. // used to include empty fields in Patch requests.
  9994. ForceSendFields []string `json:"-"`
  9995. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  9996. // include in API requests with the JSON null value. By default, fields
  9997. // with empty values are omitted from API requests. However, any field
  9998. // with an empty value appearing in NullFields will be sent to the
  9999. // server as null. It is an error if a field in this list has a
  10000. // non-empty value. This may be used to include null fields in Patch
  10001. // requests.
  10002. NullFields []string `json:"-"`
  10003. }
  10004. func (s *HealthCheckService) MarshalJSON() ([]byte, error) {
  10005. type NoMethod HealthCheckService
  10006. raw := NoMethod(*s)
  10007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10008. }
  10009. type HealthCheckServicesList struct {
  10010. // Id: [Output Only] Unique identifier for the resource; defined by the
  10011. // server.
  10012. Id string `json:"id,omitempty"`
  10013. // Items: A list of HealthCheckService resources.
  10014. Items []*HealthCheckService `json:"items,omitempty"`
  10015. // Kind: [Output Only] Type of the resource. Always
  10016. // compute#healthCheckServicesList for lists of HealthCheckServices.
  10017. Kind string `json:"kind,omitempty"`
  10018. // NextPageToken: [Output Only] This token allows you to get the next
  10019. // page of results for list requests. If the number of results is larger
  10020. // than maxResults, use the nextPageToken as a value for the query
  10021. // parameter pageToken in the next list request. Subsequent list
  10022. // requests will have their own nextPageToken to continue paging through
  10023. // the results.
  10024. NextPageToken string `json:"nextPageToken,omitempty"`
  10025. // SelfLink: [Output Only] Server-defined URL for this resource.
  10026. SelfLink string `json:"selfLink,omitempty"`
  10027. // Warning: [Output Only] Informational warning message.
  10028. Warning *HealthCheckServicesListWarning `json:"warning,omitempty"`
  10029. // ServerResponse contains the HTTP response code and headers from the
  10030. // server.
  10031. googleapi.ServerResponse `json:"-"`
  10032. // ForceSendFields is a list of field names (e.g. "Id") to
  10033. // unconditionally include in API requests. By default, fields with
  10034. // empty values are omitted from API requests. However, any non-pointer,
  10035. // non-interface field appearing in ForceSendFields will be sent to the
  10036. // server regardless of whether the field is empty or not. This may be
  10037. // used to include empty fields in Patch requests.
  10038. ForceSendFields []string `json:"-"`
  10039. // NullFields is a list of field names (e.g. "Id") to include in API
  10040. // requests with the JSON null value. By default, fields with empty
  10041. // values are omitted from API requests. However, any field with an
  10042. // empty value appearing in NullFields will be sent to the server as
  10043. // null. It is an error if a field in this list has a non-empty value.
  10044. // This may be used to include null fields in Patch requests.
  10045. NullFields []string `json:"-"`
  10046. }
  10047. func (s *HealthCheckServicesList) MarshalJSON() ([]byte, error) {
  10048. type NoMethod HealthCheckServicesList
  10049. raw := NoMethod(*s)
  10050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10051. }
  10052. // HealthCheckServicesListWarning: [Output Only] Informational warning
  10053. // message.
  10054. type HealthCheckServicesListWarning struct {
  10055. // Code: [Output Only] A warning code, if applicable. For example,
  10056. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10057. // the response.
  10058. //
  10059. // Possible values:
  10060. // "CLEANUP_FAILED"
  10061. // "DEPRECATED_RESOURCE_USED"
  10062. // "DEPRECATED_TYPE_USED"
  10063. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10064. // "EXPERIMENTAL_TYPE_USED"
  10065. // "EXTERNAL_API_WARNING"
  10066. // "FIELD_VALUE_OVERRIDEN"
  10067. // "INJECTED_KERNELS_DEPRECATED"
  10068. // "MISSING_TYPE_DEPENDENCY"
  10069. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10070. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10071. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10072. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10073. // "NEXT_HOP_NOT_RUNNING"
  10074. // "NOT_CRITICAL_ERROR"
  10075. // "NO_RESULTS_ON_PAGE"
  10076. // "REQUIRED_TOS_AGREEMENT"
  10077. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10078. // "RESOURCE_NOT_DELETED"
  10079. // "SCHEMA_VALIDATION_IGNORED"
  10080. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10081. // "UNDECLARED_PROPERTIES"
  10082. // "UNREACHABLE"
  10083. Code string `json:"code,omitempty"`
  10084. // Data: [Output Only] Metadata about this warning in key: value format.
  10085. // For example:
  10086. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10087. Data []*HealthCheckServicesListWarningData `json:"data,omitempty"`
  10088. // Message: [Output Only] A human-readable description of the warning
  10089. // code.
  10090. Message string `json:"message,omitempty"`
  10091. // ForceSendFields is a list of field names (e.g. "Code") to
  10092. // unconditionally include in API requests. By default, fields with
  10093. // empty values are omitted from API requests. However, any non-pointer,
  10094. // non-interface field appearing in ForceSendFields will be sent to the
  10095. // server regardless of whether the field is empty or not. This may be
  10096. // used to include empty fields in Patch requests.
  10097. ForceSendFields []string `json:"-"`
  10098. // NullFields is a list of field names (e.g. "Code") to include in API
  10099. // requests with the JSON null value. By default, fields with empty
  10100. // values are omitted from API requests. However, any field with an
  10101. // empty value appearing in NullFields will be sent to the server as
  10102. // null. It is an error if a field in this list has a non-empty value.
  10103. // This may be used to include null fields in Patch requests.
  10104. NullFields []string `json:"-"`
  10105. }
  10106. func (s *HealthCheckServicesListWarning) MarshalJSON() ([]byte, error) {
  10107. type NoMethod HealthCheckServicesListWarning
  10108. raw := NoMethod(*s)
  10109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10110. }
  10111. type HealthCheckServicesListWarningData struct {
  10112. // Key: [Output Only] A key that provides more detail on the warning
  10113. // being returned. For example, for warnings where there are no results
  10114. // in a list request for a particular zone, this key might be scope and
  10115. // the key value might be the zone name. Other examples might be a key
  10116. // indicating a deprecated resource and a suggested replacement, or a
  10117. // warning about invalid network settings (for example, if an instance
  10118. // attempts to perform IP forwarding but is not enabled for IP
  10119. // forwarding).
  10120. Key string `json:"key,omitempty"`
  10121. // Value: [Output Only] A warning data value corresponding to the key.
  10122. Value string `json:"value,omitempty"`
  10123. // ForceSendFields is a list of field names (e.g. "Key") to
  10124. // unconditionally include in API requests. By default, fields with
  10125. // empty values are omitted from API requests. However, any non-pointer,
  10126. // non-interface field appearing in ForceSendFields will be sent to the
  10127. // server regardless of whether the field is empty or not. This may be
  10128. // used to include empty fields in Patch requests.
  10129. ForceSendFields []string `json:"-"`
  10130. // NullFields is a list of field names (e.g. "Key") to include in API
  10131. // requests with the JSON null value. By default, fields with empty
  10132. // values are omitted from API requests. However, any field with an
  10133. // empty value appearing in NullFields will be sent to the server as
  10134. // null. It is an error if a field in this list has a non-empty value.
  10135. // This may be used to include null fields in Patch requests.
  10136. NullFields []string `json:"-"`
  10137. }
  10138. func (s *HealthCheckServicesListWarningData) MarshalJSON() ([]byte, error) {
  10139. type NoMethod HealthCheckServicesListWarningData
  10140. raw := NoMethod(*s)
  10141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10142. }
  10143. type HealthChecksAggregatedList struct {
  10144. // Id: [Output Only] Unique identifier for the resource; defined by the
  10145. // server.
  10146. Id string `json:"id,omitempty"`
  10147. // Items: A list of HealthChecksScopedList resources.
  10148. Items map[string]HealthChecksScopedList `json:"items,omitempty"`
  10149. // Kind: Type of resource.
  10150. Kind string `json:"kind,omitempty"`
  10151. // NextPageToken: [Output Only] This token allows you to get the next
  10152. // page of results for list requests. If the number of results is larger
  10153. // than maxResults, use the nextPageToken as a value for the query
  10154. // parameter pageToken in the next list request. Subsequent list
  10155. // requests will have their own nextPageToken to continue paging through
  10156. // the results.
  10157. NextPageToken string `json:"nextPageToken,omitempty"`
  10158. // SelfLink: [Output Only] Server-defined URL for this resource.
  10159. SelfLink string `json:"selfLink,omitempty"`
  10160. // Warning: [Output Only] Informational warning message.
  10161. Warning *HealthChecksAggregatedListWarning `json:"warning,omitempty"`
  10162. // ServerResponse contains the HTTP response code and headers from the
  10163. // server.
  10164. googleapi.ServerResponse `json:"-"`
  10165. // ForceSendFields is a list of field names (e.g. "Id") to
  10166. // unconditionally include in API requests. By default, fields with
  10167. // empty values are omitted from API requests. However, any non-pointer,
  10168. // non-interface field appearing in ForceSendFields will be sent to the
  10169. // server regardless of whether the field is empty or not. This may be
  10170. // used to include empty fields in Patch requests.
  10171. ForceSendFields []string `json:"-"`
  10172. // NullFields is a list of field names (e.g. "Id") to include in API
  10173. // requests with the JSON null value. By default, fields with empty
  10174. // values are omitted from API requests. However, any field with an
  10175. // empty value appearing in NullFields will be sent to the server as
  10176. // null. It is an error if a field in this list has a non-empty value.
  10177. // This may be used to include null fields in Patch requests.
  10178. NullFields []string `json:"-"`
  10179. }
  10180. func (s *HealthChecksAggregatedList) MarshalJSON() ([]byte, error) {
  10181. type NoMethod HealthChecksAggregatedList
  10182. raw := NoMethod(*s)
  10183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10184. }
  10185. // HealthChecksAggregatedListWarning: [Output Only] Informational
  10186. // warning message.
  10187. type HealthChecksAggregatedListWarning struct {
  10188. // Code: [Output Only] A warning code, if applicable. For example,
  10189. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10190. // the response.
  10191. //
  10192. // Possible values:
  10193. // "CLEANUP_FAILED"
  10194. // "DEPRECATED_RESOURCE_USED"
  10195. // "DEPRECATED_TYPE_USED"
  10196. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10197. // "EXPERIMENTAL_TYPE_USED"
  10198. // "EXTERNAL_API_WARNING"
  10199. // "FIELD_VALUE_OVERRIDEN"
  10200. // "INJECTED_KERNELS_DEPRECATED"
  10201. // "MISSING_TYPE_DEPENDENCY"
  10202. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10203. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10204. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10205. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10206. // "NEXT_HOP_NOT_RUNNING"
  10207. // "NOT_CRITICAL_ERROR"
  10208. // "NO_RESULTS_ON_PAGE"
  10209. // "REQUIRED_TOS_AGREEMENT"
  10210. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10211. // "RESOURCE_NOT_DELETED"
  10212. // "SCHEMA_VALIDATION_IGNORED"
  10213. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10214. // "UNDECLARED_PROPERTIES"
  10215. // "UNREACHABLE"
  10216. Code string `json:"code,omitempty"`
  10217. // Data: [Output Only] Metadata about this warning in key: value format.
  10218. // For example:
  10219. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10220. Data []*HealthChecksAggregatedListWarningData `json:"data,omitempty"`
  10221. // Message: [Output Only] A human-readable description of the warning
  10222. // code.
  10223. Message string `json:"message,omitempty"`
  10224. // ForceSendFields is a list of field names (e.g. "Code") to
  10225. // unconditionally include in API requests. By default, fields with
  10226. // empty values are omitted from API requests. However, any non-pointer,
  10227. // non-interface field appearing in ForceSendFields will be sent to the
  10228. // server regardless of whether the field is empty or not. This may be
  10229. // used to include empty fields in Patch requests.
  10230. ForceSendFields []string `json:"-"`
  10231. // NullFields is a list of field names (e.g. "Code") to include in API
  10232. // requests with the JSON null value. By default, fields with empty
  10233. // values are omitted from API requests. However, any field with an
  10234. // empty value appearing in NullFields will be sent to the server as
  10235. // null. It is an error if a field in this list has a non-empty value.
  10236. // This may be used to include null fields in Patch requests.
  10237. NullFields []string `json:"-"`
  10238. }
  10239. func (s *HealthChecksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  10240. type NoMethod HealthChecksAggregatedListWarning
  10241. raw := NoMethod(*s)
  10242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10243. }
  10244. type HealthChecksAggregatedListWarningData struct {
  10245. // Key: [Output Only] A key that provides more detail on the warning
  10246. // being returned. For example, for warnings where there are no results
  10247. // in a list request for a particular zone, this key might be scope and
  10248. // the key value might be the zone name. Other examples might be a key
  10249. // indicating a deprecated resource and a suggested replacement, or a
  10250. // warning about invalid network settings (for example, if an instance
  10251. // attempts to perform IP forwarding but is not enabled for IP
  10252. // forwarding).
  10253. Key string `json:"key,omitempty"`
  10254. // Value: [Output Only] A warning data value corresponding to the key.
  10255. Value string `json:"value,omitempty"`
  10256. // ForceSendFields is a list of field names (e.g. "Key") to
  10257. // unconditionally include in API requests. By default, fields with
  10258. // empty values are omitted from API requests. However, any non-pointer,
  10259. // non-interface field appearing in ForceSendFields will be sent to the
  10260. // server regardless of whether the field is empty or not. This may be
  10261. // used to include empty fields in Patch requests.
  10262. ForceSendFields []string `json:"-"`
  10263. // NullFields is a list of field names (e.g. "Key") to include in API
  10264. // requests with the JSON null value. By default, fields with empty
  10265. // values are omitted from API requests. However, any field with an
  10266. // empty value appearing in NullFields will be sent to the server as
  10267. // null. It is an error if a field in this list has a non-empty value.
  10268. // This may be used to include null fields in Patch requests.
  10269. NullFields []string `json:"-"`
  10270. }
  10271. func (s *HealthChecksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  10272. type NoMethod HealthChecksAggregatedListWarningData
  10273. raw := NoMethod(*s)
  10274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10275. }
  10276. type HealthChecksScopedList struct {
  10277. // HealthChecks: A list of HealthChecks contained in this scope.
  10278. HealthChecks []*HealthCheck `json:"healthChecks,omitempty"`
  10279. // Warning: Informational warning which replaces the list of backend
  10280. // services when the list is empty.
  10281. Warning *HealthChecksScopedListWarning `json:"warning,omitempty"`
  10282. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  10283. // unconditionally include in API requests. By default, fields with
  10284. // empty values are omitted from API requests. However, any non-pointer,
  10285. // non-interface field appearing in ForceSendFields will be sent to the
  10286. // server regardless of whether the field is empty or not. This may be
  10287. // used to include empty fields in Patch requests.
  10288. ForceSendFields []string `json:"-"`
  10289. // NullFields is a list of field names (e.g. "HealthChecks") to include
  10290. // in API requests with the JSON null value. By default, fields with
  10291. // empty values are omitted from API requests. However, any field with
  10292. // an empty value appearing in NullFields will be sent to the server as
  10293. // null. It is an error if a field in this list has a non-empty value.
  10294. // This may be used to include null fields in Patch requests.
  10295. NullFields []string `json:"-"`
  10296. }
  10297. func (s *HealthChecksScopedList) MarshalJSON() ([]byte, error) {
  10298. type NoMethod HealthChecksScopedList
  10299. raw := NoMethod(*s)
  10300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10301. }
  10302. // HealthChecksScopedListWarning: Informational warning which replaces
  10303. // the list of backend services when the list is empty.
  10304. type HealthChecksScopedListWarning struct {
  10305. // Code: [Output Only] A warning code, if applicable. For example,
  10306. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10307. // the response.
  10308. //
  10309. // Possible values:
  10310. // "CLEANUP_FAILED"
  10311. // "DEPRECATED_RESOURCE_USED"
  10312. // "DEPRECATED_TYPE_USED"
  10313. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10314. // "EXPERIMENTAL_TYPE_USED"
  10315. // "EXTERNAL_API_WARNING"
  10316. // "FIELD_VALUE_OVERRIDEN"
  10317. // "INJECTED_KERNELS_DEPRECATED"
  10318. // "MISSING_TYPE_DEPENDENCY"
  10319. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10320. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10321. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10322. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10323. // "NEXT_HOP_NOT_RUNNING"
  10324. // "NOT_CRITICAL_ERROR"
  10325. // "NO_RESULTS_ON_PAGE"
  10326. // "REQUIRED_TOS_AGREEMENT"
  10327. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10328. // "RESOURCE_NOT_DELETED"
  10329. // "SCHEMA_VALIDATION_IGNORED"
  10330. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10331. // "UNDECLARED_PROPERTIES"
  10332. // "UNREACHABLE"
  10333. Code string `json:"code,omitempty"`
  10334. // Data: [Output Only] Metadata about this warning in key: value format.
  10335. // For example:
  10336. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10337. Data []*HealthChecksScopedListWarningData `json:"data,omitempty"`
  10338. // Message: [Output Only] A human-readable description of the warning
  10339. // code.
  10340. Message string `json:"message,omitempty"`
  10341. // ForceSendFields is a list of field names (e.g. "Code") to
  10342. // unconditionally include in API requests. By default, fields with
  10343. // empty values are omitted from API requests. However, any non-pointer,
  10344. // non-interface field appearing in ForceSendFields will be sent to the
  10345. // server regardless of whether the field is empty or not. This may be
  10346. // used to include empty fields in Patch requests.
  10347. ForceSendFields []string `json:"-"`
  10348. // NullFields is a list of field names (e.g. "Code") to include in API
  10349. // requests with the JSON null value. By default, fields with empty
  10350. // values are omitted from API requests. However, any field with an
  10351. // empty value appearing in NullFields will be sent to the server as
  10352. // null. It is an error if a field in this list has a non-empty value.
  10353. // This may be used to include null fields in Patch requests.
  10354. NullFields []string `json:"-"`
  10355. }
  10356. func (s *HealthChecksScopedListWarning) MarshalJSON() ([]byte, error) {
  10357. type NoMethod HealthChecksScopedListWarning
  10358. raw := NoMethod(*s)
  10359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10360. }
  10361. type HealthChecksScopedListWarningData struct {
  10362. // Key: [Output Only] A key that provides more detail on the warning
  10363. // being returned. For example, for warnings where there are no results
  10364. // in a list request for a particular zone, this key might be scope and
  10365. // the key value might be the zone name. Other examples might be a key
  10366. // indicating a deprecated resource and a suggested replacement, or a
  10367. // warning about invalid network settings (for example, if an instance
  10368. // attempts to perform IP forwarding but is not enabled for IP
  10369. // forwarding).
  10370. Key string `json:"key,omitempty"`
  10371. // Value: [Output Only] A warning data value corresponding to the key.
  10372. Value string `json:"value,omitempty"`
  10373. // ForceSendFields is a list of field names (e.g. "Key") to
  10374. // unconditionally include in API requests. By default, fields with
  10375. // empty values are omitted from API requests. However, any non-pointer,
  10376. // non-interface field appearing in ForceSendFields will be sent to the
  10377. // server regardless of whether the field is empty or not. This may be
  10378. // used to include empty fields in Patch requests.
  10379. ForceSendFields []string `json:"-"`
  10380. // NullFields is a list of field names (e.g. "Key") to include in API
  10381. // requests with the JSON null value. By default, fields with empty
  10382. // values are omitted from API requests. However, any field with an
  10383. // empty value appearing in NullFields will be sent to the server as
  10384. // null. It is an error if a field in this list has a non-empty value.
  10385. // This may be used to include null fields in Patch requests.
  10386. NullFields []string `json:"-"`
  10387. }
  10388. func (s *HealthChecksScopedListWarningData) MarshalJSON() ([]byte, error) {
  10389. type NoMethod HealthChecksScopedListWarningData
  10390. raw := NoMethod(*s)
  10391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10392. }
  10393. type HealthStatus struct {
  10394. // Annotations: Metadata defined as annotations for network endpoint.
  10395. Annotations map[string]string `json:"annotations,omitempty"`
  10396. // HealthState: Health state of the instance.
  10397. //
  10398. // Possible values:
  10399. // "HEALTHY"
  10400. // "UNHEALTHY"
  10401. HealthState string `json:"healthState,omitempty"`
  10402. // Instance: URL of the instance resource.
  10403. Instance string `json:"instance,omitempty"`
  10404. // IpAddress: The IP address represented by this resource.
  10405. IpAddress string `json:"ipAddress,omitempty"`
  10406. // Port: The port on the instance.
  10407. Port int64 `json:"port,omitempty"`
  10408. // ForceSendFields is a list of field names (e.g. "Annotations") to
  10409. // unconditionally include in API requests. By default, fields with
  10410. // empty values are omitted from API requests. However, any non-pointer,
  10411. // non-interface field appearing in ForceSendFields will be sent to the
  10412. // server regardless of whether the field is empty or not. This may be
  10413. // used to include empty fields in Patch requests.
  10414. ForceSendFields []string `json:"-"`
  10415. // NullFields is a list of field names (e.g. "Annotations") to include
  10416. // in API requests with the JSON null value. By default, fields with
  10417. // empty values are omitted from API requests. However, any field with
  10418. // an empty value appearing in NullFields will be sent to the server as
  10419. // null. It is an error if a field in this list has a non-empty value.
  10420. // This may be used to include null fields in Patch requests.
  10421. NullFields []string `json:"-"`
  10422. }
  10423. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  10424. type NoMethod HealthStatus
  10425. raw := NoMethod(*s)
  10426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10427. }
  10428. type HealthStatusForNetworkEndpoint struct {
  10429. // BackendService: URL of the backend service associated with the health
  10430. // state of the network endpoint.
  10431. BackendService *BackendServiceReference `json:"backendService,omitempty"`
  10432. // ForwardingRule: URL of the forwarding rule associated with the health
  10433. // state of the network endpoint.
  10434. ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
  10435. // HealthCheck: URL of the health check associated with the health state
  10436. // of the network endpoint.
  10437. HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
  10438. // HealthState: Health state of the network endpoint determined based on
  10439. // the health checks configured.
  10440. //
  10441. // Possible values:
  10442. // "DRAINING"
  10443. // "HEALTHY"
  10444. // "UNHEALTHY"
  10445. // "UNKNOWN"
  10446. HealthState string `json:"healthState,omitempty"`
  10447. // ForceSendFields is a list of field names (e.g. "BackendService") to
  10448. // unconditionally include in API requests. By default, fields with
  10449. // empty values are omitted from API requests. However, any non-pointer,
  10450. // non-interface field appearing in ForceSendFields will be sent to the
  10451. // server regardless of whether the field is empty or not. This may be
  10452. // used to include empty fields in Patch requests.
  10453. ForceSendFields []string `json:"-"`
  10454. // NullFields is a list of field names (e.g. "BackendService") to
  10455. // include in API requests with the JSON null value. By default, fields
  10456. // with empty values are omitted from API requests. However, any field
  10457. // with an empty value appearing in NullFields will be sent to the
  10458. // server as null. It is an error if a field in this list has a
  10459. // non-empty value. This may be used to include null fields in Patch
  10460. // requests.
  10461. NullFields []string `json:"-"`
  10462. }
  10463. func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
  10464. type NoMethod HealthStatusForNetworkEndpoint
  10465. raw := NoMethod(*s)
  10466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10467. }
  10468. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  10469. // use the named PathMatcher to select the BackendService.
  10470. type HostRule struct {
  10471. // Description: An optional description of this resource. Provide this
  10472. // property when you create the resource.
  10473. Description string `json:"description,omitempty"`
  10474. // Hosts: The list of host patterns to match. They must be valid
  10475. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  10476. // case, * must be the first character and must be followed in the
  10477. // pattern by either - or ..
  10478. Hosts []string `json:"hosts,omitempty"`
  10479. // PathMatcher: The name of the PathMatcher to use to match the path
  10480. // portion of the URL if the hostRule matches the URL's host portion.
  10481. PathMatcher string `json:"pathMatcher,omitempty"`
  10482. // ForceSendFields is a list of field names (e.g. "Description") to
  10483. // unconditionally include in API requests. By default, fields with
  10484. // empty values are omitted from API requests. However, any non-pointer,
  10485. // non-interface field appearing in ForceSendFields will be sent to the
  10486. // server regardless of whether the field is empty or not. This may be
  10487. // used to include empty fields in Patch requests.
  10488. ForceSendFields []string `json:"-"`
  10489. // NullFields is a list of field names (e.g. "Description") to include
  10490. // in API requests with the JSON null value. By default, fields with
  10491. // empty values are omitted from API requests. However, any field with
  10492. // an empty value appearing in NullFields will be sent to the server as
  10493. // null. It is an error if a field in this list has a non-empty value.
  10494. // This may be used to include null fields in Patch requests.
  10495. NullFields []string `json:"-"`
  10496. }
  10497. func (s *HostRule) MarshalJSON() ([]byte, error) {
  10498. type NoMethod HostRule
  10499. raw := NoMethod(*s)
  10500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10501. }
  10502. // HttpFaultAbort: Specification for how requests are aborted as part of
  10503. // fault injection.
  10504. type HttpFaultAbort struct {
  10505. // HttpStatus: The HTTP status code used to abort the request.
  10506. // The value must be between 200 and 599 inclusive.
  10507. HttpStatus int64 `json:"httpStatus,omitempty"`
  10508. // Percentage: The percentage of traffic
  10509. // (connections/operations/requests) which will be aborted as part of
  10510. // fault injection.
  10511. // The value must be between 0.0 and 100.0 inclusive.
  10512. Percentage float64 `json:"percentage,omitempty"`
  10513. // ForceSendFields is a list of field names (e.g. "HttpStatus") to
  10514. // unconditionally include in API requests. By default, fields with
  10515. // empty values are omitted from API requests. However, any non-pointer,
  10516. // non-interface field appearing in ForceSendFields will be sent to the
  10517. // server regardless of whether the field is empty or not. This may be
  10518. // used to include empty fields in Patch requests.
  10519. ForceSendFields []string `json:"-"`
  10520. // NullFields is a list of field names (e.g. "HttpStatus") to include in
  10521. // API requests with the JSON null value. By default, fields with empty
  10522. // values are omitted from API requests. However, any field with an
  10523. // empty value appearing in NullFields will be sent to the server as
  10524. // null. It is an error if a field in this list has a non-empty value.
  10525. // This may be used to include null fields in Patch requests.
  10526. NullFields []string `json:"-"`
  10527. }
  10528. func (s *HttpFaultAbort) MarshalJSON() ([]byte, error) {
  10529. type NoMethod HttpFaultAbort
  10530. raw := NoMethod(*s)
  10531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10532. }
  10533. func (s *HttpFaultAbort) UnmarshalJSON(data []byte) error {
  10534. type NoMethod HttpFaultAbort
  10535. var s1 struct {
  10536. Percentage gensupport.JSONFloat64 `json:"percentage"`
  10537. *NoMethod
  10538. }
  10539. s1.NoMethod = (*NoMethod)(s)
  10540. if err := json.Unmarshal(data, &s1); err != nil {
  10541. return err
  10542. }
  10543. s.Percentage = float64(s1.Percentage)
  10544. return nil
  10545. }
  10546. // HttpFaultDelay: Specifies the delay introduced by Loadbalancer before
  10547. // forwarding the request to the backend service as part of fault
  10548. // injection.
  10549. type HttpFaultDelay struct {
  10550. // FixedDelay: Specifies the value of the fixed delay interval.
  10551. FixedDelay *Duration `json:"fixedDelay,omitempty"`
  10552. // Percentage: The percentage of traffic
  10553. // (connections/operations/requests) on which delay will be introduced
  10554. // as part of fault injection.
  10555. // The value must be between 0.0 and 100.0 inclusive.
  10556. Percentage float64 `json:"percentage,omitempty"`
  10557. // ForceSendFields is a list of field names (e.g. "FixedDelay") to
  10558. // unconditionally include in API requests. By default, fields with
  10559. // empty values are omitted from API requests. However, any non-pointer,
  10560. // non-interface field appearing in ForceSendFields will be sent to the
  10561. // server regardless of whether the field is empty or not. This may be
  10562. // used to include empty fields in Patch requests.
  10563. ForceSendFields []string `json:"-"`
  10564. // NullFields is a list of field names (e.g. "FixedDelay") to include in
  10565. // API requests with the JSON null value. By default, fields with empty
  10566. // values are omitted from API requests. However, any field with an
  10567. // empty value appearing in NullFields will be sent to the server as
  10568. // null. It is an error if a field in this list has a non-empty value.
  10569. // This may be used to include null fields in Patch requests.
  10570. NullFields []string `json:"-"`
  10571. }
  10572. func (s *HttpFaultDelay) MarshalJSON() ([]byte, error) {
  10573. type NoMethod HttpFaultDelay
  10574. raw := NoMethod(*s)
  10575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10576. }
  10577. func (s *HttpFaultDelay) UnmarshalJSON(data []byte) error {
  10578. type NoMethod HttpFaultDelay
  10579. var s1 struct {
  10580. Percentage gensupport.JSONFloat64 `json:"percentage"`
  10581. *NoMethod
  10582. }
  10583. s1.NoMethod = (*NoMethod)(s)
  10584. if err := json.Unmarshal(data, &s1); err != nil {
  10585. return err
  10586. }
  10587. s.Percentage = float64(s1.Percentage)
  10588. return nil
  10589. }
  10590. // HttpFaultInjection: The specification for fault injection introduced
  10591. // into traffic to test the resiliency of clients to backend service
  10592. // failure. As part of fault injection, when clients send requests to a
  10593. // backend service, delays can be introduced by Loadbalancer on a
  10594. // percentage of requests before sending those request to the backend
  10595. // service. Similarly requests from clients can be aborted by the
  10596. // Loadbalancer for a percentage of requests.
  10597. type HttpFaultInjection struct {
  10598. // Abort: The specification for how client requests are aborted as part
  10599. // of fault injection.
  10600. Abort *HttpFaultAbort `json:"abort,omitempty"`
  10601. // Delay: The specification for how client requests are delayed as part
  10602. // of fault injection, before being sent to a backend service.
  10603. Delay *HttpFaultDelay `json:"delay,omitempty"`
  10604. // ForceSendFields is a list of field names (e.g. "Abort") to
  10605. // unconditionally include in API requests. By default, fields with
  10606. // empty values are omitted from API requests. However, any non-pointer,
  10607. // non-interface field appearing in ForceSendFields will be sent to the
  10608. // server regardless of whether the field is empty or not. This may be
  10609. // used to include empty fields in Patch requests.
  10610. ForceSendFields []string `json:"-"`
  10611. // NullFields is a list of field names (e.g. "Abort") to include in API
  10612. // requests with the JSON null value. By default, fields with empty
  10613. // values are omitted from API requests. However, any field with an
  10614. // empty value appearing in NullFields will be sent to the server as
  10615. // null. It is an error if a field in this list has a non-empty value.
  10616. // This may be used to include null fields in Patch requests.
  10617. NullFields []string `json:"-"`
  10618. }
  10619. func (s *HttpFaultInjection) MarshalJSON() ([]byte, error) {
  10620. type NoMethod HttpFaultInjection
  10621. raw := NoMethod(*s)
  10622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10623. }
  10624. // HttpHeaderAction: The request and response header transformations
  10625. // that take effect before the request is passed along to the selected
  10626. // backendService.
  10627. type HttpHeaderAction struct {
  10628. // RequestHeadersToAdd: Headers to add to a matching request prior to
  10629. // forwarding the request to the backendService.
  10630. RequestHeadersToAdd []*HttpHeaderOption `json:"requestHeadersToAdd,omitempty"`
  10631. // RequestHeadersToRemove: A list of header names for headers that need
  10632. // to be removed from the request prior to forwarding the request to the
  10633. // backendService.
  10634. RequestHeadersToRemove []string `json:"requestHeadersToRemove,omitempty"`
  10635. // ResponseHeadersToAdd: Headers to add the response prior to sending
  10636. // the response back to the client.
  10637. ResponseHeadersToAdd []*HttpHeaderOption `json:"responseHeadersToAdd,omitempty"`
  10638. // ResponseHeadersToRemove: A list of header names for headers that need
  10639. // to be removed from the response prior to sending the response back to
  10640. // the client.
  10641. ResponseHeadersToRemove []string `json:"responseHeadersToRemove,omitempty"`
  10642. // ForceSendFields is a list of field names (e.g. "RequestHeadersToAdd")
  10643. // to unconditionally include in API requests. By default, fields with
  10644. // empty values are omitted from API requests. However, any non-pointer,
  10645. // non-interface field appearing in ForceSendFields will be sent to the
  10646. // server regardless of whether the field is empty or not. This may be
  10647. // used to include empty fields in Patch requests.
  10648. ForceSendFields []string `json:"-"`
  10649. // NullFields is a list of field names (e.g. "RequestHeadersToAdd") to
  10650. // include in API requests with the JSON null value. By default, fields
  10651. // with empty values are omitted from API requests. However, any field
  10652. // with an empty value appearing in NullFields will be sent to the
  10653. // server as null. It is an error if a field in this list has a
  10654. // non-empty value. This may be used to include null fields in Patch
  10655. // requests.
  10656. NullFields []string `json:"-"`
  10657. }
  10658. func (s *HttpHeaderAction) MarshalJSON() ([]byte, error) {
  10659. type NoMethod HttpHeaderAction
  10660. raw := NoMethod(*s)
  10661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10662. }
  10663. // HttpHeaderMatch: matchRule criteria for request header matches.
  10664. type HttpHeaderMatch struct {
  10665. // ExactMatch: The value should exactly match contents of
  10666. // exactMatch.
  10667. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10668. // presentMatch or rangeMatch must be set.
  10669. ExactMatch string `json:"exactMatch,omitempty"`
  10670. // HeaderName: The name of the HTTP header to match.
  10671. // For matching against the HTTP request's authority, use a headerMatch
  10672. // with the header name ":authority".
  10673. // For matching a request's method, use the headerName ":method".
  10674. HeaderName string `json:"headerName,omitempty"`
  10675. // InvertMatch: If set to false, the headerMatch is considered a match
  10676. // if the match criteria above are met. If set to true, the headerMatch
  10677. // is considered a match if the match criteria above are NOT met.
  10678. // The default setting is false.
  10679. InvertMatch bool `json:"invertMatch,omitempty"`
  10680. // PrefixMatch: The value of the header must start with the contents of
  10681. // prefixMatch.
  10682. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10683. // presentMatch or rangeMatch must be set.
  10684. PrefixMatch string `json:"prefixMatch,omitempty"`
  10685. // PresentMatch: A header with the contents of headerName must exist.
  10686. // The match takes place whether or not the request's header has a value
  10687. // or not.
  10688. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10689. // presentMatch or rangeMatch must be set.
  10690. PresentMatch bool `json:"presentMatch,omitempty"`
  10691. // RangeMatch: The header value must be an integer and its value must be
  10692. // in the range specified in rangeMatch. If the header does not contain
  10693. // an integer, number or is empty, the match fails.
  10694. // For example for a range [-5, 0]
  10695. // - -3 will match.
  10696. // - 0 will not match.
  10697. // - 0.25 will not match.
  10698. // - -3someString will not match.
  10699. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10700. // presentMatch or rangeMatch must be set.
  10701. RangeMatch *Int64RangeMatch `json:"rangeMatch,omitempty"`
  10702. // RegexMatch: The value of the header must match the regualar
  10703. // expression specified in regexMatch. For regular expression grammar,
  10704. // please see: en.cppreference.com/w/cpp/regex/ecmascript
  10705. // For matching against a port specified in the HTTP request, use a
  10706. // headerMatch with headerName set to PORT and a regular expression that
  10707. // satisfies the RFC2616 Host header's port specifier.
  10708. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10709. // presentMatch or rangeMatch must be set.
  10710. RegexMatch string `json:"regexMatch,omitempty"`
  10711. // SuffixMatch: The value of the header must end with the contents of
  10712. // suffixMatch.
  10713. // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch,
  10714. // presentMatch or rangeMatch must be set.
  10715. SuffixMatch string `json:"suffixMatch,omitempty"`
  10716. // ForceSendFields is a list of field names (e.g. "ExactMatch") to
  10717. // unconditionally include in API requests. By default, fields with
  10718. // empty values are omitted from API requests. However, any non-pointer,
  10719. // non-interface field appearing in ForceSendFields will be sent to the
  10720. // server regardless of whether the field is empty or not. This may be
  10721. // used to include empty fields in Patch requests.
  10722. ForceSendFields []string `json:"-"`
  10723. // NullFields is a list of field names (e.g. "ExactMatch") to include in
  10724. // API requests with the JSON null value. By default, fields with empty
  10725. // values are omitted from API requests. However, any field with an
  10726. // empty value appearing in NullFields will be sent to the server as
  10727. // null. It is an error if a field in this list has a non-empty value.
  10728. // This may be used to include null fields in Patch requests.
  10729. NullFields []string `json:"-"`
  10730. }
  10731. func (s *HttpHeaderMatch) MarshalJSON() ([]byte, error) {
  10732. type NoMethod HttpHeaderMatch
  10733. raw := NoMethod(*s)
  10734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10735. }
  10736. // HttpHeaderOption: Specification determining how headers are added to
  10737. // requests or responses.
  10738. type HttpHeaderOption struct {
  10739. // HeaderName: The name of the header.
  10740. HeaderName string `json:"headerName,omitempty"`
  10741. // HeaderValue: The value of the header to add.
  10742. HeaderValue string `json:"headerValue,omitempty"`
  10743. // Replace: If false, headerValue is appended to any values that already
  10744. // exist for the header. If true, headerValue is set for the header,
  10745. // discarding any values that were set for that header.
  10746. // The default value is false.
  10747. Replace bool `json:"replace,omitempty"`
  10748. // ForceSendFields is a list of field names (e.g. "HeaderName") to
  10749. // unconditionally include in API requests. By default, fields with
  10750. // empty values are omitted from API requests. However, any non-pointer,
  10751. // non-interface field appearing in ForceSendFields will be sent to the
  10752. // server regardless of whether the field is empty or not. This may be
  10753. // used to include empty fields in Patch requests.
  10754. ForceSendFields []string `json:"-"`
  10755. // NullFields is a list of field names (e.g. "HeaderName") to include in
  10756. // API requests with the JSON null value. By default, fields with empty
  10757. // values are omitted from API requests. However, any field with an
  10758. // empty value appearing in NullFields will be sent to the server as
  10759. // null. It is an error if a field in this list has a non-empty value.
  10760. // This may be used to include null fields in Patch requests.
  10761. NullFields []string `json:"-"`
  10762. }
  10763. func (s *HttpHeaderOption) MarshalJSON() ([]byte, error) {
  10764. type NoMethod HttpHeaderOption
  10765. raw := NoMethod(*s)
  10766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10767. }
  10768. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  10769. // template for how individual instances should be checked for health,
  10770. // via HTTP.
  10771. type HttpHealthCheck struct {
  10772. // CheckIntervalSec: How often (in seconds) to send a health check. The
  10773. // default value is 5 seconds.
  10774. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  10775. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  10776. // format.
  10777. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10778. // Description: An optional description of this resource. Provide this
  10779. // property when you create the resource.
  10780. Description string `json:"description,omitempty"`
  10781. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  10782. // after this many consecutive successes. The default value is 2.
  10783. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  10784. // Host: The value of the host header in the HTTP health check request.
  10785. // If left empty (default value), the public IP on behalf of which this
  10786. // health check is performed will be used.
  10787. Host string `json:"host,omitempty"`
  10788. // Id: [Output Only] The unique identifier for the resource. This
  10789. // identifier is defined by the server.
  10790. Id uint64 `json:"id,omitempty,string"`
  10791. // Kind: [Output Only] Type of the resource. Always
  10792. // compute#httpHealthCheck for HTTP health checks.
  10793. Kind string `json:"kind,omitempty"`
  10794. // Name: Name of the resource. Provided by the client when the resource
  10795. // is created. The name must be 1-63 characters long, and comply with
  10796. // RFC1035. Specifically, the name must be 1-63 characters long and
  10797. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10798. // the first character must be a lowercase letter, and all following
  10799. // characters must be a dash, lowercase letter, or digit, except the
  10800. // last character, which cannot be a dash.
  10801. Name string `json:"name,omitempty"`
  10802. // Port: The TCP port number for the HTTP health check request. The
  10803. // default value is 80.
  10804. Port int64 `json:"port,omitempty"`
  10805. // RequestPath: The request path of the HTTP health check request. The
  10806. // default value is /.
  10807. RequestPath string `json:"requestPath,omitempty"`
  10808. // SelfLink: [Output Only] Server-defined URL for the resource.
  10809. SelfLink string `json:"selfLink,omitempty"`
  10810. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  10811. // with the resource id.
  10812. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  10813. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  10814. // The default value is 5 seconds. It is invalid for timeoutSec to have
  10815. // greater value than checkIntervalSec.
  10816. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  10817. // UnhealthyThreshold: A so-far healthy instance will be marked
  10818. // unhealthy after this many consecutive failures. The default value is
  10819. // 2.
  10820. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  10821. // ServerResponse contains the HTTP response code and headers from the
  10822. // server.
  10823. googleapi.ServerResponse `json:"-"`
  10824. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  10825. // unconditionally include in API requests. By default, fields with
  10826. // empty values are omitted from API requests. However, any non-pointer,
  10827. // non-interface field appearing in ForceSendFields will be sent to the
  10828. // server regardless of whether the field is empty or not. This may be
  10829. // used to include empty fields in Patch requests.
  10830. ForceSendFields []string `json:"-"`
  10831. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  10832. // include in API requests with the JSON null value. By default, fields
  10833. // with empty values are omitted from API requests. However, any field
  10834. // with an empty value appearing in NullFields will be sent to the
  10835. // server as null. It is an error if a field in this list has a
  10836. // non-empty value. This may be used to include null fields in Patch
  10837. // requests.
  10838. NullFields []string `json:"-"`
  10839. }
  10840. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  10841. type NoMethod HttpHealthCheck
  10842. raw := NoMethod(*s)
  10843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10844. }
  10845. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  10846. type HttpHealthCheckList struct {
  10847. // Id: [Output Only] Unique identifier for the resource; defined by the
  10848. // server.
  10849. Id string `json:"id,omitempty"`
  10850. // Items: A list of HttpHealthCheck resources.
  10851. Items []*HttpHealthCheck `json:"items,omitempty"`
  10852. // Kind: Type of resource.
  10853. Kind string `json:"kind,omitempty"`
  10854. // NextPageToken: [Output Only] This token allows you to get the next
  10855. // page of results for list requests. If the number of results is larger
  10856. // than maxResults, use the nextPageToken as a value for the query
  10857. // parameter pageToken in the next list request. Subsequent list
  10858. // requests will have their own nextPageToken to continue paging through
  10859. // the results.
  10860. NextPageToken string `json:"nextPageToken,omitempty"`
  10861. // SelfLink: [Output Only] Server-defined URL for this resource.
  10862. SelfLink string `json:"selfLink,omitempty"`
  10863. // Warning: [Output Only] Informational warning message.
  10864. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  10865. // ServerResponse contains the HTTP response code and headers from the
  10866. // server.
  10867. googleapi.ServerResponse `json:"-"`
  10868. // ForceSendFields is a list of field names (e.g. "Id") to
  10869. // unconditionally include in API requests. By default, fields with
  10870. // empty values are omitted from API requests. However, any non-pointer,
  10871. // non-interface field appearing in ForceSendFields will be sent to the
  10872. // server regardless of whether the field is empty or not. This may be
  10873. // used to include empty fields in Patch requests.
  10874. ForceSendFields []string `json:"-"`
  10875. // NullFields is a list of field names (e.g. "Id") to include in API
  10876. // requests with the JSON null value. By default, fields with empty
  10877. // values are omitted from API requests. However, any field with an
  10878. // empty value appearing in NullFields will be sent to the server as
  10879. // null. It is an error if a field in this list has a non-empty value.
  10880. // This may be used to include null fields in Patch requests.
  10881. NullFields []string `json:"-"`
  10882. }
  10883. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  10884. type NoMethod HttpHealthCheckList
  10885. raw := NoMethod(*s)
  10886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10887. }
  10888. // HttpHealthCheckListWarning: [Output Only] Informational warning
  10889. // message.
  10890. type HttpHealthCheckListWarning struct {
  10891. // Code: [Output Only] A warning code, if applicable. For example,
  10892. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10893. // the response.
  10894. //
  10895. // Possible values:
  10896. // "CLEANUP_FAILED"
  10897. // "DEPRECATED_RESOURCE_USED"
  10898. // "DEPRECATED_TYPE_USED"
  10899. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10900. // "EXPERIMENTAL_TYPE_USED"
  10901. // "EXTERNAL_API_WARNING"
  10902. // "FIELD_VALUE_OVERRIDEN"
  10903. // "INJECTED_KERNELS_DEPRECATED"
  10904. // "MISSING_TYPE_DEPENDENCY"
  10905. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10906. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10907. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10908. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10909. // "NEXT_HOP_NOT_RUNNING"
  10910. // "NOT_CRITICAL_ERROR"
  10911. // "NO_RESULTS_ON_PAGE"
  10912. // "REQUIRED_TOS_AGREEMENT"
  10913. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10914. // "RESOURCE_NOT_DELETED"
  10915. // "SCHEMA_VALIDATION_IGNORED"
  10916. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10917. // "UNDECLARED_PROPERTIES"
  10918. // "UNREACHABLE"
  10919. Code string `json:"code,omitempty"`
  10920. // Data: [Output Only] Metadata about this warning in key: value format.
  10921. // For example:
  10922. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10923. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  10924. // Message: [Output Only] A human-readable description of the warning
  10925. // code.
  10926. Message string `json:"message,omitempty"`
  10927. // ForceSendFields is a list of field names (e.g. "Code") to
  10928. // unconditionally include in API requests. By default, fields with
  10929. // empty values are omitted from API requests. However, any non-pointer,
  10930. // non-interface field appearing in ForceSendFields will be sent to the
  10931. // server regardless of whether the field is empty or not. This may be
  10932. // used to include empty fields in Patch requests.
  10933. ForceSendFields []string `json:"-"`
  10934. // NullFields is a list of field names (e.g. "Code") to include in API
  10935. // requests with the JSON null value. By default, fields with empty
  10936. // values are omitted from API requests. However, any field with an
  10937. // empty value appearing in NullFields will be sent to the server as
  10938. // null. It is an error if a field in this list has a non-empty value.
  10939. // This may be used to include null fields in Patch requests.
  10940. NullFields []string `json:"-"`
  10941. }
  10942. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  10943. type NoMethod HttpHealthCheckListWarning
  10944. raw := NoMethod(*s)
  10945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10946. }
  10947. type HttpHealthCheckListWarningData struct {
  10948. // Key: [Output Only] A key that provides more detail on the warning
  10949. // being returned. For example, for warnings where there are no results
  10950. // in a list request for a particular zone, this key might be scope and
  10951. // the key value might be the zone name. Other examples might be a key
  10952. // indicating a deprecated resource and a suggested replacement, or a
  10953. // warning about invalid network settings (for example, if an instance
  10954. // attempts to perform IP forwarding but is not enabled for IP
  10955. // forwarding).
  10956. Key string `json:"key,omitempty"`
  10957. // Value: [Output Only] A warning data value corresponding to the key.
  10958. Value string `json:"value,omitempty"`
  10959. // ForceSendFields is a list of field names (e.g. "Key") to
  10960. // unconditionally include in API requests. By default, fields with
  10961. // empty values are omitted from API requests. However, any non-pointer,
  10962. // non-interface field appearing in ForceSendFields will be sent to the
  10963. // server regardless of whether the field is empty or not. This may be
  10964. // used to include empty fields in Patch requests.
  10965. ForceSendFields []string `json:"-"`
  10966. // NullFields is a list of field names (e.g. "Key") to include in API
  10967. // requests with the JSON null value. By default, fields with empty
  10968. // values are omitted from API requests. However, any field with an
  10969. // empty value appearing in NullFields will be sent to the server as
  10970. // null. It is an error if a field in this list has a non-empty value.
  10971. // This may be used to include null fields in Patch requests.
  10972. NullFields []string `json:"-"`
  10973. }
  10974. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  10975. type NoMethod HttpHealthCheckListWarningData
  10976. raw := NoMethod(*s)
  10977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10978. }
  10979. // HttpQueryParameterMatch: HttpRouteRuleMatch criteria for a request's
  10980. // query parameter.
  10981. type HttpQueryParameterMatch struct {
  10982. // ExactMatch: The queryParameterMatch matches if the value of the
  10983. // parameter exactly matches the contents of exactMatch.
  10984. // Only one of presentMatch, exactMatch and regexMatch must be set.
  10985. ExactMatch string `json:"exactMatch,omitempty"`
  10986. // Name: The name of the query parameter to match. The query parameter
  10987. // must exist in the request, in the absence of which the request match
  10988. // fails.
  10989. Name string `json:"name,omitempty"`
  10990. // PresentMatch: Specifies that the queryParameterMatch matches if the
  10991. // request contains the query parameter, irrespective of whether the
  10992. // parameter has a value or not.
  10993. // Only one of presentMatch, exactMatch and regexMatch must be set.
  10994. PresentMatch bool `json:"presentMatch,omitempty"`
  10995. // RegexMatch: The queryParameterMatch matches if the value of the
  10996. // parameter matches the regular expression specified by regexMatch. For
  10997. // the regular expression grammar, please see
  10998. // en.cppreference.com/w/cpp/regex/ecmascript
  10999. // Only one of presentMatch, exactMatch and regexMatch must be set.
  11000. RegexMatch string `json:"regexMatch,omitempty"`
  11001. // ForceSendFields is a list of field names (e.g. "ExactMatch") to
  11002. // unconditionally include in API requests. By default, fields with
  11003. // empty values are omitted from API requests. However, any non-pointer,
  11004. // non-interface field appearing in ForceSendFields will be sent to the
  11005. // server regardless of whether the field is empty or not. This may be
  11006. // used to include empty fields in Patch requests.
  11007. ForceSendFields []string `json:"-"`
  11008. // NullFields is a list of field names (e.g. "ExactMatch") to include in
  11009. // API requests with the JSON null value. By default, fields with empty
  11010. // values are omitted from API requests. However, any field with an
  11011. // empty value appearing in NullFields will be sent to the server as
  11012. // null. It is an error if a field in this list has a non-empty value.
  11013. // This may be used to include null fields in Patch requests.
  11014. NullFields []string `json:"-"`
  11015. }
  11016. func (s *HttpQueryParameterMatch) MarshalJSON() ([]byte, error) {
  11017. type NoMethod HttpQueryParameterMatch
  11018. raw := NoMethod(*s)
  11019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11020. }
  11021. // HttpRedirectAction: Specifies settings for an HTTP redirect.
  11022. type HttpRedirectAction struct {
  11023. // HostRedirect: The host that will be used in the redirect response
  11024. // instead of the one that was supplied in the request.
  11025. // The value must be between 1 and 255 characters.
  11026. HostRedirect string `json:"hostRedirect,omitempty"`
  11027. // HttpsRedirect: If set to true, the URL scheme in the redirected
  11028. // request is set to https. If set to false, the URL scheme of the
  11029. // redirected request will remain the same as that of the request.
  11030. // This must only be set for UrlMaps used in TargetHttpProxys. Setting
  11031. // this true for TargetHttpsProxy is not permitted.
  11032. // The default is set to false.
  11033. HttpsRedirect bool `json:"httpsRedirect,omitempty"`
  11034. // PathRedirect: The path that will be used in the redirect response
  11035. // instead of the one that was supplied in the request.
  11036. // Only one of pathRedirect or prefixRedirect must be specified.
  11037. // The value must be between 1 and 1024 characters.
  11038. PathRedirect string `json:"pathRedirect,omitempty"`
  11039. // PrefixRedirect: The prefix that replaces the prefixMatch specified in
  11040. // the HttpRouteRuleMatch, retaining the remaining portion of the URL
  11041. // before redirecting the request.
  11042. PrefixRedirect string `json:"prefixRedirect,omitempty"`
  11043. // RedirectResponseCode: The HTTP Status code to use for this
  11044. // RedirectAction.
  11045. // Supported values are:
  11046. // - MOVED_PERMANENTLY_DEFAULT, which is the default value and
  11047. // corresponds to 301.
  11048. // - FOUND, which corresponds to 302.
  11049. // - SEE_OTHER which corresponds to 303.
  11050. // - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the
  11051. // request method will be retained.
  11052. // - PERMANENT_REDIRECT, which corresponds to 308. In this case, the
  11053. // request method will be retained.
  11054. //
  11055. // Possible values:
  11056. // "FOUND"
  11057. // "MOVED_PERMANENTLY_DEFAULT"
  11058. // "PERMANENT_REDIRECT"
  11059. // "SEE_OTHER"
  11060. // "TEMPORARY_REDIRECT"
  11061. RedirectResponseCode string `json:"redirectResponseCode,omitempty"`
  11062. // StripQuery: If set to true, any accompanying query portion of the
  11063. // original URL is removed prior to redirecting the request. If set to
  11064. // false, the query portion of the original URL is retained.
  11065. // The default is set to false.
  11066. StripQuery bool `json:"stripQuery,omitempty"`
  11067. // ForceSendFields is a list of field names (e.g. "HostRedirect") to
  11068. // unconditionally include in API requests. By default, fields with
  11069. // empty values are omitted from API requests. However, any non-pointer,
  11070. // non-interface field appearing in ForceSendFields will be sent to the
  11071. // server regardless of whether the field is empty or not. This may be
  11072. // used to include empty fields in Patch requests.
  11073. ForceSendFields []string `json:"-"`
  11074. // NullFields is a list of field names (e.g. "HostRedirect") to include
  11075. // in API requests with the JSON null value. By default, fields with
  11076. // empty values are omitted from API requests. However, any field with
  11077. // an empty value appearing in NullFields will be sent to the server as
  11078. // null. It is an error if a field in this list has a non-empty value.
  11079. // This may be used to include null fields in Patch requests.
  11080. NullFields []string `json:"-"`
  11081. }
  11082. func (s *HttpRedirectAction) MarshalJSON() ([]byte, error) {
  11083. type NoMethod HttpRedirectAction
  11084. raw := NoMethod(*s)
  11085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11086. }
  11087. // HttpRetryPolicy: The retry policy associates with HttpRouteRule
  11088. type HttpRetryPolicy struct {
  11089. // NumRetries: Specifies the allowed number retries. This number must be
  11090. // > 0.
  11091. NumRetries int64 `json:"numRetries,omitempty"`
  11092. // PerTryTimeout: Specifies a non-zero timeout per retry attempt.
  11093. PerTryTimeout *Duration `json:"perTryTimeout,omitempty"`
  11094. // RetryConditions: Specfies one or more conditions when this retry rule
  11095. // applies. Valid values are:
  11096. // - 5xx: Loadbalancer will attempt a retry if the backend service
  11097. // responds with any 5xx response code, or if the backend service does
  11098. // not respond at all, example: disconnects, reset, read timeout,
  11099. // connection failure, and refused streams.
  11100. // - gateway-error: Similar to 5xx, but only applies to response codes
  11101. // 502, 503 or 504.
  11102. // -
  11103. // - connect-failure: Loadbalancer will retry on failures connecting to
  11104. // backend services, for example due to connection timeouts.
  11105. // - retriable-4xx: Loadbalancer will retry for retriable 4xx response
  11106. // codes. Currently the only retriable error supported is 409.
  11107. // - refused-stream:Loadbalancer will retry if the backend service
  11108. // resets the stream with a REFUSED_STREAM error code. This reset type
  11109. // indicates that it is safe to retry.
  11110. // - cancelledLoadbalancer will retry if the gRPC status code in the
  11111. // response header is set to cancelled
  11112. // - deadline-exceeded: Loadbalancer will retry if the gRPC status code
  11113. // in the response header is set to deadline-exceeded
  11114. // - resource-exhausted: Loadbalancer will retry if the gRPC status code
  11115. // in the response header is set to resource-exhausted
  11116. // - unavailable: Loadbalancer will retry if the gRPC status code in the
  11117. // response header is set to unavailable
  11118. RetryConditions []string `json:"retryConditions,omitempty"`
  11119. // ForceSendFields is a list of field names (e.g. "NumRetries") to
  11120. // unconditionally include in API requests. By default, fields with
  11121. // empty values are omitted from API requests. However, any non-pointer,
  11122. // non-interface field appearing in ForceSendFields will be sent to the
  11123. // server regardless of whether the field is empty or not. This may be
  11124. // used to include empty fields in Patch requests.
  11125. ForceSendFields []string `json:"-"`
  11126. // NullFields is a list of field names (e.g. "NumRetries") to include in
  11127. // API requests with the JSON null value. By default, fields with empty
  11128. // values are omitted from API requests. However, any field with an
  11129. // empty value appearing in NullFields will be sent to the server as
  11130. // null. It is an error if a field in this list has a non-empty value.
  11131. // This may be used to include null fields in Patch requests.
  11132. NullFields []string `json:"-"`
  11133. }
  11134. func (s *HttpRetryPolicy) MarshalJSON() ([]byte, error) {
  11135. type NoMethod HttpRetryPolicy
  11136. raw := NoMethod(*s)
  11137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11138. }
  11139. type HttpRouteAction struct {
  11140. // CorsPolicy: The specification for allowing client side cross-origin
  11141. // requests. Please see W3C Recommendation for Cross Origin Resource
  11142. // Sharing
  11143. CorsPolicy *CorsPolicy `json:"corsPolicy,omitempty"`
  11144. // FaultInjectionPolicy: The specification for fault injection
  11145. // introduced into traffic to test the resiliency of clients to backend
  11146. // service failure. As part of fault injection, when clients send
  11147. // requests to a backend service, delays can be introduced by
  11148. // Loadbalancer on a percentage of requests before sending those request
  11149. // to the backend service. Similarly requests from clients can be
  11150. // aborted by the Loadbalancer for a percentage of requests.
  11151. // timeout and retry_policy will be ignored by clients that are
  11152. // configured with a fault_injection_policy.
  11153. FaultInjectionPolicy *HttpFaultInjection `json:"faultInjectionPolicy,omitempty"`
  11154. // RequestMirrorPolicy: Specifies the policy on how requests intended
  11155. // for the route's backends are shadowed to a separate mirrored backend
  11156. // service. Loadbalancer does not wait for responses from the shadow
  11157. // service. Prior to sending traffic to the shadow service, the host /
  11158. // authority header is suffixed with -shadow.
  11159. RequestMirrorPolicy *RequestMirrorPolicy `json:"requestMirrorPolicy,omitempty"`
  11160. // RetryPolicy: Specifies the retry policy associated with this route.
  11161. RetryPolicy *HttpRetryPolicy `json:"retryPolicy,omitempty"`
  11162. // Timeout: Specifies the timeout for the selected route. Timeout is
  11163. // computed from the time the request is has been fully processed (i.e.
  11164. // end-of-stream) up until the response has been completely processed.
  11165. // Timeout includes all retries.
  11166. // If not specified, the default value is 15 seconds.
  11167. Timeout *Duration `json:"timeout,omitempty"`
  11168. // UrlRewrite: The spec to modify the URL of the request, prior to
  11169. // forwarding the request to the matched service
  11170. UrlRewrite *UrlRewrite `json:"urlRewrite,omitempty"`
  11171. // WeightedBackendServices: A list of weighted backend services to send
  11172. // traffic to when a route match occurs. The weights determine the
  11173. // fraction of traffic that flows to their corresponding backend
  11174. // service. If all traffic needs to go to a single backend service,
  11175. // there must be one weightedBackendService with weight set to a non 0
  11176. // number.
  11177. // Once a backendService is identified and before forwarding the request
  11178. // to the backend service, advanced routing actions like Url rewrites
  11179. // and header transformations are applied depending on additional
  11180. // settings specified in this HttpRouteAction.
  11181. WeightedBackendServices []*WeightedBackendService `json:"weightedBackendServices,omitempty"`
  11182. // ForceSendFields is a list of field names (e.g. "CorsPolicy") to
  11183. // unconditionally include in API requests. By default, fields with
  11184. // empty values are omitted from API requests. However, any non-pointer,
  11185. // non-interface field appearing in ForceSendFields will be sent to the
  11186. // server regardless of whether the field is empty or not. This may be
  11187. // used to include empty fields in Patch requests.
  11188. ForceSendFields []string `json:"-"`
  11189. // NullFields is a list of field names (e.g. "CorsPolicy") to include in
  11190. // API requests with the JSON null value. By default, fields with empty
  11191. // values are omitted from API requests. However, any field with an
  11192. // empty value appearing in NullFields will be sent to the server as
  11193. // null. It is an error if a field in this list has a non-empty value.
  11194. // This may be used to include null fields in Patch requests.
  11195. NullFields []string `json:"-"`
  11196. }
  11197. func (s *HttpRouteAction) MarshalJSON() ([]byte, error) {
  11198. type NoMethod HttpRouteAction
  11199. raw := NoMethod(*s)
  11200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11201. }
  11202. // HttpRouteRule: An HttpRouteRule specifies how to match an HTTP
  11203. // request and the corresponding routing action that load balancing
  11204. // proxies will perform.
  11205. type HttpRouteRule struct {
  11206. // HeaderAction: Specifies changes to request and response headers that
  11207. // need to take effect for the selected backendService.
  11208. // The headerAction specified here are applied before the matching
  11209. // pathMatchers[].headerAction and after
  11210. // pathMatchers[].routeRules[].routeAction.weightedBackendService.backend
  11211. // ServiceWeightAction[].headerAction
  11212. HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
  11213. MatchRules []*HttpRouteRuleMatch `json:"matchRules,omitempty"`
  11214. // RouteAction: In response to a matching matchRule, the load balancer
  11215. // performs advanced routing actions like URL rewrites, header
  11216. // transformations, etc. prior to forwarding the request to the selected
  11217. // backend. If routeAction specifies any weightedBackendServices,
  11218. // service must not be set. Conversely if service is set, routeAction
  11219. // cannot contain any weightedBackendServices.
  11220. // Only one of routeAction or urlRedirect must be set.
  11221. RouteAction *HttpRouteAction `json:"routeAction,omitempty"`
  11222. // UrlRedirect: When this rule is matched, the request is redirected to
  11223. // a URL specified by urlRedirect.
  11224. // If urlRedirect is specified, service or routeAction must not be set.
  11225. UrlRedirect *HttpRedirectAction `json:"urlRedirect,omitempty"`
  11226. // ForceSendFields is a list of field names (e.g. "HeaderAction") to
  11227. // unconditionally include in API requests. By default, fields with
  11228. // empty values are omitted from API requests. However, any non-pointer,
  11229. // non-interface field appearing in ForceSendFields will be sent to the
  11230. // server regardless of whether the field is empty or not. This may be
  11231. // used to include empty fields in Patch requests.
  11232. ForceSendFields []string `json:"-"`
  11233. // NullFields is a list of field names (e.g. "HeaderAction") to include
  11234. // in API requests with the JSON null value. By default, fields with
  11235. // empty values are omitted from API requests. However, any field with
  11236. // an empty value appearing in NullFields will be sent to the server as
  11237. // null. It is an error if a field in this list has a non-empty value.
  11238. // This may be used to include null fields in Patch requests.
  11239. NullFields []string `json:"-"`
  11240. }
  11241. func (s *HttpRouteRule) MarshalJSON() ([]byte, error) {
  11242. type NoMethod HttpRouteRule
  11243. raw := NoMethod(*s)
  11244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11245. }
  11246. // HttpRouteRuleMatch: HttpRouteRuleMatch specifies a set of criteria
  11247. // for matching requests to an HttpRouteRule. All specified criteria
  11248. // must be satisfied for a match to occur.
  11249. type HttpRouteRuleMatch struct {
  11250. // FullPathMatch: For satifying the matchRule condition, the path of the
  11251. // request must exactly match the value specified in fullPathMatch after
  11252. // removing any query parameters and anchor that may be part of the
  11253. // original URL.
  11254. // FullPathMatch must be between 1 and 1024 characters.
  11255. // Only one of prefixMatch, fullPathMatch or regexMatch must be
  11256. // specified.
  11257. FullPathMatch string `json:"fullPathMatch,omitempty"`
  11258. // HeaderMatches: Specifies a list of header match criteria, all of
  11259. // which must match corresponding headers in the request.
  11260. HeaderMatches []*HttpHeaderMatch `json:"headerMatches,omitempty"`
  11261. // IgnoreCase: Specifies that prefixMatch and fullPathMatch matches are
  11262. // case sensitive.
  11263. // The default value is false.
  11264. // caseSensitive must not be used with regexMatch.
  11265. IgnoreCase bool `json:"ignoreCase,omitempty"`
  11266. // MetadataFilters: Opaque filter criteria used by Loadbalancer to
  11267. // restrict routing configuration to a limited set xDS compliant
  11268. // clients. In their xDS requests to Loadbalancer, xDS clients present
  11269. // node metadata. If a match takes place, the relevant routing
  11270. // configuration is made available to those proxies.
  11271. // For each metadataFilter in this list, if its filterMatchCriteria is
  11272. // set to MATCH_ANY, at least one of the filterLabels must match the
  11273. // corresponding label provided in the metadata. If its
  11274. // filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels
  11275. // must match with corresponding labels in the provided
  11276. // metadata.
  11277. // metadataFilters specified here can be overrides those specified in
  11278. // ForwardingRule that refers to this UrlMap.
  11279. // metadataFilters only applies to Loadbalancers that have their
  11280. // loadBalancingScheme set to INTERNAL_SELF_MANAGED.
  11281. MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`
  11282. // PrefixMatch: For satifying the matchRule condition, the request's
  11283. // path must begin with the specified prefixMatch. prefixMatch must
  11284. // begin with a /.
  11285. // The value must be between 1 and 1024 characters.
  11286. // Only one of prefixMatch, fullPathMatch or regexMatch must be
  11287. // specified.
  11288. PrefixMatch string `json:"prefixMatch,omitempty"`
  11289. // QueryParameterMatches: Specifies a list of query parameter match
  11290. // criteria, all of which must match corresponding query parameters in
  11291. // the request.
  11292. QueryParameterMatches []*HttpQueryParameterMatch `json:"queryParameterMatches,omitempty"`
  11293. // RegexMatch: For satifying the matchRule condition, the path of the
  11294. // request must satisfy the regular expression specified in regexMatch
  11295. // after removing any query parameters and anchor supplied with the
  11296. // original URL. For regular expression grammar please see
  11297. // en.cppreference.com/w/cpp/regex/ecmascript
  11298. // Only one of prefixMatch, fullPathMatch or regexMatch must be
  11299. // specified.
  11300. RegexMatch string `json:"regexMatch,omitempty"`
  11301. // ForceSendFields is a list of field names (e.g. "FullPathMatch") to
  11302. // unconditionally include in API requests. By default, fields with
  11303. // empty values are omitted from API requests. However, any non-pointer,
  11304. // non-interface field appearing in ForceSendFields will be sent to the
  11305. // server regardless of whether the field is empty or not. This may be
  11306. // used to include empty fields in Patch requests.
  11307. ForceSendFields []string `json:"-"`
  11308. // NullFields is a list of field names (e.g. "FullPathMatch") to include
  11309. // in API requests with the JSON null value. By default, fields with
  11310. // empty values are omitted from API requests. However, any field with
  11311. // an empty value appearing in NullFields will be sent to the server as
  11312. // null. It is an error if a field in this list has a non-empty value.
  11313. // This may be used to include null fields in Patch requests.
  11314. NullFields []string `json:"-"`
  11315. }
  11316. func (s *HttpRouteRuleMatch) MarshalJSON() ([]byte, error) {
  11317. type NoMethod HttpRouteRuleMatch
  11318. raw := NoMethod(*s)
  11319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11320. }
  11321. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  11322. // a template for how individual instances should be checked for health,
  11323. // via HTTPS.
  11324. type HttpsHealthCheck struct {
  11325. // CheckIntervalSec: How often (in seconds) to send a health check. The
  11326. // default value is 5 seconds.
  11327. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  11328. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11329. // format.
  11330. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11331. // Description: An optional description of this resource. Provide this
  11332. // property when you create the resource.
  11333. Description string `json:"description,omitempty"`
  11334. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  11335. // after this many consecutive successes. The default value is 2.
  11336. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  11337. // Host: The value of the host header in the HTTPS health check request.
  11338. // If left empty (default value), the public IP on behalf of which this
  11339. // health check is performed will be used.
  11340. Host string `json:"host,omitempty"`
  11341. // Id: [Output Only] The unique identifier for the resource. This
  11342. // identifier is defined by the server.
  11343. Id uint64 `json:"id,omitempty,string"`
  11344. // Kind: Type of the resource.
  11345. Kind string `json:"kind,omitempty"`
  11346. // Name: Name of the resource. Provided by the client when the resource
  11347. // is created. The name must be 1-63 characters long, and comply with
  11348. // RFC1035. Specifically, the name must be 1-63 characters long and
  11349. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11350. // the first character must be a lowercase letter, and all following
  11351. // characters must be a dash, lowercase letter, or digit, except the
  11352. // last character, which cannot be a dash.
  11353. Name string `json:"name,omitempty"`
  11354. // Port: The TCP port number for the HTTPS health check request. The
  11355. // default value is 443.
  11356. Port int64 `json:"port,omitempty"`
  11357. // RequestPath: The request path of the HTTPS health check request. The
  11358. // default value is "/".
  11359. RequestPath string `json:"requestPath,omitempty"`
  11360. // SelfLink: [Output Only] Server-defined URL for the resource.
  11361. SelfLink string `json:"selfLink,omitempty"`
  11362. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  11363. // with the resource id.
  11364. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  11365. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  11366. // The default value is 5 seconds. It is invalid for timeoutSec to have
  11367. // a greater value than checkIntervalSec.
  11368. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  11369. // UnhealthyThreshold: A so-far healthy instance will be marked
  11370. // unhealthy after this many consecutive failures. The default value is
  11371. // 2.
  11372. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  11373. // ServerResponse contains the HTTP response code and headers from the
  11374. // server.
  11375. googleapi.ServerResponse `json:"-"`
  11376. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  11377. // unconditionally include in API requests. By default, fields with
  11378. // empty values are omitted from API requests. However, any non-pointer,
  11379. // non-interface field appearing in ForceSendFields will be sent to the
  11380. // server regardless of whether the field is empty or not. This may be
  11381. // used to include empty fields in Patch requests.
  11382. ForceSendFields []string `json:"-"`
  11383. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  11384. // include in API requests with the JSON null value. By default, fields
  11385. // with empty values are omitted from API requests. However, any field
  11386. // with an empty value appearing in NullFields will be sent to the
  11387. // server as null. It is an error if a field in this list has a
  11388. // non-empty value. This may be used to include null fields in Patch
  11389. // requests.
  11390. NullFields []string `json:"-"`
  11391. }
  11392. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  11393. type NoMethod HttpsHealthCheck
  11394. raw := NoMethod(*s)
  11395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11396. }
  11397. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  11398. type HttpsHealthCheckList struct {
  11399. // Id: [Output Only] Unique identifier for the resource; defined by the
  11400. // server.
  11401. Id string `json:"id,omitempty"`
  11402. // Items: A list of HttpsHealthCheck resources.
  11403. Items []*HttpsHealthCheck `json:"items,omitempty"`
  11404. // Kind: Type of resource.
  11405. Kind string `json:"kind,omitempty"`
  11406. // NextPageToken: [Output Only] This token allows you to get the next
  11407. // page of results for list requests. If the number of results is larger
  11408. // than maxResults, use the nextPageToken as a value for the query
  11409. // parameter pageToken in the next list request. Subsequent list
  11410. // requests will have their own nextPageToken to continue paging through
  11411. // the results.
  11412. NextPageToken string `json:"nextPageToken,omitempty"`
  11413. // SelfLink: [Output Only] Server-defined URL for this resource.
  11414. SelfLink string `json:"selfLink,omitempty"`
  11415. // Warning: [Output Only] Informational warning message.
  11416. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  11417. // ServerResponse contains the HTTP response code and headers from the
  11418. // server.
  11419. googleapi.ServerResponse `json:"-"`
  11420. // ForceSendFields is a list of field names (e.g. "Id") to
  11421. // unconditionally include in API requests. By default, fields with
  11422. // empty values are omitted from API requests. However, any non-pointer,
  11423. // non-interface field appearing in ForceSendFields will be sent to the
  11424. // server regardless of whether the field is empty or not. This may be
  11425. // used to include empty fields in Patch requests.
  11426. ForceSendFields []string `json:"-"`
  11427. // NullFields is a list of field names (e.g. "Id") to include in API
  11428. // requests with the JSON null value. By default, fields with empty
  11429. // values are omitted from API requests. However, any field with an
  11430. // empty value appearing in NullFields will be sent to the server as
  11431. // null. It is an error if a field in this list has a non-empty value.
  11432. // This may be used to include null fields in Patch requests.
  11433. NullFields []string `json:"-"`
  11434. }
  11435. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  11436. type NoMethod HttpsHealthCheckList
  11437. raw := NoMethod(*s)
  11438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11439. }
  11440. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  11441. // message.
  11442. type HttpsHealthCheckListWarning struct {
  11443. // Code: [Output Only] A warning code, if applicable. For example,
  11444. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11445. // the response.
  11446. //
  11447. // Possible values:
  11448. // "CLEANUP_FAILED"
  11449. // "DEPRECATED_RESOURCE_USED"
  11450. // "DEPRECATED_TYPE_USED"
  11451. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11452. // "EXPERIMENTAL_TYPE_USED"
  11453. // "EXTERNAL_API_WARNING"
  11454. // "FIELD_VALUE_OVERRIDEN"
  11455. // "INJECTED_KERNELS_DEPRECATED"
  11456. // "MISSING_TYPE_DEPENDENCY"
  11457. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11458. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11459. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11460. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11461. // "NEXT_HOP_NOT_RUNNING"
  11462. // "NOT_CRITICAL_ERROR"
  11463. // "NO_RESULTS_ON_PAGE"
  11464. // "REQUIRED_TOS_AGREEMENT"
  11465. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11466. // "RESOURCE_NOT_DELETED"
  11467. // "SCHEMA_VALIDATION_IGNORED"
  11468. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11469. // "UNDECLARED_PROPERTIES"
  11470. // "UNREACHABLE"
  11471. Code string `json:"code,omitempty"`
  11472. // Data: [Output Only] Metadata about this warning in key: value format.
  11473. // For example:
  11474. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11475. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  11476. // Message: [Output Only] A human-readable description of the warning
  11477. // code.
  11478. Message string `json:"message,omitempty"`
  11479. // ForceSendFields is a list of field names (e.g. "Code") to
  11480. // unconditionally include in API requests. By default, fields with
  11481. // empty values are omitted from API requests. However, any non-pointer,
  11482. // non-interface field appearing in ForceSendFields will be sent to the
  11483. // server regardless of whether the field is empty or not. This may be
  11484. // used to include empty fields in Patch requests.
  11485. ForceSendFields []string `json:"-"`
  11486. // NullFields is a list of field names (e.g. "Code") to include in API
  11487. // requests with the JSON null value. By default, fields with empty
  11488. // values are omitted from API requests. However, any field with an
  11489. // empty value appearing in NullFields will be sent to the server as
  11490. // null. It is an error if a field in this list has a non-empty value.
  11491. // This may be used to include null fields in Patch requests.
  11492. NullFields []string `json:"-"`
  11493. }
  11494. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  11495. type NoMethod HttpsHealthCheckListWarning
  11496. raw := NoMethod(*s)
  11497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11498. }
  11499. type HttpsHealthCheckListWarningData struct {
  11500. // Key: [Output Only] A key that provides more detail on the warning
  11501. // being returned. For example, for warnings where there are no results
  11502. // in a list request for a particular zone, this key might be scope and
  11503. // the key value might be the zone name. Other examples might be a key
  11504. // indicating a deprecated resource and a suggested replacement, or a
  11505. // warning about invalid network settings (for example, if an instance
  11506. // attempts to perform IP forwarding but is not enabled for IP
  11507. // forwarding).
  11508. Key string `json:"key,omitempty"`
  11509. // Value: [Output Only] A warning data value corresponding to the key.
  11510. Value string `json:"value,omitempty"`
  11511. // ForceSendFields is a list of field names (e.g. "Key") to
  11512. // unconditionally include in API requests. By default, fields with
  11513. // empty values are omitted from API requests. However, any non-pointer,
  11514. // non-interface field appearing in ForceSendFields will be sent to the
  11515. // server regardless of whether the field is empty or not. This may be
  11516. // used to include empty fields in Patch requests.
  11517. ForceSendFields []string `json:"-"`
  11518. // NullFields is a list of field names (e.g. "Key") to include in API
  11519. // requests with the JSON null value. By default, fields with empty
  11520. // values are omitted from API requests. However, any field with an
  11521. // empty value appearing in NullFields will be sent to the server as
  11522. // null. It is an error if a field in this list has a non-empty value.
  11523. // This may be used to include null fields in Patch requests.
  11524. NullFields []string `json:"-"`
  11525. }
  11526. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  11527. type NoMethod HttpsHealthCheckListWarningData
  11528. raw := NoMethod(*s)
  11529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11530. }
  11531. // Image: An Image resource. (== resource_for beta.images ==) (==
  11532. // resource_for v1.images ==)
  11533. type Image struct {
  11534. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  11535. // Cloud Storage (in bytes).
  11536. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  11537. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11538. // format.
  11539. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11540. // Deprecated: The deprecation status associated with this image.
  11541. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  11542. // Description: An optional description of this resource. Provide this
  11543. // property when you create the resource.
  11544. Description string `json:"description,omitempty"`
  11545. // DiskSizeGb: Size of the image when restored onto a persistent disk
  11546. // (in GB).
  11547. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  11548. // Family: The name of the image family to which this image belongs. You
  11549. // can create disks by specifying an image family instead of a specific
  11550. // image name. The image family always returns its latest image that is
  11551. // not deprecated. The name of the image family must comply with
  11552. // RFC1035.
  11553. Family string `json:"family,omitempty"`
  11554. // GuestOsFeatures: A list of features to enable on the guest operating
  11555. // system. Applicable only for bootable images. Read Enabling guest
  11556. // operating system features to see a list of available options.
  11557. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  11558. // Id: [Output Only] The unique identifier for the resource. This
  11559. // identifier is defined by the server.
  11560. Id uint64 `json:"id,omitempty,string"`
  11561. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  11562. // encryption key.
  11563. //
  11564. // After you encrypt an image with a customer-supplied key, you must
  11565. // provide the same key if you use the image later (e.g. to create a
  11566. // disk from the image).
  11567. //
  11568. // Customer-supplied encryption keys do not protect access to metadata
  11569. // of the disk.
  11570. //
  11571. // If you do not provide an encryption key when creating the image, then
  11572. // the disk will be encrypted using an automatically generated key and
  11573. // you do not need to provide a key to use the image later.
  11574. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  11575. // Kind: [Output Only] Type of the resource. Always compute#image for
  11576. // images.
  11577. Kind string `json:"kind,omitempty"`
  11578. // LabelFingerprint: A fingerprint for the labels being applied to this
  11579. // image, which is essentially a hash of the labels used for optimistic
  11580. // locking. The fingerprint is initially generated by Compute Engine and
  11581. // changes after every request to modify or update labels. You must
  11582. // always provide an up-to-date fingerprint hash in order to update or
  11583. // change labels, otherwise the request will fail with error 412
  11584. // conditionNotMet.
  11585. //
  11586. // To see the latest fingerprint, make a get() request to retrieve an
  11587. // image.
  11588. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11589. // Labels: Labels to apply to this image. These can be later modified by
  11590. // the setLabels method.
  11591. Labels map[string]string `json:"labels,omitempty"`
  11592. // LicenseCodes: Integer license codes indicating which licenses are
  11593. // attached to this image.
  11594. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  11595. // Licenses: Any applicable license URI.
  11596. Licenses []string `json:"licenses,omitempty"`
  11597. // Name: Name of the resource; provided by the client when the resource
  11598. // is created. The name must be 1-63 characters long, and comply with
  11599. // RFC1035. Specifically, the name must be 1-63 characters long and
  11600. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11601. // the first character must be a lowercase letter, and all following
  11602. // characters must be a dash, lowercase letter, or digit, except the
  11603. // last character, which cannot be a dash.
  11604. Name string `json:"name,omitempty"`
  11605. // RawDisk: The parameters of the raw disk image.
  11606. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  11607. // SelfLink: [Output Only] Server-defined URL for the resource.
  11608. SelfLink string `json:"selfLink,omitempty"`
  11609. // SelfLinkWithId: [Output Only] Server-defined URL for this resource's
  11610. // resource id.
  11611. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  11612. // SourceDisk: URL of the source disk used to create this image. This
  11613. // can be a full or valid partial URL. You must provide either this
  11614. // property or the rawDisk.source property but not both to create an
  11615. // image. For example, the following are valid values:
  11616. // -
  11617. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  11618. // - projects/project/zones/zone/disks/disk
  11619. // - zones/zone/disks/disk
  11620. SourceDisk string `json:"sourceDisk,omitempty"`
  11621. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  11622. // source disk. Required if the source disk is protected by a
  11623. // customer-supplied encryption key.
  11624. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  11625. // SourceDiskId: [Output Only] The ID value of the disk used to create
  11626. // this image. This value may be used to determine whether the image was
  11627. // taken from the current or a previous instance of a given disk name.
  11628. SourceDiskId string `json:"sourceDiskId,omitempty"`
  11629. // SourceImage: URL of the source image used to create this image. This
  11630. // can be a full or valid partial URL. You must provide exactly one of:
  11631. //
  11632. // - this property, or
  11633. // - the rawDisk.source property, or
  11634. // - the sourceDisk property in order to create an image.
  11635. SourceImage string `json:"sourceImage,omitempty"`
  11636. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  11637. // source image. Required if the source image is protected by a
  11638. // customer-supplied encryption key.
  11639. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  11640. // SourceImageId: [Output Only] The ID value of the image used to create
  11641. // this image. This value may be used to determine whether the image was
  11642. // taken from the current or a previous instance of a given image name.
  11643. SourceImageId string `json:"sourceImageId,omitempty"`
  11644. // SourceSnapshot: URL of the source snapshot used to create this image.
  11645. // This can be a full or valid partial URL. You must provide exactly one
  11646. // of:
  11647. // - this property, or
  11648. // - the sourceImage property, or
  11649. // - the rawDisk.source property, or
  11650. // - the sourceDisk property in order to create an image.
  11651. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  11652. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  11653. // the source snapshot. Required if the source snapshot is protected by
  11654. // a customer-supplied encryption key.
  11655. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  11656. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  11657. // create this image. This value may be used to determine whether the
  11658. // snapshot was taken from the current or a previous instance of a given
  11659. // snapshot name.
  11660. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  11661. // SourceType: The type of the image used to create this disk. The
  11662. // default and only value is RAW
  11663. //
  11664. // Possible values:
  11665. // "RAW" (default)
  11666. SourceType string `json:"sourceType,omitempty"`
  11667. // Status: [Output Only] The status of the image. An image can be used
  11668. // to create other resources, such as instances, only after the image
  11669. // has been successfully created and the status is set to READY.
  11670. // Possible values are FAILED, PENDING, or READY.
  11671. //
  11672. // Possible values:
  11673. // "DELETING"
  11674. // "FAILED"
  11675. // "PENDING"
  11676. // "READY"
  11677. Status string `json:"status,omitempty"`
  11678. // StorageLocations: GCS bucket storage location of the image (regional
  11679. // or multi-regional).
  11680. StorageLocations []string `json:"storageLocations,omitempty"`
  11681. // ServerResponse contains the HTTP response code and headers from the
  11682. // server.
  11683. googleapi.ServerResponse `json:"-"`
  11684. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  11685. // unconditionally include in API requests. By default, fields with
  11686. // empty values are omitted from API requests. However, any non-pointer,
  11687. // non-interface field appearing in ForceSendFields will be sent to the
  11688. // server regardless of whether the field is empty or not. This may be
  11689. // used to include empty fields in Patch requests.
  11690. ForceSendFields []string `json:"-"`
  11691. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  11692. // include in API requests with the JSON null value. By default, fields
  11693. // with empty values are omitted from API requests. However, any field
  11694. // with an empty value appearing in NullFields will be sent to the
  11695. // server as null. It is an error if a field in this list has a
  11696. // non-empty value. This may be used to include null fields in Patch
  11697. // requests.
  11698. NullFields []string `json:"-"`
  11699. }
  11700. func (s *Image) MarshalJSON() ([]byte, error) {
  11701. type NoMethod Image
  11702. raw := NoMethod(*s)
  11703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11704. }
  11705. // ImageRawDisk: The parameters of the raw disk image.
  11706. type ImageRawDisk struct {
  11707. // ContainerType: The format used to encode and transmit the block
  11708. // device, which should be TAR. This is just a container and
  11709. // transmission format and not a runtime format. Provided by the client
  11710. // when the disk image is created.
  11711. //
  11712. // Possible values:
  11713. // "TAR"
  11714. ContainerType string `json:"containerType,omitempty"`
  11715. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  11716. // unpackaging provided by the client when the disk image is created.
  11717. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  11718. // Source: The full Google Cloud Storage URL where the disk image is
  11719. // stored. You must provide either this property or the sourceDisk
  11720. // property but not both.
  11721. Source string `json:"source,omitempty"`
  11722. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  11723. // unconditionally include in API requests. By default, fields with
  11724. // empty values are omitted from API requests. However, any non-pointer,
  11725. // non-interface field appearing in ForceSendFields will be sent to the
  11726. // server regardless of whether the field is empty or not. This may be
  11727. // used to include empty fields in Patch requests.
  11728. ForceSendFields []string `json:"-"`
  11729. // NullFields is a list of field names (e.g. "ContainerType") to include
  11730. // in API requests with the JSON null value. By default, fields with
  11731. // empty values are omitted from API requests. However, any field with
  11732. // an empty value appearing in NullFields will be sent to the server as
  11733. // null. It is an error if a field in this list has a non-empty value.
  11734. // This may be used to include null fields in Patch requests.
  11735. NullFields []string `json:"-"`
  11736. }
  11737. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  11738. type NoMethod ImageRawDisk
  11739. raw := NoMethod(*s)
  11740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11741. }
  11742. // ImageList: Contains a list of images.
  11743. type ImageList struct {
  11744. // Id: [Output Only] Unique identifier for the resource; defined by the
  11745. // server.
  11746. Id string `json:"id,omitempty"`
  11747. // Items: A list of Image resources.
  11748. Items []*Image `json:"items,omitempty"`
  11749. // Kind: Type of resource.
  11750. Kind string `json:"kind,omitempty"`
  11751. // NextPageToken: [Output Only] This token allows you to get the next
  11752. // page of results for list requests. If the number of results is larger
  11753. // than maxResults, use the nextPageToken as a value for the query
  11754. // parameter pageToken in the next list request. Subsequent list
  11755. // requests will have their own nextPageToken to continue paging through
  11756. // the results.
  11757. NextPageToken string `json:"nextPageToken,omitempty"`
  11758. // SelfLink: [Output Only] Server-defined URL for this resource.
  11759. SelfLink string `json:"selfLink,omitempty"`
  11760. // Warning: [Output Only] Informational warning message.
  11761. Warning *ImageListWarning `json:"warning,omitempty"`
  11762. // ServerResponse contains the HTTP response code and headers from the
  11763. // server.
  11764. googleapi.ServerResponse `json:"-"`
  11765. // ForceSendFields is a list of field names (e.g. "Id") to
  11766. // unconditionally include in API requests. By default, fields with
  11767. // empty values are omitted from API requests. However, any non-pointer,
  11768. // non-interface field appearing in ForceSendFields will be sent to the
  11769. // server regardless of whether the field is empty or not. This may be
  11770. // used to include empty fields in Patch requests.
  11771. ForceSendFields []string `json:"-"`
  11772. // NullFields is a list of field names (e.g. "Id") to include in API
  11773. // requests with the JSON null value. By default, fields with empty
  11774. // values are omitted from API requests. However, any field with an
  11775. // empty value appearing in NullFields will be sent to the server as
  11776. // null. It is an error if a field in this list has a non-empty value.
  11777. // This may be used to include null fields in Patch requests.
  11778. NullFields []string `json:"-"`
  11779. }
  11780. func (s *ImageList) MarshalJSON() ([]byte, error) {
  11781. type NoMethod ImageList
  11782. raw := NoMethod(*s)
  11783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11784. }
  11785. // ImageListWarning: [Output Only] Informational warning message.
  11786. type ImageListWarning struct {
  11787. // Code: [Output Only] A warning code, if applicable. For example,
  11788. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11789. // the response.
  11790. //
  11791. // Possible values:
  11792. // "CLEANUP_FAILED"
  11793. // "DEPRECATED_RESOURCE_USED"
  11794. // "DEPRECATED_TYPE_USED"
  11795. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11796. // "EXPERIMENTAL_TYPE_USED"
  11797. // "EXTERNAL_API_WARNING"
  11798. // "FIELD_VALUE_OVERRIDEN"
  11799. // "INJECTED_KERNELS_DEPRECATED"
  11800. // "MISSING_TYPE_DEPENDENCY"
  11801. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11802. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11803. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11804. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11805. // "NEXT_HOP_NOT_RUNNING"
  11806. // "NOT_CRITICAL_ERROR"
  11807. // "NO_RESULTS_ON_PAGE"
  11808. // "REQUIRED_TOS_AGREEMENT"
  11809. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11810. // "RESOURCE_NOT_DELETED"
  11811. // "SCHEMA_VALIDATION_IGNORED"
  11812. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11813. // "UNDECLARED_PROPERTIES"
  11814. // "UNREACHABLE"
  11815. Code string `json:"code,omitempty"`
  11816. // Data: [Output Only] Metadata about this warning in key: value format.
  11817. // For example:
  11818. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11819. Data []*ImageListWarningData `json:"data,omitempty"`
  11820. // Message: [Output Only] A human-readable description of the warning
  11821. // code.
  11822. Message string `json:"message,omitempty"`
  11823. // ForceSendFields is a list of field names (e.g. "Code") to
  11824. // unconditionally include in API requests. By default, fields with
  11825. // empty values are omitted from API requests. However, any non-pointer,
  11826. // non-interface field appearing in ForceSendFields will be sent to the
  11827. // server regardless of whether the field is empty or not. This may be
  11828. // used to include empty fields in Patch requests.
  11829. ForceSendFields []string `json:"-"`
  11830. // NullFields is a list of field names (e.g. "Code") to include in API
  11831. // requests with the JSON null value. By default, fields with empty
  11832. // values are omitted from API requests. However, any field with an
  11833. // empty value appearing in NullFields will be sent to the server as
  11834. // null. It is an error if a field in this list has a non-empty value.
  11835. // This may be used to include null fields in Patch requests.
  11836. NullFields []string `json:"-"`
  11837. }
  11838. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  11839. type NoMethod ImageListWarning
  11840. raw := NoMethod(*s)
  11841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11842. }
  11843. type ImageListWarningData struct {
  11844. // Key: [Output Only] A key that provides more detail on the warning
  11845. // being returned. For example, for warnings where there are no results
  11846. // in a list request for a particular zone, this key might be scope and
  11847. // the key value might be the zone name. Other examples might be a key
  11848. // indicating a deprecated resource and a suggested replacement, or a
  11849. // warning about invalid network settings (for example, if an instance
  11850. // attempts to perform IP forwarding but is not enabled for IP
  11851. // forwarding).
  11852. Key string `json:"key,omitempty"`
  11853. // Value: [Output Only] A warning data value corresponding to the key.
  11854. Value string `json:"value,omitempty"`
  11855. // ForceSendFields is a list of field names (e.g. "Key") to
  11856. // unconditionally include in API requests. By default, fields with
  11857. // empty values are omitted from API requests. However, any non-pointer,
  11858. // non-interface field appearing in ForceSendFields will be sent to the
  11859. // server regardless of whether the field is empty or not. This may be
  11860. // used to include empty fields in Patch requests.
  11861. ForceSendFields []string `json:"-"`
  11862. // NullFields is a list of field names (e.g. "Key") to include in API
  11863. // requests with the JSON null value. By default, fields with empty
  11864. // values are omitted from API requests. However, any field with an
  11865. // empty value appearing in NullFields will be sent to the server as
  11866. // null. It is an error if a field in this list has a non-empty value.
  11867. // This may be used to include null fields in Patch requests.
  11868. NullFields []string `json:"-"`
  11869. }
  11870. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  11871. type NoMethod ImageListWarningData
  11872. raw := NoMethod(*s)
  11873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11874. }
  11875. // Instance: An Instance resource. (== resource_for beta.instances ==)
  11876. // (== resource_for v1.instances ==)
  11877. type Instance struct {
  11878. // AllocationAffinity: The configuration of desired allocations which
  11879. // this Instance could consume capacity from.
  11880. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  11881. // CanIpForward: Allows this instance to send and receive packets with
  11882. // non-matching destination or source IPs. This is required if you plan
  11883. // to use this instance to forward routes. For more information, see
  11884. // Enabling IP Forwarding.
  11885. CanIpForward bool `json:"canIpForward,omitempty"`
  11886. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  11887. CpuPlatform string `json:"cpuPlatform,omitempty"`
  11888. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11889. // format.
  11890. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11891. // DeletionProtection: Whether the resource should be protected against
  11892. // deletion.
  11893. DeletionProtection bool `json:"deletionProtection,omitempty"`
  11894. // Description: An optional description of this resource. Provide this
  11895. // property when you create the resource.
  11896. Description string `json:"description,omitempty"`
  11897. // Disks: Array of disks associated with this instance. Persistent disks
  11898. // must be created before you can assign them.
  11899. Disks []*AttachedDisk `json:"disks,omitempty"`
  11900. // DisplayDevice: Enables display device for the instance.
  11901. DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
  11902. // GuestAccelerators: A list of the type and count of accelerator cards
  11903. // attached to the instance.
  11904. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  11905. Hostname string `json:"hostname,omitempty"`
  11906. // Id: [Output Only] The unique identifier for the resource. This
  11907. // identifier is defined by the server.
  11908. Id uint64 `json:"id,omitempty,string"`
  11909. // InstanceEncryptionKey: Encrypts or decrypts data for an instance with
  11910. // a customer-supplied encryption key.
  11911. //
  11912. // If you are creating a new instance, this field encrypts the local SSD
  11913. // and in-memory contents of the instance using a key that you
  11914. // provide.
  11915. //
  11916. // If you are restarting an instance protected with a customer-supplied
  11917. // encryption key, you must provide the correct key in order to
  11918. // successfully restart the instance.
  11919. //
  11920. // If you do not provide an encryption key when creating the instance,
  11921. // then the local SSD and in-memory contents will be encrypted using an
  11922. // automatically generated key and you do not need to provide a key to
  11923. // start the instance later.
  11924. //
  11925. // Instance templates do not store customer-supplied encryption keys, so
  11926. // you cannot use your own keys to encrypt local SSDs and in-memory
  11927. // content in a managed instance group.
  11928. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  11929. // Kind: [Output Only] Type of the resource. Always compute#instance for
  11930. // instances.
  11931. Kind string `json:"kind,omitempty"`
  11932. // LabelFingerprint: A fingerprint for this request, which is
  11933. // essentially a hash of the label's contents and used for optimistic
  11934. // locking. The fingerprint is initially generated by Compute Engine and
  11935. // changes after every request to modify or update labels. You must
  11936. // always provide an up-to-date fingerprint hash in order to update or
  11937. // change labels.
  11938. //
  11939. // To see the latest fingerprint, make get() request to the instance.
  11940. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11941. // Labels: Labels to apply to this instance. These can be later modified
  11942. // by the setLabels method.
  11943. Labels map[string]string `json:"labels,omitempty"`
  11944. // MachineType: Full or partial URL of the machine type resource to use
  11945. // for this instance, in the format:
  11946. // zones/zone/machineTypes/machine-type. This is provided by the client
  11947. // when the instance is created. For example, the following is a valid
  11948. // partial url to a predefined machine
  11949. // type:
  11950. // zones/us-central1-f/machineTypes/n1-standard-1
  11951. //
  11952. //
  11953. // To create a custom machine type, provide a URL to a machine type in
  11954. // the following format, where CPUS is 1 or an even number up to 32 (2,
  11955. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  11956. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  11957. // 5 GB of memory is 5120
  11958. // MB):
  11959. // zones/zone/machineTypes/custom-CPUS-MEMORY
  11960. //
  11961. //
  11962. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  11963. //
  11964. // For a full list of restrictions, read the Specifications for custom
  11965. // machine types.
  11966. MachineType string `json:"machineType,omitempty"`
  11967. // Metadata: The metadata key/value pairs assigned to this instance.
  11968. // This includes custom metadata and predefined keys.
  11969. Metadata *Metadata `json:"metadata,omitempty"`
  11970. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  11971. // Applicable values are the friendly names of CPU platforms, such as
  11972. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  11973. // Bridge".
  11974. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  11975. // Name: The name of the resource, provided by the client when initially
  11976. // creating the resource. The resource name must be 1-63 characters
  11977. // long, and comply with RFC1035. Specifically, the name must be 1-63
  11978. // characters long and match the regular expression
  11979. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  11980. // a lowercase letter, and all following characters must be a dash,
  11981. // lowercase letter, or digit, except the last character, which cannot
  11982. // be a dash.
  11983. Name string `json:"name,omitempty"`
  11984. // NetworkInterfaces: An array of network configurations for this
  11985. // instance. These specify how interfaces are configured to interact
  11986. // with other network services, such as connecting to the internet.
  11987. // Multiple interfaces are supported per instance.
  11988. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  11989. // PreservedStateSizeGb: Total amount of preserved state for SUSPENDED
  11990. // instances. Read-only in the api.
  11991. PreservedStateSizeGb int64 `json:"preservedStateSizeGb,omitempty,string"`
  11992. // ResourcePolicies: Resource policies applied to this instance.
  11993. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  11994. // Scheduling: Sets the scheduling options for this instance.
  11995. Scheduling *Scheduling `json:"scheduling,omitempty"`
  11996. // SelfLink: [Output Only] Server-defined URL for this resource.
  11997. SelfLink string `json:"selfLink,omitempty"`
  11998. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  11999. // with the resource id.
  12000. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  12001. // ServiceAccounts: A list of service accounts, with their specified
  12002. // scopes, authorized for this instance. Only one service account per VM
  12003. // instance is supported.
  12004. //
  12005. // Service accounts generate access tokens that can be accessed through
  12006. // the metadata server and used to authenticate applications on the
  12007. // instance. See Service Accounts for more information.
  12008. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  12009. ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  12010. ShieldedInstanceIntegrityPolicy *ShieldedInstanceIntegrityPolicy `json:"shieldedInstanceIntegrityPolicy,omitempty"`
  12011. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  12012. ShieldedVmIntegrityPolicy *ShieldedVmIntegrityPolicy `json:"shieldedVmIntegrityPolicy,omitempty"`
  12013. // SourceMachineImage: Source machine image
  12014. SourceMachineImage string `json:"sourceMachineImage,omitempty"`
  12015. // SourceMachineImageEncryptionKey: Source GMI encryption key when
  12016. // creating an instance from GMI.
  12017. SourceMachineImageEncryptionKey *CustomerEncryptionKey `json:"sourceMachineImageEncryptionKey,omitempty"`
  12018. // StartRestricted: [Output Only] Whether a VM has been restricted for
  12019. // start because Compute Engine has detected suspicious activity.
  12020. StartRestricted bool `json:"startRestricted,omitempty"`
  12021. // Status: [Output Only] The status of the instance. One of the
  12022. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  12023. // SUSPENDING, SUSPENDED, and TERMINATED.
  12024. //
  12025. // Possible values:
  12026. // "PROVISIONING"
  12027. // "REPAIRING"
  12028. // "RUNNING"
  12029. // "STAGING"
  12030. // "STOPPED"
  12031. // "STOPPING"
  12032. // "SUSPENDED"
  12033. // "SUSPENDING"
  12034. // "TERMINATED"
  12035. Status string `json:"status,omitempty"`
  12036. // StatusMessage: [Output Only] An optional, human-readable explanation
  12037. // of the status.
  12038. StatusMessage string `json:"statusMessage,omitempty"`
  12039. // Tags: Tags to apply to this instance. Tags are used to identify valid
  12040. // sources or targets for network firewalls and are specified by the
  12041. // client during instance creation. The tags can be later modified by
  12042. // the setTags method. Each tag within the list must comply with
  12043. // RFC1035. Multiple tags can be specified via the 'tags.items' field.
  12044. Tags *Tags `json:"tags,omitempty"`
  12045. // Zone: [Output Only] URL of the zone where the instance resides. You
  12046. // must specify this field as part of the HTTP request URL. It is not
  12047. // settable as a field in the request body.
  12048. Zone string `json:"zone,omitempty"`
  12049. // ServerResponse contains the HTTP response code and headers from the
  12050. // server.
  12051. googleapi.ServerResponse `json:"-"`
  12052. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  12053. // to unconditionally include in API requests. By default, fields with
  12054. // empty values are omitted from API requests. However, any non-pointer,
  12055. // non-interface field appearing in ForceSendFields will be sent to the
  12056. // server regardless of whether the field is empty or not. This may be
  12057. // used to include empty fields in Patch requests.
  12058. ForceSendFields []string `json:"-"`
  12059. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  12060. // include in API requests with the JSON null value. By default, fields
  12061. // with empty values are omitted from API requests. However, any field
  12062. // with an empty value appearing in NullFields will be sent to the
  12063. // server as null. It is an error if a field in this list has a
  12064. // non-empty value. This may be used to include null fields in Patch
  12065. // requests.
  12066. NullFields []string `json:"-"`
  12067. }
  12068. func (s *Instance) MarshalJSON() ([]byte, error) {
  12069. type NoMethod Instance
  12070. raw := NoMethod(*s)
  12071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12072. }
  12073. type InstanceAggregatedList struct {
  12074. // Id: [Output Only] Unique identifier for the resource; defined by the
  12075. // server.
  12076. Id string `json:"id,omitempty"`
  12077. // Items: A list of InstancesScopedList resources.
  12078. Items map[string]InstancesScopedList `json:"items,omitempty"`
  12079. // Kind: [Output Only] Type of resource. Always
  12080. // compute#instanceAggregatedList for aggregated lists of Instance
  12081. // resources.
  12082. Kind string `json:"kind,omitempty"`
  12083. // NextPageToken: [Output Only] This token allows you to get the next
  12084. // page of results for list requests. If the number of results is larger
  12085. // than maxResults, use the nextPageToken as a value for the query
  12086. // parameter pageToken in the next list request. Subsequent list
  12087. // requests will have their own nextPageToken to continue paging through
  12088. // the results.
  12089. NextPageToken string `json:"nextPageToken,omitempty"`
  12090. // SelfLink: [Output Only] Server-defined URL for this resource.
  12091. SelfLink string `json:"selfLink,omitempty"`
  12092. // Warning: [Output Only] Informational warning message.
  12093. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  12094. // ServerResponse contains the HTTP response code and headers from the
  12095. // server.
  12096. googleapi.ServerResponse `json:"-"`
  12097. // ForceSendFields is a list of field names (e.g. "Id") to
  12098. // unconditionally include in API requests. By default, fields with
  12099. // empty values are omitted from API requests. However, any non-pointer,
  12100. // non-interface field appearing in ForceSendFields will be sent to the
  12101. // server regardless of whether the field is empty or not. This may be
  12102. // used to include empty fields in Patch requests.
  12103. ForceSendFields []string `json:"-"`
  12104. // NullFields is a list of field names (e.g. "Id") to include in API
  12105. // requests with the JSON null value. By default, fields with empty
  12106. // values are omitted from API requests. However, any field with an
  12107. // empty value appearing in NullFields will be sent to the server as
  12108. // null. It is an error if a field in this list has a non-empty value.
  12109. // This may be used to include null fields in Patch requests.
  12110. NullFields []string `json:"-"`
  12111. }
  12112. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  12113. type NoMethod InstanceAggregatedList
  12114. raw := NoMethod(*s)
  12115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12116. }
  12117. // InstanceAggregatedListWarning: [Output Only] Informational warning
  12118. // message.
  12119. type InstanceAggregatedListWarning struct {
  12120. // Code: [Output Only] A warning code, if applicable. For example,
  12121. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12122. // the response.
  12123. //
  12124. // Possible values:
  12125. // "CLEANUP_FAILED"
  12126. // "DEPRECATED_RESOURCE_USED"
  12127. // "DEPRECATED_TYPE_USED"
  12128. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12129. // "EXPERIMENTAL_TYPE_USED"
  12130. // "EXTERNAL_API_WARNING"
  12131. // "FIELD_VALUE_OVERRIDEN"
  12132. // "INJECTED_KERNELS_DEPRECATED"
  12133. // "MISSING_TYPE_DEPENDENCY"
  12134. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12135. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12136. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12137. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12138. // "NEXT_HOP_NOT_RUNNING"
  12139. // "NOT_CRITICAL_ERROR"
  12140. // "NO_RESULTS_ON_PAGE"
  12141. // "REQUIRED_TOS_AGREEMENT"
  12142. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12143. // "RESOURCE_NOT_DELETED"
  12144. // "SCHEMA_VALIDATION_IGNORED"
  12145. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12146. // "UNDECLARED_PROPERTIES"
  12147. // "UNREACHABLE"
  12148. Code string `json:"code,omitempty"`
  12149. // Data: [Output Only] Metadata about this warning in key: value format.
  12150. // For example:
  12151. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12152. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  12153. // Message: [Output Only] A human-readable description of the warning
  12154. // code.
  12155. Message string `json:"message,omitempty"`
  12156. // ForceSendFields is a list of field names (e.g. "Code") to
  12157. // unconditionally include in API requests. By default, fields with
  12158. // empty values are omitted from API requests. However, any non-pointer,
  12159. // non-interface field appearing in ForceSendFields will be sent to the
  12160. // server regardless of whether the field is empty or not. This may be
  12161. // used to include empty fields in Patch requests.
  12162. ForceSendFields []string `json:"-"`
  12163. // NullFields is a list of field names (e.g. "Code") to include in API
  12164. // requests with the JSON null value. By default, fields with empty
  12165. // values are omitted from API requests. However, any field with an
  12166. // empty value appearing in NullFields will be sent to the server as
  12167. // null. It is an error if a field in this list has a non-empty value.
  12168. // This may be used to include null fields in Patch requests.
  12169. NullFields []string `json:"-"`
  12170. }
  12171. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  12172. type NoMethod InstanceAggregatedListWarning
  12173. raw := NoMethod(*s)
  12174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12175. }
  12176. type InstanceAggregatedListWarningData struct {
  12177. // Key: [Output Only] A key that provides more detail on the warning
  12178. // being returned. For example, for warnings where there are no results
  12179. // in a list request for a particular zone, this key might be scope and
  12180. // the key value might be the zone name. Other examples might be a key
  12181. // indicating a deprecated resource and a suggested replacement, or a
  12182. // warning about invalid network settings (for example, if an instance
  12183. // attempts to perform IP forwarding but is not enabled for IP
  12184. // forwarding).
  12185. Key string `json:"key,omitempty"`
  12186. // Value: [Output Only] A warning data value corresponding to the key.
  12187. Value string `json:"value,omitempty"`
  12188. // ForceSendFields is a list of field names (e.g. "Key") to
  12189. // unconditionally include in API requests. By default, fields with
  12190. // empty values are omitted from API requests. However, any non-pointer,
  12191. // non-interface field appearing in ForceSendFields will be sent to the
  12192. // server regardless of whether the field is empty or not. This may be
  12193. // used to include empty fields in Patch requests.
  12194. ForceSendFields []string `json:"-"`
  12195. // NullFields is a list of field names (e.g. "Key") to include in API
  12196. // requests with the JSON null value. By default, fields with empty
  12197. // values are omitted from API requests. However, any field with an
  12198. // empty value appearing in NullFields will be sent to the server as
  12199. // null. It is an error if a field in this list has a non-empty value.
  12200. // This may be used to include null fields in Patch requests.
  12201. NullFields []string `json:"-"`
  12202. }
  12203. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  12204. type NoMethod InstanceAggregatedListWarningData
  12205. raw := NoMethod(*s)
  12206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12207. }
  12208. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  12209. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  12210. // beta.regionInstanceGroups ==) (== resource_for
  12211. // v1.regionInstanceGroups ==)
  12212. type InstanceGroup struct {
  12213. // CreationTimestamp: [Output Only] The creation timestamp for this
  12214. // instance group in RFC3339 text format.
  12215. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12216. // Description: An optional description of this resource. Provide this
  12217. // property when you create the resource.
  12218. Description string `json:"description,omitempty"`
  12219. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  12220. // system uses this fingerprint to detect conflicts when multiple users
  12221. // change the named ports concurrently.
  12222. Fingerprint string `json:"fingerprint,omitempty"`
  12223. // Id: [Output Only] A unique identifier for this instance group,
  12224. // generated by the server.
  12225. Id uint64 `json:"id,omitempty,string"`
  12226. // Kind: [Output Only] The resource type, which is always
  12227. // compute#instanceGroup for instance groups.
  12228. Kind string `json:"kind,omitempty"`
  12229. // Name: The name of the instance group. The name must be 1-63
  12230. // characters long, and comply with RFC1035.
  12231. Name string `json:"name,omitempty"`
  12232. // NamedPorts: Assigns a name to a port number. For example: {name:
  12233. // "http", port: 80}
  12234. //
  12235. // This allows the system to reference ports by the assigned name
  12236. // instead of a port number. Named ports can also contain multiple
  12237. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  12238. // 8080}]
  12239. //
  12240. // Named ports apply to all instances in this instance group.
  12241. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  12242. // Network: The URL of the network to which all instances in the
  12243. // instance group belong.
  12244. Network string `json:"network,omitempty"`
  12245. // Region: [Output Only] The URL of the region where the instance group
  12246. // is located (for regional resources).
  12247. Region string `json:"region,omitempty"`
  12248. // SelfLink: [Output Only] The URL for this instance group. The server
  12249. // generates this URL.
  12250. SelfLink string `json:"selfLink,omitempty"`
  12251. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  12252. // with the resource id.
  12253. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  12254. // Size: [Output Only] The total number of instances in the instance
  12255. // group.
  12256. Size int64 `json:"size,omitempty"`
  12257. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  12258. // instances in the instance group belong.
  12259. Subnetwork string `json:"subnetwork,omitempty"`
  12260. // Zone: [Output Only] The URL of the zone where the instance group is
  12261. // located (for zonal resources).
  12262. Zone string `json:"zone,omitempty"`
  12263. // ServerResponse contains the HTTP response code and headers from the
  12264. // server.
  12265. googleapi.ServerResponse `json:"-"`
  12266. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12267. // to unconditionally include in API requests. By default, fields with
  12268. // empty values are omitted from API requests. However, any non-pointer,
  12269. // non-interface field appearing in ForceSendFields will be sent to the
  12270. // server regardless of whether the field is empty or not. This may be
  12271. // used to include empty fields in Patch requests.
  12272. ForceSendFields []string `json:"-"`
  12273. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12274. // include in API requests with the JSON null value. By default, fields
  12275. // with empty values are omitted from API requests. However, any field
  12276. // with an empty value appearing in NullFields will be sent to the
  12277. // server as null. It is an error if a field in this list has a
  12278. // non-empty value. This may be used to include null fields in Patch
  12279. // requests.
  12280. NullFields []string `json:"-"`
  12281. }
  12282. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  12283. type NoMethod InstanceGroup
  12284. raw := NoMethod(*s)
  12285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12286. }
  12287. type InstanceGroupAggregatedList struct {
  12288. // Id: [Output Only] Unique identifier for the resource; defined by the
  12289. // server.
  12290. Id string `json:"id,omitempty"`
  12291. // Items: A list of InstanceGroupsScopedList resources.
  12292. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  12293. // Kind: [Output Only] The resource type, which is always
  12294. // compute#instanceGroupAggregatedList for aggregated lists of instance
  12295. // groups.
  12296. Kind string `json:"kind,omitempty"`
  12297. // NextPageToken: [Output Only] This token allows you to get the next
  12298. // page of results for list requests. If the number of results is larger
  12299. // than maxResults, use the nextPageToken as a value for the query
  12300. // parameter pageToken in the next list request. Subsequent list
  12301. // requests will have their own nextPageToken to continue paging through
  12302. // the results.
  12303. NextPageToken string `json:"nextPageToken,omitempty"`
  12304. // SelfLink: [Output Only] Server-defined URL for this resource.
  12305. SelfLink string `json:"selfLink,omitempty"`
  12306. // Warning: [Output Only] Informational warning message.
  12307. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  12308. // ServerResponse contains the HTTP response code and headers from the
  12309. // server.
  12310. googleapi.ServerResponse `json:"-"`
  12311. // ForceSendFields is a list of field names (e.g. "Id") to
  12312. // unconditionally include in API requests. By default, fields with
  12313. // empty values are omitted from API requests. However, any non-pointer,
  12314. // non-interface field appearing in ForceSendFields will be sent to the
  12315. // server regardless of whether the field is empty or not. This may be
  12316. // used to include empty fields in Patch requests.
  12317. ForceSendFields []string `json:"-"`
  12318. // NullFields is a list of field names (e.g. "Id") to include in API
  12319. // requests with the JSON null value. By default, fields with empty
  12320. // values are omitted from API requests. However, any field with an
  12321. // empty value appearing in NullFields will be sent to the server as
  12322. // null. It is an error if a field in this list has a non-empty value.
  12323. // This may be used to include null fields in Patch requests.
  12324. NullFields []string `json:"-"`
  12325. }
  12326. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  12327. type NoMethod InstanceGroupAggregatedList
  12328. raw := NoMethod(*s)
  12329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12330. }
  12331. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  12332. // warning message.
  12333. type InstanceGroupAggregatedListWarning struct {
  12334. // Code: [Output Only] A warning code, if applicable. For example,
  12335. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12336. // the response.
  12337. //
  12338. // Possible values:
  12339. // "CLEANUP_FAILED"
  12340. // "DEPRECATED_RESOURCE_USED"
  12341. // "DEPRECATED_TYPE_USED"
  12342. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12343. // "EXPERIMENTAL_TYPE_USED"
  12344. // "EXTERNAL_API_WARNING"
  12345. // "FIELD_VALUE_OVERRIDEN"
  12346. // "INJECTED_KERNELS_DEPRECATED"
  12347. // "MISSING_TYPE_DEPENDENCY"
  12348. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12349. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12350. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12351. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12352. // "NEXT_HOP_NOT_RUNNING"
  12353. // "NOT_CRITICAL_ERROR"
  12354. // "NO_RESULTS_ON_PAGE"
  12355. // "REQUIRED_TOS_AGREEMENT"
  12356. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12357. // "RESOURCE_NOT_DELETED"
  12358. // "SCHEMA_VALIDATION_IGNORED"
  12359. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12360. // "UNDECLARED_PROPERTIES"
  12361. // "UNREACHABLE"
  12362. Code string `json:"code,omitempty"`
  12363. // Data: [Output Only] Metadata about this warning in key: value format.
  12364. // For example:
  12365. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12366. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  12367. // Message: [Output Only] A human-readable description of the warning
  12368. // code.
  12369. Message string `json:"message,omitempty"`
  12370. // ForceSendFields is a list of field names (e.g. "Code") to
  12371. // unconditionally include in API requests. By default, fields with
  12372. // empty values are omitted from API requests. However, any non-pointer,
  12373. // non-interface field appearing in ForceSendFields will be sent to the
  12374. // server regardless of whether the field is empty or not. This may be
  12375. // used to include empty fields in Patch requests.
  12376. ForceSendFields []string `json:"-"`
  12377. // NullFields is a list of field names (e.g. "Code") to include in API
  12378. // requests with the JSON null value. By default, fields with empty
  12379. // values are omitted from API requests. However, any field with an
  12380. // empty value appearing in NullFields will be sent to the server as
  12381. // null. It is an error if a field in this list has a non-empty value.
  12382. // This may be used to include null fields in Patch requests.
  12383. NullFields []string `json:"-"`
  12384. }
  12385. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  12386. type NoMethod InstanceGroupAggregatedListWarning
  12387. raw := NoMethod(*s)
  12388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12389. }
  12390. type InstanceGroupAggregatedListWarningData struct {
  12391. // Key: [Output Only] A key that provides more detail on the warning
  12392. // being returned. For example, for warnings where there are no results
  12393. // in a list request for a particular zone, this key might be scope and
  12394. // the key value might be the zone name. Other examples might be a key
  12395. // indicating a deprecated resource and a suggested replacement, or a
  12396. // warning about invalid network settings (for example, if an instance
  12397. // attempts to perform IP forwarding but is not enabled for IP
  12398. // forwarding).
  12399. Key string `json:"key,omitempty"`
  12400. // Value: [Output Only] A warning data value corresponding to the key.
  12401. Value string `json:"value,omitempty"`
  12402. // ForceSendFields is a list of field names (e.g. "Key") to
  12403. // unconditionally include in API requests. By default, fields with
  12404. // empty values are omitted from API requests. However, any non-pointer,
  12405. // non-interface field appearing in ForceSendFields will be sent to the
  12406. // server regardless of whether the field is empty or not. This may be
  12407. // used to include empty fields in Patch requests.
  12408. ForceSendFields []string `json:"-"`
  12409. // NullFields is a list of field names (e.g. "Key") to include in API
  12410. // requests with the JSON null value. By default, fields with empty
  12411. // values are omitted from API requests. However, any field with an
  12412. // empty value appearing in NullFields will be sent to the server as
  12413. // null. It is an error if a field in this list has a non-empty value.
  12414. // This may be used to include null fields in Patch requests.
  12415. NullFields []string `json:"-"`
  12416. }
  12417. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  12418. type NoMethod InstanceGroupAggregatedListWarningData
  12419. raw := NoMethod(*s)
  12420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12421. }
  12422. // InstanceGroupList: A list of InstanceGroup resources.
  12423. type InstanceGroupList struct {
  12424. // Id: [Output Only] Unique identifier for the resource; defined by the
  12425. // server.
  12426. Id string `json:"id,omitempty"`
  12427. // Items: A list of InstanceGroup resources.
  12428. Items []*InstanceGroup `json:"items,omitempty"`
  12429. // Kind: [Output Only] The resource type, which is always
  12430. // compute#instanceGroupList for instance group lists.
  12431. Kind string `json:"kind,omitempty"`
  12432. // NextPageToken: [Output Only] This token allows you to get the next
  12433. // page of results for list requests. If the number of results is larger
  12434. // than maxResults, use the nextPageToken as a value for the query
  12435. // parameter pageToken in the next list request. Subsequent list
  12436. // requests will have their own nextPageToken to continue paging through
  12437. // the results.
  12438. NextPageToken string `json:"nextPageToken,omitempty"`
  12439. // SelfLink: [Output Only] Server-defined URL for this resource.
  12440. SelfLink string `json:"selfLink,omitempty"`
  12441. // Warning: [Output Only] Informational warning message.
  12442. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  12443. // ServerResponse contains the HTTP response code and headers from the
  12444. // server.
  12445. googleapi.ServerResponse `json:"-"`
  12446. // ForceSendFields is a list of field names (e.g. "Id") to
  12447. // unconditionally include in API requests. By default, fields with
  12448. // empty values are omitted from API requests. However, any non-pointer,
  12449. // non-interface field appearing in ForceSendFields will be sent to the
  12450. // server regardless of whether the field is empty or not. This may be
  12451. // used to include empty fields in Patch requests.
  12452. ForceSendFields []string `json:"-"`
  12453. // NullFields is a list of field names (e.g. "Id") to include in API
  12454. // requests with the JSON null value. By default, fields with empty
  12455. // values are omitted from API requests. However, any field with an
  12456. // empty value appearing in NullFields will be sent to the server as
  12457. // null. It is an error if a field in this list has a non-empty value.
  12458. // This may be used to include null fields in Patch requests.
  12459. NullFields []string `json:"-"`
  12460. }
  12461. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  12462. type NoMethod InstanceGroupList
  12463. raw := NoMethod(*s)
  12464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12465. }
  12466. // InstanceGroupListWarning: [Output Only] Informational warning
  12467. // message.
  12468. type InstanceGroupListWarning struct {
  12469. // Code: [Output Only] A warning code, if applicable. For example,
  12470. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12471. // the response.
  12472. //
  12473. // Possible values:
  12474. // "CLEANUP_FAILED"
  12475. // "DEPRECATED_RESOURCE_USED"
  12476. // "DEPRECATED_TYPE_USED"
  12477. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12478. // "EXPERIMENTAL_TYPE_USED"
  12479. // "EXTERNAL_API_WARNING"
  12480. // "FIELD_VALUE_OVERRIDEN"
  12481. // "INJECTED_KERNELS_DEPRECATED"
  12482. // "MISSING_TYPE_DEPENDENCY"
  12483. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12484. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12485. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12486. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12487. // "NEXT_HOP_NOT_RUNNING"
  12488. // "NOT_CRITICAL_ERROR"
  12489. // "NO_RESULTS_ON_PAGE"
  12490. // "REQUIRED_TOS_AGREEMENT"
  12491. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12492. // "RESOURCE_NOT_DELETED"
  12493. // "SCHEMA_VALIDATION_IGNORED"
  12494. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12495. // "UNDECLARED_PROPERTIES"
  12496. // "UNREACHABLE"
  12497. Code string `json:"code,omitempty"`
  12498. // Data: [Output Only] Metadata about this warning in key: value format.
  12499. // For example:
  12500. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12501. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  12502. // Message: [Output Only] A human-readable description of the warning
  12503. // code.
  12504. Message string `json:"message,omitempty"`
  12505. // ForceSendFields is a list of field names (e.g. "Code") to
  12506. // unconditionally include in API requests. By default, fields with
  12507. // empty values are omitted from API requests. However, any non-pointer,
  12508. // non-interface field appearing in ForceSendFields will be sent to the
  12509. // server regardless of whether the field is empty or not. This may be
  12510. // used to include empty fields in Patch requests.
  12511. ForceSendFields []string `json:"-"`
  12512. // NullFields is a list of field names (e.g. "Code") to include in API
  12513. // requests with the JSON null value. By default, fields with empty
  12514. // values are omitted from API requests. However, any field with an
  12515. // empty value appearing in NullFields will be sent to the server as
  12516. // null. It is an error if a field in this list has a non-empty value.
  12517. // This may be used to include null fields in Patch requests.
  12518. NullFields []string `json:"-"`
  12519. }
  12520. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  12521. type NoMethod InstanceGroupListWarning
  12522. raw := NoMethod(*s)
  12523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12524. }
  12525. type InstanceGroupListWarningData struct {
  12526. // Key: [Output Only] A key that provides more detail on the warning
  12527. // being returned. For example, for warnings where there are no results
  12528. // in a list request for a particular zone, this key might be scope and
  12529. // the key value might be the zone name. Other examples might be a key
  12530. // indicating a deprecated resource and a suggested replacement, or a
  12531. // warning about invalid network settings (for example, if an instance
  12532. // attempts to perform IP forwarding but is not enabled for IP
  12533. // forwarding).
  12534. Key string `json:"key,omitempty"`
  12535. // Value: [Output Only] A warning data value corresponding to the key.
  12536. Value string `json:"value,omitempty"`
  12537. // ForceSendFields is a list of field names (e.g. "Key") to
  12538. // unconditionally include in API requests. By default, fields with
  12539. // empty values are omitted from API requests. However, any non-pointer,
  12540. // non-interface field appearing in ForceSendFields will be sent to the
  12541. // server regardless of whether the field is empty or not. This may be
  12542. // used to include empty fields in Patch requests.
  12543. ForceSendFields []string `json:"-"`
  12544. // NullFields is a list of field names (e.g. "Key") to include in API
  12545. // requests with the JSON null value. By default, fields with empty
  12546. // values are omitted from API requests. However, any field with an
  12547. // empty value appearing in NullFields will be sent to the server as
  12548. // null. It is an error if a field in this list has a non-empty value.
  12549. // This may be used to include null fields in Patch requests.
  12550. NullFields []string `json:"-"`
  12551. }
  12552. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  12553. type NoMethod InstanceGroupListWarningData
  12554. raw := NoMethod(*s)
  12555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12556. }
  12557. // InstanceGroupManager: An Instance Group Manager resource. (==
  12558. // resource_for beta.instanceGroupManagers ==) (== resource_for
  12559. // v1.instanceGroupManagers ==) (== resource_for
  12560. // beta.regionInstanceGroupManagers ==) (== resource_for
  12561. // v1.regionInstanceGroupManagers ==)
  12562. type InstanceGroupManager struct {
  12563. // AutoHealingPolicies: The autohealing policy for this managed instance
  12564. // group. You can specify only one value.
  12565. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  12566. // BaseInstanceName: The base instance name to use for instances in this
  12567. // group. The value must be 1-58 characters long. Instances are named by
  12568. // appending a hyphen and a random four-character string to the base
  12569. // instance name. The base instance name must comply with RFC1035.
  12570. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  12571. // CreationTimestamp: [Output Only] The creation timestamp for this
  12572. // managed instance group in RFC3339 text format.
  12573. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12574. // CurrentActions: [Output Only] The list of instance actions and the
  12575. // number of instances in this managed instance group that are scheduled
  12576. // for each of those actions.
  12577. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  12578. // Description: An optional description of this resource. Provide this
  12579. // property when you create the resource.
  12580. Description string `json:"description,omitempty"`
  12581. // DistributionPolicy: Policy specifying intended distribution of
  12582. // instances in regional managed instance group.
  12583. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  12584. // FailoverAction: The action to perform in case of zone failure. Only
  12585. // one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
  12586. //
  12587. // Possible values:
  12588. // "NO_FAILOVER"
  12589. // "UNKNOWN"
  12590. FailoverAction string `json:"failoverAction,omitempty"`
  12591. // Fingerprint: Fingerprint of this resource. This field may be used in
  12592. // optimistic locking. It will be ignored when inserting an
  12593. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  12594. // order to update the InstanceGroupManager, otherwise the request will
  12595. // fail with error 412 conditionNotMet.
  12596. //
  12597. // To see the latest fingerprint, make a get() request to retrieve an
  12598. // InstanceGroupManager.
  12599. Fingerprint string `json:"fingerprint,omitempty"`
  12600. // Id: [Output Only] A unique identifier for this resource type. The
  12601. // server generates this identifier.
  12602. Id uint64 `json:"id,omitempty,string"`
  12603. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  12604. InstanceGroup string `json:"instanceGroup,omitempty"`
  12605. // InstanceTemplate: The URL of the instance template that is specified
  12606. // for this managed instance group. The group uses this template to
  12607. // create all new instances in the managed instance group.
  12608. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  12609. // Kind: [Output Only] The resource type, which is always
  12610. // compute#instanceGroupManager for managed instance groups.
  12611. Kind string `json:"kind,omitempty"`
  12612. // Name: The name of the managed instance group. The name must be 1-63
  12613. // characters long, and comply with RFC1035.
  12614. Name string `json:"name,omitempty"`
  12615. // NamedPorts: Named ports configured for the Instance Groups
  12616. // complementary to this Instance Group Manager.
  12617. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  12618. // PendingActions: [Output Only] The list of instance actions and the
  12619. // number of instances in this managed instance group that are pending
  12620. // for each of those actions.
  12621. PendingActions *InstanceGroupManagerPendingActionsSummary `json:"pendingActions,omitempty"`
  12622. // Region: [Output Only] The URL of the region where the managed
  12623. // instance group resides (for regional resources).
  12624. Region string `json:"region,omitempty"`
  12625. // SelfLink: [Output Only] The URL for this managed instance group. The
  12626. // server defines this URL.
  12627. SelfLink string `json:"selfLink,omitempty"`
  12628. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  12629. // with the resource id.
  12630. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  12631. // ServiceAccount: The service account to be used as credentials for all
  12632. // operations performed by the managed instance group on instances. The
  12633. // service accounts needs all permissions required to create and delete
  12634. // instances. By default, the service account
  12635. // {projectNumber}@cloudservices.gserviceaccount.com is used.
  12636. ServiceAccount string `json:"serviceAccount,omitempty"`
  12637. // StatefulPolicy: Stateful configuration for this Instanced Group
  12638. // Manager
  12639. StatefulPolicy *StatefulPolicy `json:"statefulPolicy,omitempty"`
  12640. // Status: [Output Only] The status of this managed instance group.
  12641. Status *InstanceGroupManagerStatus `json:"status,omitempty"`
  12642. // TargetPools: The URLs for all TargetPool resources to which instances
  12643. // in the instanceGroup field are added. The target pools automatically
  12644. // apply to all of the instances in the managed instance group.
  12645. TargetPools []string `json:"targetPools,omitempty"`
  12646. // TargetSize: The target number of running instances for this managed
  12647. // instance group. Deleting or abandoning instances reduces this number.
  12648. // Resizing the group changes this number.
  12649. TargetSize int64 `json:"targetSize,omitempty"`
  12650. // UpdatePolicy: The update policy for this managed instance group.
  12651. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  12652. // Versions: Specifies the instance templates used by this managed
  12653. // instance group to create instances.
  12654. //
  12655. // Each version is defined by an instanceTemplate. Every template can
  12656. // appear at most once per instance group. This field overrides the
  12657. // top-level instanceTemplate field. Read more about the relationships
  12658. // between these fields. Exactly one version must leave the targetSize
  12659. // field unset. That version will be applied to all remaining instances.
  12660. // For more information, read about canary updates.
  12661. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  12662. // Zone: [Output Only] The URL of the zone where the managed instance
  12663. // group is located (for zonal resources).
  12664. Zone string `json:"zone,omitempty"`
  12665. // ServerResponse contains the HTTP response code and headers from the
  12666. // server.
  12667. googleapi.ServerResponse `json:"-"`
  12668. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  12669. // to unconditionally include in API requests. By default, fields with
  12670. // empty values are omitted from API requests. However, any non-pointer,
  12671. // non-interface field appearing in ForceSendFields will be sent to the
  12672. // server regardless of whether the field is empty or not. This may be
  12673. // used to include empty fields in Patch requests.
  12674. ForceSendFields []string `json:"-"`
  12675. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  12676. // include in API requests with the JSON null value. By default, fields
  12677. // with empty values are omitted from API requests. However, any field
  12678. // with an empty value appearing in NullFields will be sent to the
  12679. // server as null. It is an error if a field in this list has a
  12680. // non-empty value. This may be used to include null fields in Patch
  12681. // requests.
  12682. NullFields []string `json:"-"`
  12683. }
  12684. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  12685. type NoMethod InstanceGroupManager
  12686. raw := NoMethod(*s)
  12687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12688. }
  12689. type InstanceGroupManagerActionsSummary struct {
  12690. // Abandoning: [Output Only] The total number of instances in the
  12691. // managed instance group that are scheduled to be abandoned. Abandoning
  12692. // an instance removes it from the managed instance group without
  12693. // deleting it.
  12694. Abandoning int64 `json:"abandoning,omitempty"`
  12695. // Creating: [Output Only] The number of instances in the managed
  12696. // instance group that are scheduled to be created or are currently
  12697. // being created. If the group fails to create any of these instances,
  12698. // it tries again until it creates the instance successfully.
  12699. //
  12700. // If you have disabled creation retries, this field will not be
  12701. // populated; instead, the creatingWithoutRetries field will be
  12702. // populated.
  12703. Creating int64 `json:"creating,omitempty"`
  12704. // CreatingWithoutRetries: [Output Only] The number of instances that
  12705. // the managed instance group will attempt to create. The group attempts
  12706. // to create each instance only once. If the group fails to create any
  12707. // of these instances, it decreases the group's targetSize value
  12708. // accordingly.
  12709. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  12710. // Deleting: [Output Only] The number of instances in the managed
  12711. // instance group that are scheduled to be deleted or are currently
  12712. // being deleted.
  12713. Deleting int64 `json:"deleting,omitempty"`
  12714. // None: [Output Only] The number of instances in the managed instance
  12715. // group that are running and have no scheduled actions.
  12716. None int64 `json:"none,omitempty"`
  12717. // Recreating: [Output Only] The number of instances in the managed
  12718. // instance group that are scheduled to be recreated or are currently
  12719. // being being recreated. Recreating an instance deletes the existing
  12720. // root persistent disk and creates a new disk from the image that is
  12721. // defined in the instance template.
  12722. Recreating int64 `json:"recreating,omitempty"`
  12723. // Refreshing: [Output Only] The number of instances in the managed
  12724. // instance group that are being reconfigured with properties that do
  12725. // not require a restart or a recreate action. For example, setting or
  12726. // removing target pools for the instance.
  12727. Refreshing int64 `json:"refreshing,omitempty"`
  12728. // Restarting: [Output Only] The number of instances in the managed
  12729. // instance group that are scheduled to be restarted or are currently
  12730. // being restarted.
  12731. Restarting int64 `json:"restarting,omitempty"`
  12732. // Verifying: [Output Only] The number of instances in the managed
  12733. // instance group that are being verified. See the
  12734. // managedInstances[].currentAction property in the listManagedInstances
  12735. // method documentation.
  12736. Verifying int64 `json:"verifying,omitempty"`
  12737. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  12738. // unconditionally include in API requests. By default, fields with
  12739. // empty values are omitted from API requests. However, any non-pointer,
  12740. // non-interface field appearing in ForceSendFields will be sent to the
  12741. // server regardless of whether the field is empty or not. This may be
  12742. // used to include empty fields in Patch requests.
  12743. ForceSendFields []string `json:"-"`
  12744. // NullFields is a list of field names (e.g. "Abandoning") to include in
  12745. // API requests with the JSON null value. By default, fields with empty
  12746. // values are omitted from API requests. However, any field with an
  12747. // empty value appearing in NullFields will be sent to the server as
  12748. // null. It is an error if a field in this list has a non-empty value.
  12749. // This may be used to include null fields in Patch requests.
  12750. NullFields []string `json:"-"`
  12751. }
  12752. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  12753. type NoMethod InstanceGroupManagerActionsSummary
  12754. raw := NoMethod(*s)
  12755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12756. }
  12757. type InstanceGroupManagerAggregatedList struct {
  12758. // Id: [Output Only] Unique identifier for the resource; defined by the
  12759. // server.
  12760. Id string `json:"id,omitempty"`
  12761. // Items: A list of InstanceGroupManagersScopedList resources.
  12762. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  12763. // Kind: [Output Only] The resource type, which is always
  12764. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  12765. // managed instance groups.
  12766. Kind string `json:"kind,omitempty"`
  12767. // NextPageToken: [Output Only] This token allows you to get the next
  12768. // page of results for list requests. If the number of results is larger
  12769. // than maxResults, use the nextPageToken as a value for the query
  12770. // parameter pageToken in the next list request. Subsequent list
  12771. // requests will have their own nextPageToken to continue paging through
  12772. // the results.
  12773. NextPageToken string `json:"nextPageToken,omitempty"`
  12774. // SelfLink: [Output Only] Server-defined URL for this resource.
  12775. SelfLink string `json:"selfLink,omitempty"`
  12776. // Warning: [Output Only] Informational warning message.
  12777. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  12778. // ServerResponse contains the HTTP response code and headers from the
  12779. // server.
  12780. googleapi.ServerResponse `json:"-"`
  12781. // ForceSendFields is a list of field names (e.g. "Id") to
  12782. // unconditionally include in API requests. By default, fields with
  12783. // empty values are omitted from API requests. However, any non-pointer,
  12784. // non-interface field appearing in ForceSendFields will be sent to the
  12785. // server regardless of whether the field is empty or not. This may be
  12786. // used to include empty fields in Patch requests.
  12787. ForceSendFields []string `json:"-"`
  12788. // NullFields is a list of field names (e.g. "Id") to include in API
  12789. // requests with the JSON null value. By default, fields with empty
  12790. // values are omitted from API requests. However, any field with an
  12791. // empty value appearing in NullFields will be sent to the server as
  12792. // null. It is an error if a field in this list has a non-empty value.
  12793. // This may be used to include null fields in Patch requests.
  12794. NullFields []string `json:"-"`
  12795. }
  12796. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  12797. type NoMethod InstanceGroupManagerAggregatedList
  12798. raw := NoMethod(*s)
  12799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12800. }
  12801. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  12802. // Informational warning message.
  12803. type InstanceGroupManagerAggregatedListWarning struct {
  12804. // Code: [Output Only] A warning code, if applicable. For example,
  12805. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12806. // the response.
  12807. //
  12808. // Possible values:
  12809. // "CLEANUP_FAILED"
  12810. // "DEPRECATED_RESOURCE_USED"
  12811. // "DEPRECATED_TYPE_USED"
  12812. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12813. // "EXPERIMENTAL_TYPE_USED"
  12814. // "EXTERNAL_API_WARNING"
  12815. // "FIELD_VALUE_OVERRIDEN"
  12816. // "INJECTED_KERNELS_DEPRECATED"
  12817. // "MISSING_TYPE_DEPENDENCY"
  12818. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12819. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12820. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12821. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12822. // "NEXT_HOP_NOT_RUNNING"
  12823. // "NOT_CRITICAL_ERROR"
  12824. // "NO_RESULTS_ON_PAGE"
  12825. // "REQUIRED_TOS_AGREEMENT"
  12826. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12827. // "RESOURCE_NOT_DELETED"
  12828. // "SCHEMA_VALIDATION_IGNORED"
  12829. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12830. // "UNDECLARED_PROPERTIES"
  12831. // "UNREACHABLE"
  12832. Code string `json:"code,omitempty"`
  12833. // Data: [Output Only] Metadata about this warning in key: value format.
  12834. // For example:
  12835. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12836. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  12837. // Message: [Output Only] A human-readable description of the warning
  12838. // code.
  12839. Message string `json:"message,omitempty"`
  12840. // ForceSendFields is a list of field names (e.g. "Code") to
  12841. // unconditionally include in API requests. By default, fields with
  12842. // empty values are omitted from API requests. However, any non-pointer,
  12843. // non-interface field appearing in ForceSendFields will be sent to the
  12844. // server regardless of whether the field is empty or not. This may be
  12845. // used to include empty fields in Patch requests.
  12846. ForceSendFields []string `json:"-"`
  12847. // NullFields is a list of field names (e.g. "Code") to include in API
  12848. // requests with the JSON null value. By default, fields with empty
  12849. // values are omitted from API requests. However, any field with an
  12850. // empty value appearing in NullFields will be sent to the server as
  12851. // null. It is an error if a field in this list has a non-empty value.
  12852. // This may be used to include null fields in Patch requests.
  12853. NullFields []string `json:"-"`
  12854. }
  12855. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  12856. type NoMethod InstanceGroupManagerAggregatedListWarning
  12857. raw := NoMethod(*s)
  12858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12859. }
  12860. type InstanceGroupManagerAggregatedListWarningData struct {
  12861. // Key: [Output Only] A key that provides more detail on the warning
  12862. // being returned. For example, for warnings where there are no results
  12863. // in a list request for a particular zone, this key might be scope and
  12864. // the key value might be the zone name. Other examples might be a key
  12865. // indicating a deprecated resource and a suggested replacement, or a
  12866. // warning about invalid network settings (for example, if an instance
  12867. // attempts to perform IP forwarding but is not enabled for IP
  12868. // forwarding).
  12869. Key string `json:"key,omitempty"`
  12870. // Value: [Output Only] A warning data value corresponding to the key.
  12871. Value string `json:"value,omitempty"`
  12872. // ForceSendFields is a list of field names (e.g. "Key") to
  12873. // unconditionally include in API requests. By default, fields with
  12874. // empty values are omitted from API requests. However, any non-pointer,
  12875. // non-interface field appearing in ForceSendFields will be sent to the
  12876. // server regardless of whether the field is empty or not. This may be
  12877. // used to include empty fields in Patch requests.
  12878. ForceSendFields []string `json:"-"`
  12879. // NullFields is a list of field names (e.g. "Key") to include in API
  12880. // requests with the JSON null value. By default, fields with empty
  12881. // values are omitted from API requests. However, any field with an
  12882. // empty value appearing in NullFields will be sent to the server as
  12883. // null. It is an error if a field in this list has a non-empty value.
  12884. // This may be used to include null fields in Patch requests.
  12885. NullFields []string `json:"-"`
  12886. }
  12887. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  12888. type NoMethod InstanceGroupManagerAggregatedListWarningData
  12889. raw := NoMethod(*s)
  12890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12891. }
  12892. type InstanceGroupManagerAutoHealingPolicy struct {
  12893. // HealthCheck: The URL for the health check that signals autohealing.
  12894. HealthCheck string `json:"healthCheck,omitempty"`
  12895. // InitialDelaySec: The number of seconds that the managed instance
  12896. // group waits before it applies autohealing policies to new instances
  12897. // or recently recreated instances. This initial delay allows instances
  12898. // to initialize and run their startup scripts before the instance group
  12899. // determines that they are UNHEALTHY. This prevents the managed
  12900. // instance group from recreating its instances prematurely. This value
  12901. // must be from range [0, 3600].
  12902. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  12903. // MaxUnavailable: Maximum number of instances that can be unavailable
  12904. // when autohealing. When 'percent' is used, the value is rounded UP.
  12905. // The instance is considered available if all of the following
  12906. // conditions are satisfied: 1. Instance's status is RUNNING. 2.
  12907. // Instance's currentAction is NONE (in particular its liveness health
  12908. // check result was observed to be HEALTHY at least once as it passed
  12909. // VERIFYING). 3. There is no outgoing action on an instance triggered
  12910. // by IGM.
  12911. //
  12912. // By default, number of concurrently autohealed instances is smaller
  12913. // than the managed instance group target size. However, if a zonal
  12914. // managed instance group has only one instance, or a regional managed
  12915. // instance group has only one instance per zone, autohealing will
  12916. // recreate these instances when they become unhealthy.
  12917. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  12918. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  12919. // unconditionally include in API requests. By default, fields with
  12920. // empty values are omitted from API requests. However, any non-pointer,
  12921. // non-interface field appearing in ForceSendFields will be sent to the
  12922. // server regardless of whether the field is empty or not. This may be
  12923. // used to include empty fields in Patch requests.
  12924. ForceSendFields []string `json:"-"`
  12925. // NullFields is a list of field names (e.g. "HealthCheck") to include
  12926. // in API requests with the JSON null value. By default, fields with
  12927. // empty values are omitted from API requests. However, any field with
  12928. // an empty value appearing in NullFields will be sent to the server as
  12929. // null. It is an error if a field in this list has a non-empty value.
  12930. // This may be used to include null fields in Patch requests.
  12931. NullFields []string `json:"-"`
  12932. }
  12933. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  12934. type NoMethod InstanceGroupManagerAutoHealingPolicy
  12935. raw := NoMethod(*s)
  12936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12937. }
  12938. // InstanceGroupManagerList: [Output Only] A list of managed instance
  12939. // groups.
  12940. type InstanceGroupManagerList struct {
  12941. // Id: [Output Only] Unique identifier for the resource; defined by the
  12942. // server.
  12943. Id string `json:"id,omitempty"`
  12944. // Items: A list of InstanceGroupManager resources.
  12945. Items []*InstanceGroupManager `json:"items,omitempty"`
  12946. // Kind: [Output Only] The resource type, which is always
  12947. // compute#instanceGroupManagerList for a list of managed instance
  12948. // groups.
  12949. Kind string `json:"kind,omitempty"`
  12950. // NextPageToken: [Output Only] This token allows you to get the next
  12951. // page of results for list requests. If the number of results is larger
  12952. // than maxResults, use the nextPageToken as a value for the query
  12953. // parameter pageToken in the next list request. Subsequent list
  12954. // requests will have their own nextPageToken to continue paging through
  12955. // the results.
  12956. NextPageToken string `json:"nextPageToken,omitempty"`
  12957. // SelfLink: [Output Only] Server-defined URL for this resource.
  12958. SelfLink string `json:"selfLink,omitempty"`
  12959. // Warning: [Output Only] Informational warning message.
  12960. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  12961. // ServerResponse contains the HTTP response code and headers from the
  12962. // server.
  12963. googleapi.ServerResponse `json:"-"`
  12964. // ForceSendFields is a list of field names (e.g. "Id") to
  12965. // unconditionally include in API requests. By default, fields with
  12966. // empty values are omitted from API requests. However, any non-pointer,
  12967. // non-interface field appearing in ForceSendFields will be sent to the
  12968. // server regardless of whether the field is empty or not. This may be
  12969. // used to include empty fields in Patch requests.
  12970. ForceSendFields []string `json:"-"`
  12971. // NullFields is a list of field names (e.g. "Id") to include in API
  12972. // requests with the JSON null value. By default, fields with empty
  12973. // values are omitted from API requests. However, any field with an
  12974. // empty value appearing in NullFields will be sent to the server as
  12975. // null. It is an error if a field in this list has a non-empty value.
  12976. // This may be used to include null fields in Patch requests.
  12977. NullFields []string `json:"-"`
  12978. }
  12979. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  12980. type NoMethod InstanceGroupManagerList
  12981. raw := NoMethod(*s)
  12982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12983. }
  12984. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  12985. // message.
  12986. type InstanceGroupManagerListWarning struct {
  12987. // Code: [Output Only] A warning code, if applicable. For example,
  12988. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12989. // the response.
  12990. //
  12991. // Possible values:
  12992. // "CLEANUP_FAILED"
  12993. // "DEPRECATED_RESOURCE_USED"
  12994. // "DEPRECATED_TYPE_USED"
  12995. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12996. // "EXPERIMENTAL_TYPE_USED"
  12997. // "EXTERNAL_API_WARNING"
  12998. // "FIELD_VALUE_OVERRIDEN"
  12999. // "INJECTED_KERNELS_DEPRECATED"
  13000. // "MISSING_TYPE_DEPENDENCY"
  13001. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13002. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13003. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13004. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13005. // "NEXT_HOP_NOT_RUNNING"
  13006. // "NOT_CRITICAL_ERROR"
  13007. // "NO_RESULTS_ON_PAGE"
  13008. // "REQUIRED_TOS_AGREEMENT"
  13009. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13010. // "RESOURCE_NOT_DELETED"
  13011. // "SCHEMA_VALIDATION_IGNORED"
  13012. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13013. // "UNDECLARED_PROPERTIES"
  13014. // "UNREACHABLE"
  13015. Code string `json:"code,omitempty"`
  13016. // Data: [Output Only] Metadata about this warning in key: value format.
  13017. // For example:
  13018. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13019. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  13020. // Message: [Output Only] A human-readable description of the warning
  13021. // code.
  13022. Message string `json:"message,omitempty"`
  13023. // ForceSendFields is a list of field names (e.g. "Code") to
  13024. // unconditionally include in API requests. By default, fields with
  13025. // empty values are omitted from API requests. However, any non-pointer,
  13026. // non-interface field appearing in ForceSendFields will be sent to the
  13027. // server regardless of whether the field is empty or not. This may be
  13028. // used to include empty fields in Patch requests.
  13029. ForceSendFields []string `json:"-"`
  13030. // NullFields is a list of field names (e.g. "Code") to include in API
  13031. // requests with the JSON null value. By default, fields with empty
  13032. // values are omitted from API requests. However, any field with an
  13033. // empty value appearing in NullFields will be sent to the server as
  13034. // null. It is an error if a field in this list has a non-empty value.
  13035. // This may be used to include null fields in Patch requests.
  13036. NullFields []string `json:"-"`
  13037. }
  13038. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  13039. type NoMethod InstanceGroupManagerListWarning
  13040. raw := NoMethod(*s)
  13041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13042. }
  13043. type InstanceGroupManagerListWarningData struct {
  13044. // Key: [Output Only] A key that provides more detail on the warning
  13045. // being returned. For example, for warnings where there are no results
  13046. // in a list request for a particular zone, this key might be scope and
  13047. // the key value might be the zone name. Other examples might be a key
  13048. // indicating a deprecated resource and a suggested replacement, or a
  13049. // warning about invalid network settings (for example, if an instance
  13050. // attempts to perform IP forwarding but is not enabled for IP
  13051. // forwarding).
  13052. Key string `json:"key,omitempty"`
  13053. // Value: [Output Only] A warning data value corresponding to the key.
  13054. Value string `json:"value,omitempty"`
  13055. // ForceSendFields is a list of field names (e.g. "Key") to
  13056. // unconditionally include in API requests. By default, fields with
  13057. // empty values are omitted from API requests. However, any non-pointer,
  13058. // non-interface field appearing in ForceSendFields will be sent to the
  13059. // server regardless of whether the field is empty or not. This may be
  13060. // used to include empty fields in Patch requests.
  13061. ForceSendFields []string `json:"-"`
  13062. // NullFields is a list of field names (e.g. "Key") to include in API
  13063. // requests with the JSON null value. By default, fields with empty
  13064. // values are omitted from API requests. However, any field with an
  13065. // empty value appearing in NullFields will be sent to the server as
  13066. // null. It is an error if a field in this list has a non-empty value.
  13067. // This may be used to include null fields in Patch requests.
  13068. NullFields []string `json:"-"`
  13069. }
  13070. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  13071. type NoMethod InstanceGroupManagerListWarningData
  13072. raw := NoMethod(*s)
  13073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13074. }
  13075. type InstanceGroupManagerPendingActionsSummary struct {
  13076. // Creating: [Output Only] The number of instances in the managed
  13077. // instance group that are pending to be created.
  13078. Creating int64 `json:"creating,omitempty"`
  13079. // Deleting: [Output Only] The number of instances in the managed
  13080. // instance group that are pending to be deleted.
  13081. Deleting int64 `json:"deleting,omitempty"`
  13082. // Recreating: [Output Only] The number of instances in the managed
  13083. // instance group that are pending to be recreated.
  13084. Recreating int64 `json:"recreating,omitempty"`
  13085. // Restarting: [Output Only] The number of instances in the managed
  13086. // instance group that are pending to be restarted.
  13087. Restarting int64 `json:"restarting,omitempty"`
  13088. // ForceSendFields is a list of field names (e.g. "Creating") to
  13089. // unconditionally include in API requests. By default, fields with
  13090. // empty values are omitted from API requests. However, any non-pointer,
  13091. // non-interface field appearing in ForceSendFields will be sent to the
  13092. // server regardless of whether the field is empty or not. This may be
  13093. // used to include empty fields in Patch requests.
  13094. ForceSendFields []string `json:"-"`
  13095. // NullFields is a list of field names (e.g. "Creating") to include in
  13096. // API requests with the JSON null value. By default, fields with empty
  13097. // values are omitted from API requests. However, any field with an
  13098. // empty value appearing in NullFields will be sent to the server as
  13099. // null. It is an error if a field in this list has a non-empty value.
  13100. // This may be used to include null fields in Patch requests.
  13101. NullFields []string `json:"-"`
  13102. }
  13103. func (s *InstanceGroupManagerPendingActionsSummary) MarshalJSON() ([]byte, error) {
  13104. type NoMethod InstanceGroupManagerPendingActionsSummary
  13105. raw := NoMethod(*s)
  13106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13107. }
  13108. type InstanceGroupManagerStatus struct {
  13109. // IsStable: [Output Only] A bit indicating whether the managed instance
  13110. // group is in a stable state. A stable state means that: none of the
  13111. // instances in the managed instance group is currently undergoing any
  13112. // type of change (for example, creation, restart, or deletion); no
  13113. // future changes are scheduled for instances in the managed instance
  13114. // group; and the managed instance group itself is not being modified.
  13115. IsStable bool `json:"isStable,omitempty"`
  13116. // VersionTarget: [Output Only] A status of consistency of Instances'
  13117. // versions with their target version specified by version field on
  13118. // Instance Group Manager.
  13119. VersionTarget *InstanceGroupManagerStatusVersionTarget `json:"versionTarget,omitempty"`
  13120. // ForceSendFields is a list of field names (e.g. "IsStable") to
  13121. // unconditionally include in API requests. By default, fields with
  13122. // empty values are omitted from API requests. However, any non-pointer,
  13123. // non-interface field appearing in ForceSendFields will be sent to the
  13124. // server regardless of whether the field is empty or not. This may be
  13125. // used to include empty fields in Patch requests.
  13126. ForceSendFields []string `json:"-"`
  13127. // NullFields is a list of field names (e.g. "IsStable") to include in
  13128. // API requests with the JSON null value. By default, fields with empty
  13129. // values are omitted from API requests. However, any field with an
  13130. // empty value appearing in NullFields will be sent to the server as
  13131. // null. It is an error if a field in this list has a non-empty value.
  13132. // This may be used to include null fields in Patch requests.
  13133. NullFields []string `json:"-"`
  13134. }
  13135. func (s *InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
  13136. type NoMethod InstanceGroupManagerStatus
  13137. raw := NoMethod(*s)
  13138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13139. }
  13140. type InstanceGroupManagerStatusVersionTarget struct {
  13141. // IsReached: [Output Only] A bit indicating whether version target has
  13142. // been reached in this managed instance group, i.e. all instances are
  13143. // in their target version. Instances' target version are specified by
  13144. // version field on Instance Group Manager.
  13145. IsReached bool `json:"isReached,omitempty"`
  13146. // ForceSendFields is a list of field names (e.g. "IsReached") to
  13147. // unconditionally include in API requests. By default, fields with
  13148. // empty values are omitted from API requests. However, any non-pointer,
  13149. // non-interface field appearing in ForceSendFields will be sent to the
  13150. // server regardless of whether the field is empty or not. This may be
  13151. // used to include empty fields in Patch requests.
  13152. ForceSendFields []string `json:"-"`
  13153. // NullFields is a list of field names (e.g. "IsReached") to include in
  13154. // API requests with the JSON null value. By default, fields with empty
  13155. // values are omitted from API requests. However, any field with an
  13156. // empty value appearing in NullFields will be sent to the server as
  13157. // null. It is an error if a field in this list has a non-empty value.
  13158. // This may be used to include null fields in Patch requests.
  13159. NullFields []string `json:"-"`
  13160. }
  13161. func (s *InstanceGroupManagerStatusVersionTarget) MarshalJSON() ([]byte, error) {
  13162. type NoMethod InstanceGroupManagerStatusVersionTarget
  13163. raw := NoMethod(*s)
  13164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13165. }
  13166. type InstanceGroupManagerUpdatePolicy struct {
  13167. // Possible values:
  13168. // "NONE"
  13169. // "PROACTIVE"
  13170. InstanceRedistributionType string `json:"instanceRedistributionType,omitempty"`
  13171. // MaxSurge: The maximum number of instances that can be created above
  13172. // the specified targetSize during the update process. By default, a
  13173. // fixed value of 1 is used. This value can be either a fixed number or
  13174. // a percentage if the instance group has 10 or more instances. If you
  13175. // set a percentage, the number of instances will be rounded up if
  13176. // necessary.
  13177. //
  13178. // At least one of either maxSurge or maxUnavailable must be greater
  13179. // than 0. Learn more about maxSurge.
  13180. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  13181. // MaxUnavailable: The maximum number of instances that can be
  13182. // unavailable during the update process. An instance is considered
  13183. // available if all of the following conditions are satisfied:
  13184. //
  13185. //
  13186. // - The instance's status is RUNNING.
  13187. // - If there is a health check on the instance group, the instance's
  13188. // liveness health check result must be HEALTHY at least once. If there
  13189. // is no health check on the group, then the instance only needs to have
  13190. // a status of RUNNING to be considered available. By default, a fixed
  13191. // value of 1 is used. This value can be either a fixed number or a
  13192. // percentage if the instance group has 10 or more instances. If you set
  13193. // a percentage, the number of instances will be rounded up if
  13194. // necessary.
  13195. //
  13196. // At least one of either maxSurge or maxUnavailable must be greater
  13197. // than 0. Learn more about maxUnavailable.
  13198. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  13199. // MinReadySec: Minimum number of seconds to wait for after a newly
  13200. // created instance becomes available. This value must be from range [0,
  13201. // 3600].
  13202. MinReadySec int64 `json:"minReadySec,omitempty"`
  13203. // MinimalAction: Minimal action to be taken on an instance. You can
  13204. // specify either RESTART to restart existing instances or REPLACE to
  13205. // delete and create new instances from the target template. If you
  13206. // specify a RESTART, the Updater will attempt to perform that action
  13207. // only. However, if the Updater determines that the minimal action you
  13208. // specify is not enough to perform the update, it might perform a more
  13209. // disruptive action.
  13210. //
  13211. // Possible values:
  13212. // "NONE"
  13213. // "REFRESH"
  13214. // "REPLACE"
  13215. // "RESTART"
  13216. MinimalAction string `json:"minimalAction,omitempty"`
  13217. // ReplacementMethod: What action should be used to replace instances.
  13218. // See minimal_action.REPLACE
  13219. //
  13220. // Possible values:
  13221. // "RECREATE"
  13222. // "SUBSTITUTE"
  13223. ReplacementMethod string `json:"replacementMethod,omitempty"`
  13224. // Possible values:
  13225. // "OPPORTUNISTIC"
  13226. // "PROACTIVE"
  13227. Type string `json:"type,omitempty"`
  13228. // ForceSendFields is a list of field names (e.g.
  13229. // "InstanceRedistributionType") to unconditionally include in API
  13230. // requests. By default, fields with empty values are omitted from API
  13231. // requests. However, any non-pointer, non-interface field appearing in
  13232. // ForceSendFields will be sent to the server regardless of whether the
  13233. // field is empty or not. This may be used to include empty fields in
  13234. // Patch requests.
  13235. ForceSendFields []string `json:"-"`
  13236. // NullFields is a list of field names (e.g.
  13237. // "InstanceRedistributionType") to include in API requests with the
  13238. // JSON null value. By default, fields with empty values are omitted
  13239. // from API requests. However, any field with an empty value appearing
  13240. // in NullFields will be sent to the server as null. It is an error if a
  13241. // field in this list has a non-empty value. This may be used to include
  13242. // null fields in Patch requests.
  13243. NullFields []string `json:"-"`
  13244. }
  13245. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  13246. type NoMethod InstanceGroupManagerUpdatePolicy
  13247. raw := NoMethod(*s)
  13248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13249. }
  13250. type InstanceGroupManagerVersion struct {
  13251. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  13252. // Name: Name of the version. Unique among all versions in the scope of
  13253. // this managed instance group.
  13254. Name string `json:"name,omitempty"`
  13255. // Tag: Tag describing the version. Used to trigger rollout of a target
  13256. // version even if instance_template remains unchanged. Deprecated in
  13257. // favor of 'name'.
  13258. Tag string `json:"tag,omitempty"`
  13259. // TargetSize: Specifies the intended number of instances to be created
  13260. // from the instanceTemplate. The final number of instances created from
  13261. // the template will be equal to:
  13262. // - If expressed as a fixed number, the minimum of either
  13263. // targetSize.fixed or instanceGroupManager.targetSize is used.
  13264. // - if expressed as a percent, the targetSize would be
  13265. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  13266. // is a remainder, the number is rounded up. If unset, this version
  13267. // will update any remaining instances not updated by another version.
  13268. // Read Starting a canary update for more information.
  13269. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  13270. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  13271. // unconditionally include in API requests. By default, fields with
  13272. // empty values are omitted from API requests. However, any non-pointer,
  13273. // non-interface field appearing in ForceSendFields will be sent to the
  13274. // server regardless of whether the field is empty or not. This may be
  13275. // used to include empty fields in Patch requests.
  13276. ForceSendFields []string `json:"-"`
  13277. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  13278. // include in API requests with the JSON null value. By default, fields
  13279. // with empty values are omitted from API requests. However, any field
  13280. // with an empty value appearing in NullFields will be sent to the
  13281. // server as null. It is an error if a field in this list has a
  13282. // non-empty value. This may be used to include null fields in Patch
  13283. // requests.
  13284. NullFields []string `json:"-"`
  13285. }
  13286. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  13287. type NoMethod InstanceGroupManagerVersion
  13288. raw := NoMethod(*s)
  13289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13290. }
  13291. type InstanceGroupManagersAbandonInstancesRequest struct {
  13292. // Instances: The URLs of one or more instances to abandon. This can be
  13293. // a full URL or a partial URL, such as
  13294. // zones/[ZONE]/instances/[INSTANCE_NAME].
  13295. Instances []string `json:"instances,omitempty"`
  13296. // ForceSendFields is a list of field names (e.g. "Instances") to
  13297. // unconditionally include in API requests. By default, fields with
  13298. // empty values are omitted from API requests. However, any non-pointer,
  13299. // non-interface field appearing in ForceSendFields will be sent to the
  13300. // server regardless of whether the field is empty or not. This may be
  13301. // used to include empty fields in Patch requests.
  13302. ForceSendFields []string `json:"-"`
  13303. // NullFields is a list of field names (e.g. "Instances") to include in
  13304. // API requests with the JSON null value. By default, fields with empty
  13305. // values are omitted from API requests. However, any field with an
  13306. // empty value appearing in NullFields will be sent to the server as
  13307. // null. It is an error if a field in this list has a non-empty value.
  13308. // This may be used to include null fields in Patch requests.
  13309. NullFields []string `json:"-"`
  13310. }
  13311. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  13312. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  13313. raw := NoMethod(*s)
  13314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13315. }
  13316. // InstanceGroupManagersApplyUpdatesRequest:
  13317. // InstanceGroupManagers.applyUpdatesToInstances
  13318. type InstanceGroupManagersApplyUpdatesRequest struct {
  13319. // Instances: The list of URLs of one or more instances for which we
  13320. // want to apply updates on this managed instance group. This can be a
  13321. // full URL or a partial URL, such as
  13322. // zones/[ZONE]/instances/[INSTANCE_NAME].
  13323. Instances []string `json:"instances,omitempty"`
  13324. // MaximalAction: The maximal action that should be performed on the
  13325. // instances. By default REPLACE. This field is deprecated, please use
  13326. // most_disruptive_allowed_action.
  13327. //
  13328. // Possible values:
  13329. // "NONE"
  13330. // "REFRESH"
  13331. // "REPLACE"
  13332. // "RESTART"
  13333. MaximalAction string `json:"maximalAction,omitempty"`
  13334. // MinimalAction: The minimal action that should be perfomed on the
  13335. // instances. By default NONE.
  13336. //
  13337. // Possible values:
  13338. // "NONE"
  13339. // "REFRESH"
  13340. // "REPLACE"
  13341. // "RESTART"
  13342. MinimalAction string `json:"minimalAction,omitempty"`
  13343. // MostDisruptiveAllowedAction: The most disruptive action that allowed
  13344. // to be performed on the instances. By default REPLACE.
  13345. //
  13346. // Possible values:
  13347. // "NONE"
  13348. // "REFRESH"
  13349. // "REPLACE"
  13350. // "RESTART"
  13351. MostDisruptiveAllowedAction string `json:"mostDisruptiveAllowedAction,omitempty"`
  13352. // ForceSendFields is a list of field names (e.g. "Instances") to
  13353. // unconditionally include in API requests. By default, fields with
  13354. // empty values are omitted from API requests. However, any non-pointer,
  13355. // non-interface field appearing in ForceSendFields will be sent to the
  13356. // server regardless of whether the field is empty or not. This may be
  13357. // used to include empty fields in Patch requests.
  13358. ForceSendFields []string `json:"-"`
  13359. // NullFields is a list of field names (e.g. "Instances") to include in
  13360. // API requests with the JSON null value. By default, fields with empty
  13361. // values are omitted from API requests. However, any field with an
  13362. // empty value appearing in NullFields will be sent to the server as
  13363. // null. It is an error if a field in this list has a non-empty value.
  13364. // This may be used to include null fields in Patch requests.
  13365. NullFields []string `json:"-"`
  13366. }
  13367. func (s *InstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
  13368. type NoMethod InstanceGroupManagersApplyUpdatesRequest
  13369. raw := NoMethod(*s)
  13370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13371. }
  13372. // InstanceGroupManagersCreateInstancesRequest:
  13373. // InstanceGroupManagers.createInstances
  13374. type InstanceGroupManagersCreateInstancesRequest struct {
  13375. // Instances: [Required] List of specifications of per-instance configs.
  13376. Instances []*PerInstanceConfig `json:"instances,omitempty"`
  13377. // ForceSendFields is a list of field names (e.g. "Instances") to
  13378. // unconditionally include in API requests. By default, fields with
  13379. // empty values are omitted from API requests. However, any non-pointer,
  13380. // non-interface field appearing in ForceSendFields will be sent to the
  13381. // server regardless of whether the field is empty or not. This may be
  13382. // used to include empty fields in Patch requests.
  13383. ForceSendFields []string `json:"-"`
  13384. // NullFields is a list of field names (e.g. "Instances") to include in
  13385. // API requests with the JSON null value. By default, fields with empty
  13386. // values are omitted from API requests. However, any field with an
  13387. // empty value appearing in NullFields will be sent to the server as
  13388. // null. It is an error if a field in this list has a non-empty value.
  13389. // This may be used to include null fields in Patch requests.
  13390. NullFields []string `json:"-"`
  13391. }
  13392. func (s *InstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
  13393. type NoMethod InstanceGroupManagersCreateInstancesRequest
  13394. raw := NoMethod(*s)
  13395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13396. }
  13397. type InstanceGroupManagersDeleteInstancesRequest struct {
  13398. // Instances: The URLs of one or more instances to delete. This can be a
  13399. // full URL or a partial URL, such as
  13400. // zones/[ZONE]/instances/[INSTANCE_NAME].
  13401. Instances []string `json:"instances,omitempty"`
  13402. // ForceSendFields is a list of field names (e.g. "Instances") to
  13403. // unconditionally include in API requests. By default, fields with
  13404. // empty values are omitted from API requests. However, any non-pointer,
  13405. // non-interface field appearing in ForceSendFields will be sent to the
  13406. // server regardless of whether the field is empty or not. This may be
  13407. // used to include empty fields in Patch requests.
  13408. ForceSendFields []string `json:"-"`
  13409. // NullFields is a list of field names (e.g. "Instances") to include in
  13410. // API requests with the JSON null value. By default, fields with empty
  13411. // values are omitted from API requests. However, any field with an
  13412. // empty value appearing in NullFields will be sent to the server as
  13413. // null. It is an error if a field in this list has a non-empty value.
  13414. // This may be used to include null fields in Patch requests.
  13415. NullFields []string `json:"-"`
  13416. }
  13417. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  13418. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  13419. raw := NoMethod(*s)
  13420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13421. }
  13422. // InstanceGroupManagersDeletePerInstanceConfigsReq:
  13423. // InstanceGroupManagers.deletePerInstanceConfigs
  13424. type InstanceGroupManagersDeletePerInstanceConfigsReq struct {
  13425. // Instances: The list of instances for which we want to delete
  13426. // per-instance configs on this managed instance group.
  13427. Instances []string `json:"instances,omitempty"`
  13428. // Names: The list of instance names for which we want to delete
  13429. // per-instance configs on this managed instance group.
  13430. Names []string `json:"names,omitempty"`
  13431. // ForceSendFields is a list of field names (e.g. "Instances") to
  13432. // unconditionally include in API requests. By default, fields with
  13433. // empty values are omitted from API requests. However, any non-pointer,
  13434. // non-interface field appearing in ForceSendFields will be sent to the
  13435. // server regardless of whether the field is empty or not. This may be
  13436. // used to include empty fields in Patch requests.
  13437. ForceSendFields []string `json:"-"`
  13438. // NullFields is a list of field names (e.g. "Instances") to include in
  13439. // API requests with the JSON null value. By default, fields with empty
  13440. // values are omitted from API requests. However, any field with an
  13441. // empty value appearing in NullFields will be sent to the server as
  13442. // null. It is an error if a field in this list has a non-empty value.
  13443. // This may be used to include null fields in Patch requests.
  13444. NullFields []string `json:"-"`
  13445. }
  13446. func (s *InstanceGroupManagersDeletePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  13447. type NoMethod InstanceGroupManagersDeletePerInstanceConfigsReq
  13448. raw := NoMethod(*s)
  13449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13450. }
  13451. type InstanceGroupManagersListManagedInstancesResponse struct {
  13452. // ManagedInstances: [Output Only] The list of instances in the managed
  13453. // instance group.
  13454. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  13455. // NextPageToken: [Output Only] This token allows you to get the next
  13456. // page of results for list requests. If the number of results is larger
  13457. // than maxResults, use the nextPageToken as a value for the query
  13458. // parameter pageToken in the next list request. Subsequent list
  13459. // requests will have their own nextPageToken to continue paging through
  13460. // the results.
  13461. NextPageToken string `json:"nextPageToken,omitempty"`
  13462. // ServerResponse contains the HTTP response code and headers from the
  13463. // server.
  13464. googleapi.ServerResponse `json:"-"`
  13465. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  13466. // unconditionally include in API requests. By default, fields with
  13467. // empty values are omitted from API requests. However, any non-pointer,
  13468. // non-interface field appearing in ForceSendFields will be sent to the
  13469. // server regardless of whether the field is empty or not. This may be
  13470. // used to include empty fields in Patch requests.
  13471. ForceSendFields []string `json:"-"`
  13472. // NullFields is a list of field names (e.g. "ManagedInstances") to
  13473. // include in API requests with the JSON null value. By default, fields
  13474. // with empty values are omitted from API requests. However, any field
  13475. // with an empty value appearing in NullFields will be sent to the
  13476. // server as null. It is an error if a field in this list has a
  13477. // non-empty value. This may be used to include null fields in Patch
  13478. // requests.
  13479. NullFields []string `json:"-"`
  13480. }
  13481. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  13482. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  13483. raw := NoMethod(*s)
  13484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13485. }
  13486. type InstanceGroupManagersListPerInstanceConfigsResp struct {
  13487. // Items: [Output Only] The list of PerInstanceConfig.
  13488. Items []*PerInstanceConfig `json:"items,omitempty"`
  13489. // NextPageToken: [Output Only] This token allows you to get the next
  13490. // page of results for list requests. If the number of results is larger
  13491. // than maxResults, use the nextPageToken as a value for the query
  13492. // parameter pageToken in the next list request. Subsequent list
  13493. // requests will have their own nextPageToken to continue paging through
  13494. // the results.
  13495. NextPageToken string `json:"nextPageToken,omitempty"`
  13496. // Warning: [Output Only] Informational warning message.
  13497. Warning *InstanceGroupManagersListPerInstanceConfigsRespWarning `json:"warning,omitempty"`
  13498. // ServerResponse contains the HTTP response code and headers from the
  13499. // server.
  13500. googleapi.ServerResponse `json:"-"`
  13501. // ForceSendFields is a list of field names (e.g. "Items") to
  13502. // unconditionally include in API requests. By default, fields with
  13503. // empty values are omitted from API requests. However, any non-pointer,
  13504. // non-interface field appearing in ForceSendFields will be sent to the
  13505. // server regardless of whether the field is empty or not. This may be
  13506. // used to include empty fields in Patch requests.
  13507. ForceSendFields []string `json:"-"`
  13508. // NullFields is a list of field names (e.g. "Items") to include in API
  13509. // requests with the JSON null value. By default, fields with empty
  13510. // values are omitted from API requests. However, any field with an
  13511. // empty value appearing in NullFields will be sent to the server as
  13512. // null. It is an error if a field in this list has a non-empty value.
  13513. // This may be used to include null fields in Patch requests.
  13514. NullFields []string `json:"-"`
  13515. }
  13516. func (s *InstanceGroupManagersListPerInstanceConfigsResp) MarshalJSON() ([]byte, error) {
  13517. type NoMethod InstanceGroupManagersListPerInstanceConfigsResp
  13518. raw := NoMethod(*s)
  13519. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13520. }
  13521. // InstanceGroupManagersListPerInstanceConfigsRespWarning: [Output Only]
  13522. // Informational warning message.
  13523. type InstanceGroupManagersListPerInstanceConfigsRespWarning struct {
  13524. // Code: [Output Only] A warning code, if applicable. For example,
  13525. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13526. // the response.
  13527. //
  13528. // Possible values:
  13529. // "CLEANUP_FAILED"
  13530. // "DEPRECATED_RESOURCE_USED"
  13531. // "DEPRECATED_TYPE_USED"
  13532. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13533. // "EXPERIMENTAL_TYPE_USED"
  13534. // "EXTERNAL_API_WARNING"
  13535. // "FIELD_VALUE_OVERRIDEN"
  13536. // "INJECTED_KERNELS_DEPRECATED"
  13537. // "MISSING_TYPE_DEPENDENCY"
  13538. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13539. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13540. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13541. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13542. // "NEXT_HOP_NOT_RUNNING"
  13543. // "NOT_CRITICAL_ERROR"
  13544. // "NO_RESULTS_ON_PAGE"
  13545. // "REQUIRED_TOS_AGREEMENT"
  13546. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13547. // "RESOURCE_NOT_DELETED"
  13548. // "SCHEMA_VALIDATION_IGNORED"
  13549. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13550. // "UNDECLARED_PROPERTIES"
  13551. // "UNREACHABLE"
  13552. Code string `json:"code,omitempty"`
  13553. // Data: [Output Only] Metadata about this warning in key: value format.
  13554. // For example:
  13555. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13556. Data []*InstanceGroupManagersListPerInstanceConfigsRespWarningData `json:"data,omitempty"`
  13557. // Message: [Output Only] A human-readable description of the warning
  13558. // code.
  13559. Message string `json:"message,omitempty"`
  13560. // ForceSendFields is a list of field names (e.g. "Code") to
  13561. // unconditionally include in API requests. By default, fields with
  13562. // empty values are omitted from API requests. However, any non-pointer,
  13563. // non-interface field appearing in ForceSendFields will be sent to the
  13564. // server regardless of whether the field is empty or not. This may be
  13565. // used to include empty fields in Patch requests.
  13566. ForceSendFields []string `json:"-"`
  13567. // NullFields is a list of field names (e.g. "Code") to include in API
  13568. // requests with the JSON null value. By default, fields with empty
  13569. // values are omitted from API requests. However, any field with an
  13570. // empty value appearing in NullFields will be sent to the server as
  13571. // null. It is an error if a field in this list has a non-empty value.
  13572. // This may be used to include null fields in Patch requests.
  13573. NullFields []string `json:"-"`
  13574. }
  13575. func (s *InstanceGroupManagersListPerInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
  13576. type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarning
  13577. raw := NoMethod(*s)
  13578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13579. }
  13580. type InstanceGroupManagersListPerInstanceConfigsRespWarningData struct {
  13581. // Key: [Output Only] A key that provides more detail on the warning
  13582. // being returned. For example, for warnings where there are no results
  13583. // in a list request for a particular zone, this key might be scope and
  13584. // the key value might be the zone name. Other examples might be a key
  13585. // indicating a deprecated resource and a suggested replacement, or a
  13586. // warning about invalid network settings (for example, if an instance
  13587. // attempts to perform IP forwarding but is not enabled for IP
  13588. // forwarding).
  13589. Key string `json:"key,omitempty"`
  13590. // Value: [Output Only] A warning data value corresponding to the key.
  13591. Value string `json:"value,omitempty"`
  13592. // ForceSendFields is a list of field names (e.g. "Key") to
  13593. // unconditionally include in API requests. By default, fields with
  13594. // empty values are omitted from API requests. However, any non-pointer,
  13595. // non-interface field appearing in ForceSendFields will be sent to the
  13596. // server regardless of whether the field is empty or not. This may be
  13597. // used to include empty fields in Patch requests.
  13598. ForceSendFields []string `json:"-"`
  13599. // NullFields is a list of field names (e.g. "Key") to include in API
  13600. // requests with the JSON null value. By default, fields with empty
  13601. // values are omitted from API requests. However, any field with an
  13602. // empty value appearing in NullFields will be sent to the server as
  13603. // null. It is an error if a field in this list has a non-empty value.
  13604. // This may be used to include null fields in Patch requests.
  13605. NullFields []string `json:"-"`
  13606. }
  13607. func (s *InstanceGroupManagersListPerInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
  13608. type NoMethod InstanceGroupManagersListPerInstanceConfigsRespWarningData
  13609. raw := NoMethod(*s)
  13610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13611. }
  13612. type InstanceGroupManagersRecreateInstancesRequest struct {
  13613. // Instances: The URLs of one or more instances to recreate. This can be
  13614. // a full URL or a partial URL, such as
  13615. // zones/[ZONE]/instances/[INSTANCE_NAME].
  13616. Instances []string `json:"instances,omitempty"`
  13617. // ForceSendFields is a list of field names (e.g. "Instances") to
  13618. // unconditionally include in API requests. By default, fields with
  13619. // empty values are omitted from API requests. However, any non-pointer,
  13620. // non-interface field appearing in ForceSendFields will be sent to the
  13621. // server regardless of whether the field is empty or not. This may be
  13622. // used to include empty fields in Patch requests.
  13623. ForceSendFields []string `json:"-"`
  13624. // NullFields is a list of field names (e.g. "Instances") to include in
  13625. // API requests with the JSON null value. By default, fields with empty
  13626. // values are omitted from API requests. However, any field with an
  13627. // empty value appearing in NullFields will be sent to the server as
  13628. // null. It is an error if a field in this list has a non-empty value.
  13629. // This may be used to include null fields in Patch requests.
  13630. NullFields []string `json:"-"`
  13631. }
  13632. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  13633. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  13634. raw := NoMethod(*s)
  13635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13636. }
  13637. type InstanceGroupManagersResizeAdvancedRequest struct {
  13638. // NoCreationRetries: If this flag is true, the managed instance group
  13639. // attempts to create all instances initiated by this resize request
  13640. // only once. If there is an error during creation, the managed instance
  13641. // group does not retry create this instance, and we will decrease the
  13642. // targetSize of the request instead. If the flag is false, the group
  13643. // attempts to recreate each instance continuously until it
  13644. // succeeds.
  13645. //
  13646. // This flag matters only in the first attempt of creation of an
  13647. // instance. After an instance is successfully created while this flag
  13648. // is enabled, the instance behaves the same way as all the other
  13649. // instances created with a regular resize request. In particular, if a
  13650. // running instance dies unexpectedly at a later time and needs to be
  13651. // recreated, this mode does not affect the recreation behavior in that
  13652. // scenario.
  13653. //
  13654. // This flag is applicable only to the current resize request. It does
  13655. // not influence other resize requests in any way.
  13656. //
  13657. // You can see which instances is being creating in which mode by
  13658. // calling the get or listManagedInstances API.
  13659. NoCreationRetries bool `json:"noCreationRetries,omitempty"`
  13660. // TargetSize: The number of running instances that the managed instance
  13661. // group should maintain at any given time. The group automatically adds
  13662. // or removes instances to maintain the number of instances specified by
  13663. // this parameter.
  13664. TargetSize int64 `json:"targetSize,omitempty"`
  13665. // ForceSendFields is a list of field names (e.g. "NoCreationRetries")
  13666. // to unconditionally include in API requests. By default, fields with
  13667. // empty values are omitted from API requests. However, any non-pointer,
  13668. // non-interface field appearing in ForceSendFields will be sent to the
  13669. // server regardless of whether the field is empty or not. This may be
  13670. // used to include empty fields in Patch requests.
  13671. ForceSendFields []string `json:"-"`
  13672. // NullFields is a list of field names (e.g. "NoCreationRetries") to
  13673. // include in API requests with the JSON null value. By default, fields
  13674. // with empty values are omitted from API requests. However, any field
  13675. // with an empty value appearing in NullFields will be sent to the
  13676. // server as null. It is an error if a field in this list has a
  13677. // non-empty value. This may be used to include null fields in Patch
  13678. // requests.
  13679. NullFields []string `json:"-"`
  13680. }
  13681. func (s *InstanceGroupManagersResizeAdvancedRequest) MarshalJSON() ([]byte, error) {
  13682. type NoMethod InstanceGroupManagersResizeAdvancedRequest
  13683. raw := NoMethod(*s)
  13684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13685. }
  13686. type InstanceGroupManagersScopedList struct {
  13687. // InstanceGroupManagers: [Output Only] The list of managed instance
  13688. // groups that are contained in the specified project and zone.
  13689. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  13690. // Warning: [Output Only] The warning that replaces the list of managed
  13691. // instance groups when the list is empty.
  13692. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  13693. // ForceSendFields is a list of field names (e.g.
  13694. // "InstanceGroupManagers") to unconditionally include in API requests.
  13695. // By default, fields with empty values are omitted from API requests.
  13696. // However, any non-pointer, non-interface field appearing in
  13697. // ForceSendFields will be sent to the server regardless of whether the
  13698. // field is empty or not. This may be used to include empty fields in
  13699. // Patch requests.
  13700. ForceSendFields []string `json:"-"`
  13701. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  13702. // include in API requests with the JSON null value. By default, fields
  13703. // with empty values are omitted from API requests. However, any field
  13704. // with an empty value appearing in NullFields will be sent to the
  13705. // server as null. It is an error if a field in this list has a
  13706. // non-empty value. This may be used to include null fields in Patch
  13707. // requests.
  13708. NullFields []string `json:"-"`
  13709. }
  13710. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  13711. type NoMethod InstanceGroupManagersScopedList
  13712. raw := NoMethod(*s)
  13713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13714. }
  13715. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  13716. // that replaces the list of managed instance groups when the list is
  13717. // empty.
  13718. type InstanceGroupManagersScopedListWarning struct {
  13719. // Code: [Output Only] A warning code, if applicable. For example,
  13720. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13721. // the response.
  13722. //
  13723. // Possible values:
  13724. // "CLEANUP_FAILED"
  13725. // "DEPRECATED_RESOURCE_USED"
  13726. // "DEPRECATED_TYPE_USED"
  13727. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13728. // "EXPERIMENTAL_TYPE_USED"
  13729. // "EXTERNAL_API_WARNING"
  13730. // "FIELD_VALUE_OVERRIDEN"
  13731. // "INJECTED_KERNELS_DEPRECATED"
  13732. // "MISSING_TYPE_DEPENDENCY"
  13733. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13734. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13735. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13736. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13737. // "NEXT_HOP_NOT_RUNNING"
  13738. // "NOT_CRITICAL_ERROR"
  13739. // "NO_RESULTS_ON_PAGE"
  13740. // "REQUIRED_TOS_AGREEMENT"
  13741. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13742. // "RESOURCE_NOT_DELETED"
  13743. // "SCHEMA_VALIDATION_IGNORED"
  13744. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13745. // "UNDECLARED_PROPERTIES"
  13746. // "UNREACHABLE"
  13747. Code string `json:"code,omitempty"`
  13748. // Data: [Output Only] Metadata about this warning in key: value format.
  13749. // For example:
  13750. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13751. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  13752. // Message: [Output Only] A human-readable description of the warning
  13753. // code.
  13754. Message string `json:"message,omitempty"`
  13755. // ForceSendFields is a list of field names (e.g. "Code") to
  13756. // unconditionally include in API requests. By default, fields with
  13757. // empty values are omitted from API requests. However, any non-pointer,
  13758. // non-interface field appearing in ForceSendFields will be sent to the
  13759. // server regardless of whether the field is empty or not. This may be
  13760. // used to include empty fields in Patch requests.
  13761. ForceSendFields []string `json:"-"`
  13762. // NullFields is a list of field names (e.g. "Code") to include in API
  13763. // requests with the JSON null value. By default, fields with empty
  13764. // values are omitted from API requests. However, any field with an
  13765. // empty value appearing in NullFields will be sent to the server as
  13766. // null. It is an error if a field in this list has a non-empty value.
  13767. // This may be used to include null fields in Patch requests.
  13768. NullFields []string `json:"-"`
  13769. }
  13770. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  13771. type NoMethod InstanceGroupManagersScopedListWarning
  13772. raw := NoMethod(*s)
  13773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13774. }
  13775. type InstanceGroupManagersScopedListWarningData struct {
  13776. // Key: [Output Only] A key that provides more detail on the warning
  13777. // being returned. For example, for warnings where there are no results
  13778. // in a list request for a particular zone, this key might be scope and
  13779. // the key value might be the zone name. Other examples might be a key
  13780. // indicating a deprecated resource and a suggested replacement, or a
  13781. // warning about invalid network settings (for example, if an instance
  13782. // attempts to perform IP forwarding but is not enabled for IP
  13783. // forwarding).
  13784. Key string `json:"key,omitempty"`
  13785. // Value: [Output Only] A warning data value corresponding to the key.
  13786. Value string `json:"value,omitempty"`
  13787. // ForceSendFields is a list of field names (e.g. "Key") to
  13788. // unconditionally include in API requests. By default, fields with
  13789. // empty values are omitted from API requests. However, any non-pointer,
  13790. // non-interface field appearing in ForceSendFields will be sent to the
  13791. // server regardless of whether the field is empty or not. This may be
  13792. // used to include empty fields in Patch requests.
  13793. ForceSendFields []string `json:"-"`
  13794. // NullFields is a list of field names (e.g. "Key") to include in API
  13795. // requests with the JSON null value. By default, fields with empty
  13796. // values are omitted from API requests. However, any field with an
  13797. // empty value appearing in NullFields will be sent to the server as
  13798. // null. It is an error if a field in this list has a non-empty value.
  13799. // This may be used to include null fields in Patch requests.
  13800. NullFields []string `json:"-"`
  13801. }
  13802. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  13803. type NoMethod InstanceGroupManagersScopedListWarningData
  13804. raw := NoMethod(*s)
  13805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13806. }
  13807. type InstanceGroupManagersSetAutoHealingRequest struct {
  13808. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  13809. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  13810. // to unconditionally include in API requests. By default, fields with
  13811. // empty values are omitted from API requests. However, any non-pointer,
  13812. // non-interface field appearing in ForceSendFields will be sent to the
  13813. // server regardless of whether the field is empty or not. This may be
  13814. // used to include empty fields in Patch requests.
  13815. ForceSendFields []string `json:"-"`
  13816. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  13817. // include in API requests with the JSON null value. By default, fields
  13818. // with empty values are omitted from API requests. However, any field
  13819. // with an empty value appearing in NullFields will be sent to the
  13820. // server as null. It is an error if a field in this list has a
  13821. // non-empty value. This may be used to include null fields in Patch
  13822. // requests.
  13823. NullFields []string `json:"-"`
  13824. }
  13825. func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  13826. type NoMethod InstanceGroupManagersSetAutoHealingRequest
  13827. raw := NoMethod(*s)
  13828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13829. }
  13830. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  13831. // InstanceTemplate: The URL of the instance template that is specified
  13832. // for this managed instance group. The group uses this template to
  13833. // create all new instances in the managed instance group.
  13834. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  13835. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  13836. // unconditionally include in API requests. By default, fields with
  13837. // empty values are omitted from API requests. However, any non-pointer,
  13838. // non-interface field appearing in ForceSendFields will be sent to the
  13839. // server regardless of whether the field is empty or not. This may be
  13840. // used to include empty fields in Patch requests.
  13841. ForceSendFields []string `json:"-"`
  13842. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  13843. // include in API requests with the JSON null value. By default, fields
  13844. // with empty values are omitted from API requests. However, any field
  13845. // with an empty value appearing in NullFields will be sent to the
  13846. // server as null. It is an error if a field in this list has a
  13847. // non-empty value. This may be used to include null fields in Patch
  13848. // requests.
  13849. NullFields []string `json:"-"`
  13850. }
  13851. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  13852. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  13853. raw := NoMethod(*s)
  13854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13855. }
  13856. type InstanceGroupManagersSetTargetPoolsRequest struct {
  13857. // Fingerprint: The fingerprint of the target pools information. Use
  13858. // this optional property to prevent conflicts when multiple users
  13859. // change the target pools settings concurrently. Obtain the fingerprint
  13860. // with the instanceGroupManagers.get method. Then, include the
  13861. // fingerprint in your request to ensure that you do not overwrite
  13862. // changes that were applied from another concurrent request.
  13863. Fingerprint string `json:"fingerprint,omitempty"`
  13864. // TargetPools: The list of target pool URLs that instances in this
  13865. // managed instance group belong to. The managed instance group applies
  13866. // these target pools to all of the instances in the group. Existing
  13867. // instances and new instances in the group all receive these target
  13868. // pool settings.
  13869. TargetPools []string `json:"targetPools,omitempty"`
  13870. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  13871. // unconditionally include in API requests. By default, fields with
  13872. // empty values are omitted from API requests. However, any non-pointer,
  13873. // non-interface field appearing in ForceSendFields will be sent to the
  13874. // server regardless of whether the field is empty or not. This may be
  13875. // used to include empty fields in Patch requests.
  13876. ForceSendFields []string `json:"-"`
  13877. // NullFields is a list of field names (e.g. "Fingerprint") to include
  13878. // in API requests with the JSON null value. By default, fields with
  13879. // empty values are omitted from API requests. However, any field with
  13880. // an empty value appearing in NullFields will be sent to the server as
  13881. // null. It is an error if a field in this list has a non-empty value.
  13882. // This may be used to include null fields in Patch requests.
  13883. NullFields []string `json:"-"`
  13884. }
  13885. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  13886. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  13887. raw := NoMethod(*s)
  13888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13889. }
  13890. // InstanceGroupManagersUpdatePerInstanceConfigsReq:
  13891. // InstanceGroupManagers.updatePerInstanceConfigs
  13892. type InstanceGroupManagersUpdatePerInstanceConfigsReq struct {
  13893. // PerInstanceConfigs: The list of per-instance configs to insert or
  13894. // patch on this managed instance group.
  13895. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  13896. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  13897. // to unconditionally include in API requests. By default, fields with
  13898. // empty values are omitted from API requests. However, any non-pointer,
  13899. // non-interface field appearing in ForceSendFields will be sent to the
  13900. // server regardless of whether the field is empty or not. This may be
  13901. // used to include empty fields in Patch requests.
  13902. ForceSendFields []string `json:"-"`
  13903. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  13904. // include in API requests with the JSON null value. By default, fields
  13905. // with empty values are omitted from API requests. However, any field
  13906. // with an empty value appearing in NullFields will be sent to the
  13907. // server as null. It is an error if a field in this list has a
  13908. // non-empty value. This may be used to include null fields in Patch
  13909. // requests.
  13910. NullFields []string `json:"-"`
  13911. }
  13912. func (s *InstanceGroupManagersUpdatePerInstanceConfigsReq) MarshalJSON() ([]byte, error) {
  13913. type NoMethod InstanceGroupManagersUpdatePerInstanceConfigsReq
  13914. raw := NoMethod(*s)
  13915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13916. }
  13917. type InstanceGroupsAddInstancesRequest struct {
  13918. // Instances: The list of instances to add to the instance group.
  13919. Instances []*InstanceReference `json:"instances,omitempty"`
  13920. // ForceSendFields is a list of field names (e.g. "Instances") to
  13921. // unconditionally include in API requests. By default, fields with
  13922. // empty values are omitted from API requests. However, any non-pointer,
  13923. // non-interface field appearing in ForceSendFields will be sent to the
  13924. // server regardless of whether the field is empty or not. This may be
  13925. // used to include empty fields in Patch requests.
  13926. ForceSendFields []string `json:"-"`
  13927. // NullFields is a list of field names (e.g. "Instances") to include in
  13928. // API requests with the JSON null value. By default, fields with empty
  13929. // values are omitted from API requests. However, any field with an
  13930. // empty value appearing in NullFields will be sent to the server as
  13931. // null. It is an error if a field in this list has a non-empty value.
  13932. // This may be used to include null fields in Patch requests.
  13933. NullFields []string `json:"-"`
  13934. }
  13935. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  13936. type NoMethod InstanceGroupsAddInstancesRequest
  13937. raw := NoMethod(*s)
  13938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13939. }
  13940. type InstanceGroupsListInstances struct {
  13941. // Id: [Output Only] Unique identifier for the resource; defined by the
  13942. // server.
  13943. Id string `json:"id,omitempty"`
  13944. // Items: A list of InstanceWithNamedPorts resources.
  13945. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  13946. // Kind: [Output Only] The resource type, which is always
  13947. // compute#instanceGroupsListInstances for the list of instances in the
  13948. // specified instance group.
  13949. Kind string `json:"kind,omitempty"`
  13950. // NextPageToken: [Output Only] This token allows you to get the next
  13951. // page of results for list requests. If the number of results is larger
  13952. // than maxResults, use the nextPageToken as a value for the query
  13953. // parameter pageToken in the next list request. Subsequent list
  13954. // requests will have their own nextPageToken to continue paging through
  13955. // the results.
  13956. NextPageToken string `json:"nextPageToken,omitempty"`
  13957. // SelfLink: [Output Only] Server-defined URL for this resource.
  13958. SelfLink string `json:"selfLink,omitempty"`
  13959. // Warning: [Output Only] Informational warning message.
  13960. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  13961. // ServerResponse contains the HTTP response code and headers from the
  13962. // server.
  13963. googleapi.ServerResponse `json:"-"`
  13964. // ForceSendFields is a list of field names (e.g. "Id") to
  13965. // unconditionally include in API requests. By default, fields with
  13966. // empty values are omitted from API requests. However, any non-pointer,
  13967. // non-interface field appearing in ForceSendFields will be sent to the
  13968. // server regardless of whether the field is empty or not. This may be
  13969. // used to include empty fields in Patch requests.
  13970. ForceSendFields []string `json:"-"`
  13971. // NullFields is a list of field names (e.g. "Id") to include in API
  13972. // requests with the JSON null value. By default, fields with empty
  13973. // values are omitted from API requests. However, any field with an
  13974. // empty value appearing in NullFields will be sent to the server as
  13975. // null. It is an error if a field in this list has a non-empty value.
  13976. // This may be used to include null fields in Patch requests.
  13977. NullFields []string `json:"-"`
  13978. }
  13979. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  13980. type NoMethod InstanceGroupsListInstances
  13981. raw := NoMethod(*s)
  13982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13983. }
  13984. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  13985. // warning message.
  13986. type InstanceGroupsListInstancesWarning struct {
  13987. // Code: [Output Only] A warning code, if applicable. For example,
  13988. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13989. // the response.
  13990. //
  13991. // Possible values:
  13992. // "CLEANUP_FAILED"
  13993. // "DEPRECATED_RESOURCE_USED"
  13994. // "DEPRECATED_TYPE_USED"
  13995. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13996. // "EXPERIMENTAL_TYPE_USED"
  13997. // "EXTERNAL_API_WARNING"
  13998. // "FIELD_VALUE_OVERRIDEN"
  13999. // "INJECTED_KERNELS_DEPRECATED"
  14000. // "MISSING_TYPE_DEPENDENCY"
  14001. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14002. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14003. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14004. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14005. // "NEXT_HOP_NOT_RUNNING"
  14006. // "NOT_CRITICAL_ERROR"
  14007. // "NO_RESULTS_ON_PAGE"
  14008. // "REQUIRED_TOS_AGREEMENT"
  14009. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14010. // "RESOURCE_NOT_DELETED"
  14011. // "SCHEMA_VALIDATION_IGNORED"
  14012. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14013. // "UNDECLARED_PROPERTIES"
  14014. // "UNREACHABLE"
  14015. Code string `json:"code,omitempty"`
  14016. // Data: [Output Only] Metadata about this warning in key: value format.
  14017. // For example:
  14018. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14019. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  14020. // Message: [Output Only] A human-readable description of the warning
  14021. // code.
  14022. Message string `json:"message,omitempty"`
  14023. // ForceSendFields is a list of field names (e.g. "Code") to
  14024. // unconditionally include in API requests. By default, fields with
  14025. // empty values are omitted from API requests. However, any non-pointer,
  14026. // non-interface field appearing in ForceSendFields will be sent to the
  14027. // server regardless of whether the field is empty or not. This may be
  14028. // used to include empty fields in Patch requests.
  14029. ForceSendFields []string `json:"-"`
  14030. // NullFields is a list of field names (e.g. "Code") to include in API
  14031. // requests with the JSON null value. By default, fields with empty
  14032. // values are omitted from API requests. However, any field with an
  14033. // empty value appearing in NullFields will be sent to the server as
  14034. // null. It is an error if a field in this list has a non-empty value.
  14035. // This may be used to include null fields in Patch requests.
  14036. NullFields []string `json:"-"`
  14037. }
  14038. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  14039. type NoMethod InstanceGroupsListInstancesWarning
  14040. raw := NoMethod(*s)
  14041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14042. }
  14043. type InstanceGroupsListInstancesWarningData struct {
  14044. // Key: [Output Only] A key that provides more detail on the warning
  14045. // being returned. For example, for warnings where there are no results
  14046. // in a list request for a particular zone, this key might be scope and
  14047. // the key value might be the zone name. Other examples might be a key
  14048. // indicating a deprecated resource and a suggested replacement, or a
  14049. // warning about invalid network settings (for example, if an instance
  14050. // attempts to perform IP forwarding but is not enabled for IP
  14051. // forwarding).
  14052. Key string `json:"key,omitempty"`
  14053. // Value: [Output Only] A warning data value corresponding to the key.
  14054. Value string `json:"value,omitempty"`
  14055. // ForceSendFields is a list of field names (e.g. "Key") to
  14056. // unconditionally include in API requests. By default, fields with
  14057. // empty values are omitted from API requests. However, any non-pointer,
  14058. // non-interface field appearing in ForceSendFields will be sent to the
  14059. // server regardless of whether the field is empty or not. This may be
  14060. // used to include empty fields in Patch requests.
  14061. ForceSendFields []string `json:"-"`
  14062. // NullFields is a list of field names (e.g. "Key") to include in API
  14063. // requests with the JSON null value. By default, fields with empty
  14064. // values are omitted from API requests. However, any field with an
  14065. // empty value appearing in NullFields will be sent to the server as
  14066. // null. It is an error if a field in this list has a non-empty value.
  14067. // This may be used to include null fields in Patch requests.
  14068. NullFields []string `json:"-"`
  14069. }
  14070. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  14071. type NoMethod InstanceGroupsListInstancesWarningData
  14072. raw := NoMethod(*s)
  14073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14074. }
  14075. type InstanceGroupsListInstancesRequest struct {
  14076. // InstanceState: A filter for the state of the instances in the
  14077. // instance group. Valid options are ALL or RUNNING. If you do not
  14078. // specify this parameter the list includes all instances regardless of
  14079. // their state.
  14080. //
  14081. // Possible values:
  14082. // "ALL"
  14083. // "RUNNING"
  14084. InstanceState string `json:"instanceState,omitempty"`
  14085. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  14086. // unconditionally include in API requests. By default, fields with
  14087. // empty values are omitted from API requests. However, any non-pointer,
  14088. // non-interface field appearing in ForceSendFields will be sent to the
  14089. // server regardless of whether the field is empty or not. This may be
  14090. // used to include empty fields in Patch requests.
  14091. ForceSendFields []string `json:"-"`
  14092. // NullFields is a list of field names (e.g. "InstanceState") to include
  14093. // in API requests with the JSON null value. By default, fields with
  14094. // empty values are omitted from API requests. However, any field with
  14095. // an empty value appearing in NullFields will be sent to the server as
  14096. // null. It is an error if a field in this list has a non-empty value.
  14097. // This may be used to include null fields in Patch requests.
  14098. NullFields []string `json:"-"`
  14099. }
  14100. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  14101. type NoMethod InstanceGroupsListInstancesRequest
  14102. raw := NoMethod(*s)
  14103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14104. }
  14105. type InstanceGroupsRemoveInstancesRequest struct {
  14106. // Instances: The list of instances to remove from the instance group.
  14107. Instances []*InstanceReference `json:"instances,omitempty"`
  14108. // ForceSendFields is a list of field names (e.g. "Instances") to
  14109. // unconditionally include in API requests. By default, fields with
  14110. // empty values are omitted from API requests. However, any non-pointer,
  14111. // non-interface field appearing in ForceSendFields will be sent to the
  14112. // server regardless of whether the field is empty or not. This may be
  14113. // used to include empty fields in Patch requests.
  14114. ForceSendFields []string `json:"-"`
  14115. // NullFields is a list of field names (e.g. "Instances") to include in
  14116. // API requests with the JSON null value. By default, fields with empty
  14117. // values are omitted from API requests. However, any field with an
  14118. // empty value appearing in NullFields will be sent to the server as
  14119. // null. It is an error if a field in this list has a non-empty value.
  14120. // This may be used to include null fields in Patch requests.
  14121. NullFields []string `json:"-"`
  14122. }
  14123. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  14124. type NoMethod InstanceGroupsRemoveInstancesRequest
  14125. raw := NoMethod(*s)
  14126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14127. }
  14128. type InstanceGroupsScopedList struct {
  14129. // InstanceGroups: [Output Only] The list of instance groups that are
  14130. // contained in this scope.
  14131. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  14132. // Warning: [Output Only] An informational warning that replaces the
  14133. // list of instance groups when the list is empty.
  14134. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  14135. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  14136. // unconditionally include in API requests. By default, fields with
  14137. // empty values are omitted from API requests. However, any non-pointer,
  14138. // non-interface field appearing in ForceSendFields will be sent to the
  14139. // server regardless of whether the field is empty or not. This may be
  14140. // used to include empty fields in Patch requests.
  14141. ForceSendFields []string `json:"-"`
  14142. // NullFields is a list of field names (e.g. "InstanceGroups") to
  14143. // include in API requests with the JSON null value. By default, fields
  14144. // with empty values are omitted from API requests. However, any field
  14145. // with an empty value appearing in NullFields will be sent to the
  14146. // server as null. It is an error if a field in this list has a
  14147. // non-empty value. This may be used to include null fields in Patch
  14148. // requests.
  14149. NullFields []string `json:"-"`
  14150. }
  14151. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  14152. type NoMethod InstanceGroupsScopedList
  14153. raw := NoMethod(*s)
  14154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14155. }
  14156. // InstanceGroupsScopedListWarning: [Output Only] An informational
  14157. // warning that replaces the list of instance groups when the list is
  14158. // empty.
  14159. type InstanceGroupsScopedListWarning struct {
  14160. // Code: [Output Only] A warning code, if applicable. For example,
  14161. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14162. // the response.
  14163. //
  14164. // Possible values:
  14165. // "CLEANUP_FAILED"
  14166. // "DEPRECATED_RESOURCE_USED"
  14167. // "DEPRECATED_TYPE_USED"
  14168. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14169. // "EXPERIMENTAL_TYPE_USED"
  14170. // "EXTERNAL_API_WARNING"
  14171. // "FIELD_VALUE_OVERRIDEN"
  14172. // "INJECTED_KERNELS_DEPRECATED"
  14173. // "MISSING_TYPE_DEPENDENCY"
  14174. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14175. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14176. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14177. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14178. // "NEXT_HOP_NOT_RUNNING"
  14179. // "NOT_CRITICAL_ERROR"
  14180. // "NO_RESULTS_ON_PAGE"
  14181. // "REQUIRED_TOS_AGREEMENT"
  14182. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14183. // "RESOURCE_NOT_DELETED"
  14184. // "SCHEMA_VALIDATION_IGNORED"
  14185. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14186. // "UNDECLARED_PROPERTIES"
  14187. // "UNREACHABLE"
  14188. Code string `json:"code,omitempty"`
  14189. // Data: [Output Only] Metadata about this warning in key: value format.
  14190. // For example:
  14191. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14192. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  14193. // Message: [Output Only] A human-readable description of the warning
  14194. // code.
  14195. Message string `json:"message,omitempty"`
  14196. // ForceSendFields is a list of field names (e.g. "Code") to
  14197. // unconditionally include in API requests. By default, fields with
  14198. // empty values are omitted from API requests. However, any non-pointer,
  14199. // non-interface field appearing in ForceSendFields will be sent to the
  14200. // server regardless of whether the field is empty or not. This may be
  14201. // used to include empty fields in Patch requests.
  14202. ForceSendFields []string `json:"-"`
  14203. // NullFields is a list of field names (e.g. "Code") to include in API
  14204. // requests with the JSON null value. By default, fields with empty
  14205. // values are omitted from API requests. However, any field with an
  14206. // empty value appearing in NullFields will be sent to the server as
  14207. // null. It is an error if a field in this list has a non-empty value.
  14208. // This may be used to include null fields in Patch requests.
  14209. NullFields []string `json:"-"`
  14210. }
  14211. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  14212. type NoMethod InstanceGroupsScopedListWarning
  14213. raw := NoMethod(*s)
  14214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14215. }
  14216. type InstanceGroupsScopedListWarningData struct {
  14217. // Key: [Output Only] A key that provides more detail on the warning
  14218. // being returned. For example, for warnings where there are no results
  14219. // in a list request for a particular zone, this key might be scope and
  14220. // the key value might be the zone name. Other examples might be a key
  14221. // indicating a deprecated resource and a suggested replacement, or a
  14222. // warning about invalid network settings (for example, if an instance
  14223. // attempts to perform IP forwarding but is not enabled for IP
  14224. // forwarding).
  14225. Key string `json:"key,omitempty"`
  14226. // Value: [Output Only] A warning data value corresponding to the key.
  14227. Value string `json:"value,omitempty"`
  14228. // ForceSendFields is a list of field names (e.g. "Key") to
  14229. // unconditionally include in API requests. By default, fields with
  14230. // empty values are omitted from API requests. However, any non-pointer,
  14231. // non-interface field appearing in ForceSendFields will be sent to the
  14232. // server regardless of whether the field is empty or not. This may be
  14233. // used to include empty fields in Patch requests.
  14234. ForceSendFields []string `json:"-"`
  14235. // NullFields is a list of field names (e.g. "Key") to include in API
  14236. // requests with the JSON null value. By default, fields with empty
  14237. // values are omitted from API requests. However, any field with an
  14238. // empty value appearing in NullFields will be sent to the server as
  14239. // null. It is an error if a field in this list has a non-empty value.
  14240. // This may be used to include null fields in Patch requests.
  14241. NullFields []string `json:"-"`
  14242. }
  14243. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  14244. type NoMethod InstanceGroupsScopedListWarningData
  14245. raw := NoMethod(*s)
  14246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14247. }
  14248. type InstanceGroupsSetNamedPortsRequest struct {
  14249. // Fingerprint: The fingerprint of the named ports information for this
  14250. // instance group. Use this optional property to prevent conflicts when
  14251. // multiple users change the named ports settings concurrently. Obtain
  14252. // the fingerprint with the instanceGroups.get method. Then, include the
  14253. // fingerprint in your request to ensure that you do not overwrite
  14254. // changes that were applied from another concurrent request. A request
  14255. // with an incorrect fingerprint will fail with error 412
  14256. // conditionNotMet.
  14257. Fingerprint string `json:"fingerprint,omitempty"`
  14258. // NamedPorts: The list of named ports to set for this instance group.
  14259. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  14260. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  14261. // unconditionally include in API requests. By default, fields with
  14262. // empty values are omitted from API requests. However, any non-pointer,
  14263. // non-interface field appearing in ForceSendFields will be sent to the
  14264. // server regardless of whether the field is empty or not. This may be
  14265. // used to include empty fields in Patch requests.
  14266. ForceSendFields []string `json:"-"`
  14267. // NullFields is a list of field names (e.g. "Fingerprint") to include
  14268. // in API requests with the JSON null value. By default, fields with
  14269. // empty values are omitted from API requests. However, any field with
  14270. // an empty value appearing in NullFields will be sent to the server as
  14271. // null. It is an error if a field in this list has a non-empty value.
  14272. // This may be used to include null fields in Patch requests.
  14273. NullFields []string `json:"-"`
  14274. }
  14275. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  14276. type NoMethod InstanceGroupsSetNamedPortsRequest
  14277. raw := NoMethod(*s)
  14278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14279. }
  14280. // InstanceList: Contains a list of instances.
  14281. type InstanceList struct {
  14282. // Id: [Output Only] Unique identifier for the resource; defined by the
  14283. // server.
  14284. Id string `json:"id,omitempty"`
  14285. // Items: A list of Instance resources.
  14286. Items []*Instance `json:"items,omitempty"`
  14287. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  14288. // lists of Instance resources.
  14289. Kind string `json:"kind,omitempty"`
  14290. // NextPageToken: [Output Only] This token allows you to get the next
  14291. // page of results for list requests. If the number of results is larger
  14292. // than maxResults, use the nextPageToken as a value for the query
  14293. // parameter pageToken in the next list request. Subsequent list
  14294. // requests will have their own nextPageToken to continue paging through
  14295. // the results.
  14296. NextPageToken string `json:"nextPageToken,omitempty"`
  14297. // SelfLink: [Output Only] Server-defined URL for this resource.
  14298. SelfLink string `json:"selfLink,omitempty"`
  14299. // Warning: [Output Only] Informational warning message.
  14300. Warning *InstanceListWarning `json:"warning,omitempty"`
  14301. // ServerResponse contains the HTTP response code and headers from the
  14302. // server.
  14303. googleapi.ServerResponse `json:"-"`
  14304. // ForceSendFields is a list of field names (e.g. "Id") to
  14305. // unconditionally include in API requests. By default, fields with
  14306. // empty values are omitted from API requests. However, any non-pointer,
  14307. // non-interface field appearing in ForceSendFields will be sent to the
  14308. // server regardless of whether the field is empty or not. This may be
  14309. // used to include empty fields in Patch requests.
  14310. ForceSendFields []string `json:"-"`
  14311. // NullFields is a list of field names (e.g. "Id") to include in API
  14312. // requests with the JSON null value. By default, fields with empty
  14313. // values are omitted from API requests. However, any field with an
  14314. // empty value appearing in NullFields will be sent to the server as
  14315. // null. It is an error if a field in this list has a non-empty value.
  14316. // This may be used to include null fields in Patch requests.
  14317. NullFields []string `json:"-"`
  14318. }
  14319. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  14320. type NoMethod InstanceList
  14321. raw := NoMethod(*s)
  14322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14323. }
  14324. // InstanceListWarning: [Output Only] Informational warning message.
  14325. type InstanceListWarning struct {
  14326. // Code: [Output Only] A warning code, if applicable. For example,
  14327. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14328. // the response.
  14329. //
  14330. // Possible values:
  14331. // "CLEANUP_FAILED"
  14332. // "DEPRECATED_RESOURCE_USED"
  14333. // "DEPRECATED_TYPE_USED"
  14334. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14335. // "EXPERIMENTAL_TYPE_USED"
  14336. // "EXTERNAL_API_WARNING"
  14337. // "FIELD_VALUE_OVERRIDEN"
  14338. // "INJECTED_KERNELS_DEPRECATED"
  14339. // "MISSING_TYPE_DEPENDENCY"
  14340. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14341. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14342. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14343. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14344. // "NEXT_HOP_NOT_RUNNING"
  14345. // "NOT_CRITICAL_ERROR"
  14346. // "NO_RESULTS_ON_PAGE"
  14347. // "REQUIRED_TOS_AGREEMENT"
  14348. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14349. // "RESOURCE_NOT_DELETED"
  14350. // "SCHEMA_VALIDATION_IGNORED"
  14351. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14352. // "UNDECLARED_PROPERTIES"
  14353. // "UNREACHABLE"
  14354. Code string `json:"code,omitempty"`
  14355. // Data: [Output Only] Metadata about this warning in key: value format.
  14356. // For example:
  14357. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14358. Data []*InstanceListWarningData `json:"data,omitempty"`
  14359. // Message: [Output Only] A human-readable description of the warning
  14360. // code.
  14361. Message string `json:"message,omitempty"`
  14362. // ForceSendFields is a list of field names (e.g. "Code") to
  14363. // unconditionally include in API requests. By default, fields with
  14364. // empty values are omitted from API requests. However, any non-pointer,
  14365. // non-interface field appearing in ForceSendFields will be sent to the
  14366. // server regardless of whether the field is empty or not. This may be
  14367. // used to include empty fields in Patch requests.
  14368. ForceSendFields []string `json:"-"`
  14369. // NullFields is a list of field names (e.g. "Code") to include in API
  14370. // requests with the JSON null value. By default, fields with empty
  14371. // values are omitted from API requests. However, any field with an
  14372. // empty value appearing in NullFields will be sent to the server as
  14373. // null. It is an error if a field in this list has a non-empty value.
  14374. // This may be used to include null fields in Patch requests.
  14375. NullFields []string `json:"-"`
  14376. }
  14377. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  14378. type NoMethod InstanceListWarning
  14379. raw := NoMethod(*s)
  14380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14381. }
  14382. type InstanceListWarningData struct {
  14383. // Key: [Output Only] A key that provides more detail on the warning
  14384. // being returned. For example, for warnings where there are no results
  14385. // in a list request for a particular zone, this key might be scope and
  14386. // the key value might be the zone name. Other examples might be a key
  14387. // indicating a deprecated resource and a suggested replacement, or a
  14388. // warning about invalid network settings (for example, if an instance
  14389. // attempts to perform IP forwarding but is not enabled for IP
  14390. // forwarding).
  14391. Key string `json:"key,omitempty"`
  14392. // Value: [Output Only] A warning data value corresponding to the key.
  14393. Value string `json:"value,omitempty"`
  14394. // ForceSendFields is a list of field names (e.g. "Key") to
  14395. // unconditionally include in API requests. By default, fields with
  14396. // empty values are omitted from API requests. However, any non-pointer,
  14397. // non-interface field appearing in ForceSendFields will be sent to the
  14398. // server regardless of whether the field is empty or not. This may be
  14399. // used to include empty fields in Patch requests.
  14400. ForceSendFields []string `json:"-"`
  14401. // NullFields is a list of field names (e.g. "Key") to include in API
  14402. // requests with the JSON null value. By default, fields with empty
  14403. // values are omitted from API requests. However, any field with an
  14404. // empty value appearing in NullFields will be sent to the server as
  14405. // null. It is an error if a field in this list has a non-empty value.
  14406. // This may be used to include null fields in Patch requests.
  14407. NullFields []string `json:"-"`
  14408. }
  14409. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  14410. type NoMethod InstanceListWarningData
  14411. raw := NoMethod(*s)
  14412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14413. }
  14414. // InstanceListReferrers: Contains a list of instance referrers.
  14415. type InstanceListReferrers struct {
  14416. // Id: [Output Only] Unique identifier for the resource; defined by the
  14417. // server.
  14418. Id string `json:"id,omitempty"`
  14419. // Items: A list of Reference resources.
  14420. Items []*Reference `json:"items,omitempty"`
  14421. // Kind: [Output Only] Type of resource. Always
  14422. // compute#instanceListReferrers for lists of Instance referrers.
  14423. Kind string `json:"kind,omitempty"`
  14424. // NextPageToken: [Output Only] This token allows you to get the next
  14425. // page of results for list requests. If the number of results is larger
  14426. // than maxResults, use the nextPageToken as a value for the query
  14427. // parameter pageToken in the next list request. Subsequent list
  14428. // requests will have their own nextPageToken to continue paging through
  14429. // the results.
  14430. NextPageToken string `json:"nextPageToken,omitempty"`
  14431. // SelfLink: [Output Only] Server-defined URL for this resource.
  14432. SelfLink string `json:"selfLink,omitempty"`
  14433. // Warning: [Output Only] Informational warning message.
  14434. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  14435. // ServerResponse contains the HTTP response code and headers from the
  14436. // server.
  14437. googleapi.ServerResponse `json:"-"`
  14438. // ForceSendFields is a list of field names (e.g. "Id") to
  14439. // unconditionally include in API requests. By default, fields with
  14440. // empty values are omitted from API requests. However, any non-pointer,
  14441. // non-interface field appearing in ForceSendFields will be sent to the
  14442. // server regardless of whether the field is empty or not. This may be
  14443. // used to include empty fields in Patch requests.
  14444. ForceSendFields []string `json:"-"`
  14445. // NullFields is a list of field names (e.g. "Id") to include in API
  14446. // requests with the JSON null value. By default, fields with empty
  14447. // values are omitted from API requests. However, any field with an
  14448. // empty value appearing in NullFields will be sent to the server as
  14449. // null. It is an error if a field in this list has a non-empty value.
  14450. // This may be used to include null fields in Patch requests.
  14451. NullFields []string `json:"-"`
  14452. }
  14453. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  14454. type NoMethod InstanceListReferrers
  14455. raw := NoMethod(*s)
  14456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14457. }
  14458. // InstanceListReferrersWarning: [Output Only] Informational warning
  14459. // message.
  14460. type InstanceListReferrersWarning struct {
  14461. // Code: [Output Only] A warning code, if applicable. For example,
  14462. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14463. // the response.
  14464. //
  14465. // Possible values:
  14466. // "CLEANUP_FAILED"
  14467. // "DEPRECATED_RESOURCE_USED"
  14468. // "DEPRECATED_TYPE_USED"
  14469. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14470. // "EXPERIMENTAL_TYPE_USED"
  14471. // "EXTERNAL_API_WARNING"
  14472. // "FIELD_VALUE_OVERRIDEN"
  14473. // "INJECTED_KERNELS_DEPRECATED"
  14474. // "MISSING_TYPE_DEPENDENCY"
  14475. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14476. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14477. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14478. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14479. // "NEXT_HOP_NOT_RUNNING"
  14480. // "NOT_CRITICAL_ERROR"
  14481. // "NO_RESULTS_ON_PAGE"
  14482. // "REQUIRED_TOS_AGREEMENT"
  14483. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14484. // "RESOURCE_NOT_DELETED"
  14485. // "SCHEMA_VALIDATION_IGNORED"
  14486. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14487. // "UNDECLARED_PROPERTIES"
  14488. // "UNREACHABLE"
  14489. Code string `json:"code,omitempty"`
  14490. // Data: [Output Only] Metadata about this warning in key: value format.
  14491. // For example:
  14492. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14493. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  14494. // Message: [Output Only] A human-readable description of the warning
  14495. // code.
  14496. Message string `json:"message,omitempty"`
  14497. // ForceSendFields is a list of field names (e.g. "Code") to
  14498. // unconditionally include in API requests. By default, fields with
  14499. // empty values are omitted from API requests. However, any non-pointer,
  14500. // non-interface field appearing in ForceSendFields will be sent to the
  14501. // server regardless of whether the field is empty or not. This may be
  14502. // used to include empty fields in Patch requests.
  14503. ForceSendFields []string `json:"-"`
  14504. // NullFields is a list of field names (e.g. "Code") to include in API
  14505. // requests with the JSON null value. By default, fields with empty
  14506. // values are omitted from API requests. However, any field with an
  14507. // empty value appearing in NullFields will be sent to the server as
  14508. // null. It is an error if a field in this list has a non-empty value.
  14509. // This may be used to include null fields in Patch requests.
  14510. NullFields []string `json:"-"`
  14511. }
  14512. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  14513. type NoMethod InstanceListReferrersWarning
  14514. raw := NoMethod(*s)
  14515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14516. }
  14517. type InstanceListReferrersWarningData struct {
  14518. // Key: [Output Only] A key that provides more detail on the warning
  14519. // being returned. For example, for warnings where there are no results
  14520. // in a list request for a particular zone, this key might be scope and
  14521. // the key value might be the zone name. Other examples might be a key
  14522. // indicating a deprecated resource and a suggested replacement, or a
  14523. // warning about invalid network settings (for example, if an instance
  14524. // attempts to perform IP forwarding but is not enabled for IP
  14525. // forwarding).
  14526. Key string `json:"key,omitempty"`
  14527. // Value: [Output Only] A warning data value corresponding to the key.
  14528. Value string `json:"value,omitempty"`
  14529. // ForceSendFields is a list of field names (e.g. "Key") to
  14530. // unconditionally include in API requests. By default, fields with
  14531. // empty values are omitted from API requests. However, any non-pointer,
  14532. // non-interface field appearing in ForceSendFields will be sent to the
  14533. // server regardless of whether the field is empty or not. This may be
  14534. // used to include empty fields in Patch requests.
  14535. ForceSendFields []string `json:"-"`
  14536. // NullFields is a list of field names (e.g. "Key") to include in API
  14537. // requests with the JSON null value. By default, fields with empty
  14538. // values are omitted from API requests. However, any field with an
  14539. // empty value appearing in NullFields will be sent to the server as
  14540. // null. It is an error if a field in this list has a non-empty value.
  14541. // This may be used to include null fields in Patch requests.
  14542. NullFields []string `json:"-"`
  14543. }
  14544. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  14545. type NoMethod InstanceListReferrersWarningData
  14546. raw := NoMethod(*s)
  14547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14548. }
  14549. type InstanceMoveRequest struct {
  14550. // DestinationZone: The URL of the destination zone to move the
  14551. // instance. This can be a full or partial URL. For example, the
  14552. // following are all valid URLs to a zone:
  14553. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  14554. //
  14555. // - projects/project/zones/zone
  14556. // - zones/zone
  14557. DestinationZone string `json:"destinationZone,omitempty"`
  14558. // TargetInstance: The URL of the target instance to move. This can be a
  14559. // full or partial URL. For example, the following are all valid URLs to
  14560. // an instance:
  14561. // -
  14562. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  14563. // - projects/project/zones/zone/instances/instance
  14564. // - zones/zone/instances/instance
  14565. TargetInstance string `json:"targetInstance,omitempty"`
  14566. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  14567. // unconditionally include in API requests. By default, fields with
  14568. // empty values are omitted from API requests. However, any non-pointer,
  14569. // non-interface field appearing in ForceSendFields will be sent to the
  14570. // server regardless of whether the field is empty or not. This may be
  14571. // used to include empty fields in Patch requests.
  14572. ForceSendFields []string `json:"-"`
  14573. // NullFields is a list of field names (e.g. "DestinationZone") to
  14574. // include in API requests with the JSON null value. By default, fields
  14575. // with empty values are omitted from API requests. However, any field
  14576. // with an empty value appearing in NullFields will be sent to the
  14577. // server as null. It is an error if a field in this list has a
  14578. // non-empty value. This may be used to include null fields in Patch
  14579. // requests.
  14580. NullFields []string `json:"-"`
  14581. }
  14582. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  14583. type NoMethod InstanceMoveRequest
  14584. raw := NoMethod(*s)
  14585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14586. }
  14587. type InstanceProperties struct {
  14588. // AllocationAffinity: The configuration of desired allocations which
  14589. // this Instance could consume capacity from.
  14590. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  14591. // CanIpForward: Enables instances created based on this template to
  14592. // send packets with source IP addresses other than their own and
  14593. // receive packets with destination IP addresses other than their own.
  14594. // If these instances will be used as an IP gateway or it will be set as
  14595. // the next-hop in a Route resource, specify true. If unsure, leave this
  14596. // set to false. See the Enable IP forwarding documentation for more
  14597. // information.
  14598. CanIpForward bool `json:"canIpForward,omitempty"`
  14599. // Description: An optional text description for the instances that are
  14600. // created from this instance template.
  14601. Description string `json:"description,omitempty"`
  14602. // Disks: An array of disks that are associated with the instances that
  14603. // are created from this template.
  14604. Disks []*AttachedDisk `json:"disks,omitempty"`
  14605. // DisplayDevice: Display Device properties to enable support for remote
  14606. // display products like: Teradici, VNC and TeamViewer
  14607. DisplayDevice *DisplayDevice `json:"displayDevice,omitempty"`
  14608. // GuestAccelerators: A list of guest accelerator cards' type and count
  14609. // to use for instances created from the instance template.
  14610. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  14611. // Labels: Labels to apply to instances that are created from this
  14612. // template.
  14613. Labels map[string]string `json:"labels,omitempty"`
  14614. // MachineType: The machine type to use for instances that are created
  14615. // from this template.
  14616. MachineType string `json:"machineType,omitempty"`
  14617. // Metadata: The metadata key/value pairs to assign to instances that
  14618. // are created from this template. These pairs can consist of custom
  14619. // metadata or predefined keys. See Project and instance metadata for
  14620. // more information.
  14621. Metadata *Metadata `json:"metadata,omitempty"`
  14622. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  14623. // instance may be scheduled on the specified or newer cpu/platform.
  14624. // Applicable values are the friendly names of CPU platforms, such as
  14625. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  14626. // Bridge". For more information, read Specifying a Minimum CPU
  14627. // Platform.
  14628. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  14629. // NetworkInterfaces: An array of network access configurations for this
  14630. // interface.
  14631. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  14632. // Scheduling: Specifies the scheduling options for the instances that
  14633. // are created from this template.
  14634. Scheduling *Scheduling `json:"scheduling,omitempty"`
  14635. // ServiceAccounts: A list of service accounts with specified scopes.
  14636. // Access tokens for these service accounts are available to the
  14637. // instances that are created from this template. Use metadata queries
  14638. // to obtain the access tokens for these instances.
  14639. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  14640. ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  14641. // ShieldedVmConfig: Specifies the Shielded VM options for the instances
  14642. // that are created from this template.
  14643. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  14644. // Tags: A list of tags to apply to the instances that are created from
  14645. // this template. The tags identify valid sources or targets for network
  14646. // firewalls. The setTags method can modify this list of tags. Each tag
  14647. // within the list must comply with RFC1035.
  14648. Tags *Tags `json:"tags,omitempty"`
  14649. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  14650. // to unconditionally include in API requests. By default, fields with
  14651. // empty values are omitted from API requests. However, any non-pointer,
  14652. // non-interface field appearing in ForceSendFields will be sent to the
  14653. // server regardless of whether the field is empty or not. This may be
  14654. // used to include empty fields in Patch requests.
  14655. ForceSendFields []string `json:"-"`
  14656. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  14657. // include in API requests with the JSON null value. By default, fields
  14658. // with empty values are omitted from API requests. However, any field
  14659. // with an empty value appearing in NullFields will be sent to the
  14660. // server as null. It is an error if a field in this list has a
  14661. // non-empty value. This may be used to include null fields in Patch
  14662. // requests.
  14663. NullFields []string `json:"-"`
  14664. }
  14665. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  14666. type NoMethod InstanceProperties
  14667. raw := NoMethod(*s)
  14668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14669. }
  14670. type InstanceReference struct {
  14671. // Instance: The URL for a specific instance.
  14672. Instance string `json:"instance,omitempty"`
  14673. // ForceSendFields is a list of field names (e.g. "Instance") to
  14674. // unconditionally include in API requests. By default, fields with
  14675. // empty values are omitted from API requests. However, any non-pointer,
  14676. // non-interface field appearing in ForceSendFields will be sent to the
  14677. // server regardless of whether the field is empty or not. This may be
  14678. // used to include empty fields in Patch requests.
  14679. ForceSendFields []string `json:"-"`
  14680. // NullFields is a list of field names (e.g. "Instance") to include in
  14681. // API requests with the JSON null value. By default, fields with empty
  14682. // values are omitted from API requests. However, any field with an
  14683. // empty value appearing in NullFields will be sent to the server as
  14684. // null. It is an error if a field in this list has a non-empty value.
  14685. // This may be used to include null fields in Patch requests.
  14686. NullFields []string `json:"-"`
  14687. }
  14688. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  14689. type NoMethod InstanceReference
  14690. raw := NoMethod(*s)
  14691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14692. }
  14693. // InstanceTemplate: An Instance Template resource. (== resource_for
  14694. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  14695. type InstanceTemplate struct {
  14696. // CreationTimestamp: [Output Only] The creation timestamp for this
  14697. // instance template in RFC3339 text format.
  14698. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14699. // Description: An optional description of this resource. Provide this
  14700. // property when you create the resource.
  14701. Description string `json:"description,omitempty"`
  14702. // Id: [Output Only] A unique identifier for this instance template. The
  14703. // server defines this identifier.
  14704. Id uint64 `json:"id,omitempty,string"`
  14705. // Kind: [Output Only] The resource type, which is always
  14706. // compute#instanceTemplate for instance templates.
  14707. Kind string `json:"kind,omitempty"`
  14708. // Name: Name of the resource; provided by the client when the resource
  14709. // is created. The name must be 1-63 characters long, and comply with
  14710. // RFC1035. Specifically, the name must be 1-63 characters long and
  14711. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  14712. // the first character must be a lowercase letter, and all following
  14713. // characters must be a dash, lowercase letter, or digit, except the
  14714. // last character, which cannot be a dash.
  14715. Name string `json:"name,omitempty"`
  14716. // Properties: The instance properties for this instance template.
  14717. Properties *InstanceProperties `json:"properties,omitempty"`
  14718. // SelfLink: [Output Only] The URL for this instance template. The
  14719. // server defines this URL.
  14720. SelfLink string `json:"selfLink,omitempty"`
  14721. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  14722. // with the resource id.
  14723. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  14724. // SourceInstance: The source instance used to create the template. You
  14725. // can provide this as a partial or full URL to the resource. For
  14726. // example, the following are valid values:
  14727. // -
  14728. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  14729. // - projects/project/zones/zone/instances/instance
  14730. SourceInstance string `json:"sourceInstance,omitempty"`
  14731. // SourceInstanceParams: The source instance params to use to create
  14732. // this instance template.
  14733. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  14734. // ServerResponse contains the HTTP response code and headers from the
  14735. // server.
  14736. googleapi.ServerResponse `json:"-"`
  14737. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14738. // to unconditionally include in API requests. By default, fields with
  14739. // empty values are omitted from API requests. However, any non-pointer,
  14740. // non-interface field appearing in ForceSendFields will be sent to the
  14741. // server regardless of whether the field is empty or not. This may be
  14742. // used to include empty fields in Patch requests.
  14743. ForceSendFields []string `json:"-"`
  14744. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14745. // include in API requests with the JSON null value. By default, fields
  14746. // with empty values are omitted from API requests. However, any field
  14747. // with an empty value appearing in NullFields will be sent to the
  14748. // server as null. It is an error if a field in this list has a
  14749. // non-empty value. This may be used to include null fields in Patch
  14750. // requests.
  14751. NullFields []string `json:"-"`
  14752. }
  14753. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  14754. type NoMethod InstanceTemplate
  14755. raw := NoMethod(*s)
  14756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14757. }
  14758. // InstanceTemplateList: A list of instance templates.
  14759. type InstanceTemplateList struct {
  14760. // Id: [Output Only] Unique identifier for the resource; defined by the
  14761. // server.
  14762. Id string `json:"id,omitempty"`
  14763. // Items: A list of InstanceTemplate resources.
  14764. Items []*InstanceTemplate `json:"items,omitempty"`
  14765. // Kind: [Output Only] The resource type, which is always
  14766. // compute#instanceTemplatesListResponse for instance template lists.
  14767. Kind string `json:"kind,omitempty"`
  14768. // NextPageToken: [Output Only] This token allows you to get the next
  14769. // page of results for list requests. If the number of results is larger
  14770. // than maxResults, use the nextPageToken as a value for the query
  14771. // parameter pageToken in the next list request. Subsequent list
  14772. // requests will have their own nextPageToken to continue paging through
  14773. // the results.
  14774. NextPageToken string `json:"nextPageToken,omitempty"`
  14775. // SelfLink: [Output Only] Server-defined URL for this resource.
  14776. SelfLink string `json:"selfLink,omitempty"`
  14777. // Warning: [Output Only] Informational warning message.
  14778. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  14779. // ServerResponse contains the HTTP response code and headers from the
  14780. // server.
  14781. googleapi.ServerResponse `json:"-"`
  14782. // ForceSendFields is a list of field names (e.g. "Id") to
  14783. // unconditionally include in API requests. By default, fields with
  14784. // empty values are omitted from API requests. However, any non-pointer,
  14785. // non-interface field appearing in ForceSendFields will be sent to the
  14786. // server regardless of whether the field is empty or not. This may be
  14787. // used to include empty fields in Patch requests.
  14788. ForceSendFields []string `json:"-"`
  14789. // NullFields is a list of field names (e.g. "Id") to include in API
  14790. // requests with the JSON null value. By default, fields with empty
  14791. // values are omitted from API requests. However, any field with an
  14792. // empty value appearing in NullFields will be sent to the server as
  14793. // null. It is an error if a field in this list has a non-empty value.
  14794. // This may be used to include null fields in Patch requests.
  14795. NullFields []string `json:"-"`
  14796. }
  14797. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  14798. type NoMethod InstanceTemplateList
  14799. raw := NoMethod(*s)
  14800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14801. }
  14802. // InstanceTemplateListWarning: [Output Only] Informational warning
  14803. // message.
  14804. type InstanceTemplateListWarning struct {
  14805. // Code: [Output Only] A warning code, if applicable. For example,
  14806. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14807. // the response.
  14808. //
  14809. // Possible values:
  14810. // "CLEANUP_FAILED"
  14811. // "DEPRECATED_RESOURCE_USED"
  14812. // "DEPRECATED_TYPE_USED"
  14813. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14814. // "EXPERIMENTAL_TYPE_USED"
  14815. // "EXTERNAL_API_WARNING"
  14816. // "FIELD_VALUE_OVERRIDEN"
  14817. // "INJECTED_KERNELS_DEPRECATED"
  14818. // "MISSING_TYPE_DEPENDENCY"
  14819. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14820. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14821. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14822. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14823. // "NEXT_HOP_NOT_RUNNING"
  14824. // "NOT_CRITICAL_ERROR"
  14825. // "NO_RESULTS_ON_PAGE"
  14826. // "REQUIRED_TOS_AGREEMENT"
  14827. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14828. // "RESOURCE_NOT_DELETED"
  14829. // "SCHEMA_VALIDATION_IGNORED"
  14830. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14831. // "UNDECLARED_PROPERTIES"
  14832. // "UNREACHABLE"
  14833. Code string `json:"code,omitempty"`
  14834. // Data: [Output Only] Metadata about this warning in key: value format.
  14835. // For example:
  14836. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14837. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  14838. // Message: [Output Only] A human-readable description of the warning
  14839. // code.
  14840. Message string `json:"message,omitempty"`
  14841. // ForceSendFields is a list of field names (e.g. "Code") to
  14842. // unconditionally include in API requests. By default, fields with
  14843. // empty values are omitted from API requests. However, any non-pointer,
  14844. // non-interface field appearing in ForceSendFields will be sent to the
  14845. // server regardless of whether the field is empty or not. This may be
  14846. // used to include empty fields in Patch requests.
  14847. ForceSendFields []string `json:"-"`
  14848. // NullFields is a list of field names (e.g. "Code") to include in API
  14849. // requests with the JSON null value. By default, fields with empty
  14850. // values are omitted from API requests. However, any field with an
  14851. // empty value appearing in NullFields will be sent to the server as
  14852. // null. It is an error if a field in this list has a non-empty value.
  14853. // This may be used to include null fields in Patch requests.
  14854. NullFields []string `json:"-"`
  14855. }
  14856. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  14857. type NoMethod InstanceTemplateListWarning
  14858. raw := NoMethod(*s)
  14859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14860. }
  14861. type InstanceTemplateListWarningData struct {
  14862. // Key: [Output Only] A key that provides more detail on the warning
  14863. // being returned. For example, for warnings where there are no results
  14864. // in a list request for a particular zone, this key might be scope and
  14865. // the key value might be the zone name. Other examples might be a key
  14866. // indicating a deprecated resource and a suggested replacement, or a
  14867. // warning about invalid network settings (for example, if an instance
  14868. // attempts to perform IP forwarding but is not enabled for IP
  14869. // forwarding).
  14870. Key string `json:"key,omitempty"`
  14871. // Value: [Output Only] A warning data value corresponding to the key.
  14872. Value string `json:"value,omitempty"`
  14873. // ForceSendFields is a list of field names (e.g. "Key") to
  14874. // unconditionally include in API requests. By default, fields with
  14875. // empty values are omitted from API requests. However, any non-pointer,
  14876. // non-interface field appearing in ForceSendFields will be sent to the
  14877. // server regardless of whether the field is empty or not. This may be
  14878. // used to include empty fields in Patch requests.
  14879. ForceSendFields []string `json:"-"`
  14880. // NullFields is a list of field names (e.g. "Key") to include in API
  14881. // requests with the JSON null value. By default, fields with empty
  14882. // values are omitted from API requests. However, any field with an
  14883. // empty value appearing in NullFields will be sent to the server as
  14884. // null. It is an error if a field in this list has a non-empty value.
  14885. // This may be used to include null fields in Patch requests.
  14886. NullFields []string `json:"-"`
  14887. }
  14888. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  14889. type NoMethod InstanceTemplateListWarningData
  14890. raw := NoMethod(*s)
  14891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14892. }
  14893. type InstanceWithNamedPorts struct {
  14894. // Instance: [Output Only] The URL of the instance.
  14895. Instance string `json:"instance,omitempty"`
  14896. // NamedPorts: [Output Only] The named ports that belong to this
  14897. // instance group.
  14898. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  14899. // Status: [Output Only] The status of the instance.
  14900. //
  14901. // Possible values:
  14902. // "PROVISIONING"
  14903. // "REPAIRING"
  14904. // "RUNNING"
  14905. // "STAGING"
  14906. // "STOPPED"
  14907. // "STOPPING"
  14908. // "SUSPENDED"
  14909. // "SUSPENDING"
  14910. // "TERMINATED"
  14911. Status string `json:"status,omitempty"`
  14912. // ForceSendFields is a list of field names (e.g. "Instance") to
  14913. // unconditionally include in API requests. By default, fields with
  14914. // empty values are omitted from API requests. However, any non-pointer,
  14915. // non-interface field appearing in ForceSendFields will be sent to the
  14916. // server regardless of whether the field is empty or not. This may be
  14917. // used to include empty fields in Patch requests.
  14918. ForceSendFields []string `json:"-"`
  14919. // NullFields is a list of field names (e.g. "Instance") to include in
  14920. // API requests with the JSON null value. By default, fields with empty
  14921. // values are omitted from API requests. However, any field with an
  14922. // empty value appearing in NullFields will be sent to the server as
  14923. // null. It is an error if a field in this list has a non-empty value.
  14924. // This may be used to include null fields in Patch requests.
  14925. NullFields []string `json:"-"`
  14926. }
  14927. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  14928. type NoMethod InstanceWithNamedPorts
  14929. raw := NoMethod(*s)
  14930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14931. }
  14932. type InstancesAddResourcePoliciesRequest struct {
  14933. // ResourcePolicies: Resource policies to be added to this instance.
  14934. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  14935. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  14936. // unconditionally include in API requests. By default, fields with
  14937. // empty values are omitted from API requests. However, any non-pointer,
  14938. // non-interface field appearing in ForceSendFields will be sent to the
  14939. // server regardless of whether the field is empty or not. This may be
  14940. // used to include empty fields in Patch requests.
  14941. ForceSendFields []string `json:"-"`
  14942. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  14943. // include in API requests with the JSON null value. By default, fields
  14944. // with empty values are omitted from API requests. However, any field
  14945. // with an empty value appearing in NullFields will be sent to the
  14946. // server as null. It is an error if a field in this list has a
  14947. // non-empty value. This may be used to include null fields in Patch
  14948. // requests.
  14949. NullFields []string `json:"-"`
  14950. }
  14951. func (s *InstancesAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  14952. type NoMethod InstancesAddResourcePoliciesRequest
  14953. raw := NoMethod(*s)
  14954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14955. }
  14956. type InstancesRemoveResourcePoliciesRequest struct {
  14957. // ResourcePolicies: Resource policies to be removed from this instance.
  14958. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  14959. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  14960. // unconditionally include in API requests. By default, fields with
  14961. // empty values are omitted from API requests. However, any non-pointer,
  14962. // non-interface field appearing in ForceSendFields will be sent to the
  14963. // server regardless of whether the field is empty or not. This may be
  14964. // used to include empty fields in Patch requests.
  14965. ForceSendFields []string `json:"-"`
  14966. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  14967. // include in API requests with the JSON null value. By default, fields
  14968. // with empty values are omitted from API requests. However, any field
  14969. // with an empty value appearing in NullFields will be sent to the
  14970. // server as null. It is an error if a field in this list has a
  14971. // non-empty value. This may be used to include null fields in Patch
  14972. // requests.
  14973. NullFields []string `json:"-"`
  14974. }
  14975. func (s *InstancesRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  14976. type NoMethod InstancesRemoveResourcePoliciesRequest
  14977. raw := NoMethod(*s)
  14978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14979. }
  14980. type InstancesResumeRequest struct {
  14981. // Disks: Array of disks associated with this instance that are
  14982. // protected with a customer-supplied encryption key.
  14983. //
  14984. // In order to resume the instance, the disk url and its corresponding
  14985. // key must be provided.
  14986. //
  14987. // If the disk is not protected with a customer-supplied encryption key
  14988. // it should not be specified.
  14989. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  14990. // InstanceEncryptionKey: Decrypts data associated with an instance that
  14991. // is protected with a customer-supplied encryption key.
  14992. //
  14993. // If the instance you are starting is protected with a
  14994. // customer-supplied encryption key, the correct key must be provided
  14995. // otherwise the instance resume will not succeed.
  14996. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  14997. // ForceSendFields is a list of field names (e.g. "Disks") to
  14998. // unconditionally include in API requests. By default, fields with
  14999. // empty values are omitted from API requests. However, any non-pointer,
  15000. // non-interface field appearing in ForceSendFields will be sent to the
  15001. // server regardless of whether the field is empty or not. This may be
  15002. // used to include empty fields in Patch requests.
  15003. ForceSendFields []string `json:"-"`
  15004. // NullFields is a list of field names (e.g. "Disks") to include in API
  15005. // requests with the JSON null value. By default, fields with empty
  15006. // values are omitted from API requests. However, any field with an
  15007. // empty value appearing in NullFields will be sent to the server as
  15008. // null. It is an error if a field in this list has a non-empty value.
  15009. // This may be used to include null fields in Patch requests.
  15010. NullFields []string `json:"-"`
  15011. }
  15012. func (s *InstancesResumeRequest) MarshalJSON() ([]byte, error) {
  15013. type NoMethod InstancesResumeRequest
  15014. raw := NoMethod(*s)
  15015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15016. }
  15017. type InstancesScopedList struct {
  15018. // Instances: [Output Only] A list of instances contained in this scope.
  15019. Instances []*Instance `json:"instances,omitempty"`
  15020. // Warning: [Output Only] Informational warning which replaces the list
  15021. // of instances when the list is empty.
  15022. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  15023. // ForceSendFields is a list of field names (e.g. "Instances") to
  15024. // unconditionally include in API requests. By default, fields with
  15025. // empty values are omitted from API requests. However, any non-pointer,
  15026. // non-interface field appearing in ForceSendFields will be sent to the
  15027. // server regardless of whether the field is empty or not. This may be
  15028. // used to include empty fields in Patch requests.
  15029. ForceSendFields []string `json:"-"`
  15030. // NullFields is a list of field names (e.g. "Instances") to include in
  15031. // API requests with the JSON null value. By default, fields with empty
  15032. // values are omitted from API requests. However, any field with an
  15033. // empty value appearing in NullFields will be sent to the server as
  15034. // null. It is an error if a field in this list has a non-empty value.
  15035. // This may be used to include null fields in Patch requests.
  15036. NullFields []string `json:"-"`
  15037. }
  15038. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  15039. type NoMethod InstancesScopedList
  15040. raw := NoMethod(*s)
  15041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15042. }
  15043. // InstancesScopedListWarning: [Output Only] Informational warning which
  15044. // replaces the list of instances when the list is empty.
  15045. type InstancesScopedListWarning struct {
  15046. // Code: [Output Only] A warning code, if applicable. For example,
  15047. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15048. // the response.
  15049. //
  15050. // Possible values:
  15051. // "CLEANUP_FAILED"
  15052. // "DEPRECATED_RESOURCE_USED"
  15053. // "DEPRECATED_TYPE_USED"
  15054. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15055. // "EXPERIMENTAL_TYPE_USED"
  15056. // "EXTERNAL_API_WARNING"
  15057. // "FIELD_VALUE_OVERRIDEN"
  15058. // "INJECTED_KERNELS_DEPRECATED"
  15059. // "MISSING_TYPE_DEPENDENCY"
  15060. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15061. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15062. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15063. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15064. // "NEXT_HOP_NOT_RUNNING"
  15065. // "NOT_CRITICAL_ERROR"
  15066. // "NO_RESULTS_ON_PAGE"
  15067. // "REQUIRED_TOS_AGREEMENT"
  15068. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15069. // "RESOURCE_NOT_DELETED"
  15070. // "SCHEMA_VALIDATION_IGNORED"
  15071. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15072. // "UNDECLARED_PROPERTIES"
  15073. // "UNREACHABLE"
  15074. Code string `json:"code,omitempty"`
  15075. // Data: [Output Only] Metadata about this warning in key: value format.
  15076. // For example:
  15077. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15078. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  15079. // Message: [Output Only] A human-readable description of the warning
  15080. // code.
  15081. Message string `json:"message,omitempty"`
  15082. // ForceSendFields is a list of field names (e.g. "Code") to
  15083. // unconditionally include in API requests. By default, fields with
  15084. // empty values are omitted from API requests. However, any non-pointer,
  15085. // non-interface field appearing in ForceSendFields will be sent to the
  15086. // server regardless of whether the field is empty or not. This may be
  15087. // used to include empty fields in Patch requests.
  15088. ForceSendFields []string `json:"-"`
  15089. // NullFields is a list of field names (e.g. "Code") to include in API
  15090. // requests with the JSON null value. By default, fields with empty
  15091. // values are omitted from API requests. However, any field with an
  15092. // empty value appearing in NullFields will be sent to the server as
  15093. // null. It is an error if a field in this list has a non-empty value.
  15094. // This may be used to include null fields in Patch requests.
  15095. NullFields []string `json:"-"`
  15096. }
  15097. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  15098. type NoMethod InstancesScopedListWarning
  15099. raw := NoMethod(*s)
  15100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15101. }
  15102. type InstancesScopedListWarningData struct {
  15103. // Key: [Output Only] A key that provides more detail on the warning
  15104. // being returned. For example, for warnings where there are no results
  15105. // in a list request for a particular zone, this key might be scope and
  15106. // the key value might be the zone name. Other examples might be a key
  15107. // indicating a deprecated resource and a suggested replacement, or a
  15108. // warning about invalid network settings (for example, if an instance
  15109. // attempts to perform IP forwarding but is not enabled for IP
  15110. // forwarding).
  15111. Key string `json:"key,omitempty"`
  15112. // Value: [Output Only] A warning data value corresponding to the key.
  15113. Value string `json:"value,omitempty"`
  15114. // ForceSendFields is a list of field names (e.g. "Key") to
  15115. // unconditionally include in API requests. By default, fields with
  15116. // empty values are omitted from API requests. However, any non-pointer,
  15117. // non-interface field appearing in ForceSendFields will be sent to the
  15118. // server regardless of whether the field is empty or not. This may be
  15119. // used to include empty fields in Patch requests.
  15120. ForceSendFields []string `json:"-"`
  15121. // NullFields is a list of field names (e.g. "Key") to include in API
  15122. // requests with the JSON null value. By default, fields with empty
  15123. // values are omitted from API requests. However, any field with an
  15124. // empty value appearing in NullFields will be sent to the server as
  15125. // null. It is an error if a field in this list has a non-empty value.
  15126. // This may be used to include null fields in Patch requests.
  15127. NullFields []string `json:"-"`
  15128. }
  15129. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  15130. type NoMethod InstancesScopedListWarningData
  15131. raw := NoMethod(*s)
  15132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15133. }
  15134. type InstancesSetLabelsRequest struct {
  15135. // LabelFingerprint: Fingerprint of the previous set of labels for this
  15136. // resource, used to prevent conflicts. Provide the latest fingerprint
  15137. // value when making a request to add or change labels.
  15138. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  15139. Labels map[string]string `json:"labels,omitempty"`
  15140. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  15141. // unconditionally include in API requests. By default, fields with
  15142. // empty values are omitted from API requests. However, any non-pointer,
  15143. // non-interface field appearing in ForceSendFields will be sent to the
  15144. // server regardless of whether the field is empty or not. This may be
  15145. // used to include empty fields in Patch requests.
  15146. ForceSendFields []string `json:"-"`
  15147. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  15148. // include in API requests with the JSON null value. By default, fields
  15149. // with empty values are omitted from API requests. However, any field
  15150. // with an empty value appearing in NullFields will be sent to the
  15151. // server as null. It is an error if a field in this list has a
  15152. // non-empty value. This may be used to include null fields in Patch
  15153. // requests.
  15154. NullFields []string `json:"-"`
  15155. }
  15156. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  15157. type NoMethod InstancesSetLabelsRequest
  15158. raw := NoMethod(*s)
  15159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15160. }
  15161. type InstancesSetMachineResourcesRequest struct {
  15162. // GuestAccelerators: A list of the type and count of accelerator cards
  15163. // attached to the instance.
  15164. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  15165. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  15166. // to unconditionally include in API requests. By default, fields with
  15167. // empty values are omitted from API requests. However, any non-pointer,
  15168. // non-interface field appearing in ForceSendFields will be sent to the
  15169. // server regardless of whether the field is empty or not. This may be
  15170. // used to include empty fields in Patch requests.
  15171. ForceSendFields []string `json:"-"`
  15172. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  15173. // include in API requests with the JSON null value. By default, fields
  15174. // with empty values are omitted from API requests. However, any field
  15175. // with an empty value appearing in NullFields will be sent to the
  15176. // server as null. It is an error if a field in this list has a
  15177. // non-empty value. This may be used to include null fields in Patch
  15178. // requests.
  15179. NullFields []string `json:"-"`
  15180. }
  15181. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  15182. type NoMethod InstancesSetMachineResourcesRequest
  15183. raw := NoMethod(*s)
  15184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15185. }
  15186. type InstancesSetMachineTypeRequest struct {
  15187. // MachineType: Full or partial URL of the machine type resource. See
  15188. // Machine Types for a full list of machine types. For example:
  15189. // zones/us-central1-f/machineTypes/n1-standard-1
  15190. MachineType string `json:"machineType,omitempty"`
  15191. // ForceSendFields is a list of field names (e.g. "MachineType") to
  15192. // unconditionally include in API requests. By default, fields with
  15193. // empty values are omitted from API requests. However, any non-pointer,
  15194. // non-interface field appearing in ForceSendFields will be sent to the
  15195. // server regardless of whether the field is empty or not. This may be
  15196. // used to include empty fields in Patch requests.
  15197. ForceSendFields []string `json:"-"`
  15198. // NullFields is a list of field names (e.g. "MachineType") to include
  15199. // in API requests with the JSON null value. By default, fields with
  15200. // empty values are omitted from API requests. However, any field with
  15201. // an empty value appearing in NullFields will be sent to the server as
  15202. // null. It is an error if a field in this list has a non-empty value.
  15203. // This may be used to include null fields in Patch requests.
  15204. NullFields []string `json:"-"`
  15205. }
  15206. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  15207. type NoMethod InstancesSetMachineTypeRequest
  15208. raw := NoMethod(*s)
  15209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15210. }
  15211. type InstancesSetMinCpuPlatformRequest struct {
  15212. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  15213. // at.
  15214. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  15215. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  15216. // unconditionally include in API requests. By default, fields with
  15217. // empty values are omitted from API requests. However, any non-pointer,
  15218. // non-interface field appearing in ForceSendFields will be sent to the
  15219. // server regardless of whether the field is empty or not. This may be
  15220. // used to include empty fields in Patch requests.
  15221. ForceSendFields []string `json:"-"`
  15222. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  15223. // include in API requests with the JSON null value. By default, fields
  15224. // with empty values are omitted from API requests. However, any field
  15225. // with an empty value appearing in NullFields will be sent to the
  15226. // server as null. It is an error if a field in this list has a
  15227. // non-empty value. This may be used to include null fields in Patch
  15228. // requests.
  15229. NullFields []string `json:"-"`
  15230. }
  15231. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  15232. type NoMethod InstancesSetMinCpuPlatformRequest
  15233. raw := NoMethod(*s)
  15234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15235. }
  15236. type InstancesSetServiceAccountRequest struct {
  15237. // Email: Email address of the service account.
  15238. Email string `json:"email,omitempty"`
  15239. // Scopes: The list of scopes to be made available for this service
  15240. // account.
  15241. Scopes []string `json:"scopes,omitempty"`
  15242. // ForceSendFields is a list of field names (e.g. "Email") to
  15243. // unconditionally include in API requests. By default, fields with
  15244. // empty values are omitted from API requests. However, any non-pointer,
  15245. // non-interface field appearing in ForceSendFields will be sent to the
  15246. // server regardless of whether the field is empty or not. This may be
  15247. // used to include empty fields in Patch requests.
  15248. ForceSendFields []string `json:"-"`
  15249. // NullFields is a list of field names (e.g. "Email") to include in API
  15250. // requests with the JSON null value. By default, fields with empty
  15251. // values are omitted from API requests. However, any field with an
  15252. // empty value appearing in NullFields will be sent to the server as
  15253. // null. It is an error if a field in this list has a non-empty value.
  15254. // This may be used to include null fields in Patch requests.
  15255. NullFields []string `json:"-"`
  15256. }
  15257. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  15258. type NoMethod InstancesSetServiceAccountRequest
  15259. raw := NoMethod(*s)
  15260. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15261. }
  15262. type InstancesStartWithEncryptionKeyRequest struct {
  15263. // Disks: Array of disks associated with this instance that are
  15264. // protected with a customer-supplied encryption key.
  15265. //
  15266. // In order to start the instance, the disk url and its corresponding
  15267. // key must be provided.
  15268. //
  15269. // If the disk is not protected with a customer-supplied encryption key
  15270. // it should not be specified.
  15271. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  15272. // InstanceEncryptionKey: Decrypts data associated with an instance that
  15273. // is protected with a customer-supplied encryption key.
  15274. //
  15275. // If the instance you are starting is protected with a
  15276. // customer-supplied encryption key, the correct key must be provided
  15277. // otherwise the instance start will not succeed.
  15278. InstanceEncryptionKey *CustomerEncryptionKey `json:"instanceEncryptionKey,omitempty"`
  15279. // ForceSendFields is a list of field names (e.g. "Disks") to
  15280. // unconditionally include in API requests. By default, fields with
  15281. // empty values are omitted from API requests. However, any non-pointer,
  15282. // non-interface field appearing in ForceSendFields will be sent to the
  15283. // server regardless of whether the field is empty or not. This may be
  15284. // used to include empty fields in Patch requests.
  15285. ForceSendFields []string `json:"-"`
  15286. // NullFields is a list of field names (e.g. "Disks") to include in API
  15287. // requests with the JSON null value. By default, fields with empty
  15288. // values are omitted from API requests. However, any field with an
  15289. // empty value appearing in NullFields will be sent to the server as
  15290. // null. It is an error if a field in this list has a non-empty value.
  15291. // This may be used to include null fields in Patch requests.
  15292. NullFields []string `json:"-"`
  15293. }
  15294. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  15295. type NoMethod InstancesStartWithEncryptionKeyRequest
  15296. raw := NoMethod(*s)
  15297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15298. }
  15299. // Int64RangeMatch: HttpRouteRuleMatch criteria for field values that
  15300. // must stay within the specified integer range.
  15301. type Int64RangeMatch struct {
  15302. // RangeEnd: The end of the range (exclusive) in signed long integer
  15303. // format.
  15304. RangeEnd int64 `json:"rangeEnd,omitempty,string"`
  15305. // RangeStart: The start of the range (inclusive) in signed long integer
  15306. // format.
  15307. RangeStart int64 `json:"rangeStart,omitempty,string"`
  15308. // ForceSendFields is a list of field names (e.g. "RangeEnd") to
  15309. // unconditionally include in API requests. By default, fields with
  15310. // empty values are omitted from API requests. However, any non-pointer,
  15311. // non-interface field appearing in ForceSendFields will be sent to the
  15312. // server regardless of whether the field is empty or not. This may be
  15313. // used to include empty fields in Patch requests.
  15314. ForceSendFields []string `json:"-"`
  15315. // NullFields is a list of field names (e.g. "RangeEnd") to include in
  15316. // API requests with the JSON null value. By default, fields with empty
  15317. // values are omitted from API requests. However, any field with an
  15318. // empty value appearing in NullFields will be sent to the server as
  15319. // null. It is an error if a field in this list has a non-empty value.
  15320. // This may be used to include null fields in Patch requests.
  15321. NullFields []string `json:"-"`
  15322. }
  15323. func (s *Int64RangeMatch) MarshalJSON() ([]byte, error) {
  15324. type NoMethod Int64RangeMatch
  15325. raw := NoMethod(*s)
  15326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15327. }
  15328. // Interconnect: Represents an Interconnects resource. The Interconnects
  15329. // resource is a dedicated connection between Google's network and your
  15330. // on-premises network. For more information, see the Dedicated
  15331. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  15332. // beta.interconnects ==)
  15333. type Interconnect struct {
  15334. // AdminEnabled: Administrative status of the interconnect. When this is
  15335. // set to true, the Interconnect is functional and can carry traffic.
  15336. // When set to false, no packets can be carried over the interconnect
  15337. // and no BGP routes are exchanged over it. By default, the status is
  15338. // set to true.
  15339. AdminEnabled bool `json:"adminEnabled,omitempty"`
  15340. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  15341. // describe the individual circuits in this LAG.
  15342. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  15343. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15344. // format.
  15345. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15346. // CustomerName: Customer name, to put in the Letter of Authorization as
  15347. // the party authorized to request a crossconnect.
  15348. CustomerName string `json:"customerName,omitempty"`
  15349. // Description: An optional description of this resource. Provide this
  15350. // property when you create the resource.
  15351. Description string `json:"description,omitempty"`
  15352. // ExpectedOutages: [Output Only] A list of outages expected for this
  15353. // Interconnect.
  15354. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  15355. // GoogleIpAddress: [Output Only] IP address configured on the Google
  15356. // side of the Interconnect link. This can be used only for ping tests.
  15357. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  15358. // GoogleReferenceId: [Output Only] Google reference ID to be used when
  15359. // raising support tickets with Google or otherwise to debug backend
  15360. // connectivity issues.
  15361. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  15362. // Id: [Output Only] The unique identifier for the resource. This
  15363. // identifier is defined by the server.
  15364. Id uint64 `json:"id,omitempty,string"`
  15365. // InterconnectAttachments: [Output Only] A list of the URLs of all
  15366. // InterconnectAttachments configured to use this Interconnect.
  15367. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  15368. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  15369. // been deprecated in favor of "DEDICATED"
  15370. //
  15371. // Possible values:
  15372. // "DEDICATED"
  15373. // "IT_PRIVATE"
  15374. // "PARTNER"
  15375. InterconnectType string `json:"interconnectType,omitempty"`
  15376. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  15377. // for interconnects.
  15378. Kind string `json:"kind,omitempty"`
  15379. // LabelFingerprint: A fingerprint for the labels being applied to this
  15380. // Interconnect, which is essentially a hash of the labels set used for
  15381. // optimistic locking. The fingerprint is initially generated by Compute
  15382. // Engine and changes after every request to modify or update labels.
  15383. // You must always provide an up-to-date fingerprint hash in order to
  15384. // update or change labels, otherwise the request will fail with error
  15385. // 412 conditionNotMet.
  15386. //
  15387. // To see the latest fingerprint, make a get() request to retrieve an
  15388. // Interconnect.
  15389. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  15390. // Labels: Labels to apply to this Interconnect resource. These can be
  15391. // later modified by the setLabels method. Each label key/value must
  15392. // comply with RFC1035. Label values may be empty.
  15393. Labels map[string]string `json:"labels,omitempty"`
  15394. // LinkType: Type of link requested. This field indicates speed of each
  15395. // of the links in the bundle, not the entire bundle.
  15396. //
  15397. // Possible values:
  15398. // "LINK_TYPE_ETHERNET_100G_LR"
  15399. // "LINK_TYPE_ETHERNET_10G_LR"
  15400. LinkType string `json:"linkType,omitempty"`
  15401. // Location: URL of the InterconnectLocation object that represents
  15402. // where this connection is to be provisioned.
  15403. Location string `json:"location,omitempty"`
  15404. // Name: Name of the resource. Provided by the client when the resource
  15405. // is created. The name must be 1-63 characters long, and comply with
  15406. // RFC1035. Specifically, the name must be 1-63 characters long and
  15407. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15408. // the first character must be a lowercase letter, and all following
  15409. // characters must be a dash, lowercase letter, or digit, except the
  15410. // last character, which cannot be a dash.
  15411. Name string `json:"name,omitempty"`
  15412. // NocContactEmail: Email address to contact the customer NOC for
  15413. // operations and maintenance notifications regarding this Interconnect.
  15414. // If specified, this will be used for notifications in addition to all
  15415. // other forms described, such as Stackdriver logs alerting and Cloud
  15416. // Notifications.
  15417. NocContactEmail string `json:"nocContactEmail,omitempty"`
  15418. // OperationalStatus: [Output Only] The current status of whether or not
  15419. // this Interconnect is functional.
  15420. //
  15421. // Possible values:
  15422. // "OS_ACTIVE"
  15423. // "OS_UNPROVISIONED"
  15424. OperationalStatus string `json:"operationalStatus,omitempty"`
  15425. // PeerIpAddress: [Output Only] IP address configured on the customer
  15426. // side of the Interconnect link. The customer should configure this IP
  15427. // address during turnup when prompted by Google NOC. This can be used
  15428. // only for ping tests.
  15429. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  15430. // ProvisionedLinkCount: [Output Only] Number of links actually
  15431. // provisioned in this interconnect.
  15432. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  15433. // RequestedLinkCount: Target number of physical links in the link
  15434. // bundle, as requested by the customer.
  15435. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  15436. // SelfLink: [Output Only] Server-defined URL for the resource.
  15437. SelfLink string `json:"selfLink,omitempty"`
  15438. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  15439. // with the resource id.
  15440. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  15441. // State: [Output Only] The current state of whether or not this
  15442. // Interconnect is functional.
  15443. //
  15444. // Possible values:
  15445. // "ACTIVE"
  15446. // "UNPROVISIONED"
  15447. State string `json:"state,omitempty"`
  15448. // ServerResponse contains the HTTP response code and headers from the
  15449. // server.
  15450. googleapi.ServerResponse `json:"-"`
  15451. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  15452. // unconditionally include in API requests. By default, fields with
  15453. // empty values are omitted from API requests. However, any non-pointer,
  15454. // non-interface field appearing in ForceSendFields will be sent to the
  15455. // server regardless of whether the field is empty or not. This may be
  15456. // used to include empty fields in Patch requests.
  15457. ForceSendFields []string `json:"-"`
  15458. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  15459. // in API requests with the JSON null value. By default, fields with
  15460. // empty values are omitted from API requests. However, any field with
  15461. // an empty value appearing in NullFields will be sent to the server as
  15462. // null. It is an error if a field in this list has a non-empty value.
  15463. // This may be used to include null fields in Patch requests.
  15464. NullFields []string `json:"-"`
  15465. }
  15466. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  15467. type NoMethod Interconnect
  15468. raw := NoMethod(*s)
  15469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15470. }
  15471. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  15472. // attachment) resource. For more information, see Creating VLAN
  15473. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  15474. // resource_for v1.interconnectAttachments ==)
  15475. type InterconnectAttachment struct {
  15476. // AdminEnabled: Determines whether this Attachment will carry packets.
  15477. // Not present for PARTNER_PROVIDER.
  15478. AdminEnabled bool `json:"adminEnabled,omitempty"`
  15479. // Bandwidth: Provisioned bandwidth capacity for the
  15480. // interconnectAttachment. Can be set by the partner to update the
  15481. // customer's provisioned bandwidth. Output only for PARTNER type,
  15482. // mutable for PARTNER_PROVIDER and DEDICATED.
  15483. //
  15484. // Possible values:
  15485. // "BPS_100M"
  15486. // "BPS_10G"
  15487. // "BPS_1G"
  15488. // "BPS_200M"
  15489. // "BPS_2G"
  15490. // "BPS_300M"
  15491. // "BPS_400M"
  15492. // "BPS_500M"
  15493. // "BPS_50M"
  15494. // "BPS_5G"
  15495. Bandwidth string `json:"bandwidth,omitempty"`
  15496. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  15497. // restrict the allocation of cloudRouterIpAddress and
  15498. // customerRouterIpAddress for this attachment. All prefixes must be
  15499. // within link-local address space (169.254.0.0/16) and must be /29 or
  15500. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  15501. // from the supplied candidate prefix(es). The request will fail if all
  15502. // possible /29s are in use on Google?s edge. If not supplied, Google
  15503. // will randomly select an unused /29 from all of link-local space.
  15504. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  15505. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  15506. // be configured on Cloud Router Interface for this interconnect
  15507. // attachment.
  15508. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  15509. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15510. // format.
  15511. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15512. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  15513. // to be configured on the customer router subinterface for this
  15514. // interconnect attachment.
  15515. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  15516. // Description: An optional description of this resource.
  15517. Description string `json:"description,omitempty"`
  15518. // EdgeAvailabilityDomain: Desired availability domain for the
  15519. // attachment. Only available for type PARTNER, at creation time. For
  15520. // improved reliability, customers should configure a pair of
  15521. // attachments with one per availability domain. The selected
  15522. // availability domain will be provided to the Partner via the pairing
  15523. // key so that the provisioned circuit will lie in the specified domain.
  15524. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  15525. //
  15526. // Possible values:
  15527. // "AVAILABILITY_DOMAIN_1"
  15528. // "AVAILABILITY_DOMAIN_2"
  15529. // "AVAILABILITY_DOMAIN_ANY"
  15530. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  15531. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  15532. // raising support tickets with Google or otherwise to debug backend
  15533. // connectivity issues.
  15534. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  15535. // Id: [Output Only] The unique identifier for the resource. This
  15536. // identifier is defined by the server.
  15537. Id uint64 `json:"id,omitempty,string"`
  15538. // Interconnect: URL of the underlying Interconnect object that this
  15539. // attachment's traffic will traverse through.
  15540. Interconnect string `json:"interconnect,omitempty"`
  15541. // Kind: [Output Only] Type of the resource. Always
  15542. // compute#interconnectAttachment for interconnect attachments.
  15543. Kind string `json:"kind,omitempty"`
  15544. // LabelFingerprint: A fingerprint for the labels being applied to this
  15545. // InterconnectAttachment, which is essentially a hash of the labels set
  15546. // used for optimistic locking. The fingerprint is initially generated
  15547. // by Compute Engine and changes after every request to modify or update
  15548. // labels. You must always provide an up-to-date fingerprint hash in
  15549. // order to update or change labels, otherwise the request will fail
  15550. // with error 412 conditionNotMet.
  15551. //
  15552. // To see the latest fingerprint, make a get() request to retrieve an
  15553. // InterconnectAttachment.
  15554. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  15555. // Labels: Labels to apply to this InterconnectAttachment resource.
  15556. // These can be later modified by the setLabels method. Each label
  15557. // key/value must comply with RFC1035. Label values may be empty.
  15558. Labels map[string]string `json:"labels,omitempty"`
  15559. // Name: Name of the resource. Provided by the client when the resource
  15560. // is created. The name must be 1-63 characters long, and comply with
  15561. // RFC1035. Specifically, the name must be 1-63 characters long and
  15562. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  15563. // the first character must be a lowercase letter, and all following
  15564. // characters must be a dash, lowercase letter, or digit, except the
  15565. // last character, which cannot be a dash.
  15566. Name string `json:"name,omitempty"`
  15567. // OperationalStatus: [Output Only] The current status of whether or not
  15568. // this interconnect attachment is functional.
  15569. //
  15570. // Possible values:
  15571. // "OS_ACTIVE"
  15572. // "OS_UNPROVISIONED"
  15573. OperationalStatus string `json:"operationalStatus,omitempty"`
  15574. // PairingKey: [Output only for type PARTNER. Input only for
  15575. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  15576. // of an PARTNER attachment used to initiate provisioning with a
  15577. // selected partner. Of the form "XXXXX/region/domain"
  15578. PairingKey string `json:"pairingKey,omitempty"`
  15579. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  15580. // by a layer 3 Partner if they configured BGP on behalf of the
  15581. // customer. Output only for PARTNER type, input only for
  15582. // PARTNER_PROVIDER, not available for DEDICATED.
  15583. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  15584. // PartnerMetadata: Informational metadata about Partner attachments
  15585. // from Partners to display to customers. Output only for for PARTNER
  15586. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  15587. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  15588. // PrivateInterconnectInfo: [Output Only] Information specific to an
  15589. // InterconnectAttachment. This property is populated if the
  15590. // interconnect that this is attached to is of type DEDICATED.
  15591. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  15592. // Region: [Output Only] URL of the region where the regional
  15593. // interconnect attachment resides. You must specify this field as part
  15594. // of the HTTP request URL. It is not settable as a field in the request
  15595. // body.
  15596. Region string `json:"region,omitempty"`
  15597. // Router: URL of the Cloud Router to be used for dynamic routing. This
  15598. // router must be in the same region as this InterconnectAttachment. The
  15599. // InterconnectAttachment will automatically connect the Interconnect to
  15600. // the network & region within which the Cloud Router is configured.
  15601. Router string `json:"router,omitempty"`
  15602. // SelfLink: [Output Only] Server-defined URL for the resource.
  15603. SelfLink string `json:"selfLink,omitempty"`
  15604. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  15605. // with the resource id.
  15606. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  15607. // State: [Output Only] The current state of this attachment's
  15608. // functionality.
  15609. //
  15610. // Possible values:
  15611. // "ACTIVE"
  15612. // "DEFUNCT"
  15613. // "PARTNER_REQUEST_RECEIVED"
  15614. // "PENDING_CUSTOMER"
  15615. // "PENDING_PARTNER"
  15616. // "STATE_UNSPECIFIED"
  15617. // "UNPROVISIONED"
  15618. State string `json:"state,omitempty"`
  15619. // Possible values:
  15620. // "DEDICATED"
  15621. // "PARTNER"
  15622. // "PARTNER_PROVIDER"
  15623. Type string `json:"type,omitempty"`
  15624. // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
  15625. // range 2-4094. Only specified at creation time.
  15626. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  15627. // ServerResponse contains the HTTP response code and headers from the
  15628. // server.
  15629. googleapi.ServerResponse `json:"-"`
  15630. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  15631. // unconditionally include in API requests. By default, fields with
  15632. // empty values are omitted from API requests. However, any non-pointer,
  15633. // non-interface field appearing in ForceSendFields will be sent to the
  15634. // server regardless of whether the field is empty or not. This may be
  15635. // used to include empty fields in Patch requests.
  15636. ForceSendFields []string `json:"-"`
  15637. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  15638. // in API requests with the JSON null value. By default, fields with
  15639. // empty values are omitted from API requests. However, any field with
  15640. // an empty value appearing in NullFields will be sent to the server as
  15641. // null. It is an error if a field in this list has a non-empty value.
  15642. // This may be used to include null fields in Patch requests.
  15643. NullFields []string `json:"-"`
  15644. }
  15645. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  15646. type NoMethod InterconnectAttachment
  15647. raw := NoMethod(*s)
  15648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15649. }
  15650. type InterconnectAttachmentAggregatedList struct {
  15651. // Id: [Output Only] Unique identifier for the resource; defined by the
  15652. // server.
  15653. Id string `json:"id,omitempty"`
  15654. // Items: A list of InterconnectAttachmentsScopedList resources.
  15655. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  15656. // Kind: [Output Only] Type of resource. Always
  15657. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  15658. // interconnect attachments.
  15659. Kind string `json:"kind,omitempty"`
  15660. // NextPageToken: [Output Only] This token allows you to get the next
  15661. // page of results for list requests. If the number of results is larger
  15662. // than maxResults, use the nextPageToken as a value for the query
  15663. // parameter pageToken in the next list request. Subsequent list
  15664. // requests will have their own nextPageToken to continue paging through
  15665. // the results.
  15666. NextPageToken string `json:"nextPageToken,omitempty"`
  15667. // SelfLink: [Output Only] Server-defined URL for this resource.
  15668. SelfLink string `json:"selfLink,omitempty"`
  15669. // Warning: [Output Only] Informational warning message.
  15670. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  15671. // ServerResponse contains the HTTP response code and headers from the
  15672. // server.
  15673. googleapi.ServerResponse `json:"-"`
  15674. // ForceSendFields is a list of field names (e.g. "Id") to
  15675. // unconditionally include in API requests. By default, fields with
  15676. // empty values are omitted from API requests. However, any non-pointer,
  15677. // non-interface field appearing in ForceSendFields will be sent to the
  15678. // server regardless of whether the field is empty or not. This may be
  15679. // used to include empty fields in Patch requests.
  15680. ForceSendFields []string `json:"-"`
  15681. // NullFields is a list of field names (e.g. "Id") to include in API
  15682. // requests with the JSON null value. By default, fields with empty
  15683. // values are omitted from API requests. However, any field with an
  15684. // empty value appearing in NullFields will be sent to the server as
  15685. // null. It is an error if a field in this list has a non-empty value.
  15686. // This may be used to include null fields in Patch requests.
  15687. NullFields []string `json:"-"`
  15688. }
  15689. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  15690. type NoMethod InterconnectAttachmentAggregatedList
  15691. raw := NoMethod(*s)
  15692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15693. }
  15694. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  15695. // Informational warning message.
  15696. type InterconnectAttachmentAggregatedListWarning struct {
  15697. // Code: [Output Only] A warning code, if applicable. For example,
  15698. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15699. // the response.
  15700. //
  15701. // Possible values:
  15702. // "CLEANUP_FAILED"
  15703. // "DEPRECATED_RESOURCE_USED"
  15704. // "DEPRECATED_TYPE_USED"
  15705. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15706. // "EXPERIMENTAL_TYPE_USED"
  15707. // "EXTERNAL_API_WARNING"
  15708. // "FIELD_VALUE_OVERRIDEN"
  15709. // "INJECTED_KERNELS_DEPRECATED"
  15710. // "MISSING_TYPE_DEPENDENCY"
  15711. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15712. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15713. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15714. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15715. // "NEXT_HOP_NOT_RUNNING"
  15716. // "NOT_CRITICAL_ERROR"
  15717. // "NO_RESULTS_ON_PAGE"
  15718. // "REQUIRED_TOS_AGREEMENT"
  15719. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15720. // "RESOURCE_NOT_DELETED"
  15721. // "SCHEMA_VALIDATION_IGNORED"
  15722. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15723. // "UNDECLARED_PROPERTIES"
  15724. // "UNREACHABLE"
  15725. Code string `json:"code,omitempty"`
  15726. // Data: [Output Only] Metadata about this warning in key: value format.
  15727. // For example:
  15728. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15729. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  15730. // Message: [Output Only] A human-readable description of the warning
  15731. // code.
  15732. Message string `json:"message,omitempty"`
  15733. // ForceSendFields is a list of field names (e.g. "Code") to
  15734. // unconditionally include in API requests. By default, fields with
  15735. // empty values are omitted from API requests. However, any non-pointer,
  15736. // non-interface field appearing in ForceSendFields will be sent to the
  15737. // server regardless of whether the field is empty or not. This may be
  15738. // used to include empty fields in Patch requests.
  15739. ForceSendFields []string `json:"-"`
  15740. // NullFields is a list of field names (e.g. "Code") to include in API
  15741. // requests with the JSON null value. By default, fields with empty
  15742. // values are omitted from API requests. However, any field with an
  15743. // empty value appearing in NullFields will be sent to the server as
  15744. // null. It is an error if a field in this list has a non-empty value.
  15745. // This may be used to include null fields in Patch requests.
  15746. NullFields []string `json:"-"`
  15747. }
  15748. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15749. type NoMethod InterconnectAttachmentAggregatedListWarning
  15750. raw := NoMethod(*s)
  15751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15752. }
  15753. type InterconnectAttachmentAggregatedListWarningData struct {
  15754. // Key: [Output Only] A key that provides more detail on the warning
  15755. // being returned. For example, for warnings where there are no results
  15756. // in a list request for a particular zone, this key might be scope and
  15757. // the key value might be the zone name. Other examples might be a key
  15758. // indicating a deprecated resource and a suggested replacement, or a
  15759. // warning about invalid network settings (for example, if an instance
  15760. // attempts to perform IP forwarding but is not enabled for IP
  15761. // forwarding).
  15762. Key string `json:"key,omitempty"`
  15763. // Value: [Output Only] A warning data value corresponding to the key.
  15764. Value string `json:"value,omitempty"`
  15765. // ForceSendFields is a list of field names (e.g. "Key") to
  15766. // unconditionally include in API requests. By default, fields with
  15767. // empty values are omitted from API requests. However, any non-pointer,
  15768. // non-interface field appearing in ForceSendFields will be sent to the
  15769. // server regardless of whether the field is empty or not. This may be
  15770. // used to include empty fields in Patch requests.
  15771. ForceSendFields []string `json:"-"`
  15772. // NullFields is a list of field names (e.g. "Key") to include in API
  15773. // requests with the JSON null value. By default, fields with empty
  15774. // values are omitted from API requests. However, any field with an
  15775. // empty value appearing in NullFields will be sent to the server as
  15776. // null. It is an error if a field in this list has a non-empty value.
  15777. // This may be used to include null fields in Patch requests.
  15778. NullFields []string `json:"-"`
  15779. }
  15780. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15781. type NoMethod InterconnectAttachmentAggregatedListWarningData
  15782. raw := NoMethod(*s)
  15783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15784. }
  15785. // InterconnectAttachmentList: Response to the list request, and
  15786. // contains a list of interconnect attachments.
  15787. type InterconnectAttachmentList struct {
  15788. // Id: [Output Only] Unique identifier for the resource; defined by the
  15789. // server.
  15790. Id string `json:"id,omitempty"`
  15791. // Items: A list of InterconnectAttachment resources.
  15792. Items []*InterconnectAttachment `json:"items,omitempty"`
  15793. // Kind: [Output Only] Type of resource. Always
  15794. // compute#interconnectAttachmentList for lists of interconnect
  15795. // attachments.
  15796. Kind string `json:"kind,omitempty"`
  15797. // NextPageToken: [Output Only] This token allows you to get the next
  15798. // page of results for list requests. If the number of results is larger
  15799. // than maxResults, use the nextPageToken as a value for the query
  15800. // parameter pageToken in the next list request. Subsequent list
  15801. // requests will have their own nextPageToken to continue paging through
  15802. // the results.
  15803. NextPageToken string `json:"nextPageToken,omitempty"`
  15804. // SelfLink: [Output Only] Server-defined URL for this resource.
  15805. SelfLink string `json:"selfLink,omitempty"`
  15806. // Warning: [Output Only] Informational warning message.
  15807. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  15808. // ServerResponse contains the HTTP response code and headers from the
  15809. // server.
  15810. googleapi.ServerResponse `json:"-"`
  15811. // ForceSendFields is a list of field names (e.g. "Id") to
  15812. // unconditionally include in API requests. By default, fields with
  15813. // empty values are omitted from API requests. However, any non-pointer,
  15814. // non-interface field appearing in ForceSendFields will be sent to the
  15815. // server regardless of whether the field is empty or not. This may be
  15816. // used to include empty fields in Patch requests.
  15817. ForceSendFields []string `json:"-"`
  15818. // NullFields is a list of field names (e.g. "Id") to include in API
  15819. // requests with the JSON null value. By default, fields with empty
  15820. // values are omitted from API requests. However, any field with an
  15821. // empty value appearing in NullFields will be sent to the server as
  15822. // null. It is an error if a field in this list has a non-empty value.
  15823. // This may be used to include null fields in Patch requests.
  15824. NullFields []string `json:"-"`
  15825. }
  15826. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  15827. type NoMethod InterconnectAttachmentList
  15828. raw := NoMethod(*s)
  15829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15830. }
  15831. // InterconnectAttachmentListWarning: [Output Only] Informational
  15832. // warning message.
  15833. type InterconnectAttachmentListWarning struct {
  15834. // Code: [Output Only] A warning code, if applicable. For example,
  15835. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15836. // the response.
  15837. //
  15838. // Possible values:
  15839. // "CLEANUP_FAILED"
  15840. // "DEPRECATED_RESOURCE_USED"
  15841. // "DEPRECATED_TYPE_USED"
  15842. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15843. // "EXPERIMENTAL_TYPE_USED"
  15844. // "EXTERNAL_API_WARNING"
  15845. // "FIELD_VALUE_OVERRIDEN"
  15846. // "INJECTED_KERNELS_DEPRECATED"
  15847. // "MISSING_TYPE_DEPENDENCY"
  15848. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15849. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15850. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15851. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15852. // "NEXT_HOP_NOT_RUNNING"
  15853. // "NOT_CRITICAL_ERROR"
  15854. // "NO_RESULTS_ON_PAGE"
  15855. // "REQUIRED_TOS_AGREEMENT"
  15856. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15857. // "RESOURCE_NOT_DELETED"
  15858. // "SCHEMA_VALIDATION_IGNORED"
  15859. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15860. // "UNDECLARED_PROPERTIES"
  15861. // "UNREACHABLE"
  15862. Code string `json:"code,omitempty"`
  15863. // Data: [Output Only] Metadata about this warning in key: value format.
  15864. // For example:
  15865. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15866. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  15867. // Message: [Output Only] A human-readable description of the warning
  15868. // code.
  15869. Message string `json:"message,omitempty"`
  15870. // ForceSendFields is a list of field names (e.g. "Code") to
  15871. // unconditionally include in API requests. By default, fields with
  15872. // empty values are omitted from API requests. However, any non-pointer,
  15873. // non-interface field appearing in ForceSendFields will be sent to the
  15874. // server regardless of whether the field is empty or not. This may be
  15875. // used to include empty fields in Patch requests.
  15876. ForceSendFields []string `json:"-"`
  15877. // NullFields is a list of field names (e.g. "Code") to include in API
  15878. // requests with the JSON null value. By default, fields with empty
  15879. // values are omitted from API requests. However, any field with an
  15880. // empty value appearing in NullFields will be sent to the server as
  15881. // null. It is an error if a field in this list has a non-empty value.
  15882. // This may be used to include null fields in Patch requests.
  15883. NullFields []string `json:"-"`
  15884. }
  15885. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  15886. type NoMethod InterconnectAttachmentListWarning
  15887. raw := NoMethod(*s)
  15888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15889. }
  15890. type InterconnectAttachmentListWarningData struct {
  15891. // Key: [Output Only] A key that provides more detail on the warning
  15892. // being returned. For example, for warnings where there are no results
  15893. // in a list request for a particular zone, this key might be scope and
  15894. // the key value might be the zone name. Other examples might be a key
  15895. // indicating a deprecated resource and a suggested replacement, or a
  15896. // warning about invalid network settings (for example, if an instance
  15897. // attempts to perform IP forwarding but is not enabled for IP
  15898. // forwarding).
  15899. Key string `json:"key,omitempty"`
  15900. // Value: [Output Only] A warning data value corresponding to the key.
  15901. Value string `json:"value,omitempty"`
  15902. // ForceSendFields is a list of field names (e.g. "Key") to
  15903. // unconditionally include in API requests. By default, fields with
  15904. // empty values are omitted from API requests. However, any non-pointer,
  15905. // non-interface field appearing in ForceSendFields will be sent to the
  15906. // server regardless of whether the field is empty or not. This may be
  15907. // used to include empty fields in Patch requests.
  15908. ForceSendFields []string `json:"-"`
  15909. // NullFields is a list of field names (e.g. "Key") to include in API
  15910. // requests with the JSON null value. By default, fields with empty
  15911. // values are omitted from API requests. However, any field with an
  15912. // empty value appearing in NullFields will be sent to the server as
  15913. // null. It is an error if a field in this list has a non-empty value.
  15914. // This may be used to include null fields in Patch requests.
  15915. NullFields []string `json:"-"`
  15916. }
  15917. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  15918. type NoMethod InterconnectAttachmentListWarningData
  15919. raw := NoMethod(*s)
  15920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15921. }
  15922. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  15923. // Partner attachments from Partners to display to customers. These
  15924. // fields are propagated from PARTNER_PROVIDER attachments to their
  15925. // corresponding PARTNER attachments.
  15926. type InterconnectAttachmentPartnerMetadata struct {
  15927. // InterconnectName: Plain text name of the Interconnect this attachment
  15928. // is connected to, as displayed in the Partner?s portal. For instance
  15929. // "Chicago 1". This value may be validated to match approved Partner
  15930. // values.
  15931. InterconnectName string `json:"interconnectName,omitempty"`
  15932. // PartnerName: Plain text name of the Partner providing this
  15933. // attachment. This value may be validated to match approved Partner
  15934. // values.
  15935. PartnerName string `json:"partnerName,omitempty"`
  15936. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  15937. // may customise this to be a deep-link to the specific resource on the
  15938. // Partner portal. This value may be validated to match approved Partner
  15939. // values.
  15940. PortalUrl string `json:"portalUrl,omitempty"`
  15941. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  15942. // unconditionally include in API requests. By default, fields with
  15943. // empty values are omitted from API requests. However, any non-pointer,
  15944. // non-interface field appearing in ForceSendFields will be sent to the
  15945. // server regardless of whether the field is empty or not. This may be
  15946. // used to include empty fields in Patch requests.
  15947. ForceSendFields []string `json:"-"`
  15948. // NullFields is a list of field names (e.g. "InterconnectName") to
  15949. // include in API requests with the JSON null value. By default, fields
  15950. // with empty values are omitted from API requests. However, any field
  15951. // with an empty value appearing in NullFields will be sent to the
  15952. // server as null. It is an error if a field in this list has a
  15953. // non-empty value. This may be used to include null fields in Patch
  15954. // requests.
  15955. NullFields []string `json:"-"`
  15956. }
  15957. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  15958. type NoMethod InterconnectAttachmentPartnerMetadata
  15959. raw := NoMethod(*s)
  15960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15961. }
  15962. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  15963. // attachment when this belongs to an interconnect of type DEDICATED.
  15964. type InterconnectAttachmentPrivateInfo struct {
  15965. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  15966. // traffic between Google and the customer, going to and from this
  15967. // network and region.
  15968. Tag8021q int64 `json:"tag8021q,omitempty"`
  15969. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  15970. // unconditionally include in API requests. By default, fields with
  15971. // empty values are omitted from API requests. However, any non-pointer,
  15972. // non-interface field appearing in ForceSendFields will be sent to the
  15973. // server regardless of whether the field is empty or not. This may be
  15974. // used to include empty fields in Patch requests.
  15975. ForceSendFields []string `json:"-"`
  15976. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  15977. // API requests with the JSON null value. By default, fields with empty
  15978. // values are omitted from API requests. However, any field with an
  15979. // empty value appearing in NullFields will be sent to the server as
  15980. // null. It is an error if a field in this list has a non-empty value.
  15981. // This may be used to include null fields in Patch requests.
  15982. NullFields []string `json:"-"`
  15983. }
  15984. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  15985. type NoMethod InterconnectAttachmentPrivateInfo
  15986. raw := NoMethod(*s)
  15987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15988. }
  15989. type InterconnectAttachmentsScopedList struct {
  15990. // InterconnectAttachments: A list of interconnect attachments contained
  15991. // in this scope.
  15992. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  15993. // Warning: Informational warning which replaces the list of addresses
  15994. // when the list is empty.
  15995. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  15996. // ForceSendFields is a list of field names (e.g.
  15997. // "InterconnectAttachments") to unconditionally include in API
  15998. // requests. By default, fields with empty values are omitted from API
  15999. // requests. However, any non-pointer, non-interface field appearing in
  16000. // ForceSendFields will be sent to the server regardless of whether the
  16001. // field is empty or not. This may be used to include empty fields in
  16002. // Patch requests.
  16003. ForceSendFields []string `json:"-"`
  16004. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  16005. // to include in API requests with the JSON null value. By default,
  16006. // fields with empty values are omitted from API requests. However, any
  16007. // field with an empty value appearing in NullFields will be sent to the
  16008. // server as null. It is an error if a field in this list has a
  16009. // non-empty value. This may be used to include null fields in Patch
  16010. // requests.
  16011. NullFields []string `json:"-"`
  16012. }
  16013. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  16014. type NoMethod InterconnectAttachmentsScopedList
  16015. raw := NoMethod(*s)
  16016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16017. }
  16018. // InterconnectAttachmentsScopedListWarning: Informational warning which
  16019. // replaces the list of addresses when the list is empty.
  16020. type InterconnectAttachmentsScopedListWarning struct {
  16021. // Code: [Output Only] A warning code, if applicable. For example,
  16022. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16023. // the response.
  16024. //
  16025. // Possible values:
  16026. // "CLEANUP_FAILED"
  16027. // "DEPRECATED_RESOURCE_USED"
  16028. // "DEPRECATED_TYPE_USED"
  16029. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16030. // "EXPERIMENTAL_TYPE_USED"
  16031. // "EXTERNAL_API_WARNING"
  16032. // "FIELD_VALUE_OVERRIDEN"
  16033. // "INJECTED_KERNELS_DEPRECATED"
  16034. // "MISSING_TYPE_DEPENDENCY"
  16035. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16036. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16037. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16038. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16039. // "NEXT_HOP_NOT_RUNNING"
  16040. // "NOT_CRITICAL_ERROR"
  16041. // "NO_RESULTS_ON_PAGE"
  16042. // "REQUIRED_TOS_AGREEMENT"
  16043. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16044. // "RESOURCE_NOT_DELETED"
  16045. // "SCHEMA_VALIDATION_IGNORED"
  16046. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16047. // "UNDECLARED_PROPERTIES"
  16048. // "UNREACHABLE"
  16049. Code string `json:"code,omitempty"`
  16050. // Data: [Output Only] Metadata about this warning in key: value format.
  16051. // For example:
  16052. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16053. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  16054. // Message: [Output Only] A human-readable description of the warning
  16055. // code.
  16056. Message string `json:"message,omitempty"`
  16057. // ForceSendFields is a list of field names (e.g. "Code") to
  16058. // unconditionally include in API requests. By default, fields with
  16059. // empty values are omitted from API requests. However, any non-pointer,
  16060. // non-interface field appearing in ForceSendFields will be sent to the
  16061. // server regardless of whether the field is empty or not. This may be
  16062. // used to include empty fields in Patch requests.
  16063. ForceSendFields []string `json:"-"`
  16064. // NullFields is a list of field names (e.g. "Code") to include in API
  16065. // requests with the JSON null value. By default, fields with empty
  16066. // values are omitted from API requests. However, any field with an
  16067. // empty value appearing in NullFields will be sent to the server as
  16068. // null. It is an error if a field in this list has a non-empty value.
  16069. // This may be used to include null fields in Patch requests.
  16070. NullFields []string `json:"-"`
  16071. }
  16072. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  16073. type NoMethod InterconnectAttachmentsScopedListWarning
  16074. raw := NoMethod(*s)
  16075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16076. }
  16077. type InterconnectAttachmentsScopedListWarningData struct {
  16078. // Key: [Output Only] A key that provides more detail on the warning
  16079. // being returned. For example, for warnings where there are no results
  16080. // in a list request for a particular zone, this key might be scope and
  16081. // the key value might be the zone name. Other examples might be a key
  16082. // indicating a deprecated resource and a suggested replacement, or a
  16083. // warning about invalid network settings (for example, if an instance
  16084. // attempts to perform IP forwarding but is not enabled for IP
  16085. // forwarding).
  16086. Key string `json:"key,omitempty"`
  16087. // Value: [Output Only] A warning data value corresponding to the key.
  16088. Value string `json:"value,omitempty"`
  16089. // ForceSendFields is a list of field names (e.g. "Key") to
  16090. // unconditionally include in API requests. By default, fields with
  16091. // empty values are omitted from API requests. However, any non-pointer,
  16092. // non-interface field appearing in ForceSendFields will be sent to the
  16093. // server regardless of whether the field is empty or not. This may be
  16094. // used to include empty fields in Patch requests.
  16095. ForceSendFields []string `json:"-"`
  16096. // NullFields is a list of field names (e.g. "Key") to include in API
  16097. // requests with the JSON null value. By default, fields with empty
  16098. // values are omitted from API requests. However, any field with an
  16099. // empty value appearing in NullFields will be sent to the server as
  16100. // null. It is an error if a field in this list has a non-empty value.
  16101. // This may be used to include null fields in Patch requests.
  16102. NullFields []string `json:"-"`
  16103. }
  16104. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  16105. type NoMethod InterconnectAttachmentsScopedListWarningData
  16106. raw := NoMethod(*s)
  16107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16108. }
  16109. // InterconnectCircuitInfo: Describes a single physical circuit between
  16110. // the Customer and Google. CircuitInfo objects are created by Google,
  16111. // so all fields are output only. Next id: 4
  16112. type InterconnectCircuitInfo struct {
  16113. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  16114. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  16115. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  16116. // at circuit turn-up.
  16117. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  16118. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  16119. // circuit turn-up and provided by Google to the customer in the LOA.
  16120. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  16121. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  16122. // unconditionally include in API requests. By default, fields with
  16123. // empty values are omitted from API requests. However, any non-pointer,
  16124. // non-interface field appearing in ForceSendFields will be sent to the
  16125. // server regardless of whether the field is empty or not. This may be
  16126. // used to include empty fields in Patch requests.
  16127. ForceSendFields []string `json:"-"`
  16128. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  16129. // include in API requests with the JSON null value. By default, fields
  16130. // with empty values are omitted from API requests. However, any field
  16131. // with an empty value appearing in NullFields will be sent to the
  16132. // server as null. It is an error if a field in this list has a
  16133. // non-empty value. This may be used to include null fields in Patch
  16134. // requests.
  16135. NullFields []string `json:"-"`
  16136. }
  16137. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  16138. type NoMethod InterconnectCircuitInfo
  16139. raw := NoMethod(*s)
  16140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16141. }
  16142. // InterconnectDiagnostics: Diagnostics information about interconnect,
  16143. // contains detailed and current technical information about Google?s
  16144. // side of the connection.
  16145. type InterconnectDiagnostics struct {
  16146. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  16147. // describing individual neighbors currently seen by the Google router
  16148. // in the ARP cache for the Interconnect. This will be empty when the
  16149. // Interconnect is not bundled.
  16150. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  16151. // Links: A list of InterconnectDiagnostics.LinkStatus objects,
  16152. // describing the status for each link on the Interconnect.
  16153. Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
  16154. // MacAddress: The MAC address of the Interconnect's bundle interface.
  16155. MacAddress string `json:"macAddress,omitempty"`
  16156. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  16157. // unconditionally include in API requests. By default, fields with
  16158. // empty values are omitted from API requests. However, any non-pointer,
  16159. // non-interface field appearing in ForceSendFields will be sent to the
  16160. // server regardless of whether the field is empty or not. This may be
  16161. // used to include empty fields in Patch requests.
  16162. ForceSendFields []string `json:"-"`
  16163. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  16164. // API requests with the JSON null value. By default, fields with empty
  16165. // values are omitted from API requests. However, any field with an
  16166. // empty value appearing in NullFields will be sent to the server as
  16167. // null. It is an error if a field in this list has a non-empty value.
  16168. // This may be used to include null fields in Patch requests.
  16169. NullFields []string `json:"-"`
  16170. }
  16171. func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
  16172. type NoMethod InterconnectDiagnostics
  16173. raw := NoMethod(*s)
  16174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16175. }
  16176. // InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
  16177. // seen on this link
  16178. type InterconnectDiagnosticsARPEntry struct {
  16179. // IpAddress: The IP address of this ARP neighbor.
  16180. IpAddress string `json:"ipAddress,omitempty"`
  16181. // MacAddress: The MAC address of this ARP neighbor.
  16182. MacAddress string `json:"macAddress,omitempty"`
  16183. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  16184. // unconditionally include in API requests. By default, fields with
  16185. // empty values are omitted from API requests. However, any non-pointer,
  16186. // non-interface field appearing in ForceSendFields will be sent to the
  16187. // server regardless of whether the field is empty or not. This may be
  16188. // used to include empty fields in Patch requests.
  16189. ForceSendFields []string `json:"-"`
  16190. // NullFields is a list of field names (e.g. "IpAddress") to include in
  16191. // API requests with the JSON null value. By default, fields with empty
  16192. // values are omitted from API requests. However, any field with an
  16193. // empty value appearing in NullFields will be sent to the server as
  16194. // null. It is an error if a field in this list has a non-empty value.
  16195. // This may be used to include null fields in Patch requests.
  16196. NullFields []string `json:"-"`
  16197. }
  16198. func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
  16199. type NoMethod InterconnectDiagnosticsARPEntry
  16200. raw := NoMethod(*s)
  16201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16202. }
  16203. type InterconnectDiagnosticsLinkLACPStatus struct {
  16204. // GoogleSystemId: System ID of the port on Google?s side of the LACP
  16205. // exchange.
  16206. GoogleSystemId string `json:"googleSystemId,omitempty"`
  16207. // NeighborSystemId: System ID of the port on the neighbor?s side of the
  16208. // LACP exchange.
  16209. NeighborSystemId string `json:"neighborSystemId,omitempty"`
  16210. // Possible values:
  16211. // "ACTIVE"
  16212. // "DETACHED"
  16213. State string `json:"state,omitempty"`
  16214. // ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
  16215. // unconditionally include in API requests. By default, fields with
  16216. // empty values are omitted from API requests. However, any non-pointer,
  16217. // non-interface field appearing in ForceSendFields will be sent to the
  16218. // server regardless of whether the field is empty or not. This may be
  16219. // used to include empty fields in Patch requests.
  16220. ForceSendFields []string `json:"-"`
  16221. // NullFields is a list of field names (e.g. "GoogleSystemId") to
  16222. // include in API requests with the JSON null value. By default, fields
  16223. // with empty values are omitted from API requests. However, any field
  16224. // with an empty value appearing in NullFields will be sent to the
  16225. // server as null. It is an error if a field in this list has a
  16226. // non-empty value. This may be used to include null fields in Patch
  16227. // requests.
  16228. NullFields []string `json:"-"`
  16229. }
  16230. func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
  16231. type NoMethod InterconnectDiagnosticsLinkLACPStatus
  16232. raw := NoMethod(*s)
  16233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16234. }
  16235. type InterconnectDiagnosticsLinkOpticalPower struct {
  16236. // State: The status of the current value when compared to the warning
  16237. // and alarm levels for the receiving or transmitting transceiver.
  16238. // Possible states include:
  16239. // - OK: The value has not crossed a warning threshold.
  16240. // - LOW_WARNING: The value has crossed below the low warning threshold.
  16241. //
  16242. // - HIGH_WARNING: The value has crossed above the high warning
  16243. // threshold.
  16244. // - LOW_ALARM: The value has crossed below the low alarm threshold.
  16245. // - HIGH_ALARM: The value has crossed above the high alarm threshold.
  16246. //
  16247. // Possible values:
  16248. // "HIGH_ALARM"
  16249. // "HIGH_WARNING"
  16250. // "LOW_ALARM"
  16251. // "LOW_WARNING"
  16252. // "OK"
  16253. State string `json:"state,omitempty"`
  16254. // Value: Value of the current receiving or transmitting optical power,
  16255. // read in dBm. Take a known good optical value, give it a 10% margin
  16256. // and trigger warnings relative to that value. In general, a -7dBm
  16257. // warning and a -11dBm alarm are good optical value estimates for most
  16258. // links.
  16259. Value float64 `json:"value,omitempty"`
  16260. // ForceSendFields is a list of field names (e.g. "State") to
  16261. // unconditionally include in API requests. By default, fields with
  16262. // empty values are omitted from API requests. However, any non-pointer,
  16263. // non-interface field appearing in ForceSendFields will be sent to the
  16264. // server regardless of whether the field is empty or not. This may be
  16265. // used to include empty fields in Patch requests.
  16266. ForceSendFields []string `json:"-"`
  16267. // NullFields is a list of field names (e.g. "State") to include in API
  16268. // requests with the JSON null value. By default, fields with empty
  16269. // values are omitted from API requests. However, any field with an
  16270. // empty value appearing in NullFields will be sent to the server as
  16271. // null. It is an error if a field in this list has a non-empty value.
  16272. // This may be used to include null fields in Patch requests.
  16273. NullFields []string `json:"-"`
  16274. }
  16275. func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
  16276. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  16277. raw := NoMethod(*s)
  16278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16279. }
  16280. func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
  16281. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  16282. var s1 struct {
  16283. Value gensupport.JSONFloat64 `json:"value"`
  16284. *NoMethod
  16285. }
  16286. s1.NoMethod = (*NoMethod)(s)
  16287. if err := json.Unmarshal(data, &s1); err != nil {
  16288. return err
  16289. }
  16290. s.Value = float64(s1.Value)
  16291. return nil
  16292. }
  16293. type InterconnectDiagnosticsLinkStatus struct {
  16294. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  16295. // describing the ARP neighbor entries seen on this link. This will be
  16296. // empty if the link is bundled
  16297. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  16298. // CircuitId: The unique ID for this link assigned during turn up by
  16299. // Google.
  16300. CircuitId string `json:"circuitId,omitempty"`
  16301. // GoogleDemarc: The Demarc address assigned by Google and provided in
  16302. // the LoA.
  16303. GoogleDemarc string `json:"googleDemarc,omitempty"`
  16304. LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
  16305. // ReceivingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  16306. // object, describing the current value and status of the received light
  16307. // level.
  16308. ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
  16309. // TransmittingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  16310. // object, describing the current value and status of the transmitted
  16311. // light level.
  16312. TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
  16313. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  16314. // unconditionally include in API requests. By default, fields with
  16315. // empty values are omitted from API requests. However, any non-pointer,
  16316. // non-interface field appearing in ForceSendFields will be sent to the
  16317. // server regardless of whether the field is empty or not. This may be
  16318. // used to include empty fields in Patch requests.
  16319. ForceSendFields []string `json:"-"`
  16320. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  16321. // API requests with the JSON null value. By default, fields with empty
  16322. // values are omitted from API requests. However, any field with an
  16323. // empty value appearing in NullFields will be sent to the server as
  16324. // null. It is an error if a field in this list has a non-empty value.
  16325. // This may be used to include null fields in Patch requests.
  16326. NullFields []string `json:"-"`
  16327. }
  16328. func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
  16329. type NoMethod InterconnectDiagnosticsLinkStatus
  16330. raw := NoMethod(*s)
  16331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16332. }
  16333. // InterconnectList: Response to the list request, and contains a list
  16334. // of interconnects.
  16335. type InterconnectList struct {
  16336. // Id: [Output Only] Unique identifier for the resource; defined by the
  16337. // server.
  16338. Id string `json:"id,omitempty"`
  16339. // Items: A list of Interconnect resources.
  16340. Items []*Interconnect `json:"items,omitempty"`
  16341. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  16342. // for lists of interconnects.
  16343. Kind string `json:"kind,omitempty"`
  16344. // NextPageToken: [Output Only] This token allows you to get the next
  16345. // page of results for list requests. If the number of results is larger
  16346. // than maxResults, use the nextPageToken as a value for the query
  16347. // parameter pageToken in the next list request. Subsequent list
  16348. // requests will have their own nextPageToken to continue paging through
  16349. // the results.
  16350. NextPageToken string `json:"nextPageToken,omitempty"`
  16351. // SelfLink: [Output Only] Server-defined URL for this resource.
  16352. SelfLink string `json:"selfLink,omitempty"`
  16353. // Warning: [Output Only] Informational warning message.
  16354. Warning *InterconnectListWarning `json:"warning,omitempty"`
  16355. // ServerResponse contains the HTTP response code and headers from the
  16356. // server.
  16357. googleapi.ServerResponse `json:"-"`
  16358. // ForceSendFields is a list of field names (e.g. "Id") to
  16359. // unconditionally include in API requests. By default, fields with
  16360. // empty values are omitted from API requests. However, any non-pointer,
  16361. // non-interface field appearing in ForceSendFields will be sent to the
  16362. // server regardless of whether the field is empty or not. This may be
  16363. // used to include empty fields in Patch requests.
  16364. ForceSendFields []string `json:"-"`
  16365. // NullFields is a list of field names (e.g. "Id") to include in API
  16366. // requests with the JSON null value. By default, fields with empty
  16367. // values are omitted from API requests. However, any field with an
  16368. // empty value appearing in NullFields will be sent to the server as
  16369. // null. It is an error if a field in this list has a non-empty value.
  16370. // This may be used to include null fields in Patch requests.
  16371. NullFields []string `json:"-"`
  16372. }
  16373. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  16374. type NoMethod InterconnectList
  16375. raw := NoMethod(*s)
  16376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16377. }
  16378. // InterconnectListWarning: [Output Only] Informational warning message.
  16379. type InterconnectListWarning struct {
  16380. // Code: [Output Only] A warning code, if applicable. For example,
  16381. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16382. // the response.
  16383. //
  16384. // Possible values:
  16385. // "CLEANUP_FAILED"
  16386. // "DEPRECATED_RESOURCE_USED"
  16387. // "DEPRECATED_TYPE_USED"
  16388. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16389. // "EXPERIMENTAL_TYPE_USED"
  16390. // "EXTERNAL_API_WARNING"
  16391. // "FIELD_VALUE_OVERRIDEN"
  16392. // "INJECTED_KERNELS_DEPRECATED"
  16393. // "MISSING_TYPE_DEPENDENCY"
  16394. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16395. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16396. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16397. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16398. // "NEXT_HOP_NOT_RUNNING"
  16399. // "NOT_CRITICAL_ERROR"
  16400. // "NO_RESULTS_ON_PAGE"
  16401. // "REQUIRED_TOS_AGREEMENT"
  16402. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16403. // "RESOURCE_NOT_DELETED"
  16404. // "SCHEMA_VALIDATION_IGNORED"
  16405. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16406. // "UNDECLARED_PROPERTIES"
  16407. // "UNREACHABLE"
  16408. Code string `json:"code,omitempty"`
  16409. // Data: [Output Only] Metadata about this warning in key: value format.
  16410. // For example:
  16411. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16412. Data []*InterconnectListWarningData `json:"data,omitempty"`
  16413. // Message: [Output Only] A human-readable description of the warning
  16414. // code.
  16415. Message string `json:"message,omitempty"`
  16416. // ForceSendFields is a list of field names (e.g. "Code") to
  16417. // unconditionally include in API requests. By default, fields with
  16418. // empty values are omitted from API requests. However, any non-pointer,
  16419. // non-interface field appearing in ForceSendFields will be sent to the
  16420. // server regardless of whether the field is empty or not. This may be
  16421. // used to include empty fields in Patch requests.
  16422. ForceSendFields []string `json:"-"`
  16423. // NullFields is a list of field names (e.g. "Code") to include in API
  16424. // requests with the JSON null value. By default, fields with empty
  16425. // values are omitted from API requests. However, any field with an
  16426. // empty value appearing in NullFields will be sent to the server as
  16427. // null. It is an error if a field in this list has a non-empty value.
  16428. // This may be used to include null fields in Patch requests.
  16429. NullFields []string `json:"-"`
  16430. }
  16431. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  16432. type NoMethod InterconnectListWarning
  16433. raw := NoMethod(*s)
  16434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16435. }
  16436. type InterconnectListWarningData struct {
  16437. // Key: [Output Only] A key that provides more detail on the warning
  16438. // being returned. For example, for warnings where there are no results
  16439. // in a list request for a particular zone, this key might be scope and
  16440. // the key value might be the zone name. Other examples might be a key
  16441. // indicating a deprecated resource and a suggested replacement, or a
  16442. // warning about invalid network settings (for example, if an instance
  16443. // attempts to perform IP forwarding but is not enabled for IP
  16444. // forwarding).
  16445. Key string `json:"key,omitempty"`
  16446. // Value: [Output Only] A warning data value corresponding to the key.
  16447. Value string `json:"value,omitempty"`
  16448. // ForceSendFields is a list of field names (e.g. "Key") to
  16449. // unconditionally include in API requests. By default, fields with
  16450. // empty values are omitted from API requests. However, any non-pointer,
  16451. // non-interface field appearing in ForceSendFields will be sent to the
  16452. // server regardless of whether the field is empty or not. This may be
  16453. // used to include empty fields in Patch requests.
  16454. ForceSendFields []string `json:"-"`
  16455. // NullFields is a list of field names (e.g. "Key") to include in API
  16456. // requests with the JSON null value. By default, fields with empty
  16457. // values are omitted from API requests. However, any field with an
  16458. // empty value appearing in NullFields will be sent to the server as
  16459. // null. It is an error if a field in this list has a non-empty value.
  16460. // This may be used to include null fields in Patch requests.
  16461. NullFields []string `json:"-"`
  16462. }
  16463. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  16464. type NoMethod InterconnectListWarningData
  16465. raw := NoMethod(*s)
  16466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16467. }
  16468. // InterconnectLocation: Represents an InterconnectLocations resource.
  16469. // The InterconnectLocations resource describes the locations where you
  16470. // can connect to Google's networks. For more information, see
  16471. // Colocation Facilities.
  16472. type InterconnectLocation struct {
  16473. // Address: [Output Only] The postal address of the Point of Presence,
  16474. // each line in the address is separated by a newline character.
  16475. Address string `json:"address,omitempty"`
  16476. // AvailabilityZone: [Output Only] Availability zone for this
  16477. // InterconnectLocation. Within a metropolitan area (metro), maintenance
  16478. // will not be simultaneously scheduled in more than one availability
  16479. // zone. Example: "zone1" or "zone2".
  16480. AvailabilityZone string `json:"availabilityZone,omitempty"`
  16481. // City: [Output Only] Metropolitan area designator that indicates which
  16482. // city an interconnect is located. For example: "Chicago, IL",
  16483. // "Amsterdam, Netherlands".
  16484. City string `json:"city,omitempty"`
  16485. // Continent: [Output Only] Continent for this location.
  16486. //
  16487. // Possible values:
  16488. // "AFRICA"
  16489. // "ASIA_PAC"
  16490. // "C_AFRICA"
  16491. // "C_ASIA_PAC"
  16492. // "C_EUROPE"
  16493. // "C_NORTH_AMERICA"
  16494. // "C_SOUTH_AMERICA"
  16495. // "EUROPE"
  16496. // "NORTH_AMERICA"
  16497. // "SOUTH_AMERICA"
  16498. Continent string `json:"continent,omitempty"`
  16499. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16500. // format.
  16501. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16502. // Description: [Output Only] An optional description of the resource.
  16503. Description string `json:"description,omitempty"`
  16504. // FacilityProvider: [Output Only] The name of the provider for this
  16505. // facility (e.g., EQUINIX).
  16506. FacilityProvider string `json:"facilityProvider,omitempty"`
  16507. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  16508. // Identifier for this facility (e.g., Ashburn-DC1).
  16509. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  16510. // Id: [Output Only] The unique identifier for the resource. This
  16511. // identifier is defined by the server.
  16512. Id uint64 `json:"id,omitempty,string"`
  16513. // Kind: [Output Only] Type of the resource. Always
  16514. // compute#interconnectLocation for interconnect locations.
  16515. Kind string `json:"kind,omitempty"`
  16516. // Name: [Output Only] Name of the resource.
  16517. Name string `json:"name,omitempty"`
  16518. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  16519. // facility (corresponding with a netfac type in peeringdb).
  16520. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  16521. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  16522. // objects, that describe parameters pertaining to the relation between
  16523. // this InterconnectLocation and various Google Cloud regions.
  16524. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  16525. // SelfLink: [Output Only] Server-defined URL for the resource.
  16526. SelfLink string `json:"selfLink,omitempty"`
  16527. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  16528. // with the resource id.
  16529. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  16530. // Status: [Output Only] The status of this InterconnectLocation. If the
  16531. // status is AVAILABLE, new Interconnects may be provisioned in this
  16532. // InterconnectLocation. Otherwise, no new Interconnects may be
  16533. // provisioned.
  16534. //
  16535. // Possible values:
  16536. // "AVAILABLE"
  16537. // "CLOSED"
  16538. Status string `json:"status,omitempty"`
  16539. // ServerResponse contains the HTTP response code and headers from the
  16540. // server.
  16541. googleapi.ServerResponse `json:"-"`
  16542. // ForceSendFields is a list of field names (e.g. "Address") to
  16543. // unconditionally include in API requests. By default, fields with
  16544. // empty values are omitted from API requests. However, any non-pointer,
  16545. // non-interface field appearing in ForceSendFields will be sent to the
  16546. // server regardless of whether the field is empty or not. This may be
  16547. // used to include empty fields in Patch requests.
  16548. ForceSendFields []string `json:"-"`
  16549. // NullFields is a list of field names (e.g. "Address") to include in
  16550. // API requests with the JSON null value. By default, fields with empty
  16551. // values are omitted from API requests. However, any field with an
  16552. // empty value appearing in NullFields will be sent to the server as
  16553. // null. It is an error if a field in this list has a non-empty value.
  16554. // This may be used to include null fields in Patch requests.
  16555. NullFields []string `json:"-"`
  16556. }
  16557. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  16558. type NoMethod InterconnectLocation
  16559. raw := NoMethod(*s)
  16560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16561. }
  16562. // InterconnectLocationList: Response to the list request, and contains
  16563. // a list of interconnect locations.
  16564. type InterconnectLocationList struct {
  16565. // Id: [Output Only] Unique identifier for the resource; defined by the
  16566. // server.
  16567. Id string `json:"id,omitempty"`
  16568. // Items: A list of InterconnectLocation resources.
  16569. Items []*InterconnectLocation `json:"items,omitempty"`
  16570. // Kind: [Output Only] Type of resource. Always
  16571. // compute#interconnectLocationList for lists of interconnect locations.
  16572. Kind string `json:"kind,omitempty"`
  16573. // NextPageToken: [Output Only] This token allows you to get the next
  16574. // page of results for list requests. If the number of results is larger
  16575. // than maxResults, use the nextPageToken as a value for the query
  16576. // parameter pageToken in the next list request. Subsequent list
  16577. // requests will have their own nextPageToken to continue paging through
  16578. // the results.
  16579. NextPageToken string `json:"nextPageToken,omitempty"`
  16580. // SelfLink: [Output Only] Server-defined URL for this resource.
  16581. SelfLink string `json:"selfLink,omitempty"`
  16582. // Warning: [Output Only] Informational warning message.
  16583. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  16584. // ServerResponse contains the HTTP response code and headers from the
  16585. // server.
  16586. googleapi.ServerResponse `json:"-"`
  16587. // ForceSendFields is a list of field names (e.g. "Id") to
  16588. // unconditionally include in API requests. By default, fields with
  16589. // empty values are omitted from API requests. However, any non-pointer,
  16590. // non-interface field appearing in ForceSendFields will be sent to the
  16591. // server regardless of whether the field is empty or not. This may be
  16592. // used to include empty fields in Patch requests.
  16593. ForceSendFields []string `json:"-"`
  16594. // NullFields is a list of field names (e.g. "Id") to include in API
  16595. // requests with the JSON null value. By default, fields with empty
  16596. // values are omitted from API requests. However, any field with an
  16597. // empty value appearing in NullFields will be sent to the server as
  16598. // null. It is an error if a field in this list has a non-empty value.
  16599. // This may be used to include null fields in Patch requests.
  16600. NullFields []string `json:"-"`
  16601. }
  16602. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  16603. type NoMethod InterconnectLocationList
  16604. raw := NoMethod(*s)
  16605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16606. }
  16607. // InterconnectLocationListWarning: [Output Only] Informational warning
  16608. // message.
  16609. type InterconnectLocationListWarning struct {
  16610. // Code: [Output Only] A warning code, if applicable. For example,
  16611. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16612. // the response.
  16613. //
  16614. // Possible values:
  16615. // "CLEANUP_FAILED"
  16616. // "DEPRECATED_RESOURCE_USED"
  16617. // "DEPRECATED_TYPE_USED"
  16618. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16619. // "EXPERIMENTAL_TYPE_USED"
  16620. // "EXTERNAL_API_WARNING"
  16621. // "FIELD_VALUE_OVERRIDEN"
  16622. // "INJECTED_KERNELS_DEPRECATED"
  16623. // "MISSING_TYPE_DEPENDENCY"
  16624. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16625. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16626. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16627. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16628. // "NEXT_HOP_NOT_RUNNING"
  16629. // "NOT_CRITICAL_ERROR"
  16630. // "NO_RESULTS_ON_PAGE"
  16631. // "REQUIRED_TOS_AGREEMENT"
  16632. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16633. // "RESOURCE_NOT_DELETED"
  16634. // "SCHEMA_VALIDATION_IGNORED"
  16635. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16636. // "UNDECLARED_PROPERTIES"
  16637. // "UNREACHABLE"
  16638. Code string `json:"code,omitempty"`
  16639. // Data: [Output Only] Metadata about this warning in key: value format.
  16640. // For example:
  16641. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16642. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  16643. // Message: [Output Only] A human-readable description of the warning
  16644. // code.
  16645. Message string `json:"message,omitempty"`
  16646. // ForceSendFields is a list of field names (e.g. "Code") to
  16647. // unconditionally include in API requests. By default, fields with
  16648. // empty values are omitted from API requests. However, any non-pointer,
  16649. // non-interface field appearing in ForceSendFields will be sent to the
  16650. // server regardless of whether the field is empty or not. This may be
  16651. // used to include empty fields in Patch requests.
  16652. ForceSendFields []string `json:"-"`
  16653. // NullFields is a list of field names (e.g. "Code") to include in API
  16654. // requests with the JSON null value. By default, fields with empty
  16655. // values are omitted from API requests. However, any field with an
  16656. // empty value appearing in NullFields will be sent to the server as
  16657. // null. It is an error if a field in this list has a non-empty value.
  16658. // This may be used to include null fields in Patch requests.
  16659. NullFields []string `json:"-"`
  16660. }
  16661. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  16662. type NoMethod InterconnectLocationListWarning
  16663. raw := NoMethod(*s)
  16664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16665. }
  16666. type InterconnectLocationListWarningData struct {
  16667. // Key: [Output Only] A key that provides more detail on the warning
  16668. // being returned. For example, for warnings where there are no results
  16669. // in a list request for a particular zone, this key might be scope and
  16670. // the key value might be the zone name. Other examples might be a key
  16671. // indicating a deprecated resource and a suggested replacement, or a
  16672. // warning about invalid network settings (for example, if an instance
  16673. // attempts to perform IP forwarding but is not enabled for IP
  16674. // forwarding).
  16675. Key string `json:"key,omitempty"`
  16676. // Value: [Output Only] A warning data value corresponding to the key.
  16677. Value string `json:"value,omitempty"`
  16678. // ForceSendFields is a list of field names (e.g. "Key") to
  16679. // unconditionally include in API requests. By default, fields with
  16680. // empty values are omitted from API requests. However, any non-pointer,
  16681. // non-interface field appearing in ForceSendFields will be sent to the
  16682. // server regardless of whether the field is empty or not. This may be
  16683. // used to include empty fields in Patch requests.
  16684. ForceSendFields []string `json:"-"`
  16685. // NullFields is a list of field names (e.g. "Key") to include in API
  16686. // requests with the JSON null value. By default, fields with empty
  16687. // values are omitted from API requests. However, any field with an
  16688. // empty value appearing in NullFields will be sent to the server as
  16689. // null. It is an error if a field in this list has a non-empty value.
  16690. // This may be used to include null fields in Patch requests.
  16691. NullFields []string `json:"-"`
  16692. }
  16693. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  16694. type NoMethod InterconnectLocationListWarningData
  16695. raw := NoMethod(*s)
  16696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16697. }
  16698. // InterconnectLocationRegionInfo: Information about any potential
  16699. // InterconnectAttachments between an Interconnect at a specific
  16700. // InterconnectLocation, and a specific Cloud Region.
  16701. type InterconnectLocationRegionInfo struct {
  16702. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  16703. // InterconnectLocation to a VM in this region.
  16704. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  16705. // LocationPresence: Identifies the network presence of this location.
  16706. //
  16707. // Possible values:
  16708. // "GLOBAL"
  16709. // "LOCAL_REGION"
  16710. // "LP_GLOBAL"
  16711. // "LP_LOCAL_REGION"
  16712. LocationPresence string `json:"locationPresence,omitempty"`
  16713. // Region: URL for the region of this location.
  16714. Region string `json:"region,omitempty"`
  16715. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  16716. // unconditionally include in API requests. By default, fields with
  16717. // empty values are omitted from API requests. However, any non-pointer,
  16718. // non-interface field appearing in ForceSendFields will be sent to the
  16719. // server regardless of whether the field is empty or not. This may be
  16720. // used to include empty fields in Patch requests.
  16721. ForceSendFields []string `json:"-"`
  16722. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  16723. // in API requests with the JSON null value. By default, fields with
  16724. // empty values are omitted from API requests. However, any field with
  16725. // an empty value appearing in NullFields will be sent to the server as
  16726. // null. It is an error if a field in this list has a non-empty value.
  16727. // This may be used to include null fields in Patch requests.
  16728. NullFields []string `json:"-"`
  16729. }
  16730. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  16731. type NoMethod InterconnectLocationRegionInfo
  16732. raw := NoMethod(*s)
  16733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16734. }
  16735. // InterconnectOutageNotification: Description of a planned outage on
  16736. // this Interconnect. Next id: 9
  16737. type InterconnectOutageNotification struct {
  16738. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  16739. // Google-side circuit IDs that will be affected.
  16740. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  16741. // Description: A description about the purpose of the outage.
  16742. Description string `json:"description,omitempty"`
  16743. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  16744. // epoch).
  16745. EndTime int64 `json:"endTime,omitempty,string"`
  16746. // IssueType: Form this outage is expected to take. Note that the "IT_"
  16747. // versions of this enum have been deprecated in favor of the unprefixed
  16748. // values.
  16749. //
  16750. // Possible values:
  16751. // "IT_OUTAGE"
  16752. // "IT_PARTIAL_OUTAGE"
  16753. // "OUTAGE"
  16754. // "PARTIAL_OUTAGE"
  16755. IssueType string `json:"issueType,omitempty"`
  16756. // Name: Unique identifier for this outage notification.
  16757. Name string `json:"name,omitempty"`
  16758. // Source: The party that generated this notification. Note that
  16759. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  16760. //
  16761. // Possible values:
  16762. // "GOOGLE"
  16763. // "NSRC_GOOGLE"
  16764. Source string `json:"source,omitempty"`
  16765. // StartTime: Scheduled start time for the outage (milliseconds since
  16766. // Unix epoch).
  16767. StartTime int64 `json:"startTime,omitempty,string"`
  16768. // State: State of this notification. Note that the "NS_" versions of
  16769. // this enum have been deprecated in favor of the unprefixed values.
  16770. //
  16771. // Possible values:
  16772. // "ACTIVE"
  16773. // "CANCELLED"
  16774. // "NS_ACTIVE"
  16775. // "NS_CANCELED"
  16776. State string `json:"state,omitempty"`
  16777. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  16778. // unconditionally include in API requests. By default, fields with
  16779. // empty values are omitted from API requests. However, any non-pointer,
  16780. // non-interface field appearing in ForceSendFields will be sent to the
  16781. // server regardless of whether the field is empty or not. This may be
  16782. // used to include empty fields in Patch requests.
  16783. ForceSendFields []string `json:"-"`
  16784. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  16785. // include in API requests with the JSON null value. By default, fields
  16786. // with empty values are omitted from API requests. However, any field
  16787. // with an empty value appearing in NullFields will be sent to the
  16788. // server as null. It is an error if a field in this list has a
  16789. // non-empty value. This may be used to include null fields in Patch
  16790. // requests.
  16791. NullFields []string `json:"-"`
  16792. }
  16793. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  16794. type NoMethod InterconnectOutageNotification
  16795. raw := NoMethod(*s)
  16796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16797. }
  16798. // InterconnectsGetDiagnosticsResponse: Response for the
  16799. // InterconnectsGetDiagnosticsRequest.
  16800. type InterconnectsGetDiagnosticsResponse struct {
  16801. Result *InterconnectDiagnostics `json:"result,omitempty"`
  16802. // ServerResponse contains the HTTP response code and headers from the
  16803. // server.
  16804. googleapi.ServerResponse `json:"-"`
  16805. // ForceSendFields is a list of field names (e.g. "Result") to
  16806. // unconditionally include in API requests. By default, fields with
  16807. // empty values are omitted from API requests. However, any non-pointer,
  16808. // non-interface field appearing in ForceSendFields will be sent to the
  16809. // server regardless of whether the field is empty or not. This may be
  16810. // used to include empty fields in Patch requests.
  16811. ForceSendFields []string `json:"-"`
  16812. // NullFields is a list of field names (e.g. "Result") to include in API
  16813. // requests with the JSON null value. By default, fields with empty
  16814. // values are omitted from API requests. However, any field with an
  16815. // empty value appearing in NullFields will be sent to the server as
  16816. // null. It is an error if a field in this list has a non-empty value.
  16817. // This may be used to include null fields in Patch requests.
  16818. NullFields []string `json:"-"`
  16819. }
  16820. func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
  16821. type NoMethod InterconnectsGetDiagnosticsResponse
  16822. raw := NoMethod(*s)
  16823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16824. }
  16825. type InternalIpAddress struct {
  16826. // Cidr: IP CIDR address or range.
  16827. Cidr string `json:"cidr,omitempty"`
  16828. // Owner: The owner of the internal IP address.
  16829. Owner string `json:"owner,omitempty"`
  16830. // Purpose: The purpose of the internal IP address if applicable.
  16831. Purpose string `json:"purpose,omitempty"`
  16832. // Region: The region of the internal IP address if applicable.
  16833. Region string `json:"region,omitempty"`
  16834. // Type: The type of the internal IP address.
  16835. //
  16836. // Possible values:
  16837. // "PEER_RESERVED"
  16838. // "PEER_USED"
  16839. // "REMOTE_RESERVED"
  16840. // "REMOTE_USED"
  16841. // "RESERVED"
  16842. // "SUBNETWORK"
  16843. // "TYPE_UNSPECIFIED"
  16844. Type string `json:"type,omitempty"`
  16845. // ForceSendFields is a list of field names (e.g. "Cidr") to
  16846. // unconditionally include in API requests. By default, fields with
  16847. // empty values are omitted from API requests. However, any non-pointer,
  16848. // non-interface field appearing in ForceSendFields will be sent to the
  16849. // server regardless of whether the field is empty or not. This may be
  16850. // used to include empty fields in Patch requests.
  16851. ForceSendFields []string `json:"-"`
  16852. // NullFields is a list of field names (e.g. "Cidr") to include in API
  16853. // requests with the JSON null value. By default, fields with empty
  16854. // values are omitted from API requests. However, any field with an
  16855. // empty value appearing in NullFields will be sent to the server as
  16856. // null. It is an error if a field in this list has a non-empty value.
  16857. // This may be used to include null fields in Patch requests.
  16858. NullFields []string `json:"-"`
  16859. }
  16860. func (s *InternalIpAddress) MarshalJSON() ([]byte, error) {
  16861. type NoMethod InternalIpAddress
  16862. raw := NoMethod(*s)
  16863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16864. }
  16865. type InternalIpOwner struct {
  16866. // IpCidrRange: IP CIDR range being owned.
  16867. IpCidrRange string `json:"ipCidrRange,omitempty"`
  16868. // Owners: URLs of the IP owners of the IP CIDR range.
  16869. Owners []string `json:"owners,omitempty"`
  16870. // SystemOwned: Whether this IP CIDR range is reserved for system use.
  16871. SystemOwned bool `json:"systemOwned,omitempty"`
  16872. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  16873. // unconditionally include in API requests. By default, fields with
  16874. // empty values are omitted from API requests. However, any non-pointer,
  16875. // non-interface field appearing in ForceSendFields will be sent to the
  16876. // server regardless of whether the field is empty or not. This may be
  16877. // used to include empty fields in Patch requests.
  16878. ForceSendFields []string `json:"-"`
  16879. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  16880. // in API requests with the JSON null value. By default, fields with
  16881. // empty values are omitted from API requests. However, any field with
  16882. // an empty value appearing in NullFields will be sent to the server as
  16883. // null. It is an error if a field in this list has a non-empty value.
  16884. // This may be used to include null fields in Patch requests.
  16885. NullFields []string `json:"-"`
  16886. }
  16887. func (s *InternalIpOwner) MarshalJSON() ([]byte, error) {
  16888. type NoMethod InternalIpOwner
  16889. raw := NoMethod(*s)
  16890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16891. }
  16892. type IpAddressesList struct {
  16893. // Id: [Output Only] Unique identifier for the resource; defined by the
  16894. // server.
  16895. Id string `json:"id,omitempty"`
  16896. // Items: A list of InternalIpAddress resources.
  16897. Items []*InternalIpAddress `json:"items,omitempty"`
  16898. // Kind: [Output Only] Type of resource. Always compute#ipAddressesList
  16899. // for IP addresses lists.
  16900. Kind string `json:"kind,omitempty"`
  16901. // NextPageToken: [Output Only] This token allows you to get the next
  16902. // page of results for list requests. If the number of results is larger
  16903. // than maxResults, use the nextPageToken as a value for the query
  16904. // parameter pageToken in the next list request. Subsequent list
  16905. // requests will have their own nextPageToken to continue paging through
  16906. // the results.
  16907. NextPageToken string `json:"nextPageToken,omitempty"`
  16908. // SelfLink: [Output Only] Server-defined URL for this resource.
  16909. SelfLink string `json:"selfLink,omitempty"`
  16910. // Warning: [Output Only] Informational warning message.
  16911. Warning *IpAddressesListWarning `json:"warning,omitempty"`
  16912. // ServerResponse contains the HTTP response code and headers from the
  16913. // server.
  16914. googleapi.ServerResponse `json:"-"`
  16915. // ForceSendFields is a list of field names (e.g. "Id") to
  16916. // unconditionally include in API requests. By default, fields with
  16917. // empty values are omitted from API requests. However, any non-pointer,
  16918. // non-interface field appearing in ForceSendFields will be sent to the
  16919. // server regardless of whether the field is empty or not. This may be
  16920. // used to include empty fields in Patch requests.
  16921. ForceSendFields []string `json:"-"`
  16922. // NullFields is a list of field names (e.g. "Id") to include in API
  16923. // requests with the JSON null value. By default, fields with empty
  16924. // values are omitted from API requests. However, any field with an
  16925. // empty value appearing in NullFields will be sent to the server as
  16926. // null. It is an error if a field in this list has a non-empty value.
  16927. // This may be used to include null fields in Patch requests.
  16928. NullFields []string `json:"-"`
  16929. }
  16930. func (s *IpAddressesList) MarshalJSON() ([]byte, error) {
  16931. type NoMethod IpAddressesList
  16932. raw := NoMethod(*s)
  16933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16934. }
  16935. // IpAddressesListWarning: [Output Only] Informational warning message.
  16936. type IpAddressesListWarning struct {
  16937. // Code: [Output Only] A warning code, if applicable. For example,
  16938. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16939. // the response.
  16940. //
  16941. // Possible values:
  16942. // "CLEANUP_FAILED"
  16943. // "DEPRECATED_RESOURCE_USED"
  16944. // "DEPRECATED_TYPE_USED"
  16945. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16946. // "EXPERIMENTAL_TYPE_USED"
  16947. // "EXTERNAL_API_WARNING"
  16948. // "FIELD_VALUE_OVERRIDEN"
  16949. // "INJECTED_KERNELS_DEPRECATED"
  16950. // "MISSING_TYPE_DEPENDENCY"
  16951. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16952. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16953. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16954. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16955. // "NEXT_HOP_NOT_RUNNING"
  16956. // "NOT_CRITICAL_ERROR"
  16957. // "NO_RESULTS_ON_PAGE"
  16958. // "REQUIRED_TOS_AGREEMENT"
  16959. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16960. // "RESOURCE_NOT_DELETED"
  16961. // "SCHEMA_VALIDATION_IGNORED"
  16962. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16963. // "UNDECLARED_PROPERTIES"
  16964. // "UNREACHABLE"
  16965. Code string `json:"code,omitempty"`
  16966. // Data: [Output Only] Metadata about this warning in key: value format.
  16967. // For example:
  16968. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16969. Data []*IpAddressesListWarningData `json:"data,omitempty"`
  16970. // Message: [Output Only] A human-readable description of the warning
  16971. // code.
  16972. Message string `json:"message,omitempty"`
  16973. // ForceSendFields is a list of field names (e.g. "Code") to
  16974. // unconditionally include in API requests. By default, fields with
  16975. // empty values are omitted from API requests. However, any non-pointer,
  16976. // non-interface field appearing in ForceSendFields will be sent to the
  16977. // server regardless of whether the field is empty or not. This may be
  16978. // used to include empty fields in Patch requests.
  16979. ForceSendFields []string `json:"-"`
  16980. // NullFields is a list of field names (e.g. "Code") to include in API
  16981. // requests with the JSON null value. By default, fields with empty
  16982. // values are omitted from API requests. However, any field with an
  16983. // empty value appearing in NullFields will be sent to the server as
  16984. // null. It is an error if a field in this list has a non-empty value.
  16985. // This may be used to include null fields in Patch requests.
  16986. NullFields []string `json:"-"`
  16987. }
  16988. func (s *IpAddressesListWarning) MarshalJSON() ([]byte, error) {
  16989. type NoMethod IpAddressesListWarning
  16990. raw := NoMethod(*s)
  16991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16992. }
  16993. type IpAddressesListWarningData struct {
  16994. // Key: [Output Only] A key that provides more detail on the warning
  16995. // being returned. For example, for warnings where there are no results
  16996. // in a list request for a particular zone, this key might be scope and
  16997. // the key value might be the zone name. Other examples might be a key
  16998. // indicating a deprecated resource and a suggested replacement, or a
  16999. // warning about invalid network settings (for example, if an instance
  17000. // attempts to perform IP forwarding but is not enabled for IP
  17001. // forwarding).
  17002. Key string `json:"key,omitempty"`
  17003. // Value: [Output Only] A warning data value corresponding to the key.
  17004. Value string `json:"value,omitempty"`
  17005. // ForceSendFields is a list of field names (e.g. "Key") to
  17006. // unconditionally include in API requests. By default, fields with
  17007. // empty values are omitted from API requests. However, any non-pointer,
  17008. // non-interface field appearing in ForceSendFields will be sent to the
  17009. // server regardless of whether the field is empty or not. This may be
  17010. // used to include empty fields in Patch requests.
  17011. ForceSendFields []string `json:"-"`
  17012. // NullFields is a list of field names (e.g. "Key") to include in API
  17013. // requests with the JSON null value. By default, fields with empty
  17014. // values are omitted from API requests. However, any field with an
  17015. // empty value appearing in NullFields will be sent to the server as
  17016. // null. It is an error if a field in this list has a non-empty value.
  17017. // This may be used to include null fields in Patch requests.
  17018. NullFields []string `json:"-"`
  17019. }
  17020. func (s *IpAddressesListWarningData) MarshalJSON() ([]byte, error) {
  17021. type NoMethod IpAddressesListWarningData
  17022. raw := NoMethod(*s)
  17023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17024. }
  17025. // IpOwnerList: Contains a list of IP owners.
  17026. type IpOwnerList struct {
  17027. // Id: [Output Only] Unique identifier for the resource; defined by the
  17028. // server.
  17029. Id string `json:"id,omitempty"`
  17030. // Items: A list of InternalIpOwner resources.
  17031. Items []*InternalIpOwner `json:"items,omitempty"`
  17032. // Kind: [Output Only] Type of resource. Always compute#ipOwnerList for
  17033. // lists of IP owners.
  17034. Kind string `json:"kind,omitempty"`
  17035. // NextPageToken: [Output Only] This token allows you to get the next
  17036. // page of results for list requests. If the number of results is larger
  17037. // than maxResults, use the nextPageToken as a value for the query
  17038. // parameter pageToken in the next list request. Subsequent list
  17039. // requests will have their own nextPageToken to continue paging through
  17040. // the results.
  17041. NextPageToken string `json:"nextPageToken,omitempty"`
  17042. // SelfLink: [Output Only] Server-defined URL for this resource.
  17043. SelfLink string `json:"selfLink,omitempty"`
  17044. // Warning: [Output Only] Informational warning message.
  17045. Warning *IpOwnerListWarning `json:"warning,omitempty"`
  17046. // ServerResponse contains the HTTP response code and headers from the
  17047. // server.
  17048. googleapi.ServerResponse `json:"-"`
  17049. // ForceSendFields is a list of field names (e.g. "Id") to
  17050. // unconditionally include in API requests. By default, fields with
  17051. // empty values are omitted from API requests. However, any non-pointer,
  17052. // non-interface field appearing in ForceSendFields will be sent to the
  17053. // server regardless of whether the field is empty or not. This may be
  17054. // used to include empty fields in Patch requests.
  17055. ForceSendFields []string `json:"-"`
  17056. // NullFields is a list of field names (e.g. "Id") to include in API
  17057. // requests with the JSON null value. By default, fields with empty
  17058. // values are omitted from API requests. However, any field with an
  17059. // empty value appearing in NullFields will be sent to the server as
  17060. // null. It is an error if a field in this list has a non-empty value.
  17061. // This may be used to include null fields in Patch requests.
  17062. NullFields []string `json:"-"`
  17063. }
  17064. func (s *IpOwnerList) MarshalJSON() ([]byte, error) {
  17065. type NoMethod IpOwnerList
  17066. raw := NoMethod(*s)
  17067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17068. }
  17069. // IpOwnerListWarning: [Output Only] Informational warning message.
  17070. type IpOwnerListWarning struct {
  17071. // Code: [Output Only] A warning code, if applicable. For example,
  17072. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17073. // the response.
  17074. //
  17075. // Possible values:
  17076. // "CLEANUP_FAILED"
  17077. // "DEPRECATED_RESOURCE_USED"
  17078. // "DEPRECATED_TYPE_USED"
  17079. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17080. // "EXPERIMENTAL_TYPE_USED"
  17081. // "EXTERNAL_API_WARNING"
  17082. // "FIELD_VALUE_OVERRIDEN"
  17083. // "INJECTED_KERNELS_DEPRECATED"
  17084. // "MISSING_TYPE_DEPENDENCY"
  17085. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17086. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17087. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17088. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17089. // "NEXT_HOP_NOT_RUNNING"
  17090. // "NOT_CRITICAL_ERROR"
  17091. // "NO_RESULTS_ON_PAGE"
  17092. // "REQUIRED_TOS_AGREEMENT"
  17093. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17094. // "RESOURCE_NOT_DELETED"
  17095. // "SCHEMA_VALIDATION_IGNORED"
  17096. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17097. // "UNDECLARED_PROPERTIES"
  17098. // "UNREACHABLE"
  17099. Code string `json:"code,omitempty"`
  17100. // Data: [Output Only] Metadata about this warning in key: value format.
  17101. // For example:
  17102. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17103. Data []*IpOwnerListWarningData `json:"data,omitempty"`
  17104. // Message: [Output Only] A human-readable description of the warning
  17105. // code.
  17106. Message string `json:"message,omitempty"`
  17107. // ForceSendFields is a list of field names (e.g. "Code") to
  17108. // unconditionally include in API requests. By default, fields with
  17109. // empty values are omitted from API requests. However, any non-pointer,
  17110. // non-interface field appearing in ForceSendFields will be sent to the
  17111. // server regardless of whether the field is empty or not. This may be
  17112. // used to include empty fields in Patch requests.
  17113. ForceSendFields []string `json:"-"`
  17114. // NullFields is a list of field names (e.g. "Code") to include in API
  17115. // requests with the JSON null value. By default, fields with empty
  17116. // values are omitted from API requests. However, any field with an
  17117. // empty value appearing in NullFields will be sent to the server as
  17118. // null. It is an error if a field in this list has a non-empty value.
  17119. // This may be used to include null fields in Patch requests.
  17120. NullFields []string `json:"-"`
  17121. }
  17122. func (s *IpOwnerListWarning) MarshalJSON() ([]byte, error) {
  17123. type NoMethod IpOwnerListWarning
  17124. raw := NoMethod(*s)
  17125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17126. }
  17127. type IpOwnerListWarningData struct {
  17128. // Key: [Output Only] A key that provides more detail on the warning
  17129. // being returned. For example, for warnings where there are no results
  17130. // in a list request for a particular zone, this key might be scope and
  17131. // the key value might be the zone name. Other examples might be a key
  17132. // indicating a deprecated resource and a suggested replacement, or a
  17133. // warning about invalid network settings (for example, if an instance
  17134. // attempts to perform IP forwarding but is not enabled for IP
  17135. // forwarding).
  17136. Key string `json:"key,omitempty"`
  17137. // Value: [Output Only] A warning data value corresponding to the key.
  17138. Value string `json:"value,omitempty"`
  17139. // ForceSendFields is a list of field names (e.g. "Key") to
  17140. // unconditionally include in API requests. By default, fields with
  17141. // empty values are omitted from API requests. However, any non-pointer,
  17142. // non-interface field appearing in ForceSendFields will be sent to the
  17143. // server regardless of whether the field is empty or not. This may be
  17144. // used to include empty fields in Patch requests.
  17145. ForceSendFields []string `json:"-"`
  17146. // NullFields is a list of field names (e.g. "Key") to include in API
  17147. // requests with the JSON null value. By default, fields with empty
  17148. // values are omitted from API requests. However, any field with an
  17149. // empty value appearing in NullFields will be sent to the server as
  17150. // null. It is an error if a field in this list has a non-empty value.
  17151. // This may be used to include null fields in Patch requests.
  17152. NullFields []string `json:"-"`
  17153. }
  17154. func (s *IpOwnerListWarningData) MarshalJSON() ([]byte, error) {
  17155. type NoMethod IpOwnerListWarningData
  17156. raw := NoMethod(*s)
  17157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17158. }
  17159. // Jwt: JWT configuration for origin authentication.
  17160. type Jwt struct {
  17161. // Audiences: A JWT containing any of these audiences will be accepted.
  17162. // The service name will be accepted if audiences is empty. Examples:
  17163. // bookstore_android.apps.googleusercontent.com,
  17164. // bookstore_web.apps.googleusercontent.com
  17165. Audiences []string `json:"audiences,omitempty"`
  17166. // Issuer: Identifies the issuer that issued the JWT, which is usually a
  17167. // URL or an email address. Examples: https://securetoken.google.com,
  17168. // 1234567-compute@developer.gserviceaccount.com
  17169. Issuer string `json:"issuer,omitempty"`
  17170. // JwksPublicKeys: The provider?s public key set to validate the
  17171. // signature of the JWT.
  17172. JwksPublicKeys string `json:"jwksPublicKeys,omitempty"`
  17173. // JwtHeaders: jwt_headers and jwt_params define where to extract the
  17174. // JWT from an HTTP request. If no explicit location is specified, the
  17175. // following default locations are tried in order:
  17176. //
  17177. // 1. The Authorization header using the Bearer schema. See `here `_.
  17178. // Example:
  17179. //
  17180. // Authorization: Bearer .
  17181. //
  17182. // 2. `access_token` query parameter. See `this `_
  17183. //
  17184. // Multiple JWTs can be verified for a request. Each JWT has to be
  17185. // extracted from the locations its issuer specified or from the default
  17186. // locations.
  17187. //
  17188. // This field is set if JWT is sent in a request header. This field
  17189. // specifies the header name. For example, if
  17190. // `header=x-goog-iap-jwt-assertion`, the header format will be
  17191. // x-goog-iap-jwt-assertion: .
  17192. JwtHeaders []*JwtHeader `json:"jwtHeaders,omitempty"`
  17193. // JwtParams: This field is set if JWT is sent in a query parameter.
  17194. // This field specifies the query parameter name. For example, if
  17195. // jwt_params[0] is jwt_token, the JWT format in the query parameter is
  17196. // /path?jwt_token=.
  17197. JwtParams []string `json:"jwtParams,omitempty"`
  17198. // ForceSendFields is a list of field names (e.g. "Audiences") to
  17199. // unconditionally include in API requests. By default, fields with
  17200. // empty values are omitted from API requests. However, any non-pointer,
  17201. // non-interface field appearing in ForceSendFields will be sent to the
  17202. // server regardless of whether the field is empty or not. This may be
  17203. // used to include empty fields in Patch requests.
  17204. ForceSendFields []string `json:"-"`
  17205. // NullFields is a list of field names (e.g. "Audiences") to include in
  17206. // API requests with the JSON null value. By default, fields with empty
  17207. // values are omitted from API requests. However, any field with an
  17208. // empty value appearing in NullFields will be sent to the server as
  17209. // null. It is an error if a field in this list has a non-empty value.
  17210. // This may be used to include null fields in Patch requests.
  17211. NullFields []string `json:"-"`
  17212. }
  17213. func (s *Jwt) MarshalJSON() ([]byte, error) {
  17214. type NoMethod Jwt
  17215. raw := NoMethod(*s)
  17216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17217. }
  17218. // JwtHeader: This message specifies a header location to extract JWT
  17219. // token.
  17220. type JwtHeader struct {
  17221. // Name: The HTTP header name.
  17222. Name string `json:"name,omitempty"`
  17223. // ValuePrefix: The value prefix. The value format is "value_prefix" For
  17224. // example, for "Authorization: Bearer ", value_prefix="Bearer " with a
  17225. // space at the end.
  17226. ValuePrefix string `json:"valuePrefix,omitempty"`
  17227. // ForceSendFields is a list of field names (e.g. "Name") to
  17228. // unconditionally include in API requests. By default, fields with
  17229. // empty values are omitted from API requests. However, any non-pointer,
  17230. // non-interface field appearing in ForceSendFields will be sent to the
  17231. // server regardless of whether the field is empty or not. This may be
  17232. // used to include empty fields in Patch requests.
  17233. ForceSendFields []string `json:"-"`
  17234. // NullFields is a list of field names (e.g. "Name") to include in API
  17235. // requests with the JSON null value. By default, fields with empty
  17236. // values are omitted from API requests. However, any field with an
  17237. // empty value appearing in NullFields will be sent to the server as
  17238. // null. It is an error if a field in this list has a non-empty value.
  17239. // This may be used to include null fields in Patch requests.
  17240. NullFields []string `json:"-"`
  17241. }
  17242. func (s *JwtHeader) MarshalJSON() ([]byte, error) {
  17243. type NoMethod JwtHeader
  17244. raw := NoMethod(*s)
  17245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17246. }
  17247. // License: A license resource.
  17248. type License struct {
  17249. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  17250. // reflects whether a license charges a usage fee.
  17251. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  17252. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17253. // format.
  17254. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17255. // Description: An optional textual description of the resource;
  17256. // provided by the client when the resource is created.
  17257. Description string `json:"description,omitempty"`
  17258. // Id: [Output Only] The unique identifier for the resource. This
  17259. // identifier is defined by the server.
  17260. Id uint64 `json:"id,omitempty,string"`
  17261. // Kind: [Output Only] Type of resource. Always compute#license for
  17262. // licenses.
  17263. Kind string `json:"kind,omitempty"`
  17264. // LicenseCode: [Output Only] The unique code used to attach this
  17265. // license to images, snapshots, and disks.
  17266. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  17267. // Name: Name of the resource. The name must be 1-63 characters long and
  17268. // comply with RFC1035.
  17269. Name string `json:"name,omitempty"`
  17270. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  17271. // SelfLink: [Output Only] Server-defined URL for the resource.
  17272. SelfLink string `json:"selfLink,omitempty"`
  17273. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  17274. // with the resource id.
  17275. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  17276. // Transferable: If false, licenses will not be copied from the source
  17277. // resource when creating an image from a disk, disk from snapshot, or
  17278. // snapshot from disk.
  17279. Transferable bool `json:"transferable,omitempty"`
  17280. // ServerResponse contains the HTTP response code and headers from the
  17281. // server.
  17282. googleapi.ServerResponse `json:"-"`
  17283. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  17284. // unconditionally include in API requests. By default, fields with
  17285. // empty values are omitted from API requests. However, any non-pointer,
  17286. // non-interface field appearing in ForceSendFields will be sent to the
  17287. // server regardless of whether the field is empty or not. This may be
  17288. // used to include empty fields in Patch requests.
  17289. ForceSendFields []string `json:"-"`
  17290. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  17291. // in API requests with the JSON null value. By default, fields with
  17292. // empty values are omitted from API requests. However, any field with
  17293. // an empty value appearing in NullFields will be sent to the server as
  17294. // null. It is an error if a field in this list has a non-empty value.
  17295. // This may be used to include null fields in Patch requests.
  17296. NullFields []string `json:"-"`
  17297. }
  17298. func (s *License) MarshalJSON() ([]byte, error) {
  17299. type NoMethod License
  17300. raw := NoMethod(*s)
  17301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17302. }
  17303. type LicenseCode struct {
  17304. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17305. // format.
  17306. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17307. // Description: [Output Only] Description of this License Code.
  17308. Description string `json:"description,omitempty"`
  17309. // Id: [Output Only] The unique identifier for the resource. This
  17310. // identifier is defined by the server.
  17311. Id uint64 `json:"id,omitempty,string"`
  17312. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  17313. // licenses.
  17314. Kind string `json:"kind,omitempty"`
  17315. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  17316. // with the same License Code.
  17317. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  17318. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  17319. // long and must be a valid 64 bit integer.
  17320. Name string `json:"name,omitempty"`
  17321. // SelfLink: [Output Only] Server-defined URL for the resource.
  17322. SelfLink string `json:"selfLink,omitempty"`
  17323. // State: [Output Only] Current state of this License Code.
  17324. //
  17325. // Possible values:
  17326. // "DISABLED"
  17327. // "ENABLED"
  17328. // "RESTRICTED"
  17329. // "STATE_UNSPECIFIED"
  17330. // "TERMINATED"
  17331. State string `json:"state,omitempty"`
  17332. // Transferable: [Output Only] If true, the license will remain attached
  17333. // when creating images or snapshots from disks. Otherwise, the license
  17334. // is not transferred.
  17335. Transferable bool `json:"transferable,omitempty"`
  17336. // ServerResponse contains the HTTP response code and headers from the
  17337. // server.
  17338. googleapi.ServerResponse `json:"-"`
  17339. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17340. // to unconditionally include in API requests. By default, fields with
  17341. // empty values are omitted from API requests. However, any non-pointer,
  17342. // non-interface field appearing in ForceSendFields will be sent to the
  17343. // server regardless of whether the field is empty or not. This may be
  17344. // used to include empty fields in Patch requests.
  17345. ForceSendFields []string `json:"-"`
  17346. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17347. // include in API requests with the JSON null value. By default, fields
  17348. // with empty values are omitted from API requests. However, any field
  17349. // with an empty value appearing in NullFields will be sent to the
  17350. // server as null. It is an error if a field in this list has a
  17351. // non-empty value. This may be used to include null fields in Patch
  17352. // requests.
  17353. NullFields []string `json:"-"`
  17354. }
  17355. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  17356. type NoMethod LicenseCode
  17357. raw := NoMethod(*s)
  17358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17359. }
  17360. type LicenseCodeLicenseAlias struct {
  17361. // Description: [Output Only] Description of this License Code.
  17362. Description string `json:"description,omitempty"`
  17363. // SelfLink: [Output Only] URL of license corresponding to this License
  17364. // Code.
  17365. SelfLink string `json:"selfLink,omitempty"`
  17366. // ForceSendFields is a list of field names (e.g. "Description") to
  17367. // unconditionally include in API requests. By default, fields with
  17368. // empty values are omitted from API requests. However, any non-pointer,
  17369. // non-interface field appearing in ForceSendFields will be sent to the
  17370. // server regardless of whether the field is empty or not. This may be
  17371. // used to include empty fields in Patch requests.
  17372. ForceSendFields []string `json:"-"`
  17373. // NullFields is a list of field names (e.g. "Description") to include
  17374. // in API requests with the JSON null value. By default, fields with
  17375. // empty values are omitted from API requests. However, any field with
  17376. // an empty value appearing in NullFields will be sent to the server as
  17377. // null. It is an error if a field in this list has a non-empty value.
  17378. // This may be used to include null fields in Patch requests.
  17379. NullFields []string `json:"-"`
  17380. }
  17381. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  17382. type NoMethod LicenseCodeLicenseAlias
  17383. raw := NoMethod(*s)
  17384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17385. }
  17386. type LicenseResourceRequirements struct {
  17387. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  17388. // Instance. Enforced at Instance creation and Instance start.
  17389. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  17390. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  17391. // Instance creation and Instance start.
  17392. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  17393. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  17394. // unconditionally include in API requests. By default, fields with
  17395. // empty values are omitted from API requests. However, any non-pointer,
  17396. // non-interface field appearing in ForceSendFields will be sent to the
  17397. // server regardless of whether the field is empty or not. This may be
  17398. // used to include empty fields in Patch requests.
  17399. ForceSendFields []string `json:"-"`
  17400. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  17401. // include in API requests with the JSON null value. By default, fields
  17402. // with empty values are omitted from API requests. However, any field
  17403. // with an empty value appearing in NullFields will be sent to the
  17404. // server as null. It is an error if a field in this list has a
  17405. // non-empty value. This may be used to include null fields in Patch
  17406. // requests.
  17407. NullFields []string `json:"-"`
  17408. }
  17409. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  17410. type NoMethod LicenseResourceRequirements
  17411. raw := NoMethod(*s)
  17412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17413. }
  17414. type LicensesListResponse struct {
  17415. // Id: [Output Only] Unique identifier for the resource; defined by the
  17416. // server.
  17417. Id string `json:"id,omitempty"`
  17418. // Items: A list of License resources.
  17419. Items []*License `json:"items,omitempty"`
  17420. // NextPageToken: [Output Only] This token allows you to get the next
  17421. // page of results for list requests. If the number of results is larger
  17422. // than maxResults, use the nextPageToken as a value for the query
  17423. // parameter pageToken in the next list request. Subsequent list
  17424. // requests will have their own nextPageToken to continue paging through
  17425. // the results.
  17426. NextPageToken string `json:"nextPageToken,omitempty"`
  17427. // SelfLink: [Output Only] Server-defined URL for this resource.
  17428. SelfLink string `json:"selfLink,omitempty"`
  17429. // Warning: [Output Only] Informational warning message.
  17430. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  17431. // ServerResponse contains the HTTP response code and headers from the
  17432. // server.
  17433. googleapi.ServerResponse `json:"-"`
  17434. // ForceSendFields is a list of field names (e.g. "Id") to
  17435. // unconditionally include in API requests. By default, fields with
  17436. // empty values are omitted from API requests. However, any non-pointer,
  17437. // non-interface field appearing in ForceSendFields will be sent to the
  17438. // server regardless of whether the field is empty or not. This may be
  17439. // used to include empty fields in Patch requests.
  17440. ForceSendFields []string `json:"-"`
  17441. // NullFields is a list of field names (e.g. "Id") to include in API
  17442. // requests with the JSON null value. By default, fields with empty
  17443. // values are omitted from API requests. However, any field with an
  17444. // empty value appearing in NullFields will be sent to the server as
  17445. // null. It is an error if a field in this list has a non-empty value.
  17446. // This may be used to include null fields in Patch requests.
  17447. NullFields []string `json:"-"`
  17448. }
  17449. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  17450. type NoMethod LicensesListResponse
  17451. raw := NoMethod(*s)
  17452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17453. }
  17454. // LicensesListResponseWarning: [Output Only] Informational warning
  17455. // message.
  17456. type LicensesListResponseWarning struct {
  17457. // Code: [Output Only] A warning code, if applicable. For example,
  17458. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17459. // the response.
  17460. //
  17461. // Possible values:
  17462. // "CLEANUP_FAILED"
  17463. // "DEPRECATED_RESOURCE_USED"
  17464. // "DEPRECATED_TYPE_USED"
  17465. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17466. // "EXPERIMENTAL_TYPE_USED"
  17467. // "EXTERNAL_API_WARNING"
  17468. // "FIELD_VALUE_OVERRIDEN"
  17469. // "INJECTED_KERNELS_DEPRECATED"
  17470. // "MISSING_TYPE_DEPENDENCY"
  17471. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17472. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17473. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17474. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17475. // "NEXT_HOP_NOT_RUNNING"
  17476. // "NOT_CRITICAL_ERROR"
  17477. // "NO_RESULTS_ON_PAGE"
  17478. // "REQUIRED_TOS_AGREEMENT"
  17479. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17480. // "RESOURCE_NOT_DELETED"
  17481. // "SCHEMA_VALIDATION_IGNORED"
  17482. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17483. // "UNDECLARED_PROPERTIES"
  17484. // "UNREACHABLE"
  17485. Code string `json:"code,omitempty"`
  17486. // Data: [Output Only] Metadata about this warning in key: value format.
  17487. // For example:
  17488. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17489. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  17490. // Message: [Output Only] A human-readable description of the warning
  17491. // code.
  17492. Message string `json:"message,omitempty"`
  17493. // ForceSendFields is a list of field names (e.g. "Code") to
  17494. // unconditionally include in API requests. By default, fields with
  17495. // empty values are omitted from API requests. However, any non-pointer,
  17496. // non-interface field appearing in ForceSendFields will be sent to the
  17497. // server regardless of whether the field is empty or not. This may be
  17498. // used to include empty fields in Patch requests.
  17499. ForceSendFields []string `json:"-"`
  17500. // NullFields is a list of field names (e.g. "Code") to include in API
  17501. // requests with the JSON null value. By default, fields with empty
  17502. // values are omitted from API requests. However, any field with an
  17503. // empty value appearing in NullFields will be sent to the server as
  17504. // null. It is an error if a field in this list has a non-empty value.
  17505. // This may be used to include null fields in Patch requests.
  17506. NullFields []string `json:"-"`
  17507. }
  17508. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  17509. type NoMethod LicensesListResponseWarning
  17510. raw := NoMethod(*s)
  17511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17512. }
  17513. type LicensesListResponseWarningData struct {
  17514. // Key: [Output Only] A key that provides more detail on the warning
  17515. // being returned. For example, for warnings where there are no results
  17516. // in a list request for a particular zone, this key might be scope and
  17517. // the key value might be the zone name. Other examples might be a key
  17518. // indicating a deprecated resource and a suggested replacement, or a
  17519. // warning about invalid network settings (for example, if an instance
  17520. // attempts to perform IP forwarding but is not enabled for IP
  17521. // forwarding).
  17522. Key string `json:"key,omitempty"`
  17523. // Value: [Output Only] A warning data value corresponding to the key.
  17524. Value string `json:"value,omitempty"`
  17525. // ForceSendFields is a list of field names (e.g. "Key") to
  17526. // unconditionally include in API requests. By default, fields with
  17527. // empty values are omitted from API requests. However, any non-pointer,
  17528. // non-interface field appearing in ForceSendFields will be sent to the
  17529. // server regardless of whether the field is empty or not. This may be
  17530. // used to include empty fields in Patch requests.
  17531. ForceSendFields []string `json:"-"`
  17532. // NullFields is a list of field names (e.g. "Key") to include in API
  17533. // requests with the JSON null value. By default, fields with empty
  17534. // values are omitted from API requests. However, any field with an
  17535. // empty value appearing in NullFields will be sent to the server as
  17536. // null. It is an error if a field in this list has a non-empty value.
  17537. // This may be used to include null fields in Patch requests.
  17538. NullFields []string `json:"-"`
  17539. }
  17540. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  17541. type NoMethod LicensesListResponseWarningData
  17542. raw := NoMethod(*s)
  17543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17544. }
  17545. // LogConfig: Specifies what kind of log the caller must write
  17546. type LogConfig struct {
  17547. // CloudAudit: Cloud audit options.
  17548. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  17549. // Counter: Counter options.
  17550. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  17551. // DataAccess: Data access options.
  17552. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  17553. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  17554. // unconditionally include in API requests. By default, fields with
  17555. // empty values are omitted from API requests. However, any non-pointer,
  17556. // non-interface field appearing in ForceSendFields will be sent to the
  17557. // server regardless of whether the field is empty or not. This may be
  17558. // used to include empty fields in Patch requests.
  17559. ForceSendFields []string `json:"-"`
  17560. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  17561. // API requests with the JSON null value. By default, fields with empty
  17562. // values are omitted from API requests. However, any field with an
  17563. // empty value appearing in NullFields will be sent to the server as
  17564. // null. It is an error if a field in this list has a non-empty value.
  17565. // This may be used to include null fields in Patch requests.
  17566. NullFields []string `json:"-"`
  17567. }
  17568. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  17569. type NoMethod LogConfig
  17570. raw := NoMethod(*s)
  17571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17572. }
  17573. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  17574. type LogConfigCloudAuditOptions struct {
  17575. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  17576. // Logging pipeline.
  17577. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  17578. // LogName: The log_name to populate in the Cloud Audit Record.
  17579. //
  17580. // Possible values:
  17581. // "ADMIN_ACTIVITY"
  17582. // "DATA_ACCESS"
  17583. // "UNSPECIFIED_LOG_NAME"
  17584. LogName string `json:"logName,omitempty"`
  17585. // ForceSendFields is a list of field names (e.g.
  17586. // "AuthorizationLoggingOptions") to unconditionally include in API
  17587. // requests. By default, fields with empty values are omitted from API
  17588. // requests. However, any non-pointer, non-interface field appearing in
  17589. // ForceSendFields will be sent to the server regardless of whether the
  17590. // field is empty or not. This may be used to include empty fields in
  17591. // Patch requests.
  17592. ForceSendFields []string `json:"-"`
  17593. // NullFields is a list of field names (e.g.
  17594. // "AuthorizationLoggingOptions") to include in API requests with the
  17595. // JSON null value. By default, fields with empty values are omitted
  17596. // from API requests. However, any field with an empty value appearing
  17597. // in NullFields will be sent to the server as null. It is an error if a
  17598. // field in this list has a non-empty value. This may be used to include
  17599. // null fields in Patch requests.
  17600. NullFields []string `json:"-"`
  17601. }
  17602. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  17603. type NoMethod LogConfigCloudAuditOptions
  17604. raw := NoMethod(*s)
  17605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17606. }
  17607. // LogConfigCounterOptions: Increment a streamz counter with the
  17608. // specified metric and field names.
  17609. //
  17610. // Metric names should start with a '/', generally be lowercase-only,
  17611. // and end in "_count". Field names should not contain an initial slash.
  17612. // The actual exported metric names will have "/iam/policy"
  17613. // prepended.
  17614. //
  17615. // Field names correspond to IAM request parameters and field values are
  17616. // their respective values.
  17617. //
  17618. // Supported field names: - "authority", which is "[token]" if
  17619. // IAMContext.token is present, otherwise the value of
  17620. // IAMContext.authority_selector if present, and otherwise a
  17621. // representation of IAMContext.principal; or - "iam_principal", a
  17622. // representation of IAMContext.principal even if a token or authority
  17623. // selector is present; or - "" (empty string), resulting in a counter
  17624. // with no fields.
  17625. //
  17626. // Examples: counter { metric: "/debug_access_count" field:
  17627. // "iam_principal" } ==> increment counter
  17628. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  17629. // IAMContext.principal]}
  17630. //
  17631. // At this time we do not support multiple field names (though this may
  17632. // be supported in the future).
  17633. type LogConfigCounterOptions struct {
  17634. // Field: The field value to attribute.
  17635. Field string `json:"field,omitempty"`
  17636. // Metric: The metric to update.
  17637. Metric string `json:"metric,omitempty"`
  17638. // ForceSendFields is a list of field names (e.g. "Field") to
  17639. // unconditionally include in API requests. By default, fields with
  17640. // empty values are omitted from API requests. However, any non-pointer,
  17641. // non-interface field appearing in ForceSendFields will be sent to the
  17642. // server regardless of whether the field is empty or not. This may be
  17643. // used to include empty fields in Patch requests.
  17644. ForceSendFields []string `json:"-"`
  17645. // NullFields is a list of field names (e.g. "Field") to include in API
  17646. // requests with the JSON null value. By default, fields with empty
  17647. // values are omitted from API requests. However, any field with an
  17648. // empty value appearing in NullFields will be sent to the server as
  17649. // null. It is an error if a field in this list has a non-empty value.
  17650. // This may be used to include null fields in Patch requests.
  17651. NullFields []string `json:"-"`
  17652. }
  17653. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  17654. type NoMethod LogConfigCounterOptions
  17655. raw := NoMethod(*s)
  17656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17657. }
  17658. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  17659. type LogConfigDataAccessOptions struct {
  17660. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  17661. // the caller. This is relevant only in the LocalIAM implementation, for
  17662. // now.
  17663. //
  17664. // NOTE: Logging to Gin in a fail-closed manner is currently unsupported
  17665. // while work is being done to satisfy the requirements of go/345.
  17666. // Currently, setting LOG_FAIL_CLOSED mode will have no effect, but
  17667. // still exists because there is active work being done to support it
  17668. // (b/115874152).
  17669. //
  17670. // Possible values:
  17671. // "LOG_FAIL_CLOSED"
  17672. // "LOG_MODE_UNSPECIFIED"
  17673. LogMode string `json:"logMode,omitempty"`
  17674. // ForceSendFields is a list of field names (e.g. "LogMode") to
  17675. // unconditionally include in API requests. By default, fields with
  17676. // empty values are omitted from API requests. However, any non-pointer,
  17677. // non-interface field appearing in ForceSendFields will be sent to the
  17678. // server regardless of whether the field is empty or not. This may be
  17679. // used to include empty fields in Patch requests.
  17680. ForceSendFields []string `json:"-"`
  17681. // NullFields is a list of field names (e.g. "LogMode") to include in
  17682. // API requests with the JSON null value. By default, fields with empty
  17683. // values are omitted from API requests. However, any field with an
  17684. // empty value appearing in NullFields will be sent to the server as
  17685. // null. It is an error if a field in this list has a non-empty value.
  17686. // This may be used to include null fields in Patch requests.
  17687. NullFields []string `json:"-"`
  17688. }
  17689. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  17690. type NoMethod LogConfigDataAccessOptions
  17691. raw := NoMethod(*s)
  17692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17693. }
  17694. // MachineImage: Machine image resource.
  17695. type MachineImage struct {
  17696. // CreationTimestamp: [Output Only] The creation timestamp for this
  17697. // machine image in RFC3339 text format.
  17698. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17699. // Description: An optional description of this resource. Provide this
  17700. // property when you create the resource.
  17701. Description string `json:"description,omitempty"`
  17702. // Id: [Output Only] A unique identifier for this machine image. The
  17703. // server defines this identifier.
  17704. Id uint64 `json:"id,omitempty,string"`
  17705. // Kind: [Output Only] The resource type, which is always
  17706. // compute#machineImage for machine image.
  17707. Kind string `json:"kind,omitempty"`
  17708. // MachineImageEncryptionKey: Encryption key to protect the machine
  17709. // image.
  17710. MachineImageEncryptionKey *CustomerEncryptionKey `json:"machineImageEncryptionKey,omitempty"`
  17711. // Name: Name of the resource; provided by the client when the resource
  17712. // is created. The name must be 1-63 characters long, and comply with
  17713. // RFC1035. Specifically, the name must be 1-63 characters long and
  17714. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  17715. // the first character must be a lowercase letter, and all following
  17716. // characters must be a dash, lowercase letter, or digit, except the
  17717. // last character, which cannot be a dash.
  17718. Name string `json:"name,omitempty"`
  17719. // SelfLink: [Output Only] The URL for this machine image. The server
  17720. // defines this URL.
  17721. SelfLink string `json:"selfLink,omitempty"`
  17722. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  17723. // with the resource id.
  17724. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  17725. // SourceInstance: The source instance used to create the machine image.
  17726. // You can provide this as a partial or full URL to the resource. For
  17727. // example, the following are valid values:
  17728. // -
  17729. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  17730. // - projects/project/zones/zone/instances/instance
  17731. SourceInstance string `json:"sourceInstance,omitempty"`
  17732. // SourceInstanceProperties: Properties of source instance.
  17733. SourceInstanceProperties *SourceInstanceProperties `json:"sourceInstanceProperties,omitempty"`
  17734. // Status: [Output Only] The status of disk creation.
  17735. //
  17736. // Possible values:
  17737. // "CREATING"
  17738. // "DELETING"
  17739. // "INVALID"
  17740. // "READY"
  17741. // "UPLOADING"
  17742. Status string `json:"status,omitempty"`
  17743. // StorageLocations: GCS bucket storage location of the snapshot
  17744. // (regional or multi-regional).
  17745. StorageLocations []string `json:"storageLocations,omitempty"`
  17746. // ServerResponse contains the HTTP response code and headers from the
  17747. // server.
  17748. googleapi.ServerResponse `json:"-"`
  17749. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17750. // to unconditionally include in API requests. By default, fields with
  17751. // empty values are omitted from API requests. However, any non-pointer,
  17752. // non-interface field appearing in ForceSendFields will be sent to the
  17753. // server regardless of whether the field is empty or not. This may be
  17754. // used to include empty fields in Patch requests.
  17755. ForceSendFields []string `json:"-"`
  17756. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17757. // include in API requests with the JSON null value. By default, fields
  17758. // with empty values are omitted from API requests. However, any field
  17759. // with an empty value appearing in NullFields will be sent to the
  17760. // server as null. It is an error if a field in this list has a
  17761. // non-empty value. This may be used to include null fields in Patch
  17762. // requests.
  17763. NullFields []string `json:"-"`
  17764. }
  17765. func (s *MachineImage) MarshalJSON() ([]byte, error) {
  17766. type NoMethod MachineImage
  17767. raw := NoMethod(*s)
  17768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17769. }
  17770. // MachineImageList: A list of machine images.
  17771. type MachineImageList struct {
  17772. Etag string `json:"etag,omitempty"`
  17773. // Id: [Output Only] Unique identifier for the resource; defined by the
  17774. // server.
  17775. Id string `json:"id,omitempty"`
  17776. // Items: A list of MachineImage resources.
  17777. Items []*MachineImage `json:"items,omitempty"`
  17778. // Kind: [Output Only] The resource type, which is always
  17779. // compute#machineImagesListResponse for machine image lists.
  17780. Kind string `json:"kind,omitempty"`
  17781. // NextPageToken: [Output Only] This token allows you to get the next
  17782. // page of results for list requests. If the number of results is larger
  17783. // than maxResults, use the nextPageToken as a value for the query
  17784. // parameter pageToken in the next list request. Subsequent list
  17785. // requests will have their own nextPageToken to continue paging through
  17786. // the results.
  17787. NextPageToken string `json:"nextPageToken,omitempty"`
  17788. // SelfLink: [Output Only] Server-defined URL for this resource.
  17789. SelfLink string `json:"selfLink,omitempty"`
  17790. // Warning: [Output Only] Informational warning message.
  17791. Warning *MachineImageListWarning `json:"warning,omitempty"`
  17792. // ServerResponse contains the HTTP response code and headers from the
  17793. // server.
  17794. googleapi.ServerResponse `json:"-"`
  17795. // ForceSendFields is a list of field names (e.g. "Etag") to
  17796. // unconditionally include in API requests. By default, fields with
  17797. // empty values are omitted from API requests. However, any non-pointer,
  17798. // non-interface field appearing in ForceSendFields will be sent to the
  17799. // server regardless of whether the field is empty or not. This may be
  17800. // used to include empty fields in Patch requests.
  17801. ForceSendFields []string `json:"-"`
  17802. // NullFields is a list of field names (e.g. "Etag") to include in API
  17803. // requests with the JSON null value. By default, fields with empty
  17804. // values are omitted from API requests. However, any field with an
  17805. // empty value appearing in NullFields will be sent to the server as
  17806. // null. It is an error if a field in this list has a non-empty value.
  17807. // This may be used to include null fields in Patch requests.
  17808. NullFields []string `json:"-"`
  17809. }
  17810. func (s *MachineImageList) MarshalJSON() ([]byte, error) {
  17811. type NoMethod MachineImageList
  17812. raw := NoMethod(*s)
  17813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17814. }
  17815. // MachineImageListWarning: [Output Only] Informational warning message.
  17816. type MachineImageListWarning struct {
  17817. // Code: [Output Only] A warning code, if applicable. For example,
  17818. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17819. // the response.
  17820. //
  17821. // Possible values:
  17822. // "CLEANUP_FAILED"
  17823. // "DEPRECATED_RESOURCE_USED"
  17824. // "DEPRECATED_TYPE_USED"
  17825. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17826. // "EXPERIMENTAL_TYPE_USED"
  17827. // "EXTERNAL_API_WARNING"
  17828. // "FIELD_VALUE_OVERRIDEN"
  17829. // "INJECTED_KERNELS_DEPRECATED"
  17830. // "MISSING_TYPE_DEPENDENCY"
  17831. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17832. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17833. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17834. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17835. // "NEXT_HOP_NOT_RUNNING"
  17836. // "NOT_CRITICAL_ERROR"
  17837. // "NO_RESULTS_ON_PAGE"
  17838. // "REQUIRED_TOS_AGREEMENT"
  17839. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17840. // "RESOURCE_NOT_DELETED"
  17841. // "SCHEMA_VALIDATION_IGNORED"
  17842. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17843. // "UNDECLARED_PROPERTIES"
  17844. // "UNREACHABLE"
  17845. Code string `json:"code,omitempty"`
  17846. // Data: [Output Only] Metadata about this warning in key: value format.
  17847. // For example:
  17848. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17849. Data []*MachineImageListWarningData `json:"data,omitempty"`
  17850. // Message: [Output Only] A human-readable description of the warning
  17851. // code.
  17852. Message string `json:"message,omitempty"`
  17853. // ForceSendFields is a list of field names (e.g. "Code") to
  17854. // unconditionally include in API requests. By default, fields with
  17855. // empty values are omitted from API requests. However, any non-pointer,
  17856. // non-interface field appearing in ForceSendFields will be sent to the
  17857. // server regardless of whether the field is empty or not. This may be
  17858. // used to include empty fields in Patch requests.
  17859. ForceSendFields []string `json:"-"`
  17860. // NullFields is a list of field names (e.g. "Code") to include in API
  17861. // requests with the JSON null value. By default, fields with empty
  17862. // values are omitted from API requests. However, any field with an
  17863. // empty value appearing in NullFields will be sent to the server as
  17864. // null. It is an error if a field in this list has a non-empty value.
  17865. // This may be used to include null fields in Patch requests.
  17866. NullFields []string `json:"-"`
  17867. }
  17868. func (s *MachineImageListWarning) MarshalJSON() ([]byte, error) {
  17869. type NoMethod MachineImageListWarning
  17870. raw := NoMethod(*s)
  17871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17872. }
  17873. type MachineImageListWarningData struct {
  17874. // Key: [Output Only] A key that provides more detail on the warning
  17875. // being returned. For example, for warnings where there are no results
  17876. // in a list request for a particular zone, this key might be scope and
  17877. // the key value might be the zone name. Other examples might be a key
  17878. // indicating a deprecated resource and a suggested replacement, or a
  17879. // warning about invalid network settings (for example, if an instance
  17880. // attempts to perform IP forwarding but is not enabled for IP
  17881. // forwarding).
  17882. Key string `json:"key,omitempty"`
  17883. // Value: [Output Only] A warning data value corresponding to the key.
  17884. Value string `json:"value,omitempty"`
  17885. // ForceSendFields is a list of field names (e.g. "Key") to
  17886. // unconditionally include in API requests. By default, fields with
  17887. // empty values are omitted from API requests. However, any non-pointer,
  17888. // non-interface field appearing in ForceSendFields will be sent to the
  17889. // server regardless of whether the field is empty or not. This may be
  17890. // used to include empty fields in Patch requests.
  17891. ForceSendFields []string `json:"-"`
  17892. // NullFields is a list of field names (e.g. "Key") to include in API
  17893. // requests with the JSON null value. By default, fields with empty
  17894. // values are omitted from API requests. However, any field with an
  17895. // empty value appearing in NullFields will be sent to the server as
  17896. // null. It is an error if a field in this list has a non-empty value.
  17897. // This may be used to include null fields in Patch requests.
  17898. NullFields []string `json:"-"`
  17899. }
  17900. func (s *MachineImageListWarningData) MarshalJSON() ([]byte, error) {
  17901. type NoMethod MachineImageListWarningData
  17902. raw := NoMethod(*s)
  17903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17904. }
  17905. // MachineType: A Machine Type resource. (== resource_for
  17906. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  17907. type MachineType struct {
  17908. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17909. // format.
  17910. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17911. // Deprecated: [Output Only] The deprecation status associated with this
  17912. // machine type.
  17913. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  17914. // Description: [Output Only] An optional textual description of the
  17915. // resource.
  17916. Description string `json:"description,omitempty"`
  17917. // GuestCpus: [Output Only] The number of virtual CPUs that are
  17918. // available to the instance.
  17919. GuestCpus int64 `json:"guestCpus,omitempty"`
  17920. // Id: [Output Only] The unique identifier for the resource. This
  17921. // identifier is defined by the server.
  17922. Id uint64 `json:"id,omitempty,string"`
  17923. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  17924. // CPU. See Shared-core machine types for more information.
  17925. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  17926. // Kind: [Output Only] The type of the resource. Always
  17927. // compute#machineType for machine types.
  17928. Kind string `json:"kind,omitempty"`
  17929. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  17930. // allowed.
  17931. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  17932. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  17933. // disks size (GB) allowed.
  17934. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  17935. // MemoryMb: [Output Only] The amount of physical memory available to
  17936. // the instance, defined in MB.
  17937. MemoryMb int64 `json:"memoryMb,omitempty"`
  17938. // Name: [Output Only] Name of the resource.
  17939. Name string `json:"name,omitempty"`
  17940. // SelfLink: [Output Only] Server-defined URL for the resource.
  17941. SelfLink string `json:"selfLink,omitempty"`
  17942. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  17943. // with the resource id.
  17944. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  17945. // Zone: [Output Only] The name of the zone where the machine type
  17946. // resides, such as us-central1-a.
  17947. Zone string `json:"zone,omitempty"`
  17948. // ServerResponse contains the HTTP response code and headers from the
  17949. // server.
  17950. googleapi.ServerResponse `json:"-"`
  17951. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17952. // to unconditionally include in API requests. By default, fields with
  17953. // empty values are omitted from API requests. However, any non-pointer,
  17954. // non-interface field appearing in ForceSendFields will be sent to the
  17955. // server regardless of whether the field is empty or not. This may be
  17956. // used to include empty fields in Patch requests.
  17957. ForceSendFields []string `json:"-"`
  17958. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17959. // include in API requests with the JSON null value. By default, fields
  17960. // with empty values are omitted from API requests. However, any field
  17961. // with an empty value appearing in NullFields will be sent to the
  17962. // server as null. It is an error if a field in this list has a
  17963. // non-empty value. This may be used to include null fields in Patch
  17964. // requests.
  17965. NullFields []string `json:"-"`
  17966. }
  17967. func (s *MachineType) MarshalJSON() ([]byte, error) {
  17968. type NoMethod MachineType
  17969. raw := NoMethod(*s)
  17970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17971. }
  17972. type MachineTypeAggregatedList struct {
  17973. // Id: [Output Only] Unique identifier for the resource; defined by the
  17974. // server.
  17975. Id string `json:"id,omitempty"`
  17976. // Items: A list of MachineTypesScopedList resources.
  17977. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  17978. // Kind: [Output Only] Type of resource. Always
  17979. // compute#machineTypeAggregatedList for aggregated lists of machine
  17980. // types.
  17981. Kind string `json:"kind,omitempty"`
  17982. // NextPageToken: [Output Only] This token allows you to get the next
  17983. // page of results for list requests. If the number of results is larger
  17984. // than maxResults, use the nextPageToken as a value for the query
  17985. // parameter pageToken in the next list request. Subsequent list
  17986. // requests will have their own nextPageToken to continue paging through
  17987. // the results.
  17988. NextPageToken string `json:"nextPageToken,omitempty"`
  17989. // SelfLink: [Output Only] Server-defined URL for this resource.
  17990. SelfLink string `json:"selfLink,omitempty"`
  17991. // Warning: [Output Only] Informational warning message.
  17992. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  17993. // ServerResponse contains the HTTP response code and headers from the
  17994. // server.
  17995. googleapi.ServerResponse `json:"-"`
  17996. // ForceSendFields is a list of field names (e.g. "Id") to
  17997. // unconditionally include in API requests. By default, fields with
  17998. // empty values are omitted from API requests. However, any non-pointer,
  17999. // non-interface field appearing in ForceSendFields will be sent to the
  18000. // server regardless of whether the field is empty or not. This may be
  18001. // used to include empty fields in Patch requests.
  18002. ForceSendFields []string `json:"-"`
  18003. // NullFields is a list of field names (e.g. "Id") to include in API
  18004. // requests with the JSON null value. By default, fields with empty
  18005. // values are omitted from API requests. However, any field with an
  18006. // empty value appearing in NullFields will be sent to the server as
  18007. // null. It is an error if a field in this list has a non-empty value.
  18008. // This may be used to include null fields in Patch requests.
  18009. NullFields []string `json:"-"`
  18010. }
  18011. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  18012. type NoMethod MachineTypeAggregatedList
  18013. raw := NoMethod(*s)
  18014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18015. }
  18016. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  18017. // message.
  18018. type MachineTypeAggregatedListWarning struct {
  18019. // Code: [Output Only] A warning code, if applicable. For example,
  18020. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18021. // the response.
  18022. //
  18023. // Possible values:
  18024. // "CLEANUP_FAILED"
  18025. // "DEPRECATED_RESOURCE_USED"
  18026. // "DEPRECATED_TYPE_USED"
  18027. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18028. // "EXPERIMENTAL_TYPE_USED"
  18029. // "EXTERNAL_API_WARNING"
  18030. // "FIELD_VALUE_OVERRIDEN"
  18031. // "INJECTED_KERNELS_DEPRECATED"
  18032. // "MISSING_TYPE_DEPENDENCY"
  18033. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18034. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18035. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18036. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18037. // "NEXT_HOP_NOT_RUNNING"
  18038. // "NOT_CRITICAL_ERROR"
  18039. // "NO_RESULTS_ON_PAGE"
  18040. // "REQUIRED_TOS_AGREEMENT"
  18041. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18042. // "RESOURCE_NOT_DELETED"
  18043. // "SCHEMA_VALIDATION_IGNORED"
  18044. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18045. // "UNDECLARED_PROPERTIES"
  18046. // "UNREACHABLE"
  18047. Code string `json:"code,omitempty"`
  18048. // Data: [Output Only] Metadata about this warning in key: value format.
  18049. // For example:
  18050. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18051. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  18052. // Message: [Output Only] A human-readable description of the warning
  18053. // code.
  18054. Message string `json:"message,omitempty"`
  18055. // ForceSendFields is a list of field names (e.g. "Code") to
  18056. // unconditionally include in API requests. By default, fields with
  18057. // empty values are omitted from API requests. However, any non-pointer,
  18058. // non-interface field appearing in ForceSendFields will be sent to the
  18059. // server regardless of whether the field is empty or not. This may be
  18060. // used to include empty fields in Patch requests.
  18061. ForceSendFields []string `json:"-"`
  18062. // NullFields is a list of field names (e.g. "Code") to include in API
  18063. // requests with the JSON null value. By default, fields with empty
  18064. // values are omitted from API requests. However, any field with an
  18065. // empty value appearing in NullFields will be sent to the server as
  18066. // null. It is an error if a field in this list has a non-empty value.
  18067. // This may be used to include null fields in Patch requests.
  18068. NullFields []string `json:"-"`
  18069. }
  18070. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  18071. type NoMethod MachineTypeAggregatedListWarning
  18072. raw := NoMethod(*s)
  18073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18074. }
  18075. type MachineTypeAggregatedListWarningData struct {
  18076. // Key: [Output Only] A key that provides more detail on the warning
  18077. // being returned. For example, for warnings where there are no results
  18078. // in a list request for a particular zone, this key might be scope and
  18079. // the key value might be the zone name. Other examples might be a key
  18080. // indicating a deprecated resource and a suggested replacement, or a
  18081. // warning about invalid network settings (for example, if an instance
  18082. // attempts to perform IP forwarding but is not enabled for IP
  18083. // forwarding).
  18084. Key string `json:"key,omitempty"`
  18085. // Value: [Output Only] A warning data value corresponding to the key.
  18086. Value string `json:"value,omitempty"`
  18087. // ForceSendFields is a list of field names (e.g. "Key") to
  18088. // unconditionally include in API requests. By default, fields with
  18089. // empty values are omitted from API requests. However, any non-pointer,
  18090. // non-interface field appearing in ForceSendFields will be sent to the
  18091. // server regardless of whether the field is empty or not. This may be
  18092. // used to include empty fields in Patch requests.
  18093. ForceSendFields []string `json:"-"`
  18094. // NullFields is a list of field names (e.g. "Key") to include in API
  18095. // requests with the JSON null value. By default, fields with empty
  18096. // values are omitted from API requests. However, any field with an
  18097. // empty value appearing in NullFields will be sent to the server as
  18098. // null. It is an error if a field in this list has a non-empty value.
  18099. // This may be used to include null fields in Patch requests.
  18100. NullFields []string `json:"-"`
  18101. }
  18102. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  18103. type NoMethod MachineTypeAggregatedListWarningData
  18104. raw := NoMethod(*s)
  18105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18106. }
  18107. // MachineTypeList: Contains a list of machine types.
  18108. type MachineTypeList struct {
  18109. // Id: [Output Only] Unique identifier for the resource; defined by the
  18110. // server.
  18111. Id string `json:"id,omitempty"`
  18112. // Items: A list of MachineType resources.
  18113. Items []*MachineType `json:"items,omitempty"`
  18114. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  18115. // for lists of machine types.
  18116. Kind string `json:"kind,omitempty"`
  18117. // NextPageToken: [Output Only] This token allows you to get the next
  18118. // page of results for list requests. If the number of results is larger
  18119. // than maxResults, use the nextPageToken as a value for the query
  18120. // parameter pageToken in the next list request. Subsequent list
  18121. // requests will have their own nextPageToken to continue paging through
  18122. // the results.
  18123. NextPageToken string `json:"nextPageToken,omitempty"`
  18124. // SelfLink: [Output Only] Server-defined URL for this resource.
  18125. SelfLink string `json:"selfLink,omitempty"`
  18126. // Warning: [Output Only] Informational warning message.
  18127. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  18128. // ServerResponse contains the HTTP response code and headers from the
  18129. // server.
  18130. googleapi.ServerResponse `json:"-"`
  18131. // ForceSendFields is a list of field names (e.g. "Id") to
  18132. // unconditionally include in API requests. By default, fields with
  18133. // empty values are omitted from API requests. However, any non-pointer,
  18134. // non-interface field appearing in ForceSendFields will be sent to the
  18135. // server regardless of whether the field is empty or not. This may be
  18136. // used to include empty fields in Patch requests.
  18137. ForceSendFields []string `json:"-"`
  18138. // NullFields is a list of field names (e.g. "Id") to include in API
  18139. // requests with the JSON null value. By default, fields with empty
  18140. // values are omitted from API requests. However, any field with an
  18141. // empty value appearing in NullFields will be sent to the server as
  18142. // null. It is an error if a field in this list has a non-empty value.
  18143. // This may be used to include null fields in Patch requests.
  18144. NullFields []string `json:"-"`
  18145. }
  18146. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  18147. type NoMethod MachineTypeList
  18148. raw := NoMethod(*s)
  18149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18150. }
  18151. // MachineTypeListWarning: [Output Only] Informational warning message.
  18152. type MachineTypeListWarning struct {
  18153. // Code: [Output Only] A warning code, if applicable. For example,
  18154. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18155. // the response.
  18156. //
  18157. // Possible values:
  18158. // "CLEANUP_FAILED"
  18159. // "DEPRECATED_RESOURCE_USED"
  18160. // "DEPRECATED_TYPE_USED"
  18161. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18162. // "EXPERIMENTAL_TYPE_USED"
  18163. // "EXTERNAL_API_WARNING"
  18164. // "FIELD_VALUE_OVERRIDEN"
  18165. // "INJECTED_KERNELS_DEPRECATED"
  18166. // "MISSING_TYPE_DEPENDENCY"
  18167. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18168. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18169. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18170. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18171. // "NEXT_HOP_NOT_RUNNING"
  18172. // "NOT_CRITICAL_ERROR"
  18173. // "NO_RESULTS_ON_PAGE"
  18174. // "REQUIRED_TOS_AGREEMENT"
  18175. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18176. // "RESOURCE_NOT_DELETED"
  18177. // "SCHEMA_VALIDATION_IGNORED"
  18178. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18179. // "UNDECLARED_PROPERTIES"
  18180. // "UNREACHABLE"
  18181. Code string `json:"code,omitempty"`
  18182. // Data: [Output Only] Metadata about this warning in key: value format.
  18183. // For example:
  18184. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18185. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  18186. // Message: [Output Only] A human-readable description of the warning
  18187. // code.
  18188. Message string `json:"message,omitempty"`
  18189. // ForceSendFields is a list of field names (e.g. "Code") to
  18190. // unconditionally include in API requests. By default, fields with
  18191. // empty values are omitted from API requests. However, any non-pointer,
  18192. // non-interface field appearing in ForceSendFields will be sent to the
  18193. // server regardless of whether the field is empty or not. This may be
  18194. // used to include empty fields in Patch requests.
  18195. ForceSendFields []string `json:"-"`
  18196. // NullFields is a list of field names (e.g. "Code") to include in API
  18197. // requests with the JSON null value. By default, fields with empty
  18198. // values are omitted from API requests. However, any field with an
  18199. // empty value appearing in NullFields will be sent to the server as
  18200. // null. It is an error if a field in this list has a non-empty value.
  18201. // This may be used to include null fields in Patch requests.
  18202. NullFields []string `json:"-"`
  18203. }
  18204. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  18205. type NoMethod MachineTypeListWarning
  18206. raw := NoMethod(*s)
  18207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18208. }
  18209. type MachineTypeListWarningData struct {
  18210. // Key: [Output Only] A key that provides more detail on the warning
  18211. // being returned. For example, for warnings where there are no results
  18212. // in a list request for a particular zone, this key might be scope and
  18213. // the key value might be the zone name. Other examples might be a key
  18214. // indicating a deprecated resource and a suggested replacement, or a
  18215. // warning about invalid network settings (for example, if an instance
  18216. // attempts to perform IP forwarding but is not enabled for IP
  18217. // forwarding).
  18218. Key string `json:"key,omitempty"`
  18219. // Value: [Output Only] A warning data value corresponding to the key.
  18220. Value string `json:"value,omitempty"`
  18221. // ForceSendFields is a list of field names (e.g. "Key") to
  18222. // unconditionally include in API requests. By default, fields with
  18223. // empty values are omitted from API requests. However, any non-pointer,
  18224. // non-interface field appearing in ForceSendFields will be sent to the
  18225. // server regardless of whether the field is empty or not. This may be
  18226. // used to include empty fields in Patch requests.
  18227. ForceSendFields []string `json:"-"`
  18228. // NullFields is a list of field names (e.g. "Key") to include in API
  18229. // requests with the JSON null value. By default, fields with empty
  18230. // values are omitted from API requests. However, any field with an
  18231. // empty value appearing in NullFields will be sent to the server as
  18232. // null. It is an error if a field in this list has a non-empty value.
  18233. // This may be used to include null fields in Patch requests.
  18234. NullFields []string `json:"-"`
  18235. }
  18236. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  18237. type NoMethod MachineTypeListWarningData
  18238. raw := NoMethod(*s)
  18239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18240. }
  18241. type MachineTypesScopedList struct {
  18242. // MachineTypes: [Output Only] A list of machine types contained in this
  18243. // scope.
  18244. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  18245. // Warning: [Output Only] An informational warning that appears when the
  18246. // machine types list is empty.
  18247. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  18248. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  18249. // unconditionally include in API requests. By default, fields with
  18250. // empty values are omitted from API requests. However, any non-pointer,
  18251. // non-interface field appearing in ForceSendFields will be sent to the
  18252. // server regardless of whether the field is empty or not. This may be
  18253. // used to include empty fields in Patch requests.
  18254. ForceSendFields []string `json:"-"`
  18255. // NullFields is a list of field names (e.g. "MachineTypes") to include
  18256. // in API requests with the JSON null value. By default, fields with
  18257. // empty values are omitted from API requests. However, any field with
  18258. // an empty value appearing in NullFields will be sent to the server as
  18259. // null. It is an error if a field in this list has a non-empty value.
  18260. // This may be used to include null fields in Patch requests.
  18261. NullFields []string `json:"-"`
  18262. }
  18263. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  18264. type NoMethod MachineTypesScopedList
  18265. raw := NoMethod(*s)
  18266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18267. }
  18268. // MachineTypesScopedListWarning: [Output Only] An informational warning
  18269. // that appears when the machine types list is empty.
  18270. type MachineTypesScopedListWarning struct {
  18271. // Code: [Output Only] A warning code, if applicable. For example,
  18272. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18273. // the response.
  18274. //
  18275. // Possible values:
  18276. // "CLEANUP_FAILED"
  18277. // "DEPRECATED_RESOURCE_USED"
  18278. // "DEPRECATED_TYPE_USED"
  18279. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18280. // "EXPERIMENTAL_TYPE_USED"
  18281. // "EXTERNAL_API_WARNING"
  18282. // "FIELD_VALUE_OVERRIDEN"
  18283. // "INJECTED_KERNELS_DEPRECATED"
  18284. // "MISSING_TYPE_DEPENDENCY"
  18285. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18286. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18287. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18288. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18289. // "NEXT_HOP_NOT_RUNNING"
  18290. // "NOT_CRITICAL_ERROR"
  18291. // "NO_RESULTS_ON_PAGE"
  18292. // "REQUIRED_TOS_AGREEMENT"
  18293. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18294. // "RESOURCE_NOT_DELETED"
  18295. // "SCHEMA_VALIDATION_IGNORED"
  18296. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18297. // "UNDECLARED_PROPERTIES"
  18298. // "UNREACHABLE"
  18299. Code string `json:"code,omitempty"`
  18300. // Data: [Output Only] Metadata about this warning in key: value format.
  18301. // For example:
  18302. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18303. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  18304. // Message: [Output Only] A human-readable description of the warning
  18305. // code.
  18306. Message string `json:"message,omitempty"`
  18307. // ForceSendFields is a list of field names (e.g. "Code") to
  18308. // unconditionally include in API requests. By default, fields with
  18309. // empty values are omitted from API requests. However, any non-pointer,
  18310. // non-interface field appearing in ForceSendFields will be sent to the
  18311. // server regardless of whether the field is empty or not. This may be
  18312. // used to include empty fields in Patch requests.
  18313. ForceSendFields []string `json:"-"`
  18314. // NullFields is a list of field names (e.g. "Code") to include in API
  18315. // requests with the JSON null value. By default, fields with empty
  18316. // values are omitted from API requests. However, any field with an
  18317. // empty value appearing in NullFields will be sent to the server as
  18318. // null. It is an error if a field in this list has a non-empty value.
  18319. // This may be used to include null fields in Patch requests.
  18320. NullFields []string `json:"-"`
  18321. }
  18322. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  18323. type NoMethod MachineTypesScopedListWarning
  18324. raw := NoMethod(*s)
  18325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18326. }
  18327. type MachineTypesScopedListWarningData struct {
  18328. // Key: [Output Only] A key that provides more detail on the warning
  18329. // being returned. For example, for warnings where there are no results
  18330. // in a list request for a particular zone, this key might be scope and
  18331. // the key value might be the zone name. Other examples might be a key
  18332. // indicating a deprecated resource and a suggested replacement, or a
  18333. // warning about invalid network settings (for example, if an instance
  18334. // attempts to perform IP forwarding but is not enabled for IP
  18335. // forwarding).
  18336. Key string `json:"key,omitempty"`
  18337. // Value: [Output Only] A warning data value corresponding to the key.
  18338. Value string `json:"value,omitempty"`
  18339. // ForceSendFields is a list of field names (e.g. "Key") to
  18340. // unconditionally include in API requests. By default, fields with
  18341. // empty values are omitted from API requests. However, any non-pointer,
  18342. // non-interface field appearing in ForceSendFields will be sent to the
  18343. // server regardless of whether the field is empty or not. This may be
  18344. // used to include empty fields in Patch requests.
  18345. ForceSendFields []string `json:"-"`
  18346. // NullFields is a list of field names (e.g. "Key") to include in API
  18347. // requests with the JSON null value. By default, fields with empty
  18348. // values are omitted from API requests. However, any field with an
  18349. // empty value appearing in NullFields will be sent to the server as
  18350. // null. It is an error if a field in this list has a non-empty value.
  18351. // This may be used to include null fields in Patch requests.
  18352. NullFields []string `json:"-"`
  18353. }
  18354. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  18355. type NoMethod MachineTypesScopedListWarningData
  18356. raw := NoMethod(*s)
  18357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18358. }
  18359. // ManagedInstance: A Managed Instance resource.
  18360. type ManagedInstance struct {
  18361. // CurrentAction: [Output Only] The current action that the managed
  18362. // instance group has scheduled for the instance. Possible values:
  18363. // - NONE The instance is running, and the managed instance group does
  18364. // not have any scheduled actions for this instance.
  18365. // - CREATING The managed instance group is creating this instance. If
  18366. // the group fails to create this instance, it will try again until it
  18367. // is successful.
  18368. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  18369. // to create this instance only once. If the group fails to create this
  18370. // instance, it does not try again and the group's targetSize value is
  18371. // decreased instead.
  18372. // - RECREATING The managed instance group is recreating this instance.
  18373. //
  18374. // - DELETING The managed instance group is permanently deleting this
  18375. // instance.
  18376. // - ABANDONING The managed instance group is abandoning this instance.
  18377. // The instance will be removed from the instance group and from any
  18378. // target pools that are associated with this group.
  18379. // - RESTARTING The managed instance group is restarting the instance.
  18380. //
  18381. // - REFRESHING The managed instance group is applying configuration
  18382. // changes to the instance without stopping it. For example, the group
  18383. // can update the target pool list for an instance without stopping that
  18384. // instance.
  18385. // - VERIFYING The managed instance group has created the instance and
  18386. // it is in the process of being verified.
  18387. //
  18388. // Possible values:
  18389. // "ABANDONING"
  18390. // "CREATING"
  18391. // "CREATING_WITHOUT_RETRIES"
  18392. // "DELETING"
  18393. // "NONE"
  18394. // "RECREATING"
  18395. // "REFRESHING"
  18396. // "RESTARTING"
  18397. // "VERIFYING"
  18398. CurrentAction string `json:"currentAction,omitempty"`
  18399. // Id: [Output only] The unique identifier for this resource. This field
  18400. // is empty when instance does not exist.
  18401. Id uint64 `json:"id,omitempty,string"`
  18402. // Instance: [Output Only] The URL of the instance. The URL can exist
  18403. // even if the instance has not yet been created.
  18404. Instance string `json:"instance,omitempty"`
  18405. // InstanceHealth: [Output Only] Health state of the instance per
  18406. // health-check.
  18407. InstanceHealth []*ManagedInstanceInstanceHealth `json:"instanceHealth,omitempty"`
  18408. // InstanceStatus: [Output Only] The status of the instance. This field
  18409. // is empty when the instance does not exist.
  18410. //
  18411. // Possible values:
  18412. // "PROVISIONING"
  18413. // "REPAIRING"
  18414. // "RUNNING"
  18415. // "STAGING"
  18416. // "STOPPED"
  18417. // "STOPPING"
  18418. // "SUSPENDED"
  18419. // "SUSPENDING"
  18420. // "TERMINATED"
  18421. InstanceStatus string `json:"instanceStatus,omitempty"`
  18422. // InstanceTemplate: [Output Only] The intended template of the
  18423. // instance. This field is empty when current_action is one of {
  18424. // DELETING, ABANDONING }.
  18425. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  18426. // LastAttempt: [Output Only] Information about the last attempt to
  18427. // create or delete the instance.
  18428. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  18429. // Override: [Output Only] Override defined for this instance.
  18430. Override *ManagedInstanceOverride `json:"override,omitempty"`
  18431. // PreservedStateFromConfig: [Output Only] Preserved state applied from
  18432. // per-instance config for this instance.
  18433. PreservedStateFromConfig *PreservedState `json:"preservedStateFromConfig,omitempty"`
  18434. // PreservedStateFromPolicy: [Output Only] Preserved state generated
  18435. // based on stateful policy for this instance.
  18436. PreservedStateFromPolicy *PreservedState `json:"preservedStateFromPolicy,omitempty"`
  18437. // Tag: [Output Only] Tag describing the version.
  18438. Tag string `json:"tag,omitempty"`
  18439. // Version: [Output Only] Intended version of this instance.
  18440. Version *ManagedInstanceVersion `json:"version,omitempty"`
  18441. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  18442. // unconditionally include in API requests. By default, fields with
  18443. // empty values are omitted from API requests. However, any non-pointer,
  18444. // non-interface field appearing in ForceSendFields will be sent to the
  18445. // server regardless of whether the field is empty or not. This may be
  18446. // used to include empty fields in Patch requests.
  18447. ForceSendFields []string `json:"-"`
  18448. // NullFields is a list of field names (e.g. "CurrentAction") to include
  18449. // in API requests with the JSON null value. By default, fields with
  18450. // empty values are omitted from API requests. However, any field with
  18451. // an empty value appearing in NullFields will be sent to the server as
  18452. // null. It is an error if a field in this list has a non-empty value.
  18453. // This may be used to include null fields in Patch requests.
  18454. NullFields []string `json:"-"`
  18455. }
  18456. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  18457. type NoMethod ManagedInstance
  18458. raw := NoMethod(*s)
  18459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18460. }
  18461. type ManagedInstanceInstanceHealth struct {
  18462. // DetailedHealthState: [Output Only] The current detailed instance
  18463. // health state.
  18464. //
  18465. // Possible values:
  18466. // "DRAINING"
  18467. // "HEALTHY"
  18468. // "TIMEOUT"
  18469. // "UNHEALTHY"
  18470. // "UNKNOWN"
  18471. DetailedHealthState string `json:"detailedHealthState,omitempty"`
  18472. // HealthCheck: [Output Only] The URL for the health check that verifies
  18473. // whether the instance is healthy.
  18474. HealthCheck string `json:"healthCheck,omitempty"`
  18475. // HealthState: [Output Only] The current instance health state.
  18476. //
  18477. // Possible values:
  18478. // "HEALTHY"
  18479. // "UNHEALTHY"
  18480. HealthState string `json:"healthState,omitempty"`
  18481. // ForceSendFields is a list of field names (e.g. "DetailedHealthState")
  18482. // to unconditionally include in API requests. By default, fields with
  18483. // empty values are omitted from API requests. However, any non-pointer,
  18484. // non-interface field appearing in ForceSendFields will be sent to the
  18485. // server regardless of whether the field is empty or not. This may be
  18486. // used to include empty fields in Patch requests.
  18487. ForceSendFields []string `json:"-"`
  18488. // NullFields is a list of field names (e.g. "DetailedHealthState") to
  18489. // include in API requests with the JSON null value. By default, fields
  18490. // with empty values are omitted from API requests. However, any field
  18491. // with an empty value appearing in NullFields will be sent to the
  18492. // server as null. It is an error if a field in this list has a
  18493. // non-empty value. This may be used to include null fields in Patch
  18494. // requests.
  18495. NullFields []string `json:"-"`
  18496. }
  18497. func (s *ManagedInstanceInstanceHealth) MarshalJSON() ([]byte, error) {
  18498. type NoMethod ManagedInstanceInstanceHealth
  18499. raw := NoMethod(*s)
  18500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18501. }
  18502. type ManagedInstanceLastAttempt struct {
  18503. // Errors: [Output Only] Encountered errors during the last attempt to
  18504. // create or delete the instance.
  18505. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  18506. // ForceSendFields is a list of field names (e.g. "Errors") to
  18507. // unconditionally include in API requests. By default, fields with
  18508. // empty values are omitted from API requests. However, any non-pointer,
  18509. // non-interface field appearing in ForceSendFields will be sent to the
  18510. // server regardless of whether the field is empty or not. This may be
  18511. // used to include empty fields in Patch requests.
  18512. ForceSendFields []string `json:"-"`
  18513. // NullFields is a list of field names (e.g. "Errors") to include in API
  18514. // requests with the JSON null value. By default, fields with empty
  18515. // values are omitted from API requests. However, any field with an
  18516. // empty value appearing in NullFields will be sent to the server as
  18517. // null. It is an error if a field in this list has a non-empty value.
  18518. // This may be used to include null fields in Patch requests.
  18519. NullFields []string `json:"-"`
  18520. }
  18521. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  18522. type NoMethod ManagedInstanceLastAttempt
  18523. raw := NoMethod(*s)
  18524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18525. }
  18526. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  18527. // during the last attempt to create or delete the instance.
  18528. type ManagedInstanceLastAttemptErrors struct {
  18529. // Errors: [Output Only] The array of errors encountered while
  18530. // processing this operation.
  18531. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  18532. // ForceSendFields is a list of field names (e.g. "Errors") to
  18533. // unconditionally include in API requests. By default, fields with
  18534. // empty values are omitted from API requests. However, any non-pointer,
  18535. // non-interface field appearing in ForceSendFields will be sent to the
  18536. // server regardless of whether the field is empty or not. This may be
  18537. // used to include empty fields in Patch requests.
  18538. ForceSendFields []string `json:"-"`
  18539. // NullFields is a list of field names (e.g. "Errors") to include in API
  18540. // requests with the JSON null value. By default, fields with empty
  18541. // values are omitted from API requests. However, any field with an
  18542. // empty value appearing in NullFields will be sent to the server as
  18543. // null. It is an error if a field in this list has a non-empty value.
  18544. // This may be used to include null fields in Patch requests.
  18545. NullFields []string `json:"-"`
  18546. }
  18547. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  18548. type NoMethod ManagedInstanceLastAttemptErrors
  18549. raw := NoMethod(*s)
  18550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18551. }
  18552. type ManagedInstanceLastAttemptErrorsErrors struct {
  18553. // Code: [Output Only] The error type identifier for this error.
  18554. Code string `json:"code,omitempty"`
  18555. // Location: [Output Only] Indicates the field in the request that
  18556. // caused the error. This property is optional.
  18557. Location string `json:"location,omitempty"`
  18558. // Message: [Output Only] An optional, human-readable error message.
  18559. Message string `json:"message,omitempty"`
  18560. // ForceSendFields is a list of field names (e.g. "Code") to
  18561. // unconditionally include in API requests. By default, fields with
  18562. // empty values are omitted from API requests. However, any non-pointer,
  18563. // non-interface field appearing in ForceSendFields will be sent to the
  18564. // server regardless of whether the field is empty or not. This may be
  18565. // used to include empty fields in Patch requests.
  18566. ForceSendFields []string `json:"-"`
  18567. // NullFields is a list of field names (e.g. "Code") to include in API
  18568. // requests with the JSON null value. By default, fields with empty
  18569. // values are omitted from API requests. However, any field with an
  18570. // empty value appearing in NullFields will be sent to the server as
  18571. // null. It is an error if a field in this list has a non-empty value.
  18572. // This may be used to include null fields in Patch requests.
  18573. NullFields []string `json:"-"`
  18574. }
  18575. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  18576. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  18577. raw := NoMethod(*s)
  18578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18579. }
  18580. // ManagedInstanceOverride: Overrides of stateful properties for a given
  18581. // instance
  18582. type ManagedInstanceOverride struct {
  18583. // Disks: Disk overrides defined for this instance. According to
  18584. // documentation the maximum number of disks attached to an instance is
  18585. // 128: https://cloud.google.com/compute/docs/disks/ However, compute
  18586. // API defines the limit at 140, so this is what we check.
  18587. Disks []*ManagedInstanceOverrideDiskOverride `json:"disks,omitempty"`
  18588. // Metadata: Metadata overrides defined for this instance.
  18589. // TODO(b/69785416) validate the total length is <9 KB
  18590. Metadata []*ManagedInstanceOverrideMetadata `json:"metadata,omitempty"`
  18591. // Origin: [Output Only] Indicates where does the override come from.
  18592. //
  18593. // Possible values:
  18594. // "AUTO_GENERATED"
  18595. // "USER_PROVIDED"
  18596. Origin string `json:"origin,omitempty"`
  18597. // ForceSendFields is a list of field names (e.g. "Disks") to
  18598. // unconditionally include in API requests. By default, fields with
  18599. // empty values are omitted from API requests. However, any non-pointer,
  18600. // non-interface field appearing in ForceSendFields will be sent to the
  18601. // server regardless of whether the field is empty or not. This may be
  18602. // used to include empty fields in Patch requests.
  18603. ForceSendFields []string `json:"-"`
  18604. // NullFields is a list of field names (e.g. "Disks") to include in API
  18605. // requests with the JSON null value. By default, fields with empty
  18606. // values are omitted from API requests. However, any field with an
  18607. // empty value appearing in NullFields will be sent to the server as
  18608. // null. It is an error if a field in this list has a non-empty value.
  18609. // This may be used to include null fields in Patch requests.
  18610. NullFields []string `json:"-"`
  18611. }
  18612. func (s *ManagedInstanceOverride) MarshalJSON() ([]byte, error) {
  18613. type NoMethod ManagedInstanceOverride
  18614. raw := NoMethod(*s)
  18615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18616. }
  18617. type ManagedInstanceOverrideMetadata struct {
  18618. // Key: Key for the metadata entry. Keys must conform to the following
  18619. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  18620. // reflected as part of a URL in the metadata server. Additionally, to
  18621. // avoid ambiguity, keys must not conflict with any other metadata keys
  18622. // for the project.
  18623. Key string `json:"key,omitempty"`
  18624. // Value: Value for the metadata entry. These are free-form strings, and
  18625. // only have meaning as interpreted by the image running in the
  18626. // instance. The only restriction placed on values is that their size
  18627. // must be less than or equal to 262144 bytes (256 KiB).
  18628. Value string `json:"value,omitempty"`
  18629. // ForceSendFields is a list of field names (e.g. "Key") to
  18630. // unconditionally include in API requests. By default, fields with
  18631. // empty values are omitted from API requests. However, any non-pointer,
  18632. // non-interface field appearing in ForceSendFields will be sent to the
  18633. // server regardless of whether the field is empty or not. This may be
  18634. // used to include empty fields in Patch requests.
  18635. ForceSendFields []string `json:"-"`
  18636. // NullFields is a list of field names (e.g. "Key") to include in API
  18637. // requests with the JSON null value. By default, fields with empty
  18638. // values are omitted from API requests. However, any field with an
  18639. // empty value appearing in NullFields will be sent to the server as
  18640. // null. It is an error if a field in this list has a non-empty value.
  18641. // This may be used to include null fields in Patch requests.
  18642. NullFields []string `json:"-"`
  18643. }
  18644. func (s *ManagedInstanceOverrideMetadata) MarshalJSON() ([]byte, error) {
  18645. type NoMethod ManagedInstanceOverrideMetadata
  18646. raw := NoMethod(*s)
  18647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18648. }
  18649. type ManagedInstanceOverrideDiskOverride struct {
  18650. // DeviceName: The name of the device on the VM
  18651. DeviceName string `json:"deviceName,omitempty"`
  18652. // Mode: The mode in which to attach this disk, either READ_WRITE or
  18653. // READ_ONLY. If not specified, the default is to attach the disk in
  18654. // READ_WRITE mode.
  18655. //
  18656. // Possible values:
  18657. // "READ_ONLY"
  18658. // "READ_WRITE"
  18659. Mode string `json:"mode,omitempty"`
  18660. // Source: The disk that is/will be mounted
  18661. Source string `json:"source,omitempty"`
  18662. // ForceSendFields is a list of field names (e.g. "DeviceName") to
  18663. // unconditionally include in API requests. By default, fields with
  18664. // empty values are omitted from API requests. However, any non-pointer,
  18665. // non-interface field appearing in ForceSendFields will be sent to the
  18666. // server regardless of whether the field is empty or not. This may be
  18667. // used to include empty fields in Patch requests.
  18668. ForceSendFields []string `json:"-"`
  18669. // NullFields is a list of field names (e.g. "DeviceName") to include in
  18670. // API requests with the JSON null value. By default, fields with empty
  18671. // values are omitted from API requests. However, any field with an
  18672. // empty value appearing in NullFields will be sent to the server as
  18673. // null. It is an error if a field in this list has a non-empty value.
  18674. // This may be used to include null fields in Patch requests.
  18675. NullFields []string `json:"-"`
  18676. }
  18677. func (s *ManagedInstanceOverrideDiskOverride) MarshalJSON() ([]byte, error) {
  18678. type NoMethod ManagedInstanceOverrideDiskOverride
  18679. raw := NoMethod(*s)
  18680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18681. }
  18682. type ManagedInstanceVersion struct {
  18683. // InstanceTemplate: [Output Only] The intended template of the
  18684. // instance. This field is empty when current_action is one of {
  18685. // DELETING, ABANDONING }.
  18686. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  18687. // Name: [Output Only] Name of the version.
  18688. Name string `json:"name,omitempty"`
  18689. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  18690. // unconditionally include in API requests. By default, fields with
  18691. // empty values are omitted from API requests. However, any non-pointer,
  18692. // non-interface field appearing in ForceSendFields will be sent to the
  18693. // server regardless of whether the field is empty or not. This may be
  18694. // used to include empty fields in Patch requests.
  18695. ForceSendFields []string `json:"-"`
  18696. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  18697. // include in API requests with the JSON null value. By default, fields
  18698. // with empty values are omitted from API requests. However, any field
  18699. // with an empty value appearing in NullFields will be sent to the
  18700. // server as null. It is an error if a field in this list has a
  18701. // non-empty value. This may be used to include null fields in Patch
  18702. // requests.
  18703. NullFields []string `json:"-"`
  18704. }
  18705. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  18706. type NoMethod ManagedInstanceVersion
  18707. raw := NoMethod(*s)
  18708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18709. }
  18710. // Metadata: A metadata key/value entry.
  18711. type Metadata struct {
  18712. // Fingerprint: Specifies a fingerprint for this request, which is
  18713. // essentially a hash of the metadata's contents and used for optimistic
  18714. // locking. The fingerprint is initially generated by Compute Engine and
  18715. // changes after every request to modify or update metadata. You must
  18716. // always provide an up-to-date fingerprint hash in order to update or
  18717. // change metadata, otherwise the request will fail with error 412
  18718. // conditionNotMet.
  18719. //
  18720. // To see the latest fingerprint, make a get() request to retrieve the
  18721. // resource.
  18722. Fingerprint string `json:"fingerprint,omitempty"`
  18723. // Items: Array of key/value pairs. The total size of all keys and
  18724. // values must be less than 512 KB.
  18725. Items []*MetadataItems `json:"items,omitempty"`
  18726. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  18727. // metadata.
  18728. Kind string `json:"kind,omitempty"`
  18729. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  18730. // unconditionally include in API requests. By default, fields with
  18731. // empty values are omitted from API requests. However, any non-pointer,
  18732. // non-interface field appearing in ForceSendFields will be sent to the
  18733. // server regardless of whether the field is empty or not. This may be
  18734. // used to include empty fields in Patch requests.
  18735. ForceSendFields []string `json:"-"`
  18736. // NullFields is a list of field names (e.g. "Fingerprint") to include
  18737. // in API requests with the JSON null value. By default, fields with
  18738. // empty values are omitted from API requests. However, any field with
  18739. // an empty value appearing in NullFields will be sent to the server as
  18740. // null. It is an error if a field in this list has a non-empty value.
  18741. // This may be used to include null fields in Patch requests.
  18742. NullFields []string `json:"-"`
  18743. }
  18744. func (s *Metadata) MarshalJSON() ([]byte, error) {
  18745. type NoMethod Metadata
  18746. raw := NoMethod(*s)
  18747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18748. }
  18749. type MetadataItems struct {
  18750. // Key: Key for the metadata entry. Keys must conform to the following
  18751. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  18752. // reflected as part of a URL in the metadata server. Additionally, to
  18753. // avoid ambiguity, keys must not conflict with any other metadata keys
  18754. // for the project.
  18755. Key string `json:"key,omitempty"`
  18756. // Value: Value for the metadata entry. These are free-form strings, and
  18757. // only have meaning as interpreted by the image running in the
  18758. // instance. The only restriction placed on values is that their size
  18759. // must be less than or equal to 262144 bytes (256 KiB).
  18760. Value string `json:"value,omitempty"`
  18761. // ForceSendFields is a list of field names (e.g. "Key") to
  18762. // unconditionally include in API requests. By default, fields with
  18763. // empty values are omitted from API requests. However, any non-pointer,
  18764. // non-interface field appearing in ForceSendFields will be sent to the
  18765. // server regardless of whether the field is empty or not. This may be
  18766. // used to include empty fields in Patch requests.
  18767. ForceSendFields []string `json:"-"`
  18768. // NullFields is a list of field names (e.g. "Key") to include in API
  18769. // requests with the JSON null value. By default, fields with empty
  18770. // values are omitted from API requests. However, any field with an
  18771. // empty value appearing in NullFields will be sent to the server as
  18772. // null. It is an error if a field in this list has a non-empty value.
  18773. // This may be used to include null fields in Patch requests.
  18774. NullFields []string `json:"-"`
  18775. }
  18776. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  18777. type NoMethod MetadataItems
  18778. raw := NoMethod(*s)
  18779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18780. }
  18781. // MetadataCredentialsFromPlugin: Custom authenticator credentials.
  18782. type MetadataCredentialsFromPlugin struct {
  18783. // Name: Plugin name.
  18784. Name string `json:"name,omitempty"`
  18785. // StructConfig: A text proto that conforms to a Struct type definition
  18786. // interpreted by the plugin.
  18787. StructConfig string `json:"structConfig,omitempty"`
  18788. // ForceSendFields is a list of field names (e.g. "Name") to
  18789. // unconditionally include in API requests. By default, fields with
  18790. // empty values are omitted from API requests. However, any non-pointer,
  18791. // non-interface field appearing in ForceSendFields will be sent to the
  18792. // server regardless of whether the field is empty or not. This may be
  18793. // used to include empty fields in Patch requests.
  18794. ForceSendFields []string `json:"-"`
  18795. // NullFields is a list of field names (e.g. "Name") to include in API
  18796. // requests with the JSON null value. By default, fields with empty
  18797. // values are omitted from API requests. However, any field with an
  18798. // empty value appearing in NullFields will be sent to the server as
  18799. // null. It is an error if a field in this list has a non-empty value.
  18800. // This may be used to include null fields in Patch requests.
  18801. NullFields []string `json:"-"`
  18802. }
  18803. func (s *MetadataCredentialsFromPlugin) MarshalJSON() ([]byte, error) {
  18804. type NoMethod MetadataCredentialsFromPlugin
  18805. raw := NoMethod(*s)
  18806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18807. }
  18808. // MetadataFilter: Opaque filter criteria used by loadbalancers to
  18809. // restrict routing configuration to a limited set of loadbalancing
  18810. // proxies. Proxies and sidecars involved in loadbalancing would
  18811. // typically present metadata to the loadbalancers which need to match
  18812. // criteria specified here. If a match takes place, the relevant routing
  18813. // configuration is made available to those proxies.
  18814. // For each metadataFilter in this list, if its filterMatchCriteria is
  18815. // set to MATCH_ANY, at least one of the filterLabels must match the
  18816. // corresponding label provided in the metadata. If its
  18817. // filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels
  18818. // must match with corresponding labels in the provided metadata.
  18819. // An example for using metadataFilters would be: if loadbalancing
  18820. // involves Envoys, they will only receive routing configuration when
  18821. // values in metadataFilters match values supplied in <a
  18822. // href="https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/core/b
  18823. // ase.proto#envoy-api-msg-core-node" Node metadata of their XDS
  18824. // requests to loadbalancers.
  18825. type MetadataFilter struct {
  18826. // FilterLabels: The list of label value pairs that must match labels in
  18827. // the provided metadata based on filterMatchCriteria
  18828. // This list must not be empty and can have at the most 64 entries.
  18829. FilterLabels []*MetadataFilterLabelMatch `json:"filterLabels,omitempty"`
  18830. // FilterMatchCriteria: Specifies how individual filterLabel matches
  18831. // within the list of filterLabels contribute towards the overall
  18832. // metadataFilter match.
  18833. // Supported values are:
  18834. // - MATCH_ANY: At least one of the filterLabels must have a matching
  18835. // label in the provided metadata.
  18836. // - MATCH_ALL: All filterLabels must have matching labels in the
  18837. // provided metadata.
  18838. //
  18839. // Possible values:
  18840. // "MATCH_ALL"
  18841. // "MATCH_ANY"
  18842. // "NOT_SET"
  18843. FilterMatchCriteria string `json:"filterMatchCriteria,omitempty"`
  18844. // ForceSendFields is a list of field names (e.g. "FilterLabels") to
  18845. // unconditionally include in API requests. By default, fields with
  18846. // empty values are omitted from API requests. However, any non-pointer,
  18847. // non-interface field appearing in ForceSendFields will be sent to the
  18848. // server regardless of whether the field is empty or not. This may be
  18849. // used to include empty fields in Patch requests.
  18850. ForceSendFields []string `json:"-"`
  18851. // NullFields is a list of field names (e.g. "FilterLabels") to include
  18852. // in API requests with the JSON null value. By default, fields with
  18853. // empty values are omitted from API requests. However, any field with
  18854. // an empty value appearing in NullFields will be sent to the server as
  18855. // null. It is an error if a field in this list has a non-empty value.
  18856. // This may be used to include null fields in Patch requests.
  18857. NullFields []string `json:"-"`
  18858. }
  18859. func (s *MetadataFilter) MarshalJSON() ([]byte, error) {
  18860. type NoMethod MetadataFilter
  18861. raw := NoMethod(*s)
  18862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18863. }
  18864. // MetadataFilterLabelMatch: MetadataFilter label name value pairs that
  18865. // are expected to match corresponding labels presented as metadata to
  18866. // the loadbalancer.
  18867. type MetadataFilterLabelMatch struct {
  18868. // Name: Name of metadata label.
  18869. // The name can have a maximum length of 1024 characters and must be at
  18870. // least 1 character long.
  18871. Name string `json:"name,omitempty"`
  18872. // Value: The value of the label must match the specified value.
  18873. // value can have a maximum length of 1024 characters.
  18874. Value string `json:"value,omitempty"`
  18875. // ForceSendFields is a list of field names (e.g. "Name") to
  18876. // unconditionally include in API requests. By default, fields with
  18877. // empty values are omitted from API requests. However, any non-pointer,
  18878. // non-interface field appearing in ForceSendFields will be sent to the
  18879. // server regardless of whether the field is empty or not. This may be
  18880. // used to include empty fields in Patch requests.
  18881. ForceSendFields []string `json:"-"`
  18882. // NullFields is a list of field names (e.g. "Name") to include in API
  18883. // requests with the JSON null value. By default, fields with empty
  18884. // values are omitted from API requests. However, any field with an
  18885. // empty value appearing in NullFields will be sent to the server as
  18886. // null. It is an error if a field in this list has a non-empty value.
  18887. // This may be used to include null fields in Patch requests.
  18888. NullFields []string `json:"-"`
  18889. }
  18890. func (s *MetadataFilterLabelMatch) MarshalJSON() ([]byte, error) {
  18891. type NoMethod MetadataFilterLabelMatch
  18892. raw := NoMethod(*s)
  18893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18894. }
  18895. // MutualTls: Configuration for the mutual Tls mode for peer
  18896. // authentication.
  18897. type MutualTls struct {
  18898. // Mode: Specifies if the server TLS is configured to be strict or
  18899. // permissive. This field can be set to one of the following: STRICT:
  18900. // Client certificate must be presented, connection is in TLS.
  18901. // PERMISSIVE: Client certificate can be omitted, connection can be
  18902. // either plaintext or TLS.
  18903. //
  18904. // Possible values:
  18905. // "INVALID"
  18906. // "PERMISSIVE"
  18907. // "STRICT"
  18908. Mode string `json:"mode,omitempty"`
  18909. // ForceSendFields is a list of field names (e.g. "Mode") to
  18910. // unconditionally include in API requests. By default, fields with
  18911. // empty values are omitted from API requests. However, any non-pointer,
  18912. // non-interface field appearing in ForceSendFields will be sent to the
  18913. // server regardless of whether the field is empty or not. This may be
  18914. // used to include empty fields in Patch requests.
  18915. ForceSendFields []string `json:"-"`
  18916. // NullFields is a list of field names (e.g. "Mode") to include in API
  18917. // requests with the JSON null value. By default, fields with empty
  18918. // values are omitted from API requests. However, any field with an
  18919. // empty value appearing in NullFields will be sent to the server as
  18920. // null. It is an error if a field in this list has a non-empty value.
  18921. // This may be used to include null fields in Patch requests.
  18922. NullFields []string `json:"-"`
  18923. }
  18924. func (s *MutualTls) MarshalJSON() ([]byte, error) {
  18925. type NoMethod MutualTls
  18926. raw := NoMethod(*s)
  18927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18928. }
  18929. // NamedPort: The named port. For example: .
  18930. type NamedPort struct {
  18931. // Name: The name for this named port. The name must be 1-63 characters
  18932. // long, and comply with RFC1035.
  18933. Name string `json:"name,omitempty"`
  18934. // Port: The port number, which can be a value between 1 and 65535.
  18935. Port int64 `json:"port,omitempty"`
  18936. // ForceSendFields is a list of field names (e.g. "Name") to
  18937. // unconditionally include in API requests. By default, fields with
  18938. // empty values are omitted from API requests. However, any non-pointer,
  18939. // non-interface field appearing in ForceSendFields will be sent to the
  18940. // server regardless of whether the field is empty or not. This may be
  18941. // used to include empty fields in Patch requests.
  18942. ForceSendFields []string `json:"-"`
  18943. // NullFields is a list of field names (e.g. "Name") to include in API
  18944. // requests with the JSON null value. By default, fields with empty
  18945. // values are omitted from API requests. However, any field with an
  18946. // empty value appearing in NullFields will be sent to the server as
  18947. // null. It is an error if a field in this list has a non-empty value.
  18948. // This may be used to include null fields in Patch requests.
  18949. NullFields []string `json:"-"`
  18950. }
  18951. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  18952. type NoMethod NamedPort
  18953. raw := NoMethod(*s)
  18954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18955. }
  18956. // Network: Represents a Network resource. Read Virtual Private Cloud
  18957. // (VPC) Network Overview for more information. (== resource_for
  18958. // v1.networks ==) (== resource_for beta.networks ==)
  18959. type Network struct {
  18960. // IPv4Range: Deprecated in favor of subnet mode networks. The range of
  18961. // internal addresses that are legal on this network. This range is a
  18962. // CIDR specification, for example: 192.168.0.0/16. Provided by the
  18963. // client when the network is created.
  18964. IPv4Range string `json:"IPv4Range,omitempty"`
  18965. // AutoCreateSubnetworks: When set to true, the VPC network is created
  18966. // in "auto" mode. When set to false, the VPC network is created in
  18967. // "custom" mode.
  18968. //
  18969. // An auto mode VPC network starts with one subnet per region. Each
  18970. // subnet has a predetermined range as described in Auto mode VPC
  18971. // network IP ranges.
  18972. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  18973. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18974. // format.
  18975. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18976. // CrossVmEncryption: [Output Only] Type of VM-to-VM traffic encryption
  18977. // for this network.
  18978. //
  18979. // Possible values:
  18980. // "ENCRYPTED"
  18981. // "UNENCRYPTED"
  18982. CrossVmEncryption string `json:"crossVmEncryption,omitempty"`
  18983. // Description: An optional description of this resource. Provide this
  18984. // property when you create the resource.
  18985. Description string `json:"description,omitempty"`
  18986. // GatewayIPv4: [Output Only] The gateway address for default routing
  18987. // out of the network. This value is read only and is selected by GCP.
  18988. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  18989. // Id: [Output Only] The unique identifier for the resource. This
  18990. // identifier is defined by the server.
  18991. Id uint64 `json:"id,omitempty,string"`
  18992. // Kind: [Output Only] Type of the resource. Always compute#network for
  18993. // networks.
  18994. Kind string `json:"kind,omitempty"`
  18995. // LoadBalancerVmEncryption: [Output Only] Type of LB-to-VM traffic
  18996. // encryption for this network.
  18997. //
  18998. // Possible values:
  18999. // "ENCRYPTED"
  19000. // "UNENCRYPTED"
  19001. LoadBalancerVmEncryption string `json:"loadBalancerVmEncryption,omitempty"`
  19002. // Name: Name of the resource. Provided by the client when the resource
  19003. // is created. The name must be 1-63 characters long, and comply with
  19004. // RFC1035. Specifically, the name must be 1-63 characters long and
  19005. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19006. // the first character must be a lowercase letter, and all following
  19007. // characters must be a dash, lowercase letter, or digit, except the
  19008. // last character, which cannot be a dash.
  19009. Name string `json:"name,omitempty"`
  19010. // Peerings: [Output Only] A list of network peerings for the resource.
  19011. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  19012. // RoutingConfig: The network-level routing configuration for this
  19013. // network. Used by Cloud Router to determine what type of network-wide
  19014. // routing behavior to enforce.
  19015. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  19016. // SelfLink: [Output Only] Server-defined URL for the resource.
  19017. SelfLink string `json:"selfLink,omitempty"`
  19018. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  19019. // with the resource id.
  19020. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  19021. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  19022. // all subnetworks in this VPC network.
  19023. Subnetworks []string `json:"subnetworks,omitempty"`
  19024. // ServerResponse contains the HTTP response code and headers from the
  19025. // server.
  19026. googleapi.ServerResponse `json:"-"`
  19027. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  19028. // unconditionally include in API requests. By default, fields with
  19029. // empty values are omitted from API requests. However, any non-pointer,
  19030. // non-interface field appearing in ForceSendFields will be sent to the
  19031. // server regardless of whether the field is empty or not. This may be
  19032. // used to include empty fields in Patch requests.
  19033. ForceSendFields []string `json:"-"`
  19034. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  19035. // API requests with the JSON null value. By default, fields with empty
  19036. // values are omitted from API requests. However, any field with an
  19037. // empty value appearing in NullFields will be sent to the server as
  19038. // null. It is an error if a field in this list has a non-empty value.
  19039. // This may be used to include null fields in Patch requests.
  19040. NullFields []string `json:"-"`
  19041. }
  19042. func (s *Network) MarshalJSON() ([]byte, error) {
  19043. type NoMethod Network
  19044. raw := NoMethod(*s)
  19045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19046. }
  19047. // NetworkEndpoint: The network endpoint.
  19048. type NetworkEndpoint struct {
  19049. // Annotations: Metadata defined as annotations on the network endpoint.
  19050. Annotations map[string]string `json:"annotations,omitempty"`
  19051. // Instance: The name for a specific VM instance that the IP address
  19052. // belongs to. This is required for network endpoints of type
  19053. // GCE_VM_IP_PORT. The instance must be in the same zone of network
  19054. // endpoint group.
  19055. //
  19056. // The name must be 1-63 characters long, and comply with RFC1035.
  19057. Instance string `json:"instance,omitempty"`
  19058. // IpAddress: Optional IPv4 address of network endpoint. The IP address
  19059. // must belong to a VM in GCE (either the primary IP or as part of an
  19060. // aliased IP range). If the IP address is not specified, then the
  19061. // primary IP address for the VM instance in the network that the
  19062. // network endpoint group belongs to will be used.
  19063. IpAddress string `json:"ipAddress,omitempty"`
  19064. // Port: Optional port number of network endpoint. If not specified and
  19065. // the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the
  19066. // defaultPort for the network endpoint group will be used.
  19067. Port int64 `json:"port,omitempty"`
  19068. // ForceSendFields is a list of field names (e.g. "Annotations") to
  19069. // unconditionally include in API requests. By default, fields with
  19070. // empty values are omitted from API requests. However, any non-pointer,
  19071. // non-interface field appearing in ForceSendFields will be sent to the
  19072. // server regardless of whether the field is empty or not. This may be
  19073. // used to include empty fields in Patch requests.
  19074. ForceSendFields []string `json:"-"`
  19075. // NullFields is a list of field names (e.g. "Annotations") to include
  19076. // in API requests with the JSON null value. By default, fields with
  19077. // empty values are omitted from API requests. However, any field with
  19078. // an empty value appearing in NullFields will be sent to the server as
  19079. // null. It is an error if a field in this list has a non-empty value.
  19080. // This may be used to include null fields in Patch requests.
  19081. NullFields []string `json:"-"`
  19082. }
  19083. func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  19084. type NoMethod NetworkEndpoint
  19085. raw := NoMethod(*s)
  19086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19087. }
  19088. // NetworkEndpointGroup: Represents a collection of network endpoints.
  19089. type NetworkEndpointGroup struct {
  19090. // Annotations: Metadata defined as annotations on the network endpoint
  19091. // group.
  19092. Annotations map[string]string `json:"annotations,omitempty"`
  19093. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19094. // format.
  19095. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19096. // DefaultPort: The default port used if the port number is not
  19097. // specified in the network endpoint.
  19098. DefaultPort int64 `json:"defaultPort,omitempty"`
  19099. // Description: An optional description of this resource. Provide this
  19100. // property when you create the resource.
  19101. Description string `json:"description,omitempty"`
  19102. // Id: [Output Only] The unique identifier for the resource. This
  19103. // identifier is defined by the server.
  19104. Id uint64 `json:"id,omitempty,string"`
  19105. // Kind: [Output Only] Type of the resource. Always
  19106. // compute#networkEndpointGroup for network endpoint group.
  19107. Kind string `json:"kind,omitempty"`
  19108. // LoadBalancer: This field is only valid when the network endpoint
  19109. // group is used for load balancing. [Deprecated] This field is
  19110. // deprecated.
  19111. LoadBalancer *NetworkEndpointGroupLbNetworkEndpointGroup `json:"loadBalancer,omitempty"`
  19112. // Name: Name of the resource; provided by the client when the resource
  19113. // is created. The name must be 1-63 characters long, and comply with
  19114. // RFC1035. Specifically, the name must be 1-63 characters long and
  19115. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19116. // the first character must be a lowercase letter, and all following
  19117. // characters must be a dash, lowercase letter, or digit, except the
  19118. // last character, which cannot be a dash.
  19119. Name string `json:"name,omitempty"`
  19120. // Network: The URL of the network to which all network endpoints in the
  19121. // NEG belong. Uses "default" project network if unspecified.
  19122. Network string `json:"network,omitempty"`
  19123. // NetworkEndpointType: Type of network endpoints in this network
  19124. // endpoint group. Currently the only supported value is GCE_VM_IP_PORT.
  19125. //
  19126. // Possible values:
  19127. // "GCE_VM_IP_PORT"
  19128. // "NON_GCP_PRIVATE_IP_PORT"
  19129. NetworkEndpointType string `json:"networkEndpointType,omitempty"`
  19130. // SelfLink: [Output Only] Server-defined URL for the resource.
  19131. SelfLink string `json:"selfLink,omitempty"`
  19132. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  19133. // with the resource id.
  19134. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  19135. // Size: [Output only] Number of network endpoints in the network
  19136. // endpoint group.
  19137. Size int64 `json:"size,omitempty"`
  19138. // Subnetwork: Optional URL of the subnetwork to which all network
  19139. // endpoints in the NEG belong.
  19140. Subnetwork string `json:"subnetwork,omitempty"`
  19141. // Type: Specify the type of this network endpoint group. Only
  19142. // LOAD_BALANCING is valid for now.
  19143. //
  19144. // Possible values:
  19145. // "LOAD_BALANCING"
  19146. Type string `json:"type,omitempty"`
  19147. // Zone: [Output Only] The URL of the zone where the network endpoint
  19148. // group is located.
  19149. Zone string `json:"zone,omitempty"`
  19150. // ServerResponse contains the HTTP response code and headers from the
  19151. // server.
  19152. googleapi.ServerResponse `json:"-"`
  19153. // ForceSendFields is a list of field names (e.g. "Annotations") to
  19154. // unconditionally include in API requests. By default, fields with
  19155. // empty values are omitted from API requests. However, any non-pointer,
  19156. // non-interface field appearing in ForceSendFields will be sent to the
  19157. // server regardless of whether the field is empty or not. This may be
  19158. // used to include empty fields in Patch requests.
  19159. ForceSendFields []string `json:"-"`
  19160. // NullFields is a list of field names (e.g. "Annotations") to include
  19161. // in API requests with the JSON null value. By default, fields with
  19162. // empty values are omitted from API requests. However, any field with
  19163. // an empty value appearing in NullFields will be sent to the server as
  19164. // null. It is an error if a field in this list has a non-empty value.
  19165. // This may be used to include null fields in Patch requests.
  19166. NullFields []string `json:"-"`
  19167. }
  19168. func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  19169. type NoMethod NetworkEndpointGroup
  19170. raw := NoMethod(*s)
  19171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19172. }
  19173. type NetworkEndpointGroupAggregatedList struct {
  19174. // Id: [Output Only] Unique identifier for the resource; defined by the
  19175. // server.
  19176. Id string `json:"id,omitempty"`
  19177. // Items: A list of NetworkEndpointGroupsScopedList resources.
  19178. Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
  19179. // Kind: [Output Only] The resource type, which is always
  19180. // compute#networkEndpointGroupAggregatedList for aggregated lists of
  19181. // network endpoint groups.
  19182. Kind string `json:"kind,omitempty"`
  19183. // NextPageToken: [Output Only] This token allows you to get the next
  19184. // page of results for list requests. If the number of results is larger
  19185. // than maxResults, use the nextPageToken as a value for the query
  19186. // parameter pageToken in the next list request. Subsequent list
  19187. // requests will have their own nextPageToken to continue paging through
  19188. // the results.
  19189. NextPageToken string `json:"nextPageToken,omitempty"`
  19190. // SelfLink: [Output Only] Server-defined URL for this resource.
  19191. SelfLink string `json:"selfLink,omitempty"`
  19192. // Warning: [Output Only] Informational warning message.
  19193. Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
  19194. // ServerResponse contains the HTTP response code and headers from the
  19195. // server.
  19196. googleapi.ServerResponse `json:"-"`
  19197. // ForceSendFields is a list of field names (e.g. "Id") to
  19198. // unconditionally include in API requests. By default, fields with
  19199. // empty values are omitted from API requests. However, any non-pointer,
  19200. // non-interface field appearing in ForceSendFields will be sent to the
  19201. // server regardless of whether the field is empty or not. This may be
  19202. // used to include empty fields in Patch requests.
  19203. ForceSendFields []string `json:"-"`
  19204. // NullFields is a list of field names (e.g. "Id") to include in API
  19205. // requests with the JSON null value. By default, fields with empty
  19206. // values are omitted from API requests. However, any field with an
  19207. // empty value appearing in NullFields will be sent to the server as
  19208. // null. It is an error if a field in this list has a non-empty value.
  19209. // This may be used to include null fields in Patch requests.
  19210. NullFields []string `json:"-"`
  19211. }
  19212. func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
  19213. type NoMethod NetworkEndpointGroupAggregatedList
  19214. raw := NoMethod(*s)
  19215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19216. }
  19217. // NetworkEndpointGroupAggregatedListWarning: [Output Only]
  19218. // Informational warning message.
  19219. type NetworkEndpointGroupAggregatedListWarning struct {
  19220. // Code: [Output Only] A warning code, if applicable. For example,
  19221. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19222. // the response.
  19223. //
  19224. // Possible values:
  19225. // "CLEANUP_FAILED"
  19226. // "DEPRECATED_RESOURCE_USED"
  19227. // "DEPRECATED_TYPE_USED"
  19228. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19229. // "EXPERIMENTAL_TYPE_USED"
  19230. // "EXTERNAL_API_WARNING"
  19231. // "FIELD_VALUE_OVERRIDEN"
  19232. // "INJECTED_KERNELS_DEPRECATED"
  19233. // "MISSING_TYPE_DEPENDENCY"
  19234. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19235. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19236. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19237. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19238. // "NEXT_HOP_NOT_RUNNING"
  19239. // "NOT_CRITICAL_ERROR"
  19240. // "NO_RESULTS_ON_PAGE"
  19241. // "REQUIRED_TOS_AGREEMENT"
  19242. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19243. // "RESOURCE_NOT_DELETED"
  19244. // "SCHEMA_VALIDATION_IGNORED"
  19245. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19246. // "UNDECLARED_PROPERTIES"
  19247. // "UNREACHABLE"
  19248. Code string `json:"code,omitempty"`
  19249. // Data: [Output Only] Metadata about this warning in key: value format.
  19250. // For example:
  19251. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19252. Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
  19253. // Message: [Output Only] A human-readable description of the warning
  19254. // code.
  19255. Message string `json:"message,omitempty"`
  19256. // ForceSendFields is a list of field names (e.g. "Code") to
  19257. // unconditionally include in API requests. By default, fields with
  19258. // empty values are omitted from API requests. However, any non-pointer,
  19259. // non-interface field appearing in ForceSendFields will be sent to the
  19260. // server regardless of whether the field is empty or not. This may be
  19261. // used to include empty fields in Patch requests.
  19262. ForceSendFields []string `json:"-"`
  19263. // NullFields is a list of field names (e.g. "Code") to include in API
  19264. // requests with the JSON null value. By default, fields with empty
  19265. // values are omitted from API requests. However, any field with an
  19266. // empty value appearing in NullFields will be sent to the server as
  19267. // null. It is an error if a field in this list has a non-empty value.
  19268. // This may be used to include null fields in Patch requests.
  19269. NullFields []string `json:"-"`
  19270. }
  19271. func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  19272. type NoMethod NetworkEndpointGroupAggregatedListWarning
  19273. raw := NoMethod(*s)
  19274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19275. }
  19276. type NetworkEndpointGroupAggregatedListWarningData struct {
  19277. // Key: [Output Only] A key that provides more detail on the warning
  19278. // being returned. For example, for warnings where there are no results
  19279. // in a list request for a particular zone, this key might be scope and
  19280. // the key value might be the zone name. Other examples might be a key
  19281. // indicating a deprecated resource and a suggested replacement, or a
  19282. // warning about invalid network settings (for example, if an instance
  19283. // attempts to perform IP forwarding but is not enabled for IP
  19284. // forwarding).
  19285. Key string `json:"key,omitempty"`
  19286. // Value: [Output Only] A warning data value corresponding to the key.
  19287. Value string `json:"value,omitempty"`
  19288. // ForceSendFields is a list of field names (e.g. "Key") to
  19289. // unconditionally include in API requests. By default, fields with
  19290. // empty values are omitted from API requests. However, any non-pointer,
  19291. // non-interface field appearing in ForceSendFields will be sent to the
  19292. // server regardless of whether the field is empty or not. This may be
  19293. // used to include empty fields in Patch requests.
  19294. ForceSendFields []string `json:"-"`
  19295. // NullFields is a list of field names (e.g. "Key") to include in API
  19296. // requests with the JSON null value. By default, fields with empty
  19297. // values are omitted from API requests. However, any field with an
  19298. // empty value appearing in NullFields will be sent to the server as
  19299. // null. It is an error if a field in this list has a non-empty value.
  19300. // This may be used to include null fields in Patch requests.
  19301. NullFields []string `json:"-"`
  19302. }
  19303. func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  19304. type NoMethod NetworkEndpointGroupAggregatedListWarningData
  19305. raw := NoMethod(*s)
  19306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19307. }
  19308. // NetworkEndpointGroupLbNetworkEndpointGroup: Load balancing specific
  19309. // fields for network endpoint group.
  19310. type NetworkEndpointGroupLbNetworkEndpointGroup struct {
  19311. // DefaultPort: The default port used if the port number is not
  19312. // specified in the network endpoint. [Deprecated] This field is
  19313. // deprecated.
  19314. DefaultPort int64 `json:"defaultPort,omitempty"`
  19315. // Network: The URL of the network to which all network endpoints in the
  19316. // NEG belong. Uses "default" project network if unspecified.
  19317. // [Deprecated] This field is deprecated.
  19318. Network string `json:"network,omitempty"`
  19319. // Subnetwork: Optional URL of the subnetwork to which all network
  19320. // endpoints in the NEG belong. [Deprecated] This field is deprecated.
  19321. Subnetwork string `json:"subnetwork,omitempty"`
  19322. // Zone: [Output Only] The URL of the zone where the network endpoint
  19323. // group is located. [Deprecated] This field is deprecated.
  19324. Zone string `json:"zone,omitempty"`
  19325. // ForceSendFields is a list of field names (e.g. "DefaultPort") to
  19326. // unconditionally include in API requests. By default, fields with
  19327. // empty values are omitted from API requests. However, any non-pointer,
  19328. // non-interface field appearing in ForceSendFields will be sent to the
  19329. // server regardless of whether the field is empty or not. This may be
  19330. // used to include empty fields in Patch requests.
  19331. ForceSendFields []string `json:"-"`
  19332. // NullFields is a list of field names (e.g. "DefaultPort") to include
  19333. // in API requests with the JSON null value. By default, fields with
  19334. // empty values are omitted from API requests. However, any field with
  19335. // an empty value appearing in NullFields will be sent to the server as
  19336. // null. It is an error if a field in this list has a non-empty value.
  19337. // This may be used to include null fields in Patch requests.
  19338. NullFields []string `json:"-"`
  19339. }
  19340. func (s *NetworkEndpointGroupLbNetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  19341. type NoMethod NetworkEndpointGroupLbNetworkEndpointGroup
  19342. raw := NoMethod(*s)
  19343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19344. }
  19345. type NetworkEndpointGroupList struct {
  19346. // Id: [Output Only] Unique identifier for the resource; defined by the
  19347. // server.
  19348. Id string `json:"id,omitempty"`
  19349. // Items: A list of NetworkEndpointGroup resources.
  19350. Items []*NetworkEndpointGroup `json:"items,omitempty"`
  19351. // Kind: [Output Only] The resource type, which is always
  19352. // compute#networkEndpointGroupList for network endpoint group lists.
  19353. Kind string `json:"kind,omitempty"`
  19354. // NextPageToken: [Output Only] This token allows you to get the next
  19355. // page of results for list requests. If the number of results is larger
  19356. // than maxResults, use the nextPageToken as a value for the query
  19357. // parameter pageToken in the next list request. Subsequent list
  19358. // requests will have their own nextPageToken to continue paging through
  19359. // the results.
  19360. NextPageToken string `json:"nextPageToken,omitempty"`
  19361. // SelfLink: [Output Only] Server-defined URL for this resource.
  19362. SelfLink string `json:"selfLink,omitempty"`
  19363. // Warning: [Output Only] Informational warning message.
  19364. Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
  19365. // ServerResponse contains the HTTP response code and headers from the
  19366. // server.
  19367. googleapi.ServerResponse `json:"-"`
  19368. // ForceSendFields is a list of field names (e.g. "Id") to
  19369. // unconditionally include in API requests. By default, fields with
  19370. // empty values are omitted from API requests. However, any non-pointer,
  19371. // non-interface field appearing in ForceSendFields will be sent to the
  19372. // server regardless of whether the field is empty or not. This may be
  19373. // used to include empty fields in Patch requests.
  19374. ForceSendFields []string `json:"-"`
  19375. // NullFields is a list of field names (e.g. "Id") to include in API
  19376. // requests with the JSON null value. By default, fields with empty
  19377. // values are omitted from API requests. However, any field with an
  19378. // empty value appearing in NullFields will be sent to the server as
  19379. // null. It is an error if a field in this list has a non-empty value.
  19380. // This may be used to include null fields in Patch requests.
  19381. NullFields []string `json:"-"`
  19382. }
  19383. func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
  19384. type NoMethod NetworkEndpointGroupList
  19385. raw := NoMethod(*s)
  19386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19387. }
  19388. // NetworkEndpointGroupListWarning: [Output Only] Informational warning
  19389. // message.
  19390. type NetworkEndpointGroupListWarning struct {
  19391. // Code: [Output Only] A warning code, if applicable. For example,
  19392. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19393. // the response.
  19394. //
  19395. // Possible values:
  19396. // "CLEANUP_FAILED"
  19397. // "DEPRECATED_RESOURCE_USED"
  19398. // "DEPRECATED_TYPE_USED"
  19399. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19400. // "EXPERIMENTAL_TYPE_USED"
  19401. // "EXTERNAL_API_WARNING"
  19402. // "FIELD_VALUE_OVERRIDEN"
  19403. // "INJECTED_KERNELS_DEPRECATED"
  19404. // "MISSING_TYPE_DEPENDENCY"
  19405. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19406. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19407. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19408. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19409. // "NEXT_HOP_NOT_RUNNING"
  19410. // "NOT_CRITICAL_ERROR"
  19411. // "NO_RESULTS_ON_PAGE"
  19412. // "REQUIRED_TOS_AGREEMENT"
  19413. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19414. // "RESOURCE_NOT_DELETED"
  19415. // "SCHEMA_VALIDATION_IGNORED"
  19416. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19417. // "UNDECLARED_PROPERTIES"
  19418. // "UNREACHABLE"
  19419. Code string `json:"code,omitempty"`
  19420. // Data: [Output Only] Metadata about this warning in key: value format.
  19421. // For example:
  19422. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19423. Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
  19424. // Message: [Output Only] A human-readable description of the warning
  19425. // code.
  19426. Message string `json:"message,omitempty"`
  19427. // ForceSendFields is a list of field names (e.g. "Code") to
  19428. // unconditionally include in API requests. By default, fields with
  19429. // empty values are omitted from API requests. However, any non-pointer,
  19430. // non-interface field appearing in ForceSendFields will be sent to the
  19431. // server regardless of whether the field is empty or not. This may be
  19432. // used to include empty fields in Patch requests.
  19433. ForceSendFields []string `json:"-"`
  19434. // NullFields is a list of field names (e.g. "Code") to include in API
  19435. // requests with the JSON null value. By default, fields with empty
  19436. // values are omitted from API requests. However, any field with an
  19437. // empty value appearing in NullFields will be sent to the server as
  19438. // null. It is an error if a field in this list has a non-empty value.
  19439. // This may be used to include null fields in Patch requests.
  19440. NullFields []string `json:"-"`
  19441. }
  19442. func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
  19443. type NoMethod NetworkEndpointGroupListWarning
  19444. raw := NoMethod(*s)
  19445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19446. }
  19447. type NetworkEndpointGroupListWarningData struct {
  19448. // Key: [Output Only] A key that provides more detail on the warning
  19449. // being returned. For example, for warnings where there are no results
  19450. // in a list request for a particular zone, this key might be scope and
  19451. // the key value might be the zone name. Other examples might be a key
  19452. // indicating a deprecated resource and a suggested replacement, or a
  19453. // warning about invalid network settings (for example, if an instance
  19454. // attempts to perform IP forwarding but is not enabled for IP
  19455. // forwarding).
  19456. Key string `json:"key,omitempty"`
  19457. // Value: [Output Only] A warning data value corresponding to the key.
  19458. Value string `json:"value,omitempty"`
  19459. // ForceSendFields is a list of field names (e.g. "Key") to
  19460. // unconditionally include in API requests. By default, fields with
  19461. // empty values are omitted from API requests. However, any non-pointer,
  19462. // non-interface field appearing in ForceSendFields will be sent to the
  19463. // server regardless of whether the field is empty or not. This may be
  19464. // used to include empty fields in Patch requests.
  19465. ForceSendFields []string `json:"-"`
  19466. // NullFields is a list of field names (e.g. "Key") to include in API
  19467. // requests with the JSON null value. By default, fields with empty
  19468. // values are omitted from API requests. However, any field with an
  19469. // empty value appearing in NullFields will be sent to the server as
  19470. // null. It is an error if a field in this list has a non-empty value.
  19471. // This may be used to include null fields in Patch requests.
  19472. NullFields []string `json:"-"`
  19473. }
  19474. func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
  19475. type NoMethod NetworkEndpointGroupListWarningData
  19476. raw := NoMethod(*s)
  19477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19478. }
  19479. type NetworkEndpointGroupsAttachEndpointsRequest struct {
  19480. // NetworkEndpoints: The list of network endpoints to be attached.
  19481. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  19482. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  19483. // unconditionally include in API requests. By default, fields with
  19484. // empty values are omitted from API requests. However, any non-pointer,
  19485. // non-interface field appearing in ForceSendFields will be sent to the
  19486. // server regardless of whether the field is empty or not. This may be
  19487. // used to include empty fields in Patch requests.
  19488. ForceSendFields []string `json:"-"`
  19489. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  19490. // include in API requests with the JSON null value. By default, fields
  19491. // with empty values are omitted from API requests. However, any field
  19492. // with an empty value appearing in NullFields will be sent to the
  19493. // server as null. It is an error if a field in this list has a
  19494. // non-empty value. This may be used to include null fields in Patch
  19495. // requests.
  19496. NullFields []string `json:"-"`
  19497. }
  19498. func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  19499. type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
  19500. raw := NoMethod(*s)
  19501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19502. }
  19503. type NetworkEndpointGroupsDetachEndpointsRequest struct {
  19504. // NetworkEndpoints: The list of network endpoints to be detached.
  19505. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  19506. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  19507. // unconditionally include in API requests. By default, fields with
  19508. // empty values are omitted from API requests. However, any non-pointer,
  19509. // non-interface field appearing in ForceSendFields will be sent to the
  19510. // server regardless of whether the field is empty or not. This may be
  19511. // used to include empty fields in Patch requests.
  19512. ForceSendFields []string `json:"-"`
  19513. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  19514. // include in API requests with the JSON null value. By default, fields
  19515. // with empty values are omitted from API requests. However, any field
  19516. // with an empty value appearing in NullFields will be sent to the
  19517. // server as null. It is an error if a field in this list has a
  19518. // non-empty value. This may be used to include null fields in Patch
  19519. // requests.
  19520. NullFields []string `json:"-"`
  19521. }
  19522. func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  19523. type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
  19524. raw := NoMethod(*s)
  19525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19526. }
  19527. type NetworkEndpointGroupsListEndpointsRequest struct {
  19528. // HealthStatus: Optional query parameter for showing the health status
  19529. // of each network endpoint. Valid options are SKIP or SHOW. If you
  19530. // don't specifiy this parameter, the health status of network endpoints
  19531. // will not be provided.
  19532. //
  19533. // Possible values:
  19534. // "SHOW"
  19535. // "SKIP"
  19536. HealthStatus string `json:"healthStatus,omitempty"`
  19537. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  19538. // unconditionally include in API requests. By default, fields with
  19539. // empty values are omitted from API requests. However, any non-pointer,
  19540. // non-interface field appearing in ForceSendFields will be sent to the
  19541. // server regardless of whether the field is empty or not. This may be
  19542. // used to include empty fields in Patch requests.
  19543. ForceSendFields []string `json:"-"`
  19544. // NullFields is a list of field names (e.g. "HealthStatus") to include
  19545. // in API requests with the JSON null value. By default, fields with
  19546. // empty values are omitted from API requests. However, any field with
  19547. // an empty value appearing in NullFields will be sent to the server as
  19548. // null. It is an error if a field in this list has a non-empty value.
  19549. // This may be used to include null fields in Patch requests.
  19550. NullFields []string `json:"-"`
  19551. }
  19552. func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
  19553. type NoMethod NetworkEndpointGroupsListEndpointsRequest
  19554. raw := NoMethod(*s)
  19555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19556. }
  19557. type NetworkEndpointGroupsListNetworkEndpoints struct {
  19558. // Id: [Output Only] Unique identifier for the resource; defined by the
  19559. // server.
  19560. Id string `json:"id,omitempty"`
  19561. // Items: A list of NetworkEndpointWithHealthStatus resources.
  19562. Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
  19563. // Kind: [Output Only] The resource type, which is always
  19564. // compute#networkEndpointGroupsListNetworkEndpoints for the list of
  19565. // network endpoints in the specified network endpoint group.
  19566. Kind string `json:"kind,omitempty"`
  19567. // NextPageToken: [Output Only] This token allows you to get the next
  19568. // page of results for list requests. If the number of results is larger
  19569. // than maxResults, use the nextPageToken as a value for the query
  19570. // parameter pageToken in the next list request. Subsequent list
  19571. // requests will have their own nextPageToken to continue paging through
  19572. // the results.
  19573. NextPageToken string `json:"nextPageToken,omitempty"`
  19574. // Warning: [Output Only] Informational warning message.
  19575. Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
  19576. // ServerResponse contains the HTTP response code and headers from the
  19577. // server.
  19578. googleapi.ServerResponse `json:"-"`
  19579. // ForceSendFields is a list of field names (e.g. "Id") to
  19580. // unconditionally include in API requests. By default, fields with
  19581. // empty values are omitted from API requests. However, any non-pointer,
  19582. // non-interface field appearing in ForceSendFields will be sent to the
  19583. // server regardless of whether the field is empty or not. This may be
  19584. // used to include empty fields in Patch requests.
  19585. ForceSendFields []string `json:"-"`
  19586. // NullFields is a list of field names (e.g. "Id") to include in API
  19587. // requests with the JSON null value. By default, fields with empty
  19588. // values are omitted from API requests. However, any field with an
  19589. // empty value appearing in NullFields will be sent to the server as
  19590. // null. It is an error if a field in this list has a non-empty value.
  19591. // This may be used to include null fields in Patch requests.
  19592. NullFields []string `json:"-"`
  19593. }
  19594. func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
  19595. type NoMethod NetworkEndpointGroupsListNetworkEndpoints
  19596. raw := NoMethod(*s)
  19597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19598. }
  19599. // NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
  19600. // Informational warning message.
  19601. type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
  19602. // Code: [Output Only] A warning code, if applicable. For example,
  19603. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19604. // the response.
  19605. //
  19606. // Possible values:
  19607. // "CLEANUP_FAILED"
  19608. // "DEPRECATED_RESOURCE_USED"
  19609. // "DEPRECATED_TYPE_USED"
  19610. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19611. // "EXPERIMENTAL_TYPE_USED"
  19612. // "EXTERNAL_API_WARNING"
  19613. // "FIELD_VALUE_OVERRIDEN"
  19614. // "INJECTED_KERNELS_DEPRECATED"
  19615. // "MISSING_TYPE_DEPENDENCY"
  19616. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19617. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19618. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19619. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19620. // "NEXT_HOP_NOT_RUNNING"
  19621. // "NOT_CRITICAL_ERROR"
  19622. // "NO_RESULTS_ON_PAGE"
  19623. // "REQUIRED_TOS_AGREEMENT"
  19624. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19625. // "RESOURCE_NOT_DELETED"
  19626. // "SCHEMA_VALIDATION_IGNORED"
  19627. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19628. // "UNDECLARED_PROPERTIES"
  19629. // "UNREACHABLE"
  19630. Code string `json:"code,omitempty"`
  19631. // Data: [Output Only] Metadata about this warning in key: value format.
  19632. // For example:
  19633. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19634. Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
  19635. // Message: [Output Only] A human-readable description of the warning
  19636. // code.
  19637. Message string `json:"message,omitempty"`
  19638. // ForceSendFields is a list of field names (e.g. "Code") to
  19639. // unconditionally include in API requests. By default, fields with
  19640. // empty values are omitted from API requests. However, any non-pointer,
  19641. // non-interface field appearing in ForceSendFields will be sent to the
  19642. // server regardless of whether the field is empty or not. This may be
  19643. // used to include empty fields in Patch requests.
  19644. ForceSendFields []string `json:"-"`
  19645. // NullFields is a list of field names (e.g. "Code") to include in API
  19646. // requests with the JSON null value. By default, fields with empty
  19647. // values are omitted from API requests. However, any field with an
  19648. // empty value appearing in NullFields will be sent to the server as
  19649. // null. It is an error if a field in this list has a non-empty value.
  19650. // This may be used to include null fields in Patch requests.
  19651. NullFields []string `json:"-"`
  19652. }
  19653. func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
  19654. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
  19655. raw := NoMethod(*s)
  19656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19657. }
  19658. type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
  19659. // Key: [Output Only] A key that provides more detail on the warning
  19660. // being returned. For example, for warnings where there are no results
  19661. // in a list request for a particular zone, this key might be scope and
  19662. // the key value might be the zone name. Other examples might be a key
  19663. // indicating a deprecated resource and a suggested replacement, or a
  19664. // warning about invalid network settings (for example, if an instance
  19665. // attempts to perform IP forwarding but is not enabled for IP
  19666. // forwarding).
  19667. Key string `json:"key,omitempty"`
  19668. // Value: [Output Only] A warning data value corresponding to the key.
  19669. Value string `json:"value,omitempty"`
  19670. // ForceSendFields is a list of field names (e.g. "Key") to
  19671. // unconditionally include in API requests. By default, fields with
  19672. // empty values are omitted from API requests. However, any non-pointer,
  19673. // non-interface field appearing in ForceSendFields will be sent to the
  19674. // server regardless of whether the field is empty or not. This may be
  19675. // used to include empty fields in Patch requests.
  19676. ForceSendFields []string `json:"-"`
  19677. // NullFields is a list of field names (e.g. "Key") to include in API
  19678. // requests with the JSON null value. By default, fields with empty
  19679. // values are omitted from API requests. However, any field with an
  19680. // empty value appearing in NullFields will be sent to the server as
  19681. // null. It is an error if a field in this list has a non-empty value.
  19682. // This may be used to include null fields in Patch requests.
  19683. NullFields []string `json:"-"`
  19684. }
  19685. func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
  19686. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
  19687. raw := NoMethod(*s)
  19688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19689. }
  19690. type NetworkEndpointGroupsScopedList struct {
  19691. // NetworkEndpointGroups: [Output Only] The list of network endpoint
  19692. // groups that are contained in this scope.
  19693. NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
  19694. // Warning: [Output Only] An informational warning that replaces the
  19695. // list of network endpoint groups when the list is empty.
  19696. Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
  19697. // ForceSendFields is a list of field names (e.g.
  19698. // "NetworkEndpointGroups") to unconditionally include in API requests.
  19699. // By default, fields with empty values are omitted from API requests.
  19700. // However, any non-pointer, non-interface field appearing in
  19701. // ForceSendFields will be sent to the server regardless of whether the
  19702. // field is empty or not. This may be used to include empty fields in
  19703. // Patch requests.
  19704. ForceSendFields []string `json:"-"`
  19705. // NullFields is a list of field names (e.g. "NetworkEndpointGroups") to
  19706. // include in API requests with the JSON null value. By default, fields
  19707. // with empty values are omitted from API requests. However, any field
  19708. // with an empty value appearing in NullFields will be sent to the
  19709. // server as null. It is an error if a field in this list has a
  19710. // non-empty value. This may be used to include null fields in Patch
  19711. // requests.
  19712. NullFields []string `json:"-"`
  19713. }
  19714. func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
  19715. type NoMethod NetworkEndpointGroupsScopedList
  19716. raw := NoMethod(*s)
  19717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19718. }
  19719. // NetworkEndpointGroupsScopedListWarning: [Output Only] An
  19720. // informational warning that replaces the list of network endpoint
  19721. // groups when the list is empty.
  19722. type NetworkEndpointGroupsScopedListWarning struct {
  19723. // Code: [Output Only] A warning code, if applicable. For example,
  19724. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19725. // the response.
  19726. //
  19727. // Possible values:
  19728. // "CLEANUP_FAILED"
  19729. // "DEPRECATED_RESOURCE_USED"
  19730. // "DEPRECATED_TYPE_USED"
  19731. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19732. // "EXPERIMENTAL_TYPE_USED"
  19733. // "EXTERNAL_API_WARNING"
  19734. // "FIELD_VALUE_OVERRIDEN"
  19735. // "INJECTED_KERNELS_DEPRECATED"
  19736. // "MISSING_TYPE_DEPENDENCY"
  19737. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19738. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19739. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19740. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19741. // "NEXT_HOP_NOT_RUNNING"
  19742. // "NOT_CRITICAL_ERROR"
  19743. // "NO_RESULTS_ON_PAGE"
  19744. // "REQUIRED_TOS_AGREEMENT"
  19745. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19746. // "RESOURCE_NOT_DELETED"
  19747. // "SCHEMA_VALIDATION_IGNORED"
  19748. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19749. // "UNDECLARED_PROPERTIES"
  19750. // "UNREACHABLE"
  19751. Code string `json:"code,omitempty"`
  19752. // Data: [Output Only] Metadata about this warning in key: value format.
  19753. // For example:
  19754. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19755. Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
  19756. // Message: [Output Only] A human-readable description of the warning
  19757. // code.
  19758. Message string `json:"message,omitempty"`
  19759. // ForceSendFields is a list of field names (e.g. "Code") to
  19760. // unconditionally include in API requests. By default, fields with
  19761. // empty values are omitted from API requests. However, any non-pointer,
  19762. // non-interface field appearing in ForceSendFields will be sent to the
  19763. // server regardless of whether the field is empty or not. This may be
  19764. // used to include empty fields in Patch requests.
  19765. ForceSendFields []string `json:"-"`
  19766. // NullFields is a list of field names (e.g. "Code") to include in API
  19767. // requests with the JSON null value. By default, fields with empty
  19768. // values are omitted from API requests. However, any field with an
  19769. // empty value appearing in NullFields will be sent to the server as
  19770. // null. It is an error if a field in this list has a non-empty value.
  19771. // This may be used to include null fields in Patch requests.
  19772. NullFields []string `json:"-"`
  19773. }
  19774. func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  19775. type NoMethod NetworkEndpointGroupsScopedListWarning
  19776. raw := NoMethod(*s)
  19777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19778. }
  19779. type NetworkEndpointGroupsScopedListWarningData struct {
  19780. // Key: [Output Only] A key that provides more detail on the warning
  19781. // being returned. For example, for warnings where there are no results
  19782. // in a list request for a particular zone, this key might be scope and
  19783. // the key value might be the zone name. Other examples might be a key
  19784. // indicating a deprecated resource and a suggested replacement, or a
  19785. // warning about invalid network settings (for example, if an instance
  19786. // attempts to perform IP forwarding but is not enabled for IP
  19787. // forwarding).
  19788. Key string `json:"key,omitempty"`
  19789. // Value: [Output Only] A warning data value corresponding to the key.
  19790. Value string `json:"value,omitempty"`
  19791. // ForceSendFields is a list of field names (e.g. "Key") to
  19792. // unconditionally include in API requests. By default, fields with
  19793. // empty values are omitted from API requests. However, any non-pointer,
  19794. // non-interface field appearing in ForceSendFields will be sent to the
  19795. // server regardless of whether the field is empty or not. This may be
  19796. // used to include empty fields in Patch requests.
  19797. ForceSendFields []string `json:"-"`
  19798. // NullFields is a list of field names (e.g. "Key") to include in API
  19799. // requests with the JSON null value. By default, fields with empty
  19800. // values are omitted from API requests. However, any field with an
  19801. // empty value appearing in NullFields will be sent to the server as
  19802. // null. It is an error if a field in this list has a non-empty value.
  19803. // This may be used to include null fields in Patch requests.
  19804. NullFields []string `json:"-"`
  19805. }
  19806. func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  19807. type NoMethod NetworkEndpointGroupsScopedListWarningData
  19808. raw := NoMethod(*s)
  19809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19810. }
  19811. type NetworkEndpointWithHealthStatus struct {
  19812. // Healths: [Output only] The health status of network endpoint;
  19813. Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
  19814. // NetworkEndpoint: [Output only] The network endpoint;
  19815. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  19816. // ForceSendFields is a list of field names (e.g. "Healths") to
  19817. // unconditionally include in API requests. By default, fields with
  19818. // empty values are omitted from API requests. However, any non-pointer,
  19819. // non-interface field appearing in ForceSendFields will be sent to the
  19820. // server regardless of whether the field is empty or not. This may be
  19821. // used to include empty fields in Patch requests.
  19822. ForceSendFields []string `json:"-"`
  19823. // NullFields is a list of field names (e.g. "Healths") to include in
  19824. // API requests with the JSON null value. By default, fields with empty
  19825. // values are omitted from API requests. However, any field with an
  19826. // empty value appearing in NullFields will be sent to the server as
  19827. // null. It is an error if a field in this list has a non-empty value.
  19828. // This may be used to include null fields in Patch requests.
  19829. NullFields []string `json:"-"`
  19830. }
  19831. func (s *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
  19832. type NoMethod NetworkEndpointWithHealthStatus
  19833. raw := NoMethod(*s)
  19834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19835. }
  19836. // NetworkInterface: A network interface resource attached to an
  19837. // instance.
  19838. type NetworkInterface struct {
  19839. // AccessConfigs: An array of configurations for this interface.
  19840. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  19841. // there are no accessConfigs specified, then this instance will have no
  19842. // external internet access.
  19843. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  19844. // AliasIpRanges: An array of alias IP ranges for this network
  19845. // interface. Can only be specified for network interfaces on
  19846. // subnet-mode networks.
  19847. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  19848. // Fingerprint: Fingerprint hash of contents stored in this network
  19849. // interface. This field will be ignored when inserting an Instance or
  19850. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  19851. // in order to update the NetworkInterface, otherwise the request will
  19852. // fail with error 412 conditionNotMet.
  19853. Fingerprint string `json:"fingerprint,omitempty"`
  19854. // Kind: [Output Only] Type of the resource. Always
  19855. // compute#networkInterface for network interfaces.
  19856. Kind string `json:"kind,omitempty"`
  19857. // Name: [Output Only] The name of the network interface, generated by
  19858. // the server. For network devices, these are eth0, eth1, etc.
  19859. Name string `json:"name,omitempty"`
  19860. // Network: URL of the network resource for this instance. When creating
  19861. // an instance, if neither the network nor the subnetwork is specified,
  19862. // the default network global/networks/default is used; if the network
  19863. // is not specified but the subnetwork is specified, the network is
  19864. // inferred.
  19865. //
  19866. // This field is optional when creating a firewall rule. If not
  19867. // specified when creating a firewall rule, the default network
  19868. // global/networks/default is used.
  19869. //
  19870. // If you specify this property, you can specify the network as a full
  19871. // or partial URL. For example, the following are all valid URLs:
  19872. // -
  19873. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  19874. // - projects/project/global/networks/network
  19875. // - global/networks/default
  19876. Network string `json:"network,omitempty"`
  19877. // NetworkIP: An IPv4 internal network address to assign to the instance
  19878. // for this network interface. If not specified by the user, an unused
  19879. // internal IP is assigned by the system.
  19880. NetworkIP string `json:"networkIP,omitempty"`
  19881. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  19882. // the network resource is in legacy mode, do not provide this property.
  19883. // If the network is in auto subnet mode, providing the subnetwork is
  19884. // optional. If the network is in custom subnet mode, then this field
  19885. // should be specified. If you specify this property, you can specify
  19886. // the subnetwork as a full or partial URL. For example, the following
  19887. // are all valid URLs:
  19888. // -
  19889. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  19890. // - regions/region/subnetworks/subnetwork
  19891. Subnetwork string `json:"subnetwork,omitempty"`
  19892. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  19893. // unconditionally include in API requests. By default, fields with
  19894. // empty values are omitted from API requests. However, any non-pointer,
  19895. // non-interface field appearing in ForceSendFields will be sent to the
  19896. // server regardless of whether the field is empty or not. This may be
  19897. // used to include empty fields in Patch requests.
  19898. ForceSendFields []string `json:"-"`
  19899. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  19900. // in API requests with the JSON null value. By default, fields with
  19901. // empty values are omitted from API requests. However, any field with
  19902. // an empty value appearing in NullFields will be sent to the server as
  19903. // null. It is an error if a field in this list has a non-empty value.
  19904. // This may be used to include null fields in Patch requests.
  19905. NullFields []string `json:"-"`
  19906. }
  19907. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  19908. type NoMethod NetworkInterface
  19909. raw := NoMethod(*s)
  19910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19911. }
  19912. // NetworkList: Contains a list of networks.
  19913. type NetworkList struct {
  19914. // Id: [Output Only] Unique identifier for the resource; defined by the
  19915. // server.
  19916. Id string `json:"id,omitempty"`
  19917. // Items: A list of Network resources.
  19918. Items []*Network `json:"items,omitempty"`
  19919. // Kind: [Output Only] Type of resource. Always compute#networkList for
  19920. // lists of networks.
  19921. Kind string `json:"kind,omitempty"`
  19922. // NextPageToken: [Output Only] This token allows you to get the next
  19923. // page of results for list requests. If the number of results is larger
  19924. // than maxResults, use the nextPageToken as a value for the query
  19925. // parameter pageToken in the next list request. Subsequent list
  19926. // requests will have their own nextPageToken to continue paging through
  19927. // the results.
  19928. NextPageToken string `json:"nextPageToken,omitempty"`
  19929. // SelfLink: [Output Only] Server-defined URL for this resource.
  19930. SelfLink string `json:"selfLink,omitempty"`
  19931. // Warning: [Output Only] Informational warning message.
  19932. Warning *NetworkListWarning `json:"warning,omitempty"`
  19933. // ServerResponse contains the HTTP response code and headers from the
  19934. // server.
  19935. googleapi.ServerResponse `json:"-"`
  19936. // ForceSendFields is a list of field names (e.g. "Id") to
  19937. // unconditionally include in API requests. By default, fields with
  19938. // empty values are omitted from API requests. However, any non-pointer,
  19939. // non-interface field appearing in ForceSendFields will be sent to the
  19940. // server regardless of whether the field is empty or not. This may be
  19941. // used to include empty fields in Patch requests.
  19942. ForceSendFields []string `json:"-"`
  19943. // NullFields is a list of field names (e.g. "Id") to include in API
  19944. // requests with the JSON null value. By default, fields with empty
  19945. // values are omitted from API requests. However, any field with an
  19946. // empty value appearing in NullFields will be sent to the server as
  19947. // null. It is an error if a field in this list has a non-empty value.
  19948. // This may be used to include null fields in Patch requests.
  19949. NullFields []string `json:"-"`
  19950. }
  19951. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  19952. type NoMethod NetworkList
  19953. raw := NoMethod(*s)
  19954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19955. }
  19956. // NetworkListWarning: [Output Only] Informational warning message.
  19957. type NetworkListWarning struct {
  19958. // Code: [Output Only] A warning code, if applicable. For example,
  19959. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19960. // the response.
  19961. //
  19962. // Possible values:
  19963. // "CLEANUP_FAILED"
  19964. // "DEPRECATED_RESOURCE_USED"
  19965. // "DEPRECATED_TYPE_USED"
  19966. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19967. // "EXPERIMENTAL_TYPE_USED"
  19968. // "EXTERNAL_API_WARNING"
  19969. // "FIELD_VALUE_OVERRIDEN"
  19970. // "INJECTED_KERNELS_DEPRECATED"
  19971. // "MISSING_TYPE_DEPENDENCY"
  19972. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19973. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19974. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19975. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19976. // "NEXT_HOP_NOT_RUNNING"
  19977. // "NOT_CRITICAL_ERROR"
  19978. // "NO_RESULTS_ON_PAGE"
  19979. // "REQUIRED_TOS_AGREEMENT"
  19980. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19981. // "RESOURCE_NOT_DELETED"
  19982. // "SCHEMA_VALIDATION_IGNORED"
  19983. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19984. // "UNDECLARED_PROPERTIES"
  19985. // "UNREACHABLE"
  19986. Code string `json:"code,omitempty"`
  19987. // Data: [Output Only] Metadata about this warning in key: value format.
  19988. // For example:
  19989. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19990. Data []*NetworkListWarningData `json:"data,omitempty"`
  19991. // Message: [Output Only] A human-readable description of the warning
  19992. // code.
  19993. Message string `json:"message,omitempty"`
  19994. // ForceSendFields is a list of field names (e.g. "Code") to
  19995. // unconditionally include in API requests. By default, fields with
  19996. // empty values are omitted from API requests. However, any non-pointer,
  19997. // non-interface field appearing in ForceSendFields will be sent to the
  19998. // server regardless of whether the field is empty or not. This may be
  19999. // used to include empty fields in Patch requests.
  20000. ForceSendFields []string `json:"-"`
  20001. // NullFields is a list of field names (e.g. "Code") to include in API
  20002. // requests with the JSON null value. By default, fields with empty
  20003. // values are omitted from API requests. However, any field with an
  20004. // empty value appearing in NullFields will be sent to the server as
  20005. // null. It is an error if a field in this list has a non-empty value.
  20006. // This may be used to include null fields in Patch requests.
  20007. NullFields []string `json:"-"`
  20008. }
  20009. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  20010. type NoMethod NetworkListWarning
  20011. raw := NoMethod(*s)
  20012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20013. }
  20014. type NetworkListWarningData struct {
  20015. // Key: [Output Only] A key that provides more detail on the warning
  20016. // being returned. For example, for warnings where there are no results
  20017. // in a list request for a particular zone, this key might be scope and
  20018. // the key value might be the zone name. Other examples might be a key
  20019. // indicating a deprecated resource and a suggested replacement, or a
  20020. // warning about invalid network settings (for example, if an instance
  20021. // attempts to perform IP forwarding but is not enabled for IP
  20022. // forwarding).
  20023. Key string `json:"key,omitempty"`
  20024. // Value: [Output Only] A warning data value corresponding to the key.
  20025. Value string `json:"value,omitempty"`
  20026. // ForceSendFields is a list of field names (e.g. "Key") to
  20027. // unconditionally include in API requests. By default, fields with
  20028. // empty values are omitted from API requests. However, any non-pointer,
  20029. // non-interface field appearing in ForceSendFields will be sent to the
  20030. // server regardless of whether the field is empty or not. This may be
  20031. // used to include empty fields in Patch requests.
  20032. ForceSendFields []string `json:"-"`
  20033. // NullFields is a list of field names (e.g. "Key") to include in API
  20034. // requests with the JSON null value. By default, fields with empty
  20035. // values are omitted from API requests. However, any field with an
  20036. // empty value appearing in NullFields will be sent to the server as
  20037. // null. It is an error if a field in this list has a non-empty value.
  20038. // This may be used to include null fields in Patch requests.
  20039. NullFields []string `json:"-"`
  20040. }
  20041. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  20042. type NoMethod NetworkListWarningData
  20043. raw := NoMethod(*s)
  20044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20045. }
  20046. // NetworkPeering: A network peering attached to a network resource. The
  20047. // message includes the peering name, peer network, peering state, and a
  20048. // flag indicating whether Google Compute Engine should automatically
  20049. // create routes for the peering.
  20050. type NetworkPeering struct {
  20051. // AdvertisePeerSubnetsViaRouters: Whether Cloud Routers in this network
  20052. // can automatically advertise subnets from the peer network.
  20053. AdvertisePeerSubnetsViaRouters bool `json:"advertisePeerSubnetsViaRouters,omitempty"`
  20054. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  20055. // exchange_subnet_routes instead. Indicates whether full mesh
  20056. // connectivity is created and managed automatically. When it is set to
  20057. // true, Google Compute Engine will automatically create and manage the
  20058. // routes between two networks when the state is ACTIVE. Otherwise, user
  20059. // needs to create routes manually to route packets to peer network.
  20060. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  20061. // ExchangeSubnetRoutes: Whether full mesh connectivity is created and
  20062. // managed automatically. When it is set to true, Google Compute Engine
  20063. // will automatically create and manage the routes between two networks
  20064. // when the peering state is ACTIVE. Otherwise, user needs to create
  20065. // routes manually to route packets to peer network.
  20066. ExchangeSubnetRoutes bool `json:"exchangeSubnetRoutes,omitempty"`
  20067. // ExportCustomRoutes: Whether to export the custom routes to peer
  20068. // network.
  20069. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  20070. // ExportSubnetRoutesWithPublicIp: Whether subnet routes with public IP
  20071. // range are exported. The default value is true, all subnet routes are
  20072. // exported. The IPv4 special-use ranges
  20073. // (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always
  20074. // exported to peers and are not controlled by this field.
  20075. ExportSubnetRoutesWithPublicIp bool `json:"exportSubnetRoutesWithPublicIp,omitempty"`
  20076. // ImportCustomRoutes: Whether to import the custom routes from peer
  20077. // network.
  20078. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  20079. // ImportSubnetRoutesWithPublicIp: Whether subnet routes with public IP
  20080. // range are imported. The default value is false. The IPv4 special-use
  20081. // ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are
  20082. // always imported from peers and are not controlled by this field.
  20083. ImportSubnetRoutesWithPublicIp bool `json:"importSubnetRoutesWithPublicIp,omitempty"`
  20084. // Name: Name of this peering. Provided by the client when the peering
  20085. // is created. The name must comply with RFC1035. Specifically, the name
  20086. // must be 1-63 characters long and match regular expression
  20087. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  20088. // a lowercase letter, and all the following characters must be a dash,
  20089. // lowercase letter, or digit, except the last character, which cannot
  20090. // be a dash.
  20091. Name string `json:"name,omitempty"`
  20092. // Network: The URL of the peer network. It can be either full URL or
  20093. // partial URL. The peer network may belong to a different project. If
  20094. // the partial URL does not contain project, it is assumed that the peer
  20095. // network is in the same project as the current network.
  20096. Network string `json:"network,omitempty"`
  20097. // State: [Output Only] State for the peering.
  20098. //
  20099. // Possible values:
  20100. // "ACTIVE"
  20101. // "INACTIVE"
  20102. State string `json:"state,omitempty"`
  20103. // StateDetails: [Output Only] Details about the current state of the
  20104. // peering.
  20105. StateDetails string `json:"stateDetails,omitempty"`
  20106. // ForceSendFields is a list of field names (e.g.
  20107. // "AdvertisePeerSubnetsViaRouters") to unconditionally include in API
  20108. // requests. By default, fields with empty values are omitted from API
  20109. // requests. However, any non-pointer, non-interface field appearing in
  20110. // ForceSendFields will be sent to the server regardless of whether the
  20111. // field is empty or not. This may be used to include empty fields in
  20112. // Patch requests.
  20113. ForceSendFields []string `json:"-"`
  20114. // NullFields is a list of field names (e.g.
  20115. // "AdvertisePeerSubnetsViaRouters") to include in API requests with the
  20116. // JSON null value. By default, fields with empty values are omitted
  20117. // from API requests. However, any field with an empty value appearing
  20118. // in NullFields will be sent to the server as null. It is an error if a
  20119. // field in this list has a non-empty value. This may be used to include
  20120. // null fields in Patch requests.
  20121. NullFields []string `json:"-"`
  20122. }
  20123. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  20124. type NoMethod NetworkPeering
  20125. raw := NoMethod(*s)
  20126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20127. }
  20128. // NetworkRoutingConfig: A routing configuration attached to a network
  20129. // resource. The message includes the list of routers associated with
  20130. // the network, and a flag indicating the type of routing behavior to
  20131. // enforce network-wide.
  20132. type NetworkRoutingConfig struct {
  20133. // RoutingMode: The network-wide routing mode to use. If set to
  20134. // REGIONAL, this network's cloud routers will only advertise routes
  20135. // with subnets of this network in the same region as the router. If set
  20136. // to GLOBAL, this network's cloud routers will advertise routes with
  20137. // all subnets of this network, across regions.
  20138. //
  20139. // Possible values:
  20140. // "GLOBAL"
  20141. // "REGIONAL"
  20142. RoutingMode string `json:"routingMode,omitempty"`
  20143. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  20144. // unconditionally include in API requests. By default, fields with
  20145. // empty values are omitted from API requests. However, any non-pointer,
  20146. // non-interface field appearing in ForceSendFields will be sent to the
  20147. // server regardless of whether the field is empty or not. This may be
  20148. // used to include empty fields in Patch requests.
  20149. ForceSendFields []string `json:"-"`
  20150. // NullFields is a list of field names (e.g. "RoutingMode") to include
  20151. // in API requests with the JSON null value. By default, fields with
  20152. // empty values are omitted from API requests. However, any field with
  20153. // an empty value appearing in NullFields will be sent to the server as
  20154. // null. It is an error if a field in this list has a non-empty value.
  20155. // This may be used to include null fields in Patch requests.
  20156. NullFields []string `json:"-"`
  20157. }
  20158. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  20159. type NoMethod NetworkRoutingConfig
  20160. raw := NoMethod(*s)
  20161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20162. }
  20163. type NetworksAddPeeringRequest struct {
  20164. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  20165. // exchange_subnet_routes in network_peering instead. Whether Google
  20166. // Compute Engine manages the routes automatically.
  20167. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  20168. // ExportCustomRoutes: This field will be deprecated soon. Prefer using
  20169. // export_custom_routes in network_peering instead. Whether to export
  20170. // the custom routes to peer network.
  20171. ExportCustomRoutes bool `json:"exportCustomRoutes,omitempty"`
  20172. // ImportCustomRoutes: This field will be deprecated soon. Prefer using
  20173. // import_custom_routes in network_peering instead. Whether to import
  20174. // the custom routes from peer network.
  20175. ImportCustomRoutes bool `json:"importCustomRoutes,omitempty"`
  20176. // Name: Name of the peering, which should conform to RFC1035.
  20177. Name string `json:"name,omitempty"`
  20178. // NetworkPeering: Network peering parameters. In order to specify route
  20179. // policies for peering using import/export custom routes, you will have
  20180. // to fill all peering related parameters (name, peer network,
  20181. // exchange_subnet_routes) in network_peeringfield. Corresponding fields
  20182. // in NetworksAddPeeringRequest will be deprecated soon.
  20183. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  20184. // PeerNetwork: URL of the peer network. It can be either full URL or
  20185. // partial URL. The peer network may belong to a different project. If
  20186. // the partial URL does not contain project, it is assumed that the peer
  20187. // network is in the same project as the current network.
  20188. PeerNetwork string `json:"peerNetwork,omitempty"`
  20189. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  20190. // unconditionally include in API requests. By default, fields with
  20191. // empty values are omitted from API requests. However, any non-pointer,
  20192. // non-interface field appearing in ForceSendFields will be sent to the
  20193. // server regardless of whether the field is empty or not. This may be
  20194. // used to include empty fields in Patch requests.
  20195. ForceSendFields []string `json:"-"`
  20196. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  20197. // include in API requests with the JSON null value. By default, fields
  20198. // with empty values are omitted from API requests. However, any field
  20199. // with an empty value appearing in NullFields will be sent to the
  20200. // server as null. It is an error if a field in this list has a
  20201. // non-empty value. This may be used to include null fields in Patch
  20202. // requests.
  20203. NullFields []string `json:"-"`
  20204. }
  20205. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  20206. type NoMethod NetworksAddPeeringRequest
  20207. raw := NoMethod(*s)
  20208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20209. }
  20210. type NetworksRemovePeeringRequest struct {
  20211. // Name: Name of the peering, which should conform to RFC1035.
  20212. Name string `json:"name,omitempty"`
  20213. // ForceSendFields is a list of field names (e.g. "Name") to
  20214. // unconditionally include in API requests. By default, fields with
  20215. // empty values are omitted from API requests. However, any non-pointer,
  20216. // non-interface field appearing in ForceSendFields will be sent to the
  20217. // server regardless of whether the field is empty or not. This may be
  20218. // used to include empty fields in Patch requests.
  20219. ForceSendFields []string `json:"-"`
  20220. // NullFields is a list of field names (e.g. "Name") to include in API
  20221. // requests with the JSON null value. By default, fields with empty
  20222. // values are omitted from API requests. However, any field with an
  20223. // empty value appearing in NullFields will be sent to the server as
  20224. // null. It is an error if a field in this list has a non-empty value.
  20225. // This may be used to include null fields in Patch requests.
  20226. NullFields []string `json:"-"`
  20227. }
  20228. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  20229. type NoMethod NetworksRemovePeeringRequest
  20230. raw := NoMethod(*s)
  20231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20232. }
  20233. type NetworksUpdatePeeringRequest struct {
  20234. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  20235. // ForceSendFields is a list of field names (e.g. "NetworkPeering") to
  20236. // unconditionally include in API requests. By default, fields with
  20237. // empty values are omitted from API requests. However, any non-pointer,
  20238. // non-interface field appearing in ForceSendFields will be sent to the
  20239. // server regardless of whether the field is empty or not. This may be
  20240. // used to include empty fields in Patch requests.
  20241. ForceSendFields []string `json:"-"`
  20242. // NullFields is a list of field names (e.g. "NetworkPeering") to
  20243. // include in API requests with the JSON null value. By default, fields
  20244. // with empty values are omitted from API requests. However, any field
  20245. // with an empty value appearing in NullFields will be sent to the
  20246. // server as null. It is an error if a field in this list has a
  20247. // non-empty value. This may be used to include null fields in Patch
  20248. // requests.
  20249. NullFields []string `json:"-"`
  20250. }
  20251. func (s *NetworksUpdatePeeringRequest) MarshalJSON() ([]byte, error) {
  20252. type NoMethod NetworksUpdatePeeringRequest
  20253. raw := NoMethod(*s)
  20254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20255. }
  20256. // NodeGroup: A NodeGroup resource.
  20257. type NodeGroup struct {
  20258. AutoscalingPolicy *NodeGroupAutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  20259. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20260. // format.
  20261. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20262. // Description: An optional description of this resource. Provide this
  20263. // property when you create the resource.
  20264. Description string `json:"description,omitempty"`
  20265. // Id: [Output Only] The unique identifier for the resource. This
  20266. // identifier is defined by the server.
  20267. Id uint64 `json:"id,omitempty,string"`
  20268. // Kind: [Output Only] The type of the resource. Always
  20269. // compute#nodeGroup for node group.
  20270. Kind string `json:"kind,omitempty"`
  20271. // Name: The name of the resource, provided by the client when initially
  20272. // creating the resource. The resource name must be 1-63 characters
  20273. // long, and comply with RFC1035. Specifically, the name must be 1-63
  20274. // characters long and match the regular expression
  20275. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  20276. // a lowercase letter, and all following characters must be a dash,
  20277. // lowercase letter, or digit, except the last character, which cannot
  20278. // be a dash.
  20279. Name string `json:"name,omitempty"`
  20280. // NodeTemplate: The URL of the node template to which this node group
  20281. // belongs.
  20282. NodeTemplate string `json:"nodeTemplate,omitempty"`
  20283. // SelfLink: [Output Only] Server-defined URL for the resource.
  20284. SelfLink string `json:"selfLink,omitempty"`
  20285. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  20286. // with the resource id.
  20287. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  20288. // Size: [Output Only] The total number of nodes in the node group.
  20289. Size int64 `json:"size,omitempty"`
  20290. // Possible values:
  20291. // "CREATING"
  20292. // "DELETING"
  20293. // "INVALID"
  20294. // "READY"
  20295. Status string `json:"status,omitempty"`
  20296. // Zone: [Output Only] The name of the zone where the node group
  20297. // resides, such as us-central1-a.
  20298. Zone string `json:"zone,omitempty"`
  20299. // ServerResponse contains the HTTP response code and headers from the
  20300. // server.
  20301. googleapi.ServerResponse `json:"-"`
  20302. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  20303. // to unconditionally include in API requests. By default, fields with
  20304. // empty values are omitted from API requests. However, any non-pointer,
  20305. // non-interface field appearing in ForceSendFields will be sent to the
  20306. // server regardless of whether the field is empty or not. This may be
  20307. // used to include empty fields in Patch requests.
  20308. ForceSendFields []string `json:"-"`
  20309. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  20310. // include in API requests with the JSON null value. By default, fields
  20311. // with empty values are omitted from API requests. However, any field
  20312. // with an empty value appearing in NullFields will be sent to the
  20313. // server as null. It is an error if a field in this list has a
  20314. // non-empty value. This may be used to include null fields in Patch
  20315. // requests.
  20316. NullFields []string `json:"-"`
  20317. }
  20318. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  20319. type NoMethod NodeGroup
  20320. raw := NoMethod(*s)
  20321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20322. }
  20323. type NodeGroupAggregatedList struct {
  20324. // Id: [Output Only] Unique identifier for the resource; defined by the
  20325. // server.
  20326. Id string `json:"id,omitempty"`
  20327. // Items: A list of NodeGroupsScopedList resources.
  20328. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  20329. // Kind: [Output Only] Type of resource.Always
  20330. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  20331. Kind string `json:"kind,omitempty"`
  20332. // NextPageToken: [Output Only] This token allows you to get the next
  20333. // page of results for list requests. If the number of results is larger
  20334. // than maxResults, use the nextPageToken as a value for the query
  20335. // parameter pageToken in the next list request. Subsequent list
  20336. // requests will have their own nextPageToken to continue paging through
  20337. // the results.
  20338. NextPageToken string `json:"nextPageToken,omitempty"`
  20339. // SelfLink: [Output Only] Server-defined URL for this resource.
  20340. SelfLink string `json:"selfLink,omitempty"`
  20341. // Warning: [Output Only] Informational warning message.
  20342. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  20343. // ServerResponse contains the HTTP response code and headers from the
  20344. // server.
  20345. googleapi.ServerResponse `json:"-"`
  20346. // ForceSendFields is a list of field names (e.g. "Id") to
  20347. // unconditionally include in API requests. By default, fields with
  20348. // empty values are omitted from API requests. However, any non-pointer,
  20349. // non-interface field appearing in ForceSendFields will be sent to the
  20350. // server regardless of whether the field is empty or not. This may be
  20351. // used to include empty fields in Patch requests.
  20352. ForceSendFields []string `json:"-"`
  20353. // NullFields is a list of field names (e.g. "Id") to include in API
  20354. // requests with the JSON null value. By default, fields with empty
  20355. // values are omitted from API requests. However, any field with an
  20356. // empty value appearing in NullFields will be sent to the server as
  20357. // null. It is an error if a field in this list has a non-empty value.
  20358. // This may be used to include null fields in Patch requests.
  20359. NullFields []string `json:"-"`
  20360. }
  20361. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  20362. type NoMethod NodeGroupAggregatedList
  20363. raw := NoMethod(*s)
  20364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20365. }
  20366. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  20367. // message.
  20368. type NodeGroupAggregatedListWarning struct {
  20369. // Code: [Output Only] A warning code, if applicable. For example,
  20370. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20371. // the response.
  20372. //
  20373. // Possible values:
  20374. // "CLEANUP_FAILED"
  20375. // "DEPRECATED_RESOURCE_USED"
  20376. // "DEPRECATED_TYPE_USED"
  20377. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20378. // "EXPERIMENTAL_TYPE_USED"
  20379. // "EXTERNAL_API_WARNING"
  20380. // "FIELD_VALUE_OVERRIDEN"
  20381. // "INJECTED_KERNELS_DEPRECATED"
  20382. // "MISSING_TYPE_DEPENDENCY"
  20383. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20384. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20385. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20386. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20387. // "NEXT_HOP_NOT_RUNNING"
  20388. // "NOT_CRITICAL_ERROR"
  20389. // "NO_RESULTS_ON_PAGE"
  20390. // "REQUIRED_TOS_AGREEMENT"
  20391. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20392. // "RESOURCE_NOT_DELETED"
  20393. // "SCHEMA_VALIDATION_IGNORED"
  20394. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20395. // "UNDECLARED_PROPERTIES"
  20396. // "UNREACHABLE"
  20397. Code string `json:"code,omitempty"`
  20398. // Data: [Output Only] Metadata about this warning in key: value format.
  20399. // For example:
  20400. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20401. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  20402. // Message: [Output Only] A human-readable description of the warning
  20403. // code.
  20404. Message string `json:"message,omitempty"`
  20405. // ForceSendFields is a list of field names (e.g. "Code") to
  20406. // unconditionally include in API requests. By default, fields with
  20407. // empty values are omitted from API requests. However, any non-pointer,
  20408. // non-interface field appearing in ForceSendFields will be sent to the
  20409. // server regardless of whether the field is empty or not. This may be
  20410. // used to include empty fields in Patch requests.
  20411. ForceSendFields []string `json:"-"`
  20412. // NullFields is a list of field names (e.g. "Code") to include in API
  20413. // requests with the JSON null value. By default, fields with empty
  20414. // values are omitted from API requests. However, any field with an
  20415. // empty value appearing in NullFields will be sent to the server as
  20416. // null. It is an error if a field in this list has a non-empty value.
  20417. // This may be used to include null fields in Patch requests.
  20418. NullFields []string `json:"-"`
  20419. }
  20420. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  20421. type NoMethod NodeGroupAggregatedListWarning
  20422. raw := NoMethod(*s)
  20423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20424. }
  20425. type NodeGroupAggregatedListWarningData struct {
  20426. // Key: [Output Only] A key that provides more detail on the warning
  20427. // being returned. For example, for warnings where there are no results
  20428. // in a list request for a particular zone, this key might be scope and
  20429. // the key value might be the zone name. Other examples might be a key
  20430. // indicating a deprecated resource and a suggested replacement, or a
  20431. // warning about invalid network settings (for example, if an instance
  20432. // attempts to perform IP forwarding but is not enabled for IP
  20433. // forwarding).
  20434. Key string `json:"key,omitempty"`
  20435. // Value: [Output Only] A warning data value corresponding to the key.
  20436. Value string `json:"value,omitempty"`
  20437. // ForceSendFields is a list of field names (e.g. "Key") to
  20438. // unconditionally include in API requests. By default, fields with
  20439. // empty values are omitted from API requests. However, any non-pointer,
  20440. // non-interface field appearing in ForceSendFields will be sent to the
  20441. // server regardless of whether the field is empty or not. This may be
  20442. // used to include empty fields in Patch requests.
  20443. ForceSendFields []string `json:"-"`
  20444. // NullFields is a list of field names (e.g. "Key") to include in API
  20445. // requests with the JSON null value. By default, fields with empty
  20446. // values are omitted from API requests. However, any field with an
  20447. // empty value appearing in NullFields will be sent to the server as
  20448. // null. It is an error if a field in this list has a non-empty value.
  20449. // This may be used to include null fields in Patch requests.
  20450. NullFields []string `json:"-"`
  20451. }
  20452. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  20453. type NoMethod NodeGroupAggregatedListWarningData
  20454. raw := NoMethod(*s)
  20455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20456. }
  20457. type NodeGroupAutoscalingPolicy struct {
  20458. MaxSize int64 `json:"maxSize,omitempty"`
  20459. MinSize int64 `json:"minSize,omitempty"`
  20460. // ForceSendFields is a list of field names (e.g. "MaxSize") to
  20461. // unconditionally include in API requests. By default, fields with
  20462. // empty values are omitted from API requests. However, any non-pointer,
  20463. // non-interface field appearing in ForceSendFields will be sent to the
  20464. // server regardless of whether the field is empty or not. This may be
  20465. // used to include empty fields in Patch requests.
  20466. ForceSendFields []string `json:"-"`
  20467. // NullFields is a list of field names (e.g. "MaxSize") to include in
  20468. // API requests with the JSON null value. By default, fields with empty
  20469. // values are omitted from API requests. However, any field with an
  20470. // empty value appearing in NullFields will be sent to the server as
  20471. // null. It is an error if a field in this list has a non-empty value.
  20472. // This may be used to include null fields in Patch requests.
  20473. NullFields []string `json:"-"`
  20474. }
  20475. func (s *NodeGroupAutoscalingPolicy) MarshalJSON() ([]byte, error) {
  20476. type NoMethod NodeGroupAutoscalingPolicy
  20477. raw := NoMethod(*s)
  20478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20479. }
  20480. // NodeGroupList: Contains a list of nodeGroups.
  20481. type NodeGroupList struct {
  20482. // Id: [Output Only] Unique identifier for the resource; defined by the
  20483. // server.
  20484. Id string `json:"id,omitempty"`
  20485. // Items: A list of NodeGroup resources.
  20486. Items []*NodeGroup `json:"items,omitempty"`
  20487. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  20488. // lists of node groups.
  20489. Kind string `json:"kind,omitempty"`
  20490. // NextPageToken: [Output Only] This token allows you to get the next
  20491. // page of results for list requests. If the number of results is larger
  20492. // than maxResults, use the nextPageToken as a value for the query
  20493. // parameter pageToken in the next list request. Subsequent list
  20494. // requests will have their own nextPageToken to continue paging through
  20495. // the results.
  20496. NextPageToken string `json:"nextPageToken,omitempty"`
  20497. // SelfLink: [Output Only] Server-defined URL for this resource.
  20498. SelfLink string `json:"selfLink,omitempty"`
  20499. // Warning: [Output Only] Informational warning message.
  20500. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  20501. // ServerResponse contains the HTTP response code and headers from the
  20502. // server.
  20503. googleapi.ServerResponse `json:"-"`
  20504. // ForceSendFields is a list of field names (e.g. "Id") to
  20505. // unconditionally include in API requests. By default, fields with
  20506. // empty values are omitted from API requests. However, any non-pointer,
  20507. // non-interface field appearing in ForceSendFields will be sent to the
  20508. // server regardless of whether the field is empty or not. This may be
  20509. // used to include empty fields in Patch requests.
  20510. ForceSendFields []string `json:"-"`
  20511. // NullFields is a list of field names (e.g. "Id") to include in API
  20512. // requests with the JSON null value. By default, fields with empty
  20513. // values are omitted from API requests. However, any field with an
  20514. // empty value appearing in NullFields will be sent to the server as
  20515. // null. It is an error if a field in this list has a non-empty value.
  20516. // This may be used to include null fields in Patch requests.
  20517. NullFields []string `json:"-"`
  20518. }
  20519. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  20520. type NoMethod NodeGroupList
  20521. raw := NoMethod(*s)
  20522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20523. }
  20524. // NodeGroupListWarning: [Output Only] Informational warning message.
  20525. type NodeGroupListWarning struct {
  20526. // Code: [Output Only] A warning code, if applicable. For example,
  20527. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20528. // the response.
  20529. //
  20530. // Possible values:
  20531. // "CLEANUP_FAILED"
  20532. // "DEPRECATED_RESOURCE_USED"
  20533. // "DEPRECATED_TYPE_USED"
  20534. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20535. // "EXPERIMENTAL_TYPE_USED"
  20536. // "EXTERNAL_API_WARNING"
  20537. // "FIELD_VALUE_OVERRIDEN"
  20538. // "INJECTED_KERNELS_DEPRECATED"
  20539. // "MISSING_TYPE_DEPENDENCY"
  20540. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20541. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20542. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20543. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20544. // "NEXT_HOP_NOT_RUNNING"
  20545. // "NOT_CRITICAL_ERROR"
  20546. // "NO_RESULTS_ON_PAGE"
  20547. // "REQUIRED_TOS_AGREEMENT"
  20548. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20549. // "RESOURCE_NOT_DELETED"
  20550. // "SCHEMA_VALIDATION_IGNORED"
  20551. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20552. // "UNDECLARED_PROPERTIES"
  20553. // "UNREACHABLE"
  20554. Code string `json:"code,omitempty"`
  20555. // Data: [Output Only] Metadata about this warning in key: value format.
  20556. // For example:
  20557. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20558. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  20559. // Message: [Output Only] A human-readable description of the warning
  20560. // code.
  20561. Message string `json:"message,omitempty"`
  20562. // ForceSendFields is a list of field names (e.g. "Code") to
  20563. // unconditionally include in API requests. By default, fields with
  20564. // empty values are omitted from API requests. However, any non-pointer,
  20565. // non-interface field appearing in ForceSendFields will be sent to the
  20566. // server regardless of whether the field is empty or not. This may be
  20567. // used to include empty fields in Patch requests.
  20568. ForceSendFields []string `json:"-"`
  20569. // NullFields is a list of field names (e.g. "Code") to include in API
  20570. // requests with the JSON null value. By default, fields with empty
  20571. // values are omitted from API requests. However, any field with an
  20572. // empty value appearing in NullFields will be sent to the server as
  20573. // null. It is an error if a field in this list has a non-empty value.
  20574. // This may be used to include null fields in Patch requests.
  20575. NullFields []string `json:"-"`
  20576. }
  20577. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  20578. type NoMethod NodeGroupListWarning
  20579. raw := NoMethod(*s)
  20580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20581. }
  20582. type NodeGroupListWarningData struct {
  20583. // Key: [Output Only] A key that provides more detail on the warning
  20584. // being returned. For example, for warnings where there are no results
  20585. // in a list request for a particular zone, this key might be scope and
  20586. // the key value might be the zone name. Other examples might be a key
  20587. // indicating a deprecated resource and a suggested replacement, or a
  20588. // warning about invalid network settings (for example, if an instance
  20589. // attempts to perform IP forwarding but is not enabled for IP
  20590. // forwarding).
  20591. Key string `json:"key,omitempty"`
  20592. // Value: [Output Only] A warning data value corresponding to the key.
  20593. Value string `json:"value,omitempty"`
  20594. // ForceSendFields is a list of field names (e.g. "Key") to
  20595. // unconditionally include in API requests. By default, fields with
  20596. // empty values are omitted from API requests. However, any non-pointer,
  20597. // non-interface field appearing in ForceSendFields will be sent to the
  20598. // server regardless of whether the field is empty or not. This may be
  20599. // used to include empty fields in Patch requests.
  20600. ForceSendFields []string `json:"-"`
  20601. // NullFields is a list of field names (e.g. "Key") to include in API
  20602. // requests with the JSON null value. By default, fields with empty
  20603. // values are omitted from API requests. However, any field with an
  20604. // empty value appearing in NullFields will be sent to the server as
  20605. // null. It is an error if a field in this list has a non-empty value.
  20606. // This may be used to include null fields in Patch requests.
  20607. NullFields []string `json:"-"`
  20608. }
  20609. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  20610. type NoMethod NodeGroupListWarningData
  20611. raw := NoMethod(*s)
  20612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20613. }
  20614. type NodeGroupNode struct {
  20615. // Instances: Instances scheduled on this node.
  20616. Instances []string `json:"instances,omitempty"`
  20617. // Name: The name of the node.
  20618. Name string `json:"name,omitempty"`
  20619. // NodeType: The type of this node.
  20620. NodeType string `json:"nodeType,omitempty"`
  20621. // ServerBinding: Binding properties for the physical server.
  20622. ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
  20623. // Possible values:
  20624. // "CREATING"
  20625. // "DELETING"
  20626. // "INVALID"
  20627. // "READY"
  20628. // "REPAIRING"
  20629. Status string `json:"status,omitempty"`
  20630. // ForceSendFields is a list of field names (e.g. "Instances") to
  20631. // unconditionally include in API requests. By default, fields with
  20632. // empty values are omitted from API requests. However, any non-pointer,
  20633. // non-interface field appearing in ForceSendFields will be sent to the
  20634. // server regardless of whether the field is empty or not. This may be
  20635. // used to include empty fields in Patch requests.
  20636. ForceSendFields []string `json:"-"`
  20637. // NullFields is a list of field names (e.g. "Instances") to include in
  20638. // API requests with the JSON null value. By default, fields with empty
  20639. // values are omitted from API requests. However, any field with an
  20640. // empty value appearing in NullFields will be sent to the server as
  20641. // null. It is an error if a field in this list has a non-empty value.
  20642. // This may be used to include null fields in Patch requests.
  20643. NullFields []string `json:"-"`
  20644. }
  20645. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  20646. type NoMethod NodeGroupNode
  20647. raw := NoMethod(*s)
  20648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20649. }
  20650. type NodeGroupsAddNodesRequest struct {
  20651. // AdditionalNodeCount: Count of additional nodes to be added to the
  20652. // node group.
  20653. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  20654. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  20655. // to unconditionally include in API requests. By default, fields with
  20656. // empty values are omitted from API requests. However, any non-pointer,
  20657. // non-interface field appearing in ForceSendFields will be sent to the
  20658. // server regardless of whether the field is empty or not. This may be
  20659. // used to include empty fields in Patch requests.
  20660. ForceSendFields []string `json:"-"`
  20661. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  20662. // include in API requests with the JSON null value. By default, fields
  20663. // with empty values are omitted from API requests. However, any field
  20664. // with an empty value appearing in NullFields will be sent to the
  20665. // server as null. It is an error if a field in this list has a
  20666. // non-empty value. This may be used to include null fields in Patch
  20667. // requests.
  20668. NullFields []string `json:"-"`
  20669. }
  20670. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  20671. type NoMethod NodeGroupsAddNodesRequest
  20672. raw := NoMethod(*s)
  20673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20674. }
  20675. type NodeGroupsDeleteNodesRequest struct {
  20676. Nodes []string `json:"nodes,omitempty"`
  20677. // ForceSendFields is a list of field names (e.g. "Nodes") to
  20678. // unconditionally include in API requests. By default, fields with
  20679. // empty values are omitted from API requests. However, any non-pointer,
  20680. // non-interface field appearing in ForceSendFields will be sent to the
  20681. // server regardless of whether the field is empty or not. This may be
  20682. // used to include empty fields in Patch requests.
  20683. ForceSendFields []string `json:"-"`
  20684. // NullFields is a list of field names (e.g. "Nodes") to include in API
  20685. // requests with the JSON null value. By default, fields with empty
  20686. // values are omitted from API requests. However, any field with an
  20687. // empty value appearing in NullFields will be sent to the server as
  20688. // null. It is an error if a field in this list has a non-empty value.
  20689. // This may be used to include null fields in Patch requests.
  20690. NullFields []string `json:"-"`
  20691. }
  20692. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  20693. type NoMethod NodeGroupsDeleteNodesRequest
  20694. raw := NoMethod(*s)
  20695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20696. }
  20697. type NodeGroupsListNodes struct {
  20698. // Id: [Output Only] Unique identifier for the resource; defined by the
  20699. // server.
  20700. Id string `json:"id,omitempty"`
  20701. // Items: A list of Node resources.
  20702. Items []*NodeGroupNode `json:"items,omitempty"`
  20703. // Kind: [Output Only] The resource type, which is always
  20704. // compute.nodeGroupsListNodes for the list of nodes in the specified
  20705. // node group.
  20706. Kind string `json:"kind,omitempty"`
  20707. // NextPageToken: [Output Only] This token allows you to get the next
  20708. // page of results for list requests. If the number of results is larger
  20709. // than maxResults, use the nextPageToken as a value for the query
  20710. // parameter pageToken in the next list request. Subsequent list
  20711. // requests will have their own nextPageToken to continue paging through
  20712. // the results.
  20713. NextPageToken string `json:"nextPageToken,omitempty"`
  20714. // SelfLink: [Output Only] Server-defined URL for this resource.
  20715. SelfLink string `json:"selfLink,omitempty"`
  20716. // Warning: [Output Only] Informational warning message.
  20717. Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
  20718. // ServerResponse contains the HTTP response code and headers from the
  20719. // server.
  20720. googleapi.ServerResponse `json:"-"`
  20721. // ForceSendFields is a list of field names (e.g. "Id") to
  20722. // unconditionally include in API requests. By default, fields with
  20723. // empty values are omitted from API requests. However, any non-pointer,
  20724. // non-interface field appearing in ForceSendFields will be sent to the
  20725. // server regardless of whether the field is empty or not. This may be
  20726. // used to include empty fields in Patch requests.
  20727. ForceSendFields []string `json:"-"`
  20728. // NullFields is a list of field names (e.g. "Id") to include in API
  20729. // requests with the JSON null value. By default, fields with empty
  20730. // values are omitted from API requests. However, any field with an
  20731. // empty value appearing in NullFields will be sent to the server as
  20732. // null. It is an error if a field in this list has a non-empty value.
  20733. // This may be used to include null fields in Patch requests.
  20734. NullFields []string `json:"-"`
  20735. }
  20736. func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
  20737. type NoMethod NodeGroupsListNodes
  20738. raw := NoMethod(*s)
  20739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20740. }
  20741. // NodeGroupsListNodesWarning: [Output Only] Informational warning
  20742. // message.
  20743. type NodeGroupsListNodesWarning struct {
  20744. // Code: [Output Only] A warning code, if applicable. For example,
  20745. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20746. // the response.
  20747. //
  20748. // Possible values:
  20749. // "CLEANUP_FAILED"
  20750. // "DEPRECATED_RESOURCE_USED"
  20751. // "DEPRECATED_TYPE_USED"
  20752. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20753. // "EXPERIMENTAL_TYPE_USED"
  20754. // "EXTERNAL_API_WARNING"
  20755. // "FIELD_VALUE_OVERRIDEN"
  20756. // "INJECTED_KERNELS_DEPRECATED"
  20757. // "MISSING_TYPE_DEPENDENCY"
  20758. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20759. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20760. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20761. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20762. // "NEXT_HOP_NOT_RUNNING"
  20763. // "NOT_CRITICAL_ERROR"
  20764. // "NO_RESULTS_ON_PAGE"
  20765. // "REQUIRED_TOS_AGREEMENT"
  20766. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20767. // "RESOURCE_NOT_DELETED"
  20768. // "SCHEMA_VALIDATION_IGNORED"
  20769. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20770. // "UNDECLARED_PROPERTIES"
  20771. // "UNREACHABLE"
  20772. Code string `json:"code,omitempty"`
  20773. // Data: [Output Only] Metadata about this warning in key: value format.
  20774. // For example:
  20775. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20776. Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
  20777. // Message: [Output Only] A human-readable description of the warning
  20778. // code.
  20779. Message string `json:"message,omitempty"`
  20780. // ForceSendFields is a list of field names (e.g. "Code") to
  20781. // unconditionally include in API requests. By default, fields with
  20782. // empty values are omitted from API requests. However, any non-pointer,
  20783. // non-interface field appearing in ForceSendFields will be sent to the
  20784. // server regardless of whether the field is empty or not. This may be
  20785. // used to include empty fields in Patch requests.
  20786. ForceSendFields []string `json:"-"`
  20787. // NullFields is a list of field names (e.g. "Code") to include in API
  20788. // requests with the JSON null value. By default, fields with empty
  20789. // values are omitted from API requests. However, any field with an
  20790. // empty value appearing in NullFields will be sent to the server as
  20791. // null. It is an error if a field in this list has a non-empty value.
  20792. // This may be used to include null fields in Patch requests.
  20793. NullFields []string `json:"-"`
  20794. }
  20795. func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
  20796. type NoMethod NodeGroupsListNodesWarning
  20797. raw := NoMethod(*s)
  20798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20799. }
  20800. type NodeGroupsListNodesWarningData struct {
  20801. // Key: [Output Only] A key that provides more detail on the warning
  20802. // being returned. For example, for warnings where there are no results
  20803. // in a list request for a particular zone, this key might be scope and
  20804. // the key value might be the zone name. Other examples might be a key
  20805. // indicating a deprecated resource and a suggested replacement, or a
  20806. // warning about invalid network settings (for example, if an instance
  20807. // attempts to perform IP forwarding but is not enabled for IP
  20808. // forwarding).
  20809. Key string `json:"key,omitempty"`
  20810. // Value: [Output Only] A warning data value corresponding to the key.
  20811. Value string `json:"value,omitempty"`
  20812. // ForceSendFields is a list of field names (e.g. "Key") to
  20813. // unconditionally include in API requests. By default, fields with
  20814. // empty values are omitted from API requests. However, any non-pointer,
  20815. // non-interface field appearing in ForceSendFields will be sent to the
  20816. // server regardless of whether the field is empty or not. This may be
  20817. // used to include empty fields in Patch requests.
  20818. ForceSendFields []string `json:"-"`
  20819. // NullFields is a list of field names (e.g. "Key") to include in API
  20820. // requests with the JSON null value. By default, fields with empty
  20821. // values are omitted from API requests. However, any field with an
  20822. // empty value appearing in NullFields will be sent to the server as
  20823. // null. It is an error if a field in this list has a non-empty value.
  20824. // This may be used to include null fields in Patch requests.
  20825. NullFields []string `json:"-"`
  20826. }
  20827. func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
  20828. type NoMethod NodeGroupsListNodesWarningData
  20829. raw := NoMethod(*s)
  20830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20831. }
  20832. type NodeGroupsScopedList struct {
  20833. // NodeGroups: [Output Only] A list of node groups contained in this
  20834. // scope.
  20835. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  20836. // Warning: [Output Only] An informational warning that appears when the
  20837. // nodeGroup list is empty.
  20838. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  20839. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  20840. // unconditionally include in API requests. By default, fields with
  20841. // empty values are omitted from API requests. However, any non-pointer,
  20842. // non-interface field appearing in ForceSendFields will be sent to the
  20843. // server regardless of whether the field is empty or not. This may be
  20844. // used to include empty fields in Patch requests.
  20845. ForceSendFields []string `json:"-"`
  20846. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  20847. // API requests with the JSON null value. By default, fields with empty
  20848. // values are omitted from API requests. However, any field with an
  20849. // empty value appearing in NullFields will be sent to the server as
  20850. // null. It is an error if a field in this list has a non-empty value.
  20851. // This may be used to include null fields in Patch requests.
  20852. NullFields []string `json:"-"`
  20853. }
  20854. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  20855. type NoMethod NodeGroupsScopedList
  20856. raw := NoMethod(*s)
  20857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20858. }
  20859. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  20860. // that appears when the nodeGroup list is empty.
  20861. type NodeGroupsScopedListWarning struct {
  20862. // Code: [Output Only] A warning code, if applicable. For example,
  20863. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20864. // the response.
  20865. //
  20866. // Possible values:
  20867. // "CLEANUP_FAILED"
  20868. // "DEPRECATED_RESOURCE_USED"
  20869. // "DEPRECATED_TYPE_USED"
  20870. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20871. // "EXPERIMENTAL_TYPE_USED"
  20872. // "EXTERNAL_API_WARNING"
  20873. // "FIELD_VALUE_OVERRIDEN"
  20874. // "INJECTED_KERNELS_DEPRECATED"
  20875. // "MISSING_TYPE_DEPENDENCY"
  20876. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20877. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20878. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20879. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20880. // "NEXT_HOP_NOT_RUNNING"
  20881. // "NOT_CRITICAL_ERROR"
  20882. // "NO_RESULTS_ON_PAGE"
  20883. // "REQUIRED_TOS_AGREEMENT"
  20884. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20885. // "RESOURCE_NOT_DELETED"
  20886. // "SCHEMA_VALIDATION_IGNORED"
  20887. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20888. // "UNDECLARED_PROPERTIES"
  20889. // "UNREACHABLE"
  20890. Code string `json:"code,omitempty"`
  20891. // Data: [Output Only] Metadata about this warning in key: value format.
  20892. // For example:
  20893. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20894. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  20895. // Message: [Output Only] A human-readable description of the warning
  20896. // code.
  20897. Message string `json:"message,omitempty"`
  20898. // ForceSendFields is a list of field names (e.g. "Code") to
  20899. // unconditionally include in API requests. By default, fields with
  20900. // empty values are omitted from API requests. However, any non-pointer,
  20901. // non-interface field appearing in ForceSendFields will be sent to the
  20902. // server regardless of whether the field is empty or not. This may be
  20903. // used to include empty fields in Patch requests.
  20904. ForceSendFields []string `json:"-"`
  20905. // NullFields is a list of field names (e.g. "Code") to include in API
  20906. // requests with the JSON null value. By default, fields with empty
  20907. // values are omitted from API requests. However, any field with an
  20908. // empty value appearing in NullFields will be sent to the server as
  20909. // null. It is an error if a field in this list has a non-empty value.
  20910. // This may be used to include null fields in Patch requests.
  20911. NullFields []string `json:"-"`
  20912. }
  20913. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  20914. type NoMethod NodeGroupsScopedListWarning
  20915. raw := NoMethod(*s)
  20916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20917. }
  20918. type NodeGroupsScopedListWarningData struct {
  20919. // Key: [Output Only] A key that provides more detail on the warning
  20920. // being returned. For example, for warnings where there are no results
  20921. // in a list request for a particular zone, this key might be scope and
  20922. // the key value might be the zone name. Other examples might be a key
  20923. // indicating a deprecated resource and a suggested replacement, or a
  20924. // warning about invalid network settings (for example, if an instance
  20925. // attempts to perform IP forwarding but is not enabled for IP
  20926. // forwarding).
  20927. Key string `json:"key,omitempty"`
  20928. // Value: [Output Only] A warning data value corresponding to the key.
  20929. Value string `json:"value,omitempty"`
  20930. // ForceSendFields is a list of field names (e.g. "Key") to
  20931. // unconditionally include in API requests. By default, fields with
  20932. // empty values are omitted from API requests. However, any non-pointer,
  20933. // non-interface field appearing in ForceSendFields will be sent to the
  20934. // server regardless of whether the field is empty or not. This may be
  20935. // used to include empty fields in Patch requests.
  20936. ForceSendFields []string `json:"-"`
  20937. // NullFields is a list of field names (e.g. "Key") to include in API
  20938. // requests with the JSON null value. By default, fields with empty
  20939. // values are omitted from API requests. However, any field with an
  20940. // empty value appearing in NullFields will be sent to the server as
  20941. // null. It is an error if a field in this list has a non-empty value.
  20942. // This may be used to include null fields in Patch requests.
  20943. NullFields []string `json:"-"`
  20944. }
  20945. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  20946. type NoMethod NodeGroupsScopedListWarningData
  20947. raw := NoMethod(*s)
  20948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20949. }
  20950. type NodeGroupsSetAutoscalingPolicyRequest struct {
  20951. AutoscalingPolicy *NodeGroupAutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  20952. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  20953. // to unconditionally include in API requests. By default, fields with
  20954. // empty values are omitted from API requests. However, any non-pointer,
  20955. // non-interface field appearing in ForceSendFields will be sent to the
  20956. // server regardless of whether the field is empty or not. This may be
  20957. // used to include empty fields in Patch requests.
  20958. ForceSendFields []string `json:"-"`
  20959. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  20960. // include in API requests with the JSON null value. By default, fields
  20961. // with empty values are omitted from API requests. However, any field
  20962. // with an empty value appearing in NullFields will be sent to the
  20963. // server as null. It is an error if a field in this list has a
  20964. // non-empty value. This may be used to include null fields in Patch
  20965. // requests.
  20966. NullFields []string `json:"-"`
  20967. }
  20968. func (s *NodeGroupsSetAutoscalingPolicyRequest) MarshalJSON() ([]byte, error) {
  20969. type NoMethod NodeGroupsSetAutoscalingPolicyRequest
  20970. raw := NoMethod(*s)
  20971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20972. }
  20973. type NodeGroupsSetNodeTemplateRequest struct {
  20974. // NodeTemplate: Full or partial URL of the node template resource to be
  20975. // updated for this node group.
  20976. NodeTemplate string `json:"nodeTemplate,omitempty"`
  20977. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  20978. // unconditionally include in API requests. By default, fields with
  20979. // empty values are omitted from API requests. However, any non-pointer,
  20980. // non-interface field appearing in ForceSendFields will be sent to the
  20981. // server regardless of whether the field is empty or not. This may be
  20982. // used to include empty fields in Patch requests.
  20983. ForceSendFields []string `json:"-"`
  20984. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  20985. // in API requests with the JSON null value. By default, fields with
  20986. // empty values are omitted from API requests. However, any field with
  20987. // an empty value appearing in NullFields will be sent to the server as
  20988. // null. It is an error if a field in this list has a non-empty value.
  20989. // This may be used to include null fields in Patch requests.
  20990. NullFields []string `json:"-"`
  20991. }
  20992. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  20993. type NoMethod NodeGroupsSetNodeTemplateRequest
  20994. raw := NoMethod(*s)
  20995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20996. }
  20997. // NodeTemplate: A Node Template resource.
  20998. type NodeTemplate struct {
  20999. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21000. // format.
  21001. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21002. // Description: An optional description of this resource. Provide this
  21003. // property when you create the resource.
  21004. Description string `json:"description,omitempty"`
  21005. // Id: [Output Only] The unique identifier for the resource. This
  21006. // identifier is defined by the server.
  21007. Id uint64 `json:"id,omitempty,string"`
  21008. // Kind: [Output Only] The type of the resource. Always
  21009. // compute#nodeTemplate for node templates.
  21010. Kind string `json:"kind,omitempty"`
  21011. // Name: The name of the resource, provided by the client when initially
  21012. // creating the resource. The resource name must be 1-63 characters
  21013. // long, and comply with RFC1035. Specifically, the name must be 1-63
  21014. // characters long and match the regular expression
  21015. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  21016. // a lowercase letter, and all following characters must be a dash,
  21017. // lowercase letter, or digit, except the last character, which cannot
  21018. // be a dash.
  21019. Name string `json:"name,omitempty"`
  21020. // NodeAffinityLabels: Labels to use for node affinity, which will be
  21021. // used in instance scheduling.
  21022. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  21023. // NodeType: The node type to use for nodes group that are created from
  21024. // this template.
  21025. NodeType string `json:"nodeType,omitempty"`
  21026. // NodeTypeFlexibility: The flexible properties of the desired node
  21027. // type. Node groups that use this node template will create nodes of a
  21028. // type that matches these properties.
  21029. //
  21030. // This field is mutually exclusive with the node_type property; you can
  21031. // only define one or the other, but not both.
  21032. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  21033. // Region: [Output Only] The name of the region where the node template
  21034. // resides, such as us-central1.
  21035. Region string `json:"region,omitempty"`
  21036. // SelfLink: [Output Only] Server-defined URL for the resource.
  21037. SelfLink string `json:"selfLink,omitempty"`
  21038. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  21039. // with the resource id.
  21040. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  21041. // ServerBinding: Binding properties for the physical server.
  21042. ServerBinding *ServerBinding `json:"serverBinding,omitempty"`
  21043. // Status: [Output Only] The status of the node template. One of the
  21044. // following values: CREATING, READY, and DELETING.
  21045. //
  21046. // Possible values:
  21047. // "CREATING"
  21048. // "DELETING"
  21049. // "INVALID"
  21050. // "READY"
  21051. Status string `json:"status,omitempty"`
  21052. // StatusMessage: [Output Only] An optional, human-readable explanation
  21053. // of the status.
  21054. StatusMessage string `json:"statusMessage,omitempty"`
  21055. // ServerResponse contains the HTTP response code and headers from the
  21056. // server.
  21057. googleapi.ServerResponse `json:"-"`
  21058. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21059. // to unconditionally include in API requests. By default, fields with
  21060. // empty values are omitted from API requests. However, any non-pointer,
  21061. // non-interface field appearing in ForceSendFields will be sent to the
  21062. // server regardless of whether the field is empty or not. This may be
  21063. // used to include empty fields in Patch requests.
  21064. ForceSendFields []string `json:"-"`
  21065. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21066. // include in API requests with the JSON null value. By default, fields
  21067. // with empty values are omitted from API requests. However, any field
  21068. // with an empty value appearing in NullFields will be sent to the
  21069. // server as null. It is an error if a field in this list has a
  21070. // non-empty value. This may be used to include null fields in Patch
  21071. // requests.
  21072. NullFields []string `json:"-"`
  21073. }
  21074. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  21075. type NoMethod NodeTemplate
  21076. raw := NoMethod(*s)
  21077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21078. }
  21079. type NodeTemplateAggregatedList struct {
  21080. // Id: [Output Only] Unique identifier for the resource; defined by the
  21081. // server.
  21082. Id string `json:"id,omitempty"`
  21083. // Items: A list of NodeTemplatesScopedList resources.
  21084. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  21085. // Kind: [Output Only] Type of resource.Always
  21086. // compute#nodeTemplateAggregatedList for aggregated lists of node
  21087. // templates.
  21088. Kind string `json:"kind,omitempty"`
  21089. // NextPageToken: [Output Only] This token allows you to get the next
  21090. // page of results for list requests. If the number of results is larger
  21091. // than maxResults, use the nextPageToken as a value for the query
  21092. // parameter pageToken in the next list request. Subsequent list
  21093. // requests will have their own nextPageToken to continue paging through
  21094. // the results.
  21095. NextPageToken string `json:"nextPageToken,omitempty"`
  21096. // SelfLink: [Output Only] Server-defined URL for this resource.
  21097. SelfLink string `json:"selfLink,omitempty"`
  21098. // Warning: [Output Only] Informational warning message.
  21099. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  21100. // ServerResponse contains the HTTP response code and headers from the
  21101. // server.
  21102. googleapi.ServerResponse `json:"-"`
  21103. // ForceSendFields is a list of field names (e.g. "Id") to
  21104. // unconditionally include in API requests. By default, fields with
  21105. // empty values are omitted from API requests. However, any non-pointer,
  21106. // non-interface field appearing in ForceSendFields will be sent to the
  21107. // server regardless of whether the field is empty or not. This may be
  21108. // used to include empty fields in Patch requests.
  21109. ForceSendFields []string `json:"-"`
  21110. // NullFields is a list of field names (e.g. "Id") to include in API
  21111. // requests with the JSON null value. By default, fields with empty
  21112. // values are omitted from API requests. However, any field with an
  21113. // empty value appearing in NullFields will be sent to the server as
  21114. // null. It is an error if a field in this list has a non-empty value.
  21115. // This may be used to include null fields in Patch requests.
  21116. NullFields []string `json:"-"`
  21117. }
  21118. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  21119. type NoMethod NodeTemplateAggregatedList
  21120. raw := NoMethod(*s)
  21121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21122. }
  21123. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  21124. // warning message.
  21125. type NodeTemplateAggregatedListWarning struct {
  21126. // Code: [Output Only] A warning code, if applicable. For example,
  21127. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21128. // the response.
  21129. //
  21130. // Possible values:
  21131. // "CLEANUP_FAILED"
  21132. // "DEPRECATED_RESOURCE_USED"
  21133. // "DEPRECATED_TYPE_USED"
  21134. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21135. // "EXPERIMENTAL_TYPE_USED"
  21136. // "EXTERNAL_API_WARNING"
  21137. // "FIELD_VALUE_OVERRIDEN"
  21138. // "INJECTED_KERNELS_DEPRECATED"
  21139. // "MISSING_TYPE_DEPENDENCY"
  21140. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21141. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21142. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21143. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21144. // "NEXT_HOP_NOT_RUNNING"
  21145. // "NOT_CRITICAL_ERROR"
  21146. // "NO_RESULTS_ON_PAGE"
  21147. // "REQUIRED_TOS_AGREEMENT"
  21148. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21149. // "RESOURCE_NOT_DELETED"
  21150. // "SCHEMA_VALIDATION_IGNORED"
  21151. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21152. // "UNDECLARED_PROPERTIES"
  21153. // "UNREACHABLE"
  21154. Code string `json:"code,omitempty"`
  21155. // Data: [Output Only] Metadata about this warning in key: value format.
  21156. // For example:
  21157. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21158. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  21159. // Message: [Output Only] A human-readable description of the warning
  21160. // code.
  21161. Message string `json:"message,omitempty"`
  21162. // ForceSendFields is a list of field names (e.g. "Code") to
  21163. // unconditionally include in API requests. By default, fields with
  21164. // empty values are omitted from API requests. However, any non-pointer,
  21165. // non-interface field appearing in ForceSendFields will be sent to the
  21166. // server regardless of whether the field is empty or not. This may be
  21167. // used to include empty fields in Patch requests.
  21168. ForceSendFields []string `json:"-"`
  21169. // NullFields is a list of field names (e.g. "Code") to include in API
  21170. // requests with the JSON null value. By default, fields with empty
  21171. // values are omitted from API requests. However, any field with an
  21172. // empty value appearing in NullFields will be sent to the server as
  21173. // null. It is an error if a field in this list has a non-empty value.
  21174. // This may be used to include null fields in Patch requests.
  21175. NullFields []string `json:"-"`
  21176. }
  21177. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21178. type NoMethod NodeTemplateAggregatedListWarning
  21179. raw := NoMethod(*s)
  21180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21181. }
  21182. type NodeTemplateAggregatedListWarningData struct {
  21183. // Key: [Output Only] A key that provides more detail on the warning
  21184. // being returned. For example, for warnings where there are no results
  21185. // in a list request for a particular zone, this key might be scope and
  21186. // the key value might be the zone name. Other examples might be a key
  21187. // indicating a deprecated resource and a suggested replacement, or a
  21188. // warning about invalid network settings (for example, if an instance
  21189. // attempts to perform IP forwarding but is not enabled for IP
  21190. // forwarding).
  21191. Key string `json:"key,omitempty"`
  21192. // Value: [Output Only] A warning data value corresponding to the key.
  21193. Value string `json:"value,omitempty"`
  21194. // ForceSendFields is a list of field names (e.g. "Key") to
  21195. // unconditionally include in API requests. By default, fields with
  21196. // empty values are omitted from API requests. However, any non-pointer,
  21197. // non-interface field appearing in ForceSendFields will be sent to the
  21198. // server regardless of whether the field is empty or not. This may be
  21199. // used to include empty fields in Patch requests.
  21200. ForceSendFields []string `json:"-"`
  21201. // NullFields is a list of field names (e.g. "Key") to include in API
  21202. // requests with the JSON null value. By default, fields with empty
  21203. // values are omitted from API requests. However, any field with an
  21204. // empty value appearing in NullFields will be sent to the server as
  21205. // null. It is an error if a field in this list has a non-empty value.
  21206. // This may be used to include null fields in Patch requests.
  21207. NullFields []string `json:"-"`
  21208. }
  21209. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21210. type NoMethod NodeTemplateAggregatedListWarningData
  21211. raw := NoMethod(*s)
  21212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21213. }
  21214. // NodeTemplateList: Contains a list of node templates.
  21215. type NodeTemplateList struct {
  21216. // Id: [Output Only] Unique identifier for the resource; defined by the
  21217. // server.
  21218. Id string `json:"id,omitempty"`
  21219. // Items: A list of NodeTemplate resources.
  21220. Items []*NodeTemplate `json:"items,omitempty"`
  21221. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  21222. // for lists of node templates.
  21223. Kind string `json:"kind,omitempty"`
  21224. // NextPageToken: [Output Only] This token allows you to get the next
  21225. // page of results for list requests. If the number of results is larger
  21226. // than maxResults, use the nextPageToken as a value for the query
  21227. // parameter pageToken in the next list request. Subsequent list
  21228. // requests will have their own nextPageToken to continue paging through
  21229. // the results.
  21230. NextPageToken string `json:"nextPageToken,omitempty"`
  21231. // SelfLink: [Output Only] Server-defined URL for this resource.
  21232. SelfLink string `json:"selfLink,omitempty"`
  21233. // Warning: [Output Only] Informational warning message.
  21234. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  21235. // ServerResponse contains the HTTP response code and headers from the
  21236. // server.
  21237. googleapi.ServerResponse `json:"-"`
  21238. // ForceSendFields is a list of field names (e.g. "Id") to
  21239. // unconditionally include in API requests. By default, fields with
  21240. // empty values are omitted from API requests. However, any non-pointer,
  21241. // non-interface field appearing in ForceSendFields will be sent to the
  21242. // server regardless of whether the field is empty or not. This may be
  21243. // used to include empty fields in Patch requests.
  21244. ForceSendFields []string `json:"-"`
  21245. // NullFields is a list of field names (e.g. "Id") to include in API
  21246. // requests with the JSON null value. By default, fields with empty
  21247. // values are omitted from API requests. However, any field with an
  21248. // empty value appearing in NullFields will be sent to the server as
  21249. // null. It is an error if a field in this list has a non-empty value.
  21250. // This may be used to include null fields in Patch requests.
  21251. NullFields []string `json:"-"`
  21252. }
  21253. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  21254. type NoMethod NodeTemplateList
  21255. raw := NoMethod(*s)
  21256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21257. }
  21258. // NodeTemplateListWarning: [Output Only] Informational warning message.
  21259. type NodeTemplateListWarning struct {
  21260. // Code: [Output Only] A warning code, if applicable. For example,
  21261. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21262. // the response.
  21263. //
  21264. // Possible values:
  21265. // "CLEANUP_FAILED"
  21266. // "DEPRECATED_RESOURCE_USED"
  21267. // "DEPRECATED_TYPE_USED"
  21268. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21269. // "EXPERIMENTAL_TYPE_USED"
  21270. // "EXTERNAL_API_WARNING"
  21271. // "FIELD_VALUE_OVERRIDEN"
  21272. // "INJECTED_KERNELS_DEPRECATED"
  21273. // "MISSING_TYPE_DEPENDENCY"
  21274. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21275. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21276. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21277. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21278. // "NEXT_HOP_NOT_RUNNING"
  21279. // "NOT_CRITICAL_ERROR"
  21280. // "NO_RESULTS_ON_PAGE"
  21281. // "REQUIRED_TOS_AGREEMENT"
  21282. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21283. // "RESOURCE_NOT_DELETED"
  21284. // "SCHEMA_VALIDATION_IGNORED"
  21285. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21286. // "UNDECLARED_PROPERTIES"
  21287. // "UNREACHABLE"
  21288. Code string `json:"code,omitempty"`
  21289. // Data: [Output Only] Metadata about this warning in key: value format.
  21290. // For example:
  21291. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21292. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  21293. // Message: [Output Only] A human-readable description of the warning
  21294. // code.
  21295. Message string `json:"message,omitempty"`
  21296. // ForceSendFields is a list of field names (e.g. "Code") to
  21297. // unconditionally include in API requests. By default, fields with
  21298. // empty values are omitted from API requests. However, any non-pointer,
  21299. // non-interface field appearing in ForceSendFields will be sent to the
  21300. // server regardless of whether the field is empty or not. This may be
  21301. // used to include empty fields in Patch requests.
  21302. ForceSendFields []string `json:"-"`
  21303. // NullFields is a list of field names (e.g. "Code") to include in API
  21304. // requests with the JSON null value. By default, fields with empty
  21305. // values are omitted from API requests. However, any field with an
  21306. // empty value appearing in NullFields will be sent to the server as
  21307. // null. It is an error if a field in this list has a non-empty value.
  21308. // This may be used to include null fields in Patch requests.
  21309. NullFields []string `json:"-"`
  21310. }
  21311. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  21312. type NoMethod NodeTemplateListWarning
  21313. raw := NoMethod(*s)
  21314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21315. }
  21316. type NodeTemplateListWarningData struct {
  21317. // Key: [Output Only] A key that provides more detail on the warning
  21318. // being returned. For example, for warnings where there are no results
  21319. // in a list request for a particular zone, this key might be scope and
  21320. // the key value might be the zone name. Other examples might be a key
  21321. // indicating a deprecated resource and a suggested replacement, or a
  21322. // warning about invalid network settings (for example, if an instance
  21323. // attempts to perform IP forwarding but is not enabled for IP
  21324. // forwarding).
  21325. Key string `json:"key,omitempty"`
  21326. // Value: [Output Only] A warning data value corresponding to the key.
  21327. Value string `json:"value,omitempty"`
  21328. // ForceSendFields is a list of field names (e.g. "Key") to
  21329. // unconditionally include in API requests. By default, fields with
  21330. // empty values are omitted from API requests. However, any non-pointer,
  21331. // non-interface field appearing in ForceSendFields will be sent to the
  21332. // server regardless of whether the field is empty or not. This may be
  21333. // used to include empty fields in Patch requests.
  21334. ForceSendFields []string `json:"-"`
  21335. // NullFields is a list of field names (e.g. "Key") to include in API
  21336. // requests with the JSON null value. By default, fields with empty
  21337. // values are omitted from API requests. However, any field with an
  21338. // empty value appearing in NullFields will be sent to the server as
  21339. // null. It is an error if a field in this list has a non-empty value.
  21340. // This may be used to include null fields in Patch requests.
  21341. NullFields []string `json:"-"`
  21342. }
  21343. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  21344. type NoMethod NodeTemplateListWarningData
  21345. raw := NoMethod(*s)
  21346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21347. }
  21348. type NodeTemplateNodeTypeFlexibility struct {
  21349. Cpus string `json:"cpus,omitempty"`
  21350. LocalSsd string `json:"localSsd,omitempty"`
  21351. Memory string `json:"memory,omitempty"`
  21352. // ForceSendFields is a list of field names (e.g. "Cpus") to
  21353. // unconditionally include in API requests. By default, fields with
  21354. // empty values are omitted from API requests. However, any non-pointer,
  21355. // non-interface field appearing in ForceSendFields will be sent to the
  21356. // server regardless of whether the field is empty or not. This may be
  21357. // used to include empty fields in Patch requests.
  21358. ForceSendFields []string `json:"-"`
  21359. // NullFields is a list of field names (e.g. "Cpus") to include in API
  21360. // requests with the JSON null value. By default, fields with empty
  21361. // values are omitted from API requests. However, any field with an
  21362. // empty value appearing in NullFields will be sent to the server as
  21363. // null. It is an error if a field in this list has a non-empty value.
  21364. // This may be used to include null fields in Patch requests.
  21365. NullFields []string `json:"-"`
  21366. }
  21367. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  21368. type NoMethod NodeTemplateNodeTypeFlexibility
  21369. raw := NoMethod(*s)
  21370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21371. }
  21372. type NodeTemplatesScopedList struct {
  21373. // NodeTemplates: [Output Only] A list of node templates contained in
  21374. // this scope.
  21375. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  21376. // Warning: [Output Only] An informational warning that appears when the
  21377. // node templates list is empty.
  21378. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  21379. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  21380. // unconditionally include in API requests. By default, fields with
  21381. // empty values are omitted from API requests. However, any non-pointer,
  21382. // non-interface field appearing in ForceSendFields will be sent to the
  21383. // server regardless of whether the field is empty or not. This may be
  21384. // used to include empty fields in Patch requests.
  21385. ForceSendFields []string `json:"-"`
  21386. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  21387. // in API requests with the JSON null value. By default, fields with
  21388. // empty values are omitted from API requests. However, any field with
  21389. // an empty value appearing in NullFields will be sent to the server as
  21390. // null. It is an error if a field in this list has a non-empty value.
  21391. // This may be used to include null fields in Patch requests.
  21392. NullFields []string `json:"-"`
  21393. }
  21394. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  21395. type NoMethod NodeTemplatesScopedList
  21396. raw := NoMethod(*s)
  21397. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21398. }
  21399. // NodeTemplatesScopedListWarning: [Output Only] An informational
  21400. // warning that appears when the node templates list is empty.
  21401. type NodeTemplatesScopedListWarning struct {
  21402. // Code: [Output Only] A warning code, if applicable. For example,
  21403. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21404. // the response.
  21405. //
  21406. // Possible values:
  21407. // "CLEANUP_FAILED"
  21408. // "DEPRECATED_RESOURCE_USED"
  21409. // "DEPRECATED_TYPE_USED"
  21410. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21411. // "EXPERIMENTAL_TYPE_USED"
  21412. // "EXTERNAL_API_WARNING"
  21413. // "FIELD_VALUE_OVERRIDEN"
  21414. // "INJECTED_KERNELS_DEPRECATED"
  21415. // "MISSING_TYPE_DEPENDENCY"
  21416. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21417. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21418. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21419. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21420. // "NEXT_HOP_NOT_RUNNING"
  21421. // "NOT_CRITICAL_ERROR"
  21422. // "NO_RESULTS_ON_PAGE"
  21423. // "REQUIRED_TOS_AGREEMENT"
  21424. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21425. // "RESOURCE_NOT_DELETED"
  21426. // "SCHEMA_VALIDATION_IGNORED"
  21427. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21428. // "UNDECLARED_PROPERTIES"
  21429. // "UNREACHABLE"
  21430. Code string `json:"code,omitempty"`
  21431. // Data: [Output Only] Metadata about this warning in key: value format.
  21432. // For example:
  21433. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21434. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  21435. // Message: [Output Only] A human-readable description of the warning
  21436. // code.
  21437. Message string `json:"message,omitempty"`
  21438. // ForceSendFields is a list of field names (e.g. "Code") to
  21439. // unconditionally include in API requests. By default, fields with
  21440. // empty values are omitted from API requests. However, any non-pointer,
  21441. // non-interface field appearing in ForceSendFields will be sent to the
  21442. // server regardless of whether the field is empty or not. This may be
  21443. // used to include empty fields in Patch requests.
  21444. ForceSendFields []string `json:"-"`
  21445. // NullFields is a list of field names (e.g. "Code") to include in API
  21446. // requests with the JSON null value. By default, fields with empty
  21447. // values are omitted from API requests. However, any field with an
  21448. // empty value appearing in NullFields will be sent to the server as
  21449. // null. It is an error if a field in this list has a non-empty value.
  21450. // This may be used to include null fields in Patch requests.
  21451. NullFields []string `json:"-"`
  21452. }
  21453. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  21454. type NoMethod NodeTemplatesScopedListWarning
  21455. raw := NoMethod(*s)
  21456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21457. }
  21458. type NodeTemplatesScopedListWarningData struct {
  21459. // Key: [Output Only] A key that provides more detail on the warning
  21460. // being returned. For example, for warnings where there are no results
  21461. // in a list request for a particular zone, this key might be scope and
  21462. // the key value might be the zone name. Other examples might be a key
  21463. // indicating a deprecated resource and a suggested replacement, or a
  21464. // warning about invalid network settings (for example, if an instance
  21465. // attempts to perform IP forwarding but is not enabled for IP
  21466. // forwarding).
  21467. Key string `json:"key,omitempty"`
  21468. // Value: [Output Only] A warning data value corresponding to the key.
  21469. Value string `json:"value,omitempty"`
  21470. // ForceSendFields is a list of field names (e.g. "Key") to
  21471. // unconditionally include in API requests. By default, fields with
  21472. // empty values are omitted from API requests. However, any non-pointer,
  21473. // non-interface field appearing in ForceSendFields will be sent to the
  21474. // server regardless of whether the field is empty or not. This may be
  21475. // used to include empty fields in Patch requests.
  21476. ForceSendFields []string `json:"-"`
  21477. // NullFields is a list of field names (e.g. "Key") to include in API
  21478. // requests with the JSON null value. By default, fields with empty
  21479. // values are omitted from API requests. However, any field with an
  21480. // empty value appearing in NullFields will be sent to the server as
  21481. // null. It is an error if a field in this list has a non-empty value.
  21482. // This may be used to include null fields in Patch requests.
  21483. NullFields []string `json:"-"`
  21484. }
  21485. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  21486. type NoMethod NodeTemplatesScopedListWarningData
  21487. raw := NoMethod(*s)
  21488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21489. }
  21490. // NodeType: A Node Type resource.
  21491. type NodeType struct {
  21492. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  21493. CpuPlatform string `json:"cpuPlatform,omitempty"`
  21494. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21495. // format.
  21496. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21497. // Deprecated: [Output Only] The deprecation status associated with this
  21498. // node type.
  21499. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  21500. // Description: [Output Only] An optional textual description of the
  21501. // resource.
  21502. Description string `json:"description,omitempty"`
  21503. // GuestCpus: [Output Only] The number of virtual CPUs that are
  21504. // available to the node type.
  21505. GuestCpus int64 `json:"guestCpus,omitempty"`
  21506. // Id: [Output Only] The unique identifier for the resource. This
  21507. // identifier is defined by the server.
  21508. Id uint64 `json:"id,omitempty,string"`
  21509. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  21510. // for node types.
  21511. Kind string `json:"kind,omitempty"`
  21512. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  21513. // defined in GB.
  21514. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  21515. // MemoryMb: [Output Only] The amount of physical memory available to
  21516. // the node type, defined in MB.
  21517. MemoryMb int64 `json:"memoryMb,omitempty"`
  21518. // Name: [Output Only] Name of the resource.
  21519. Name string `json:"name,omitempty"`
  21520. // SelfLink: [Output Only] Server-defined URL for the resource.
  21521. SelfLink string `json:"selfLink,omitempty"`
  21522. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  21523. // with the resource id.
  21524. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  21525. // Zone: [Output Only] The name of the zone where the node type resides,
  21526. // such as us-central1-a.
  21527. Zone string `json:"zone,omitempty"`
  21528. // ServerResponse contains the HTTP response code and headers from the
  21529. // server.
  21530. googleapi.ServerResponse `json:"-"`
  21531. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  21532. // unconditionally include in API requests. By default, fields with
  21533. // empty values are omitted from API requests. However, any non-pointer,
  21534. // non-interface field appearing in ForceSendFields will be sent to the
  21535. // server regardless of whether the field is empty or not. This may be
  21536. // used to include empty fields in Patch requests.
  21537. ForceSendFields []string `json:"-"`
  21538. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  21539. // in API requests with the JSON null value. By default, fields with
  21540. // empty values are omitted from API requests. However, any field with
  21541. // an empty value appearing in NullFields will be sent to the server as
  21542. // null. It is an error if a field in this list has a non-empty value.
  21543. // This may be used to include null fields in Patch requests.
  21544. NullFields []string `json:"-"`
  21545. }
  21546. func (s *NodeType) MarshalJSON() ([]byte, error) {
  21547. type NoMethod NodeType
  21548. raw := NoMethod(*s)
  21549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21550. }
  21551. type NodeTypeAggregatedList struct {
  21552. // Id: [Output Only] Unique identifier for the resource; defined by the
  21553. // server.
  21554. Id string `json:"id,omitempty"`
  21555. // Items: A list of NodeTypesScopedList resources.
  21556. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  21557. // Kind: [Output Only] Type of resource.Always
  21558. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  21559. Kind string `json:"kind,omitempty"`
  21560. // NextPageToken: [Output Only] This token allows you to get the next
  21561. // page of results for list requests. If the number of results is larger
  21562. // than maxResults, use the nextPageToken as a value for the query
  21563. // parameter pageToken in the next list request. Subsequent list
  21564. // requests will have their own nextPageToken to continue paging through
  21565. // the results.
  21566. NextPageToken string `json:"nextPageToken,omitempty"`
  21567. // SelfLink: [Output Only] Server-defined URL for this resource.
  21568. SelfLink string `json:"selfLink,omitempty"`
  21569. // Warning: [Output Only] Informational warning message.
  21570. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  21571. // ServerResponse contains the HTTP response code and headers from the
  21572. // server.
  21573. googleapi.ServerResponse `json:"-"`
  21574. // ForceSendFields is a list of field names (e.g. "Id") to
  21575. // unconditionally include in API requests. By default, fields with
  21576. // empty values are omitted from API requests. However, any non-pointer,
  21577. // non-interface field appearing in ForceSendFields will be sent to the
  21578. // server regardless of whether the field is empty or not. This may be
  21579. // used to include empty fields in Patch requests.
  21580. ForceSendFields []string `json:"-"`
  21581. // NullFields is a list of field names (e.g. "Id") to include in API
  21582. // requests with the JSON null value. By default, fields with empty
  21583. // values are omitted from API requests. However, any field with an
  21584. // empty value appearing in NullFields will be sent to the server as
  21585. // null. It is an error if a field in this list has a non-empty value.
  21586. // This may be used to include null fields in Patch requests.
  21587. NullFields []string `json:"-"`
  21588. }
  21589. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  21590. type NoMethod NodeTypeAggregatedList
  21591. raw := NoMethod(*s)
  21592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21593. }
  21594. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  21595. // message.
  21596. type NodeTypeAggregatedListWarning struct {
  21597. // Code: [Output Only] A warning code, if applicable. For example,
  21598. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21599. // the response.
  21600. //
  21601. // Possible values:
  21602. // "CLEANUP_FAILED"
  21603. // "DEPRECATED_RESOURCE_USED"
  21604. // "DEPRECATED_TYPE_USED"
  21605. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21606. // "EXPERIMENTAL_TYPE_USED"
  21607. // "EXTERNAL_API_WARNING"
  21608. // "FIELD_VALUE_OVERRIDEN"
  21609. // "INJECTED_KERNELS_DEPRECATED"
  21610. // "MISSING_TYPE_DEPENDENCY"
  21611. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21612. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21613. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21614. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21615. // "NEXT_HOP_NOT_RUNNING"
  21616. // "NOT_CRITICAL_ERROR"
  21617. // "NO_RESULTS_ON_PAGE"
  21618. // "REQUIRED_TOS_AGREEMENT"
  21619. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21620. // "RESOURCE_NOT_DELETED"
  21621. // "SCHEMA_VALIDATION_IGNORED"
  21622. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21623. // "UNDECLARED_PROPERTIES"
  21624. // "UNREACHABLE"
  21625. Code string `json:"code,omitempty"`
  21626. // Data: [Output Only] Metadata about this warning in key: value format.
  21627. // For example:
  21628. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21629. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  21630. // Message: [Output Only] A human-readable description of the warning
  21631. // code.
  21632. Message string `json:"message,omitempty"`
  21633. // ForceSendFields is a list of field names (e.g. "Code") to
  21634. // unconditionally include in API requests. By default, fields with
  21635. // empty values are omitted from API requests. However, any non-pointer,
  21636. // non-interface field appearing in ForceSendFields will be sent to the
  21637. // server regardless of whether the field is empty or not. This may be
  21638. // used to include empty fields in Patch requests.
  21639. ForceSendFields []string `json:"-"`
  21640. // NullFields is a list of field names (e.g. "Code") to include in API
  21641. // requests with the JSON null value. By default, fields with empty
  21642. // values are omitted from API requests. However, any field with an
  21643. // empty value appearing in NullFields will be sent to the server as
  21644. // null. It is an error if a field in this list has a non-empty value.
  21645. // This may be used to include null fields in Patch requests.
  21646. NullFields []string `json:"-"`
  21647. }
  21648. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21649. type NoMethod NodeTypeAggregatedListWarning
  21650. raw := NoMethod(*s)
  21651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21652. }
  21653. type NodeTypeAggregatedListWarningData struct {
  21654. // Key: [Output Only] A key that provides more detail on the warning
  21655. // being returned. For example, for warnings where there are no results
  21656. // in a list request for a particular zone, this key might be scope and
  21657. // the key value might be the zone name. Other examples might be a key
  21658. // indicating a deprecated resource and a suggested replacement, or a
  21659. // warning about invalid network settings (for example, if an instance
  21660. // attempts to perform IP forwarding but is not enabled for IP
  21661. // forwarding).
  21662. Key string `json:"key,omitempty"`
  21663. // Value: [Output Only] A warning data value corresponding to the key.
  21664. Value string `json:"value,omitempty"`
  21665. // ForceSendFields is a list of field names (e.g. "Key") to
  21666. // unconditionally include in API requests. By default, fields with
  21667. // empty values are omitted from API requests. However, any non-pointer,
  21668. // non-interface field appearing in ForceSendFields will be sent to the
  21669. // server regardless of whether the field is empty or not. This may be
  21670. // used to include empty fields in Patch requests.
  21671. ForceSendFields []string `json:"-"`
  21672. // NullFields is a list of field names (e.g. "Key") to include in API
  21673. // requests with the JSON null value. By default, fields with empty
  21674. // values are omitted from API requests. However, any field with an
  21675. // empty value appearing in NullFields will be sent to the server as
  21676. // null. It is an error if a field in this list has a non-empty value.
  21677. // This may be used to include null fields in Patch requests.
  21678. NullFields []string `json:"-"`
  21679. }
  21680. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21681. type NoMethod NodeTypeAggregatedListWarningData
  21682. raw := NoMethod(*s)
  21683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21684. }
  21685. // NodeTypeList: Contains a list of node types.
  21686. type NodeTypeList struct {
  21687. // Id: [Output Only] Unique identifier for the resource; defined by the
  21688. // server.
  21689. Id string `json:"id,omitempty"`
  21690. // Items: A list of NodeType resources.
  21691. Items []*NodeType `json:"items,omitempty"`
  21692. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  21693. // lists of node types.
  21694. Kind string `json:"kind,omitempty"`
  21695. // NextPageToken: [Output Only] This token allows you to get the next
  21696. // page of results for list requests. If the number of results is larger
  21697. // than maxResults, use the nextPageToken as a value for the query
  21698. // parameter pageToken in the next list request. Subsequent list
  21699. // requests will have their own nextPageToken to continue paging through
  21700. // the results.
  21701. NextPageToken string `json:"nextPageToken,omitempty"`
  21702. // SelfLink: [Output Only] Server-defined URL for this resource.
  21703. SelfLink string `json:"selfLink,omitempty"`
  21704. // Warning: [Output Only] Informational warning message.
  21705. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  21706. // ServerResponse contains the HTTP response code and headers from the
  21707. // server.
  21708. googleapi.ServerResponse `json:"-"`
  21709. // ForceSendFields is a list of field names (e.g. "Id") to
  21710. // unconditionally include in API requests. By default, fields with
  21711. // empty values are omitted from API requests. However, any non-pointer,
  21712. // non-interface field appearing in ForceSendFields will be sent to the
  21713. // server regardless of whether the field is empty or not. This may be
  21714. // used to include empty fields in Patch requests.
  21715. ForceSendFields []string `json:"-"`
  21716. // NullFields is a list of field names (e.g. "Id") to include in API
  21717. // requests with the JSON null value. By default, fields with empty
  21718. // values are omitted from API requests. However, any field with an
  21719. // empty value appearing in NullFields will be sent to the server as
  21720. // null. It is an error if a field in this list has a non-empty value.
  21721. // This may be used to include null fields in Patch requests.
  21722. NullFields []string `json:"-"`
  21723. }
  21724. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  21725. type NoMethod NodeTypeList
  21726. raw := NoMethod(*s)
  21727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21728. }
  21729. // NodeTypeListWarning: [Output Only] Informational warning message.
  21730. type NodeTypeListWarning struct {
  21731. // Code: [Output Only] A warning code, if applicable. For example,
  21732. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21733. // the response.
  21734. //
  21735. // Possible values:
  21736. // "CLEANUP_FAILED"
  21737. // "DEPRECATED_RESOURCE_USED"
  21738. // "DEPRECATED_TYPE_USED"
  21739. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21740. // "EXPERIMENTAL_TYPE_USED"
  21741. // "EXTERNAL_API_WARNING"
  21742. // "FIELD_VALUE_OVERRIDEN"
  21743. // "INJECTED_KERNELS_DEPRECATED"
  21744. // "MISSING_TYPE_DEPENDENCY"
  21745. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21746. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21747. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21748. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21749. // "NEXT_HOP_NOT_RUNNING"
  21750. // "NOT_CRITICAL_ERROR"
  21751. // "NO_RESULTS_ON_PAGE"
  21752. // "REQUIRED_TOS_AGREEMENT"
  21753. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21754. // "RESOURCE_NOT_DELETED"
  21755. // "SCHEMA_VALIDATION_IGNORED"
  21756. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21757. // "UNDECLARED_PROPERTIES"
  21758. // "UNREACHABLE"
  21759. Code string `json:"code,omitempty"`
  21760. // Data: [Output Only] Metadata about this warning in key: value format.
  21761. // For example:
  21762. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21763. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  21764. // Message: [Output Only] A human-readable description of the warning
  21765. // code.
  21766. Message string `json:"message,omitempty"`
  21767. // ForceSendFields is a list of field names (e.g. "Code") to
  21768. // unconditionally include in API requests. By default, fields with
  21769. // empty values are omitted from API requests. However, any non-pointer,
  21770. // non-interface field appearing in ForceSendFields will be sent to the
  21771. // server regardless of whether the field is empty or not. This may be
  21772. // used to include empty fields in Patch requests.
  21773. ForceSendFields []string `json:"-"`
  21774. // NullFields is a list of field names (e.g. "Code") to include in API
  21775. // requests with the JSON null value. By default, fields with empty
  21776. // values are omitted from API requests. However, any field with an
  21777. // empty value appearing in NullFields will be sent to the server as
  21778. // null. It is an error if a field in this list has a non-empty value.
  21779. // This may be used to include null fields in Patch requests.
  21780. NullFields []string `json:"-"`
  21781. }
  21782. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  21783. type NoMethod NodeTypeListWarning
  21784. raw := NoMethod(*s)
  21785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21786. }
  21787. type NodeTypeListWarningData struct {
  21788. // Key: [Output Only] A key that provides more detail on the warning
  21789. // being returned. For example, for warnings where there are no results
  21790. // in a list request for a particular zone, this key might be scope and
  21791. // the key value might be the zone name. Other examples might be a key
  21792. // indicating a deprecated resource and a suggested replacement, or a
  21793. // warning about invalid network settings (for example, if an instance
  21794. // attempts to perform IP forwarding but is not enabled for IP
  21795. // forwarding).
  21796. Key string `json:"key,omitempty"`
  21797. // Value: [Output Only] A warning data value corresponding to the key.
  21798. Value string `json:"value,omitempty"`
  21799. // ForceSendFields is a list of field names (e.g. "Key") to
  21800. // unconditionally include in API requests. By default, fields with
  21801. // empty values are omitted from API requests. However, any non-pointer,
  21802. // non-interface field appearing in ForceSendFields will be sent to the
  21803. // server regardless of whether the field is empty or not. This may be
  21804. // used to include empty fields in Patch requests.
  21805. ForceSendFields []string `json:"-"`
  21806. // NullFields is a list of field names (e.g. "Key") to include in API
  21807. // requests with the JSON null value. By default, fields with empty
  21808. // values are omitted from API requests. However, any field with an
  21809. // empty value appearing in NullFields will be sent to the server as
  21810. // null. It is an error if a field in this list has a non-empty value.
  21811. // This may be used to include null fields in Patch requests.
  21812. NullFields []string `json:"-"`
  21813. }
  21814. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  21815. type NoMethod NodeTypeListWarningData
  21816. raw := NoMethod(*s)
  21817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21818. }
  21819. type NodeTypesScopedList struct {
  21820. // NodeTypes: [Output Only] A list of node types contained in this
  21821. // scope.
  21822. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  21823. // Warning: [Output Only] An informational warning that appears when the
  21824. // node types list is empty.
  21825. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  21826. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  21827. // unconditionally include in API requests. By default, fields with
  21828. // empty values are omitted from API requests. However, any non-pointer,
  21829. // non-interface field appearing in ForceSendFields will be sent to the
  21830. // server regardless of whether the field is empty or not. This may be
  21831. // used to include empty fields in Patch requests.
  21832. ForceSendFields []string `json:"-"`
  21833. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  21834. // API requests with the JSON null value. By default, fields with empty
  21835. // values are omitted from API requests. However, any field with an
  21836. // empty value appearing in NullFields will be sent to the server as
  21837. // null. It is an error if a field in this list has a non-empty value.
  21838. // This may be used to include null fields in Patch requests.
  21839. NullFields []string `json:"-"`
  21840. }
  21841. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  21842. type NoMethod NodeTypesScopedList
  21843. raw := NoMethod(*s)
  21844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21845. }
  21846. // NodeTypesScopedListWarning: [Output Only] An informational warning
  21847. // that appears when the node types list is empty.
  21848. type NodeTypesScopedListWarning struct {
  21849. // Code: [Output Only] A warning code, if applicable. For example,
  21850. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21851. // the response.
  21852. //
  21853. // Possible values:
  21854. // "CLEANUP_FAILED"
  21855. // "DEPRECATED_RESOURCE_USED"
  21856. // "DEPRECATED_TYPE_USED"
  21857. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21858. // "EXPERIMENTAL_TYPE_USED"
  21859. // "EXTERNAL_API_WARNING"
  21860. // "FIELD_VALUE_OVERRIDEN"
  21861. // "INJECTED_KERNELS_DEPRECATED"
  21862. // "MISSING_TYPE_DEPENDENCY"
  21863. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21864. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21865. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21866. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21867. // "NEXT_HOP_NOT_RUNNING"
  21868. // "NOT_CRITICAL_ERROR"
  21869. // "NO_RESULTS_ON_PAGE"
  21870. // "REQUIRED_TOS_AGREEMENT"
  21871. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21872. // "RESOURCE_NOT_DELETED"
  21873. // "SCHEMA_VALIDATION_IGNORED"
  21874. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21875. // "UNDECLARED_PROPERTIES"
  21876. // "UNREACHABLE"
  21877. Code string `json:"code,omitempty"`
  21878. // Data: [Output Only] Metadata about this warning in key: value format.
  21879. // For example:
  21880. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21881. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  21882. // Message: [Output Only] A human-readable description of the warning
  21883. // code.
  21884. Message string `json:"message,omitempty"`
  21885. // ForceSendFields is a list of field names (e.g. "Code") to
  21886. // unconditionally include in API requests. By default, fields with
  21887. // empty values are omitted from API requests. However, any non-pointer,
  21888. // non-interface field appearing in ForceSendFields will be sent to the
  21889. // server regardless of whether the field is empty or not. This may be
  21890. // used to include empty fields in Patch requests.
  21891. ForceSendFields []string `json:"-"`
  21892. // NullFields is a list of field names (e.g. "Code") to include in API
  21893. // requests with the JSON null value. By default, fields with empty
  21894. // values are omitted from API requests. However, any field with an
  21895. // empty value appearing in NullFields will be sent to the server as
  21896. // null. It is an error if a field in this list has a non-empty value.
  21897. // This may be used to include null fields in Patch requests.
  21898. NullFields []string `json:"-"`
  21899. }
  21900. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  21901. type NoMethod NodeTypesScopedListWarning
  21902. raw := NoMethod(*s)
  21903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21904. }
  21905. type NodeTypesScopedListWarningData struct {
  21906. // Key: [Output Only] A key that provides more detail on the warning
  21907. // being returned. For example, for warnings where there are no results
  21908. // in a list request for a particular zone, this key might be scope and
  21909. // the key value might be the zone name. Other examples might be a key
  21910. // indicating a deprecated resource and a suggested replacement, or a
  21911. // warning about invalid network settings (for example, if an instance
  21912. // attempts to perform IP forwarding but is not enabled for IP
  21913. // forwarding).
  21914. Key string `json:"key,omitempty"`
  21915. // Value: [Output Only] A warning data value corresponding to the key.
  21916. Value string `json:"value,omitempty"`
  21917. // ForceSendFields is a list of field names (e.g. "Key") to
  21918. // unconditionally include in API requests. By default, fields with
  21919. // empty values are omitted from API requests. However, any non-pointer,
  21920. // non-interface field appearing in ForceSendFields will be sent to the
  21921. // server regardless of whether the field is empty or not. This may be
  21922. // used to include empty fields in Patch requests.
  21923. ForceSendFields []string `json:"-"`
  21924. // NullFields is a list of field names (e.g. "Key") to include in API
  21925. // requests with the JSON null value. By default, fields with empty
  21926. // values are omitted from API requests. However, any field with an
  21927. // empty value appearing in NullFields will be sent to the server as
  21928. // null. It is an error if a field in this list has a non-empty value.
  21929. // This may be used to include null fields in Patch requests.
  21930. NullFields []string `json:"-"`
  21931. }
  21932. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  21933. type NoMethod NodeTypesScopedListWarningData
  21934. raw := NoMethod(*s)
  21935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21936. }
  21937. // NotificationEndpoint: A notification endpoint resource defines an
  21938. // endpoint to receive notifications when there are status changes
  21939. // detected by the associated health check service.
  21940. type NotificationEndpoint struct {
  21941. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21942. // format.
  21943. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21944. // Description: An optional description of this resource. Provide this
  21945. // property when you create the resource.
  21946. Description string `json:"description,omitempty"`
  21947. // GrpcSettings: Settings of the gRPC notification endpoint including
  21948. // the endpoint URL and the retry duration.
  21949. GrpcSettings *NotificationEndpointGrpcSettings `json:"grpcSettings,omitempty"`
  21950. // Id: [Output Only] A unique identifier for this resource type. The
  21951. // server generates this identifier.
  21952. Id uint64 `json:"id,omitempty,string"`
  21953. // Kind: [Output Only] Type of the resource. Always
  21954. // compute#notificationEndpoint for notification endpoints.
  21955. Kind string `json:"kind,omitempty"`
  21956. // Name: Name of the resource. Provided by the client when the resource
  21957. // is created. The name must be 1-63 characters long, and comply with
  21958. // RFC1035. Specifically, the name must be 1-63 characters long and
  21959. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21960. // the first character must be a lowercase letter, and all following
  21961. // characters must be a dash, lowercase letter, or digit, except the
  21962. // last character, which cannot be a dash.
  21963. Name string `json:"name,omitempty"`
  21964. // Region: [Output Only] URL of the region where the notification
  21965. // endpoint resides. This field applies only to the regional resource.
  21966. // You must specify this field as part of the HTTP request URL. It is
  21967. // not settable as a field in the request body.
  21968. Region string `json:"region,omitempty"`
  21969. // SelfLink: [Output Only] Server-defined URL for the resource.
  21970. SelfLink string `json:"selfLink,omitempty"`
  21971. // ServerResponse contains the HTTP response code and headers from the
  21972. // server.
  21973. googleapi.ServerResponse `json:"-"`
  21974. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21975. // to unconditionally include in API requests. By default, fields with
  21976. // empty values are omitted from API requests. However, any non-pointer,
  21977. // non-interface field appearing in ForceSendFields will be sent to the
  21978. // server regardless of whether the field is empty or not. This may be
  21979. // used to include empty fields in Patch requests.
  21980. ForceSendFields []string `json:"-"`
  21981. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21982. // include in API requests with the JSON null value. By default, fields
  21983. // with empty values are omitted from API requests. However, any field
  21984. // with an empty value appearing in NullFields will be sent to the
  21985. // server as null. It is an error if a field in this list has a
  21986. // non-empty value. This may be used to include null fields in Patch
  21987. // requests.
  21988. NullFields []string `json:"-"`
  21989. }
  21990. func (s *NotificationEndpoint) MarshalJSON() ([]byte, error) {
  21991. type NoMethod NotificationEndpoint
  21992. raw := NoMethod(*s)
  21993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21994. }
  21995. // NotificationEndpointGrpcSettings: Represents a gRPC setting that
  21996. // describes one gRPC notification endpoint and the retry duration
  21997. // attempting to send notification to this endpoint.
  21998. type NotificationEndpointGrpcSettings struct {
  21999. // Endpoint: Endpoint to which gRPC notifications are sent. This must be
  22000. // a valid gRPCLB DNS name.
  22001. Endpoint string `json:"endpoint,omitempty"`
  22002. // PayloadName: Optional. If specified, this field is used to populate
  22003. // the ?name? field in gRPC requests.
  22004. PayloadName string `json:"payloadName,omitempty"`
  22005. // RetryDurationSec: How much time (in seconds) is spent attempting
  22006. // notification retries until a successful response is received. Default
  22007. // is 30s. Limit is 20m (1200s). Must be a positive number.
  22008. RetryDurationSec int64 `json:"retryDurationSec,omitempty"`
  22009. // ForceSendFields is a list of field names (e.g. "Endpoint") to
  22010. // unconditionally include in API requests. By default, fields with
  22011. // empty values are omitted from API requests. However, any non-pointer,
  22012. // non-interface field appearing in ForceSendFields will be sent to the
  22013. // server regardless of whether the field is empty or not. This may be
  22014. // used to include empty fields in Patch requests.
  22015. ForceSendFields []string `json:"-"`
  22016. // NullFields is a list of field names (e.g. "Endpoint") to include in
  22017. // API requests with the JSON null value. By default, fields with empty
  22018. // values are omitted from API requests. However, any field with an
  22019. // empty value appearing in NullFields will be sent to the server as
  22020. // null. It is an error if a field in this list has a non-empty value.
  22021. // This may be used to include null fields in Patch requests.
  22022. NullFields []string `json:"-"`
  22023. }
  22024. func (s *NotificationEndpointGrpcSettings) MarshalJSON() ([]byte, error) {
  22025. type NoMethod NotificationEndpointGrpcSettings
  22026. raw := NoMethod(*s)
  22027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22028. }
  22029. type NotificationEndpointList struct {
  22030. // Id: [Output Only] Unique identifier for the resource; defined by the
  22031. // server.
  22032. Id string `json:"id,omitempty"`
  22033. // Items: A list of NotificationEndpoint resources.
  22034. Items []*NotificationEndpoint `json:"items,omitempty"`
  22035. // Kind: [Output Only] Type of the resource. Always
  22036. // compute#notificationEndpoint for notification endpoints.
  22037. Kind string `json:"kind,omitempty"`
  22038. // NextPageToken: [Output Only] This token allows you to get the next
  22039. // page of results for list requests. If the number of results is larger
  22040. // than maxResults, use the nextPageToken as a value for the query
  22041. // parameter pageToken in the next list request. Subsequent list
  22042. // requests will have their own nextPageToken to continue paging through
  22043. // the results.
  22044. NextPageToken string `json:"nextPageToken,omitempty"`
  22045. // SelfLink: [Output Only] Server-defined URL for this resource.
  22046. SelfLink string `json:"selfLink,omitempty"`
  22047. // Warning: [Output Only] Informational warning message.
  22048. Warning *NotificationEndpointListWarning `json:"warning,omitempty"`
  22049. // ServerResponse contains the HTTP response code and headers from the
  22050. // server.
  22051. googleapi.ServerResponse `json:"-"`
  22052. // ForceSendFields is a list of field names (e.g. "Id") to
  22053. // unconditionally include in API requests. By default, fields with
  22054. // empty values are omitted from API requests. However, any non-pointer,
  22055. // non-interface field appearing in ForceSendFields will be sent to the
  22056. // server regardless of whether the field is empty or not. This may be
  22057. // used to include empty fields in Patch requests.
  22058. ForceSendFields []string `json:"-"`
  22059. // NullFields is a list of field names (e.g. "Id") to include in API
  22060. // requests with the JSON null value. By default, fields with empty
  22061. // values are omitted from API requests. However, any field with an
  22062. // empty value appearing in NullFields will be sent to the server as
  22063. // null. It is an error if a field in this list has a non-empty value.
  22064. // This may be used to include null fields in Patch requests.
  22065. NullFields []string `json:"-"`
  22066. }
  22067. func (s *NotificationEndpointList) MarshalJSON() ([]byte, error) {
  22068. type NoMethod NotificationEndpointList
  22069. raw := NoMethod(*s)
  22070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22071. }
  22072. // NotificationEndpointListWarning: [Output Only] Informational warning
  22073. // message.
  22074. type NotificationEndpointListWarning struct {
  22075. // Code: [Output Only] A warning code, if applicable. For example,
  22076. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22077. // the response.
  22078. //
  22079. // Possible values:
  22080. // "CLEANUP_FAILED"
  22081. // "DEPRECATED_RESOURCE_USED"
  22082. // "DEPRECATED_TYPE_USED"
  22083. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22084. // "EXPERIMENTAL_TYPE_USED"
  22085. // "EXTERNAL_API_WARNING"
  22086. // "FIELD_VALUE_OVERRIDEN"
  22087. // "INJECTED_KERNELS_DEPRECATED"
  22088. // "MISSING_TYPE_DEPENDENCY"
  22089. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22090. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22091. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22092. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22093. // "NEXT_HOP_NOT_RUNNING"
  22094. // "NOT_CRITICAL_ERROR"
  22095. // "NO_RESULTS_ON_PAGE"
  22096. // "REQUIRED_TOS_AGREEMENT"
  22097. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22098. // "RESOURCE_NOT_DELETED"
  22099. // "SCHEMA_VALIDATION_IGNORED"
  22100. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22101. // "UNDECLARED_PROPERTIES"
  22102. // "UNREACHABLE"
  22103. Code string `json:"code,omitempty"`
  22104. // Data: [Output Only] Metadata about this warning in key: value format.
  22105. // For example:
  22106. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22107. Data []*NotificationEndpointListWarningData `json:"data,omitempty"`
  22108. // Message: [Output Only] A human-readable description of the warning
  22109. // code.
  22110. Message string `json:"message,omitempty"`
  22111. // ForceSendFields is a list of field names (e.g. "Code") to
  22112. // unconditionally include in API requests. By default, fields with
  22113. // empty values are omitted from API requests. However, any non-pointer,
  22114. // non-interface field appearing in ForceSendFields will be sent to the
  22115. // server regardless of whether the field is empty or not. This may be
  22116. // used to include empty fields in Patch requests.
  22117. ForceSendFields []string `json:"-"`
  22118. // NullFields is a list of field names (e.g. "Code") to include in API
  22119. // requests with the JSON null value. By default, fields with empty
  22120. // values are omitted from API requests. However, any field with an
  22121. // empty value appearing in NullFields will be sent to the server as
  22122. // null. It is an error if a field in this list has a non-empty value.
  22123. // This may be used to include null fields in Patch requests.
  22124. NullFields []string `json:"-"`
  22125. }
  22126. func (s *NotificationEndpointListWarning) MarshalJSON() ([]byte, error) {
  22127. type NoMethod NotificationEndpointListWarning
  22128. raw := NoMethod(*s)
  22129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22130. }
  22131. type NotificationEndpointListWarningData struct {
  22132. // Key: [Output Only] A key that provides more detail on the warning
  22133. // being returned. For example, for warnings where there are no results
  22134. // in a list request for a particular zone, this key might be scope and
  22135. // the key value might be the zone name. Other examples might be a key
  22136. // indicating a deprecated resource and a suggested replacement, or a
  22137. // warning about invalid network settings (for example, if an instance
  22138. // attempts to perform IP forwarding but is not enabled for IP
  22139. // forwarding).
  22140. Key string `json:"key,omitempty"`
  22141. // Value: [Output Only] A warning data value corresponding to the key.
  22142. Value string `json:"value,omitempty"`
  22143. // ForceSendFields is a list of field names (e.g. "Key") to
  22144. // unconditionally include in API requests. By default, fields with
  22145. // empty values are omitted from API requests. However, any non-pointer,
  22146. // non-interface field appearing in ForceSendFields will be sent to the
  22147. // server regardless of whether the field is empty or not. This may be
  22148. // used to include empty fields in Patch requests.
  22149. ForceSendFields []string `json:"-"`
  22150. // NullFields is a list of field names (e.g. "Key") to include in API
  22151. // requests with the JSON null value. By default, fields with empty
  22152. // values are omitted from API requests. However, any field with an
  22153. // empty value appearing in NullFields will be sent to the server as
  22154. // null. It is an error if a field in this list has a non-empty value.
  22155. // This may be used to include null fields in Patch requests.
  22156. NullFields []string `json:"-"`
  22157. }
  22158. func (s *NotificationEndpointListWarningData) MarshalJSON() ([]byte, error) {
  22159. type NoMethod NotificationEndpointListWarningData
  22160. raw := NoMethod(*s)
  22161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22162. }
  22163. // Operation: An Operation resource, used to manage asynchronous API
  22164. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  22165. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  22166. // (== resource_for beta.regionOperations ==) (== resource_for
  22167. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  22168. type Operation struct {
  22169. // ClientOperationId: [Output Only] The value of `requestId` if you
  22170. // provided it in the request. Not present otherwise.
  22171. ClientOperationId string `json:"clientOperationId,omitempty"`
  22172. // CreationTimestamp: [Deprecated] This field is deprecated.
  22173. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22174. // Description: [Output Only] A textual description of the operation,
  22175. // which is set when the operation is created.
  22176. Description string `json:"description,omitempty"`
  22177. // EndTime: [Output Only] The time that this operation was completed.
  22178. // This value is in RFC3339 text format.
  22179. EndTime string `json:"endTime,omitempty"`
  22180. // Error: [Output Only] If errors are generated during processing of the
  22181. // operation, this field will be populated.
  22182. Error *OperationError `json:"error,omitempty"`
  22183. // HttpErrorMessage: [Output Only] If the operation fails, this field
  22184. // contains the HTTP error message that was returned, such as NOT FOUND.
  22185. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  22186. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  22187. // contains the HTTP error status code that was returned. For example, a
  22188. // 404 means the resource was not found.
  22189. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  22190. // Id: [Output Only] The unique identifier for the resource. This
  22191. // identifier is defined by the server.
  22192. Id uint64 `json:"id,omitempty,string"`
  22193. // InsertTime: [Output Only] The time that this operation was requested.
  22194. // This value is in RFC3339 text format.
  22195. InsertTime string `json:"insertTime,omitempty"`
  22196. // Kind: [Output Only] Type of the resource. Always compute#operation
  22197. // for Operation resources.
  22198. Kind string `json:"kind,omitempty"`
  22199. // Name: [Output Only] Name of the resource.
  22200. Name string `json:"name,omitempty"`
  22201. // OperationType: [Output Only] The type of operation, such as insert,
  22202. // update, or delete, and so on.
  22203. OperationType string `json:"operationType,omitempty"`
  22204. // Progress: [Output Only] An optional progress indicator that ranges
  22205. // from 0 to 100. There is no requirement that this be linear or support
  22206. // any granularity of operations. This should not be used to guess when
  22207. // the operation will be complete. This number should monotonically
  22208. // increase as the operation progresses.
  22209. Progress int64 `json:"progress,omitempty"`
  22210. // Region: [Output Only] The URL of the region where the operation
  22211. // resides. Only available when performing regional operations. You must
  22212. // specify this field as part of the HTTP request URL. It is not
  22213. // settable as a field in the request body.
  22214. Region string `json:"region,omitempty"`
  22215. // SelfLink: [Output Only] Server-defined URL for the resource.
  22216. SelfLink string `json:"selfLink,omitempty"`
  22217. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  22218. // with the resource id.
  22219. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  22220. // StartTime: [Output Only] The time that this operation was started by
  22221. // the server. This value is in RFC3339 text format.
  22222. StartTime string `json:"startTime,omitempty"`
  22223. // Status: [Output Only] The status of the operation, which can be one
  22224. // of the following: PENDING, RUNNING, or DONE.
  22225. //
  22226. // Possible values:
  22227. // "DONE"
  22228. // "PENDING"
  22229. // "RUNNING"
  22230. Status string `json:"status,omitempty"`
  22231. // StatusMessage: [Output Only] An optional textual description of the
  22232. // current status of the operation.
  22233. StatusMessage string `json:"statusMessage,omitempty"`
  22234. // TargetId: [Output Only] The unique target ID, which identifies a
  22235. // specific incarnation of the target resource.
  22236. TargetId uint64 `json:"targetId,omitempty,string"`
  22237. // TargetLink: [Output Only] The URL of the resource that the operation
  22238. // modifies. For operations related to creating a snapshot, this points
  22239. // to the persistent disk that the snapshot was created from.
  22240. TargetLink string `json:"targetLink,omitempty"`
  22241. // User: [Output Only] User who requested the operation, for example:
  22242. // user@example.com.
  22243. User string `json:"user,omitempty"`
  22244. // Warnings: [Output Only] If warning messages are generated during
  22245. // processing of the operation, this field will be populated.
  22246. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  22247. // Zone: [Output Only] The URL of the zone where the operation resides.
  22248. // Only available when performing per-zone operations. You must specify
  22249. // this field as part of the HTTP request URL. It is not settable as a
  22250. // field in the request body.
  22251. Zone string `json:"zone,omitempty"`
  22252. // ServerResponse contains the HTTP response code and headers from the
  22253. // server.
  22254. googleapi.ServerResponse `json:"-"`
  22255. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  22256. // to unconditionally include in API requests. By default, fields with
  22257. // empty values are omitted from API requests. However, any non-pointer,
  22258. // non-interface field appearing in ForceSendFields will be sent to the
  22259. // server regardless of whether the field is empty or not. This may be
  22260. // used to include empty fields in Patch requests.
  22261. ForceSendFields []string `json:"-"`
  22262. // NullFields is a list of field names (e.g. "ClientOperationId") to
  22263. // include in API requests with the JSON null value. By default, fields
  22264. // with empty values are omitted from API requests. However, any field
  22265. // with an empty value appearing in NullFields will be sent to the
  22266. // server as null. It is an error if a field in this list has a
  22267. // non-empty value. This may be used to include null fields in Patch
  22268. // requests.
  22269. NullFields []string `json:"-"`
  22270. }
  22271. func (s *Operation) MarshalJSON() ([]byte, error) {
  22272. type NoMethod Operation
  22273. raw := NoMethod(*s)
  22274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22275. }
  22276. // OperationError: [Output Only] If errors are generated during
  22277. // processing of the operation, this field will be populated.
  22278. type OperationError struct {
  22279. // Errors: [Output Only] The array of errors encountered while
  22280. // processing this operation.
  22281. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  22282. // ForceSendFields is a list of field names (e.g. "Errors") to
  22283. // unconditionally include in API requests. By default, fields with
  22284. // empty values are omitted from API requests. However, any non-pointer,
  22285. // non-interface field appearing in ForceSendFields will be sent to the
  22286. // server regardless of whether the field is empty or not. This may be
  22287. // used to include empty fields in Patch requests.
  22288. ForceSendFields []string `json:"-"`
  22289. // NullFields is a list of field names (e.g. "Errors") to include in API
  22290. // requests with the JSON null value. By default, fields with empty
  22291. // values are omitted from API requests. However, any field with an
  22292. // empty value appearing in NullFields will be sent to the server as
  22293. // null. It is an error if a field in this list has a non-empty value.
  22294. // This may be used to include null fields in Patch requests.
  22295. NullFields []string `json:"-"`
  22296. }
  22297. func (s *OperationError) MarshalJSON() ([]byte, error) {
  22298. type NoMethod OperationError
  22299. raw := NoMethod(*s)
  22300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22301. }
  22302. type OperationErrorErrors struct {
  22303. // Code: [Output Only] The error type identifier for this error.
  22304. Code string `json:"code,omitempty"`
  22305. // Location: [Output Only] Indicates the field in the request that
  22306. // caused the error. This property is optional.
  22307. Location string `json:"location,omitempty"`
  22308. // Message: [Output Only] An optional, human-readable error message.
  22309. Message string `json:"message,omitempty"`
  22310. // ForceSendFields is a list of field names (e.g. "Code") to
  22311. // unconditionally include in API requests. By default, fields with
  22312. // empty values are omitted from API requests. However, any non-pointer,
  22313. // non-interface field appearing in ForceSendFields will be sent to the
  22314. // server regardless of whether the field is empty or not. This may be
  22315. // used to include empty fields in Patch requests.
  22316. ForceSendFields []string `json:"-"`
  22317. // NullFields is a list of field names (e.g. "Code") to include in API
  22318. // requests with the JSON null value. By default, fields with empty
  22319. // values are omitted from API requests. However, any field with an
  22320. // empty value appearing in NullFields will be sent to the server as
  22321. // null. It is an error if a field in this list has a non-empty value.
  22322. // This may be used to include null fields in Patch requests.
  22323. NullFields []string `json:"-"`
  22324. }
  22325. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  22326. type NoMethod OperationErrorErrors
  22327. raw := NoMethod(*s)
  22328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22329. }
  22330. type OperationWarnings struct {
  22331. // Code: [Output Only] A warning code, if applicable. For example,
  22332. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22333. // the response.
  22334. //
  22335. // Possible values:
  22336. // "CLEANUP_FAILED"
  22337. // "DEPRECATED_RESOURCE_USED"
  22338. // "DEPRECATED_TYPE_USED"
  22339. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22340. // "EXPERIMENTAL_TYPE_USED"
  22341. // "EXTERNAL_API_WARNING"
  22342. // "FIELD_VALUE_OVERRIDEN"
  22343. // "INJECTED_KERNELS_DEPRECATED"
  22344. // "MISSING_TYPE_DEPENDENCY"
  22345. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22346. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22347. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22348. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22349. // "NEXT_HOP_NOT_RUNNING"
  22350. // "NOT_CRITICAL_ERROR"
  22351. // "NO_RESULTS_ON_PAGE"
  22352. // "REQUIRED_TOS_AGREEMENT"
  22353. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22354. // "RESOURCE_NOT_DELETED"
  22355. // "SCHEMA_VALIDATION_IGNORED"
  22356. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22357. // "UNDECLARED_PROPERTIES"
  22358. // "UNREACHABLE"
  22359. Code string `json:"code,omitempty"`
  22360. // Data: [Output Only] Metadata about this warning in key: value format.
  22361. // For example:
  22362. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22363. Data []*OperationWarningsData `json:"data,omitempty"`
  22364. // Message: [Output Only] A human-readable description of the warning
  22365. // code.
  22366. Message string `json:"message,omitempty"`
  22367. // ForceSendFields is a list of field names (e.g. "Code") to
  22368. // unconditionally include in API requests. By default, fields with
  22369. // empty values are omitted from API requests. However, any non-pointer,
  22370. // non-interface field appearing in ForceSendFields will be sent to the
  22371. // server regardless of whether the field is empty or not. This may be
  22372. // used to include empty fields in Patch requests.
  22373. ForceSendFields []string `json:"-"`
  22374. // NullFields is a list of field names (e.g. "Code") to include in API
  22375. // requests with the JSON null value. By default, fields with empty
  22376. // values are omitted from API requests. However, any field with an
  22377. // empty value appearing in NullFields will be sent to the server as
  22378. // null. It is an error if a field in this list has a non-empty value.
  22379. // This may be used to include null fields in Patch requests.
  22380. NullFields []string `json:"-"`
  22381. }
  22382. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  22383. type NoMethod OperationWarnings
  22384. raw := NoMethod(*s)
  22385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22386. }
  22387. type OperationWarningsData struct {
  22388. // Key: [Output Only] A key that provides more detail on the warning
  22389. // being returned. For example, for warnings where there are no results
  22390. // in a list request for a particular zone, this key might be scope and
  22391. // the key value might be the zone name. Other examples might be a key
  22392. // indicating a deprecated resource and a suggested replacement, or a
  22393. // warning about invalid network settings (for example, if an instance
  22394. // attempts to perform IP forwarding but is not enabled for IP
  22395. // forwarding).
  22396. Key string `json:"key,omitempty"`
  22397. // Value: [Output Only] A warning data value corresponding to the key.
  22398. Value string `json:"value,omitempty"`
  22399. // ForceSendFields is a list of field names (e.g. "Key") to
  22400. // unconditionally include in API requests. By default, fields with
  22401. // empty values are omitted from API requests. However, any non-pointer,
  22402. // non-interface field appearing in ForceSendFields will be sent to the
  22403. // server regardless of whether the field is empty or not. This may be
  22404. // used to include empty fields in Patch requests.
  22405. ForceSendFields []string `json:"-"`
  22406. // NullFields is a list of field names (e.g. "Key") to include in API
  22407. // requests with the JSON null value. By default, fields with empty
  22408. // values are omitted from API requests. However, any field with an
  22409. // empty value appearing in NullFields will be sent to the server as
  22410. // null. It is an error if a field in this list has a non-empty value.
  22411. // This may be used to include null fields in Patch requests.
  22412. NullFields []string `json:"-"`
  22413. }
  22414. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  22415. type NoMethod OperationWarningsData
  22416. raw := NoMethod(*s)
  22417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22418. }
  22419. type OperationAggregatedList struct {
  22420. // Id: [Output Only] The unique identifier for the resource. This
  22421. // identifier is defined by the server.
  22422. Id string `json:"id,omitempty"`
  22423. // Items: [Output Only] A map of scoped operation lists.
  22424. Items map[string]OperationsScopedList `json:"items,omitempty"`
  22425. // Kind: [Output Only] Type of resource. Always
  22426. // compute#operationAggregatedList for aggregated lists of operations.
  22427. Kind string `json:"kind,omitempty"`
  22428. // NextPageToken: [Output Only] This token allows you to get the next
  22429. // page of results for list requests. If the number of results is larger
  22430. // than maxResults, use the nextPageToken as a value for the query
  22431. // parameter pageToken in the next list request. Subsequent list
  22432. // requests will have their own nextPageToken to continue paging through
  22433. // the results.
  22434. NextPageToken string `json:"nextPageToken,omitempty"`
  22435. // SelfLink: [Output Only] Server-defined URL for this resource.
  22436. SelfLink string `json:"selfLink,omitempty"`
  22437. // Warning: [Output Only] Informational warning message.
  22438. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  22439. // ServerResponse contains the HTTP response code and headers from the
  22440. // server.
  22441. googleapi.ServerResponse `json:"-"`
  22442. // ForceSendFields is a list of field names (e.g. "Id") to
  22443. // unconditionally include in API requests. By default, fields with
  22444. // empty values are omitted from API requests. However, any non-pointer,
  22445. // non-interface field appearing in ForceSendFields will be sent to the
  22446. // server regardless of whether the field is empty or not. This may be
  22447. // used to include empty fields in Patch requests.
  22448. ForceSendFields []string `json:"-"`
  22449. // NullFields is a list of field names (e.g. "Id") to include in API
  22450. // requests with the JSON null value. By default, fields with empty
  22451. // values are omitted from API requests. However, any field with an
  22452. // empty value appearing in NullFields will be sent to the server as
  22453. // null. It is an error if a field in this list has a non-empty value.
  22454. // This may be used to include null fields in Patch requests.
  22455. NullFields []string `json:"-"`
  22456. }
  22457. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  22458. type NoMethod OperationAggregatedList
  22459. raw := NoMethod(*s)
  22460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22461. }
  22462. // OperationAggregatedListWarning: [Output Only] Informational warning
  22463. // message.
  22464. type OperationAggregatedListWarning struct {
  22465. // Code: [Output Only] A warning code, if applicable. For example,
  22466. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22467. // the response.
  22468. //
  22469. // Possible values:
  22470. // "CLEANUP_FAILED"
  22471. // "DEPRECATED_RESOURCE_USED"
  22472. // "DEPRECATED_TYPE_USED"
  22473. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22474. // "EXPERIMENTAL_TYPE_USED"
  22475. // "EXTERNAL_API_WARNING"
  22476. // "FIELD_VALUE_OVERRIDEN"
  22477. // "INJECTED_KERNELS_DEPRECATED"
  22478. // "MISSING_TYPE_DEPENDENCY"
  22479. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22480. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22481. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22482. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22483. // "NEXT_HOP_NOT_RUNNING"
  22484. // "NOT_CRITICAL_ERROR"
  22485. // "NO_RESULTS_ON_PAGE"
  22486. // "REQUIRED_TOS_AGREEMENT"
  22487. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22488. // "RESOURCE_NOT_DELETED"
  22489. // "SCHEMA_VALIDATION_IGNORED"
  22490. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22491. // "UNDECLARED_PROPERTIES"
  22492. // "UNREACHABLE"
  22493. Code string `json:"code,omitempty"`
  22494. // Data: [Output Only] Metadata about this warning in key: value format.
  22495. // For example:
  22496. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22497. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  22498. // Message: [Output Only] A human-readable description of the warning
  22499. // code.
  22500. Message string `json:"message,omitempty"`
  22501. // ForceSendFields is a list of field names (e.g. "Code") to
  22502. // unconditionally include in API requests. By default, fields with
  22503. // empty values are omitted from API requests. However, any non-pointer,
  22504. // non-interface field appearing in ForceSendFields will be sent to the
  22505. // server regardless of whether the field is empty or not. This may be
  22506. // used to include empty fields in Patch requests.
  22507. ForceSendFields []string `json:"-"`
  22508. // NullFields is a list of field names (e.g. "Code") to include in API
  22509. // requests with the JSON null value. By default, fields with empty
  22510. // values are omitted from API requests. However, any field with an
  22511. // empty value appearing in NullFields will be sent to the server as
  22512. // null. It is an error if a field in this list has a non-empty value.
  22513. // This may be used to include null fields in Patch requests.
  22514. NullFields []string `json:"-"`
  22515. }
  22516. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22517. type NoMethod OperationAggregatedListWarning
  22518. raw := NoMethod(*s)
  22519. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22520. }
  22521. type OperationAggregatedListWarningData struct {
  22522. // Key: [Output Only] A key that provides more detail on the warning
  22523. // being returned. For example, for warnings where there are no results
  22524. // in a list request for a particular zone, this key might be scope and
  22525. // the key value might be the zone name. Other examples might be a key
  22526. // indicating a deprecated resource and a suggested replacement, or a
  22527. // warning about invalid network settings (for example, if an instance
  22528. // attempts to perform IP forwarding but is not enabled for IP
  22529. // forwarding).
  22530. Key string `json:"key,omitempty"`
  22531. // Value: [Output Only] A warning data value corresponding to the key.
  22532. Value string `json:"value,omitempty"`
  22533. // ForceSendFields is a list of field names (e.g. "Key") to
  22534. // unconditionally include in API requests. By default, fields with
  22535. // empty values are omitted from API requests. However, any non-pointer,
  22536. // non-interface field appearing in ForceSendFields will be sent to the
  22537. // server regardless of whether the field is empty or not. This may be
  22538. // used to include empty fields in Patch requests.
  22539. ForceSendFields []string `json:"-"`
  22540. // NullFields is a list of field names (e.g. "Key") to include in API
  22541. // requests with the JSON null value. By default, fields with empty
  22542. // values are omitted from API requests. However, any field with an
  22543. // empty value appearing in NullFields will be sent to the server as
  22544. // null. It is an error if a field in this list has a non-empty value.
  22545. // This may be used to include null fields in Patch requests.
  22546. NullFields []string `json:"-"`
  22547. }
  22548. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22549. type NoMethod OperationAggregatedListWarningData
  22550. raw := NoMethod(*s)
  22551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22552. }
  22553. // OperationList: Contains a list of Operation resources.
  22554. type OperationList struct {
  22555. // Id: [Output Only] The unique identifier for the resource. This
  22556. // identifier is defined by the server.
  22557. Id string `json:"id,omitempty"`
  22558. // Items: [Output Only] A list of Operation resources.
  22559. Items []*Operation `json:"items,omitempty"`
  22560. // Kind: [Output Only] Type of resource. Always compute#operations for
  22561. // Operations resource.
  22562. Kind string `json:"kind,omitempty"`
  22563. // NextPageToken: [Output Only] This token allows you to get the next
  22564. // page of results for list requests. If the number of results is larger
  22565. // than maxResults, use the nextPageToken as a value for the query
  22566. // parameter pageToken in the next list request. Subsequent list
  22567. // requests will have their own nextPageToken to continue paging through
  22568. // the results.
  22569. NextPageToken string `json:"nextPageToken,omitempty"`
  22570. // SelfLink: [Output Only] Server-defined URL for this resource.
  22571. SelfLink string `json:"selfLink,omitempty"`
  22572. // Warning: [Output Only] Informational warning message.
  22573. Warning *OperationListWarning `json:"warning,omitempty"`
  22574. // ServerResponse contains the HTTP response code and headers from the
  22575. // server.
  22576. googleapi.ServerResponse `json:"-"`
  22577. // ForceSendFields is a list of field names (e.g. "Id") to
  22578. // unconditionally include in API requests. By default, fields with
  22579. // empty values are omitted from API requests. However, any non-pointer,
  22580. // non-interface field appearing in ForceSendFields will be sent to the
  22581. // server regardless of whether the field is empty or not. This may be
  22582. // used to include empty fields in Patch requests.
  22583. ForceSendFields []string `json:"-"`
  22584. // NullFields is a list of field names (e.g. "Id") to include in API
  22585. // requests with the JSON null value. By default, fields with empty
  22586. // values are omitted from API requests. However, any field with an
  22587. // empty value appearing in NullFields will be sent to the server as
  22588. // null. It is an error if a field in this list has a non-empty value.
  22589. // This may be used to include null fields in Patch requests.
  22590. NullFields []string `json:"-"`
  22591. }
  22592. func (s *OperationList) MarshalJSON() ([]byte, error) {
  22593. type NoMethod OperationList
  22594. raw := NoMethod(*s)
  22595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22596. }
  22597. // OperationListWarning: [Output Only] Informational warning message.
  22598. type OperationListWarning struct {
  22599. // Code: [Output Only] A warning code, if applicable. For example,
  22600. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22601. // the response.
  22602. //
  22603. // Possible values:
  22604. // "CLEANUP_FAILED"
  22605. // "DEPRECATED_RESOURCE_USED"
  22606. // "DEPRECATED_TYPE_USED"
  22607. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22608. // "EXPERIMENTAL_TYPE_USED"
  22609. // "EXTERNAL_API_WARNING"
  22610. // "FIELD_VALUE_OVERRIDEN"
  22611. // "INJECTED_KERNELS_DEPRECATED"
  22612. // "MISSING_TYPE_DEPENDENCY"
  22613. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22614. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22615. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22616. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22617. // "NEXT_HOP_NOT_RUNNING"
  22618. // "NOT_CRITICAL_ERROR"
  22619. // "NO_RESULTS_ON_PAGE"
  22620. // "REQUIRED_TOS_AGREEMENT"
  22621. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22622. // "RESOURCE_NOT_DELETED"
  22623. // "SCHEMA_VALIDATION_IGNORED"
  22624. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22625. // "UNDECLARED_PROPERTIES"
  22626. // "UNREACHABLE"
  22627. Code string `json:"code,omitempty"`
  22628. // Data: [Output Only] Metadata about this warning in key: value format.
  22629. // For example:
  22630. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22631. Data []*OperationListWarningData `json:"data,omitempty"`
  22632. // Message: [Output Only] A human-readable description of the warning
  22633. // code.
  22634. Message string `json:"message,omitempty"`
  22635. // ForceSendFields is a list of field names (e.g. "Code") to
  22636. // unconditionally include in API requests. By default, fields with
  22637. // empty values are omitted from API requests. However, any non-pointer,
  22638. // non-interface field appearing in ForceSendFields will be sent to the
  22639. // server regardless of whether the field is empty or not. This may be
  22640. // used to include empty fields in Patch requests.
  22641. ForceSendFields []string `json:"-"`
  22642. // NullFields is a list of field names (e.g. "Code") to include in API
  22643. // requests with the JSON null value. By default, fields with empty
  22644. // values are omitted from API requests. However, any field with an
  22645. // empty value appearing in NullFields will be sent to the server as
  22646. // null. It is an error if a field in this list has a non-empty value.
  22647. // This may be used to include null fields in Patch requests.
  22648. NullFields []string `json:"-"`
  22649. }
  22650. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  22651. type NoMethod OperationListWarning
  22652. raw := NoMethod(*s)
  22653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22654. }
  22655. type OperationListWarningData struct {
  22656. // Key: [Output Only] A key that provides more detail on the warning
  22657. // being returned. For example, for warnings where there are no results
  22658. // in a list request for a particular zone, this key might be scope and
  22659. // the key value might be the zone name. Other examples might be a key
  22660. // indicating a deprecated resource and a suggested replacement, or a
  22661. // warning about invalid network settings (for example, if an instance
  22662. // attempts to perform IP forwarding but is not enabled for IP
  22663. // forwarding).
  22664. Key string `json:"key,omitempty"`
  22665. // Value: [Output Only] A warning data value corresponding to the key.
  22666. Value string `json:"value,omitempty"`
  22667. // ForceSendFields is a list of field names (e.g. "Key") to
  22668. // unconditionally include in API requests. By default, fields with
  22669. // empty values are omitted from API requests. However, any non-pointer,
  22670. // non-interface field appearing in ForceSendFields will be sent to the
  22671. // server regardless of whether the field is empty or not. This may be
  22672. // used to include empty fields in Patch requests.
  22673. ForceSendFields []string `json:"-"`
  22674. // NullFields is a list of field names (e.g. "Key") to include in API
  22675. // requests with the JSON null value. By default, fields with empty
  22676. // values are omitted from API requests. However, any field with an
  22677. // empty value appearing in NullFields will be sent to the server as
  22678. // null. It is an error if a field in this list has a non-empty value.
  22679. // This may be used to include null fields in Patch requests.
  22680. NullFields []string `json:"-"`
  22681. }
  22682. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  22683. type NoMethod OperationListWarningData
  22684. raw := NoMethod(*s)
  22685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22686. }
  22687. type OperationsScopedList struct {
  22688. // Operations: [Output Only] A list of operations contained in this
  22689. // scope.
  22690. Operations []*Operation `json:"operations,omitempty"`
  22691. // Warning: [Output Only] Informational warning which replaces the list
  22692. // of operations when the list is empty.
  22693. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  22694. // ForceSendFields is a list of field names (e.g. "Operations") to
  22695. // unconditionally include in API requests. By default, fields with
  22696. // empty values are omitted from API requests. However, any non-pointer,
  22697. // non-interface field appearing in ForceSendFields will be sent to the
  22698. // server regardless of whether the field is empty or not. This may be
  22699. // used to include empty fields in Patch requests.
  22700. ForceSendFields []string `json:"-"`
  22701. // NullFields is a list of field names (e.g. "Operations") to include in
  22702. // API requests with the JSON null value. By default, fields with empty
  22703. // values are omitted from API requests. However, any field with an
  22704. // empty value appearing in NullFields will be sent to the server as
  22705. // null. It is an error if a field in this list has a non-empty value.
  22706. // This may be used to include null fields in Patch requests.
  22707. NullFields []string `json:"-"`
  22708. }
  22709. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  22710. type NoMethod OperationsScopedList
  22711. raw := NoMethod(*s)
  22712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22713. }
  22714. // OperationsScopedListWarning: [Output Only] Informational warning
  22715. // which replaces the list of operations when the list is empty.
  22716. type OperationsScopedListWarning struct {
  22717. // Code: [Output Only] A warning code, if applicable. For example,
  22718. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22719. // the response.
  22720. //
  22721. // Possible values:
  22722. // "CLEANUP_FAILED"
  22723. // "DEPRECATED_RESOURCE_USED"
  22724. // "DEPRECATED_TYPE_USED"
  22725. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22726. // "EXPERIMENTAL_TYPE_USED"
  22727. // "EXTERNAL_API_WARNING"
  22728. // "FIELD_VALUE_OVERRIDEN"
  22729. // "INJECTED_KERNELS_DEPRECATED"
  22730. // "MISSING_TYPE_DEPENDENCY"
  22731. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22732. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22733. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22734. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22735. // "NEXT_HOP_NOT_RUNNING"
  22736. // "NOT_CRITICAL_ERROR"
  22737. // "NO_RESULTS_ON_PAGE"
  22738. // "REQUIRED_TOS_AGREEMENT"
  22739. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22740. // "RESOURCE_NOT_DELETED"
  22741. // "SCHEMA_VALIDATION_IGNORED"
  22742. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22743. // "UNDECLARED_PROPERTIES"
  22744. // "UNREACHABLE"
  22745. Code string `json:"code,omitempty"`
  22746. // Data: [Output Only] Metadata about this warning in key: value format.
  22747. // For example:
  22748. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22749. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  22750. // Message: [Output Only] A human-readable description of the warning
  22751. // code.
  22752. Message string `json:"message,omitempty"`
  22753. // ForceSendFields is a list of field names (e.g. "Code") to
  22754. // unconditionally include in API requests. By default, fields with
  22755. // empty values are omitted from API requests. However, any non-pointer,
  22756. // non-interface field appearing in ForceSendFields will be sent to the
  22757. // server regardless of whether the field is empty or not. This may be
  22758. // used to include empty fields in Patch requests.
  22759. ForceSendFields []string `json:"-"`
  22760. // NullFields is a list of field names (e.g. "Code") to include in API
  22761. // requests with the JSON null value. By default, fields with empty
  22762. // values are omitted from API requests. However, any field with an
  22763. // empty value appearing in NullFields will be sent to the server as
  22764. // null. It is an error if a field in this list has a non-empty value.
  22765. // This may be used to include null fields in Patch requests.
  22766. NullFields []string `json:"-"`
  22767. }
  22768. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  22769. type NoMethod OperationsScopedListWarning
  22770. raw := NoMethod(*s)
  22771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22772. }
  22773. type OperationsScopedListWarningData struct {
  22774. // Key: [Output Only] A key that provides more detail on the warning
  22775. // being returned. For example, for warnings where there are no results
  22776. // in a list request for a particular zone, this key might be scope and
  22777. // the key value might be the zone name. Other examples might be a key
  22778. // indicating a deprecated resource and a suggested replacement, or a
  22779. // warning about invalid network settings (for example, if an instance
  22780. // attempts to perform IP forwarding but is not enabled for IP
  22781. // forwarding).
  22782. Key string `json:"key,omitempty"`
  22783. // Value: [Output Only] A warning data value corresponding to the key.
  22784. Value string `json:"value,omitempty"`
  22785. // ForceSendFields is a list of field names (e.g. "Key") to
  22786. // unconditionally include in API requests. By default, fields with
  22787. // empty values are omitted from API requests. However, any non-pointer,
  22788. // non-interface field appearing in ForceSendFields will be sent to the
  22789. // server regardless of whether the field is empty or not. This may be
  22790. // used to include empty fields in Patch requests.
  22791. ForceSendFields []string `json:"-"`
  22792. // NullFields is a list of field names (e.g. "Key") to include in API
  22793. // requests with the JSON null value. By default, fields with empty
  22794. // values are omitted from API requests. However, any field with an
  22795. // empty value appearing in NullFields will be sent to the server as
  22796. // null. It is an error if a field in this list has a non-empty value.
  22797. // This may be used to include null fields in Patch requests.
  22798. NullFields []string `json:"-"`
  22799. }
  22800. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  22801. type NoMethod OperationsScopedListWarningData
  22802. raw := NoMethod(*s)
  22803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22804. }
  22805. // OriginAuthenticationMethod: Configuration for the origin
  22806. // authentication method.
  22807. type OriginAuthenticationMethod struct {
  22808. Jwt *Jwt `json:"jwt,omitempty"`
  22809. // ForceSendFields is a list of field names (e.g. "Jwt") to
  22810. // unconditionally include in API requests. By default, fields with
  22811. // empty values are omitted from API requests. However, any non-pointer,
  22812. // non-interface field appearing in ForceSendFields will be sent to the
  22813. // server regardless of whether the field is empty or not. This may be
  22814. // used to include empty fields in Patch requests.
  22815. ForceSendFields []string `json:"-"`
  22816. // NullFields is a list of field names (e.g. "Jwt") to include in API
  22817. // requests with the JSON null value. By default, fields with empty
  22818. // values are omitted from API requests. However, any field with an
  22819. // empty value appearing in NullFields will be sent to the server as
  22820. // null. It is an error if a field in this list has a non-empty value.
  22821. // This may be used to include null fields in Patch requests.
  22822. NullFields []string `json:"-"`
  22823. }
  22824. func (s *OriginAuthenticationMethod) MarshalJSON() ([]byte, error) {
  22825. type NoMethod OriginAuthenticationMethod
  22826. raw := NoMethod(*s)
  22827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22828. }
  22829. // OutlierDetection: Settings controlling eviction of unhealthy hosts
  22830. // from the load balancing pool.
  22831. type OutlierDetection struct {
  22832. // BaseEjectionTime: The base time that a host is ejected for. The real
  22833. // time is equal to the base time multiplied by the number of times the
  22834. // host has been ejected. Defaults to 30000ms or 30s.
  22835. BaseEjectionTime *Duration `json:"baseEjectionTime,omitempty"`
  22836. // ConsecutiveErrors: Number of errors before a host is ejected from the
  22837. // connection pool. When the backend host is accessed over HTTP, a 5xx
  22838. // return code qualifies as an error. Defaults to 5.
  22839. ConsecutiveErrors int64 `json:"consecutiveErrors,omitempty"`
  22840. // ConsecutiveGatewayFailure: The number of consecutive gateway failures
  22841. // (502, 503, 504 status or connection errors that are mapped to one of
  22842. // those status codes) before a consecutive gateway failure ejection
  22843. // occurs. Defaults to 5.
  22844. ConsecutiveGatewayFailure int64 `json:"consecutiveGatewayFailure,omitempty"`
  22845. // EnforcingConsecutiveErrors: The percentage chance that a host will be
  22846. // actually ejected when an outlier status is detected through
  22847. // consecutive 5xx. This setting can be used to disable ejection or to
  22848. // ramp it up slowly. Defaults to 100.
  22849. EnforcingConsecutiveErrors int64 `json:"enforcingConsecutiveErrors,omitempty"`
  22850. // EnforcingConsecutiveGatewayFailure: The percentage chance that a host
  22851. // will be actually ejected when an outlier status is detected through
  22852. // consecutive gateway failures. This setting can be used to disable
  22853. // ejection or to ramp it up slowly. Defaults to 0.
  22854. EnforcingConsecutiveGatewayFailure int64 `json:"enforcingConsecutiveGatewayFailure,omitempty"`
  22855. // EnforcingSuccessRate: The percentage chance that a host will be
  22856. // actually ejected when an outlier status is detected through success
  22857. // rate statistics. This setting can be used to disable ejection or to
  22858. // ramp it up slowly. Defaults to 100.
  22859. EnforcingSuccessRate int64 `json:"enforcingSuccessRate,omitempty"`
  22860. // Interval: Time interval between ejection sweep analysis. This can
  22861. // result in both new ejections as well as hosts being returned to
  22862. // service. Defaults to 10 seconds.
  22863. Interval *Duration `json:"interval,omitempty"`
  22864. // MaxEjectionPercent: Maximum percentage of hosts in the load balancing
  22865. // pool for the backend service that can be ejected. Defaults to 10%.
  22866. MaxEjectionPercent int64 `json:"maxEjectionPercent,omitempty"`
  22867. // SuccessRateMinimumHosts: The number of hosts in a cluster that must
  22868. // have enough request volume to detect success rate outliers. If the
  22869. // number of hosts is less than this setting, outlier detection via
  22870. // success rate statistics is not performed for any host in the cluster.
  22871. // Defaults to 5.
  22872. SuccessRateMinimumHosts int64 `json:"successRateMinimumHosts,omitempty"`
  22873. // SuccessRateRequestVolume: The minimum number of total requests that
  22874. // must be collected in one interval (as defined by the interval
  22875. // duration above) to include this host in success rate based outlier
  22876. // detection. If the volume is lower than this setting, outlier
  22877. // detection via success rate statistics is not performed for that host.
  22878. // Defaults to 100.
  22879. SuccessRateRequestVolume int64 `json:"successRateRequestVolume,omitempty"`
  22880. // SuccessRateStdevFactor: This factor is used to determine the ejection
  22881. // threshold for success rate outlier ejection. The ejection threshold
  22882. // is the difference between the mean success rate, and the product of
  22883. // this factor and the standard deviation of the mean success rate: mean
  22884. // - (stdev * success_rate_stdev_factor). This factor is divided by a
  22885. // thousand to get a double. That is, if the desired factor is 1.9, the
  22886. // runtime value should be 1900. Defaults to 1900.
  22887. SuccessRateStdevFactor int64 `json:"successRateStdevFactor,omitempty"`
  22888. // ForceSendFields is a list of field names (e.g. "BaseEjectionTime") to
  22889. // unconditionally include in API requests. By default, fields with
  22890. // empty values are omitted from API requests. However, any non-pointer,
  22891. // non-interface field appearing in ForceSendFields will be sent to the
  22892. // server regardless of whether the field is empty or not. This may be
  22893. // used to include empty fields in Patch requests.
  22894. ForceSendFields []string `json:"-"`
  22895. // NullFields is a list of field names (e.g. "BaseEjectionTime") to
  22896. // include in API requests with the JSON null value. By default, fields
  22897. // with empty values are omitted from API requests. However, any field
  22898. // with an empty value appearing in NullFields will be sent to the
  22899. // server as null. It is an error if a field in this list has a
  22900. // non-empty value. This may be used to include null fields in Patch
  22901. // requests.
  22902. NullFields []string `json:"-"`
  22903. }
  22904. func (s *OutlierDetection) MarshalJSON() ([]byte, error) {
  22905. type NoMethod OutlierDetection
  22906. raw := NoMethod(*s)
  22907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22908. }
  22909. // PathMatcher: A matcher for the path portion of the URL. The
  22910. // BackendService from the longest-matched rule will serve the URL. If
  22911. // no rule was matched, the default service will be used.
  22912. type PathMatcher struct {
  22913. // DefaultRouteAction: defaultRouteAction takes effect when none of the
  22914. // pathRules or routeRules match. The load balancer performs advanced
  22915. // routing actions like URL rewrites, header transformations, etc. prior
  22916. // to forwarding the request to the selected backend. If
  22917. // defaultRouteAction specifies any weightedBackendServices,
  22918. // defaultService must not be set. Conversely if defaultService is set,
  22919. // defaultRouteAction cannot contain any weightedBackendServices.
  22920. // Only one of defaultRouteAction or defaultUrlRedirect must be set.
  22921. DefaultRouteAction *HttpRouteAction `json:"defaultRouteAction,omitempty"`
  22922. // DefaultService: The full or partial URL to the BackendService
  22923. // resource. This will be used if none of the pathRules or routeRules
  22924. // defined by this PathMatcher are matched. For example, the following
  22925. // are all valid URLs to a BackendService resource:
  22926. // -
  22927. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  22928. // - compute/v1/projects/project/global/backendServices/backendService
  22929. //
  22930. // - global/backendServices/backendService If defaultRouteAction is
  22931. // additionally specified, advanced routing actions like URL Rewrites,
  22932. // etc. take effect prior to sending the request to the backend.
  22933. // However, if defaultService is specified, defaultRouteAction cannot
  22934. // contain any weightedBackendServices. Conversely, if
  22935. // defaultRouteAction specifies any weightedBackendServices,
  22936. // defaultService must not be specified.
  22937. // Only one of defaultService, defaultUrlRedirect or
  22938. // defaultRouteAction.weightedBackendService must be set.
  22939. // Authorization requires one or more of the following Google IAM
  22940. // permissions on the specified resource default_service:
  22941. // - compute.backendBuckets.use
  22942. // - compute.backendServices.use
  22943. DefaultService string `json:"defaultService,omitempty"`
  22944. // DefaultUrlRedirect: When when none of the specified pathRules or
  22945. // routeRules match, the request is redirected to a URL specified by
  22946. // defaultUrlRedirect.
  22947. // If defaultUrlRedirect is specified, defaultService or
  22948. // defaultRouteAction must not be set.
  22949. DefaultUrlRedirect *HttpRedirectAction `json:"defaultUrlRedirect,omitempty"`
  22950. // Description: An optional description of this resource. Provide this
  22951. // property when you create the resource.
  22952. Description string `json:"description,omitempty"`
  22953. // HeaderAction: Specifies changes to request and response headers that
  22954. // need to take effect for the selected backendService.
  22955. // HeaderAction specified here are applied after the matching
  22956. // HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap
  22957. HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
  22958. // Name: The name to which this PathMatcher is referred by the HostRule.
  22959. Name string `json:"name,omitempty"`
  22960. // PathRules: The list of path rules. Use this list instead of
  22961. // routeRules when routing based on simple path matching is all that's
  22962. // required. The order by which path rules are specified does not
  22963. // matter. Matches are always done on the longest-path-first basis.
  22964. // For example: a pathRule with a path /a/b/c/* will match before /a/b/*
  22965. // irrespective of the order in which those paths appear in this
  22966. // list.
  22967. // Only one of pathRules or routeRules must be set.
  22968. PathRules []*PathRule `json:"pathRules,omitempty"`
  22969. // RouteRules: The list of ordered HTTP route rules. Use this list
  22970. // instead of pathRules when advanced route matching and routing actions
  22971. // are desired. The order of specifying routeRules matters: the first
  22972. // rule that matches will cause its specified routing action to take
  22973. // effect.
  22974. // Only one of pathRules or routeRules must be set.
  22975. RouteRules []*HttpRouteRule `json:"routeRules,omitempty"`
  22976. // ForceSendFields is a list of field names (e.g. "DefaultRouteAction")
  22977. // to unconditionally include in API requests. By default, fields with
  22978. // empty values are omitted from API requests. However, any non-pointer,
  22979. // non-interface field appearing in ForceSendFields will be sent to the
  22980. // server regardless of whether the field is empty or not. This may be
  22981. // used to include empty fields in Patch requests.
  22982. ForceSendFields []string `json:"-"`
  22983. // NullFields is a list of field names (e.g. "DefaultRouteAction") to
  22984. // include in API requests with the JSON null value. By default, fields
  22985. // with empty values are omitted from API requests. However, any field
  22986. // with an empty value appearing in NullFields will be sent to the
  22987. // server as null. It is an error if a field in this list has a
  22988. // non-empty value. This may be used to include null fields in Patch
  22989. // requests.
  22990. NullFields []string `json:"-"`
  22991. }
  22992. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  22993. type NoMethod PathMatcher
  22994. raw := NoMethod(*s)
  22995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22996. }
  22997. // PathRule: A path-matching rule for a URL. If matched, will use the
  22998. // specified BackendService to handle the traffic arriving at this URL.
  22999. type PathRule struct {
  23000. // Paths: The list of path patterns to match. Each must start with / and
  23001. // the only place a * is allowed is at the end following a /. The string
  23002. // fed to the path matcher does not include any text after the first ?
  23003. // or #, and those chars are not allowed here.
  23004. Paths []string `json:"paths,omitempty"`
  23005. // RouteAction: In response to a matching path, the load balancer
  23006. // performs advanced routing actions like URL rewrites, header
  23007. // transformations, etc. prior to forwarding the request to the selected
  23008. // backend. If routeAction specifies any weightedBackendServices,
  23009. // service must not be set. Conversely if service is set, routeAction
  23010. // cannot contain any weightedBackendServices.
  23011. // Only one of routeAction or urlRedirect must be set.
  23012. RouteAction *HttpRouteAction `json:"routeAction,omitempty"`
  23013. // Service: The full or partial URL of the backend service resource to
  23014. // which traffic is directed if this rule is matched. If routeAction is
  23015. // additionally specified, advanced routing actions like URL Rewrites,
  23016. // etc. take effect prior to sending the request to the backend.
  23017. // However, if service is specified, routeAction cannot contain any
  23018. // weightedBackendService s. Conversely, if routeAction specifies any
  23019. // weightedBackendServices, service must not be specified.
  23020. // Only one of urlRedirect, service or
  23021. // routeAction.weightedBackendService must be set.
  23022. Service string `json:"service,omitempty"`
  23023. // UrlRedirect: When a path pattern is matched, the request is
  23024. // redirected to a URL specified by urlRedirect.
  23025. // If urlRedirect is specified, service or routeAction must not be set.
  23026. UrlRedirect *HttpRedirectAction `json:"urlRedirect,omitempty"`
  23027. // ForceSendFields is a list of field names (e.g. "Paths") to
  23028. // unconditionally include in API requests. By default, fields with
  23029. // empty values are omitted from API requests. However, any non-pointer,
  23030. // non-interface field appearing in ForceSendFields will be sent to the
  23031. // server regardless of whether the field is empty or not. This may be
  23032. // used to include empty fields in Patch requests.
  23033. ForceSendFields []string `json:"-"`
  23034. // NullFields is a list of field names (e.g. "Paths") to include in API
  23035. // requests with the JSON null value. By default, fields with empty
  23036. // values are omitted from API requests. However, any field with an
  23037. // empty value appearing in NullFields will be sent to the server as
  23038. // null. It is an error if a field in this list has a non-empty value.
  23039. // This may be used to include null fields in Patch requests.
  23040. NullFields []string `json:"-"`
  23041. }
  23042. func (s *PathRule) MarshalJSON() ([]byte, error) {
  23043. type NoMethod PathRule
  23044. raw := NoMethod(*s)
  23045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23046. }
  23047. // PeerAuthenticationMethod: Configuration for the peer authentication
  23048. // method.
  23049. type PeerAuthenticationMethod struct {
  23050. // Mtls: Set if mTLS is used for peer authentication.
  23051. Mtls *MutualTls `json:"mtls,omitempty"`
  23052. // ForceSendFields is a list of field names (e.g. "Mtls") to
  23053. // unconditionally include in API requests. By default, fields with
  23054. // empty values are omitted from API requests. However, any non-pointer,
  23055. // non-interface field appearing in ForceSendFields will be sent to the
  23056. // server regardless of whether the field is empty or not. This may be
  23057. // used to include empty fields in Patch requests.
  23058. ForceSendFields []string `json:"-"`
  23059. // NullFields is a list of field names (e.g. "Mtls") to include in API
  23060. // requests with the JSON null value. By default, fields with empty
  23061. // values are omitted from API requests. However, any field with an
  23062. // empty value appearing in NullFields will be sent to the server as
  23063. // null. It is an error if a field in this list has a non-empty value.
  23064. // This may be used to include null fields in Patch requests.
  23065. NullFields []string `json:"-"`
  23066. }
  23067. func (s *PeerAuthenticationMethod) MarshalJSON() ([]byte, error) {
  23068. type NoMethod PeerAuthenticationMethod
  23069. raw := NoMethod(*s)
  23070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23071. }
  23072. type PerInstanceConfig struct {
  23073. // Fingerprint: Fingerprint of this per-instance config. This field may
  23074. // be used in optimistic locking. It will be ignored when inserting a
  23075. // per-instance config. An up-to-date fingerprint must be provided in
  23076. // order to update an existing per-instance config or the field needs to
  23077. // be unset.
  23078. Fingerprint string `json:"fingerprint,omitempty"`
  23079. // Instance: The URL of the instance. Serves as a merge key during
  23080. // UpdatePerInstanceConfigs operation, i.e. if per-instance config with
  23081. // the same instance URL exists then it will be updated, otherwise a new
  23082. // one will be created.
  23083. Instance string `json:"instance,omitempty"`
  23084. // Name: The name of the per-instance config and the corresponding
  23085. // instance. Serves as a merge key during UpdatePerInstanceConfigs
  23086. // operation, i.e. if per-instance config with the same name exists then
  23087. // it will be updated, otherwise a new one will be created for the VM
  23088. // instance with the same name. An attempt to create a per-instance
  23089. // config for a VM instance that either doesn't exist or is not part of
  23090. // the group will result in a failure.
  23091. Name string `json:"name,omitempty"`
  23092. Override *ManagedInstanceOverride `json:"override,omitempty"`
  23093. // PreservedState: Intended preserved state for the given instance. Does
  23094. // not contain state generated based on Stateful Policy.
  23095. PreservedState *PreservedState `json:"preservedState,omitempty"`
  23096. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  23097. // unconditionally include in API requests. By default, fields with
  23098. // empty values are omitted from API requests. However, any non-pointer,
  23099. // non-interface field appearing in ForceSendFields will be sent to the
  23100. // server regardless of whether the field is empty or not. This may be
  23101. // used to include empty fields in Patch requests.
  23102. ForceSendFields []string `json:"-"`
  23103. // NullFields is a list of field names (e.g. "Fingerprint") to include
  23104. // in API requests with the JSON null value. By default, fields with
  23105. // empty values are omitted from API requests. However, any field with
  23106. // an empty value appearing in NullFields will be sent to the server as
  23107. // null. It is an error if a field in this list has a non-empty value.
  23108. // This may be used to include null fields in Patch requests.
  23109. NullFields []string `json:"-"`
  23110. }
  23111. func (s *PerInstanceConfig) MarshalJSON() ([]byte, error) {
  23112. type NoMethod PerInstanceConfig
  23113. raw := NoMethod(*s)
  23114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23115. }
  23116. // Permission: All fields defined in a permission are ANDed.
  23117. type Permission struct {
  23118. // Constraints: Extra custom constraints. The constraints are ANDed
  23119. // together.
  23120. Constraints []*PermissionConstraint `json:"constraints,omitempty"`
  23121. // Hosts: Used in Ingress or Egress Gateway cases to specify hosts that
  23122. // the policy applies to. Exact match, prefix match, and suffix match
  23123. // are supported.
  23124. Hosts []string `json:"hosts,omitempty"`
  23125. // Methods: HTTP method.
  23126. Methods []string `json:"methods,omitempty"`
  23127. // NotHosts: Negate of hosts. Specifies exclusions.
  23128. NotHosts []string `json:"notHosts,omitempty"`
  23129. // NotMethods: Negate of methods. Specifies exclusions.
  23130. NotMethods []string `json:"notMethods,omitempty"`
  23131. // NotPaths: Negate of paths. Specifies exclusions.
  23132. NotPaths []string `json:"notPaths,omitempty"`
  23133. // NotPorts: Negate of ports. Specifies exclusions.
  23134. NotPorts []string `json:"notPorts,omitempty"`
  23135. // Paths: HTTP request paths or gRPC methods. Exact match, prefix match,
  23136. // and suffix match are supported.
  23137. Paths []string `json:"paths,omitempty"`
  23138. // Ports: Port names or numbers.
  23139. Ports []string `json:"ports,omitempty"`
  23140. // ForceSendFields is a list of field names (e.g. "Constraints") to
  23141. // unconditionally include in API requests. By default, fields with
  23142. // empty values are omitted from API requests. However, any non-pointer,
  23143. // non-interface field appearing in ForceSendFields will be sent to the
  23144. // server regardless of whether the field is empty or not. This may be
  23145. // used to include empty fields in Patch requests.
  23146. ForceSendFields []string `json:"-"`
  23147. // NullFields is a list of field names (e.g. "Constraints") to include
  23148. // in API requests with the JSON null value. By default, fields with
  23149. // empty values are omitted from API requests. However, any field with
  23150. // an empty value appearing in NullFields will be sent to the server as
  23151. // null. It is an error if a field in this list has a non-empty value.
  23152. // This may be used to include null fields in Patch requests.
  23153. NullFields []string `json:"-"`
  23154. }
  23155. func (s *Permission) MarshalJSON() ([]byte, error) {
  23156. type NoMethod Permission
  23157. raw := NoMethod(*s)
  23158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23159. }
  23160. // PermissionConstraint: Custom constraint that specifies a key and a
  23161. // list of allowed values for Istio attributes.
  23162. type PermissionConstraint struct {
  23163. // Key: Key of the constraint.
  23164. Key string `json:"key,omitempty"`
  23165. // Values: A list of allowed values.
  23166. Values []string `json:"values,omitempty"`
  23167. // ForceSendFields is a list of field names (e.g. "Key") to
  23168. // unconditionally include in API requests. By default, fields with
  23169. // empty values are omitted from API requests. However, any non-pointer,
  23170. // non-interface field appearing in ForceSendFields will be sent to the
  23171. // server regardless of whether the field is empty or not. This may be
  23172. // used to include empty fields in Patch requests.
  23173. ForceSendFields []string `json:"-"`
  23174. // NullFields is a list of field names (e.g. "Key") to include in API
  23175. // requests with the JSON null value. By default, fields with empty
  23176. // values are omitted from API requests. However, any field with an
  23177. // empty value appearing in NullFields will be sent to the server as
  23178. // null. It is an error if a field in this list has a non-empty value.
  23179. // This may be used to include null fields in Patch requests.
  23180. NullFields []string `json:"-"`
  23181. }
  23182. func (s *PermissionConstraint) MarshalJSON() ([]byte, error) {
  23183. type NoMethod PermissionConstraint
  23184. raw := NoMethod(*s)
  23185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23186. }
  23187. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  23188. // used to specify access control policies for Cloud Platform
  23189. // resources.
  23190. //
  23191. //
  23192. //
  23193. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  23194. // of `members` to a `role`, where the members can be user accounts,
  23195. // Google groups, Google domains, and service accounts. A `role` is a
  23196. // named list of permissions defined by IAM.
  23197. //
  23198. // **JSON Example**
  23199. //
  23200. // { "bindings": [ { "role": "roles/owner", "members": [
  23201. // "user:mike@example.com", "group:admins@example.com",
  23202. // "domain:google.com",
  23203. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  23204. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  23205. // }
  23206. //
  23207. // **YAML Example**
  23208. //
  23209. // bindings: - members: - user:mike@example.com -
  23210. // group:admins@example.com - domain:google.com -
  23211. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  23212. // roles/owner - members: - user:sean@example.com role:
  23213. // roles/viewer
  23214. //
  23215. //
  23216. //
  23217. // For a description of IAM and its features, see the [IAM developer's
  23218. // guide](https://cloud.google.com/iam/docs).
  23219. type Policy struct {
  23220. // AuditConfigs: Specifies cloud audit logging configuration for this
  23221. // policy.
  23222. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  23223. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  23224. // no members will result in an error.
  23225. Bindings []*Binding `json:"bindings,omitempty"`
  23226. // Etag: `etag` is used for optimistic concurrency control as a way to
  23227. // help prevent simultaneous updates of a policy from overwriting each
  23228. // other. It is strongly suggested that systems make use of the `etag`
  23229. // in the read-modify-write cycle to perform policy updates in order to
  23230. // avoid race conditions: An `etag` is returned in the response to
  23231. // `getIamPolicy`, and systems are expected to put that etag in the
  23232. // request to `setIamPolicy` to ensure that their change will be applied
  23233. // to the same version of the policy.
  23234. //
  23235. // If no `etag` is provided in the call to `setIamPolicy`, then the
  23236. // existing policy is overwritten blindly.
  23237. Etag string `json:"etag,omitempty"`
  23238. IamOwned bool `json:"iamOwned,omitempty"`
  23239. // Rules: If more than one rule is specified, the rules are applied in
  23240. // the following manner: - All matching LOG rules are always applied. -
  23241. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  23242. // will be applied if one or more matching rule requires logging. -
  23243. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  23244. // granted. Logging will be applied if one or more matching rule
  23245. // requires logging. - Otherwise, if no rule applies, permission is
  23246. // denied.
  23247. Rules []*Rule `json:"rules,omitempty"`
  23248. // Version: Deprecated.
  23249. Version int64 `json:"version,omitempty"`
  23250. // ServerResponse contains the HTTP response code and headers from the
  23251. // server.
  23252. googleapi.ServerResponse `json:"-"`
  23253. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  23254. // unconditionally include in API requests. By default, fields with
  23255. // empty values are omitted from API requests. However, any non-pointer,
  23256. // non-interface field appearing in ForceSendFields will be sent to the
  23257. // server regardless of whether the field is empty or not. This may be
  23258. // used to include empty fields in Patch requests.
  23259. ForceSendFields []string `json:"-"`
  23260. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  23261. // in API requests with the JSON null value. By default, fields with
  23262. // empty values are omitted from API requests. However, any field with
  23263. // an empty value appearing in NullFields will be sent to the server as
  23264. // null. It is an error if a field in this list has a non-empty value.
  23265. // This may be used to include null fields in Patch requests.
  23266. NullFields []string `json:"-"`
  23267. }
  23268. func (s *Policy) MarshalJSON() ([]byte, error) {
  23269. type NoMethod Policy
  23270. raw := NoMethod(*s)
  23271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23272. }
  23273. type PreconfiguredWafSet struct {
  23274. // ExpressionSets: List of entities that are currently supported for WAF
  23275. // rules.
  23276. ExpressionSets []*WafExpressionSet `json:"expressionSets,omitempty"`
  23277. // ForceSendFields is a list of field names (e.g. "ExpressionSets") to
  23278. // unconditionally include in API requests. By default, fields with
  23279. // empty values are omitted from API requests. However, any non-pointer,
  23280. // non-interface field appearing in ForceSendFields will be sent to the
  23281. // server regardless of whether the field is empty or not. This may be
  23282. // used to include empty fields in Patch requests.
  23283. ForceSendFields []string `json:"-"`
  23284. // NullFields is a list of field names (e.g. "ExpressionSets") to
  23285. // include in API requests with the JSON null value. By default, fields
  23286. // with empty values are omitted from API requests. However, any field
  23287. // with an empty value appearing in NullFields will be sent to the
  23288. // server as null. It is an error if a field in this list has a
  23289. // non-empty value. This may be used to include null fields in Patch
  23290. // requests.
  23291. NullFields []string `json:"-"`
  23292. }
  23293. func (s *PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
  23294. type NoMethod PreconfiguredWafSet
  23295. raw := NoMethod(*s)
  23296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23297. }
  23298. // PreservedState: Preserved state for a given instance.
  23299. type PreservedState struct {
  23300. // Disks: Preserved disks defined for this instance. This map is keyed
  23301. // with the device names of the disks.
  23302. Disks map[string]PreservedStatePreservedDisk `json:"disks,omitempty"`
  23303. // Metadata: Preserved metadata defined for this instance.
  23304. Metadata map[string]string `json:"metadata,omitempty"`
  23305. // ForceSendFields is a list of field names (e.g. "Disks") to
  23306. // unconditionally include in API requests. By default, fields with
  23307. // empty values are omitted from API requests. However, any non-pointer,
  23308. // non-interface field appearing in ForceSendFields will be sent to the
  23309. // server regardless of whether the field is empty or not. This may be
  23310. // used to include empty fields in Patch requests.
  23311. ForceSendFields []string `json:"-"`
  23312. // NullFields is a list of field names (e.g. "Disks") to include in API
  23313. // requests with the JSON null value. By default, fields with empty
  23314. // values are omitted from API requests. However, any field with an
  23315. // empty value appearing in NullFields will be sent to the server as
  23316. // null. It is an error if a field in this list has a non-empty value.
  23317. // This may be used to include null fields in Patch requests.
  23318. NullFields []string `json:"-"`
  23319. }
  23320. func (s *PreservedState) MarshalJSON() ([]byte, error) {
  23321. type NoMethod PreservedState
  23322. raw := NoMethod(*s)
  23323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23324. }
  23325. type PreservedStatePreservedDisk struct {
  23326. // AutoDelete: These stateful disks will never be deleted during
  23327. // autohealing, update, instance recreate operations. This flag is used
  23328. // to configure if the disk should be deleted after it is no longer used
  23329. // by the group, e.g. when the given instance or the whole MIG is
  23330. // deleted. Note: disks attached in READ_ONLY mode cannot be
  23331. // auto-deleted.
  23332. //
  23333. // Possible values:
  23334. // "NEVER"
  23335. // "WHEN_NOT_IN_USE"
  23336. AutoDelete string `json:"autoDelete,omitempty"`
  23337. // Mode: The mode in which to attach this disk, either READ_WRITE or
  23338. // READ_ONLY. If not specified, the default is to attach the disk in
  23339. // READ_WRITE mode.
  23340. //
  23341. // Possible values:
  23342. // "READ_ONLY"
  23343. // "READ_WRITE"
  23344. Mode string `json:"mode,omitempty"`
  23345. // Source: The URL of the disk resource that is stateful and should be
  23346. // attached to the VM instance.
  23347. Source string `json:"source,omitempty"`
  23348. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  23349. // unconditionally include in API requests. By default, fields with
  23350. // empty values are omitted from API requests. However, any non-pointer,
  23351. // non-interface field appearing in ForceSendFields will be sent to the
  23352. // server regardless of whether the field is empty or not. This may be
  23353. // used to include empty fields in Patch requests.
  23354. ForceSendFields []string `json:"-"`
  23355. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  23356. // API requests with the JSON null value. By default, fields with empty
  23357. // values are omitted from API requests. However, any field with an
  23358. // empty value appearing in NullFields will be sent to the server as
  23359. // null. It is an error if a field in this list has a non-empty value.
  23360. // This may be used to include null fields in Patch requests.
  23361. NullFields []string `json:"-"`
  23362. }
  23363. func (s *PreservedStatePreservedDisk) MarshalJSON() ([]byte, error) {
  23364. type NoMethod PreservedStatePreservedDisk
  23365. raw := NoMethod(*s)
  23366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23367. }
  23368. // Principal: All fields defined in a principal are ANDed.
  23369. type Principal struct {
  23370. // Condition: An expression to specify custom condition.
  23371. Condition string `json:"condition,omitempty"`
  23372. // Groups: The groups the principal belongs to. Exact match, prefix
  23373. // match, and suffix match are supported.
  23374. Groups []string `json:"groups,omitempty"`
  23375. // Ips: IPv4 or IPv6 address or range (In CIDR format)
  23376. Ips []string `json:"ips,omitempty"`
  23377. // Namespaces: The namespaces. Exact match, prefix match, and suffix
  23378. // match are supported.
  23379. Namespaces []string `json:"namespaces,omitempty"`
  23380. // NotGroups: Negate of groups. Specifies exclusions.
  23381. NotGroups []string `json:"notGroups,omitempty"`
  23382. // NotIps: Negate of IPs. Specifies exclusions.
  23383. NotIps []string `json:"notIps,omitempty"`
  23384. // NotNamespaces: Negate of namespaces. Specifies exclusions.
  23385. NotNamespaces []string `json:"notNamespaces,omitempty"`
  23386. // NotUsers: Negate of users. Specifies exclusions.
  23387. NotUsers []string `json:"notUsers,omitempty"`
  23388. // Properties: A map of Istio attribute to expected values. Exact match,
  23389. // prefix match, and suffix match are supported for values. For example,
  23390. // `request.headers[version]: ?v1?`. The properties are ANDed together.
  23391. Properties map[string]string `json:"properties,omitempty"`
  23392. // Users: The user names/IDs or service accounts. Exact match, prefix
  23393. // match, and suffix match are supported.
  23394. Users []string `json:"users,omitempty"`
  23395. // ForceSendFields is a list of field names (e.g. "Condition") to
  23396. // unconditionally include in API requests. By default, fields with
  23397. // empty values are omitted from API requests. However, any non-pointer,
  23398. // non-interface field appearing in ForceSendFields will be sent to the
  23399. // server regardless of whether the field is empty or not. This may be
  23400. // used to include empty fields in Patch requests.
  23401. ForceSendFields []string `json:"-"`
  23402. // NullFields is a list of field names (e.g. "Condition") to include in
  23403. // API requests with the JSON null value. By default, fields with empty
  23404. // values are omitted from API requests. However, any field with an
  23405. // empty value appearing in NullFields will be sent to the server as
  23406. // null. It is an error if a field in this list has a non-empty value.
  23407. // This may be used to include null fields in Patch requests.
  23408. NullFields []string `json:"-"`
  23409. }
  23410. func (s *Principal) MarshalJSON() ([]byte, error) {
  23411. type NoMethod Principal
  23412. raw := NoMethod(*s)
  23413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23414. }
  23415. // Project: A Project resource. For an overview of projects, see Cloud
  23416. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  23417. // resource_for beta.projects ==)
  23418. type Project struct {
  23419. // CommonInstanceMetadata: Metadata key/value pairs available to all
  23420. // instances contained in this project. See Custom metadata for more
  23421. // information.
  23422. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  23423. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23424. // format.
  23425. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23426. // DefaultNetworkTier: This signifies the default network tier used for
  23427. // configuring resources of the project and can only take the following
  23428. // values: PREMIUM, STANDARD. Initially the default network tier is
  23429. // PREMIUM.
  23430. //
  23431. // Possible values:
  23432. // "PREMIUM"
  23433. // "SELECT"
  23434. // "STANDARD"
  23435. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  23436. // DefaultServiceAccount: [Output Only] Default service account used by
  23437. // VMs running in this project.
  23438. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  23439. // Description: An optional textual description of the resource.
  23440. Description string `json:"description,omitempty"`
  23441. // EnabledFeatures: Restricted features enabled for use on this project.
  23442. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  23443. // Id: [Output Only] The unique identifier for the resource. This
  23444. // identifier is defined by the server. This is not the project ID, and
  23445. // is just a unique ID used by Compute Engine to identify resources.
  23446. Id uint64 `json:"id,omitempty,string"`
  23447. // Kind: [Output Only] Type of the resource. Always compute#project for
  23448. // projects.
  23449. Kind string `json:"kind,omitempty"`
  23450. // Name: The project ID. For example: my-example-project. Use the
  23451. // project ID to make requests to Compute Engine.
  23452. Name string `json:"name,omitempty"`
  23453. // Quotas: [Output Only] Quotas assigned to this project.
  23454. Quotas []*Quota `json:"quotas,omitempty"`
  23455. // SelfLink: [Output Only] Server-defined URL for the resource.
  23456. SelfLink string `json:"selfLink,omitempty"`
  23457. // UsageExportLocation: The naming prefix for daily usage reports and
  23458. // the Google Cloud Storage bucket where they are stored.
  23459. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  23460. // XpnProjectStatus: [Output Only] The role this project has in a shared
  23461. // VPC configuration. Currently only HOST projects are differentiated.
  23462. //
  23463. // Possible values:
  23464. // "HOST"
  23465. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  23466. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  23467. // ServerResponse contains the HTTP response code and headers from the
  23468. // server.
  23469. googleapi.ServerResponse `json:"-"`
  23470. // ForceSendFields is a list of field names (e.g.
  23471. // "CommonInstanceMetadata") to unconditionally include in API requests.
  23472. // By default, fields with empty values are omitted from API requests.
  23473. // However, any non-pointer, non-interface field appearing in
  23474. // ForceSendFields will be sent to the server regardless of whether the
  23475. // field is empty or not. This may be used to include empty fields in
  23476. // Patch requests.
  23477. ForceSendFields []string `json:"-"`
  23478. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  23479. // to include in API requests with the JSON null value. By default,
  23480. // fields with empty values are omitted from API requests. However, any
  23481. // field with an empty value appearing in NullFields will be sent to the
  23482. // server as null. It is an error if a field in this list has a
  23483. // non-empty value. This may be used to include null fields in Patch
  23484. // requests.
  23485. NullFields []string `json:"-"`
  23486. }
  23487. func (s *Project) MarshalJSON() ([]byte, error) {
  23488. type NoMethod Project
  23489. raw := NoMethod(*s)
  23490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23491. }
  23492. type ProjectsDisableXpnResourceRequest struct {
  23493. // XpnResource: Service resource (a.k.a service project) ID.
  23494. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  23495. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  23496. // unconditionally include in API requests. By default, fields with
  23497. // empty values are omitted from API requests. However, any non-pointer,
  23498. // non-interface field appearing in ForceSendFields will be sent to the
  23499. // server regardless of whether the field is empty or not. This may be
  23500. // used to include empty fields in Patch requests.
  23501. ForceSendFields []string `json:"-"`
  23502. // NullFields is a list of field names (e.g. "XpnResource") to include
  23503. // in API requests with the JSON null value. By default, fields with
  23504. // empty values are omitted from API requests. However, any field with
  23505. // an empty value appearing in NullFields will be sent to the server as
  23506. // null. It is an error if a field in this list has a non-empty value.
  23507. // This may be used to include null fields in Patch requests.
  23508. NullFields []string `json:"-"`
  23509. }
  23510. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  23511. type NoMethod ProjectsDisableXpnResourceRequest
  23512. raw := NoMethod(*s)
  23513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23514. }
  23515. type ProjectsEnableXpnResourceRequest struct {
  23516. // XpnResource: Service resource (a.k.a service project) ID.
  23517. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  23518. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  23519. // unconditionally include in API requests. By default, fields with
  23520. // empty values are omitted from API requests. However, any non-pointer,
  23521. // non-interface field appearing in ForceSendFields will be sent to the
  23522. // server regardless of whether the field is empty or not. This may be
  23523. // used to include empty fields in Patch requests.
  23524. ForceSendFields []string `json:"-"`
  23525. // NullFields is a list of field names (e.g. "XpnResource") to include
  23526. // in API requests with the JSON null value. By default, fields with
  23527. // empty values are omitted from API requests. However, any field with
  23528. // an empty value appearing in NullFields will be sent to the server as
  23529. // null. It is an error if a field in this list has a non-empty value.
  23530. // This may be used to include null fields in Patch requests.
  23531. NullFields []string `json:"-"`
  23532. }
  23533. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  23534. type NoMethod ProjectsEnableXpnResourceRequest
  23535. raw := NoMethod(*s)
  23536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23537. }
  23538. type ProjectsGetXpnResources struct {
  23539. // Kind: [Output Only] Type of resource. Always
  23540. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  23541. // service projects)
  23542. Kind string `json:"kind,omitempty"`
  23543. // NextPageToken: [Output Only] This token allows you to get the next
  23544. // page of results for list requests. If the number of results is larger
  23545. // than maxResults, use the nextPageToken as a value for the query
  23546. // parameter pageToken in the next list request. Subsequent list
  23547. // requests will have their own nextPageToken to continue paging through
  23548. // the results.
  23549. NextPageToken string `json:"nextPageToken,omitempty"`
  23550. // Resources: Service resources (a.k.a service projects) attached to
  23551. // this project as their shared VPC host.
  23552. Resources []*XpnResourceId `json:"resources,omitempty"`
  23553. // ServerResponse contains the HTTP response code and headers from the
  23554. // server.
  23555. googleapi.ServerResponse `json:"-"`
  23556. // ForceSendFields is a list of field names (e.g. "Kind") to
  23557. // unconditionally include in API requests. By default, fields with
  23558. // empty values are omitted from API requests. However, any non-pointer,
  23559. // non-interface field appearing in ForceSendFields will be sent to the
  23560. // server regardless of whether the field is empty or not. This may be
  23561. // used to include empty fields in Patch requests.
  23562. ForceSendFields []string `json:"-"`
  23563. // NullFields is a list of field names (e.g. "Kind") to include in API
  23564. // requests with the JSON null value. By default, fields with empty
  23565. // values are omitted from API requests. However, any field with an
  23566. // empty value appearing in NullFields will be sent to the server as
  23567. // null. It is an error if a field in this list has a non-empty value.
  23568. // This may be used to include null fields in Patch requests.
  23569. NullFields []string `json:"-"`
  23570. }
  23571. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  23572. type NoMethod ProjectsGetXpnResources
  23573. raw := NoMethod(*s)
  23574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23575. }
  23576. type ProjectsListXpnHostsRequest struct {
  23577. // Organization: Optional organization ID managed by Cloud Resource
  23578. // Manager, for which to list shared VPC host projects. If not
  23579. // specified, the organization will be inferred from the project.
  23580. Organization string `json:"organization,omitempty"`
  23581. // ForceSendFields is a list of field names (e.g. "Organization") to
  23582. // unconditionally include in API requests. By default, fields with
  23583. // empty values are omitted from API requests. However, any non-pointer,
  23584. // non-interface field appearing in ForceSendFields will be sent to the
  23585. // server regardless of whether the field is empty or not. This may be
  23586. // used to include empty fields in Patch requests.
  23587. ForceSendFields []string `json:"-"`
  23588. // NullFields is a list of field names (e.g. "Organization") to include
  23589. // in API requests with the JSON null value. By default, fields with
  23590. // empty values are omitted from API requests. However, any field with
  23591. // an empty value appearing in NullFields will be sent to the server as
  23592. // null. It is an error if a field in this list has a non-empty value.
  23593. // This may be used to include null fields in Patch requests.
  23594. NullFields []string `json:"-"`
  23595. }
  23596. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  23597. type NoMethod ProjectsListXpnHostsRequest
  23598. raw := NoMethod(*s)
  23599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23600. }
  23601. type ProjectsSetDefaultNetworkTierRequest struct {
  23602. // NetworkTier: Default network tier to be set.
  23603. //
  23604. // Possible values:
  23605. // "PREMIUM"
  23606. // "SELECT"
  23607. // "STANDARD"
  23608. NetworkTier string `json:"networkTier,omitempty"`
  23609. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  23610. // unconditionally include in API requests. By default, fields with
  23611. // empty values are omitted from API requests. However, any non-pointer,
  23612. // non-interface field appearing in ForceSendFields will be sent to the
  23613. // server regardless of whether the field is empty or not. This may be
  23614. // used to include empty fields in Patch requests.
  23615. ForceSendFields []string `json:"-"`
  23616. // NullFields is a list of field names (e.g. "NetworkTier") to include
  23617. // in API requests with the JSON null value. By default, fields with
  23618. // empty values are omitted from API requests. However, any field with
  23619. // an empty value appearing in NullFields will be sent to the server as
  23620. // null. It is an error if a field in this list has a non-empty value.
  23621. // This may be used to include null fields in Patch requests.
  23622. NullFields []string `json:"-"`
  23623. }
  23624. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  23625. type NoMethod ProjectsSetDefaultNetworkTierRequest
  23626. raw := NoMethod(*s)
  23627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23628. }
  23629. type ProjectsSetDefaultServiceAccountRequest struct {
  23630. // Email: Email address of the service account.
  23631. Email string `json:"email,omitempty"`
  23632. // ForceSendFields is a list of field names (e.g. "Email") to
  23633. // unconditionally include in API requests. By default, fields with
  23634. // empty values are omitted from API requests. However, any non-pointer,
  23635. // non-interface field appearing in ForceSendFields will be sent to the
  23636. // server regardless of whether the field is empty or not. This may be
  23637. // used to include empty fields in Patch requests.
  23638. ForceSendFields []string `json:"-"`
  23639. // NullFields is a list of field names (e.g. "Email") to include in API
  23640. // requests with the JSON null value. By default, fields with empty
  23641. // values are omitted from API requests. However, any field with an
  23642. // empty value appearing in NullFields will be sent to the server as
  23643. // null. It is an error if a field in this list has a non-empty value.
  23644. // This may be used to include null fields in Patch requests.
  23645. NullFields []string `json:"-"`
  23646. }
  23647. func (s *ProjectsSetDefaultServiceAccountRequest) MarshalJSON() ([]byte, error) {
  23648. type NoMethod ProjectsSetDefaultServiceAccountRequest
  23649. raw := NoMethod(*s)
  23650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23651. }
  23652. // Quota: A quotas entry.
  23653. type Quota struct {
  23654. // Limit: [Output Only] Quota limit for this metric.
  23655. Limit float64 `json:"limit,omitempty"`
  23656. // Metric: [Output Only] Name of the quota metric.
  23657. //
  23658. // Possible values:
  23659. // "ALIASES_PER_NETWORK_GLOBAL"
  23660. // "AMD_S9300_GPUS"
  23661. // "AUTOSCALERS"
  23662. // "BACKEND_BUCKETS"
  23663. // "BACKEND_SERVICES"
  23664. // "COMMITMENTS"
  23665. // "CPUS"
  23666. // "CPUS_ALL_REGIONS"
  23667. // "DISKS_TOTAL_GB"
  23668. // "FIREWALLS"
  23669. // "FORWARDING_RULES"
  23670. // "GLOBAL_INTERNAL_ADDRESSES"
  23671. // "GPUS_ALL_REGIONS"
  23672. // "HEALTH_CHECKS"
  23673. // "IMAGES"
  23674. // "INSTANCES"
  23675. // "INSTANCES_PER_NETWORK_GLOBAL"
  23676. // "INSTANCE_GROUPS"
  23677. // "INSTANCE_GROUP_MANAGERS"
  23678. // "INSTANCE_TEMPLATES"
  23679. // "INTERCONNECTS"
  23680. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  23681. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  23682. // "INTERNAL_ADDRESSES"
  23683. // "INTERNAL_FORWARDING_RULES_PER_NETWORK"
  23684. // "INTERNAL_FORWARDING_RULES_WITH_GLOBAL_ACCESS_PER_NETWORK"
  23685. // "INTERNAL_FORWARDING_RULES_WITH_TARGET_INSTANCE_PER_NETWORK"
  23686. // "INTERNAL_TARGET_INSTANCE_WITH_GLOBAL_ACCESS_PER_NETWORK"
  23687. // "IN_USE_ADDRESSES"
  23688. // "IN_USE_BACKUP_SCHEDULES"
  23689. // "IN_USE_MAINTENANCE_WINDOWS"
  23690. // "IN_USE_SNAPSHOT_SCHEDULES"
  23691. // "LOCAL_SSD_TOTAL_GB"
  23692. // "MACHINE_IMAGES"
  23693. // "NETWORKS"
  23694. // "NETWORK_ENDPOINT_GROUPS"
  23695. // "NVIDIA_K80_GPUS"
  23696. // "NVIDIA_P100_GPUS"
  23697. // "NVIDIA_P100_VWS_GPUS"
  23698. // "NVIDIA_P4_GPUS"
  23699. // "NVIDIA_P4_VWS_GPUS"
  23700. // "NVIDIA_T4_GPUS"
  23701. // "NVIDIA_T4_VWS_GPUS"
  23702. // "NVIDIA_V100_GPUS"
  23703. // "PREEMPTIBLE_CPUS"
  23704. // "PREEMPTIBLE_LOCAL_SSD_GB"
  23705. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  23706. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  23707. // "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"
  23708. // "PREEMPTIBLE_NVIDIA_P4_GPUS"
  23709. // "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"
  23710. // "PREEMPTIBLE_NVIDIA_T4_GPUS"
  23711. // "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"
  23712. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  23713. // "PRIVATE_V6_ACCESS_SUBNETWORKS"
  23714. // "REGIONAL_AUTOSCALERS"
  23715. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  23716. // "RESOURCE_POLICIES"
  23717. // "ROUTERS"
  23718. // "ROUTES"
  23719. // "SECURITY_POLICIES"
  23720. // "SECURITY_POLICY_RULES"
  23721. // "SNAPSHOTS"
  23722. // "SSD_TOTAL_GB"
  23723. // "SSL_CERTIFICATES"
  23724. // "STATIC_ADDRESSES"
  23725. // "SUBNETWORKS"
  23726. // "TARGET_HTTPS_PROXIES"
  23727. // "TARGET_HTTP_PROXIES"
  23728. // "TARGET_INSTANCES"
  23729. // "TARGET_POOLS"
  23730. // "TARGET_SSL_PROXIES"
  23731. // "TARGET_TCP_PROXIES"
  23732. // "TARGET_VPN_GATEWAYS"
  23733. // "URL_MAPS"
  23734. // "VPN_GATEWAYS"
  23735. // "VPN_TUNNELS"
  23736. // "XPN_SERVICE_PROJECTS"
  23737. Metric string `json:"metric,omitempty"`
  23738. // Owner: [Output Only] Owning resource. This is the resource on which
  23739. // this quota is applied.
  23740. Owner string `json:"owner,omitempty"`
  23741. // Usage: [Output Only] Current usage of this metric.
  23742. Usage float64 `json:"usage,omitempty"`
  23743. // ForceSendFields is a list of field names (e.g. "Limit") to
  23744. // unconditionally include in API requests. By default, fields with
  23745. // empty values are omitted from API requests. However, any non-pointer,
  23746. // non-interface field appearing in ForceSendFields will be sent to the
  23747. // server regardless of whether the field is empty or not. This may be
  23748. // used to include empty fields in Patch requests.
  23749. ForceSendFields []string `json:"-"`
  23750. // NullFields is a list of field names (e.g. "Limit") to include in API
  23751. // requests with the JSON null value. By default, fields with empty
  23752. // values are omitted from API requests. However, any field with an
  23753. // empty value appearing in NullFields will be sent to the server as
  23754. // null. It is an error if a field in this list has a non-empty value.
  23755. // This may be used to include null fields in Patch requests.
  23756. NullFields []string `json:"-"`
  23757. }
  23758. func (s *Quota) MarshalJSON() ([]byte, error) {
  23759. type NoMethod Quota
  23760. raw := NoMethod(*s)
  23761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23762. }
  23763. func (s *Quota) UnmarshalJSON(data []byte) error {
  23764. type NoMethod Quota
  23765. var s1 struct {
  23766. Limit gensupport.JSONFloat64 `json:"limit"`
  23767. Usage gensupport.JSONFloat64 `json:"usage"`
  23768. *NoMethod
  23769. }
  23770. s1.NoMethod = (*NoMethod)(s)
  23771. if err := json.Unmarshal(data, &s1); err != nil {
  23772. return err
  23773. }
  23774. s.Limit = float64(s1.Limit)
  23775. s.Usage = float64(s1.Usage)
  23776. return nil
  23777. }
  23778. type RbacPolicy struct {
  23779. // Name: Name of the RbacPolicy.
  23780. Name string `json:"name,omitempty"`
  23781. // Permissions: The list of permissions.
  23782. Permissions []*Permission `json:"permissions,omitempty"`
  23783. // Principals: The list of principals.
  23784. Principals []*Principal `json:"principals,omitempty"`
  23785. // ForceSendFields is a list of field names (e.g. "Name") to
  23786. // unconditionally include in API requests. By default, fields with
  23787. // empty values are omitted from API requests. However, any non-pointer,
  23788. // non-interface field appearing in ForceSendFields will be sent to the
  23789. // server regardless of whether the field is empty or not. This may be
  23790. // used to include empty fields in Patch requests.
  23791. ForceSendFields []string `json:"-"`
  23792. // NullFields is a list of field names (e.g. "Name") to include in API
  23793. // requests with the JSON null value. By default, fields with empty
  23794. // values are omitted from API requests. However, any field with an
  23795. // empty value appearing in NullFields will be sent to the server as
  23796. // null. It is an error if a field in this list has a non-empty value.
  23797. // This may be used to include null fields in Patch requests.
  23798. NullFields []string `json:"-"`
  23799. }
  23800. func (s *RbacPolicy) MarshalJSON() ([]byte, error) {
  23801. type NoMethod RbacPolicy
  23802. raw := NoMethod(*s)
  23803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23804. }
  23805. // Reference: Represents a reference to a resource.
  23806. type Reference struct {
  23807. // Kind: [Output Only] Type of the resource. Always compute#reference
  23808. // for references.
  23809. Kind string `json:"kind,omitempty"`
  23810. // ReferenceType: A description of the reference type with no implied
  23811. // semantics. Possible values include:
  23812. // - MEMBER_OF
  23813. ReferenceType string `json:"referenceType,omitempty"`
  23814. // Referrer: URL of the resource which refers to the target.
  23815. Referrer string `json:"referrer,omitempty"`
  23816. // Target: URL of the resource to which this reference points.
  23817. Target string `json:"target,omitempty"`
  23818. // ForceSendFields is a list of field names (e.g. "Kind") to
  23819. // unconditionally include in API requests. By default, fields with
  23820. // empty values are omitted from API requests. However, any non-pointer,
  23821. // non-interface field appearing in ForceSendFields will be sent to the
  23822. // server regardless of whether the field is empty or not. This may be
  23823. // used to include empty fields in Patch requests.
  23824. ForceSendFields []string `json:"-"`
  23825. // NullFields is a list of field names (e.g. "Kind") to include in API
  23826. // requests with the JSON null value. By default, fields with empty
  23827. // values are omitted from API requests. However, any field with an
  23828. // empty value appearing in NullFields will be sent to the server as
  23829. // null. It is an error if a field in this list has a non-empty value.
  23830. // This may be used to include null fields in Patch requests.
  23831. NullFields []string `json:"-"`
  23832. }
  23833. func (s *Reference) MarshalJSON() ([]byte, error) {
  23834. type NoMethod Reference
  23835. raw := NoMethod(*s)
  23836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23837. }
  23838. // Region: Region resource. (== resource_for beta.regions ==) (==
  23839. // resource_for v1.regions ==)
  23840. type Region struct {
  23841. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23842. // format.
  23843. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23844. // Deprecated: [Output Only] The deprecation status associated with this
  23845. // region.
  23846. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  23847. // Description: [Output Only] Textual description of the resource.
  23848. Description string `json:"description,omitempty"`
  23849. // Id: [Output Only] The unique identifier for the resource. This
  23850. // identifier is defined by the server.
  23851. Id uint64 `json:"id,omitempty,string"`
  23852. // Kind: [Output Only] Type of the resource. Always compute#region for
  23853. // regions.
  23854. Kind string `json:"kind,omitempty"`
  23855. // Name: [Output Only] Name of the resource.
  23856. Name string `json:"name,omitempty"`
  23857. // Quotas: [Output Only] Quotas assigned to this region.
  23858. Quotas []*Quota `json:"quotas,omitempty"`
  23859. // SelfLink: [Output Only] Server-defined URL for the resource.
  23860. SelfLink string `json:"selfLink,omitempty"`
  23861. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  23862. // with the resource id.
  23863. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  23864. // Status: [Output Only] Status of the region, either UP or DOWN.
  23865. //
  23866. // Possible values:
  23867. // "DOWN"
  23868. // "UP"
  23869. Status string `json:"status,omitempty"`
  23870. // Zones: [Output Only] A list of zones available in this region, in the
  23871. // form of resource URLs.
  23872. Zones []string `json:"zones,omitempty"`
  23873. // ServerResponse contains the HTTP response code and headers from the
  23874. // server.
  23875. googleapi.ServerResponse `json:"-"`
  23876. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23877. // to unconditionally include in API requests. By default, fields with
  23878. // empty values are omitted from API requests. However, any non-pointer,
  23879. // non-interface field appearing in ForceSendFields will be sent to the
  23880. // server regardless of whether the field is empty or not. This may be
  23881. // used to include empty fields in Patch requests.
  23882. ForceSendFields []string `json:"-"`
  23883. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23884. // include in API requests with the JSON null value. By default, fields
  23885. // with empty values are omitted from API requests. However, any field
  23886. // with an empty value appearing in NullFields will be sent to the
  23887. // server as null. It is an error if a field in this list has a
  23888. // non-empty value. This may be used to include null fields in Patch
  23889. // requests.
  23890. NullFields []string `json:"-"`
  23891. }
  23892. func (s *Region) MarshalJSON() ([]byte, error) {
  23893. type NoMethod Region
  23894. raw := NoMethod(*s)
  23895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23896. }
  23897. // RegionAutoscalerList: Contains a list of autoscalers.
  23898. type RegionAutoscalerList struct {
  23899. // Id: [Output Only] Unique identifier for the resource; defined by the
  23900. // server.
  23901. Id string `json:"id,omitempty"`
  23902. // Items: A list of Autoscaler resources.
  23903. Items []*Autoscaler `json:"items,omitempty"`
  23904. // Kind: Type of resource.
  23905. Kind string `json:"kind,omitempty"`
  23906. // NextPageToken: [Output Only] This token allows you to get the next
  23907. // page of results for list requests. If the number of results is larger
  23908. // than maxResults, use the nextPageToken as a value for the query
  23909. // parameter pageToken in the next list request. Subsequent list
  23910. // requests will have their own nextPageToken to continue paging through
  23911. // the results.
  23912. NextPageToken string `json:"nextPageToken,omitempty"`
  23913. // SelfLink: [Output Only] Server-defined URL for this resource.
  23914. SelfLink string `json:"selfLink,omitempty"`
  23915. // Warning: [Output Only] Informational warning message.
  23916. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  23917. // ServerResponse contains the HTTP response code and headers from the
  23918. // server.
  23919. googleapi.ServerResponse `json:"-"`
  23920. // ForceSendFields is a list of field names (e.g. "Id") to
  23921. // unconditionally include in API requests. By default, fields with
  23922. // empty values are omitted from API requests. However, any non-pointer,
  23923. // non-interface field appearing in ForceSendFields will be sent to the
  23924. // server regardless of whether the field is empty or not. This may be
  23925. // used to include empty fields in Patch requests.
  23926. ForceSendFields []string `json:"-"`
  23927. // NullFields is a list of field names (e.g. "Id") to include in API
  23928. // requests with the JSON null value. By default, fields with empty
  23929. // values are omitted from API requests. However, any field with an
  23930. // empty value appearing in NullFields will be sent to the server as
  23931. // null. It is an error if a field in this list has a non-empty value.
  23932. // This may be used to include null fields in Patch requests.
  23933. NullFields []string `json:"-"`
  23934. }
  23935. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  23936. type NoMethod RegionAutoscalerList
  23937. raw := NoMethod(*s)
  23938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23939. }
  23940. // RegionAutoscalerListWarning: [Output Only] Informational warning
  23941. // message.
  23942. type RegionAutoscalerListWarning struct {
  23943. // Code: [Output Only] A warning code, if applicable. For example,
  23944. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23945. // the response.
  23946. //
  23947. // Possible values:
  23948. // "CLEANUP_FAILED"
  23949. // "DEPRECATED_RESOURCE_USED"
  23950. // "DEPRECATED_TYPE_USED"
  23951. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23952. // "EXPERIMENTAL_TYPE_USED"
  23953. // "EXTERNAL_API_WARNING"
  23954. // "FIELD_VALUE_OVERRIDEN"
  23955. // "INJECTED_KERNELS_DEPRECATED"
  23956. // "MISSING_TYPE_DEPENDENCY"
  23957. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23958. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23959. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23960. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23961. // "NEXT_HOP_NOT_RUNNING"
  23962. // "NOT_CRITICAL_ERROR"
  23963. // "NO_RESULTS_ON_PAGE"
  23964. // "REQUIRED_TOS_AGREEMENT"
  23965. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23966. // "RESOURCE_NOT_DELETED"
  23967. // "SCHEMA_VALIDATION_IGNORED"
  23968. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23969. // "UNDECLARED_PROPERTIES"
  23970. // "UNREACHABLE"
  23971. Code string `json:"code,omitempty"`
  23972. // Data: [Output Only] Metadata about this warning in key: value format.
  23973. // For example:
  23974. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23975. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  23976. // Message: [Output Only] A human-readable description of the warning
  23977. // code.
  23978. Message string `json:"message,omitempty"`
  23979. // ForceSendFields is a list of field names (e.g. "Code") to
  23980. // unconditionally include in API requests. By default, fields with
  23981. // empty values are omitted from API requests. However, any non-pointer,
  23982. // non-interface field appearing in ForceSendFields will be sent to the
  23983. // server regardless of whether the field is empty or not. This may be
  23984. // used to include empty fields in Patch requests.
  23985. ForceSendFields []string `json:"-"`
  23986. // NullFields is a list of field names (e.g. "Code") to include in API
  23987. // requests with the JSON null value. By default, fields with empty
  23988. // values are omitted from API requests. However, any field with an
  23989. // empty value appearing in NullFields will be sent to the server as
  23990. // null. It is an error if a field in this list has a non-empty value.
  23991. // This may be used to include null fields in Patch requests.
  23992. NullFields []string `json:"-"`
  23993. }
  23994. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  23995. type NoMethod RegionAutoscalerListWarning
  23996. raw := NoMethod(*s)
  23997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23998. }
  23999. type RegionAutoscalerListWarningData struct {
  24000. // Key: [Output Only] A key that provides more detail on the warning
  24001. // being returned. For example, for warnings where there are no results
  24002. // in a list request for a particular zone, this key might be scope and
  24003. // the key value might be the zone name. Other examples might be a key
  24004. // indicating a deprecated resource and a suggested replacement, or a
  24005. // warning about invalid network settings (for example, if an instance
  24006. // attempts to perform IP forwarding but is not enabled for IP
  24007. // forwarding).
  24008. Key string `json:"key,omitempty"`
  24009. // Value: [Output Only] A warning data value corresponding to the key.
  24010. Value string `json:"value,omitempty"`
  24011. // ForceSendFields is a list of field names (e.g. "Key") to
  24012. // unconditionally include in API requests. By default, fields with
  24013. // empty values are omitted from API requests. However, any non-pointer,
  24014. // non-interface field appearing in ForceSendFields will be sent to the
  24015. // server regardless of whether the field is empty or not. This may be
  24016. // used to include empty fields in Patch requests.
  24017. ForceSendFields []string `json:"-"`
  24018. // NullFields is a list of field names (e.g. "Key") to include in API
  24019. // requests with the JSON null value. By default, fields with empty
  24020. // values are omitted from API requests. However, any field with an
  24021. // empty value appearing in NullFields will be sent to the server as
  24022. // null. It is an error if a field in this list has a non-empty value.
  24023. // This may be used to include null fields in Patch requests.
  24024. NullFields []string `json:"-"`
  24025. }
  24026. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  24027. type NoMethod RegionAutoscalerListWarningData
  24028. raw := NoMethod(*s)
  24029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24030. }
  24031. type RegionCommitmentsUpdateAllocationsRequest struct {
  24032. // Allocations: List of allocations for the capacity move of VMs with
  24033. // accelerators and local ssds.
  24034. Allocations []*Allocation `json:"allocations,omitempty"`
  24035. // ForceSendFields is a list of field names (e.g. "Allocations") to
  24036. // unconditionally include in API requests. By default, fields with
  24037. // empty values are omitted from API requests. However, any non-pointer,
  24038. // non-interface field appearing in ForceSendFields will be sent to the
  24039. // server regardless of whether the field is empty or not. This may be
  24040. // used to include empty fields in Patch requests.
  24041. ForceSendFields []string `json:"-"`
  24042. // NullFields is a list of field names (e.g. "Allocations") to include
  24043. // in API requests with the JSON null value. By default, fields with
  24044. // empty values are omitted from API requests. However, any field with
  24045. // an empty value appearing in NullFields will be sent to the server as
  24046. // null. It is an error if a field in this list has a non-empty value.
  24047. // This may be used to include null fields in Patch requests.
  24048. NullFields []string `json:"-"`
  24049. }
  24050. func (s *RegionCommitmentsUpdateAllocationsRequest) MarshalJSON() ([]byte, error) {
  24051. type NoMethod RegionCommitmentsUpdateAllocationsRequest
  24052. raw := NoMethod(*s)
  24053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24054. }
  24055. type RegionDiskTypeList struct {
  24056. // Id: [Output Only] Unique identifier for the resource; defined by the
  24057. // server.
  24058. Id string `json:"id,omitempty"`
  24059. // Items: A list of DiskType resources.
  24060. Items []*DiskType `json:"items,omitempty"`
  24061. // Kind: [Output Only] Type of resource. Always
  24062. // compute#regionDiskTypeList for region disk types.
  24063. Kind string `json:"kind,omitempty"`
  24064. // NextPageToken: [Output Only] This token allows you to get the next
  24065. // page of results for list requests. If the number of results is larger
  24066. // than maxResults, use the nextPageToken as a value for the query
  24067. // parameter pageToken in the next list request. Subsequent list
  24068. // requests will have their own nextPageToken to continue paging through
  24069. // the results.
  24070. NextPageToken string `json:"nextPageToken,omitempty"`
  24071. // SelfLink: [Output Only] Server-defined URL for this resource.
  24072. SelfLink string `json:"selfLink,omitempty"`
  24073. // Warning: [Output Only] Informational warning message.
  24074. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  24075. // ServerResponse contains the HTTP response code and headers from the
  24076. // server.
  24077. googleapi.ServerResponse `json:"-"`
  24078. // ForceSendFields is a list of field names (e.g. "Id") to
  24079. // unconditionally include in API requests. By default, fields with
  24080. // empty values are omitted from API requests. However, any non-pointer,
  24081. // non-interface field appearing in ForceSendFields will be sent to the
  24082. // server regardless of whether the field is empty or not. This may be
  24083. // used to include empty fields in Patch requests.
  24084. ForceSendFields []string `json:"-"`
  24085. // NullFields is a list of field names (e.g. "Id") to include in API
  24086. // requests with the JSON null value. By default, fields with empty
  24087. // values are omitted from API requests. However, any field with an
  24088. // empty value appearing in NullFields will be sent to the server as
  24089. // null. It is an error if a field in this list has a non-empty value.
  24090. // This may be used to include null fields in Patch requests.
  24091. NullFields []string `json:"-"`
  24092. }
  24093. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  24094. type NoMethod RegionDiskTypeList
  24095. raw := NoMethod(*s)
  24096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24097. }
  24098. // RegionDiskTypeListWarning: [Output Only] Informational warning
  24099. // message.
  24100. type RegionDiskTypeListWarning struct {
  24101. // Code: [Output Only] A warning code, if applicable. For example,
  24102. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24103. // the response.
  24104. //
  24105. // Possible values:
  24106. // "CLEANUP_FAILED"
  24107. // "DEPRECATED_RESOURCE_USED"
  24108. // "DEPRECATED_TYPE_USED"
  24109. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24110. // "EXPERIMENTAL_TYPE_USED"
  24111. // "EXTERNAL_API_WARNING"
  24112. // "FIELD_VALUE_OVERRIDEN"
  24113. // "INJECTED_KERNELS_DEPRECATED"
  24114. // "MISSING_TYPE_DEPENDENCY"
  24115. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24116. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24117. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24118. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24119. // "NEXT_HOP_NOT_RUNNING"
  24120. // "NOT_CRITICAL_ERROR"
  24121. // "NO_RESULTS_ON_PAGE"
  24122. // "REQUIRED_TOS_AGREEMENT"
  24123. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24124. // "RESOURCE_NOT_DELETED"
  24125. // "SCHEMA_VALIDATION_IGNORED"
  24126. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24127. // "UNDECLARED_PROPERTIES"
  24128. // "UNREACHABLE"
  24129. Code string `json:"code,omitempty"`
  24130. // Data: [Output Only] Metadata about this warning in key: value format.
  24131. // For example:
  24132. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24133. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  24134. // Message: [Output Only] A human-readable description of the warning
  24135. // code.
  24136. Message string `json:"message,omitempty"`
  24137. // ForceSendFields is a list of field names (e.g. "Code") to
  24138. // unconditionally include in API requests. By default, fields with
  24139. // empty values are omitted from API requests. However, any non-pointer,
  24140. // non-interface field appearing in ForceSendFields will be sent to the
  24141. // server regardless of whether the field is empty or not. This may be
  24142. // used to include empty fields in Patch requests.
  24143. ForceSendFields []string `json:"-"`
  24144. // NullFields is a list of field names (e.g. "Code") to include in API
  24145. // requests with the JSON null value. By default, fields with empty
  24146. // values are omitted from API requests. However, any field with an
  24147. // empty value appearing in NullFields will be sent to the server as
  24148. // null. It is an error if a field in this list has a non-empty value.
  24149. // This may be used to include null fields in Patch requests.
  24150. NullFields []string `json:"-"`
  24151. }
  24152. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  24153. type NoMethod RegionDiskTypeListWarning
  24154. raw := NoMethod(*s)
  24155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24156. }
  24157. type RegionDiskTypeListWarningData struct {
  24158. // Key: [Output Only] A key that provides more detail on the warning
  24159. // being returned. For example, for warnings where there are no results
  24160. // in a list request for a particular zone, this key might be scope and
  24161. // the key value might be the zone name. Other examples might be a key
  24162. // indicating a deprecated resource and a suggested replacement, or a
  24163. // warning about invalid network settings (for example, if an instance
  24164. // attempts to perform IP forwarding but is not enabled for IP
  24165. // forwarding).
  24166. Key string `json:"key,omitempty"`
  24167. // Value: [Output Only] A warning data value corresponding to the key.
  24168. Value string `json:"value,omitempty"`
  24169. // ForceSendFields is a list of field names (e.g. "Key") to
  24170. // unconditionally include in API requests. By default, fields with
  24171. // empty values are omitted from API requests. However, any non-pointer,
  24172. // non-interface field appearing in ForceSendFields will be sent to the
  24173. // server regardless of whether the field is empty or not. This may be
  24174. // used to include empty fields in Patch requests.
  24175. ForceSendFields []string `json:"-"`
  24176. // NullFields is a list of field names (e.g. "Key") to include in API
  24177. // requests with the JSON null value. By default, fields with empty
  24178. // values are omitted from API requests. However, any field with an
  24179. // empty value appearing in NullFields will be sent to the server as
  24180. // null. It is an error if a field in this list has a non-empty value.
  24181. // This may be used to include null fields in Patch requests.
  24182. NullFields []string `json:"-"`
  24183. }
  24184. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  24185. type NoMethod RegionDiskTypeListWarningData
  24186. raw := NoMethod(*s)
  24187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24188. }
  24189. type RegionDisksAddResourcePoliciesRequest struct {
  24190. // ResourcePolicies: Resource policies to be added to this disk.
  24191. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  24192. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  24193. // unconditionally include in API requests. By default, fields with
  24194. // empty values are omitted from API requests. However, any non-pointer,
  24195. // non-interface field appearing in ForceSendFields will be sent to the
  24196. // server regardless of whether the field is empty or not. This may be
  24197. // used to include empty fields in Patch requests.
  24198. ForceSendFields []string `json:"-"`
  24199. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  24200. // include in API requests with the JSON null value. By default, fields
  24201. // with empty values are omitted from API requests. However, any field
  24202. // with an empty value appearing in NullFields will be sent to the
  24203. // server as null. It is an error if a field in this list has a
  24204. // non-empty value. This may be used to include null fields in Patch
  24205. // requests.
  24206. NullFields []string `json:"-"`
  24207. }
  24208. func (s *RegionDisksAddResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  24209. type NoMethod RegionDisksAddResourcePoliciesRequest
  24210. raw := NoMethod(*s)
  24211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24212. }
  24213. type RegionDisksRemoveResourcePoliciesRequest struct {
  24214. // ResourcePolicies: Resource policies to be removed from this disk.
  24215. ResourcePolicies []string `json:"resourcePolicies,omitempty"`
  24216. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  24217. // unconditionally include in API requests. By default, fields with
  24218. // empty values are omitted from API requests. However, any non-pointer,
  24219. // non-interface field appearing in ForceSendFields will be sent to the
  24220. // server regardless of whether the field is empty or not. This may be
  24221. // used to include empty fields in Patch requests.
  24222. ForceSendFields []string `json:"-"`
  24223. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  24224. // include in API requests with the JSON null value. By default, fields
  24225. // with empty values are omitted from API requests. However, any field
  24226. // with an empty value appearing in NullFields will be sent to the
  24227. // server as null. It is an error if a field in this list has a
  24228. // non-empty value. This may be used to include null fields in Patch
  24229. // requests.
  24230. NullFields []string `json:"-"`
  24231. }
  24232. func (s *RegionDisksRemoveResourcePoliciesRequest) MarshalJSON() ([]byte, error) {
  24233. type NoMethod RegionDisksRemoveResourcePoliciesRequest
  24234. raw := NoMethod(*s)
  24235. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24236. }
  24237. type RegionDisksResizeRequest struct {
  24238. // SizeGb: The new size of the regional persistent disk, which is
  24239. // specified in GB.
  24240. SizeGb int64 `json:"sizeGb,omitempty,string"`
  24241. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  24242. // unconditionally include in API requests. By default, fields with
  24243. // empty values are omitted from API requests. However, any non-pointer,
  24244. // non-interface field appearing in ForceSendFields will be sent to the
  24245. // server regardless of whether the field is empty or not. This may be
  24246. // used to include empty fields in Patch requests.
  24247. ForceSendFields []string `json:"-"`
  24248. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  24249. // requests with the JSON null value. By default, fields with empty
  24250. // values are omitted from API requests. However, any field with an
  24251. // empty value appearing in NullFields will be sent to the server as
  24252. // null. It is an error if a field in this list has a non-empty value.
  24253. // This may be used to include null fields in Patch requests.
  24254. NullFields []string `json:"-"`
  24255. }
  24256. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  24257. type NoMethod RegionDisksResizeRequest
  24258. raw := NoMethod(*s)
  24259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24260. }
  24261. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  24262. type RegionInstanceGroupList struct {
  24263. // Id: [Output Only] Unique identifier for the resource; defined by the
  24264. // server.
  24265. Id string `json:"id,omitempty"`
  24266. // Items: A list of InstanceGroup resources.
  24267. Items []*InstanceGroup `json:"items,omitempty"`
  24268. // Kind: The resource type.
  24269. Kind string `json:"kind,omitempty"`
  24270. // NextPageToken: [Output Only] This token allows you to get the next
  24271. // page of results for list requests. If the number of results is larger
  24272. // than maxResults, use the nextPageToken as a value for the query
  24273. // parameter pageToken in the next list request. Subsequent list
  24274. // requests will have their own nextPageToken to continue paging through
  24275. // the results.
  24276. NextPageToken string `json:"nextPageToken,omitempty"`
  24277. // SelfLink: [Output Only] Server-defined URL for this resource.
  24278. SelfLink string `json:"selfLink,omitempty"`
  24279. // Warning: [Output Only] Informational warning message.
  24280. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  24281. // ServerResponse contains the HTTP response code and headers from the
  24282. // server.
  24283. googleapi.ServerResponse `json:"-"`
  24284. // ForceSendFields is a list of field names (e.g. "Id") to
  24285. // unconditionally include in API requests. By default, fields with
  24286. // empty values are omitted from API requests. However, any non-pointer,
  24287. // non-interface field appearing in ForceSendFields will be sent to the
  24288. // server regardless of whether the field is empty or not. This may be
  24289. // used to include empty fields in Patch requests.
  24290. ForceSendFields []string `json:"-"`
  24291. // NullFields is a list of field names (e.g. "Id") to include in API
  24292. // requests with the JSON null value. By default, fields with empty
  24293. // values are omitted from API requests. However, any field with an
  24294. // empty value appearing in NullFields will be sent to the server as
  24295. // null. It is an error if a field in this list has a non-empty value.
  24296. // This may be used to include null fields in Patch requests.
  24297. NullFields []string `json:"-"`
  24298. }
  24299. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  24300. type NoMethod RegionInstanceGroupList
  24301. raw := NoMethod(*s)
  24302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24303. }
  24304. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  24305. // message.
  24306. type RegionInstanceGroupListWarning struct {
  24307. // Code: [Output Only] A warning code, if applicable. For example,
  24308. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24309. // the response.
  24310. //
  24311. // Possible values:
  24312. // "CLEANUP_FAILED"
  24313. // "DEPRECATED_RESOURCE_USED"
  24314. // "DEPRECATED_TYPE_USED"
  24315. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24316. // "EXPERIMENTAL_TYPE_USED"
  24317. // "EXTERNAL_API_WARNING"
  24318. // "FIELD_VALUE_OVERRIDEN"
  24319. // "INJECTED_KERNELS_DEPRECATED"
  24320. // "MISSING_TYPE_DEPENDENCY"
  24321. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24322. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24323. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24324. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24325. // "NEXT_HOP_NOT_RUNNING"
  24326. // "NOT_CRITICAL_ERROR"
  24327. // "NO_RESULTS_ON_PAGE"
  24328. // "REQUIRED_TOS_AGREEMENT"
  24329. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24330. // "RESOURCE_NOT_DELETED"
  24331. // "SCHEMA_VALIDATION_IGNORED"
  24332. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24333. // "UNDECLARED_PROPERTIES"
  24334. // "UNREACHABLE"
  24335. Code string `json:"code,omitempty"`
  24336. // Data: [Output Only] Metadata about this warning in key: value format.
  24337. // For example:
  24338. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24339. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  24340. // Message: [Output Only] A human-readable description of the warning
  24341. // code.
  24342. Message string `json:"message,omitempty"`
  24343. // ForceSendFields is a list of field names (e.g. "Code") to
  24344. // unconditionally include in API requests. By default, fields with
  24345. // empty values are omitted from API requests. However, any non-pointer,
  24346. // non-interface field appearing in ForceSendFields will be sent to the
  24347. // server regardless of whether the field is empty or not. This may be
  24348. // used to include empty fields in Patch requests.
  24349. ForceSendFields []string `json:"-"`
  24350. // NullFields is a list of field names (e.g. "Code") to include in API
  24351. // requests with the JSON null value. By default, fields with empty
  24352. // values are omitted from API requests. However, any field with an
  24353. // empty value appearing in NullFields will be sent to the server as
  24354. // null. It is an error if a field in this list has a non-empty value.
  24355. // This may be used to include null fields in Patch requests.
  24356. NullFields []string `json:"-"`
  24357. }
  24358. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  24359. type NoMethod RegionInstanceGroupListWarning
  24360. raw := NoMethod(*s)
  24361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24362. }
  24363. type RegionInstanceGroupListWarningData struct {
  24364. // Key: [Output Only] A key that provides more detail on the warning
  24365. // being returned. For example, for warnings where there are no results
  24366. // in a list request for a particular zone, this key might be scope and
  24367. // the key value might be the zone name. Other examples might be a key
  24368. // indicating a deprecated resource and a suggested replacement, or a
  24369. // warning about invalid network settings (for example, if an instance
  24370. // attempts to perform IP forwarding but is not enabled for IP
  24371. // forwarding).
  24372. Key string `json:"key,omitempty"`
  24373. // Value: [Output Only] A warning data value corresponding to the key.
  24374. Value string `json:"value,omitempty"`
  24375. // ForceSendFields is a list of field names (e.g. "Key") to
  24376. // unconditionally include in API requests. By default, fields with
  24377. // empty values are omitted from API requests. However, any non-pointer,
  24378. // non-interface field appearing in ForceSendFields will be sent to the
  24379. // server regardless of whether the field is empty or not. This may be
  24380. // used to include empty fields in Patch requests.
  24381. ForceSendFields []string `json:"-"`
  24382. // NullFields is a list of field names (e.g. "Key") to include in API
  24383. // requests with the JSON null value. By default, fields with empty
  24384. // values are omitted from API requests. However, any field with an
  24385. // empty value appearing in NullFields will be sent to the server as
  24386. // null. It is an error if a field in this list has a non-empty value.
  24387. // This may be used to include null fields in Patch requests.
  24388. NullFields []string `json:"-"`
  24389. }
  24390. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  24391. type NoMethod RegionInstanceGroupListWarningData
  24392. raw := NoMethod(*s)
  24393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24394. }
  24395. // RegionInstanceGroupManagerDeleteInstanceConfigReq:
  24396. // RegionInstanceGroupManagers.deletePerInstanceConfigs
  24397. type RegionInstanceGroupManagerDeleteInstanceConfigReq struct {
  24398. // Instances: The list of instances for which we want to delete
  24399. // per-instance configs on this managed instance group.
  24400. Instances []string `json:"instances,omitempty"`
  24401. // Names: The list of instance names for which we want to delete
  24402. // per-instance configs on this managed instance group.
  24403. Names []string `json:"names,omitempty"`
  24404. // ForceSendFields is a list of field names (e.g. "Instances") to
  24405. // unconditionally include in API requests. By default, fields with
  24406. // empty values are omitted from API requests. However, any non-pointer,
  24407. // non-interface field appearing in ForceSendFields will be sent to the
  24408. // server regardless of whether the field is empty or not. This may be
  24409. // used to include empty fields in Patch requests.
  24410. ForceSendFields []string `json:"-"`
  24411. // NullFields is a list of field names (e.g. "Instances") to include in
  24412. // API requests with the JSON null value. By default, fields with empty
  24413. // values are omitted from API requests. However, any field with an
  24414. // empty value appearing in NullFields will be sent to the server as
  24415. // null. It is an error if a field in this list has a non-empty value.
  24416. // This may be used to include null fields in Patch requests.
  24417. NullFields []string `json:"-"`
  24418. }
  24419. func (s *RegionInstanceGroupManagerDeleteInstanceConfigReq) MarshalJSON() ([]byte, error) {
  24420. type NoMethod RegionInstanceGroupManagerDeleteInstanceConfigReq
  24421. raw := NoMethod(*s)
  24422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24423. }
  24424. // RegionInstanceGroupManagerList: Contains a list of managed instance
  24425. // groups.
  24426. type RegionInstanceGroupManagerList struct {
  24427. // Id: [Output Only] Unique identifier for the resource; defined by the
  24428. // server.
  24429. Id string `json:"id,omitempty"`
  24430. // Items: A list of InstanceGroupManager resources.
  24431. Items []*InstanceGroupManager `json:"items,omitempty"`
  24432. // Kind: [Output Only] The resource type, which is always
  24433. // compute#instanceGroupManagerList for a list of managed instance
  24434. // groups that exist in th regional scope.
  24435. Kind string `json:"kind,omitempty"`
  24436. // NextPageToken: [Output Only] This token allows you to get the next
  24437. // page of results for list requests. If the number of results is larger
  24438. // than maxResults, use the nextPageToken as a value for the query
  24439. // parameter pageToken in the next list request. Subsequent list
  24440. // requests will have their own nextPageToken to continue paging through
  24441. // the results.
  24442. NextPageToken string `json:"nextPageToken,omitempty"`
  24443. // SelfLink: [Output Only] Server-defined URL for this resource.
  24444. SelfLink string `json:"selfLink,omitempty"`
  24445. // Warning: [Output Only] Informational warning message.
  24446. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  24447. // ServerResponse contains the HTTP response code and headers from the
  24448. // server.
  24449. googleapi.ServerResponse `json:"-"`
  24450. // ForceSendFields is a list of field names (e.g. "Id") to
  24451. // unconditionally include in API requests. By default, fields with
  24452. // empty values are omitted from API requests. However, any non-pointer,
  24453. // non-interface field appearing in ForceSendFields will be sent to the
  24454. // server regardless of whether the field is empty or not. This may be
  24455. // used to include empty fields in Patch requests.
  24456. ForceSendFields []string `json:"-"`
  24457. // NullFields is a list of field names (e.g. "Id") to include in API
  24458. // requests with the JSON null value. By default, fields with empty
  24459. // values are omitted from API requests. However, any field with an
  24460. // empty value appearing in NullFields will be sent to the server as
  24461. // null. It is an error if a field in this list has a non-empty value.
  24462. // This may be used to include null fields in Patch requests.
  24463. NullFields []string `json:"-"`
  24464. }
  24465. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  24466. type NoMethod RegionInstanceGroupManagerList
  24467. raw := NoMethod(*s)
  24468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24469. }
  24470. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  24471. // warning message.
  24472. type RegionInstanceGroupManagerListWarning struct {
  24473. // Code: [Output Only] A warning code, if applicable. For example,
  24474. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24475. // the response.
  24476. //
  24477. // Possible values:
  24478. // "CLEANUP_FAILED"
  24479. // "DEPRECATED_RESOURCE_USED"
  24480. // "DEPRECATED_TYPE_USED"
  24481. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24482. // "EXPERIMENTAL_TYPE_USED"
  24483. // "EXTERNAL_API_WARNING"
  24484. // "FIELD_VALUE_OVERRIDEN"
  24485. // "INJECTED_KERNELS_DEPRECATED"
  24486. // "MISSING_TYPE_DEPENDENCY"
  24487. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24488. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24489. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24490. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24491. // "NEXT_HOP_NOT_RUNNING"
  24492. // "NOT_CRITICAL_ERROR"
  24493. // "NO_RESULTS_ON_PAGE"
  24494. // "REQUIRED_TOS_AGREEMENT"
  24495. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24496. // "RESOURCE_NOT_DELETED"
  24497. // "SCHEMA_VALIDATION_IGNORED"
  24498. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24499. // "UNDECLARED_PROPERTIES"
  24500. // "UNREACHABLE"
  24501. Code string `json:"code,omitempty"`
  24502. // Data: [Output Only] Metadata about this warning in key: value format.
  24503. // For example:
  24504. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24505. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  24506. // Message: [Output Only] A human-readable description of the warning
  24507. // code.
  24508. Message string `json:"message,omitempty"`
  24509. // ForceSendFields is a list of field names (e.g. "Code") to
  24510. // unconditionally include in API requests. By default, fields with
  24511. // empty values are omitted from API requests. However, any non-pointer,
  24512. // non-interface field appearing in ForceSendFields will be sent to the
  24513. // server regardless of whether the field is empty or not. This may be
  24514. // used to include empty fields in Patch requests.
  24515. ForceSendFields []string `json:"-"`
  24516. // NullFields is a list of field names (e.g. "Code") to include in API
  24517. // requests with the JSON null value. By default, fields with empty
  24518. // values are omitted from API requests. However, any field with an
  24519. // empty value appearing in NullFields will be sent to the server as
  24520. // null. It is an error if a field in this list has a non-empty value.
  24521. // This may be used to include null fields in Patch requests.
  24522. NullFields []string `json:"-"`
  24523. }
  24524. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  24525. type NoMethod RegionInstanceGroupManagerListWarning
  24526. raw := NoMethod(*s)
  24527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24528. }
  24529. type RegionInstanceGroupManagerListWarningData struct {
  24530. // Key: [Output Only] A key that provides more detail on the warning
  24531. // being returned. For example, for warnings where there are no results
  24532. // in a list request for a particular zone, this key might be scope and
  24533. // the key value might be the zone name. Other examples might be a key
  24534. // indicating a deprecated resource and a suggested replacement, or a
  24535. // warning about invalid network settings (for example, if an instance
  24536. // attempts to perform IP forwarding but is not enabled for IP
  24537. // forwarding).
  24538. Key string `json:"key,omitempty"`
  24539. // Value: [Output Only] A warning data value corresponding to the key.
  24540. Value string `json:"value,omitempty"`
  24541. // ForceSendFields is a list of field names (e.g. "Key") to
  24542. // unconditionally include in API requests. By default, fields with
  24543. // empty values are omitted from API requests. However, any non-pointer,
  24544. // non-interface field appearing in ForceSendFields will be sent to the
  24545. // server regardless of whether the field is empty or not. This may be
  24546. // used to include empty fields in Patch requests.
  24547. ForceSendFields []string `json:"-"`
  24548. // NullFields is a list of field names (e.g. "Key") to include in API
  24549. // requests with the JSON null value. By default, fields with empty
  24550. // values are omitted from API requests. However, any field with an
  24551. // empty value appearing in NullFields will be sent to the server as
  24552. // null. It is an error if a field in this list has a non-empty value.
  24553. // This may be used to include null fields in Patch requests.
  24554. NullFields []string `json:"-"`
  24555. }
  24556. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  24557. type NoMethod RegionInstanceGroupManagerListWarningData
  24558. raw := NoMethod(*s)
  24559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24560. }
  24561. // RegionInstanceGroupManagerUpdateInstanceConfigReq:
  24562. // RegionInstanceGroupManagers.updatePerInstanceConfigs
  24563. type RegionInstanceGroupManagerUpdateInstanceConfigReq struct {
  24564. // PerInstanceConfigs: The list of per-instance configs to insert or
  24565. // patch on this managed instance group.
  24566. PerInstanceConfigs []*PerInstanceConfig `json:"perInstanceConfigs,omitempty"`
  24567. // ForceSendFields is a list of field names (e.g. "PerInstanceConfigs")
  24568. // to unconditionally include in API requests. By default, fields with
  24569. // empty values are omitted from API requests. However, any non-pointer,
  24570. // non-interface field appearing in ForceSendFields will be sent to the
  24571. // server regardless of whether the field is empty or not. This may be
  24572. // used to include empty fields in Patch requests.
  24573. ForceSendFields []string `json:"-"`
  24574. // NullFields is a list of field names (e.g. "PerInstanceConfigs") to
  24575. // include in API requests with the JSON null value. By default, fields
  24576. // with empty values are omitted from API requests. However, any field
  24577. // with an empty value appearing in NullFields will be sent to the
  24578. // server as null. It is an error if a field in this list has a
  24579. // non-empty value. This may be used to include null fields in Patch
  24580. // requests.
  24581. NullFields []string `json:"-"`
  24582. }
  24583. func (s *RegionInstanceGroupManagerUpdateInstanceConfigReq) MarshalJSON() ([]byte, error) {
  24584. type NoMethod RegionInstanceGroupManagerUpdateInstanceConfigReq
  24585. raw := NoMethod(*s)
  24586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24587. }
  24588. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  24589. // Instances: The URLs of one or more instances to abandon. This can be
  24590. // a full URL or a partial URL, such as
  24591. // zones/[ZONE]/instances/[INSTANCE_NAME].
  24592. Instances []string `json:"instances,omitempty"`
  24593. // ForceSendFields is a list of field names (e.g. "Instances") to
  24594. // unconditionally include in API requests. By default, fields with
  24595. // empty values are omitted from API requests. However, any non-pointer,
  24596. // non-interface field appearing in ForceSendFields will be sent to the
  24597. // server regardless of whether the field is empty or not. This may be
  24598. // used to include empty fields in Patch requests.
  24599. ForceSendFields []string `json:"-"`
  24600. // NullFields is a list of field names (e.g. "Instances") to include in
  24601. // API requests with the JSON null value. By default, fields with empty
  24602. // values are omitted from API requests. However, any field with an
  24603. // empty value appearing in NullFields will be sent to the server as
  24604. // null. It is an error if a field in this list has a non-empty value.
  24605. // This may be used to include null fields in Patch requests.
  24606. NullFields []string `json:"-"`
  24607. }
  24608. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  24609. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  24610. raw := NoMethod(*s)
  24611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24612. }
  24613. // RegionInstanceGroupManagersApplyUpdatesRequest:
  24614. // InstanceGroupManagers.applyUpdatesToInstances
  24615. type RegionInstanceGroupManagersApplyUpdatesRequest struct {
  24616. // Instances: The list of instances for which we want to apply changes
  24617. // on this managed instance group.
  24618. Instances []string `json:"instances,omitempty"`
  24619. // MaximalAction: The maximal action that should be performed on the
  24620. // instances. By default REPLACE. This field is deprecated, please use
  24621. // most_disruptive_allowed_action.
  24622. //
  24623. // Possible values:
  24624. // "NONE"
  24625. // "REFRESH"
  24626. // "REPLACE"
  24627. // "RESTART"
  24628. MaximalAction string `json:"maximalAction,omitempty"`
  24629. // MinimalAction: The minimal action that should be perfomed on the
  24630. // instances. By default NONE.
  24631. //
  24632. // Possible values:
  24633. // "NONE"
  24634. // "REFRESH"
  24635. // "REPLACE"
  24636. // "RESTART"
  24637. MinimalAction string `json:"minimalAction,omitempty"`
  24638. // MostDisruptiveAllowedAction: The most disruptive action that allowed
  24639. // to be performed on the instances. By default REPLACE.
  24640. //
  24641. // Possible values:
  24642. // "NONE"
  24643. // "REFRESH"
  24644. // "REPLACE"
  24645. // "RESTART"
  24646. MostDisruptiveAllowedAction string `json:"mostDisruptiveAllowedAction,omitempty"`
  24647. // ForceSendFields is a list of field names (e.g. "Instances") to
  24648. // unconditionally include in API requests. By default, fields with
  24649. // empty values are omitted from API requests. However, any non-pointer,
  24650. // non-interface field appearing in ForceSendFields will be sent to the
  24651. // server regardless of whether the field is empty or not. This may be
  24652. // used to include empty fields in Patch requests.
  24653. ForceSendFields []string `json:"-"`
  24654. // NullFields is a list of field names (e.g. "Instances") to include in
  24655. // API requests with the JSON null value. By default, fields with empty
  24656. // values are omitted from API requests. However, any field with an
  24657. // empty value appearing in NullFields will be sent to the server as
  24658. // null. It is an error if a field in this list has a non-empty value.
  24659. // This may be used to include null fields in Patch requests.
  24660. NullFields []string `json:"-"`
  24661. }
  24662. func (s *RegionInstanceGroupManagersApplyUpdatesRequest) MarshalJSON() ([]byte, error) {
  24663. type NoMethod RegionInstanceGroupManagersApplyUpdatesRequest
  24664. raw := NoMethod(*s)
  24665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24666. }
  24667. // RegionInstanceGroupManagersCreateInstancesRequest:
  24668. // RegionInstanceGroupManagers.createInstances
  24669. type RegionInstanceGroupManagersCreateInstancesRequest struct {
  24670. // Instances: [Required] List of specifications of per-instance configs.
  24671. Instances []*PerInstanceConfig `json:"instances,omitempty"`
  24672. // ForceSendFields is a list of field names (e.g. "Instances") to
  24673. // unconditionally include in API requests. By default, fields with
  24674. // empty values are omitted from API requests. However, any non-pointer,
  24675. // non-interface field appearing in ForceSendFields will be sent to the
  24676. // server regardless of whether the field is empty or not. This may be
  24677. // used to include empty fields in Patch requests.
  24678. ForceSendFields []string `json:"-"`
  24679. // NullFields is a list of field names (e.g. "Instances") to include in
  24680. // API requests with the JSON null value. By default, fields with empty
  24681. // values are omitted from API requests. However, any field with an
  24682. // empty value appearing in NullFields will be sent to the server as
  24683. // null. It is an error if a field in this list has a non-empty value.
  24684. // This may be used to include null fields in Patch requests.
  24685. NullFields []string `json:"-"`
  24686. }
  24687. func (s *RegionInstanceGroupManagersCreateInstancesRequest) MarshalJSON() ([]byte, error) {
  24688. type NoMethod RegionInstanceGroupManagersCreateInstancesRequest
  24689. raw := NoMethod(*s)
  24690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24691. }
  24692. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  24693. // Instances: The URLs of one or more instances to delete. This can be a
  24694. // full URL or a partial URL, such as
  24695. // zones/[ZONE]/instances/[INSTANCE_NAME].
  24696. Instances []string `json:"instances,omitempty"`
  24697. // ForceSendFields is a list of field names (e.g. "Instances") to
  24698. // unconditionally include in API requests. By default, fields with
  24699. // empty values are omitted from API requests. However, any non-pointer,
  24700. // non-interface field appearing in ForceSendFields will be sent to the
  24701. // server regardless of whether the field is empty or not. This may be
  24702. // used to include empty fields in Patch requests.
  24703. ForceSendFields []string `json:"-"`
  24704. // NullFields is a list of field names (e.g. "Instances") to include in
  24705. // API requests with the JSON null value. By default, fields with empty
  24706. // values are omitted from API requests. However, any field with an
  24707. // empty value appearing in NullFields will be sent to the server as
  24708. // null. It is an error if a field in this list has a non-empty value.
  24709. // This may be used to include null fields in Patch requests.
  24710. NullFields []string `json:"-"`
  24711. }
  24712. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  24713. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  24714. raw := NoMethod(*s)
  24715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24716. }
  24717. type RegionInstanceGroupManagersListInstanceConfigsResp struct {
  24718. // Items: [Output Only] The list of PerInstanceConfig.
  24719. Items []*PerInstanceConfig `json:"items,omitempty"`
  24720. // NextPageToken: [Output Only] This token allows you to get the next
  24721. // page of results for list requests. If the number of results is larger
  24722. // than maxResults, use the nextPageToken as a value for the query
  24723. // parameter pageToken in the next list request. Subsequent list
  24724. // requests will have their own nextPageToken to continue paging through
  24725. // the results.
  24726. NextPageToken string `json:"nextPageToken,omitempty"`
  24727. // Warning: [Output Only] Informational warning message.
  24728. Warning *RegionInstanceGroupManagersListInstanceConfigsRespWarning `json:"warning,omitempty"`
  24729. // ServerResponse contains the HTTP response code and headers from the
  24730. // server.
  24731. googleapi.ServerResponse `json:"-"`
  24732. // ForceSendFields is a list of field names (e.g. "Items") to
  24733. // unconditionally include in API requests. By default, fields with
  24734. // empty values are omitted from API requests. However, any non-pointer,
  24735. // non-interface field appearing in ForceSendFields will be sent to the
  24736. // server regardless of whether the field is empty or not. This may be
  24737. // used to include empty fields in Patch requests.
  24738. ForceSendFields []string `json:"-"`
  24739. // NullFields is a list of field names (e.g. "Items") to include in API
  24740. // requests with the JSON null value. By default, fields with empty
  24741. // values are omitted from API requests. However, any field with an
  24742. // empty value appearing in NullFields will be sent to the server as
  24743. // null. It is an error if a field in this list has a non-empty value.
  24744. // This may be used to include null fields in Patch requests.
  24745. NullFields []string `json:"-"`
  24746. }
  24747. func (s *RegionInstanceGroupManagersListInstanceConfigsResp) MarshalJSON() ([]byte, error) {
  24748. type NoMethod RegionInstanceGroupManagersListInstanceConfigsResp
  24749. raw := NoMethod(*s)
  24750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24751. }
  24752. // RegionInstanceGroupManagersListInstanceConfigsRespWarning: [Output
  24753. // Only] Informational warning message.
  24754. type RegionInstanceGroupManagersListInstanceConfigsRespWarning struct {
  24755. // Code: [Output Only] A warning code, if applicable. For example,
  24756. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24757. // the response.
  24758. //
  24759. // Possible values:
  24760. // "CLEANUP_FAILED"
  24761. // "DEPRECATED_RESOURCE_USED"
  24762. // "DEPRECATED_TYPE_USED"
  24763. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24764. // "EXPERIMENTAL_TYPE_USED"
  24765. // "EXTERNAL_API_WARNING"
  24766. // "FIELD_VALUE_OVERRIDEN"
  24767. // "INJECTED_KERNELS_DEPRECATED"
  24768. // "MISSING_TYPE_DEPENDENCY"
  24769. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24770. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24771. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24772. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24773. // "NEXT_HOP_NOT_RUNNING"
  24774. // "NOT_CRITICAL_ERROR"
  24775. // "NO_RESULTS_ON_PAGE"
  24776. // "REQUIRED_TOS_AGREEMENT"
  24777. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24778. // "RESOURCE_NOT_DELETED"
  24779. // "SCHEMA_VALIDATION_IGNORED"
  24780. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24781. // "UNDECLARED_PROPERTIES"
  24782. // "UNREACHABLE"
  24783. Code string `json:"code,omitempty"`
  24784. // Data: [Output Only] Metadata about this warning in key: value format.
  24785. // For example:
  24786. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24787. Data []*RegionInstanceGroupManagersListInstanceConfigsRespWarningData `json:"data,omitempty"`
  24788. // Message: [Output Only] A human-readable description of the warning
  24789. // code.
  24790. Message string `json:"message,omitempty"`
  24791. // ForceSendFields is a list of field names (e.g. "Code") to
  24792. // unconditionally include in API requests. By default, fields with
  24793. // empty values are omitted from API requests. However, any non-pointer,
  24794. // non-interface field appearing in ForceSendFields will be sent to the
  24795. // server regardless of whether the field is empty or not. This may be
  24796. // used to include empty fields in Patch requests.
  24797. ForceSendFields []string `json:"-"`
  24798. // NullFields is a list of field names (e.g. "Code") to include in API
  24799. // requests with the JSON null value. By default, fields with empty
  24800. // values are omitted from API requests. However, any field with an
  24801. // empty value appearing in NullFields will be sent to the server as
  24802. // null. It is an error if a field in this list has a non-empty value.
  24803. // This may be used to include null fields in Patch requests.
  24804. NullFields []string `json:"-"`
  24805. }
  24806. func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarning) MarshalJSON() ([]byte, error) {
  24807. type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarning
  24808. raw := NoMethod(*s)
  24809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24810. }
  24811. type RegionInstanceGroupManagersListInstanceConfigsRespWarningData struct {
  24812. // Key: [Output Only] A key that provides more detail on the warning
  24813. // being returned. For example, for warnings where there are no results
  24814. // in a list request for a particular zone, this key might be scope and
  24815. // the key value might be the zone name. Other examples might be a key
  24816. // indicating a deprecated resource and a suggested replacement, or a
  24817. // warning about invalid network settings (for example, if an instance
  24818. // attempts to perform IP forwarding but is not enabled for IP
  24819. // forwarding).
  24820. Key string `json:"key,omitempty"`
  24821. // Value: [Output Only] A warning data value corresponding to the key.
  24822. Value string `json:"value,omitempty"`
  24823. // ForceSendFields is a list of field names (e.g. "Key") to
  24824. // unconditionally include in API requests. By default, fields with
  24825. // empty values are omitted from API requests. However, any non-pointer,
  24826. // non-interface field appearing in ForceSendFields will be sent to the
  24827. // server regardless of whether the field is empty or not. This may be
  24828. // used to include empty fields in Patch requests.
  24829. ForceSendFields []string `json:"-"`
  24830. // NullFields is a list of field names (e.g. "Key") to include in API
  24831. // requests with the JSON null value. By default, fields with empty
  24832. // values are omitted from API requests. However, any field with an
  24833. // empty value appearing in NullFields will be sent to the server as
  24834. // null. It is an error if a field in this list has a non-empty value.
  24835. // This may be used to include null fields in Patch requests.
  24836. NullFields []string `json:"-"`
  24837. }
  24838. func (s *RegionInstanceGroupManagersListInstanceConfigsRespWarningData) MarshalJSON() ([]byte, error) {
  24839. type NoMethod RegionInstanceGroupManagersListInstanceConfigsRespWarningData
  24840. raw := NoMethod(*s)
  24841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24842. }
  24843. type RegionInstanceGroupManagersListInstancesResponse struct {
  24844. // ManagedInstances: A list of managed instances.
  24845. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  24846. // NextPageToken: [Output Only] This token allows you to get the next
  24847. // page of results for list requests. If the number of results is larger
  24848. // than maxResults, use the nextPageToken as a value for the query
  24849. // parameter pageToken in the next list request. Subsequent list
  24850. // requests will have their own nextPageToken to continue paging through
  24851. // the results.
  24852. NextPageToken string `json:"nextPageToken,omitempty"`
  24853. // ServerResponse contains the HTTP response code and headers from the
  24854. // server.
  24855. googleapi.ServerResponse `json:"-"`
  24856. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  24857. // unconditionally include in API requests. By default, fields with
  24858. // empty values are omitted from API requests. However, any non-pointer,
  24859. // non-interface field appearing in ForceSendFields will be sent to the
  24860. // server regardless of whether the field is empty or not. This may be
  24861. // used to include empty fields in Patch requests.
  24862. ForceSendFields []string `json:"-"`
  24863. // NullFields is a list of field names (e.g. "ManagedInstances") to
  24864. // include in API requests with the JSON null value. By default, fields
  24865. // with empty values are omitted from API requests. However, any field
  24866. // with an empty value appearing in NullFields will be sent to the
  24867. // server as null. It is an error if a field in this list has a
  24868. // non-empty value. This may be used to include null fields in Patch
  24869. // requests.
  24870. NullFields []string `json:"-"`
  24871. }
  24872. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  24873. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  24874. raw := NoMethod(*s)
  24875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24876. }
  24877. type RegionInstanceGroupManagersRecreateRequest struct {
  24878. // Instances: The URLs of one or more instances to recreate. This can be
  24879. // a full URL or a partial URL, such as
  24880. // zones/[ZONE]/instances/[INSTANCE_NAME].
  24881. Instances []string `json:"instances,omitempty"`
  24882. // ForceSendFields is a list of field names (e.g. "Instances") to
  24883. // unconditionally include in API requests. By default, fields with
  24884. // empty values are omitted from API requests. However, any non-pointer,
  24885. // non-interface field appearing in ForceSendFields will be sent to the
  24886. // server regardless of whether the field is empty or not. This may be
  24887. // used to include empty fields in Patch requests.
  24888. ForceSendFields []string `json:"-"`
  24889. // NullFields is a list of field names (e.g. "Instances") to include in
  24890. // API requests with the JSON null value. By default, fields with empty
  24891. // values are omitted from API requests. However, any field with an
  24892. // empty value appearing in NullFields will be sent to the server as
  24893. // null. It is an error if a field in this list has a non-empty value.
  24894. // This may be used to include null fields in Patch requests.
  24895. NullFields []string `json:"-"`
  24896. }
  24897. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  24898. type NoMethod RegionInstanceGroupManagersRecreateRequest
  24899. raw := NoMethod(*s)
  24900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24901. }
  24902. type RegionInstanceGroupManagersSetAutoHealingRequest struct {
  24903. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  24904. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  24905. // to unconditionally include in API requests. By default, fields with
  24906. // empty values are omitted from API requests. However, any non-pointer,
  24907. // non-interface field appearing in ForceSendFields will be sent to the
  24908. // server regardless of whether the field is empty or not. This may be
  24909. // used to include empty fields in Patch requests.
  24910. ForceSendFields []string `json:"-"`
  24911. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  24912. // include in API requests with the JSON null value. By default, fields
  24913. // with empty values are omitted from API requests. However, any field
  24914. // with an empty value appearing in NullFields will be sent to the
  24915. // server as null. It is an error if a field in this list has a
  24916. // non-empty value. This may be used to include null fields in Patch
  24917. // requests.
  24918. NullFields []string `json:"-"`
  24919. }
  24920. func (s *RegionInstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  24921. type NoMethod RegionInstanceGroupManagersSetAutoHealingRequest
  24922. raw := NoMethod(*s)
  24923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24924. }
  24925. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  24926. // Fingerprint: Fingerprint of the target pools information, which is a
  24927. // hash of the contents. This field is used for optimistic locking when
  24928. // you update the target pool entries. This field is optional.
  24929. Fingerprint string `json:"fingerprint,omitempty"`
  24930. // TargetPools: The URL of all TargetPool resources to which instances
  24931. // in the instanceGroup field are added. The target pools automatically
  24932. // apply to all of the instances in the managed instance group.
  24933. TargetPools []string `json:"targetPools,omitempty"`
  24934. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  24935. // unconditionally include in API requests. By default, fields with
  24936. // empty values are omitted from API requests. However, any non-pointer,
  24937. // non-interface field appearing in ForceSendFields will be sent to the
  24938. // server regardless of whether the field is empty or not. This may be
  24939. // used to include empty fields in Patch requests.
  24940. ForceSendFields []string `json:"-"`
  24941. // NullFields is a list of field names (e.g. "Fingerprint") to include
  24942. // in API requests with the JSON null value. By default, fields with
  24943. // empty values are omitted from API requests. However, any field with
  24944. // an empty value appearing in NullFields will be sent to the server as
  24945. // null. It is an error if a field in this list has a non-empty value.
  24946. // This may be used to include null fields in Patch requests.
  24947. NullFields []string `json:"-"`
  24948. }
  24949. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  24950. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  24951. raw := NoMethod(*s)
  24952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24953. }
  24954. type RegionInstanceGroupManagersSetTemplateRequest struct {
  24955. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  24956. // new instances will be created.
  24957. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  24958. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  24959. // unconditionally include in API requests. By default, fields with
  24960. // empty values are omitted from API requests. However, any non-pointer,
  24961. // non-interface field appearing in ForceSendFields will be sent to the
  24962. // server regardless of whether the field is empty or not. This may be
  24963. // used to include empty fields in Patch requests.
  24964. ForceSendFields []string `json:"-"`
  24965. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  24966. // include in API requests with the JSON null value. By default, fields
  24967. // with empty values are omitted from API requests. However, any field
  24968. // with an empty value appearing in NullFields will be sent to the
  24969. // server as null. It is an error if a field in this list has a
  24970. // non-empty value. This may be used to include null fields in Patch
  24971. // requests.
  24972. NullFields []string `json:"-"`
  24973. }
  24974. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  24975. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  24976. raw := NoMethod(*s)
  24977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24978. }
  24979. type RegionInstanceGroupsListInstances struct {
  24980. // Id: [Output Only] Unique identifier for the resource; defined by the
  24981. // server.
  24982. Id string `json:"id,omitempty"`
  24983. // Items: A list of InstanceWithNamedPorts resources.
  24984. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  24985. // Kind: The resource type.
  24986. Kind string `json:"kind,omitempty"`
  24987. // NextPageToken: [Output Only] This token allows you to get the next
  24988. // page of results for list requests. If the number of results is larger
  24989. // than maxResults, use the nextPageToken as a value for the query
  24990. // parameter pageToken in the next list request. Subsequent list
  24991. // requests will have their own nextPageToken to continue paging through
  24992. // the results.
  24993. NextPageToken string `json:"nextPageToken,omitempty"`
  24994. // SelfLink: [Output Only] Server-defined URL for this resource.
  24995. SelfLink string `json:"selfLink,omitempty"`
  24996. // Warning: [Output Only] Informational warning message.
  24997. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  24998. // ServerResponse contains the HTTP response code and headers from the
  24999. // server.
  25000. googleapi.ServerResponse `json:"-"`
  25001. // ForceSendFields is a list of field names (e.g. "Id") to
  25002. // unconditionally include in API requests. By default, fields with
  25003. // empty values are omitted from API requests. However, any non-pointer,
  25004. // non-interface field appearing in ForceSendFields will be sent to the
  25005. // server regardless of whether the field is empty or not. This may be
  25006. // used to include empty fields in Patch requests.
  25007. ForceSendFields []string `json:"-"`
  25008. // NullFields is a list of field names (e.g. "Id") to include in API
  25009. // requests with the JSON null value. By default, fields with empty
  25010. // values are omitted from API requests. However, any field with an
  25011. // empty value appearing in NullFields will be sent to the server as
  25012. // null. It is an error if a field in this list has a non-empty value.
  25013. // This may be used to include null fields in Patch requests.
  25014. NullFields []string `json:"-"`
  25015. }
  25016. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  25017. type NoMethod RegionInstanceGroupsListInstances
  25018. raw := NoMethod(*s)
  25019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25020. }
  25021. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  25022. // warning message.
  25023. type RegionInstanceGroupsListInstancesWarning struct {
  25024. // Code: [Output Only] A warning code, if applicable. For example,
  25025. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25026. // the response.
  25027. //
  25028. // Possible values:
  25029. // "CLEANUP_FAILED"
  25030. // "DEPRECATED_RESOURCE_USED"
  25031. // "DEPRECATED_TYPE_USED"
  25032. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25033. // "EXPERIMENTAL_TYPE_USED"
  25034. // "EXTERNAL_API_WARNING"
  25035. // "FIELD_VALUE_OVERRIDEN"
  25036. // "INJECTED_KERNELS_DEPRECATED"
  25037. // "MISSING_TYPE_DEPENDENCY"
  25038. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25039. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25040. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25041. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25042. // "NEXT_HOP_NOT_RUNNING"
  25043. // "NOT_CRITICAL_ERROR"
  25044. // "NO_RESULTS_ON_PAGE"
  25045. // "REQUIRED_TOS_AGREEMENT"
  25046. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25047. // "RESOURCE_NOT_DELETED"
  25048. // "SCHEMA_VALIDATION_IGNORED"
  25049. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25050. // "UNDECLARED_PROPERTIES"
  25051. // "UNREACHABLE"
  25052. Code string `json:"code,omitempty"`
  25053. // Data: [Output Only] Metadata about this warning in key: value format.
  25054. // For example:
  25055. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25056. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  25057. // Message: [Output Only] A human-readable description of the warning
  25058. // code.
  25059. Message string `json:"message,omitempty"`
  25060. // ForceSendFields is a list of field names (e.g. "Code") to
  25061. // unconditionally include in API requests. By default, fields with
  25062. // empty values are omitted from API requests. However, any non-pointer,
  25063. // non-interface field appearing in ForceSendFields will be sent to the
  25064. // server regardless of whether the field is empty or not. This may be
  25065. // used to include empty fields in Patch requests.
  25066. ForceSendFields []string `json:"-"`
  25067. // NullFields is a list of field names (e.g. "Code") to include in API
  25068. // requests with the JSON null value. By default, fields with empty
  25069. // values are omitted from API requests. However, any field with an
  25070. // empty value appearing in NullFields will be sent to the server as
  25071. // null. It is an error if a field in this list has a non-empty value.
  25072. // This may be used to include null fields in Patch requests.
  25073. NullFields []string `json:"-"`
  25074. }
  25075. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  25076. type NoMethod RegionInstanceGroupsListInstancesWarning
  25077. raw := NoMethod(*s)
  25078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25079. }
  25080. type RegionInstanceGroupsListInstancesWarningData struct {
  25081. // Key: [Output Only] A key that provides more detail on the warning
  25082. // being returned. For example, for warnings where there are no results
  25083. // in a list request for a particular zone, this key might be scope and
  25084. // the key value might be the zone name. Other examples might be a key
  25085. // indicating a deprecated resource and a suggested replacement, or a
  25086. // warning about invalid network settings (for example, if an instance
  25087. // attempts to perform IP forwarding but is not enabled for IP
  25088. // forwarding).
  25089. Key string `json:"key,omitempty"`
  25090. // Value: [Output Only] A warning data value corresponding to the key.
  25091. Value string `json:"value,omitempty"`
  25092. // ForceSendFields is a list of field names (e.g. "Key") to
  25093. // unconditionally include in API requests. By default, fields with
  25094. // empty values are omitted from API requests. However, any non-pointer,
  25095. // non-interface field appearing in ForceSendFields will be sent to the
  25096. // server regardless of whether the field is empty or not. This may be
  25097. // used to include empty fields in Patch requests.
  25098. ForceSendFields []string `json:"-"`
  25099. // NullFields is a list of field names (e.g. "Key") to include in API
  25100. // requests with the JSON null value. By default, fields with empty
  25101. // values are omitted from API requests. However, any field with an
  25102. // empty value appearing in NullFields will be sent to the server as
  25103. // null. It is an error if a field in this list has a non-empty value.
  25104. // This may be used to include null fields in Patch requests.
  25105. NullFields []string `json:"-"`
  25106. }
  25107. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  25108. type NoMethod RegionInstanceGroupsListInstancesWarningData
  25109. raw := NoMethod(*s)
  25110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25111. }
  25112. type RegionInstanceGroupsListInstancesRequest struct {
  25113. // InstanceState: Instances in which state should be returned. Valid
  25114. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  25115. //
  25116. // Possible values:
  25117. // "ALL"
  25118. // "RUNNING"
  25119. InstanceState string `json:"instanceState,omitempty"`
  25120. // PortName: Name of port user is interested in. It is optional. If it
  25121. // is set, only information about this ports will be returned. If it is
  25122. // not set, all the named ports will be returned. Always lists all
  25123. // instances.
  25124. PortName string `json:"portName,omitempty"`
  25125. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  25126. // unconditionally include in API requests. By default, fields with
  25127. // empty values are omitted from API requests. However, any non-pointer,
  25128. // non-interface field appearing in ForceSendFields will be sent to the
  25129. // server regardless of whether the field is empty or not. This may be
  25130. // used to include empty fields in Patch requests.
  25131. ForceSendFields []string `json:"-"`
  25132. // NullFields is a list of field names (e.g. "InstanceState") to include
  25133. // in API requests with the JSON null value. By default, fields with
  25134. // empty values are omitted from API requests. However, any field with
  25135. // an empty value appearing in NullFields will be sent to the server as
  25136. // null. It is an error if a field in this list has a non-empty value.
  25137. // This may be used to include null fields in Patch requests.
  25138. NullFields []string `json:"-"`
  25139. }
  25140. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  25141. type NoMethod RegionInstanceGroupsListInstancesRequest
  25142. raw := NoMethod(*s)
  25143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25144. }
  25145. type RegionInstanceGroupsSetNamedPortsRequest struct {
  25146. // Fingerprint: The fingerprint of the named ports information for this
  25147. // instance group. Use this optional property to prevent conflicts when
  25148. // multiple users change the named ports settings concurrently. Obtain
  25149. // the fingerprint with the instanceGroups.get method. Then, include the
  25150. // fingerprint in your request to ensure that you do not overwrite
  25151. // changes that were applied from another concurrent request.
  25152. Fingerprint string `json:"fingerprint,omitempty"`
  25153. // NamedPorts: The list of named ports to set for this instance group.
  25154. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  25155. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  25156. // unconditionally include in API requests. By default, fields with
  25157. // empty values are omitted from API requests. However, any non-pointer,
  25158. // non-interface field appearing in ForceSendFields will be sent to the
  25159. // server regardless of whether the field is empty or not. This may be
  25160. // used to include empty fields in Patch requests.
  25161. ForceSendFields []string `json:"-"`
  25162. // NullFields is a list of field names (e.g. "Fingerprint") to include
  25163. // in API requests with the JSON null value. By default, fields with
  25164. // empty values are omitted from API requests. However, any field with
  25165. // an empty value appearing in NullFields will be sent to the server as
  25166. // null. It is an error if a field in this list has a non-empty value.
  25167. // This may be used to include null fields in Patch requests.
  25168. NullFields []string `json:"-"`
  25169. }
  25170. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  25171. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  25172. raw := NoMethod(*s)
  25173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25174. }
  25175. // RegionList: Contains a list of region resources.
  25176. type RegionList struct {
  25177. // Id: [Output Only] Unique identifier for the resource; defined by the
  25178. // server.
  25179. Id string `json:"id,omitempty"`
  25180. // Items: A list of Region resources.
  25181. Items []*Region `json:"items,omitempty"`
  25182. // Kind: [Output Only] Type of resource. Always compute#regionList for
  25183. // lists of regions.
  25184. Kind string `json:"kind,omitempty"`
  25185. // NextPageToken: [Output Only] This token allows you to get the next
  25186. // page of results for list requests. If the number of results is larger
  25187. // than maxResults, use the nextPageToken as a value for the query
  25188. // parameter pageToken in the next list request. Subsequent list
  25189. // requests will have their own nextPageToken to continue paging through
  25190. // the results.
  25191. NextPageToken string `json:"nextPageToken,omitempty"`
  25192. // SelfLink: [Output Only] Server-defined URL for this resource.
  25193. SelfLink string `json:"selfLink,omitempty"`
  25194. // Warning: [Output Only] Informational warning message.
  25195. Warning *RegionListWarning `json:"warning,omitempty"`
  25196. // ServerResponse contains the HTTP response code and headers from the
  25197. // server.
  25198. googleapi.ServerResponse `json:"-"`
  25199. // ForceSendFields is a list of field names (e.g. "Id") to
  25200. // unconditionally include in API requests. By default, fields with
  25201. // empty values are omitted from API requests. However, any non-pointer,
  25202. // non-interface field appearing in ForceSendFields will be sent to the
  25203. // server regardless of whether the field is empty or not. This may be
  25204. // used to include empty fields in Patch requests.
  25205. ForceSendFields []string `json:"-"`
  25206. // NullFields is a list of field names (e.g. "Id") to include in API
  25207. // requests with the JSON null value. By default, fields with empty
  25208. // values are omitted from API requests. However, any field with an
  25209. // empty value appearing in NullFields will be sent to the server as
  25210. // null. It is an error if a field in this list has a non-empty value.
  25211. // This may be used to include null fields in Patch requests.
  25212. NullFields []string `json:"-"`
  25213. }
  25214. func (s *RegionList) MarshalJSON() ([]byte, error) {
  25215. type NoMethod RegionList
  25216. raw := NoMethod(*s)
  25217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25218. }
  25219. // RegionListWarning: [Output Only] Informational warning message.
  25220. type RegionListWarning struct {
  25221. // Code: [Output Only] A warning code, if applicable. For example,
  25222. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25223. // the response.
  25224. //
  25225. // Possible values:
  25226. // "CLEANUP_FAILED"
  25227. // "DEPRECATED_RESOURCE_USED"
  25228. // "DEPRECATED_TYPE_USED"
  25229. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25230. // "EXPERIMENTAL_TYPE_USED"
  25231. // "EXTERNAL_API_WARNING"
  25232. // "FIELD_VALUE_OVERRIDEN"
  25233. // "INJECTED_KERNELS_DEPRECATED"
  25234. // "MISSING_TYPE_DEPENDENCY"
  25235. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25236. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25237. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25238. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25239. // "NEXT_HOP_NOT_RUNNING"
  25240. // "NOT_CRITICAL_ERROR"
  25241. // "NO_RESULTS_ON_PAGE"
  25242. // "REQUIRED_TOS_AGREEMENT"
  25243. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25244. // "RESOURCE_NOT_DELETED"
  25245. // "SCHEMA_VALIDATION_IGNORED"
  25246. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25247. // "UNDECLARED_PROPERTIES"
  25248. // "UNREACHABLE"
  25249. Code string `json:"code,omitempty"`
  25250. // Data: [Output Only] Metadata about this warning in key: value format.
  25251. // For example:
  25252. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25253. Data []*RegionListWarningData `json:"data,omitempty"`
  25254. // Message: [Output Only] A human-readable description of the warning
  25255. // code.
  25256. Message string `json:"message,omitempty"`
  25257. // ForceSendFields is a list of field names (e.g. "Code") to
  25258. // unconditionally include in API requests. By default, fields with
  25259. // empty values are omitted from API requests. However, any non-pointer,
  25260. // non-interface field appearing in ForceSendFields will be sent to the
  25261. // server regardless of whether the field is empty or not. This may be
  25262. // used to include empty fields in Patch requests.
  25263. ForceSendFields []string `json:"-"`
  25264. // NullFields is a list of field names (e.g. "Code") to include in API
  25265. // requests with the JSON null value. By default, fields with empty
  25266. // values are omitted from API requests. However, any field with an
  25267. // empty value appearing in NullFields will be sent to the server as
  25268. // null. It is an error if a field in this list has a non-empty value.
  25269. // This may be used to include null fields in Patch requests.
  25270. NullFields []string `json:"-"`
  25271. }
  25272. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  25273. type NoMethod RegionListWarning
  25274. raw := NoMethod(*s)
  25275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25276. }
  25277. type RegionListWarningData struct {
  25278. // Key: [Output Only] A key that provides more detail on the warning
  25279. // being returned. For example, for warnings where there are no results
  25280. // in a list request for a particular zone, this key might be scope and
  25281. // the key value might be the zone name. Other examples might be a key
  25282. // indicating a deprecated resource and a suggested replacement, or a
  25283. // warning about invalid network settings (for example, if an instance
  25284. // attempts to perform IP forwarding but is not enabled for IP
  25285. // forwarding).
  25286. Key string `json:"key,omitempty"`
  25287. // Value: [Output Only] A warning data value corresponding to the key.
  25288. Value string `json:"value,omitempty"`
  25289. // ForceSendFields is a list of field names (e.g. "Key") to
  25290. // unconditionally include in API requests. By default, fields with
  25291. // empty values are omitted from API requests. However, any non-pointer,
  25292. // non-interface field appearing in ForceSendFields will be sent to the
  25293. // server regardless of whether the field is empty or not. This may be
  25294. // used to include empty fields in Patch requests.
  25295. ForceSendFields []string `json:"-"`
  25296. // NullFields is a list of field names (e.g. "Key") to include in API
  25297. // requests with the JSON null value. By default, fields with empty
  25298. // values are omitted from API requests. However, any field with an
  25299. // empty value appearing in NullFields will be sent to the server as
  25300. // null. It is an error if a field in this list has a non-empty value.
  25301. // This may be used to include null fields in Patch requests.
  25302. NullFields []string `json:"-"`
  25303. }
  25304. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  25305. type NoMethod RegionListWarningData
  25306. raw := NoMethod(*s)
  25307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25308. }
  25309. type RegionSetLabelsRequest struct {
  25310. // LabelFingerprint: The fingerprint of the previous set of labels for
  25311. // this resource, used to detect conflicts. The fingerprint is initially
  25312. // generated by Compute Engine and changes after every request to modify
  25313. // or update labels. You must always provide an up-to-date fingerprint
  25314. // hash in order to update or change labels. Make a get() request to the
  25315. // resource to get the latest fingerprint.
  25316. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  25317. // Labels: The labels to set for this resource.
  25318. Labels map[string]string `json:"labels,omitempty"`
  25319. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  25320. // unconditionally include in API requests. By default, fields with
  25321. // empty values are omitted from API requests. However, any non-pointer,
  25322. // non-interface field appearing in ForceSendFields will be sent to the
  25323. // server regardless of whether the field is empty or not. This may be
  25324. // used to include empty fields in Patch requests.
  25325. ForceSendFields []string `json:"-"`
  25326. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  25327. // include in API requests with the JSON null value. By default, fields
  25328. // with empty values are omitted from API requests. However, any field
  25329. // with an empty value appearing in NullFields will be sent to the
  25330. // server as null. It is an error if a field in this list has a
  25331. // non-empty value. This may be used to include null fields in Patch
  25332. // requests.
  25333. NullFields []string `json:"-"`
  25334. }
  25335. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  25336. type NoMethod RegionSetLabelsRequest
  25337. raw := NoMethod(*s)
  25338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25339. }
  25340. type RegionSetPolicyRequest struct {
  25341. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  25342. // Deprecated. Use 'policy' to specify bindings.
  25343. Bindings []*Binding `json:"bindings,omitempty"`
  25344. // Etag: Flatten Policy to create a backward compatible wire-format.
  25345. // Deprecated. Use 'policy' to specify the etag.
  25346. Etag string `json:"etag,omitempty"`
  25347. // Policy: REQUIRED: The complete policy to be applied to the
  25348. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  25349. // empty policy is in general a valid policy but certain services (like
  25350. // Projects) might reject them.
  25351. Policy *Policy `json:"policy,omitempty"`
  25352. // ForceSendFields is a list of field names (e.g. "Bindings") to
  25353. // unconditionally include in API requests. By default, fields with
  25354. // empty values are omitted from API requests. However, any non-pointer,
  25355. // non-interface field appearing in ForceSendFields will be sent to the
  25356. // server regardless of whether the field is empty or not. This may be
  25357. // used to include empty fields in Patch requests.
  25358. ForceSendFields []string `json:"-"`
  25359. // NullFields is a list of field names (e.g. "Bindings") to include in
  25360. // API requests with the JSON null value. By default, fields with empty
  25361. // values are omitted from API requests. However, any field with an
  25362. // empty value appearing in NullFields will be sent to the server as
  25363. // null. It is an error if a field in this list has a non-empty value.
  25364. // This may be used to include null fields in Patch requests.
  25365. NullFields []string `json:"-"`
  25366. }
  25367. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  25368. type NoMethod RegionSetPolicyRequest
  25369. raw := NoMethod(*s)
  25370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25371. }
  25372. type RegionTargetHttpsProxiesSetSslCertificatesRequest struct {
  25373. // SslCertificates: New set of SslCertificate resources to associate
  25374. // with this TargetHttpsProxy resource. Currently exactly one
  25375. // SslCertificate resource must be specified.
  25376. SslCertificates []string `json:"sslCertificates,omitempty"`
  25377. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  25378. // unconditionally include in API requests. By default, fields with
  25379. // empty values are omitted from API requests. However, any non-pointer,
  25380. // non-interface field appearing in ForceSendFields will be sent to the
  25381. // server regardless of whether the field is empty or not. This may be
  25382. // used to include empty fields in Patch requests.
  25383. ForceSendFields []string `json:"-"`
  25384. // NullFields is a list of field names (e.g. "SslCertificates") to
  25385. // include in API requests with the JSON null value. By default, fields
  25386. // with empty values are omitted from API requests. However, any field
  25387. // with an empty value appearing in NullFields will be sent to the
  25388. // server as null. It is an error if a field in this list has a
  25389. // non-empty value. This may be used to include null fields in Patch
  25390. // requests.
  25391. NullFields []string `json:"-"`
  25392. }
  25393. func (s *RegionTargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  25394. type NoMethod RegionTargetHttpsProxiesSetSslCertificatesRequest
  25395. raw := NoMethod(*s)
  25396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25397. }
  25398. type RegionUrlMapsValidateRequest struct {
  25399. // Resource: Content of the UrlMap to be validated.
  25400. Resource *UrlMap `json:"resource,omitempty"`
  25401. // ForceSendFields is a list of field names (e.g. "Resource") to
  25402. // unconditionally include in API requests. By default, fields with
  25403. // empty values are omitted from API requests. However, any non-pointer,
  25404. // non-interface field appearing in ForceSendFields will be sent to the
  25405. // server regardless of whether the field is empty or not. This may be
  25406. // used to include empty fields in Patch requests.
  25407. ForceSendFields []string `json:"-"`
  25408. // NullFields is a list of field names (e.g. "Resource") to include in
  25409. // API requests with the JSON null value. By default, fields with empty
  25410. // values are omitted from API requests. However, any field with an
  25411. // empty value appearing in NullFields will be sent to the server as
  25412. // null. It is an error if a field in this list has a non-empty value.
  25413. // This may be used to include null fields in Patch requests.
  25414. NullFields []string `json:"-"`
  25415. }
  25416. func (s *RegionUrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  25417. type NoMethod RegionUrlMapsValidateRequest
  25418. raw := NoMethod(*s)
  25419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25420. }
  25421. // RequestMirrorPolicy: A policy that specifies how requests intended
  25422. // for the route's backends are shadowed to a separate mirrored backend
  25423. // service. Loadbalancer does not wait for responses from the shadow
  25424. // service. Prior to sending traffic to the shadow service, the host /
  25425. // authority header is suffixed with -shadow.
  25426. type RequestMirrorPolicy struct {
  25427. // BackendService: The full or partial URL to the BackendService
  25428. // resource being mirrored to.
  25429. BackendService string `json:"backendService,omitempty"`
  25430. // ForceSendFields is a list of field names (e.g. "BackendService") to
  25431. // unconditionally include in API requests. By default, fields with
  25432. // empty values are omitted from API requests. However, any non-pointer,
  25433. // non-interface field appearing in ForceSendFields will be sent to the
  25434. // server regardless of whether the field is empty or not. This may be
  25435. // used to include empty fields in Patch requests.
  25436. ForceSendFields []string `json:"-"`
  25437. // NullFields is a list of field names (e.g. "BackendService") to
  25438. // include in API requests with the JSON null value. By default, fields
  25439. // with empty values are omitted from API requests. However, any field
  25440. // with an empty value appearing in NullFields will be sent to the
  25441. // server as null. It is an error if a field in this list has a
  25442. // non-empty value. This may be used to include null fields in Patch
  25443. // requests.
  25444. NullFields []string `json:"-"`
  25445. }
  25446. func (s *RequestMirrorPolicy) MarshalJSON() ([]byte, error) {
  25447. type NoMethod RequestMirrorPolicy
  25448. raw := NoMethod(*s)
  25449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25450. }
  25451. // ResourceCommitment: Commitment for a particular resource (a
  25452. // Commitment is composed of one or more of these).
  25453. type ResourceCommitment struct {
  25454. // AcceleratorType: Name of the accelerator type resource. Applicable
  25455. // only when the type is ACCELERATOR.
  25456. AcceleratorType string `json:"acceleratorType,omitempty"`
  25457. // Amount: The amount of the resource purchased (in a type-dependent
  25458. // unit, such as bytes). For vCPUs, this can just be an integer. For
  25459. // memory, this must be provided in MB. Memory must be a multiple of 256
  25460. // MB, with up to 6.5GB of memory per every vCPU.
  25461. Amount int64 `json:"amount,omitempty,string"`
  25462. // Type: Type of resource for which this commitment applies. Possible
  25463. // values are VCPU and MEMORY
  25464. //
  25465. // Possible values:
  25466. // "ACCELERATOR"
  25467. // "LOCAL_SSD"
  25468. // "MEMORY"
  25469. // "UNSPECIFIED"
  25470. // "VCPU"
  25471. Type string `json:"type,omitempty"`
  25472. // ForceSendFields is a list of field names (e.g. "AcceleratorType") to
  25473. // unconditionally include in API requests. By default, fields with
  25474. // empty values are omitted from API requests. However, any non-pointer,
  25475. // non-interface field appearing in ForceSendFields will be sent to the
  25476. // server regardless of whether the field is empty or not. This may be
  25477. // used to include empty fields in Patch requests.
  25478. ForceSendFields []string `json:"-"`
  25479. // NullFields is a list of field names (e.g. "AcceleratorType") to
  25480. // include in API requests with the JSON null value. By default, fields
  25481. // with empty values are omitted from API requests. However, any field
  25482. // with an empty value appearing in NullFields will be sent to the
  25483. // server as null. It is an error if a field in this list has a
  25484. // non-empty value. This may be used to include null fields in Patch
  25485. // requests.
  25486. NullFields []string `json:"-"`
  25487. }
  25488. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  25489. type NoMethod ResourceCommitment
  25490. raw := NoMethod(*s)
  25491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25492. }
  25493. type ResourceGroupReference struct {
  25494. // Group: A URI referencing one of the instance groups or network
  25495. // endpoint groups listed in the backend service.
  25496. Group string `json:"group,omitempty"`
  25497. // ForceSendFields is a list of field names (e.g. "Group") to
  25498. // unconditionally include in API requests. By default, fields with
  25499. // empty values are omitted from API requests. However, any non-pointer,
  25500. // non-interface field appearing in ForceSendFields will be sent to the
  25501. // server regardless of whether the field is empty or not. This may be
  25502. // used to include empty fields in Patch requests.
  25503. ForceSendFields []string `json:"-"`
  25504. // NullFields is a list of field names (e.g. "Group") to include in API
  25505. // requests with the JSON null value. By default, fields with empty
  25506. // values are omitted from API requests. However, any field with an
  25507. // empty value appearing in NullFields will be sent to the server as
  25508. // null. It is an error if a field in this list has a non-empty value.
  25509. // This may be used to include null fields in Patch requests.
  25510. NullFields []string `json:"-"`
  25511. }
  25512. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  25513. type NoMethod ResourceGroupReference
  25514. raw := NoMethod(*s)
  25515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25516. }
  25517. type ResourcePoliciesScopedList struct {
  25518. // ResourcePolicies: A list of resourcePolicies contained in this scope.
  25519. ResourcePolicies []*ResourcePolicy `json:"resourcePolicies,omitempty"`
  25520. // Warning: Informational warning which replaces the list of
  25521. // resourcePolicies when the list is empty.
  25522. Warning *ResourcePoliciesScopedListWarning `json:"warning,omitempty"`
  25523. // ForceSendFields is a list of field names (e.g. "ResourcePolicies") to
  25524. // unconditionally include in API requests. By default, fields with
  25525. // empty values are omitted from API requests. However, any non-pointer,
  25526. // non-interface field appearing in ForceSendFields will be sent to the
  25527. // server regardless of whether the field is empty or not. This may be
  25528. // used to include empty fields in Patch requests.
  25529. ForceSendFields []string `json:"-"`
  25530. // NullFields is a list of field names (e.g. "ResourcePolicies") to
  25531. // include in API requests with the JSON null value. By default, fields
  25532. // with empty values are omitted from API requests. However, any field
  25533. // with an empty value appearing in NullFields will be sent to the
  25534. // server as null. It is an error if a field in this list has a
  25535. // non-empty value. This may be used to include null fields in Patch
  25536. // requests.
  25537. NullFields []string `json:"-"`
  25538. }
  25539. func (s *ResourcePoliciesScopedList) MarshalJSON() ([]byte, error) {
  25540. type NoMethod ResourcePoliciesScopedList
  25541. raw := NoMethod(*s)
  25542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25543. }
  25544. // ResourcePoliciesScopedListWarning: Informational warning which
  25545. // replaces the list of resourcePolicies when the list is empty.
  25546. type ResourcePoliciesScopedListWarning struct {
  25547. // Code: [Output Only] A warning code, if applicable. For example,
  25548. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25549. // the response.
  25550. //
  25551. // Possible values:
  25552. // "CLEANUP_FAILED"
  25553. // "DEPRECATED_RESOURCE_USED"
  25554. // "DEPRECATED_TYPE_USED"
  25555. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25556. // "EXPERIMENTAL_TYPE_USED"
  25557. // "EXTERNAL_API_WARNING"
  25558. // "FIELD_VALUE_OVERRIDEN"
  25559. // "INJECTED_KERNELS_DEPRECATED"
  25560. // "MISSING_TYPE_DEPENDENCY"
  25561. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25562. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25563. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25564. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25565. // "NEXT_HOP_NOT_RUNNING"
  25566. // "NOT_CRITICAL_ERROR"
  25567. // "NO_RESULTS_ON_PAGE"
  25568. // "REQUIRED_TOS_AGREEMENT"
  25569. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25570. // "RESOURCE_NOT_DELETED"
  25571. // "SCHEMA_VALIDATION_IGNORED"
  25572. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25573. // "UNDECLARED_PROPERTIES"
  25574. // "UNREACHABLE"
  25575. Code string `json:"code,omitempty"`
  25576. // Data: [Output Only] Metadata about this warning in key: value format.
  25577. // For example:
  25578. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25579. Data []*ResourcePoliciesScopedListWarningData `json:"data,omitempty"`
  25580. // Message: [Output Only] A human-readable description of the warning
  25581. // code.
  25582. Message string `json:"message,omitempty"`
  25583. // ForceSendFields is a list of field names (e.g. "Code") to
  25584. // unconditionally include in API requests. By default, fields with
  25585. // empty values are omitted from API requests. However, any non-pointer,
  25586. // non-interface field appearing in ForceSendFields will be sent to the
  25587. // server regardless of whether the field is empty or not. This may be
  25588. // used to include empty fields in Patch requests.
  25589. ForceSendFields []string `json:"-"`
  25590. // NullFields is a list of field names (e.g. "Code") to include in API
  25591. // requests with the JSON null value. By default, fields with empty
  25592. // values are omitted from API requests. However, any field with an
  25593. // empty value appearing in NullFields will be sent to the server as
  25594. // null. It is an error if a field in this list has a non-empty value.
  25595. // This may be used to include null fields in Patch requests.
  25596. NullFields []string `json:"-"`
  25597. }
  25598. func (s *ResourcePoliciesScopedListWarning) MarshalJSON() ([]byte, error) {
  25599. type NoMethod ResourcePoliciesScopedListWarning
  25600. raw := NoMethod(*s)
  25601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25602. }
  25603. type ResourcePoliciesScopedListWarningData struct {
  25604. // Key: [Output Only] A key that provides more detail on the warning
  25605. // being returned. For example, for warnings where there are no results
  25606. // in a list request for a particular zone, this key might be scope and
  25607. // the key value might be the zone name. Other examples might be a key
  25608. // indicating a deprecated resource and a suggested replacement, or a
  25609. // warning about invalid network settings (for example, if an instance
  25610. // attempts to perform IP forwarding but is not enabled for IP
  25611. // forwarding).
  25612. Key string `json:"key,omitempty"`
  25613. // Value: [Output Only] A warning data value corresponding to the key.
  25614. Value string `json:"value,omitempty"`
  25615. // ForceSendFields is a list of field names (e.g. "Key") to
  25616. // unconditionally include in API requests. By default, fields with
  25617. // empty values are omitted from API requests. However, any non-pointer,
  25618. // non-interface field appearing in ForceSendFields will be sent to the
  25619. // server regardless of whether the field is empty or not. This may be
  25620. // used to include empty fields in Patch requests.
  25621. ForceSendFields []string `json:"-"`
  25622. // NullFields is a list of field names (e.g. "Key") to include in API
  25623. // requests with the JSON null value. By default, fields with empty
  25624. // values are omitted from API requests. However, any field with an
  25625. // empty value appearing in NullFields will be sent to the server as
  25626. // null. It is an error if a field in this list has a non-empty value.
  25627. // This may be used to include null fields in Patch requests.
  25628. NullFields []string `json:"-"`
  25629. }
  25630. func (s *ResourcePoliciesScopedListWarningData) MarshalJSON() ([]byte, error) {
  25631. type NoMethod ResourcePoliciesScopedListWarningData
  25632. raw := NoMethod(*s)
  25633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25634. }
  25635. type ResourcePolicy struct {
  25636. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25637. // format.
  25638. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25639. Description string `json:"description,omitempty"`
  25640. // GroupPlacementPolicy: Resource policy for instacnes for placement
  25641. // configuration.
  25642. GroupPlacementPolicy *ResourcePolicyGroupPlacementPolicy `json:"groupPlacementPolicy,omitempty"`
  25643. // Id: [Output Only] The unique identifier for the resource. This
  25644. // identifier is defined by the server.
  25645. Id uint64 `json:"id,omitempty,string"`
  25646. // Kind: [Output Only] Type of the resource. Always
  25647. // compute#resource_policies for resource policies.
  25648. Kind string `json:"kind,omitempty"`
  25649. // Name: The name of the resource, provided by the client when initially
  25650. // creating the resource. The resource name must be 1-63 characters
  25651. // long, and comply with RFC1035. Specifically, the name must be 1-63
  25652. // characters long and match the regular expression
  25653. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  25654. // a lowercase letter, and all following characters must be a dash,
  25655. // lowercase letter, or digit, except the last character, which cannot
  25656. // be a dash.
  25657. Name string `json:"name,omitempty"`
  25658. Region string `json:"region,omitempty"`
  25659. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  25660. // resource.
  25661. SelfLink string `json:"selfLink,omitempty"`
  25662. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  25663. // with the resource id.
  25664. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  25665. // SnapshotSchedulePolicy: Resource policy for persistent disks for
  25666. // creating snapshots.
  25667. SnapshotSchedulePolicy *ResourcePolicySnapshotSchedulePolicy `json:"snapshotSchedulePolicy,omitempty"`
  25668. // VmMaintenancePolicy: Resource policy applicable to VMs for
  25669. // infrastructure maintenance.
  25670. VmMaintenancePolicy *ResourcePolicyVmMaintenancePolicy `json:"vmMaintenancePolicy,omitempty"`
  25671. // ServerResponse contains the HTTP response code and headers from the
  25672. // server.
  25673. googleapi.ServerResponse `json:"-"`
  25674. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25675. // to unconditionally include in API requests. By default, fields with
  25676. // empty values are omitted from API requests. However, any non-pointer,
  25677. // non-interface field appearing in ForceSendFields will be sent to the
  25678. // server regardless of whether the field is empty or not. This may be
  25679. // used to include empty fields in Patch requests.
  25680. ForceSendFields []string `json:"-"`
  25681. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25682. // include in API requests with the JSON null value. By default, fields
  25683. // with empty values are omitted from API requests. However, any field
  25684. // with an empty value appearing in NullFields will be sent to the
  25685. // server as null. It is an error if a field in this list has a
  25686. // non-empty value. This may be used to include null fields in Patch
  25687. // requests.
  25688. NullFields []string `json:"-"`
  25689. }
  25690. func (s *ResourcePolicy) MarshalJSON() ([]byte, error) {
  25691. type NoMethod ResourcePolicy
  25692. raw := NoMethod(*s)
  25693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25694. }
  25695. // ResourcePolicyAggregatedList: Contains a list of resourcePolicies.
  25696. type ResourcePolicyAggregatedList struct {
  25697. Etag string `json:"etag,omitempty"`
  25698. // Id: [Output Only] Unique identifier for the resource; defined by the
  25699. // server.
  25700. Id string `json:"id,omitempty"`
  25701. // Items: A list of ResourcePolicy resources.
  25702. Items map[string]ResourcePoliciesScopedList `json:"items,omitempty"`
  25703. // Kind: Type of resource.
  25704. Kind string `json:"kind,omitempty"`
  25705. // NextPageToken: [Output Only] This token allows you to get the next
  25706. // page of results for list requests. If the number of results is larger
  25707. // than maxResults, use the nextPageToken as a value for the query
  25708. // parameter pageToken in the next list request. Subsequent list
  25709. // requests will have their own nextPageToken to continue paging through
  25710. // the results.
  25711. NextPageToken string `json:"nextPageToken,omitempty"`
  25712. // SelfLink: [Output Only] Server-defined URL for this resource.
  25713. SelfLink string `json:"selfLink,omitempty"`
  25714. // Warning: [Output Only] Informational warning message.
  25715. Warning *ResourcePolicyAggregatedListWarning `json:"warning,omitempty"`
  25716. // ServerResponse contains the HTTP response code and headers from the
  25717. // server.
  25718. googleapi.ServerResponse `json:"-"`
  25719. // ForceSendFields is a list of field names (e.g. "Etag") to
  25720. // unconditionally include in API requests. By default, fields with
  25721. // empty values are omitted from API requests. However, any non-pointer,
  25722. // non-interface field appearing in ForceSendFields will be sent to the
  25723. // server regardless of whether the field is empty or not. This may be
  25724. // used to include empty fields in Patch requests.
  25725. ForceSendFields []string `json:"-"`
  25726. // NullFields is a list of field names (e.g. "Etag") to include in API
  25727. // requests with the JSON null value. By default, fields with empty
  25728. // values are omitted from API requests. However, any field with an
  25729. // empty value appearing in NullFields will be sent to the server as
  25730. // null. It is an error if a field in this list has a non-empty value.
  25731. // This may be used to include null fields in Patch requests.
  25732. NullFields []string `json:"-"`
  25733. }
  25734. func (s *ResourcePolicyAggregatedList) MarshalJSON() ([]byte, error) {
  25735. type NoMethod ResourcePolicyAggregatedList
  25736. raw := NoMethod(*s)
  25737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25738. }
  25739. // ResourcePolicyAggregatedListWarning: [Output Only] Informational
  25740. // warning message.
  25741. type ResourcePolicyAggregatedListWarning struct {
  25742. // Code: [Output Only] A warning code, if applicable. For example,
  25743. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25744. // the response.
  25745. //
  25746. // Possible values:
  25747. // "CLEANUP_FAILED"
  25748. // "DEPRECATED_RESOURCE_USED"
  25749. // "DEPRECATED_TYPE_USED"
  25750. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25751. // "EXPERIMENTAL_TYPE_USED"
  25752. // "EXTERNAL_API_WARNING"
  25753. // "FIELD_VALUE_OVERRIDEN"
  25754. // "INJECTED_KERNELS_DEPRECATED"
  25755. // "MISSING_TYPE_DEPENDENCY"
  25756. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25757. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25758. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25759. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25760. // "NEXT_HOP_NOT_RUNNING"
  25761. // "NOT_CRITICAL_ERROR"
  25762. // "NO_RESULTS_ON_PAGE"
  25763. // "REQUIRED_TOS_AGREEMENT"
  25764. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25765. // "RESOURCE_NOT_DELETED"
  25766. // "SCHEMA_VALIDATION_IGNORED"
  25767. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25768. // "UNDECLARED_PROPERTIES"
  25769. // "UNREACHABLE"
  25770. Code string `json:"code,omitempty"`
  25771. // Data: [Output Only] Metadata about this warning in key: value format.
  25772. // For example:
  25773. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25774. Data []*ResourcePolicyAggregatedListWarningData `json:"data,omitempty"`
  25775. // Message: [Output Only] A human-readable description of the warning
  25776. // code.
  25777. Message string `json:"message,omitempty"`
  25778. // ForceSendFields is a list of field names (e.g. "Code") to
  25779. // unconditionally include in API requests. By default, fields with
  25780. // empty values are omitted from API requests. However, any non-pointer,
  25781. // non-interface field appearing in ForceSendFields will be sent to the
  25782. // server regardless of whether the field is empty or not. This may be
  25783. // used to include empty fields in Patch requests.
  25784. ForceSendFields []string `json:"-"`
  25785. // NullFields is a list of field names (e.g. "Code") to include in API
  25786. // requests with the JSON null value. By default, fields with empty
  25787. // values are omitted from API requests. However, any field with an
  25788. // empty value appearing in NullFields will be sent to the server as
  25789. // null. It is an error if a field in this list has a non-empty value.
  25790. // This may be used to include null fields in Patch requests.
  25791. NullFields []string `json:"-"`
  25792. }
  25793. func (s *ResourcePolicyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25794. type NoMethod ResourcePolicyAggregatedListWarning
  25795. raw := NoMethod(*s)
  25796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25797. }
  25798. type ResourcePolicyAggregatedListWarningData struct {
  25799. // Key: [Output Only] A key that provides more detail on the warning
  25800. // being returned. For example, for warnings where there are no results
  25801. // in a list request for a particular zone, this key might be scope and
  25802. // the key value might be the zone name. Other examples might be a key
  25803. // indicating a deprecated resource and a suggested replacement, or a
  25804. // warning about invalid network settings (for example, if an instance
  25805. // attempts to perform IP forwarding but is not enabled for IP
  25806. // forwarding).
  25807. Key string `json:"key,omitempty"`
  25808. // Value: [Output Only] A warning data value corresponding to the key.
  25809. Value string `json:"value,omitempty"`
  25810. // ForceSendFields is a list of field names (e.g. "Key") to
  25811. // unconditionally include in API requests. By default, fields with
  25812. // empty values are omitted from API requests. However, any non-pointer,
  25813. // non-interface field appearing in ForceSendFields will be sent to the
  25814. // server regardless of whether the field is empty or not. This may be
  25815. // used to include empty fields in Patch requests.
  25816. ForceSendFields []string `json:"-"`
  25817. // NullFields is a list of field names (e.g. "Key") to include in API
  25818. // requests with the JSON null value. By default, fields with empty
  25819. // values are omitted from API requests. However, any field with an
  25820. // empty value appearing in NullFields will be sent to the server as
  25821. // null. It is an error if a field in this list has a non-empty value.
  25822. // This may be used to include null fields in Patch requests.
  25823. NullFields []string `json:"-"`
  25824. }
  25825. func (s *ResourcePolicyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25826. type NoMethod ResourcePolicyAggregatedListWarningData
  25827. raw := NoMethod(*s)
  25828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25829. }
  25830. // ResourcePolicyDailyCycle: Time window specified for daily operations.
  25831. type ResourcePolicyDailyCycle struct {
  25832. // DaysInCycle: Allows to define schedule that runs every nth day of the
  25833. // month.
  25834. DaysInCycle int64 `json:"daysInCycle,omitempty"`
  25835. // Duration: [Output only] Duration of the time window, automatically
  25836. // chosen to be smallest possible in the given scenario.
  25837. Duration string `json:"duration,omitempty"`
  25838. // StartTime: Time within the window to start the operations. It must be
  25839. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  25840. StartTime string `json:"startTime,omitempty"`
  25841. // ForceSendFields is a list of field names (e.g. "DaysInCycle") to
  25842. // unconditionally include in API requests. By default, fields with
  25843. // empty values are omitted from API requests. However, any non-pointer,
  25844. // non-interface field appearing in ForceSendFields will be sent to the
  25845. // server regardless of whether the field is empty or not. This may be
  25846. // used to include empty fields in Patch requests.
  25847. ForceSendFields []string `json:"-"`
  25848. // NullFields is a list of field names (e.g. "DaysInCycle") to include
  25849. // in API requests with the JSON null value. By default, fields with
  25850. // empty values are omitted from API requests. However, any field with
  25851. // an empty value appearing in NullFields will be sent to the server as
  25852. // null. It is an error if a field in this list has a non-empty value.
  25853. // This may be used to include null fields in Patch requests.
  25854. NullFields []string `json:"-"`
  25855. }
  25856. func (s *ResourcePolicyDailyCycle) MarshalJSON() ([]byte, error) {
  25857. type NoMethod ResourcePolicyDailyCycle
  25858. raw := NoMethod(*s)
  25859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25860. }
  25861. // ResourcePolicyGroupPlacementPolicy: A GroupPlacementPolicy specifies
  25862. // resource placement configuration. It specifies the failure bucket
  25863. // separation as well as network locality
  25864. type ResourcePolicyGroupPlacementPolicy struct {
  25865. // Locality: Specifies network locality
  25866. //
  25867. // Possible values:
  25868. // "BEST_EFFORT"
  25869. // "STRICT"
  25870. // "UNSPECIFIED_LOCALITY"
  25871. Locality string `json:"locality,omitempty"`
  25872. // Style: Specifies instances to hosts placement relationship
  25873. //
  25874. // Possible values:
  25875. // "COMPACT"
  25876. // "FULLY_SPREAD"
  25877. // "UNSPECIFIED_PLACEMENT_TYPE"
  25878. Style string `json:"style,omitempty"`
  25879. // VmCount: Number of vms in this placement group
  25880. VmCount int64 `json:"vmCount,omitempty"`
  25881. // ForceSendFields is a list of field names (e.g. "Locality") to
  25882. // unconditionally include in API requests. By default, fields with
  25883. // empty values are omitted from API requests. However, any non-pointer,
  25884. // non-interface field appearing in ForceSendFields will be sent to the
  25885. // server regardless of whether the field is empty or not. This may be
  25886. // used to include empty fields in Patch requests.
  25887. ForceSendFields []string `json:"-"`
  25888. // NullFields is a list of field names (e.g. "Locality") to include in
  25889. // API requests with the JSON null value. By default, fields with empty
  25890. // values are omitted from API requests. However, any field with an
  25891. // empty value appearing in NullFields will be sent to the server as
  25892. // null. It is an error if a field in this list has a non-empty value.
  25893. // This may be used to include null fields in Patch requests.
  25894. NullFields []string `json:"-"`
  25895. }
  25896. func (s *ResourcePolicyGroupPlacementPolicy) MarshalJSON() ([]byte, error) {
  25897. type NoMethod ResourcePolicyGroupPlacementPolicy
  25898. raw := NoMethod(*s)
  25899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25900. }
  25901. // ResourcePolicyHourlyCycle: Time window specified for hourly
  25902. // operations.
  25903. type ResourcePolicyHourlyCycle struct {
  25904. // Duration: [Output only] Duration of the time window, automatically
  25905. // chosen to be smallest possible in the given scenario.
  25906. Duration string `json:"duration,omitempty"`
  25907. // HoursInCycle: Allows to define schedule that runs every nth hour.
  25908. HoursInCycle int64 `json:"hoursInCycle,omitempty"`
  25909. // StartTime: Time within the window to start the operations. It must be
  25910. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  25911. StartTime string `json:"startTime,omitempty"`
  25912. // ForceSendFields is a list of field names (e.g. "Duration") to
  25913. // unconditionally include in API requests. By default, fields with
  25914. // empty values are omitted from API requests. However, any non-pointer,
  25915. // non-interface field appearing in ForceSendFields will be sent to the
  25916. // server regardless of whether the field is empty or not. This may be
  25917. // used to include empty fields in Patch requests.
  25918. ForceSendFields []string `json:"-"`
  25919. // NullFields is a list of field names (e.g. "Duration") to include in
  25920. // API requests with the JSON null value. By default, fields with empty
  25921. // values are omitted from API requests. However, any field with an
  25922. // empty value appearing in NullFields will be sent to the server as
  25923. // null. It is an error if a field in this list has a non-empty value.
  25924. // This may be used to include null fields in Patch requests.
  25925. NullFields []string `json:"-"`
  25926. }
  25927. func (s *ResourcePolicyHourlyCycle) MarshalJSON() ([]byte, error) {
  25928. type NoMethod ResourcePolicyHourlyCycle
  25929. raw := NoMethod(*s)
  25930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25931. }
  25932. type ResourcePolicyList struct {
  25933. Etag string `json:"etag,omitempty"`
  25934. // Id: [Output Only] The unique identifier for the resource. This
  25935. // identifier is defined by the server.
  25936. Id string `json:"id,omitempty"`
  25937. // Items: [Output Only] A list of ResourcePolicy resources.
  25938. Items []*ResourcePolicy `json:"items,omitempty"`
  25939. // Kind: [Output Only] Type of resource.Always
  25940. // compute#resourcePoliciesList for listsof resourcePolicies
  25941. Kind string `json:"kind,omitempty"`
  25942. // NextPageToken: [Output Only] This token allows you to get the next
  25943. // page of results for list requests. If the number of results is larger
  25944. // than maxResults, use the nextPageToken as a value for the query
  25945. // parameter pageToken in the next list request. Subsequent list
  25946. // requests will have their own nextPageToken to continue paging through
  25947. // the results.
  25948. NextPageToken string `json:"nextPageToken,omitempty"`
  25949. // SelfLink: [Output Only] Server-defined URL for this resource.
  25950. SelfLink string `json:"selfLink,omitempty"`
  25951. // Warning: [Output Only] Informational warning message.
  25952. Warning *ResourcePolicyListWarning `json:"warning,omitempty"`
  25953. // ServerResponse contains the HTTP response code and headers from the
  25954. // server.
  25955. googleapi.ServerResponse `json:"-"`
  25956. // ForceSendFields is a list of field names (e.g. "Etag") to
  25957. // unconditionally include in API requests. By default, fields with
  25958. // empty values are omitted from API requests. However, any non-pointer,
  25959. // non-interface field appearing in ForceSendFields will be sent to the
  25960. // server regardless of whether the field is empty or not. This may be
  25961. // used to include empty fields in Patch requests.
  25962. ForceSendFields []string `json:"-"`
  25963. // NullFields is a list of field names (e.g. "Etag") to include in API
  25964. // requests with the JSON null value. By default, fields with empty
  25965. // values are omitted from API requests. However, any field with an
  25966. // empty value appearing in NullFields will be sent to the server as
  25967. // null. It is an error if a field in this list has a non-empty value.
  25968. // This may be used to include null fields in Patch requests.
  25969. NullFields []string `json:"-"`
  25970. }
  25971. func (s *ResourcePolicyList) MarshalJSON() ([]byte, error) {
  25972. type NoMethod ResourcePolicyList
  25973. raw := NoMethod(*s)
  25974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25975. }
  25976. // ResourcePolicyListWarning: [Output Only] Informational warning
  25977. // message.
  25978. type ResourcePolicyListWarning struct {
  25979. // Code: [Output Only] A warning code, if applicable. For example,
  25980. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25981. // the response.
  25982. //
  25983. // Possible values:
  25984. // "CLEANUP_FAILED"
  25985. // "DEPRECATED_RESOURCE_USED"
  25986. // "DEPRECATED_TYPE_USED"
  25987. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25988. // "EXPERIMENTAL_TYPE_USED"
  25989. // "EXTERNAL_API_WARNING"
  25990. // "FIELD_VALUE_OVERRIDEN"
  25991. // "INJECTED_KERNELS_DEPRECATED"
  25992. // "MISSING_TYPE_DEPENDENCY"
  25993. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25994. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25995. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25996. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25997. // "NEXT_HOP_NOT_RUNNING"
  25998. // "NOT_CRITICAL_ERROR"
  25999. // "NO_RESULTS_ON_PAGE"
  26000. // "REQUIRED_TOS_AGREEMENT"
  26001. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26002. // "RESOURCE_NOT_DELETED"
  26003. // "SCHEMA_VALIDATION_IGNORED"
  26004. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26005. // "UNDECLARED_PROPERTIES"
  26006. // "UNREACHABLE"
  26007. Code string `json:"code,omitempty"`
  26008. // Data: [Output Only] Metadata about this warning in key: value format.
  26009. // For example:
  26010. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26011. Data []*ResourcePolicyListWarningData `json:"data,omitempty"`
  26012. // Message: [Output Only] A human-readable description of the warning
  26013. // code.
  26014. Message string `json:"message,omitempty"`
  26015. // ForceSendFields is a list of field names (e.g. "Code") to
  26016. // unconditionally include in API requests. By default, fields with
  26017. // empty values are omitted from API requests. However, any non-pointer,
  26018. // non-interface field appearing in ForceSendFields will be sent to the
  26019. // server regardless of whether the field is empty or not. This may be
  26020. // used to include empty fields in Patch requests.
  26021. ForceSendFields []string `json:"-"`
  26022. // NullFields is a list of field names (e.g. "Code") to include in API
  26023. // requests with the JSON null value. By default, fields with empty
  26024. // values are omitted from API requests. However, any field with an
  26025. // empty value appearing in NullFields will be sent to the server as
  26026. // null. It is an error if a field in this list has a non-empty value.
  26027. // This may be used to include null fields in Patch requests.
  26028. NullFields []string `json:"-"`
  26029. }
  26030. func (s *ResourcePolicyListWarning) MarshalJSON() ([]byte, error) {
  26031. type NoMethod ResourcePolicyListWarning
  26032. raw := NoMethod(*s)
  26033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26034. }
  26035. type ResourcePolicyListWarningData struct {
  26036. // Key: [Output Only] A key that provides more detail on the warning
  26037. // being returned. For example, for warnings where there are no results
  26038. // in a list request for a particular zone, this key might be scope and
  26039. // the key value might be the zone name. Other examples might be a key
  26040. // indicating a deprecated resource and a suggested replacement, or a
  26041. // warning about invalid network settings (for example, if an instance
  26042. // attempts to perform IP forwarding but is not enabled for IP
  26043. // forwarding).
  26044. Key string `json:"key,omitempty"`
  26045. // Value: [Output Only] A warning data value corresponding to the key.
  26046. Value string `json:"value,omitempty"`
  26047. // ForceSendFields is a list of field names (e.g. "Key") to
  26048. // unconditionally include in API requests. By default, fields with
  26049. // empty values are omitted from API requests. However, any non-pointer,
  26050. // non-interface field appearing in ForceSendFields will be sent to the
  26051. // server regardless of whether the field is empty or not. This may be
  26052. // used to include empty fields in Patch requests.
  26053. ForceSendFields []string `json:"-"`
  26054. // NullFields is a list of field names (e.g. "Key") to include in API
  26055. // requests with the JSON null value. By default, fields with empty
  26056. // values are omitted from API requests. However, any field with an
  26057. // empty value appearing in NullFields will be sent to the server as
  26058. // null. It is an error if a field in this list has a non-empty value.
  26059. // This may be used to include null fields in Patch requests.
  26060. NullFields []string `json:"-"`
  26061. }
  26062. func (s *ResourcePolicyListWarningData) MarshalJSON() ([]byte, error) {
  26063. type NoMethod ResourcePolicyListWarningData
  26064. raw := NoMethod(*s)
  26065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26066. }
  26067. // ResourcePolicySnapshotSchedulePolicy: A snapshot schedule policy
  26068. // specifies when and how frequently snapshots are to be created for the
  26069. // target disk. Also specifies how many and how long these scheduled
  26070. // snapshots should be retained.
  26071. type ResourcePolicySnapshotSchedulePolicy struct {
  26072. // RetentionPolicy: Retention policy applied to snapshots created by
  26073. // this resource policy.
  26074. RetentionPolicy *ResourcePolicySnapshotSchedulePolicyRetentionPolicy `json:"retentionPolicy,omitempty"`
  26075. // Schedule: A Vm Maintenance Policy specifies what kind of
  26076. // infrastructure maintenance we are allowed to perform on this VM and
  26077. // when. Schedule that is applied to disks covered by this policy.
  26078. Schedule *ResourcePolicySnapshotSchedulePolicySchedule `json:"schedule,omitempty"`
  26079. // SnapshotProperties: Properties with which snapshots are created such
  26080. // as labels, encryption keys.
  26081. SnapshotProperties *ResourcePolicySnapshotSchedulePolicySnapshotProperties `json:"snapshotProperties,omitempty"`
  26082. // ForceSendFields is a list of field names (e.g. "RetentionPolicy") to
  26083. // unconditionally include in API requests. By default, fields with
  26084. // empty values are omitted from API requests. However, any non-pointer,
  26085. // non-interface field appearing in ForceSendFields will be sent to the
  26086. // server regardless of whether the field is empty or not. This may be
  26087. // used to include empty fields in Patch requests.
  26088. ForceSendFields []string `json:"-"`
  26089. // NullFields is a list of field names (e.g. "RetentionPolicy") to
  26090. // include in API requests with the JSON null value. By default, fields
  26091. // with empty values are omitted from API requests. However, any field
  26092. // with an empty value appearing in NullFields will be sent to the
  26093. // server as null. It is an error if a field in this list has a
  26094. // non-empty value. This may be used to include null fields in Patch
  26095. // requests.
  26096. NullFields []string `json:"-"`
  26097. }
  26098. func (s *ResourcePolicySnapshotSchedulePolicy) MarshalJSON() ([]byte, error) {
  26099. type NoMethod ResourcePolicySnapshotSchedulePolicy
  26100. raw := NoMethod(*s)
  26101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26102. }
  26103. // ResourcePolicySnapshotSchedulePolicyRetentionPolicy: Policy for
  26104. // retention of scheduled snapshots.
  26105. type ResourcePolicySnapshotSchedulePolicyRetentionPolicy struct {
  26106. // MaxRetentionDays: Maximum age of the snapshot that is allowed to be
  26107. // kept.
  26108. MaxRetentionDays int64 `json:"maxRetentionDays,omitempty"`
  26109. // OnPolicySwitch: Specifies the behavior to apply to existing,
  26110. // scheduled snapshots snapshots if the policy is changed.
  26111. //
  26112. // Possible values:
  26113. // "DO_NOT_RETROACTIVELY_APPLY"
  26114. // "RETROACTIVELY_APPLY"
  26115. // "UNSPECIFIED_ON_POLICY_SWITCH"
  26116. OnPolicySwitch string `json:"onPolicySwitch,omitempty"`
  26117. // OnSourceDiskDelete: Specifies the behavior to apply to scheduled
  26118. // snapshots when the source disk is deleted.
  26119. //
  26120. // Possible values:
  26121. // "APPLY_RETENTION_POLICY"
  26122. // "KEEP_AUTO_SNAPSHOTS"
  26123. // "UNSPECIFIED_ON_SOURCE_DISK_DELETE"
  26124. OnSourceDiskDelete string `json:"onSourceDiskDelete,omitempty"`
  26125. // ForceSendFields is a list of field names (e.g. "MaxRetentionDays") to
  26126. // unconditionally include in API requests. By default, fields with
  26127. // empty values are omitted from API requests. However, any non-pointer,
  26128. // non-interface field appearing in ForceSendFields will be sent to the
  26129. // server regardless of whether the field is empty or not. This may be
  26130. // used to include empty fields in Patch requests.
  26131. ForceSendFields []string `json:"-"`
  26132. // NullFields is a list of field names (e.g. "MaxRetentionDays") to
  26133. // include in API requests with the JSON null value. By default, fields
  26134. // with empty values are omitted from API requests. However, any field
  26135. // with an empty value appearing in NullFields will be sent to the
  26136. // server as null. It is an error if a field in this list has a
  26137. // non-empty value. This may be used to include null fields in Patch
  26138. // requests.
  26139. NullFields []string `json:"-"`
  26140. }
  26141. func (s *ResourcePolicySnapshotSchedulePolicyRetentionPolicy) MarshalJSON() ([]byte, error) {
  26142. type NoMethod ResourcePolicySnapshotSchedulePolicyRetentionPolicy
  26143. raw := NoMethod(*s)
  26144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26145. }
  26146. // ResourcePolicySnapshotSchedulePolicySchedule: A schedule for disks
  26147. // where the schedueled operations are performed.
  26148. type ResourcePolicySnapshotSchedulePolicySchedule struct {
  26149. DailySchedule *ResourcePolicyDailyCycle `json:"dailySchedule,omitempty"`
  26150. HourlySchedule *ResourcePolicyHourlyCycle `json:"hourlySchedule,omitempty"`
  26151. WeeklySchedule *ResourcePolicyWeeklyCycle `json:"weeklySchedule,omitempty"`
  26152. // ForceSendFields is a list of field names (e.g. "DailySchedule") to
  26153. // unconditionally include in API requests. By default, fields with
  26154. // empty values are omitted from API requests. However, any non-pointer,
  26155. // non-interface field appearing in ForceSendFields will be sent to the
  26156. // server regardless of whether the field is empty or not. This may be
  26157. // used to include empty fields in Patch requests.
  26158. ForceSendFields []string `json:"-"`
  26159. // NullFields is a list of field names (e.g. "DailySchedule") to include
  26160. // in API requests with the JSON null value. By default, fields with
  26161. // empty values are omitted from API requests. However, any field with
  26162. // an empty value appearing in NullFields will be sent to the server as
  26163. // null. It is an error if a field in this list has a non-empty value.
  26164. // This may be used to include null fields in Patch requests.
  26165. NullFields []string `json:"-"`
  26166. }
  26167. func (s *ResourcePolicySnapshotSchedulePolicySchedule) MarshalJSON() ([]byte, error) {
  26168. type NoMethod ResourcePolicySnapshotSchedulePolicySchedule
  26169. raw := NoMethod(*s)
  26170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26171. }
  26172. // ResourcePolicySnapshotSchedulePolicySnapshotProperties: Specified
  26173. // snapshot properties for scheduled snapshots created by this policy.
  26174. type ResourcePolicySnapshotSchedulePolicySnapshotProperties struct {
  26175. // GuestFlush: Indication to perform a ?guest aware? snapshot.
  26176. GuestFlush bool `json:"guestFlush,omitempty"`
  26177. // Labels: Labels to apply to scheduled snapshots. These can be later
  26178. // modified by the setLabels method. Label values may be empty.
  26179. Labels map[string]string `json:"labels,omitempty"`
  26180. // StorageLocations: GCS bucket storage location of the auto snapshot
  26181. // (regional or multi-regional).
  26182. StorageLocations []string `json:"storageLocations,omitempty"`
  26183. // ForceSendFields is a list of field names (e.g. "GuestFlush") to
  26184. // unconditionally include in API requests. By default, fields with
  26185. // empty values are omitted from API requests. However, any non-pointer,
  26186. // non-interface field appearing in ForceSendFields will be sent to the
  26187. // server regardless of whether the field is empty or not. This may be
  26188. // used to include empty fields in Patch requests.
  26189. ForceSendFields []string `json:"-"`
  26190. // NullFields is a list of field names (e.g. "GuestFlush") to include in
  26191. // API requests with the JSON null value. By default, fields with empty
  26192. // values are omitted from API requests. However, any field with an
  26193. // empty value appearing in NullFields will be sent to the server as
  26194. // null. It is an error if a field in this list has a non-empty value.
  26195. // This may be used to include null fields in Patch requests.
  26196. NullFields []string `json:"-"`
  26197. }
  26198. func (s *ResourcePolicySnapshotSchedulePolicySnapshotProperties) MarshalJSON() ([]byte, error) {
  26199. type NoMethod ResourcePolicySnapshotSchedulePolicySnapshotProperties
  26200. raw := NoMethod(*s)
  26201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26202. }
  26203. type ResourcePolicyVmMaintenancePolicy struct {
  26204. // MaintenanceWindow: Maintenance windows that are applied to VMs
  26205. // covered by this policy.
  26206. MaintenanceWindow *ResourcePolicyVmMaintenancePolicyMaintenanceWindow `json:"maintenanceWindow,omitempty"`
  26207. // ForceSendFields is a list of field names (e.g. "MaintenanceWindow")
  26208. // to unconditionally include in API requests. By default, fields with
  26209. // empty values are omitted from API requests. However, any non-pointer,
  26210. // non-interface field appearing in ForceSendFields will be sent to the
  26211. // server regardless of whether the field is empty or not. This may be
  26212. // used to include empty fields in Patch requests.
  26213. ForceSendFields []string `json:"-"`
  26214. // NullFields is a list of field names (e.g. "MaintenanceWindow") to
  26215. // include in API requests with the JSON null value. By default, fields
  26216. // with empty values are omitted from API requests. However, any field
  26217. // with an empty value appearing in NullFields will be sent to the
  26218. // server as null. It is an error if a field in this list has a
  26219. // non-empty value. This may be used to include null fields in Patch
  26220. // requests.
  26221. NullFields []string `json:"-"`
  26222. }
  26223. func (s *ResourcePolicyVmMaintenancePolicy) MarshalJSON() ([]byte, error) {
  26224. type NoMethod ResourcePolicyVmMaintenancePolicy
  26225. raw := NoMethod(*s)
  26226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26227. }
  26228. // ResourcePolicyVmMaintenancePolicyMaintenanceWindow: A maintenance
  26229. // window for VMs. When set, we restrict our maintenance operations to
  26230. // this window.
  26231. type ResourcePolicyVmMaintenancePolicyMaintenanceWindow struct {
  26232. DailyMaintenanceWindow *ResourcePolicyDailyCycle `json:"dailyMaintenanceWindow,omitempty"`
  26233. // ForceSendFields is a list of field names (e.g.
  26234. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  26235. // By default, fields with empty values are omitted from API requests.
  26236. // However, any non-pointer, non-interface field appearing in
  26237. // ForceSendFields will be sent to the server regardless of whether the
  26238. // field is empty or not. This may be used to include empty fields in
  26239. // Patch requests.
  26240. ForceSendFields []string `json:"-"`
  26241. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  26242. // to include in API requests with the JSON null value. By default,
  26243. // fields with empty values are omitted from API requests. However, any
  26244. // field with an empty value appearing in NullFields will be sent to the
  26245. // server as null. It is an error if a field in this list has a
  26246. // non-empty value. This may be used to include null fields in Patch
  26247. // requests.
  26248. NullFields []string `json:"-"`
  26249. }
  26250. func (s *ResourcePolicyVmMaintenancePolicyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  26251. type NoMethod ResourcePolicyVmMaintenancePolicyMaintenanceWindow
  26252. raw := NoMethod(*s)
  26253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26254. }
  26255. // ResourcePolicyWeeklyCycle: Time window specified for weekly
  26256. // operations.
  26257. type ResourcePolicyWeeklyCycle struct {
  26258. // DayOfWeeks: Up to 7 intervals/windows, one for each day of the week.
  26259. DayOfWeeks []*ResourcePolicyWeeklyCycleDayOfWeek `json:"dayOfWeeks,omitempty"`
  26260. // ForceSendFields is a list of field names (e.g. "DayOfWeeks") to
  26261. // unconditionally include in API requests. By default, fields with
  26262. // empty values are omitted from API requests. However, any non-pointer,
  26263. // non-interface field appearing in ForceSendFields will be sent to the
  26264. // server regardless of whether the field is empty or not. This may be
  26265. // used to include empty fields in Patch requests.
  26266. ForceSendFields []string `json:"-"`
  26267. // NullFields is a list of field names (e.g. "DayOfWeeks") to include in
  26268. // API requests with the JSON null value. By default, fields with empty
  26269. // values are omitted from API requests. However, any field with an
  26270. // empty value appearing in NullFields will be sent to the server as
  26271. // null. It is an error if a field in this list has a non-empty value.
  26272. // This may be used to include null fields in Patch requests.
  26273. NullFields []string `json:"-"`
  26274. }
  26275. func (s *ResourcePolicyWeeklyCycle) MarshalJSON() ([]byte, error) {
  26276. type NoMethod ResourcePolicyWeeklyCycle
  26277. raw := NoMethod(*s)
  26278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26279. }
  26280. type ResourcePolicyWeeklyCycleDayOfWeek struct {
  26281. // Day: Allows to define schedule that runs specified day of the week.
  26282. //
  26283. // Possible values:
  26284. // "FRIDAY"
  26285. // "INVALID"
  26286. // "MONDAY"
  26287. // "SATURDAY"
  26288. // "SUNDAY"
  26289. // "THURSDAY"
  26290. // "TUESDAY"
  26291. // "WEDNESDAY"
  26292. Day string `json:"day,omitempty"`
  26293. // Duration: [Output only] Duration of the time window, automatically
  26294. // chosen to be smallest possible in the given scenario.
  26295. Duration string `json:"duration,omitempty"`
  26296. // StartTime: Time within the window to start the operations. It must be
  26297. // in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT.
  26298. StartTime string `json:"startTime,omitempty"`
  26299. // ForceSendFields is a list of field names (e.g. "Day") to
  26300. // unconditionally include in API requests. By default, fields with
  26301. // empty values are omitted from API requests. However, any non-pointer,
  26302. // non-interface field appearing in ForceSendFields will be sent to the
  26303. // server regardless of whether the field is empty or not. This may be
  26304. // used to include empty fields in Patch requests.
  26305. ForceSendFields []string `json:"-"`
  26306. // NullFields is a list of field names (e.g. "Day") to include in API
  26307. // requests with the JSON null value. By default, fields with empty
  26308. // values are omitted from API requests. However, any field with an
  26309. // empty value appearing in NullFields will be sent to the server as
  26310. // null. It is an error if a field in this list has a non-empty value.
  26311. // This may be used to include null fields in Patch requests.
  26312. NullFields []string `json:"-"`
  26313. }
  26314. func (s *ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) {
  26315. type NoMethod ResourcePolicyWeeklyCycleDayOfWeek
  26316. raw := NoMethod(*s)
  26317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26318. }
  26319. // Route: Represents a Route resource. A route specifies how certain
  26320. // packets should be handled by the network. Routes are associated with
  26321. // instances by tags and the set of routes for a particular instance is
  26322. // called its routing table.
  26323. //
  26324. // For each packet leaving an instance, the system searches that
  26325. // instance's routing table for a single best matching route. Routes
  26326. // match packets by destination IP address, preferring smaller or more
  26327. // specific ranges over larger ones. If there is a tie, the system
  26328. // selects the route with the smallest priority value. If there is still
  26329. // a tie, it uses the layer three and four packet headers to select just
  26330. // one of the remaining matching routes. The packet is then forwarded as
  26331. // specified by the nextHop field of the winning route - either to
  26332. // another instance destination, an instance gateway, or a Google
  26333. // Compute Engine-operated gateway.
  26334. //
  26335. // Packets that do not match any route in the sending instance's routing
  26336. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  26337. // v1.routes ==)
  26338. type Route struct {
  26339. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26340. // format.
  26341. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26342. // Description: An optional description of this resource. Provide this
  26343. // property when you create the resource.
  26344. Description string `json:"description,omitempty"`
  26345. // DestRange: The destination range of outgoing packets that this route
  26346. // applies to. Only IPv4 is supported.
  26347. DestRange string `json:"destRange,omitempty"`
  26348. // Id: [Output Only] The unique identifier for the resource. This
  26349. // identifier is defined by the server.
  26350. Id uint64 `json:"id,omitempty,string"`
  26351. // Kind: [Output Only] Type of this resource. Always compute#routes for
  26352. // Route resources.
  26353. Kind string `json:"kind,omitempty"`
  26354. // Name: Name of the resource. Provided by the client when the resource
  26355. // is created. The name must be 1-63 characters long, and comply with
  26356. // RFC1035. Specifically, the name must be 1-63 characters long and
  26357. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26358. // the first character must be a lowercase letter, and all following
  26359. // characters must be a dash, lowercase letter, or digit, except the
  26360. // last character, which cannot be a dash.
  26361. Name string `json:"name,omitempty"`
  26362. // Network: Fully-qualified URL of the network that this route applies
  26363. // to.
  26364. Network string `json:"network,omitempty"`
  26365. // NextHopGateway: The URL to a gateway that should handle matching
  26366. // packets. You can only specify the internet gateway using a full or
  26367. // partial valid URL:
  26368. // projects/<project-id>/global/gateways/default-internet-gateway
  26369. NextHopGateway string `json:"nextHopGateway,omitempty"`
  26370. // NextHopIlb: The URL to a forwarding rule of type
  26371. // loadBalancingScheme=INTERNAL that should handle matching packets. You
  26372. // can only specify the forwarding rule as a partial or full URL. For
  26373. // example, the following are all valid URLs:
  26374. // -
  26375. // https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule
  26376. // - regions/region/forwardingRules/forwardingRule Note that this can
  26377. // only be used when the destination_range is a public (non-RFC 1918) IP
  26378. // CIDR range.
  26379. NextHopIlb string `json:"nextHopIlb,omitempty"`
  26380. // NextHopInstance: The URL to an instance that should handle matching
  26381. // packets. You can specify this as a full or partial URL. For
  26382. // example:
  26383. // https://www.googleapis.com/compute/v1/projects/project/zones/
  26384. // zone/instances/
  26385. NextHopInstance string `json:"nextHopInstance,omitempty"`
  26386. // NextHopIp: The network IP address of an instance that should handle
  26387. // matching packets. Only IPv4 is supported.
  26388. NextHopIp string `json:"nextHopIp,omitempty"`
  26389. // NextHopNetwork: The URL of the local network if it should handle
  26390. // matching packets.
  26391. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  26392. // NextHopPeering: [Output Only] The network peering name that should
  26393. // handle matching packets, which should conform to RFC1035.
  26394. NextHopPeering string `json:"nextHopPeering,omitempty"`
  26395. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  26396. // packets.
  26397. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  26398. // Priority: The priority of this route. Priority is used to break ties
  26399. // in cases where there is more than one matching route of equal prefix
  26400. // length. In the case of two routes with equal prefix length, the one
  26401. // with the lowest-numbered priority value wins. Default value is 1000.
  26402. // Valid range is 0 through 65535.
  26403. Priority int64 `json:"priority,omitempty"`
  26404. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  26405. // resource.
  26406. SelfLink string `json:"selfLink,omitempty"`
  26407. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  26408. // with the resource id.
  26409. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  26410. // Tags: A list of instance tags to which this route applies.
  26411. Tags []string `json:"tags,omitempty"`
  26412. // Warnings: [Output Only] If potential misconfigurations are detected
  26413. // for this route, this field will be populated with warning messages.
  26414. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  26415. // ServerResponse contains the HTTP response code and headers from the
  26416. // server.
  26417. googleapi.ServerResponse `json:"-"`
  26418. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26419. // to unconditionally include in API requests. By default, fields with
  26420. // empty values are omitted from API requests. However, any non-pointer,
  26421. // non-interface field appearing in ForceSendFields will be sent to the
  26422. // server regardless of whether the field is empty or not. This may be
  26423. // used to include empty fields in Patch requests.
  26424. ForceSendFields []string `json:"-"`
  26425. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26426. // include in API requests with the JSON null value. By default, fields
  26427. // with empty values are omitted from API requests. However, any field
  26428. // with an empty value appearing in NullFields will be sent to the
  26429. // server as null. It is an error if a field in this list has a
  26430. // non-empty value. This may be used to include null fields in Patch
  26431. // requests.
  26432. NullFields []string `json:"-"`
  26433. }
  26434. func (s *Route) MarshalJSON() ([]byte, error) {
  26435. type NoMethod Route
  26436. raw := NoMethod(*s)
  26437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26438. }
  26439. type RouteWarnings struct {
  26440. // Code: [Output Only] A warning code, if applicable. For example,
  26441. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26442. // the response.
  26443. //
  26444. // Possible values:
  26445. // "CLEANUP_FAILED"
  26446. // "DEPRECATED_RESOURCE_USED"
  26447. // "DEPRECATED_TYPE_USED"
  26448. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26449. // "EXPERIMENTAL_TYPE_USED"
  26450. // "EXTERNAL_API_WARNING"
  26451. // "FIELD_VALUE_OVERRIDEN"
  26452. // "INJECTED_KERNELS_DEPRECATED"
  26453. // "MISSING_TYPE_DEPENDENCY"
  26454. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26455. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26456. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26457. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26458. // "NEXT_HOP_NOT_RUNNING"
  26459. // "NOT_CRITICAL_ERROR"
  26460. // "NO_RESULTS_ON_PAGE"
  26461. // "REQUIRED_TOS_AGREEMENT"
  26462. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26463. // "RESOURCE_NOT_DELETED"
  26464. // "SCHEMA_VALIDATION_IGNORED"
  26465. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26466. // "UNDECLARED_PROPERTIES"
  26467. // "UNREACHABLE"
  26468. Code string `json:"code,omitempty"`
  26469. // Data: [Output Only] Metadata about this warning in key: value format.
  26470. // For example:
  26471. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26472. Data []*RouteWarningsData `json:"data,omitempty"`
  26473. // Message: [Output Only] A human-readable description of the warning
  26474. // code.
  26475. Message string `json:"message,omitempty"`
  26476. // ForceSendFields is a list of field names (e.g. "Code") to
  26477. // unconditionally include in API requests. By default, fields with
  26478. // empty values are omitted from API requests. However, any non-pointer,
  26479. // non-interface field appearing in ForceSendFields will be sent to the
  26480. // server regardless of whether the field is empty or not. This may be
  26481. // used to include empty fields in Patch requests.
  26482. ForceSendFields []string `json:"-"`
  26483. // NullFields is a list of field names (e.g. "Code") to include in API
  26484. // requests with the JSON null value. By default, fields with empty
  26485. // values are omitted from API requests. However, any field with an
  26486. // empty value appearing in NullFields will be sent to the server as
  26487. // null. It is an error if a field in this list has a non-empty value.
  26488. // This may be used to include null fields in Patch requests.
  26489. NullFields []string `json:"-"`
  26490. }
  26491. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  26492. type NoMethod RouteWarnings
  26493. raw := NoMethod(*s)
  26494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26495. }
  26496. type RouteWarningsData struct {
  26497. // Key: [Output Only] A key that provides more detail on the warning
  26498. // being returned. For example, for warnings where there are no results
  26499. // in a list request for a particular zone, this key might be scope and
  26500. // the key value might be the zone name. Other examples might be a key
  26501. // indicating a deprecated resource and a suggested replacement, or a
  26502. // warning about invalid network settings (for example, if an instance
  26503. // attempts to perform IP forwarding but is not enabled for IP
  26504. // forwarding).
  26505. Key string `json:"key,omitempty"`
  26506. // Value: [Output Only] A warning data value corresponding to the key.
  26507. Value string `json:"value,omitempty"`
  26508. // ForceSendFields is a list of field names (e.g. "Key") to
  26509. // unconditionally include in API requests. By default, fields with
  26510. // empty values are omitted from API requests. However, any non-pointer,
  26511. // non-interface field appearing in ForceSendFields will be sent to the
  26512. // server regardless of whether the field is empty or not. This may be
  26513. // used to include empty fields in Patch requests.
  26514. ForceSendFields []string `json:"-"`
  26515. // NullFields is a list of field names (e.g. "Key") to include in API
  26516. // requests with the JSON null value. By default, fields with empty
  26517. // values are omitted from API requests. However, any field with an
  26518. // empty value appearing in NullFields will be sent to the server as
  26519. // null. It is an error if a field in this list has a non-empty value.
  26520. // This may be used to include null fields in Patch requests.
  26521. NullFields []string `json:"-"`
  26522. }
  26523. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  26524. type NoMethod RouteWarningsData
  26525. raw := NoMethod(*s)
  26526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26527. }
  26528. // RouteList: Contains a list of Route resources.
  26529. type RouteList struct {
  26530. // Id: [Output Only] Unique identifier for the resource; defined by the
  26531. // server.
  26532. Id string `json:"id,omitempty"`
  26533. // Items: A list of Route resources.
  26534. Items []*Route `json:"items,omitempty"`
  26535. // Kind: Type of resource.
  26536. Kind string `json:"kind,omitempty"`
  26537. // NextPageToken: [Output Only] This token allows you to get the next
  26538. // page of results for list requests. If the number of results is larger
  26539. // than maxResults, use the nextPageToken as a value for the query
  26540. // parameter pageToken in the next list request. Subsequent list
  26541. // requests will have their own nextPageToken to continue paging through
  26542. // the results.
  26543. NextPageToken string `json:"nextPageToken,omitempty"`
  26544. // SelfLink: [Output Only] Server-defined URL for this resource.
  26545. SelfLink string `json:"selfLink,omitempty"`
  26546. // Warning: [Output Only] Informational warning message.
  26547. Warning *RouteListWarning `json:"warning,omitempty"`
  26548. // ServerResponse contains the HTTP response code and headers from the
  26549. // server.
  26550. googleapi.ServerResponse `json:"-"`
  26551. // ForceSendFields is a list of field names (e.g. "Id") to
  26552. // unconditionally include in API requests. By default, fields with
  26553. // empty values are omitted from API requests. However, any non-pointer,
  26554. // non-interface field appearing in ForceSendFields will be sent to the
  26555. // server regardless of whether the field is empty or not. This may be
  26556. // used to include empty fields in Patch requests.
  26557. ForceSendFields []string `json:"-"`
  26558. // NullFields is a list of field names (e.g. "Id") to include in API
  26559. // requests with the JSON null value. By default, fields with empty
  26560. // values are omitted from API requests. However, any field with an
  26561. // empty value appearing in NullFields will be sent to the server as
  26562. // null. It is an error if a field in this list has a non-empty value.
  26563. // This may be used to include null fields in Patch requests.
  26564. NullFields []string `json:"-"`
  26565. }
  26566. func (s *RouteList) MarshalJSON() ([]byte, error) {
  26567. type NoMethod RouteList
  26568. raw := NoMethod(*s)
  26569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26570. }
  26571. // RouteListWarning: [Output Only] Informational warning message.
  26572. type RouteListWarning struct {
  26573. // Code: [Output Only] A warning code, if applicable. For example,
  26574. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26575. // the response.
  26576. //
  26577. // Possible values:
  26578. // "CLEANUP_FAILED"
  26579. // "DEPRECATED_RESOURCE_USED"
  26580. // "DEPRECATED_TYPE_USED"
  26581. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26582. // "EXPERIMENTAL_TYPE_USED"
  26583. // "EXTERNAL_API_WARNING"
  26584. // "FIELD_VALUE_OVERRIDEN"
  26585. // "INJECTED_KERNELS_DEPRECATED"
  26586. // "MISSING_TYPE_DEPENDENCY"
  26587. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26588. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26589. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26590. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26591. // "NEXT_HOP_NOT_RUNNING"
  26592. // "NOT_CRITICAL_ERROR"
  26593. // "NO_RESULTS_ON_PAGE"
  26594. // "REQUIRED_TOS_AGREEMENT"
  26595. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26596. // "RESOURCE_NOT_DELETED"
  26597. // "SCHEMA_VALIDATION_IGNORED"
  26598. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26599. // "UNDECLARED_PROPERTIES"
  26600. // "UNREACHABLE"
  26601. Code string `json:"code,omitempty"`
  26602. // Data: [Output Only] Metadata about this warning in key: value format.
  26603. // For example:
  26604. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26605. Data []*RouteListWarningData `json:"data,omitempty"`
  26606. // Message: [Output Only] A human-readable description of the warning
  26607. // code.
  26608. Message string `json:"message,omitempty"`
  26609. // ForceSendFields is a list of field names (e.g. "Code") to
  26610. // unconditionally include in API requests. By default, fields with
  26611. // empty values are omitted from API requests. However, any non-pointer,
  26612. // non-interface field appearing in ForceSendFields will be sent to the
  26613. // server regardless of whether the field is empty or not. This may be
  26614. // used to include empty fields in Patch requests.
  26615. ForceSendFields []string `json:"-"`
  26616. // NullFields is a list of field names (e.g. "Code") to include in API
  26617. // requests with the JSON null value. By default, fields with empty
  26618. // values are omitted from API requests. However, any field with an
  26619. // empty value appearing in NullFields will be sent to the server as
  26620. // null. It is an error if a field in this list has a non-empty value.
  26621. // This may be used to include null fields in Patch requests.
  26622. NullFields []string `json:"-"`
  26623. }
  26624. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  26625. type NoMethod RouteListWarning
  26626. raw := NoMethod(*s)
  26627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26628. }
  26629. type RouteListWarningData struct {
  26630. // Key: [Output Only] A key that provides more detail on the warning
  26631. // being returned. For example, for warnings where there are no results
  26632. // in a list request for a particular zone, this key might be scope and
  26633. // the key value might be the zone name. Other examples might be a key
  26634. // indicating a deprecated resource and a suggested replacement, or a
  26635. // warning about invalid network settings (for example, if an instance
  26636. // attempts to perform IP forwarding but is not enabled for IP
  26637. // forwarding).
  26638. Key string `json:"key,omitempty"`
  26639. // Value: [Output Only] A warning data value corresponding to the key.
  26640. Value string `json:"value,omitempty"`
  26641. // ForceSendFields is a list of field names (e.g. "Key") to
  26642. // unconditionally include in API requests. By default, fields with
  26643. // empty values are omitted from API requests. However, any non-pointer,
  26644. // non-interface field appearing in ForceSendFields will be sent to the
  26645. // server regardless of whether the field is empty or not. This may be
  26646. // used to include empty fields in Patch requests.
  26647. ForceSendFields []string `json:"-"`
  26648. // NullFields is a list of field names (e.g. "Key") to include in API
  26649. // requests with the JSON null value. By default, fields with empty
  26650. // values are omitted from API requests. However, any field with an
  26651. // empty value appearing in NullFields will be sent to the server as
  26652. // null. It is an error if a field in this list has a non-empty value.
  26653. // This may be used to include null fields in Patch requests.
  26654. NullFields []string `json:"-"`
  26655. }
  26656. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  26657. type NoMethod RouteListWarningData
  26658. raw := NoMethod(*s)
  26659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26660. }
  26661. // Router: Router resource.
  26662. type Router struct {
  26663. // Bgp: BGP information specific to this router.
  26664. Bgp *RouterBgp `json:"bgp,omitempty"`
  26665. // BgpPeers: BGP information that needs to be configured into the
  26666. // routing stack to establish the BGP peering. It must specify peer ASN
  26667. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  26668. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  26669. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26670. // format.
  26671. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26672. // Description: An optional description of this resource. Provide this
  26673. // property when you create the resource.
  26674. Description string `json:"description,omitempty"`
  26675. // Id: [Output Only] The unique identifier for the resource. This
  26676. // identifier is defined by the server.
  26677. Id uint64 `json:"id,omitempty,string"`
  26678. // Interfaces: Router interfaces. Each interface requires either one
  26679. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  26680. // range (e.g. ipRange), or both.
  26681. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  26682. // Kind: [Output Only] Type of resource. Always compute#router for
  26683. // routers.
  26684. Kind string `json:"kind,omitempty"`
  26685. // Name: Name of the resource. Provided by the client when the resource
  26686. // is created. The name must be 1-63 characters long, and comply with
  26687. // RFC1035. Specifically, the name must be 1-63 characters long and
  26688. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26689. // the first character must be a lowercase letter, and all following
  26690. // characters must be a dash, lowercase letter, or digit, except the
  26691. // last character, which cannot be a dash.
  26692. Name string `json:"name,omitempty"`
  26693. // Nats: A list of Nat services created in this router.
  26694. Nats []*RouterNat `json:"nats,omitempty"`
  26695. // Network: URI of the network to which this router belongs.
  26696. Network string `json:"network,omitempty"`
  26697. // Region: [Output Only] URI of the region where the router resides. You
  26698. // must specify this field as part of the HTTP request URL. It is not
  26699. // settable as a field in the request body.
  26700. Region string `json:"region,omitempty"`
  26701. // SelfLink: [Output Only] Server-defined URL for the resource.
  26702. SelfLink string `json:"selfLink,omitempty"`
  26703. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  26704. // with the resource id.
  26705. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  26706. // ServerResponse contains the HTTP response code and headers from the
  26707. // server.
  26708. googleapi.ServerResponse `json:"-"`
  26709. // ForceSendFields is a list of field names (e.g. "Bgp") to
  26710. // unconditionally include in API requests. By default, fields with
  26711. // empty values are omitted from API requests. However, any non-pointer,
  26712. // non-interface field appearing in ForceSendFields will be sent to the
  26713. // server regardless of whether the field is empty or not. This may be
  26714. // used to include empty fields in Patch requests.
  26715. ForceSendFields []string `json:"-"`
  26716. // NullFields is a list of field names (e.g. "Bgp") to include in API
  26717. // requests with the JSON null value. By default, fields with empty
  26718. // values are omitted from API requests. However, any field with an
  26719. // empty value appearing in NullFields will be sent to the server as
  26720. // null. It is an error if a field in this list has a non-empty value.
  26721. // This may be used to include null fields in Patch requests.
  26722. NullFields []string `json:"-"`
  26723. }
  26724. func (s *Router) MarshalJSON() ([]byte, error) {
  26725. type NoMethod Router
  26726. raw := NoMethod(*s)
  26727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26728. }
  26729. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  26730. // to advertise.
  26731. type RouterAdvertisedIpRange struct {
  26732. // Description: User-specified description for the IP range.
  26733. Description string `json:"description,omitempty"`
  26734. // Range: The IP range to advertise. The value must be a CIDR-formatted
  26735. // string.
  26736. Range string `json:"range,omitempty"`
  26737. // ForceSendFields is a list of field names (e.g. "Description") to
  26738. // unconditionally include in API requests. By default, fields with
  26739. // empty values are omitted from API requests. However, any non-pointer,
  26740. // non-interface field appearing in ForceSendFields will be sent to the
  26741. // server regardless of whether the field is empty or not. This may be
  26742. // used to include empty fields in Patch requests.
  26743. ForceSendFields []string `json:"-"`
  26744. // NullFields is a list of field names (e.g. "Description") to include
  26745. // in API requests with the JSON null value. By default, fields with
  26746. // empty values are omitted from API requests. However, any field with
  26747. // an empty value appearing in NullFields will be sent to the server as
  26748. // null. It is an error if a field in this list has a non-empty value.
  26749. // This may be used to include null fields in Patch requests.
  26750. NullFields []string `json:"-"`
  26751. }
  26752. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  26753. type NoMethod RouterAdvertisedIpRange
  26754. raw := NoMethod(*s)
  26755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26756. }
  26757. // RouterAggregatedList: Contains a list of routers.
  26758. type RouterAggregatedList struct {
  26759. // Id: [Output Only] Unique identifier for the resource; defined by the
  26760. // server.
  26761. Id string `json:"id,omitempty"`
  26762. // Items: A list of Router resources.
  26763. Items map[string]RoutersScopedList `json:"items,omitempty"`
  26764. // Kind: Type of resource.
  26765. Kind string `json:"kind,omitempty"`
  26766. // NextPageToken: [Output Only] This token allows you to get the next
  26767. // page of results for list requests. If the number of results is larger
  26768. // than maxResults, use the nextPageToken as a value for the query
  26769. // parameter pageToken in the next list request. Subsequent list
  26770. // requests will have their own nextPageToken to continue paging through
  26771. // the results.
  26772. NextPageToken string `json:"nextPageToken,omitempty"`
  26773. // SelfLink: [Output Only] Server-defined URL for this resource.
  26774. SelfLink string `json:"selfLink,omitempty"`
  26775. // Warning: [Output Only] Informational warning message.
  26776. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  26777. // ServerResponse contains the HTTP response code and headers from the
  26778. // server.
  26779. googleapi.ServerResponse `json:"-"`
  26780. // ForceSendFields is a list of field names (e.g. "Id") to
  26781. // unconditionally include in API requests. By default, fields with
  26782. // empty values are omitted from API requests. However, any non-pointer,
  26783. // non-interface field appearing in ForceSendFields will be sent to the
  26784. // server regardless of whether the field is empty or not. This may be
  26785. // used to include empty fields in Patch requests.
  26786. ForceSendFields []string `json:"-"`
  26787. // NullFields is a list of field names (e.g. "Id") to include in API
  26788. // requests with the JSON null value. By default, fields with empty
  26789. // values are omitted from API requests. However, any field with an
  26790. // empty value appearing in NullFields will be sent to the server as
  26791. // null. It is an error if a field in this list has a non-empty value.
  26792. // This may be used to include null fields in Patch requests.
  26793. NullFields []string `json:"-"`
  26794. }
  26795. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  26796. type NoMethod RouterAggregatedList
  26797. raw := NoMethod(*s)
  26798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26799. }
  26800. // RouterAggregatedListWarning: [Output Only] Informational warning
  26801. // message.
  26802. type RouterAggregatedListWarning struct {
  26803. // Code: [Output Only] A warning code, if applicable. For example,
  26804. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26805. // the response.
  26806. //
  26807. // Possible values:
  26808. // "CLEANUP_FAILED"
  26809. // "DEPRECATED_RESOURCE_USED"
  26810. // "DEPRECATED_TYPE_USED"
  26811. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26812. // "EXPERIMENTAL_TYPE_USED"
  26813. // "EXTERNAL_API_WARNING"
  26814. // "FIELD_VALUE_OVERRIDEN"
  26815. // "INJECTED_KERNELS_DEPRECATED"
  26816. // "MISSING_TYPE_DEPENDENCY"
  26817. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26818. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26819. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26820. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26821. // "NEXT_HOP_NOT_RUNNING"
  26822. // "NOT_CRITICAL_ERROR"
  26823. // "NO_RESULTS_ON_PAGE"
  26824. // "REQUIRED_TOS_AGREEMENT"
  26825. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26826. // "RESOURCE_NOT_DELETED"
  26827. // "SCHEMA_VALIDATION_IGNORED"
  26828. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26829. // "UNDECLARED_PROPERTIES"
  26830. // "UNREACHABLE"
  26831. Code string `json:"code,omitempty"`
  26832. // Data: [Output Only] Metadata about this warning in key: value format.
  26833. // For example:
  26834. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26835. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  26836. // Message: [Output Only] A human-readable description of the warning
  26837. // code.
  26838. Message string `json:"message,omitempty"`
  26839. // ForceSendFields is a list of field names (e.g. "Code") to
  26840. // unconditionally include in API requests. By default, fields with
  26841. // empty values are omitted from API requests. However, any non-pointer,
  26842. // non-interface field appearing in ForceSendFields will be sent to the
  26843. // server regardless of whether the field is empty or not. This may be
  26844. // used to include empty fields in Patch requests.
  26845. ForceSendFields []string `json:"-"`
  26846. // NullFields is a list of field names (e.g. "Code") to include in API
  26847. // requests with the JSON null value. By default, fields with empty
  26848. // values are omitted from API requests. However, any field with an
  26849. // empty value appearing in NullFields will be sent to the server as
  26850. // null. It is an error if a field in this list has a non-empty value.
  26851. // This may be used to include null fields in Patch requests.
  26852. NullFields []string `json:"-"`
  26853. }
  26854. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  26855. type NoMethod RouterAggregatedListWarning
  26856. raw := NoMethod(*s)
  26857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26858. }
  26859. type RouterAggregatedListWarningData struct {
  26860. // Key: [Output Only] A key that provides more detail on the warning
  26861. // being returned. For example, for warnings where there are no results
  26862. // in a list request for a particular zone, this key might be scope and
  26863. // the key value might be the zone name. Other examples might be a key
  26864. // indicating a deprecated resource and a suggested replacement, or a
  26865. // warning about invalid network settings (for example, if an instance
  26866. // attempts to perform IP forwarding but is not enabled for IP
  26867. // forwarding).
  26868. Key string `json:"key,omitempty"`
  26869. // Value: [Output Only] A warning data value corresponding to the key.
  26870. Value string `json:"value,omitempty"`
  26871. // ForceSendFields is a list of field names (e.g. "Key") to
  26872. // unconditionally include in API requests. By default, fields with
  26873. // empty values are omitted from API requests. However, any non-pointer,
  26874. // non-interface field appearing in ForceSendFields will be sent to the
  26875. // server regardless of whether the field is empty or not. This may be
  26876. // used to include empty fields in Patch requests.
  26877. ForceSendFields []string `json:"-"`
  26878. // NullFields is a list of field names (e.g. "Key") to include in API
  26879. // requests with the JSON null value. By default, fields with empty
  26880. // values are omitted from API requests. However, any field with an
  26881. // empty value appearing in NullFields will be sent to the server as
  26882. // null. It is an error if a field in this list has a non-empty value.
  26883. // This may be used to include null fields in Patch requests.
  26884. NullFields []string `json:"-"`
  26885. }
  26886. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  26887. type NoMethod RouterAggregatedListWarningData
  26888. raw := NoMethod(*s)
  26889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26890. }
  26891. type RouterBgp struct {
  26892. // AdvertiseMode: User-specified flag to indicate which mode to use for
  26893. // advertisement.
  26894. //
  26895. // Possible values:
  26896. // "CUSTOM"
  26897. // "DEFAULT"
  26898. AdvertiseMode string `json:"advertiseMode,omitempty"`
  26899. // AdvertisedGroups: User-specified list of prefix groups to advertise
  26900. // in custom mode. This field can only be populated if advertise_mode is
  26901. // CUSTOM and is advertised to all peers of the router. These groups
  26902. // will be advertised in addition to any specified prefixes. Leave this
  26903. // field blank to advertise no custom groups.
  26904. //
  26905. // Possible values:
  26906. // "ALL_PEER_VPC_SUBNETS"
  26907. // "ALL_SUBNETS"
  26908. // "ALL_VPC_SUBNETS"
  26909. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  26910. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  26911. // advertise in custom mode. This field can only be populated if
  26912. // advertise_mode is CUSTOM and is advertised to all peers of the
  26913. // router. These IP ranges will be advertised in addition to any
  26914. // specified groups. Leave this field blank to advertise no custom IP
  26915. // ranges.
  26916. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  26917. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  26918. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  26919. // this router resource. All VPN tunnels that link to this router will
  26920. // have the same local ASN.
  26921. Asn int64 `json:"asn,omitempty"`
  26922. // KeepaliveInterval: The interval in seconds between BGP keepalive
  26923. // messages that are sent to the peer. Hold time is three times the
  26924. // interval at which keepalive messages are sent, and the hold time is
  26925. // the maximum number of seconds allowed to elapse between successive
  26926. // keepalive messages that BGP receives from a peer. BGP will use the
  26927. // smaller of either the local hold time value or the peer?s hold time
  26928. // value as the hold time for the BGP connection between the two peers.
  26929. // If set, this value must be between 1 and 120. The default is 20.
  26930. KeepaliveInterval int64 `json:"keepaliveInterval,omitempty"`
  26931. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  26932. // unconditionally include in API requests. By default, fields with
  26933. // empty values are omitted from API requests. However, any non-pointer,
  26934. // non-interface field appearing in ForceSendFields will be sent to the
  26935. // server regardless of whether the field is empty or not. This may be
  26936. // used to include empty fields in Patch requests.
  26937. ForceSendFields []string `json:"-"`
  26938. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  26939. // in API requests with the JSON null value. By default, fields with
  26940. // empty values are omitted from API requests. However, any field with
  26941. // an empty value appearing in NullFields will be sent to the server as
  26942. // null. It is an error if a field in this list has a non-empty value.
  26943. // This may be used to include null fields in Patch requests.
  26944. NullFields []string `json:"-"`
  26945. }
  26946. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  26947. type NoMethod RouterBgp
  26948. raw := NoMethod(*s)
  26949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26950. }
  26951. type RouterBgpPeer struct {
  26952. // AdvertiseMode: User-specified flag to indicate which mode to use for
  26953. // advertisement.
  26954. //
  26955. // Possible values:
  26956. // "CUSTOM"
  26957. // "DEFAULT"
  26958. AdvertiseMode string `json:"advertiseMode,omitempty"`
  26959. // AdvertisedGroups: User-specified list of prefix groups to advertise
  26960. // in custom mode. This field can only be populated if advertise_mode is
  26961. // CUSTOM and overrides the list defined for the router (in Bgp
  26962. // message). These groups will be advertised in addition to any
  26963. // specified prefixes. Leave this field blank to advertise no custom
  26964. // groups.
  26965. //
  26966. // Possible values:
  26967. // "ALL_PEER_VPC_SUBNETS"
  26968. // "ALL_SUBNETS"
  26969. // "ALL_VPC_SUBNETS"
  26970. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  26971. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  26972. // advertise in custom mode. This field can only be populated if
  26973. // advertise_mode is CUSTOM and overrides the list defined for the
  26974. // router (in Bgp message). These IP ranges will be advertised in
  26975. // addition to any specified groups. Leave this field blank to advertise
  26976. // no custom IP ranges.
  26977. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  26978. // AdvertisedRoutePriority: The priority of routes advertised to this
  26979. // BGP peer. In the case where there is more than one matching route of
  26980. // maximum length, the routes with lowest priority value win.
  26981. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  26982. // Bfd: BFD configuration for the BGP peering.
  26983. Bfd *RouterBgpPeerBfd `json:"bfd,omitempty"`
  26984. // Enable: The status of the BGP peer connection. If set to FALSE, any
  26985. // active session with the peer is terminated and all associated routing
  26986. // information is removed. If set to TRUE, the peer connection can be
  26987. // established with routing information. The default is TRUE.
  26988. //
  26989. // Possible values:
  26990. // "FALSE"
  26991. // "TRUE"
  26992. Enable string `json:"enable,omitempty"`
  26993. // InterfaceName: Name of the interface the BGP peer is associated with.
  26994. InterfaceName string `json:"interfaceName,omitempty"`
  26995. // IpAddress: IP address of the interface inside Google Cloud Platform.
  26996. // Only IPv4 is supported.
  26997. IpAddress string `json:"ipAddress,omitempty"`
  26998. // ManagementType: [Output Only] The resource that configures and
  26999. // manages this BGP peer. MANAGED_BY_USER is the default value and can
  27000. // be managed by you or other users; MANAGED_BY_ATTACHMENT is a BGP peer
  27001. // that is configured and managed by Cloud Interconnect, specifically by
  27002. // an InterconnectAttachment of type PARTNER. Google will automatically
  27003. // create, update, and delete this type of BGP peer when the PARTNER
  27004. // InterconnectAttachment is created, updated, or deleted.
  27005. //
  27006. // Possible values:
  27007. // "MANAGED_BY_ATTACHMENT"
  27008. // "MANAGED_BY_USER"
  27009. ManagementType string `json:"managementType,omitempty"`
  27010. // Name: Name of this BGP peer. The name must be 1-63 characters long
  27011. // and comply with RFC1035.
  27012. Name string `json:"name,omitempty"`
  27013. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  27014. // this value can be different for every tunnel.
  27015. PeerAsn int64 `json:"peerAsn,omitempty"`
  27016. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  27017. // Only IPv4 is supported.
  27018. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  27019. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  27020. // unconditionally include in API requests. By default, fields with
  27021. // empty values are omitted from API requests. However, any non-pointer,
  27022. // non-interface field appearing in ForceSendFields will be sent to the
  27023. // server regardless of whether the field is empty or not. This may be
  27024. // used to include empty fields in Patch requests.
  27025. ForceSendFields []string `json:"-"`
  27026. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  27027. // in API requests with the JSON null value. By default, fields with
  27028. // empty values are omitted from API requests. However, any field with
  27029. // an empty value appearing in NullFields will be sent to the server as
  27030. // null. It is an error if a field in this list has a non-empty value.
  27031. // This may be used to include null fields in Patch requests.
  27032. NullFields []string `json:"-"`
  27033. }
  27034. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  27035. type NoMethod RouterBgpPeer
  27036. raw := NoMethod(*s)
  27037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27038. }
  27039. type RouterBgpPeerBfd struct {
  27040. // MinReceiveInterval: The minimum interval, in milliseconds, between
  27041. // BFD packets received from the peer router. The actual value is
  27042. // negotiated between the two routers and is equal to the greater of
  27043. // this value and the transmit interval of the other router. If BFD echo
  27044. // mode is enabled on this router and the peer router, this value is
  27045. // used to negotiate the interval between BFD echo packets transmitted
  27046. // by the peer router. Otherwise, it will be used to determine the
  27047. // interval between BFD control packets. If set, this value must be
  27048. // between 33 and 30000. The default is 300.
  27049. MinReceiveInterval int64 `json:"minReceiveInterval,omitempty"`
  27050. // MinTransmitInterval: The minimum interval, in milliseconds, between
  27051. // BFD packets transmitted to the peer router. The actual value is
  27052. // negotiated between the two routers and is equal to the greater of
  27053. // this value and the corresponding receive interval of the other
  27054. // router. If BFD echo mode is enabled on this router and the peer
  27055. // router, this value is used to negotiate the interval between BFD echo
  27056. // packets transmitted by this router. Otherwise, it will be used to
  27057. // determine the interval between BFD control packets. If set, this
  27058. // value must be between 33 and 30000. The default is 300.
  27059. MinTransmitInterval int64 `json:"minTransmitInterval,omitempty"`
  27060. // Mode: The BFD session initiation mode for this BGP peer. If set to
  27061. // ACTIVE, the Cloud Router will initiate the BFD session for this BGP
  27062. // peer. If set to PASSIVE, the Cloud Router will wait for the peer
  27063. // router to initiate the BFD session for this BGP peer. If set to
  27064. // DISABLED, BFD is disabled for this BGP peer. The default is PASSIVE.
  27065. //
  27066. // Possible values:
  27067. // "ACTIVE"
  27068. // "DISABLED"
  27069. // "PASSIVE"
  27070. Mode string `json:"mode,omitempty"`
  27071. // Multiplier: The number of consecutive BFD packets that must be missed
  27072. // before BFD declares that a peer is unavailable. If set, the value
  27073. // must be a value between 2 and 16. The default is 3.
  27074. Multiplier int64 `json:"multiplier,omitempty"`
  27075. // PacketMode: The BFD packet mode for this BGP peer. If set to
  27076. // CONTROL_AND_ECHO, BFD echo mode is enabled for this BGP peer. In this
  27077. // mode, if the peer router also has BFD echo mode enabled, BFD echo
  27078. // packets will be sent to the other router. If the peer router does not
  27079. // have BFD echo mode enabled, only control packets will be sent. If set
  27080. // to CONTROL_ONLY, BFD echo mode is disabled for this BGP peer. If this
  27081. // router and the peer router have a multihop connection, this should be
  27082. // set to CONTROL_ONLY as BFD echo mode is only supported on singlehop
  27083. // connections. The default is CONTROL_AND_ECHO.
  27084. //
  27085. // Possible values:
  27086. // "CONTROL_AND_ECHO"
  27087. // "CONTROL_ONLY"
  27088. PacketMode string `json:"packetMode,omitempty"`
  27089. // SlowTimerInterval: The minimum interval, in milliseconds, between BFD
  27090. // control packets transmitted to and received from the peer router when
  27091. // BFD echo mode is enabled on both routers. The actual transmit and
  27092. // receive intervals are negotiated between the two routers and are
  27093. // equal to the greater of this value and the corresponding interval on
  27094. // the other router. If set, this value must be between 1000 and 30000.
  27095. // The default is 5000.
  27096. SlowTimerInterval int64 `json:"slowTimerInterval,omitempty"`
  27097. // ForceSendFields is a list of field names (e.g. "MinReceiveInterval")
  27098. // to unconditionally include in API requests. By default, fields with
  27099. // empty values are omitted from API requests. However, any non-pointer,
  27100. // non-interface field appearing in ForceSendFields will be sent to the
  27101. // server regardless of whether the field is empty or not. This may be
  27102. // used to include empty fields in Patch requests.
  27103. ForceSendFields []string `json:"-"`
  27104. // NullFields is a list of field names (e.g. "MinReceiveInterval") to
  27105. // include in API requests with the JSON null value. By default, fields
  27106. // with empty values are omitted from API requests. However, any field
  27107. // with an empty value appearing in NullFields will be sent to the
  27108. // server as null. It is an error if a field in this list has a
  27109. // non-empty value. This may be used to include null fields in Patch
  27110. // requests.
  27111. NullFields []string `json:"-"`
  27112. }
  27113. func (s *RouterBgpPeerBfd) MarshalJSON() ([]byte, error) {
  27114. type NoMethod RouterBgpPeerBfd
  27115. raw := NoMethod(*s)
  27116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27117. }
  27118. type RouterInterface struct {
  27119. // IpRange: IP address and range of the interface. The IP range must be
  27120. // in the RFC3927 link-local IP space. The value must be a
  27121. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  27122. // truncate the address as it represents the IP address of the
  27123. // interface.
  27124. IpRange string `json:"ipRange,omitempty"`
  27125. // LinkedInterconnectAttachment: URI of the linked interconnect
  27126. // attachment. It must be in the same region as the router. Each
  27127. // interface can have at most one linked resource and it could either be
  27128. // a VPN Tunnel or an interconnect attachment.
  27129. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  27130. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  27131. // region as the router. Each interface can have at most one linked
  27132. // resource and it could either be a VPN Tunnel or an interconnect
  27133. // attachment.
  27134. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  27135. // ManagementType: [Output Only] The resource that configures and
  27136. // manages this interface. MANAGED_BY_USER is the default value and can
  27137. // be managed by you or other users; MANAGED_BY_ATTACHMENT is an
  27138. // interface that is configured and managed by Cloud Interconnect,
  27139. // specifically by an InterconnectAttachment of type PARTNER. Google
  27140. // will automatically create, update, and delete this type of interface
  27141. // when the PARTNER InterconnectAttachment is created, updated, or
  27142. // deleted.
  27143. //
  27144. // Possible values:
  27145. // "MANAGED_BY_ATTACHMENT"
  27146. // "MANAGED_BY_USER"
  27147. ManagementType string `json:"managementType,omitempty"`
  27148. // Name: Name of this interface entry. The name must be 1-63 characters
  27149. // long and comply with RFC1035.
  27150. Name string `json:"name,omitempty"`
  27151. // ForceSendFields is a list of field names (e.g. "IpRange") to
  27152. // unconditionally include in API requests. By default, fields with
  27153. // empty values are omitted from API requests. However, any non-pointer,
  27154. // non-interface field appearing in ForceSendFields will be sent to the
  27155. // server regardless of whether the field is empty or not. This may be
  27156. // used to include empty fields in Patch requests.
  27157. ForceSendFields []string `json:"-"`
  27158. // NullFields is a list of field names (e.g. "IpRange") to include in
  27159. // API requests with the JSON null value. By default, fields with empty
  27160. // values are omitted from API requests. However, any field with an
  27161. // empty value appearing in NullFields will be sent to the server as
  27162. // null. It is an error if a field in this list has a non-empty value.
  27163. // This may be used to include null fields in Patch requests.
  27164. NullFields []string `json:"-"`
  27165. }
  27166. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  27167. type NoMethod RouterInterface
  27168. raw := NoMethod(*s)
  27169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27170. }
  27171. // RouterList: Contains a list of Router resources.
  27172. type RouterList struct {
  27173. // Id: [Output Only] Unique identifier for the resource; defined by the
  27174. // server.
  27175. Id string `json:"id,omitempty"`
  27176. // Items: A list of Router resources.
  27177. Items []*Router `json:"items,omitempty"`
  27178. // Kind: [Output Only] Type of resource. Always compute#router for
  27179. // routers.
  27180. Kind string `json:"kind,omitempty"`
  27181. // NextPageToken: [Output Only] This token allows you to get the next
  27182. // page of results for list requests. If the number of results is larger
  27183. // than maxResults, use the nextPageToken as a value for the query
  27184. // parameter pageToken in the next list request. Subsequent list
  27185. // requests will have their own nextPageToken to continue paging through
  27186. // the results.
  27187. NextPageToken string `json:"nextPageToken,omitempty"`
  27188. // SelfLink: [Output Only] Server-defined URL for this resource.
  27189. SelfLink string `json:"selfLink,omitempty"`
  27190. // Warning: [Output Only] Informational warning message.
  27191. Warning *RouterListWarning `json:"warning,omitempty"`
  27192. // ServerResponse contains the HTTP response code and headers from the
  27193. // server.
  27194. googleapi.ServerResponse `json:"-"`
  27195. // ForceSendFields is a list of field names (e.g. "Id") to
  27196. // unconditionally include in API requests. By default, fields with
  27197. // empty values are omitted from API requests. However, any non-pointer,
  27198. // non-interface field appearing in ForceSendFields will be sent to the
  27199. // server regardless of whether the field is empty or not. This may be
  27200. // used to include empty fields in Patch requests.
  27201. ForceSendFields []string `json:"-"`
  27202. // NullFields is a list of field names (e.g. "Id") to include in API
  27203. // requests with the JSON null value. By default, fields with empty
  27204. // values are omitted from API requests. However, any field with an
  27205. // empty value appearing in NullFields will be sent to the server as
  27206. // null. It is an error if a field in this list has a non-empty value.
  27207. // This may be used to include null fields in Patch requests.
  27208. NullFields []string `json:"-"`
  27209. }
  27210. func (s *RouterList) MarshalJSON() ([]byte, error) {
  27211. type NoMethod RouterList
  27212. raw := NoMethod(*s)
  27213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27214. }
  27215. // RouterListWarning: [Output Only] Informational warning message.
  27216. type RouterListWarning struct {
  27217. // Code: [Output Only] A warning code, if applicable. For example,
  27218. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27219. // the response.
  27220. //
  27221. // Possible values:
  27222. // "CLEANUP_FAILED"
  27223. // "DEPRECATED_RESOURCE_USED"
  27224. // "DEPRECATED_TYPE_USED"
  27225. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27226. // "EXPERIMENTAL_TYPE_USED"
  27227. // "EXTERNAL_API_WARNING"
  27228. // "FIELD_VALUE_OVERRIDEN"
  27229. // "INJECTED_KERNELS_DEPRECATED"
  27230. // "MISSING_TYPE_DEPENDENCY"
  27231. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27232. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27233. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27234. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27235. // "NEXT_HOP_NOT_RUNNING"
  27236. // "NOT_CRITICAL_ERROR"
  27237. // "NO_RESULTS_ON_PAGE"
  27238. // "REQUIRED_TOS_AGREEMENT"
  27239. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27240. // "RESOURCE_NOT_DELETED"
  27241. // "SCHEMA_VALIDATION_IGNORED"
  27242. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27243. // "UNDECLARED_PROPERTIES"
  27244. // "UNREACHABLE"
  27245. Code string `json:"code,omitempty"`
  27246. // Data: [Output Only] Metadata about this warning in key: value format.
  27247. // For example:
  27248. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27249. Data []*RouterListWarningData `json:"data,omitempty"`
  27250. // Message: [Output Only] A human-readable description of the warning
  27251. // code.
  27252. Message string `json:"message,omitempty"`
  27253. // ForceSendFields is a list of field names (e.g. "Code") to
  27254. // unconditionally include in API requests. By default, fields with
  27255. // empty values are omitted from API requests. However, any non-pointer,
  27256. // non-interface field appearing in ForceSendFields will be sent to the
  27257. // server regardless of whether the field is empty or not. This may be
  27258. // used to include empty fields in Patch requests.
  27259. ForceSendFields []string `json:"-"`
  27260. // NullFields is a list of field names (e.g. "Code") to include in API
  27261. // requests with the JSON null value. By default, fields with empty
  27262. // values are omitted from API requests. However, any field with an
  27263. // empty value appearing in NullFields will be sent to the server as
  27264. // null. It is an error if a field in this list has a non-empty value.
  27265. // This may be used to include null fields in Patch requests.
  27266. NullFields []string `json:"-"`
  27267. }
  27268. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  27269. type NoMethod RouterListWarning
  27270. raw := NoMethod(*s)
  27271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27272. }
  27273. type RouterListWarningData struct {
  27274. // Key: [Output Only] A key that provides more detail on the warning
  27275. // being returned. For example, for warnings where there are no results
  27276. // in a list request for a particular zone, this key might be scope and
  27277. // the key value might be the zone name. Other examples might be a key
  27278. // indicating a deprecated resource and a suggested replacement, or a
  27279. // warning about invalid network settings (for example, if an instance
  27280. // attempts to perform IP forwarding but is not enabled for IP
  27281. // forwarding).
  27282. Key string `json:"key,omitempty"`
  27283. // Value: [Output Only] A warning data value corresponding to the key.
  27284. Value string `json:"value,omitempty"`
  27285. // ForceSendFields is a list of field names (e.g. "Key") to
  27286. // unconditionally include in API requests. By default, fields with
  27287. // empty values are omitted from API requests. However, any non-pointer,
  27288. // non-interface field appearing in ForceSendFields will be sent to the
  27289. // server regardless of whether the field is empty or not. This may be
  27290. // used to include empty fields in Patch requests.
  27291. ForceSendFields []string `json:"-"`
  27292. // NullFields is a list of field names (e.g. "Key") to include in API
  27293. // requests with the JSON null value. By default, fields with empty
  27294. // values are omitted from API requests. However, any field with an
  27295. // empty value appearing in NullFields will be sent to the server as
  27296. // null. It is an error if a field in this list has a non-empty value.
  27297. // This may be used to include null fields in Patch requests.
  27298. NullFields []string `json:"-"`
  27299. }
  27300. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  27301. type NoMethod RouterListWarningData
  27302. raw := NoMethod(*s)
  27303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27304. }
  27305. // RouterNat: Represents a Nat resource. It enables the VMs within the
  27306. // specified subnetworks to access Internet without external IP
  27307. // addresses. It specifies a list of subnetworks (and the ranges within)
  27308. // that want to use NAT. Customers can also provide the external IPs
  27309. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  27310. // no external IPs are provided.
  27311. type RouterNat struct {
  27312. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  27313. // Defaults to 30s if not set.
  27314. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  27315. // LogConfig: Configure logging on this NAT.
  27316. LogConfig *RouterNatLogConfig `json:"logConfig,omitempty"`
  27317. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  27318. // NAT config. If not set, a default number of ports is allocated to a
  27319. // VM. This gets rounded up to the nearest power of 2. Eg. if the value
  27320. // of this field is 50, at least 64 ports will be allocated to a VM.
  27321. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  27322. // Name: Unique name of this Nat service. The name must be 1-63
  27323. // characters long and comply with RFC1035.
  27324. Name string `json:"name,omitempty"`
  27325. // NatIpAllocateOption: Specify the NatIpAllocateOption. If it is
  27326. // AUTO_ONLY, then nat_ip should be empty.
  27327. //
  27328. // Possible values:
  27329. // "AUTO_ONLY"
  27330. // "MANUAL_ONLY"
  27331. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  27332. // NatIps: A list of URLs of the IP resources used for this Nat service.
  27333. // These IPs must be valid static external IP addresses assigned to the
  27334. // project. max_length is subject to change post alpha.
  27335. NatIps []string `json:"natIps,omitempty"`
  27336. // SourceSubnetworkIpRangesToNat: Specify the Nat option. If this field
  27337. // contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  27338. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  27339. // other Router.Nat section in any Router for this network in this
  27340. // region.
  27341. //
  27342. // Possible values:
  27343. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  27344. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  27345. // "LIST_OF_SUBNETWORKS"
  27346. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  27347. // Subnetworks: A list of Subnetwork resources whose traffic should be
  27348. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  27349. // is selected for the SubnetworkIpRangeToNatOption above.
  27350. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  27351. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  27352. // established connections. Defaults to 1200s if not set.
  27353. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  27354. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  27355. // connections. Defaults to 30s if not set.
  27356. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  27357. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  27358. // to 30s if not set.
  27359. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  27360. // ForceSendFields is a list of field names (e.g. "IcmpIdleTimeoutSec")
  27361. // to unconditionally include in API requests. By default, fields with
  27362. // empty values are omitted from API requests. However, any non-pointer,
  27363. // non-interface field appearing in ForceSendFields will be sent to the
  27364. // server regardless of whether the field is empty or not. This may be
  27365. // used to include empty fields in Patch requests.
  27366. ForceSendFields []string `json:"-"`
  27367. // NullFields is a list of field names (e.g. "IcmpIdleTimeoutSec") to
  27368. // include in API requests with the JSON null value. By default, fields
  27369. // with empty values are omitted from API requests. However, any field
  27370. // with an empty value appearing in NullFields will be sent to the
  27371. // server as null. It is an error if a field in this list has a
  27372. // non-empty value. This may be used to include null fields in Patch
  27373. // requests.
  27374. NullFields []string `json:"-"`
  27375. }
  27376. func (s *RouterNat) MarshalJSON() ([]byte, error) {
  27377. type NoMethod RouterNat
  27378. raw := NoMethod(*s)
  27379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27380. }
  27381. // RouterNatLogConfig: Configuration of logging on a NAT.
  27382. type RouterNatLogConfig struct {
  27383. // Enable: Indicates whether or not to export logs. This is false by
  27384. // default.
  27385. Enable bool `json:"enable,omitempty"`
  27386. // Filter: Specifies the desired filtering of logs on this NAT. If
  27387. // unspecified, logs are exported for all connections handled by this
  27388. // NAT.
  27389. //
  27390. // Possible values:
  27391. // "ALL"
  27392. // "ERRORS_ONLY"
  27393. // "TRANSLATIONS_ONLY"
  27394. Filter string `json:"filter,omitempty"`
  27395. // ForceSendFields is a list of field names (e.g. "Enable") to
  27396. // unconditionally include in API requests. By default, fields with
  27397. // empty values are omitted from API requests. However, any non-pointer,
  27398. // non-interface field appearing in ForceSendFields will be sent to the
  27399. // server regardless of whether the field is empty or not. This may be
  27400. // used to include empty fields in Patch requests.
  27401. ForceSendFields []string `json:"-"`
  27402. // NullFields is a list of field names (e.g. "Enable") to include in API
  27403. // requests with the JSON null value. By default, fields with empty
  27404. // values are omitted from API requests. However, any field with an
  27405. // empty value appearing in NullFields will be sent to the server as
  27406. // null. It is an error if a field in this list has a non-empty value.
  27407. // This may be used to include null fields in Patch requests.
  27408. NullFields []string `json:"-"`
  27409. }
  27410. func (s *RouterNatLogConfig) MarshalJSON() ([]byte, error) {
  27411. type NoMethod RouterNatLogConfig
  27412. raw := NoMethod(*s)
  27413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27414. }
  27415. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  27416. // for a subnetwork.
  27417. type RouterNatSubnetworkToNat struct {
  27418. // Name: URL for the subnetwork resource to use NAT.
  27419. Name string `json:"name,omitempty"`
  27420. // SecondaryIpRangeNames: A list of the secondary ranges of the
  27421. // Subnetwork that are allowed to use NAT. This can be populated only if
  27422. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  27423. // source_ip_ranges_to_nat.
  27424. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  27425. // SourceIpRangesToNat: Specify the options for NAT ranges in the
  27426. // Subnetwork. All usages of single value are valid except
  27427. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  27428. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  27429. // Default: [ALL_IP_RANGES]
  27430. //
  27431. // Possible values:
  27432. // "ALL_IP_RANGES"
  27433. // "LIST_OF_SECONDARY_IP_RANGES"
  27434. // "PRIMARY_IP_RANGE"
  27435. SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
  27436. // ForceSendFields is a list of field names (e.g. "Name") to
  27437. // unconditionally include in API requests. By default, fields with
  27438. // empty values are omitted from API requests. However, any non-pointer,
  27439. // non-interface field appearing in ForceSendFields will be sent to the
  27440. // server regardless of whether the field is empty or not. This may be
  27441. // used to include empty fields in Patch requests.
  27442. ForceSendFields []string `json:"-"`
  27443. // NullFields is a list of field names (e.g. "Name") to include in API
  27444. // requests with the JSON null value. By default, fields with empty
  27445. // values are omitted from API requests. However, any field with an
  27446. // empty value appearing in NullFields will be sent to the server as
  27447. // null. It is an error if a field in this list has a non-empty value.
  27448. // This may be used to include null fields in Patch requests.
  27449. NullFields []string `json:"-"`
  27450. }
  27451. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  27452. type NoMethod RouterNatSubnetworkToNat
  27453. raw := NoMethod(*s)
  27454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27455. }
  27456. type RouterStatus struct {
  27457. // BestRoutes: Best routes for this router's network.
  27458. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  27459. // BestRoutesForRouter: Best routes learned by this router.
  27460. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  27461. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  27462. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  27463. // Network: URI of the network to which this router belongs.
  27464. Network string `json:"network,omitempty"`
  27465. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  27466. // unconditionally include in API requests. By default, fields with
  27467. // empty values are omitted from API requests. However, any non-pointer,
  27468. // non-interface field appearing in ForceSendFields will be sent to the
  27469. // server regardless of whether the field is empty or not. This may be
  27470. // used to include empty fields in Patch requests.
  27471. ForceSendFields []string `json:"-"`
  27472. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  27473. // API requests with the JSON null value. By default, fields with empty
  27474. // values are omitted from API requests. However, any field with an
  27475. // empty value appearing in NullFields will be sent to the server as
  27476. // null. It is an error if a field in this list has a non-empty value.
  27477. // This may be used to include null fields in Patch requests.
  27478. NullFields []string `json:"-"`
  27479. }
  27480. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  27481. type NoMethod RouterStatus
  27482. raw := NoMethod(*s)
  27483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27484. }
  27485. type RouterStatusBgpPeerStatus struct {
  27486. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  27487. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  27488. // IpAddress: IP address of the local BGP interface.
  27489. IpAddress string `json:"ipAddress,omitempty"`
  27490. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  27491. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  27492. // Name: Name of this BGP peer. Unique within the Routers resource.
  27493. Name string `json:"name,omitempty"`
  27494. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  27495. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  27496. // PeerIpAddress: IP address of the remote BGP interface.
  27497. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  27498. // State: BGP state as specified in RFC1771.
  27499. State string `json:"state,omitempty"`
  27500. // Status: Status of the BGP peer: {UP, DOWN}
  27501. //
  27502. // Possible values:
  27503. // "DOWN"
  27504. // "UNKNOWN"
  27505. // "UP"
  27506. Status string `json:"status,omitempty"`
  27507. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  27508. // days, 23 hours, 59 minutes, 59 seconds
  27509. Uptime string `json:"uptime,omitempty"`
  27510. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  27511. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  27512. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  27513. // unconditionally include in API requests. By default, fields with
  27514. // empty values are omitted from API requests. However, any non-pointer,
  27515. // non-interface field appearing in ForceSendFields will be sent to the
  27516. // server regardless of whether the field is empty or not. This may be
  27517. // used to include empty fields in Patch requests.
  27518. ForceSendFields []string `json:"-"`
  27519. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  27520. // include in API requests with the JSON null value. By default, fields
  27521. // with empty values are omitted from API requests. However, any field
  27522. // with an empty value appearing in NullFields will be sent to the
  27523. // server as null. It is an error if a field in this list has a
  27524. // non-empty value. This may be used to include null fields in Patch
  27525. // requests.
  27526. NullFields []string `json:"-"`
  27527. }
  27528. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  27529. type NoMethod RouterStatusBgpPeerStatus
  27530. raw := NoMethod(*s)
  27531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27532. }
  27533. // RouterStatusNatStatus: Status of a NAT contained in this router. Next
  27534. // tag: 9
  27535. type RouterStatusNatStatus struct {
  27536. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  27537. // ["1.1.1.1", "129.2.16.89"]
  27538. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  27539. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  27540. // be greater than 0 only if user-specified IPs are NOT enough to allow
  27541. // all configured VMs to use NAT. This value is meaningful only when
  27542. // auto-allocation of NAT IPs is *not* used.
  27543. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  27544. // Name: Unique name of this NAT.
  27545. Name string `json:"name,omitempty"`
  27546. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  27547. // that can use NAT.
  27548. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  27549. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  27550. // reserved IP address resources.
  27551. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  27552. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  27553. // be raw IP strings like "179.12.26.133".
  27554. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  27555. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  27556. // to unconditionally include in API requests. By default, fields with
  27557. // empty values are omitted from API requests. However, any non-pointer,
  27558. // non-interface field appearing in ForceSendFields will be sent to the
  27559. // server regardless of whether the field is empty or not. This may be
  27560. // used to include empty fields in Patch requests.
  27561. ForceSendFields []string `json:"-"`
  27562. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  27563. // include in API requests with the JSON null value. By default, fields
  27564. // with empty values are omitted from API requests. However, any field
  27565. // with an empty value appearing in NullFields will be sent to the
  27566. // server as null. It is an error if a field in this list has a
  27567. // non-empty value. This may be used to include null fields in Patch
  27568. // requests.
  27569. NullFields []string `json:"-"`
  27570. }
  27571. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  27572. type NoMethod RouterStatusNatStatus
  27573. raw := NoMethod(*s)
  27574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27575. }
  27576. type RouterStatusResponse struct {
  27577. // Kind: Type of resource.
  27578. Kind string `json:"kind,omitempty"`
  27579. Result *RouterStatus `json:"result,omitempty"`
  27580. // ServerResponse contains the HTTP response code and headers from the
  27581. // server.
  27582. googleapi.ServerResponse `json:"-"`
  27583. // ForceSendFields is a list of field names (e.g. "Kind") to
  27584. // unconditionally include in API requests. By default, fields with
  27585. // empty values are omitted from API requests. However, any non-pointer,
  27586. // non-interface field appearing in ForceSendFields will be sent to the
  27587. // server regardless of whether the field is empty or not. This may be
  27588. // used to include empty fields in Patch requests.
  27589. ForceSendFields []string `json:"-"`
  27590. // NullFields is a list of field names (e.g. "Kind") to include in API
  27591. // requests with the JSON null value. By default, fields with empty
  27592. // values are omitted from API requests. However, any field with an
  27593. // empty value appearing in NullFields will be sent to the server as
  27594. // null. It is an error if a field in this list has a non-empty value.
  27595. // This may be used to include null fields in Patch requests.
  27596. NullFields []string `json:"-"`
  27597. }
  27598. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  27599. type NoMethod RouterStatusResponse
  27600. raw := NoMethod(*s)
  27601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27602. }
  27603. type RoutersPreviewResponse struct {
  27604. // Resource: Preview of given router.
  27605. Resource *Router `json:"resource,omitempty"`
  27606. // ServerResponse contains the HTTP response code and headers from the
  27607. // server.
  27608. googleapi.ServerResponse `json:"-"`
  27609. // ForceSendFields is a list of field names (e.g. "Resource") to
  27610. // unconditionally include in API requests. By default, fields with
  27611. // empty values are omitted from API requests. However, any non-pointer,
  27612. // non-interface field appearing in ForceSendFields will be sent to the
  27613. // server regardless of whether the field is empty or not. This may be
  27614. // used to include empty fields in Patch requests.
  27615. ForceSendFields []string `json:"-"`
  27616. // NullFields is a list of field names (e.g. "Resource") to include in
  27617. // API requests with the JSON null value. By default, fields with empty
  27618. // values are omitted from API requests. However, any field with an
  27619. // empty value appearing in NullFields will be sent to the server as
  27620. // null. It is an error if a field in this list has a non-empty value.
  27621. // This may be used to include null fields in Patch requests.
  27622. NullFields []string `json:"-"`
  27623. }
  27624. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  27625. type NoMethod RoutersPreviewResponse
  27626. raw := NoMethod(*s)
  27627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27628. }
  27629. type RoutersScopedList struct {
  27630. // Routers: A list of routers contained in this scope.
  27631. Routers []*Router `json:"routers,omitempty"`
  27632. // Warning: Informational warning which replaces the list of routers
  27633. // when the list is empty.
  27634. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  27635. // ForceSendFields is a list of field names (e.g. "Routers") to
  27636. // unconditionally include in API requests. By default, fields with
  27637. // empty values are omitted from API requests. However, any non-pointer,
  27638. // non-interface field appearing in ForceSendFields will be sent to the
  27639. // server regardless of whether the field is empty or not. This may be
  27640. // used to include empty fields in Patch requests.
  27641. ForceSendFields []string `json:"-"`
  27642. // NullFields is a list of field names (e.g. "Routers") to include in
  27643. // API requests with the JSON null value. By default, fields with empty
  27644. // values are omitted from API requests. However, any field with an
  27645. // empty value appearing in NullFields will be sent to the server as
  27646. // null. It is an error if a field in this list has a non-empty value.
  27647. // This may be used to include null fields in Patch requests.
  27648. NullFields []string `json:"-"`
  27649. }
  27650. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  27651. type NoMethod RoutersScopedList
  27652. raw := NoMethod(*s)
  27653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27654. }
  27655. // RoutersScopedListWarning: Informational warning which replaces the
  27656. // list of routers when the list is empty.
  27657. type RoutersScopedListWarning struct {
  27658. // Code: [Output Only] A warning code, if applicable. For example,
  27659. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  27660. // the response.
  27661. //
  27662. // Possible values:
  27663. // "CLEANUP_FAILED"
  27664. // "DEPRECATED_RESOURCE_USED"
  27665. // "DEPRECATED_TYPE_USED"
  27666. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  27667. // "EXPERIMENTAL_TYPE_USED"
  27668. // "EXTERNAL_API_WARNING"
  27669. // "FIELD_VALUE_OVERRIDEN"
  27670. // "INJECTED_KERNELS_DEPRECATED"
  27671. // "MISSING_TYPE_DEPENDENCY"
  27672. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  27673. // "NEXT_HOP_CANNOT_IP_FORWARD"
  27674. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  27675. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  27676. // "NEXT_HOP_NOT_RUNNING"
  27677. // "NOT_CRITICAL_ERROR"
  27678. // "NO_RESULTS_ON_PAGE"
  27679. // "REQUIRED_TOS_AGREEMENT"
  27680. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  27681. // "RESOURCE_NOT_DELETED"
  27682. // "SCHEMA_VALIDATION_IGNORED"
  27683. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  27684. // "UNDECLARED_PROPERTIES"
  27685. // "UNREACHABLE"
  27686. Code string `json:"code,omitempty"`
  27687. // Data: [Output Only] Metadata about this warning in key: value format.
  27688. // For example:
  27689. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27690. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  27691. // Message: [Output Only] A human-readable description of the warning
  27692. // code.
  27693. Message string `json:"message,omitempty"`
  27694. // ForceSendFields is a list of field names (e.g. "Code") to
  27695. // unconditionally include in API requests. By default, fields with
  27696. // empty values are omitted from API requests. However, any non-pointer,
  27697. // non-interface field appearing in ForceSendFields will be sent to the
  27698. // server regardless of whether the field is empty or not. This may be
  27699. // used to include empty fields in Patch requests.
  27700. ForceSendFields []string `json:"-"`
  27701. // NullFields is a list of field names (e.g. "Code") to include in API
  27702. // requests with the JSON null value. By default, fields with empty
  27703. // values are omitted from API requests. However, any field with an
  27704. // empty value appearing in NullFields will be sent to the server as
  27705. // null. It is an error if a field in this list has a non-empty value.
  27706. // This may be used to include null fields in Patch requests.
  27707. NullFields []string `json:"-"`
  27708. }
  27709. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  27710. type NoMethod RoutersScopedListWarning
  27711. raw := NoMethod(*s)
  27712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27713. }
  27714. type RoutersScopedListWarningData struct {
  27715. // Key: [Output Only] A key that provides more detail on the warning
  27716. // being returned. For example, for warnings where there are no results
  27717. // in a list request for a particular zone, this key might be scope and
  27718. // the key value might be the zone name. Other examples might be a key
  27719. // indicating a deprecated resource and a suggested replacement, or a
  27720. // warning about invalid network settings (for example, if an instance
  27721. // attempts to perform IP forwarding but is not enabled for IP
  27722. // forwarding).
  27723. Key string `json:"key,omitempty"`
  27724. // Value: [Output Only] A warning data value corresponding to the key.
  27725. Value string `json:"value,omitempty"`
  27726. // ForceSendFields is a list of field names (e.g. "Key") to
  27727. // unconditionally include in API requests. By default, fields with
  27728. // empty values are omitted from API requests. However, any non-pointer,
  27729. // non-interface field appearing in ForceSendFields will be sent to the
  27730. // server regardless of whether the field is empty or not. This may be
  27731. // used to include empty fields in Patch requests.
  27732. ForceSendFields []string `json:"-"`
  27733. // NullFields is a list of field names (e.g. "Key") to include in API
  27734. // requests with the JSON null value. By default, fields with empty
  27735. // values are omitted from API requests. However, any field with an
  27736. // empty value appearing in NullFields will be sent to the server as
  27737. // null. It is an error if a field in this list has a non-empty value.
  27738. // This may be used to include null fields in Patch requests.
  27739. NullFields []string `json:"-"`
  27740. }
  27741. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  27742. type NoMethod RoutersScopedListWarningData
  27743. raw := NoMethod(*s)
  27744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27745. }
  27746. // Rule: A rule to be applied in a Policy.
  27747. type Rule struct {
  27748. // Action: Required
  27749. //
  27750. // Possible values:
  27751. // "ALLOW"
  27752. // "ALLOW_WITH_LOG"
  27753. // "DENY"
  27754. // "DENY_WITH_LOG"
  27755. // "LOG"
  27756. // "NO_ACTION"
  27757. Action string `json:"action,omitempty"`
  27758. // Conditions: Additional restrictions that must be met. All conditions
  27759. // must pass for the rule to match.
  27760. Conditions []*Condition `json:"conditions,omitempty"`
  27761. // Description: Human-readable description of the rule.
  27762. Description string `json:"description,omitempty"`
  27763. // Ins: If one or more 'in' clauses are specified, the rule matches if
  27764. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  27765. Ins []string `json:"ins,omitempty"`
  27766. // LogConfigs: The config returned to callers of
  27767. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  27768. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  27769. // NotIns: If one or more 'not_in' clauses are specified, the rule
  27770. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  27771. // entries.
  27772. NotIns []string `json:"notIns,omitempty"`
  27773. // Permissions: A permission is a string of form '..' (e.g.,
  27774. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  27775. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  27776. Permissions []string `json:"permissions,omitempty"`
  27777. // ForceSendFields is a list of field names (e.g. "Action") to
  27778. // unconditionally include in API requests. By default, fields with
  27779. // empty values are omitted from API requests. However, any non-pointer,
  27780. // non-interface field appearing in ForceSendFields will be sent to the
  27781. // server regardless of whether the field is empty or not. This may be
  27782. // used to include empty fields in Patch requests.
  27783. ForceSendFields []string `json:"-"`
  27784. // NullFields is a list of field names (e.g. "Action") to include in API
  27785. // requests with the JSON null value. By default, fields with empty
  27786. // values are omitted from API requests. However, any field with an
  27787. // empty value appearing in NullFields will be sent to the server as
  27788. // null. It is an error if a field in this list has a non-empty value.
  27789. // This may be used to include null fields in Patch requests.
  27790. NullFields []string `json:"-"`
  27791. }
  27792. func (s *Rule) MarshalJSON() ([]byte, error) {
  27793. type NoMethod Rule
  27794. raw := NoMethod(*s)
  27795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27796. }
  27797. type SSLHealthCheck struct {
  27798. // Port: The TCP port number for the health check request. The default
  27799. // value is 443. Valid values are 1 through 65535.
  27800. Port int64 `json:"port,omitempty"`
  27801. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  27802. // both port and port_name are defined, port takes precedence.
  27803. PortName string `json:"portName,omitempty"`
  27804. // PortSpecification: Specifies how port is selected for health
  27805. // checking, can be one of following values:
  27806. // USE_FIXED_PORT: The port number in
  27807. // port
  27808. // is used for health checking.
  27809. // USE_NAMED_PORT: The
  27810. // portName
  27811. // is used for health checking.
  27812. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  27813. // each network endpoint is used for health checking. For other
  27814. // backends, the port or named port specified in the Backend Service is
  27815. // used for health checking.
  27816. //
  27817. //
  27818. // If not specified, SSL health check follows behavior specified
  27819. // in
  27820. // port
  27821. // and
  27822. // portName
  27823. // fields.
  27824. //
  27825. // Possible values:
  27826. // "USE_FIXED_PORT"
  27827. // "USE_NAMED_PORT"
  27828. // "USE_SERVING_PORT"
  27829. PortSpecification string `json:"portSpecification,omitempty"`
  27830. // ProxyHeader: Specifies the type of proxy header to append before
  27831. // sending data to the backend, either NONE or PROXY_V1. The default is
  27832. // NONE.
  27833. //
  27834. // Possible values:
  27835. // "NONE"
  27836. // "PROXY_V1"
  27837. ProxyHeader string `json:"proxyHeader,omitempty"`
  27838. // Request: The application data to send once the SSL connection has
  27839. // been established (default value is empty). If both request and
  27840. // response are empty, the connection establishment alone will indicate
  27841. // health. The request data can only be ASCII.
  27842. Request string `json:"request,omitempty"`
  27843. // Response: The bytes to match against the beginning of the response
  27844. // data. If left empty (the default value), any response will indicate
  27845. // health. The response data can only be ASCII.
  27846. Response string `json:"response,omitempty"`
  27847. // ForceSendFields is a list of field names (e.g. "Port") to
  27848. // unconditionally include in API requests. By default, fields with
  27849. // empty values are omitted from API requests. However, any non-pointer,
  27850. // non-interface field appearing in ForceSendFields will be sent to the
  27851. // server regardless of whether the field is empty or not. This may be
  27852. // used to include empty fields in Patch requests.
  27853. ForceSendFields []string `json:"-"`
  27854. // NullFields is a list of field names (e.g. "Port") to include in API
  27855. // requests with the JSON null value. By default, fields with empty
  27856. // values are omitted from API requests. However, any field with an
  27857. // empty value appearing in NullFields will be sent to the server as
  27858. // null. It is an error if a field in this list has a non-empty value.
  27859. // This may be used to include null fields in Patch requests.
  27860. NullFields []string `json:"-"`
  27861. }
  27862. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  27863. type NoMethod SSLHealthCheck
  27864. raw := NoMethod(*s)
  27865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27866. }
  27867. // SavedAttachedDisk: An instance-attached disk resource.
  27868. type SavedAttachedDisk struct {
  27869. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  27870. // instance is deleted (but not when the disk is detached from the
  27871. // instance).
  27872. AutoDelete bool `json:"autoDelete,omitempty"`
  27873. // Boot: Indicates that this is a boot disk. The virtual machine will
  27874. // use the first partition of the disk for its root filesystem.
  27875. Boot bool `json:"boot,omitempty"`
  27876. // DeviceName: Specifies a unique device name of your choice that is
  27877. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  27878. // system running within the instance. This name can be used to
  27879. // reference the device for mounting, resizing, and so on, from within
  27880. // the instance.
  27881. //
  27882. // If not specified, the server chooses a default device name to apply
  27883. // to this disk, in the form persistent-disks-x, where x is a number
  27884. // assigned by Google Compute Engine. This field is only applicable for
  27885. // persistent disks.
  27886. DeviceName string `json:"deviceName,omitempty"`
  27887. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  27888. // customer-supplied encryption key.
  27889. //
  27890. // If you are creating a new disk, this field encrypts the new disk
  27891. // using an encryption key that you provide. If you are attaching an
  27892. // existing disk that is already encrypted, this field decrypts the disk
  27893. // using the customer-supplied encryption key.
  27894. //
  27895. // If you encrypt a disk using a customer-supplied key, you must provide
  27896. // the same key again when you attempt to use this resource at a later
  27897. // time. For example, you must provide the key when you create a
  27898. // snapshot or an image from the disk or when you attach the disk to a
  27899. // virtual machine instance.
  27900. //
  27901. // If you do not provide an encryption key, then the disk will be
  27902. // encrypted using an automatically generated key and you do not need to
  27903. // provide a key to use the disk later.
  27904. //
  27905. // Machine Images do not store customer-supplied encryption keys, so you
  27906. // cannot use your own keys to encrypt disks in a managed instance
  27907. // group.
  27908. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  27909. // DiskSizeGb: The size of the disk in base-2 GB. This supersedes
  27910. // disk_size_gb in InitializeParams.
  27911. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  27912. // GuestOsFeatures: A list of features to enable on the guest operating
  27913. // system. Applicable only for bootable images. Read Enabling guest
  27914. // operating system features to see a list of available options.
  27915. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  27916. // Index: [Output Only] A zero-based index to this disk, where 0 is
  27917. // reserved for the boot disk. If you have many disks attached to an
  27918. // instance, each disk would have a unique index number.
  27919. Index int64 `json:"index,omitempty"`
  27920. // InitializeParams: [Input Only] Specifies the parameters for a new
  27921. // disk that will be created alongside the new instance. Use
  27922. // initialization parameters to create boot disks or local SSDs attached
  27923. // to the new instance.
  27924. //
  27925. // This property is mutually exclusive with the source property; you can
  27926. // only define one or the other, but not both.
  27927. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  27928. // Interface: Specifies the disk interface to use for attaching this
  27929. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  27930. // disks must always use SCSI and the request will fail if you attempt
  27931. // to attach a persistent disk in any other format than SCSI. Local SSDs
  27932. // can use either NVME or SCSI. For performance characteristics of SCSI
  27933. // over NVMe, see Local SSD performance.
  27934. //
  27935. // Possible values:
  27936. // "NVDIMM"
  27937. // "NVME"
  27938. // "SCSI"
  27939. Interface string `json:"interface,omitempty"`
  27940. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  27941. // for attached disks.
  27942. Kind string `json:"kind,omitempty"`
  27943. // Licenses: [Output Only] Any valid publicly visible licenses.
  27944. Licenses []string `json:"licenses,omitempty"`
  27945. // Mode: The mode in which to attach this disk, either READ_WRITE or
  27946. // READ_ONLY. If not specified, the default is to attach the disk in
  27947. // READ_WRITE mode.
  27948. //
  27949. // Possible values:
  27950. // "READ_ONLY"
  27951. // "READ_WRITE"
  27952. Mode string `json:"mode,omitempty"`
  27953. // SavedState: For LocalSSD disks on VM Instances in STOPPED or
  27954. // SUSPENDED state, this field is set to PRESERVED if the LocalSSD data
  27955. // has been saved to a persistent location by customer request. (see the
  27956. // discard_local_ssd option on Stop/Suspend). Read-only in the api.
  27957. //
  27958. // Possible values:
  27959. // "DISK_SAVED_STATE_UNSPECIFIED"
  27960. // "PRESERVED"
  27961. SavedState string `json:"savedState,omitempty"`
  27962. // Source: Specifies a valid partial or full URL to an existing
  27963. // Persistent Disk resource. When creating a new instance, one of
  27964. // initializeParams.sourceImage or disks.source is required except for
  27965. // local SSD.
  27966. //
  27967. // If desired, you can also attach existing non-root persistent disks
  27968. // using this property. This field is only applicable for persistent
  27969. // disks.
  27970. //
  27971. // Note that for sourceMachineImage, specify the disk name, not the URL
  27972. // for the disk.
  27973. Source string `json:"source,omitempty"`
  27974. // StorageBytes: [Output Only] A size of the storage used by the disk's
  27975. // snapshot.
  27976. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  27977. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  27978. // is in a stable state or it is being adjusted as a result of shared
  27979. // storage reallocation. This status can either be UPDATING, meaning the
  27980. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  27981. // size of the snapshot is up-to-date.
  27982. //
  27983. // Possible values:
  27984. // "UPDATING"
  27985. // "UP_TO_DATE"
  27986. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  27987. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  27988. // If not specified, the default is PERSISTENT.
  27989. //
  27990. // Possible values:
  27991. // "PERSISTENT"
  27992. // "SCRATCH"
  27993. Type string `json:"type,omitempty"`
  27994. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  27995. // unconditionally include in API requests. By default, fields with
  27996. // empty values are omitted from API requests. However, any non-pointer,
  27997. // non-interface field appearing in ForceSendFields will be sent to the
  27998. // server regardless of whether the field is empty or not. This may be
  27999. // used to include empty fields in Patch requests.
  28000. ForceSendFields []string `json:"-"`
  28001. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  28002. // API requests with the JSON null value. By default, fields with empty
  28003. // values are omitted from API requests. However, any field with an
  28004. // empty value appearing in NullFields will be sent to the server as
  28005. // null. It is an error if a field in this list has a non-empty value.
  28006. // This may be used to include null fields in Patch requests.
  28007. NullFields []string `json:"-"`
  28008. }
  28009. func (s *SavedAttachedDisk) MarshalJSON() ([]byte, error) {
  28010. type NoMethod SavedAttachedDisk
  28011. raw := NoMethod(*s)
  28012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28013. }
  28014. // Scheduling: Sets the scheduling options for an Instance.
  28015. type Scheduling struct {
  28016. // AutomaticRestart: Specifies whether the instance should be
  28017. // automatically restarted if it is terminated by Compute Engine (not
  28018. // terminated by a user). You can only set the automatic restart option
  28019. // for standard instances. Preemptible instances cannot be automatically
  28020. // restarted.
  28021. //
  28022. // By default, this is set to true so an instance is automatically
  28023. // restarted if it is terminated by Compute Engine.
  28024. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  28025. // MinNodeCpus: The minimum number of virtual CPUs this instance will
  28026. // consume when running on a sole-tenant node.
  28027. MinNodeCpus int64 `json:"minNodeCpus,omitempty"`
  28028. // NodeAffinities: A set of node affinity and anti-affinity.
  28029. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  28030. // OnHostMaintenance: Defines the maintenance behavior for this
  28031. // instance. For standard instances, the default behavior is MIGRATE.
  28032. // For preemptible instances, the default and only possible behavior is
  28033. // TERMINATE. For more information, see Setting Instance Scheduling
  28034. // Options.
  28035. //
  28036. // Possible values:
  28037. // "MIGRATE"
  28038. // "TERMINATE"
  28039. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  28040. // Preemptible: Defines whether the instance is preemptible. This can
  28041. // only be set during instance creation, it cannot be set or changed
  28042. // after the instance has been created.
  28043. Preemptible bool `json:"preemptible,omitempty"`
  28044. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  28045. // unconditionally include in API requests. By default, fields with
  28046. // empty values are omitted from API requests. However, any non-pointer,
  28047. // non-interface field appearing in ForceSendFields will be sent to the
  28048. // server regardless of whether the field is empty or not. This may be
  28049. // used to include empty fields in Patch requests.
  28050. ForceSendFields []string `json:"-"`
  28051. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  28052. // include in API requests with the JSON null value. By default, fields
  28053. // with empty values are omitted from API requests. However, any field
  28054. // with an empty value appearing in NullFields will be sent to the
  28055. // server as null. It is an error if a field in this list has a
  28056. // non-empty value. This may be used to include null fields in Patch
  28057. // requests.
  28058. NullFields []string `json:"-"`
  28059. }
  28060. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  28061. type NoMethod Scheduling
  28062. raw := NoMethod(*s)
  28063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28064. }
  28065. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  28066. // nodes onto which this Instance could be scheduled.
  28067. type SchedulingNodeAffinity struct {
  28068. // Key: Corresponds to the label key of Node resource.
  28069. Key string `json:"key,omitempty"`
  28070. // Operator: Defines the operation of node selection.
  28071. //
  28072. // Possible values:
  28073. // "IN"
  28074. // "NOT_IN"
  28075. // "OPERATOR_UNSPECIFIED"
  28076. Operator string `json:"operator,omitempty"`
  28077. // Values: Corresponds to the label values of Node resource.
  28078. Values []string `json:"values,omitempty"`
  28079. // ForceSendFields is a list of field names (e.g. "Key") to
  28080. // unconditionally include in API requests. By default, fields with
  28081. // empty values are omitted from API requests. However, any non-pointer,
  28082. // non-interface field appearing in ForceSendFields will be sent to the
  28083. // server regardless of whether the field is empty or not. This may be
  28084. // used to include empty fields in Patch requests.
  28085. ForceSendFields []string `json:"-"`
  28086. // NullFields is a list of field names (e.g. "Key") to include in API
  28087. // requests with the JSON null value. By default, fields with empty
  28088. // values are omitted from API requests. However, any field with an
  28089. // empty value appearing in NullFields will be sent to the server as
  28090. // null. It is an error if a field in this list has a non-empty value.
  28091. // This may be used to include null fields in Patch requests.
  28092. NullFields []string `json:"-"`
  28093. }
  28094. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  28095. type NoMethod SchedulingNodeAffinity
  28096. raw := NoMethod(*s)
  28097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28098. }
  28099. // SdsConfig: The configuration to access the SDS server.
  28100. type SdsConfig struct {
  28101. // GrpcServiceConfig: The configuration to access the SDS server over
  28102. // GRPC.
  28103. GrpcServiceConfig *GrpcServiceConfig `json:"grpcServiceConfig,omitempty"`
  28104. // ForceSendFields is a list of field names (e.g. "GrpcServiceConfig")
  28105. // to unconditionally include in API requests. By default, fields with
  28106. // empty values are omitted from API requests. However, any non-pointer,
  28107. // non-interface field appearing in ForceSendFields will be sent to the
  28108. // server regardless of whether the field is empty or not. This may be
  28109. // used to include empty fields in Patch requests.
  28110. ForceSendFields []string `json:"-"`
  28111. // NullFields is a list of field names (e.g. "GrpcServiceConfig") to
  28112. // include in API requests with the JSON null value. By default, fields
  28113. // with empty values are omitted from API requests. However, any field
  28114. // with an empty value appearing in NullFields will be sent to the
  28115. // server as null. It is an error if a field in this list has a
  28116. // non-empty value. This may be used to include null fields in Patch
  28117. // requests.
  28118. NullFields []string `json:"-"`
  28119. }
  28120. func (s *SdsConfig) MarshalJSON() ([]byte, error) {
  28121. type NoMethod SdsConfig
  28122. raw := NoMethod(*s)
  28123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28124. }
  28125. type SecurityPoliciesListPreconfiguredExpressionSetsResponse struct {
  28126. PreconfiguredExpressionSets *SecurityPoliciesWafConfig `json:"preconfiguredExpressionSets,omitempty"`
  28127. // ServerResponse contains the HTTP response code and headers from the
  28128. // server.
  28129. googleapi.ServerResponse `json:"-"`
  28130. // ForceSendFields is a list of field names (e.g.
  28131. // "PreconfiguredExpressionSets") to unconditionally include in API
  28132. // requests. By default, fields with empty values are omitted from API
  28133. // requests. However, any non-pointer, non-interface field appearing in
  28134. // ForceSendFields will be sent to the server regardless of whether the
  28135. // field is empty or not. This may be used to include empty fields in
  28136. // Patch requests.
  28137. ForceSendFields []string `json:"-"`
  28138. // NullFields is a list of field names (e.g.
  28139. // "PreconfiguredExpressionSets") to include in API requests with the
  28140. // JSON null value. By default, fields with empty values are omitted
  28141. // from API requests. However, any field with an empty value appearing
  28142. // in NullFields will be sent to the server as null. It is an error if a
  28143. // field in this list has a non-empty value. This may be used to include
  28144. // null fields in Patch requests.
  28145. NullFields []string `json:"-"`
  28146. }
  28147. func (s *SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
  28148. type NoMethod SecurityPoliciesListPreconfiguredExpressionSetsResponse
  28149. raw := NoMethod(*s)
  28150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28151. }
  28152. type SecurityPoliciesWafConfig struct {
  28153. WafRules *PreconfiguredWafSet `json:"wafRules,omitempty"`
  28154. // ForceSendFields is a list of field names (e.g. "WafRules") to
  28155. // unconditionally include in API requests. By default, fields with
  28156. // empty values are omitted from API requests. However, any non-pointer,
  28157. // non-interface field appearing in ForceSendFields will be sent to the
  28158. // server regardless of whether the field is empty or not. This may be
  28159. // used to include empty fields in Patch requests.
  28160. ForceSendFields []string `json:"-"`
  28161. // NullFields is a list of field names (e.g. "WafRules") to include in
  28162. // API requests with the JSON null value. By default, fields with empty
  28163. // values are omitted from API requests. However, any field with an
  28164. // empty value appearing in NullFields will be sent to the server as
  28165. // null. It is an error if a field in this list has a non-empty value.
  28166. // This may be used to include null fields in Patch requests.
  28167. NullFields []string `json:"-"`
  28168. }
  28169. func (s *SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
  28170. type NoMethod SecurityPoliciesWafConfig
  28171. raw := NoMethod(*s)
  28172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28173. }
  28174. // SecurityPolicy: A security policy is comprised of one or more rules.
  28175. // It can also be associated with one or more 'targets'. (==
  28176. // resource_for v1.securityPolicies ==) (== resource_for
  28177. // beta.securityPolicies ==)
  28178. type SecurityPolicy struct {
  28179. // Associations: A list of assocations that belong to this policy.
  28180. Associations []*SecurityPolicyAssociation `json:"associations,omitempty"`
  28181. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  28182. // format.
  28183. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  28184. // Description: An optional description of this resource. Provide this
  28185. // property when you create the resource.
  28186. Description string `json:"description,omitempty"`
  28187. // Fingerprint: Specifies a fingerprint for this resource, which is
  28188. // essentially a hash of the metadata's contents and used for optimistic
  28189. // locking. The fingerprint is initially generated by Compute Engine and
  28190. // changes after every request to modify or update metadata. You must
  28191. // always provide an up-to-date fingerprint hash in order to update or
  28192. // change metadata, otherwise the request will fail with error 412
  28193. // conditionNotMet.
  28194. //
  28195. // To see the latest fingerprint, make get() request to the security
  28196. // policy.
  28197. Fingerprint string `json:"fingerprint,omitempty"`
  28198. // Id: [Output Only] The unique identifier for the resource. This
  28199. // identifier is defined by the server.
  28200. Id uint64 `json:"id,omitempty,string"`
  28201. // Kind: [Output only] Type of the resource. Always
  28202. // compute#securityPolicyfor security policies
  28203. Kind string `json:"kind,omitempty"`
  28204. // LabelFingerprint: A fingerprint for the labels being applied to this
  28205. // security policy, which is essentially a hash of the labels set used
  28206. // for optimistic locking. The fingerprint is initially generated by
  28207. // Compute Engine and changes after every request to modify or update
  28208. // labels. You must always provide an up-to-date fingerprint hash in
  28209. // order to update or change labels.
  28210. //
  28211. // To see the latest fingerprint, make get() request to the security
  28212. // policy.
  28213. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  28214. // Labels: Labels to apply to this security policy resource. These can
  28215. // be later modified by the setLabels method. Each label key/value must
  28216. // comply with RFC1035. Label values may be empty.
  28217. Labels map[string]string `json:"labels,omitempty"`
  28218. // Name: Name of the resource. Provided by the client when the resource
  28219. // is created. The name must be 1-63 characters long, and comply with
  28220. // RFC1035. Specifically, the name must be 1-63 characters long and
  28221. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  28222. // the first character must be a lowercase letter, and all following
  28223. // characters must be a dash, lowercase letter, or digit, except the
  28224. // last character, which cannot be a dash.
  28225. Name string `json:"name,omitempty"`
  28226. // Rules: A list of rules that belong to this policy. There must always
  28227. // be a default rule (rule with priority 2147483647 and match "*"). If
  28228. // no rules are provided when creating a security policy, a default rule
  28229. // with action "allow" will be added.
  28230. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  28231. // SelfLink: [Output Only] Server-defined URL for the resource.
  28232. SelfLink string `json:"selfLink,omitempty"`
  28233. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  28234. // with the resource id.
  28235. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  28236. // Type: The type indicates the intended use of the security policy.
  28237. // CLOUD_ARMOR policies apply to backend services. FIREWALL policies
  28238. // apply to organizations.
  28239. //
  28240. // Possible values:
  28241. // "CLOUD_ARMOR"
  28242. // "FIREWALL"
  28243. Type string `json:"type,omitempty"`
  28244. // ServerResponse contains the HTTP response code and headers from the
  28245. // server.
  28246. googleapi.ServerResponse `json:"-"`
  28247. // ForceSendFields is a list of field names (e.g. "Associations") to
  28248. // unconditionally include in API requests. By default, fields with
  28249. // empty values are omitted from API requests. However, any non-pointer,
  28250. // non-interface field appearing in ForceSendFields will be sent to the
  28251. // server regardless of whether the field is empty or not. This may be
  28252. // used to include empty fields in Patch requests.
  28253. ForceSendFields []string `json:"-"`
  28254. // NullFields is a list of field names (e.g. "Associations") to include
  28255. // in API requests with the JSON null value. By default, fields with
  28256. // empty values are omitted from API requests. However, any field with
  28257. // an empty value appearing in NullFields will be sent to the server as
  28258. // null. It is an error if a field in this list has a non-empty value.
  28259. // This may be used to include null fields in Patch requests.
  28260. NullFields []string `json:"-"`
  28261. }
  28262. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  28263. type NoMethod SecurityPolicy
  28264. raw := NoMethod(*s)
  28265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28266. }
  28267. type SecurityPolicyAssociation struct {
  28268. // AttachmentId: The resource that the security policy is attached to.
  28269. AttachmentId string `json:"attachmentId,omitempty"`
  28270. // Name: The name for an association.
  28271. Name string `json:"name,omitempty"`
  28272. // ServerResponse contains the HTTP response code and headers from the
  28273. // server.
  28274. googleapi.ServerResponse `json:"-"`
  28275. // ForceSendFields is a list of field names (e.g. "AttachmentId") to
  28276. // unconditionally include in API requests. By default, fields with
  28277. // empty values are omitted from API requests. However, any non-pointer,
  28278. // non-interface field appearing in ForceSendFields will be sent to the
  28279. // server regardless of whether the field is empty or not. This may be
  28280. // used to include empty fields in Patch requests.
  28281. ForceSendFields []string `json:"-"`
  28282. // NullFields is a list of field names (e.g. "AttachmentId") to include
  28283. // in API requests with the JSON null value. By default, fields with
  28284. // empty values are omitted from API requests. However, any field with
  28285. // an empty value appearing in NullFields will be sent to the server as
  28286. // null. It is an error if a field in this list has a non-empty value.
  28287. // This may be used to include null fields in Patch requests.
  28288. NullFields []string `json:"-"`
  28289. }
  28290. func (s *SecurityPolicyAssociation) MarshalJSON() ([]byte, error) {
  28291. type NoMethod SecurityPolicyAssociation
  28292. raw := NoMethod(*s)
  28293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28294. }
  28295. type SecurityPolicyList struct {
  28296. // Id: [Output Only] Unique identifier for the resource; defined by the
  28297. // server.
  28298. Id string `json:"id,omitempty"`
  28299. // Items: A list of SecurityPolicy resources.
  28300. Items []*SecurityPolicy `json:"items,omitempty"`
  28301. // Kind: [Output Only] Type of resource. Always
  28302. // compute#securityPolicyList for listsof securityPolicies
  28303. Kind string `json:"kind,omitempty"`
  28304. // NextPageToken: [Output Only] This token allows you to get the next
  28305. // page of results for list requests. If the number of results is larger
  28306. // than maxResults, use the nextPageToken as a value for the query
  28307. // parameter pageToken in the next list request. Subsequent list
  28308. // requests will have their own nextPageToken to continue paging through
  28309. // the results.
  28310. NextPageToken string `json:"nextPageToken,omitempty"`
  28311. // Warning: [Output Only] Informational warning message.
  28312. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  28313. // ServerResponse contains the HTTP response code and headers from the
  28314. // server.
  28315. googleapi.ServerResponse `json:"-"`
  28316. // ForceSendFields is a list of field names (e.g. "Id") to
  28317. // unconditionally include in API requests. By default, fields with
  28318. // empty values are omitted from API requests. However, any non-pointer,
  28319. // non-interface field appearing in ForceSendFields will be sent to the
  28320. // server regardless of whether the field is empty or not. This may be
  28321. // used to include empty fields in Patch requests.
  28322. ForceSendFields []string `json:"-"`
  28323. // NullFields is a list of field names (e.g. "Id") to include in API
  28324. // requests with the JSON null value. By default, fields with empty
  28325. // values are omitted from API requests. However, any field with an
  28326. // empty value appearing in NullFields will be sent to the server as
  28327. // null. It is an error if a field in this list has a non-empty value.
  28328. // This may be used to include null fields in Patch requests.
  28329. NullFields []string `json:"-"`
  28330. }
  28331. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  28332. type NoMethod SecurityPolicyList
  28333. raw := NoMethod(*s)
  28334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28335. }
  28336. // SecurityPolicyListWarning: [Output Only] Informational warning
  28337. // message.
  28338. type SecurityPolicyListWarning struct {
  28339. // Code: [Output Only] A warning code, if applicable. For example,
  28340. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  28341. // the response.
  28342. //
  28343. // Possible values:
  28344. // "CLEANUP_FAILED"
  28345. // "DEPRECATED_RESOURCE_USED"
  28346. // "DEPRECATED_TYPE_USED"
  28347. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  28348. // "EXPERIMENTAL_TYPE_USED"
  28349. // "EXTERNAL_API_WARNING"
  28350. // "FIELD_VALUE_OVERRIDEN"
  28351. // "INJECTED_KERNELS_DEPRECATED"
  28352. // "MISSING_TYPE_DEPENDENCY"
  28353. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  28354. // "NEXT_HOP_CANNOT_IP_FORWARD"
  28355. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  28356. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  28357. // "NEXT_HOP_NOT_RUNNING"
  28358. // "NOT_CRITICAL_ERROR"
  28359. // "NO_RESULTS_ON_PAGE"
  28360. // "REQUIRED_TOS_AGREEMENT"
  28361. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  28362. // "RESOURCE_NOT_DELETED"
  28363. // "SCHEMA_VALIDATION_IGNORED"
  28364. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  28365. // "UNDECLARED_PROPERTIES"
  28366. // "UNREACHABLE"
  28367. Code string `json:"code,omitempty"`
  28368. // Data: [Output Only] Metadata about this warning in key: value format.
  28369. // For example:
  28370. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  28371. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  28372. // Message: [Output Only] A human-readable description of the warning
  28373. // code.
  28374. Message string `json:"message,omitempty"`
  28375. // ForceSendFields is a list of field names (e.g. "Code") to
  28376. // unconditionally include in API requests. By default, fields with
  28377. // empty values are omitted from API requests. However, any non-pointer,
  28378. // non-interface field appearing in ForceSendFields will be sent to the
  28379. // server regardless of whether the field is empty or not. This may be
  28380. // used to include empty fields in Patch requests.
  28381. ForceSendFields []string `json:"-"`
  28382. // NullFields is a list of field names (e.g. "Code") to include in API
  28383. // requests with the JSON null value. By default, fields with empty
  28384. // values are omitted from API requests. However, any field with an
  28385. // empty value appearing in NullFields will be sent to the server as
  28386. // null. It is an error if a field in this list has a non-empty value.
  28387. // This may be used to include null fields in Patch requests.
  28388. NullFields []string `json:"-"`
  28389. }
  28390. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  28391. type NoMethod SecurityPolicyListWarning
  28392. raw := NoMethod(*s)
  28393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28394. }
  28395. type SecurityPolicyListWarningData struct {
  28396. // Key: [Output Only] A key that provides more detail on the warning
  28397. // being returned. For example, for warnings where there are no results
  28398. // in a list request for a particular zone, this key might be scope and
  28399. // the key value might be the zone name. Other examples might be a key
  28400. // indicating a deprecated resource and a suggested replacement, or a
  28401. // warning about invalid network settings (for example, if an instance
  28402. // attempts to perform IP forwarding but is not enabled for IP
  28403. // forwarding).
  28404. Key string `json:"key,omitempty"`
  28405. // Value: [Output Only] A warning data value corresponding to the key.
  28406. Value string `json:"value,omitempty"`
  28407. // ForceSendFields is a list of field names (e.g. "Key") to
  28408. // unconditionally include in API requests. By default, fields with
  28409. // empty values are omitted from API requests. However, any non-pointer,
  28410. // non-interface field appearing in ForceSendFields will be sent to the
  28411. // server regardless of whether the field is empty or not. This may be
  28412. // used to include empty fields in Patch requests.
  28413. ForceSendFields []string `json:"-"`
  28414. // NullFields is a list of field names (e.g. "Key") to include in API
  28415. // requests with the JSON null value. By default, fields with empty
  28416. // values are omitted from API requests. However, any field with an
  28417. // empty value appearing in NullFields will be sent to the server as
  28418. // null. It is an error if a field in this list has a non-empty value.
  28419. // This may be used to include null fields in Patch requests.
  28420. NullFields []string `json:"-"`
  28421. }
  28422. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  28423. type NoMethod SecurityPolicyListWarningData
  28424. raw := NoMethod(*s)
  28425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28426. }
  28427. type SecurityPolicyReference struct {
  28428. SecurityPolicy string `json:"securityPolicy,omitempty"`
  28429. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  28430. // unconditionally include in API requests. By default, fields with
  28431. // empty values are omitted from API requests. However, any non-pointer,
  28432. // non-interface field appearing in ForceSendFields will be sent to the
  28433. // server regardless of whether the field is empty or not. This may be
  28434. // used to include empty fields in Patch requests.
  28435. ForceSendFields []string `json:"-"`
  28436. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  28437. // include in API requests with the JSON null value. By default, fields
  28438. // with empty values are omitted from API requests. However, any field
  28439. // with an empty value appearing in NullFields will be sent to the
  28440. // server as null. It is an error if a field in this list has a
  28441. // non-empty value. This may be used to include null fields in Patch
  28442. // requests.
  28443. NullFields []string `json:"-"`
  28444. }
  28445. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  28446. type NoMethod SecurityPolicyReference
  28447. raw := NoMethod(*s)
  28448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28449. }
  28450. // SecurityPolicyRule: Represents a rule that describes one or more
  28451. // match conditions along with the action to be taken when traffic
  28452. // matches this condition (allow or deny).
  28453. type SecurityPolicyRule struct {
  28454. // Action: The Action to preform when the client connection triggers the
  28455. // rule. Can currently be either "allow" or "deny()" where valid values
  28456. // for status are 403, 404, and 502.
  28457. Action string `json:"action,omitempty"`
  28458. // Description: An optional description of this resource. Provide this
  28459. // property when you create the resource.
  28460. Description string `json:"description,omitempty"`
  28461. // Direction: The direction in which this rule applies. This field may
  28462. // only be specified when versioned_expr is set to FIREWALL.
  28463. //
  28464. // Possible values:
  28465. // "EGRESS"
  28466. // "INGRESS"
  28467. Direction string `json:"direction,omitempty"`
  28468. // EnableLogging: Denotes whether to enable logging for a particular
  28469. // rule. If logging is enabled, logs will be exported to the configured
  28470. // export destination in Stackdriver. Logs may be exported to BigQuery
  28471. // or Pub/Sub. Note: you cannot enable logging on "goto_next"
  28472. // rules.
  28473. //
  28474. // This field may only be specified when the versioned_expr is set to
  28475. // FIREWALL.
  28476. EnableLogging bool `json:"enableLogging,omitempty"`
  28477. // Kind: [Output only] Type of the resource. Always
  28478. // compute#securityPolicyRule for security policy rules
  28479. Kind string `json:"kind,omitempty"`
  28480. // Match: A match condition that incoming traffic is evaluated against.
  28481. // If it evaluates to true, the corresponding ?action? is enforced.
  28482. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  28483. // Preview: If set to true, the specified action is not enforced.
  28484. Preview bool `json:"preview,omitempty"`
  28485. // Priority: An integer indicating the priority of a rule in the list.
  28486. // The priority must be a positive value between 0 and 2147483647. Rules
  28487. // are evaluated from highest to lowest priority where 0 is the highest
  28488. // priority and 2147483647 is the lowest prority.
  28489. Priority int64 `json:"priority,omitempty"`
  28490. // RateLimitOptions: Must be specified if the action is
  28491. // "rate_based_blacklist" or "throttle". Cannot be specified for any
  28492. // other actions.
  28493. RateLimitOptions *SecurityPolicyRuleRateLimitOptions `json:"rateLimitOptions,omitempty"`
  28494. // TargetResources: A list of network resource URLs to which this rule
  28495. // applies. This field allows you to control which network?s VMs get
  28496. // this rule. If this field is left blank, all VMs within the
  28497. // organization will receive the rule.
  28498. //
  28499. // This field may only be specified when versioned_expr is set to
  28500. // FIREWALL.
  28501. TargetResources []string `json:"targetResources,omitempty"`
  28502. // ServerResponse contains the HTTP response code and headers from the
  28503. // server.
  28504. googleapi.ServerResponse `json:"-"`
  28505. // ForceSendFields is a list of field names (e.g. "Action") to
  28506. // unconditionally include in API requests. By default, fields with
  28507. // empty values are omitted from API requests. However, any non-pointer,
  28508. // non-interface field appearing in ForceSendFields will be sent to the
  28509. // server regardless of whether the field is empty or not. This may be
  28510. // used to include empty fields in Patch requests.
  28511. ForceSendFields []string `json:"-"`
  28512. // NullFields is a list of field names (e.g. "Action") to include in API
  28513. // requests with the JSON null value. By default, fields with empty
  28514. // values are omitted from API requests. However, any field with an
  28515. // empty value appearing in NullFields will be sent to the server as
  28516. // null. It is an error if a field in this list has a non-empty value.
  28517. // This may be used to include null fields in Patch requests.
  28518. NullFields []string `json:"-"`
  28519. }
  28520. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  28521. type NoMethod SecurityPolicyRule
  28522. raw := NoMethod(*s)
  28523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28524. }
  28525. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  28526. // traffic is evaluated against. Exactly one field must be specified.
  28527. type SecurityPolicyRuleMatcher struct {
  28528. // Config: The configuration options available when specifying
  28529. // versioned_expr. This field must be specified if versioned_expr is
  28530. // specified and cannot be specified if versioned_expr is not specified.
  28531. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  28532. // Expr: User defined CEVAL expression. A CEVAL expression is used to
  28533. // specify match criteria such as origin.ip, source.region_code and
  28534. // contents in the request header.
  28535. Expr *Expr `json:"expr,omitempty"`
  28536. // VersionedExpr: Preconfigured versioned expression. If this field is
  28537. // specified, config must also be specified. Available preconfigured
  28538. // expressions along with their requirements are: SRC_IPS_V1 - must
  28539. // specify the corresponding src_ip_range field in config.
  28540. //
  28541. // Possible values:
  28542. // "FIREWALL"
  28543. // "SRC_IPS_V1"
  28544. VersionedExpr string `json:"versionedExpr,omitempty"`
  28545. // ForceSendFields is a list of field names (e.g. "Config") to
  28546. // unconditionally include in API requests. By default, fields with
  28547. // empty values are omitted from API requests. However, any non-pointer,
  28548. // non-interface field appearing in ForceSendFields will be sent to the
  28549. // server regardless of whether the field is empty or not. This may be
  28550. // used to include empty fields in Patch requests.
  28551. ForceSendFields []string `json:"-"`
  28552. // NullFields is a list of field names (e.g. "Config") to include in API
  28553. // requests with the JSON null value. By default, fields with empty
  28554. // values are omitted from API requests. However, any field with an
  28555. // empty value appearing in NullFields will be sent to the server as
  28556. // null. It is an error if a field in this list has a non-empty value.
  28557. // This may be used to include null fields in Patch requests.
  28558. NullFields []string `json:"-"`
  28559. }
  28560. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  28561. type NoMethod SecurityPolicyRuleMatcher
  28562. raw := NoMethod(*s)
  28563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28564. }
  28565. type SecurityPolicyRuleMatcherConfig struct {
  28566. // DestIpRanges: CIDR IP address range.
  28567. //
  28568. // This field may only be specified when versioned_expr is set to
  28569. // FIREWALL.
  28570. DestIpRanges []string `json:"destIpRanges,omitempty"`
  28571. // DestPorts: Pairs of IP protocols and ports that the rule should
  28572. // match.
  28573. //
  28574. // This field may only be specified when versioned_expr is set to
  28575. // FIREWALL.
  28576. DestPorts []*SecurityPolicyRuleMatcherConfigDestinationPort `json:"destPorts,omitempty"`
  28577. // SrcIpRanges: CIDR IP address range.
  28578. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  28579. // ForceSendFields is a list of field names (e.g. "DestIpRanges") to
  28580. // unconditionally include in API requests. By default, fields with
  28581. // empty values are omitted from API requests. However, any non-pointer,
  28582. // non-interface field appearing in ForceSendFields will be sent to the
  28583. // server regardless of whether the field is empty or not. This may be
  28584. // used to include empty fields in Patch requests.
  28585. ForceSendFields []string `json:"-"`
  28586. // NullFields is a list of field names (e.g. "DestIpRanges") to include
  28587. // in API requests with the JSON null value. By default, fields with
  28588. // empty values are omitted from API requests. However, any field with
  28589. // an empty value appearing in NullFields will be sent to the server as
  28590. // null. It is an error if a field in this list has a non-empty value.
  28591. // This may be used to include null fields in Patch requests.
  28592. NullFields []string `json:"-"`
  28593. }
  28594. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  28595. type NoMethod SecurityPolicyRuleMatcherConfig
  28596. raw := NoMethod(*s)
  28597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28598. }
  28599. type SecurityPolicyRuleMatcherConfigDestinationPort struct {
  28600. // IpProtocol: The IP protocol to which this rule applies. The protocol
  28601. // type is required when creating a firewall rule. This value can either
  28602. // be one of the following well known protocol strings (tcp, udp, icmp,
  28603. // esp, ah, ipip, sctp), or the IP protocol number.
  28604. IpProtocol string `json:"ipProtocol,omitempty"`
  28605. // Ports: An optional list of ports to which this rule applies. This
  28606. // field is only applicable for UDP or TCP protocol. Each entry must be
  28607. // either an integer or a range. If not specified, this rule applies to
  28608. // connections through any port.
  28609. //
  28610. // Example inputs include: ["22"], ["80","443"], and
  28611. // ["12345-12349"].
  28612. //
  28613. // This field may only be specified when versioned_expr is set to
  28614. // FIREWALL.
  28615. Ports []string `json:"ports,omitempty"`
  28616. // ForceSendFields is a list of field names (e.g. "IpProtocol") to
  28617. // unconditionally include in API requests. By default, fields with
  28618. // empty values are omitted from API requests. However, any non-pointer,
  28619. // non-interface field appearing in ForceSendFields will be sent to the
  28620. // server regardless of whether the field is empty or not. This may be
  28621. // used to include empty fields in Patch requests.
  28622. ForceSendFields []string `json:"-"`
  28623. // NullFields is a list of field names (e.g. "IpProtocol") to include in
  28624. // API requests with the JSON null value. By default, fields with empty
  28625. // values are omitted from API requests. However, any field with an
  28626. // empty value appearing in NullFields will be sent to the server as
  28627. // null. It is an error if a field in this list has a non-empty value.
  28628. // This may be used to include null fields in Patch requests.
  28629. NullFields []string `json:"-"`
  28630. }
  28631. func (s *SecurityPolicyRuleMatcherConfigDestinationPort) MarshalJSON() ([]byte, error) {
  28632. type NoMethod SecurityPolicyRuleMatcherConfigDestinationPort
  28633. raw := NoMethod(*s)
  28634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28635. }
  28636. type SecurityPolicyRuleRateLimitOptions struct {
  28637. // BlockDuration: Can only be specifed if the action for the rule is
  28638. // "rate_based_blacklist" If specified, determines the time (in seconds)
  28639. // the traffic will continue to be blocked by the rate limit after the
  28640. // rate falls below the threshold. The default value is 0 seconds.
  28641. BlockDuration int64 `json:"blockDuration,omitempty"`
  28642. // ConformAction: Action to take when requests are under the given
  28643. // threshold. When requests are throttled, this is also the action for
  28644. // all requests which are not dropped. Valid options are "allow",
  28645. // "fairshare", and "drop_overload".
  28646. ConformAction string `json:"conformAction,omitempty"`
  28647. // EnforceOnKey: Determines the key to enforce the threshold_rps limit
  28648. // on. If key is "IP", each IP has this limit enforced separately,
  28649. // whereas "ALL_IPs" means a single limit is applied to all requests
  28650. // matching this rule.
  28651. //
  28652. // Possible values:
  28653. // "ALL_IPS"
  28654. // "IP"
  28655. EnforceOnKey string `json:"enforceOnKey,omitempty"`
  28656. // ExceedAction: When a request is denied, returns the HTTP response
  28657. // code specified. Valid options are "deny()" where valid values for
  28658. // status are 403, 404, 429, and 502.
  28659. ExceedAction string `json:"exceedAction,omitempty"`
  28660. // ThresholdRps: Rate in requests per second at which to begin
  28661. // ratelimiting.
  28662. ThresholdRps int64 `json:"thresholdRps,omitempty"`
  28663. // ForceSendFields is a list of field names (e.g. "BlockDuration") to
  28664. // unconditionally include in API requests. By default, fields with
  28665. // empty values are omitted from API requests. However, any non-pointer,
  28666. // non-interface field appearing in ForceSendFields will be sent to the
  28667. // server regardless of whether the field is empty or not. This may be
  28668. // used to include empty fields in Patch requests.
  28669. ForceSendFields []string `json:"-"`
  28670. // NullFields is a list of field names (e.g. "BlockDuration") to include
  28671. // in API requests with the JSON null value. By default, fields with
  28672. // empty values are omitted from API requests. However, any field with
  28673. // an empty value appearing in NullFields will be sent to the server as
  28674. // null. It is an error if a field in this list has a non-empty value.
  28675. // This may be used to include null fields in Patch requests.
  28676. NullFields []string `json:"-"`
  28677. }
  28678. func (s *SecurityPolicyRuleRateLimitOptions) MarshalJSON() ([]byte, error) {
  28679. type NoMethod SecurityPolicyRuleRateLimitOptions
  28680. raw := NoMethod(*s)
  28681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28682. }
  28683. // SecuritySettings: The authentication and authorization settings for a
  28684. // BackendService.
  28685. type SecuritySettings struct {
  28686. // AuthenticationPolicy: Authentication policy defines what
  28687. // authentication methods can be accepted on backends, and if
  28688. // authenticated, which method/certificate will set the request
  28689. // principal.
  28690. AuthenticationPolicy *AuthenticationPolicy `json:"authenticationPolicy,omitempty"`
  28691. // AuthorizationConfig: Authorization config defines the Role Based
  28692. // Access Control (RBAC) config.
  28693. AuthorizationConfig *AuthorizationConfig `json:"authorizationConfig,omitempty"`
  28694. // ClientTlsSettings: TLS Settings for the backend service.
  28695. ClientTlsSettings *ClientTlsSettings `json:"clientTlsSettings,omitempty"`
  28696. // ServerSettingsSelector: The listener config of the XDS client is
  28697. // generated if the selector matches the client.
  28698. ServerSettingsSelector *ServerSecuritySettingsSelector `json:"serverSettingsSelector,omitempty"`
  28699. // ForceSendFields is a list of field names (e.g.
  28700. // "AuthenticationPolicy") to unconditionally include in API requests.
  28701. // By default, fields with empty values are omitted from API requests.
  28702. // However, any non-pointer, non-interface field appearing in
  28703. // ForceSendFields will be sent to the server regardless of whether the
  28704. // field is empty or not. This may be used to include empty fields in
  28705. // Patch requests.
  28706. ForceSendFields []string `json:"-"`
  28707. // NullFields is a list of field names (e.g. "AuthenticationPolicy") to
  28708. // include in API requests with the JSON null value. By default, fields
  28709. // with empty values are omitted from API requests. However, any field
  28710. // with an empty value appearing in NullFields will be sent to the
  28711. // server as null. It is an error if a field in this list has a
  28712. // non-empty value. This may be used to include null fields in Patch
  28713. // requests.
  28714. NullFields []string `json:"-"`
  28715. }
  28716. func (s *SecuritySettings) MarshalJSON() ([]byte, error) {
  28717. type NoMethod SecuritySettings
  28718. raw := NoMethod(*s)
  28719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28720. }
  28721. // SerialPortOutput: An instance's serial console output.
  28722. type SerialPortOutput struct {
  28723. // Contents: [Output Only] The contents of the console output.
  28724. Contents string `json:"contents,omitempty"`
  28725. // Kind: [Output Only] Type of the resource. Always
  28726. // compute#serialPortOutput for serial port output.
  28727. Kind string `json:"kind,omitempty"`
  28728. // Next: [Output Only] The position of the next byte of content from the
  28729. // serial console output. Use this value in the next request as the
  28730. // start parameter.
  28731. Next int64 `json:"next,omitempty,string"`
  28732. // SelfLink: [Output Only] Server-defined URL for this resource.
  28733. SelfLink string `json:"selfLink,omitempty"`
  28734. // Start: The starting byte position of the output that was returned.
  28735. // This should match the start parameter sent with the request. If the
  28736. // serial console output exceeds the size of the buffer, older output
  28737. // will be overwritten by newer content and the start values will be
  28738. // mismatched.
  28739. Start int64 `json:"start,omitempty,string"`
  28740. // ServerResponse contains the HTTP response code and headers from the
  28741. // server.
  28742. googleapi.ServerResponse `json:"-"`
  28743. // ForceSendFields is a list of field names (e.g. "Contents") to
  28744. // unconditionally include in API requests. By default, fields with
  28745. // empty values are omitted from API requests. However, any non-pointer,
  28746. // non-interface field appearing in ForceSendFields will be sent to the
  28747. // server regardless of whether the field is empty or not. This may be
  28748. // used to include empty fields in Patch requests.
  28749. ForceSendFields []string `json:"-"`
  28750. // NullFields is a list of field names (e.g. "Contents") to include in
  28751. // API requests with the JSON null value. By default, fields with empty
  28752. // values are omitted from API requests. However, any field with an
  28753. // empty value appearing in NullFields will be sent to the server as
  28754. // null. It is an error if a field in this list has a non-empty value.
  28755. // This may be used to include null fields in Patch requests.
  28756. NullFields []string `json:"-"`
  28757. }
  28758. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  28759. type NoMethod SerialPortOutput
  28760. raw := NoMethod(*s)
  28761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28762. }
  28763. type ServerBinding struct {
  28764. // Possible values:
  28765. // "RESTART_NODE_ON_ANY_SERVER"
  28766. // "RESTART_NODE_ON_MINIMAL_SERVERS"
  28767. // "SERVER_BINDING_TYPE_UNSPECIFIED"
  28768. Type string `json:"type,omitempty"`
  28769. // ForceSendFields is a list of field names (e.g. "Type") to
  28770. // unconditionally include in API requests. By default, fields with
  28771. // empty values are omitted from API requests. However, any non-pointer,
  28772. // non-interface field appearing in ForceSendFields will be sent to the
  28773. // server regardless of whether the field is empty or not. This may be
  28774. // used to include empty fields in Patch requests.
  28775. ForceSendFields []string `json:"-"`
  28776. // NullFields is a list of field names (e.g. "Type") to include in API
  28777. // requests with the JSON null value. By default, fields with empty
  28778. // values are omitted from API requests. However, any field with an
  28779. // empty value appearing in NullFields will be sent to the server as
  28780. // null. It is an error if a field in this list has a non-empty value.
  28781. // This may be used to include null fields in Patch requests.
  28782. NullFields []string `json:"-"`
  28783. }
  28784. func (s *ServerBinding) MarshalJSON() ([]byte, error) {
  28785. type NoMethod ServerBinding
  28786. raw := NoMethod(*s)
  28787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28788. }
  28789. // ServerSecuritySettingsSelector: A selector associated with the
  28790. // SecuritySettings. If the labels and port in this selector match the
  28791. // Envoy's label and port, the server side authentication and
  28792. // authorization settings are applied to the Envoy.
  28793. type ServerSecuritySettingsSelector struct {
  28794. // LabelMatches: The labels associated with the XDS client.
  28795. LabelMatches []*MetadataFilterLabelMatch `json:"labelMatches,omitempty"`
  28796. // Port: The listener port of the XDS client.
  28797. Port int64 `json:"port,omitempty"`
  28798. // ForceSendFields is a list of field names (e.g. "LabelMatches") to
  28799. // unconditionally include in API requests. By default, fields with
  28800. // empty values are omitted from API requests. However, any non-pointer,
  28801. // non-interface field appearing in ForceSendFields will be sent to the
  28802. // server regardless of whether the field is empty or not. This may be
  28803. // used to include empty fields in Patch requests.
  28804. ForceSendFields []string `json:"-"`
  28805. // NullFields is a list of field names (e.g. "LabelMatches") to include
  28806. // in API requests with the JSON null value. By default, fields with
  28807. // empty values are omitted from API requests. However, any field with
  28808. // an empty value appearing in NullFields will be sent to the server as
  28809. // null. It is an error if a field in this list has a non-empty value.
  28810. // This may be used to include null fields in Patch requests.
  28811. NullFields []string `json:"-"`
  28812. }
  28813. func (s *ServerSecuritySettingsSelector) MarshalJSON() ([]byte, error) {
  28814. type NoMethod ServerSecuritySettingsSelector
  28815. raw := NoMethod(*s)
  28816. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28817. }
  28818. // ServerTlsSettings: The TLS settings for the server.
  28819. type ServerTlsSettings struct {
  28820. // ProxyTlsContext: Configures the mechanism to obtain security
  28821. // certificates and identity information.
  28822. ProxyTlsContext *TlsContext `json:"proxyTlsContext,omitempty"`
  28823. // SubjectAltNames: A list of alternate names to verify the subject
  28824. // identity in the certificate presented by the client.
  28825. SubjectAltNames []string `json:"subjectAltNames,omitempty"`
  28826. // TlsMode: Indicates whether connections should be secured using TLS.
  28827. // The value of this field determines how TLS is enforced. This field
  28828. // can be set to one of the following:
  28829. // - SIMPLE Secure connections with standard TLS semantics.
  28830. // - MUTUAL Secure connections to the backends using mutual TLS by
  28831. // presenting client certificates for authentication.
  28832. //
  28833. // Possible values:
  28834. // "INVALID"
  28835. // "MUTUAL"
  28836. // "SIMPLE"
  28837. TlsMode string `json:"tlsMode,omitempty"`
  28838. // ForceSendFields is a list of field names (e.g. "ProxyTlsContext") to
  28839. // unconditionally include in API requests. By default, fields with
  28840. // empty values are omitted from API requests. However, any non-pointer,
  28841. // non-interface field appearing in ForceSendFields will be sent to the
  28842. // server regardless of whether the field is empty or not. This may be
  28843. // used to include empty fields in Patch requests.
  28844. ForceSendFields []string `json:"-"`
  28845. // NullFields is a list of field names (e.g. "ProxyTlsContext") to
  28846. // include in API requests with the JSON null value. By default, fields
  28847. // with empty values are omitted from API requests. However, any field
  28848. // with an empty value appearing in NullFields will be sent to the
  28849. // server as null. It is an error if a field in this list has a
  28850. // non-empty value. This may be used to include null fields in Patch
  28851. // requests.
  28852. NullFields []string `json:"-"`
  28853. }
  28854. func (s *ServerTlsSettings) MarshalJSON() ([]byte, error) {
  28855. type NoMethod ServerTlsSettings
  28856. raw := NoMethod(*s)
  28857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28858. }
  28859. // ServiceAccount: A service account.
  28860. type ServiceAccount struct {
  28861. // Email: Email address of the service account.
  28862. Email string `json:"email,omitempty"`
  28863. // Scopes: The list of scopes to be made available for this service
  28864. // account.
  28865. Scopes []string `json:"scopes,omitempty"`
  28866. // ForceSendFields is a list of field names (e.g. "Email") to
  28867. // unconditionally include in API requests. By default, fields with
  28868. // empty values are omitted from API requests. However, any non-pointer,
  28869. // non-interface field appearing in ForceSendFields will be sent to the
  28870. // server regardless of whether the field is empty or not. This may be
  28871. // used to include empty fields in Patch requests.
  28872. ForceSendFields []string `json:"-"`
  28873. // NullFields is a list of field names (e.g. "Email") to include in API
  28874. // requests with the JSON null value. By default, fields with empty
  28875. // values are omitted from API requests. However, any field with an
  28876. // empty value appearing in NullFields will be sent to the server as
  28877. // null. It is an error if a field in this list has a non-empty value.
  28878. // This may be used to include null fields in Patch requests.
  28879. NullFields []string `json:"-"`
  28880. }
  28881. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  28882. type NoMethod ServiceAccount
  28883. raw := NoMethod(*s)
  28884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28885. }
  28886. // ServiceAccountJwtAccessCredentials: JWT credentials for a service
  28887. // account.
  28888. type ServiceAccountJwtAccessCredentials struct {
  28889. // JsonKey: Service account key.
  28890. JsonKey string `json:"jsonKey,omitempty"`
  28891. // TokenLifetimeSeconds: The token lifetime seconds.
  28892. TokenLifetimeSeconds int64 `json:"tokenLifetimeSeconds,omitempty,string"`
  28893. // ForceSendFields is a list of field names (e.g. "JsonKey") to
  28894. // unconditionally include in API requests. By default, fields with
  28895. // empty values are omitted from API requests. However, any non-pointer,
  28896. // non-interface field appearing in ForceSendFields will be sent to the
  28897. // server regardless of whether the field is empty or not. This may be
  28898. // used to include empty fields in Patch requests.
  28899. ForceSendFields []string `json:"-"`
  28900. // NullFields is a list of field names (e.g. "JsonKey") to include in
  28901. // API requests with the JSON null value. By default, fields with empty
  28902. // values are omitted from API requests. However, any field with an
  28903. // empty value appearing in NullFields will be sent to the server as
  28904. // null. It is an error if a field in this list has a non-empty value.
  28905. // This may be used to include null fields in Patch requests.
  28906. NullFields []string `json:"-"`
  28907. }
  28908. func (s *ServiceAccountJwtAccessCredentials) MarshalJSON() ([]byte, error) {
  28909. type NoMethod ServiceAccountJwtAccessCredentials
  28910. raw := NoMethod(*s)
  28911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28912. }
  28913. // ShieldedInstanceConfig: A set of Shielded Instance options.
  28914. type ShieldedInstanceConfig struct {
  28915. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  28916. // monitoring enabled.
  28917. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  28918. // EnableSecureBoot: Defines whether the instance has Secure Boot
  28919. // enabled.
  28920. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  28921. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  28922. EnableVtpm bool `json:"enableVtpm,omitempty"`
  28923. // ForceSendFields is a list of field names (e.g.
  28924. // "EnableIntegrityMonitoring") to unconditionally include in API
  28925. // requests. By default, fields with empty values are omitted from API
  28926. // requests. However, any non-pointer, non-interface field appearing in
  28927. // ForceSendFields will be sent to the server regardless of whether the
  28928. // field is empty or not. This may be used to include empty fields in
  28929. // Patch requests.
  28930. ForceSendFields []string `json:"-"`
  28931. // NullFields is a list of field names (e.g.
  28932. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  28933. // null value. By default, fields with empty values are omitted from API
  28934. // requests. However, any field with an empty value appearing in
  28935. // NullFields will be sent to the server as null. It is an error if a
  28936. // field in this list has a non-empty value. This may be used to include
  28937. // null fields in Patch requests.
  28938. NullFields []string `json:"-"`
  28939. }
  28940. func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) {
  28941. type NoMethod ShieldedInstanceConfig
  28942. raw := NoMethod(*s)
  28943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28944. }
  28945. // ShieldedInstanceIdentity: A shielded Instance identity entry.
  28946. type ShieldedInstanceIdentity struct {
  28947. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded
  28948. // Instance's vTPM.
  28949. EncryptionKey *ShieldedInstanceIdentityEntry `json:"encryptionKey,omitempty"`
  28950. // Kind: [Output Only] Type of the resource. Always
  28951. // compute#shieldedInstanceIdentity for shielded Instance identity
  28952. // entry.
  28953. Kind string `json:"kind,omitempty"`
  28954. // SigningKey: An Attestation Key (AK) issued to the Shielded Instance's
  28955. // vTPM.
  28956. SigningKey *ShieldedInstanceIdentityEntry `json:"signingKey,omitempty"`
  28957. // ServerResponse contains the HTTP response code and headers from the
  28958. // server.
  28959. googleapi.ServerResponse `json:"-"`
  28960. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  28961. // unconditionally include in API requests. By default, fields with
  28962. // empty values are omitted from API requests. However, any non-pointer,
  28963. // non-interface field appearing in ForceSendFields will be sent to the
  28964. // server regardless of whether the field is empty or not. This may be
  28965. // used to include empty fields in Patch requests.
  28966. ForceSendFields []string `json:"-"`
  28967. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  28968. // in API requests with the JSON null value. By default, fields with
  28969. // empty values are omitted from API requests. However, any field with
  28970. // an empty value appearing in NullFields will be sent to the server as
  28971. // null. It is an error if a field in this list has a non-empty value.
  28972. // This may be used to include null fields in Patch requests.
  28973. NullFields []string `json:"-"`
  28974. }
  28975. func (s *ShieldedInstanceIdentity) MarshalJSON() ([]byte, error) {
  28976. type NoMethod ShieldedInstanceIdentity
  28977. raw := NoMethod(*s)
  28978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  28979. }
  28980. // ShieldedInstanceIdentityEntry: A Shielded Instance Identity Entry.
  28981. type ShieldedInstanceIdentityEntry struct {
  28982. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  28983. EkCert string `json:"ekCert,omitempty"`
  28984. // EkPub: A PEM-encoded public key.
  28985. EkPub string `json:"ekPub,omitempty"`
  28986. // ForceSendFields is a list of field names (e.g. "EkCert") to
  28987. // unconditionally include in API requests. By default, fields with
  28988. // empty values are omitted from API requests. However, any non-pointer,
  28989. // non-interface field appearing in ForceSendFields will be sent to the
  28990. // server regardless of whether the field is empty or not. This may be
  28991. // used to include empty fields in Patch requests.
  28992. ForceSendFields []string `json:"-"`
  28993. // NullFields is a list of field names (e.g. "EkCert") to include in API
  28994. // requests with the JSON null value. By default, fields with empty
  28995. // values are omitted from API requests. However, any field with an
  28996. // empty value appearing in NullFields will be sent to the server as
  28997. // null. It is an error if a field in this list has a non-empty value.
  28998. // This may be used to include null fields in Patch requests.
  28999. NullFields []string `json:"-"`
  29000. }
  29001. func (s *ShieldedInstanceIdentityEntry) MarshalJSON() ([]byte, error) {
  29002. type NoMethod ShieldedInstanceIdentityEntry
  29003. raw := NoMethod(*s)
  29004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29005. }
  29006. // ShieldedInstanceIntegrityPolicy: The policy describes the baseline
  29007. // against which Instance boot integrity is measured.
  29008. type ShieldedInstanceIntegrityPolicy struct {
  29009. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  29010. // the measurements from the VM instance's most recent boot.
  29011. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  29012. // ForceSendFields is a list of field names (e.g.
  29013. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  29014. // By default, fields with empty values are omitted from API requests.
  29015. // However, any non-pointer, non-interface field appearing in
  29016. // ForceSendFields will be sent to the server regardless of whether the
  29017. // field is empty or not. This may be used to include empty fields in
  29018. // Patch requests.
  29019. ForceSendFields []string `json:"-"`
  29020. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  29021. // include in API requests with the JSON null value. By default, fields
  29022. // with empty values are omitted from API requests. However, any field
  29023. // with an empty value appearing in NullFields will be sent to the
  29024. // server as null. It is an error if a field in this list has a
  29025. // non-empty value. This may be used to include null fields in Patch
  29026. // requests.
  29027. NullFields []string `json:"-"`
  29028. }
  29029. func (s *ShieldedInstanceIntegrityPolicy) MarshalJSON() ([]byte, error) {
  29030. type NoMethod ShieldedInstanceIntegrityPolicy
  29031. raw := NoMethod(*s)
  29032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29033. }
  29034. // ShieldedVmConfig: A set of Shielded VM options.
  29035. type ShieldedVmConfig struct {
  29036. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  29037. // monitoring enabled.
  29038. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  29039. // EnableSecureBoot: Defines whether the instance has Secure Boot
  29040. // enabled.
  29041. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  29042. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  29043. EnableVtpm bool `json:"enableVtpm,omitempty"`
  29044. // ForceSendFields is a list of field names (e.g.
  29045. // "EnableIntegrityMonitoring") to unconditionally include in API
  29046. // requests. By default, fields with empty values are omitted from API
  29047. // requests. However, any non-pointer, non-interface field appearing in
  29048. // ForceSendFields will be sent to the server regardless of whether the
  29049. // field is empty or not. This may be used to include empty fields in
  29050. // Patch requests.
  29051. ForceSendFields []string `json:"-"`
  29052. // NullFields is a list of field names (e.g.
  29053. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  29054. // null value. By default, fields with empty values are omitted from API
  29055. // requests. However, any field with an empty value appearing in
  29056. // NullFields will be sent to the server as null. It is an error if a
  29057. // field in this list has a non-empty value. This may be used to include
  29058. // null fields in Patch requests.
  29059. NullFields []string `json:"-"`
  29060. }
  29061. func (s *ShieldedVmConfig) MarshalJSON() ([]byte, error) {
  29062. type NoMethod ShieldedVmConfig
  29063. raw := NoMethod(*s)
  29064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29065. }
  29066. // ShieldedVmIdentity: A shielded VM identity entry.
  29067. type ShieldedVmIdentity struct {
  29068. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded VM's
  29069. // vTPM.
  29070. EncryptionKey *ShieldedVmIdentityEntry `json:"encryptionKey,omitempty"`
  29071. // Kind: [Output Only] Type of the resource. Always
  29072. // compute#shieldedVmIdentity for shielded VM identity entry.
  29073. Kind string `json:"kind,omitempty"`
  29074. // SigningKey: An Attestation Key (AK) issued to the Shielded VM's vTPM.
  29075. SigningKey *ShieldedVmIdentityEntry `json:"signingKey,omitempty"`
  29076. // ServerResponse contains the HTTP response code and headers from the
  29077. // server.
  29078. googleapi.ServerResponse `json:"-"`
  29079. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  29080. // unconditionally include in API requests. By default, fields with
  29081. // empty values are omitted from API requests. However, any non-pointer,
  29082. // non-interface field appearing in ForceSendFields will be sent to the
  29083. // server regardless of whether the field is empty or not. This may be
  29084. // used to include empty fields in Patch requests.
  29085. ForceSendFields []string `json:"-"`
  29086. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  29087. // in API requests with the JSON null value. By default, fields with
  29088. // empty values are omitted from API requests. However, any field with
  29089. // an empty value appearing in NullFields will be sent to the server as
  29090. // null. It is an error if a field in this list has a non-empty value.
  29091. // This may be used to include null fields in Patch requests.
  29092. NullFields []string `json:"-"`
  29093. }
  29094. func (s *ShieldedVmIdentity) MarshalJSON() ([]byte, error) {
  29095. type NoMethod ShieldedVmIdentity
  29096. raw := NoMethod(*s)
  29097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29098. }
  29099. // ShieldedVmIdentityEntry: A Shielded Instance Identity Entry.
  29100. type ShieldedVmIdentityEntry struct {
  29101. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  29102. EkCert string `json:"ekCert,omitempty"`
  29103. // EkPub: A PEM-encoded public key.
  29104. EkPub string `json:"ekPub,omitempty"`
  29105. // ForceSendFields is a list of field names (e.g. "EkCert") to
  29106. // unconditionally include in API requests. By default, fields with
  29107. // empty values are omitted from API requests. However, any non-pointer,
  29108. // non-interface field appearing in ForceSendFields will be sent to the
  29109. // server regardless of whether the field is empty or not. This may be
  29110. // used to include empty fields in Patch requests.
  29111. ForceSendFields []string `json:"-"`
  29112. // NullFields is a list of field names (e.g. "EkCert") to include in API
  29113. // requests with the JSON null value. By default, fields with empty
  29114. // values are omitted from API requests. However, any field with an
  29115. // empty value appearing in NullFields will be sent to the server as
  29116. // null. It is an error if a field in this list has a non-empty value.
  29117. // This may be used to include null fields in Patch requests.
  29118. NullFields []string `json:"-"`
  29119. }
  29120. func (s *ShieldedVmIdentityEntry) MarshalJSON() ([]byte, error) {
  29121. type NoMethod ShieldedVmIdentityEntry
  29122. raw := NoMethod(*s)
  29123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29124. }
  29125. // ShieldedVmIntegrityPolicy: The policy describes the baseline against
  29126. // which VM instance boot integrity is measured.
  29127. type ShieldedVmIntegrityPolicy struct {
  29128. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  29129. // the measurements from the VM instance's most recent boot.
  29130. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  29131. // ForceSendFields is a list of field names (e.g.
  29132. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  29133. // By default, fields with empty values are omitted from API requests.
  29134. // However, any non-pointer, non-interface field appearing in
  29135. // ForceSendFields will be sent to the server regardless of whether the
  29136. // field is empty or not. This may be used to include empty fields in
  29137. // Patch requests.
  29138. ForceSendFields []string `json:"-"`
  29139. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  29140. // include in API requests with the JSON null value. By default, fields
  29141. // with empty values are omitted from API requests. However, any field
  29142. // with an empty value appearing in NullFields will be sent to the
  29143. // server as null. It is an error if a field in this list has a
  29144. // non-empty value. This may be used to include null fields in Patch
  29145. // requests.
  29146. NullFields []string `json:"-"`
  29147. }
  29148. func (s *ShieldedVmIntegrityPolicy) MarshalJSON() ([]byte, error) {
  29149. type NoMethod ShieldedVmIntegrityPolicy
  29150. raw := NoMethod(*s)
  29151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29152. }
  29153. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  29154. // Cloud CDN Signed URLs
  29155. type SignedUrlKey struct {
  29156. // KeyName: Name of the key. The name must be 1-63 characters long, and
  29157. // comply with RFC1035. Specifically, the name must be 1-63 characters
  29158. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  29159. // which means the first character must be a lowercase letter, and all
  29160. // following characters must be a dash, lowercase letter, or digit,
  29161. // except the last character, which cannot be a dash.
  29162. KeyName string `json:"keyName,omitempty"`
  29163. // KeyValue: 128-bit key value used for signing the URL. The key value
  29164. // must be a valid RFC 4648 Section 5 base64url encoded string.
  29165. KeyValue string `json:"keyValue,omitempty"`
  29166. // ForceSendFields is a list of field names (e.g. "KeyName") to
  29167. // unconditionally include in API requests. By default, fields with
  29168. // empty values are omitted from API requests. However, any non-pointer,
  29169. // non-interface field appearing in ForceSendFields will be sent to the
  29170. // server regardless of whether the field is empty or not. This may be
  29171. // used to include empty fields in Patch requests.
  29172. ForceSendFields []string `json:"-"`
  29173. // NullFields is a list of field names (e.g. "KeyName") to include in
  29174. // API requests with the JSON null value. By default, fields with empty
  29175. // values are omitted from API requests. However, any field with an
  29176. // empty value appearing in NullFields will be sent to the server as
  29177. // null. It is an error if a field in this list has a non-empty value.
  29178. // This may be used to include null fields in Patch requests.
  29179. NullFields []string `json:"-"`
  29180. }
  29181. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  29182. type NoMethod SignedUrlKey
  29183. raw := NoMethod(*s)
  29184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29185. }
  29186. // Snapshot: A persistent disk snapshot resource. (== resource_for
  29187. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  29188. type Snapshot struct {
  29189. // AutoCreated: [Output Only] Set to true if snapshots are automatically
  29190. // by applying resource policy on the target disk.
  29191. AutoCreated bool `json:"autoCreated,omitempty"`
  29192. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29193. // format.
  29194. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29195. // Description: An optional description of this resource. Provide this
  29196. // property when you create the resource.
  29197. Description string `json:"description,omitempty"`
  29198. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  29199. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  29200. // GuestOsFeatures: [Output Only] A list of features to enable on the
  29201. // guest operating system. Applicable only for bootable images. Read
  29202. // Enabling guest operating system features to see a list of available
  29203. // options.
  29204. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  29205. // Id: [Output Only] The unique identifier for the resource. This
  29206. // identifier is defined by the server.
  29207. Id uint64 `json:"id,omitempty,string"`
  29208. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  29209. // Snapshot resources.
  29210. Kind string `json:"kind,omitempty"`
  29211. // LabelFingerprint: A fingerprint for the labels being applied to this
  29212. // snapshot, which is essentially a hash of the labels set used for
  29213. // optimistic locking. The fingerprint is initially generated by Compute
  29214. // Engine and changes after every request to modify or update labels.
  29215. // You must always provide an up-to-date fingerprint hash in order to
  29216. // update or change labels, otherwise the request will fail with error
  29217. // 412 conditionNotMet.
  29218. //
  29219. // To see the latest fingerprint, make a get() request to retrieve a
  29220. // snapshot.
  29221. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  29222. // Labels: Labels to apply to this snapshot. These can be later modified
  29223. // by the setLabels method. Label values may be empty.
  29224. Labels map[string]string `json:"labels,omitempty"`
  29225. // LicenseCodes: [Output Only] Integer license codes indicating which
  29226. // licenses are attached to this snapshot.
  29227. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  29228. // Licenses: [Output Only] A list of public visible licenses that apply
  29229. // to this snapshot. This can be because the original image had licenses
  29230. // attached (such as a Windows image).
  29231. Licenses []string `json:"licenses,omitempty"`
  29232. // Name: Name of the resource; provided by the client when the resource
  29233. // is created. The name must be 1-63 characters long, and comply with
  29234. // RFC1035. Specifically, the name must be 1-63 characters long and
  29235. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  29236. // the first character must be a lowercase letter, and all following
  29237. // characters must be a dash, lowercase letter, or digit, except the
  29238. // last character, which cannot be a dash.
  29239. Name string `json:"name,omitempty"`
  29240. // SelfLink: [Output Only] Server-defined URL for the resource.
  29241. SelfLink string `json:"selfLink,omitempty"`
  29242. // SelfLinkWithId: [Output Only] Server-defined URL for this resource's
  29243. // resource id.
  29244. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  29245. // SnapshotEncryptionKey: Encrypts the snapshot using a
  29246. // customer-supplied encryption key.
  29247. //
  29248. // After you encrypt a snapshot using a customer-supplied key, you must
  29249. // provide the same key if you use the image later For example, you must
  29250. // provide the encryption key when you create a disk from the encrypted
  29251. // snapshot in a future request.
  29252. //
  29253. // Customer-supplied encryption keys do not protect access to metadata
  29254. // of the disk.
  29255. //
  29256. // If you do not provide an encryption key when creating the snapshot,
  29257. // then the snapshot will be encrypted using an automatically generated
  29258. // key and you do not need to provide a key to use the snapshot later.
  29259. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  29260. // SourceDisk: [Output Only] The source disk used to create this
  29261. // snapshot.
  29262. SourceDisk string `json:"sourceDisk,omitempty"`
  29263. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  29264. // source disk. Required if the source disk is protected by a
  29265. // customer-supplied encryption key.
  29266. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  29267. // SourceDiskId: [Output Only] The ID value of the disk used to create
  29268. // this snapshot. This value may be used to determine whether the
  29269. // snapshot was taken from the current or a previous instance of a given
  29270. // disk name.
  29271. SourceDiskId string `json:"sourceDiskId,omitempty"`
  29272. // Status: [Output Only] The status of the snapshot. This can be
  29273. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  29274. //
  29275. // Possible values:
  29276. // "CREATING"
  29277. // "DELETING"
  29278. // "FAILED"
  29279. // "READY"
  29280. // "UPLOADING"
  29281. Status string `json:"status,omitempty"`
  29282. // StorageBytes: [Output Only] A size of the storage used by the
  29283. // snapshot. As snapshots share storage, this number is expected to
  29284. // change with snapshot creation/deletion.
  29285. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  29286. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  29287. // is in a stable state or it is being adjusted as a result of shared
  29288. // storage reallocation. This status can either be UPDATING, meaning the
  29289. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  29290. // size of the snapshot is up-to-date.
  29291. //
  29292. // Possible values:
  29293. // "UPDATING"
  29294. // "UP_TO_DATE"
  29295. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  29296. // StorageLocations: GCS bucket storage location of the snapshot
  29297. // (regional or multi-regional).
  29298. StorageLocations []string `json:"storageLocations,omitempty"`
  29299. // ServerResponse contains the HTTP response code and headers from the
  29300. // server.
  29301. googleapi.ServerResponse `json:"-"`
  29302. // ForceSendFields is a list of field names (e.g. "AutoCreated") to
  29303. // unconditionally include in API requests. By default, fields with
  29304. // empty values are omitted from API requests. However, any non-pointer,
  29305. // non-interface field appearing in ForceSendFields will be sent to the
  29306. // server regardless of whether the field is empty or not. This may be
  29307. // used to include empty fields in Patch requests.
  29308. ForceSendFields []string `json:"-"`
  29309. // NullFields is a list of field names (e.g. "AutoCreated") to include
  29310. // in API requests with the JSON null value. By default, fields with
  29311. // empty values are omitted from API requests. However, any field with
  29312. // an empty value appearing in NullFields will be sent to the server as
  29313. // null. It is an error if a field in this list has a non-empty value.
  29314. // This may be used to include null fields in Patch requests.
  29315. NullFields []string `json:"-"`
  29316. }
  29317. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  29318. type NoMethod Snapshot
  29319. raw := NoMethod(*s)
  29320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29321. }
  29322. // SnapshotList: Contains a list of Snapshot resources.
  29323. type SnapshotList struct {
  29324. // Id: [Output Only] Unique identifier for the resource; defined by the
  29325. // server.
  29326. Id string `json:"id,omitempty"`
  29327. // Items: A list of Snapshot resources.
  29328. Items []*Snapshot `json:"items,omitempty"`
  29329. // Kind: Type of resource.
  29330. Kind string `json:"kind,omitempty"`
  29331. // NextPageToken: [Output Only] This token allows you to get the next
  29332. // page of results for list requests. If the number of results is larger
  29333. // than maxResults, use the nextPageToken as a value for the query
  29334. // parameter pageToken in the next list request. Subsequent list
  29335. // requests will have their own nextPageToken to continue paging through
  29336. // the results.
  29337. NextPageToken string `json:"nextPageToken,omitempty"`
  29338. // SelfLink: [Output Only] Server-defined URL for this resource.
  29339. SelfLink string `json:"selfLink,omitempty"`
  29340. // Warning: [Output Only] Informational warning message.
  29341. Warning *SnapshotListWarning `json:"warning,omitempty"`
  29342. // ServerResponse contains the HTTP response code and headers from the
  29343. // server.
  29344. googleapi.ServerResponse `json:"-"`
  29345. // ForceSendFields is a list of field names (e.g. "Id") to
  29346. // unconditionally include in API requests. By default, fields with
  29347. // empty values are omitted from API requests. However, any non-pointer,
  29348. // non-interface field appearing in ForceSendFields will be sent to the
  29349. // server regardless of whether the field is empty or not. This may be
  29350. // used to include empty fields in Patch requests.
  29351. ForceSendFields []string `json:"-"`
  29352. // NullFields is a list of field names (e.g. "Id") to include in API
  29353. // requests with the JSON null value. By default, fields with empty
  29354. // values are omitted from API requests. However, any field with an
  29355. // empty value appearing in NullFields will be sent to the server as
  29356. // null. It is an error if a field in this list has a non-empty value.
  29357. // This may be used to include null fields in Patch requests.
  29358. NullFields []string `json:"-"`
  29359. }
  29360. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  29361. type NoMethod SnapshotList
  29362. raw := NoMethod(*s)
  29363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29364. }
  29365. // SnapshotListWarning: [Output Only] Informational warning message.
  29366. type SnapshotListWarning struct {
  29367. // Code: [Output Only] A warning code, if applicable. For example,
  29368. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29369. // the response.
  29370. //
  29371. // Possible values:
  29372. // "CLEANUP_FAILED"
  29373. // "DEPRECATED_RESOURCE_USED"
  29374. // "DEPRECATED_TYPE_USED"
  29375. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29376. // "EXPERIMENTAL_TYPE_USED"
  29377. // "EXTERNAL_API_WARNING"
  29378. // "FIELD_VALUE_OVERRIDEN"
  29379. // "INJECTED_KERNELS_DEPRECATED"
  29380. // "MISSING_TYPE_DEPENDENCY"
  29381. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29382. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29383. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29384. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29385. // "NEXT_HOP_NOT_RUNNING"
  29386. // "NOT_CRITICAL_ERROR"
  29387. // "NO_RESULTS_ON_PAGE"
  29388. // "REQUIRED_TOS_AGREEMENT"
  29389. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29390. // "RESOURCE_NOT_DELETED"
  29391. // "SCHEMA_VALIDATION_IGNORED"
  29392. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29393. // "UNDECLARED_PROPERTIES"
  29394. // "UNREACHABLE"
  29395. Code string `json:"code,omitempty"`
  29396. // Data: [Output Only] Metadata about this warning in key: value format.
  29397. // For example:
  29398. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29399. Data []*SnapshotListWarningData `json:"data,omitempty"`
  29400. // Message: [Output Only] A human-readable description of the warning
  29401. // code.
  29402. Message string `json:"message,omitempty"`
  29403. // ForceSendFields is a list of field names (e.g. "Code") to
  29404. // unconditionally include in API requests. By default, fields with
  29405. // empty values are omitted from API requests. However, any non-pointer,
  29406. // non-interface field appearing in ForceSendFields will be sent to the
  29407. // server regardless of whether the field is empty or not. This may be
  29408. // used to include empty fields in Patch requests.
  29409. ForceSendFields []string `json:"-"`
  29410. // NullFields is a list of field names (e.g. "Code") to include in API
  29411. // requests with the JSON null value. By default, fields with empty
  29412. // values are omitted from API requests. However, any field with an
  29413. // empty value appearing in NullFields will be sent to the server as
  29414. // null. It is an error if a field in this list has a non-empty value.
  29415. // This may be used to include null fields in Patch requests.
  29416. NullFields []string `json:"-"`
  29417. }
  29418. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  29419. type NoMethod SnapshotListWarning
  29420. raw := NoMethod(*s)
  29421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29422. }
  29423. type SnapshotListWarningData struct {
  29424. // Key: [Output Only] A key that provides more detail on the warning
  29425. // being returned. For example, for warnings where there are no results
  29426. // in a list request for a particular zone, this key might be scope and
  29427. // the key value might be the zone name. Other examples might be a key
  29428. // indicating a deprecated resource and a suggested replacement, or a
  29429. // warning about invalid network settings (for example, if an instance
  29430. // attempts to perform IP forwarding but is not enabled for IP
  29431. // forwarding).
  29432. Key string `json:"key,omitempty"`
  29433. // Value: [Output Only] A warning data value corresponding to the key.
  29434. Value string `json:"value,omitempty"`
  29435. // ForceSendFields is a list of field names (e.g. "Key") to
  29436. // unconditionally include in API requests. By default, fields with
  29437. // empty values are omitted from API requests. However, any non-pointer,
  29438. // non-interface field appearing in ForceSendFields will be sent to the
  29439. // server regardless of whether the field is empty or not. This may be
  29440. // used to include empty fields in Patch requests.
  29441. ForceSendFields []string `json:"-"`
  29442. // NullFields is a list of field names (e.g. "Key") to include in API
  29443. // requests with the JSON null value. By default, fields with empty
  29444. // values are omitted from API requests. However, any field with an
  29445. // empty value appearing in NullFields will be sent to the server as
  29446. // null. It is an error if a field in this list has a non-empty value.
  29447. // This may be used to include null fields in Patch requests.
  29448. NullFields []string `json:"-"`
  29449. }
  29450. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  29451. type NoMethod SnapshotListWarningData
  29452. raw := NoMethod(*s)
  29453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29454. }
  29455. // SourceInstanceParams: A specification of the parameters to use when
  29456. // creating the instance template from a source instance.
  29457. type SourceInstanceParams struct {
  29458. // DiskConfigs: Attached disks configuration. If not provided, defaults
  29459. // are applied: For boot disk and any other R/W disks, new custom images
  29460. // will be created from each disk. For read-only disks, they will be
  29461. // attached in read-only mode. Local SSD disks will be created as blank
  29462. // volumes.
  29463. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  29464. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  29465. // unconditionally include in API requests. By default, fields with
  29466. // empty values are omitted from API requests. However, any non-pointer,
  29467. // non-interface field appearing in ForceSendFields will be sent to the
  29468. // server regardless of whether the field is empty or not. This may be
  29469. // used to include empty fields in Patch requests.
  29470. ForceSendFields []string `json:"-"`
  29471. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  29472. // in API requests with the JSON null value. By default, fields with
  29473. // empty values are omitted from API requests. However, any field with
  29474. // an empty value appearing in NullFields will be sent to the server as
  29475. // null. It is an error if a field in this list has a non-empty value.
  29476. // This may be used to include null fields in Patch requests.
  29477. NullFields []string `json:"-"`
  29478. }
  29479. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  29480. type NoMethod SourceInstanceParams
  29481. raw := NoMethod(*s)
  29482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29483. }
  29484. type SourceInstanceProperties struct {
  29485. // CanIpForward: Enables instances created based on this machine image
  29486. // to send packets with source IP addresses other than their own and
  29487. // receive packets with destination IP addresses other than their own.
  29488. // If these instances will be used as an IP gateway or it will be set as
  29489. // the next-hop in a Route resource, specify true. If unsure, leave this
  29490. // set to false. See the Enable IP forwarding documentation for more
  29491. // information.
  29492. CanIpForward bool `json:"canIpForward,omitempty"`
  29493. // DeletionProtection: Whether the instance created from the machine
  29494. // image should be protected against deletion.
  29495. DeletionProtection bool `json:"deletionProtection,omitempty"`
  29496. // Description: An optional text description for the instances that are
  29497. // created from this machine image.
  29498. Description string `json:"description,omitempty"`
  29499. // Disks: An array of disks that are associated with the instances that
  29500. // are created from this machine image.
  29501. Disks []*SavedAttachedDisk `json:"disks,omitempty"`
  29502. // GuestAccelerators: A list of guest accelerator cards' type and count
  29503. // to use for instances created from the machine image.
  29504. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  29505. // Labels: Labels to apply to instances that are created from this
  29506. // machine image.
  29507. Labels map[string]string `json:"labels,omitempty"`
  29508. // MachineType: The machine type to use for instances that are created
  29509. // from this machine image.
  29510. MachineType string `json:"machineType,omitempty"`
  29511. // Metadata: The metadata key/value pairs to assign to instances that
  29512. // are created from this machine image. These pairs can consist of
  29513. // custom metadata or predefined keys. See Project and instance metadata
  29514. // for more information.
  29515. Metadata *Metadata `json:"metadata,omitempty"`
  29516. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  29517. // instance may be scheduled on the specified or newer cpu/platform.
  29518. // Applicable values are the friendly names of CPU platforms, such as
  29519. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  29520. // Bridge". For more information, read Specifying a Minimum CPU
  29521. // Platform.
  29522. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  29523. // NetworkInterfaces: An array of network access configurations for this
  29524. // interface.
  29525. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  29526. // Scheduling: Specifies the scheduling options for the instances that
  29527. // are created from this machine image.
  29528. Scheduling *Scheduling `json:"scheduling,omitempty"`
  29529. // ServiceAccounts: A list of service accounts with specified scopes.
  29530. // Access tokens for these service accounts are available to the
  29531. // instances that are created from this machine image. Use metadata
  29532. // queries to obtain the access tokens for these instances.
  29533. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  29534. // Tags: A list of tags to apply to the instances that are created from
  29535. // this machine image. The tags identify valid sources or targets for
  29536. // network firewalls. The setTags method can modify this list of tags.
  29537. // Each tag within the list must comply with RFC1035.
  29538. Tags *Tags `json:"tags,omitempty"`
  29539. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  29540. // unconditionally include in API requests. By default, fields with
  29541. // empty values are omitted from API requests. However, any non-pointer,
  29542. // non-interface field appearing in ForceSendFields will be sent to the
  29543. // server regardless of whether the field is empty or not. This may be
  29544. // used to include empty fields in Patch requests.
  29545. ForceSendFields []string `json:"-"`
  29546. // NullFields is a list of field names (e.g. "CanIpForward") to include
  29547. // in API requests with the JSON null value. By default, fields with
  29548. // empty values are omitted from API requests. However, any field with
  29549. // an empty value appearing in NullFields will be sent to the server as
  29550. // null. It is an error if a field in this list has a non-empty value.
  29551. // This may be used to include null fields in Patch requests.
  29552. NullFields []string `json:"-"`
  29553. }
  29554. func (s *SourceInstanceProperties) MarshalJSON() ([]byte, error) {
  29555. type NoMethod SourceInstanceProperties
  29556. raw := NoMethod(*s)
  29557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29558. }
  29559. // SslCertificate: An SslCertificate resource. This resource provides a
  29560. // mechanism to upload an SSL key and certificate to the load balancer
  29561. // to serve secure connections from the user. (== resource_for
  29562. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  29563. type SslCertificate struct {
  29564. // Certificate: A local certificate file. The certificate must be in PEM
  29565. // format. The certificate chain must be no greater than 5 certs long.
  29566. // The chain must include at least one intermediate cert.
  29567. Certificate string `json:"certificate,omitempty"`
  29568. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  29569. // format.
  29570. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  29571. // Description: An optional description of this resource. Provide this
  29572. // property when you create the resource.
  29573. Description string `json:"description,omitempty"`
  29574. // ExpireTime: [Output Only] Expire time of the certificate. RFC3339
  29575. ExpireTime string `json:"expireTime,omitempty"`
  29576. // Id: [Output Only] The unique identifier for the resource. This
  29577. // identifier is defined by the server.
  29578. Id uint64 `json:"id,omitempty,string"`
  29579. // Kind: [Output Only] Type of the resource. Always
  29580. // compute#sslCertificate for SSL certificates.
  29581. Kind string `json:"kind,omitempty"`
  29582. // Managed: Configuration and status of a managed SSL certificate.
  29583. Managed *SslCertificateManagedSslCertificate `json:"managed,omitempty"`
  29584. // Name: Name of the resource. Provided by the client when the resource
  29585. // is created. The name must be 1-63 characters long, and comply with
  29586. // RFC1035. Specifically, the name must be 1-63 characters long and
  29587. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  29588. // the first character must be a lowercase letter, and all following
  29589. // characters must be a dash, lowercase letter, or digit, except the
  29590. // last character, which cannot be a dash.
  29591. Name string `json:"name,omitempty"`
  29592. // PrivateKey: A write-only private key in PEM format. Only insert
  29593. // requests will include this field.
  29594. PrivateKey string `json:"privateKey,omitempty"`
  29595. // Region: [Output Only] URL of the region where the regional SSL
  29596. // Certificate resides. This field is not applicable to global SSL
  29597. // Certificate.
  29598. Region string `json:"region,omitempty"`
  29599. // SelfLink: [Output only] Server-defined URL for the resource.
  29600. SelfLink string `json:"selfLink,omitempty"`
  29601. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  29602. // with the resource id.
  29603. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  29604. // SelfManaged: Configuration and status of a self-managed SSL
  29605. // certificate.
  29606. SelfManaged *SslCertificateSelfManagedSslCertificate `json:"selfManaged,omitempty"`
  29607. // SubjectAlternativeNames: [Output Only] Domains associated with the
  29608. // certificate via Subject Alternative Name.
  29609. SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`
  29610. // Type: (Optional) Specifies the type of SSL certificate, either
  29611. // "SELF_MANAGED" or "MANAGED". If not specified, the certificate is
  29612. // self-managed and the fields certificate and private_key are used.
  29613. //
  29614. // Possible values:
  29615. // "MANAGED"
  29616. // "SELF_MANAGED"
  29617. // "TYPE_UNSPECIFIED"
  29618. Type string `json:"type,omitempty"`
  29619. // ServerResponse contains the HTTP response code and headers from the
  29620. // server.
  29621. googleapi.ServerResponse `json:"-"`
  29622. // ForceSendFields is a list of field names (e.g. "Certificate") to
  29623. // unconditionally include in API requests. By default, fields with
  29624. // empty values are omitted from API requests. However, any non-pointer,
  29625. // non-interface field appearing in ForceSendFields will be sent to the
  29626. // server regardless of whether the field is empty or not. This may be
  29627. // used to include empty fields in Patch requests.
  29628. ForceSendFields []string `json:"-"`
  29629. // NullFields is a list of field names (e.g. "Certificate") to include
  29630. // in API requests with the JSON null value. By default, fields with
  29631. // empty values are omitted from API requests. However, any field with
  29632. // an empty value appearing in NullFields will be sent to the server as
  29633. // null. It is an error if a field in this list has a non-empty value.
  29634. // This may be used to include null fields in Patch requests.
  29635. NullFields []string `json:"-"`
  29636. }
  29637. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  29638. type NoMethod SslCertificate
  29639. raw := NoMethod(*s)
  29640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29641. }
  29642. type SslCertificateAggregatedList struct {
  29643. // Id: [Output Only] Unique identifier for the resource; defined by the
  29644. // server.
  29645. Id string `json:"id,omitempty"`
  29646. // Items: A list of SslCertificatesScopedList resources.
  29647. Items map[string]SslCertificatesScopedList `json:"items,omitempty"`
  29648. // Kind: [Output Only] Type of resource. Always
  29649. // compute#sslCertificateAggregatedList for lists of SSL Certificates.
  29650. Kind string `json:"kind,omitempty"`
  29651. // NextPageToken: [Output Only] This token allows you to get the next
  29652. // page of results for list requests. If the number of results is larger
  29653. // than maxResults, use the nextPageToken as a value for the query
  29654. // parameter pageToken in the next list request. Subsequent list
  29655. // requests will have their own nextPageToken to continue paging through
  29656. // the results.
  29657. NextPageToken string `json:"nextPageToken,omitempty"`
  29658. // SelfLink: [Output Only] Server-defined URL for this resource.
  29659. SelfLink string `json:"selfLink,omitempty"`
  29660. // Warning: [Output Only] Informational warning message.
  29661. Warning *SslCertificateAggregatedListWarning `json:"warning,omitempty"`
  29662. // ServerResponse contains the HTTP response code and headers from the
  29663. // server.
  29664. googleapi.ServerResponse `json:"-"`
  29665. // ForceSendFields is a list of field names (e.g. "Id") to
  29666. // unconditionally include in API requests. By default, fields with
  29667. // empty values are omitted from API requests. However, any non-pointer,
  29668. // non-interface field appearing in ForceSendFields will be sent to the
  29669. // server regardless of whether the field is empty or not. This may be
  29670. // used to include empty fields in Patch requests.
  29671. ForceSendFields []string `json:"-"`
  29672. // NullFields is a list of field names (e.g. "Id") to include in API
  29673. // requests with the JSON null value. By default, fields with empty
  29674. // values are omitted from API requests. However, any field with an
  29675. // empty value appearing in NullFields will be sent to the server as
  29676. // null. It is an error if a field in this list has a non-empty value.
  29677. // This may be used to include null fields in Patch requests.
  29678. NullFields []string `json:"-"`
  29679. }
  29680. func (s *SslCertificateAggregatedList) MarshalJSON() ([]byte, error) {
  29681. type NoMethod SslCertificateAggregatedList
  29682. raw := NoMethod(*s)
  29683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29684. }
  29685. // SslCertificateAggregatedListWarning: [Output Only] Informational
  29686. // warning message.
  29687. type SslCertificateAggregatedListWarning struct {
  29688. // Code: [Output Only] A warning code, if applicable. For example,
  29689. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29690. // the response.
  29691. //
  29692. // Possible values:
  29693. // "CLEANUP_FAILED"
  29694. // "DEPRECATED_RESOURCE_USED"
  29695. // "DEPRECATED_TYPE_USED"
  29696. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29697. // "EXPERIMENTAL_TYPE_USED"
  29698. // "EXTERNAL_API_WARNING"
  29699. // "FIELD_VALUE_OVERRIDEN"
  29700. // "INJECTED_KERNELS_DEPRECATED"
  29701. // "MISSING_TYPE_DEPENDENCY"
  29702. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29703. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29704. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29705. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29706. // "NEXT_HOP_NOT_RUNNING"
  29707. // "NOT_CRITICAL_ERROR"
  29708. // "NO_RESULTS_ON_PAGE"
  29709. // "REQUIRED_TOS_AGREEMENT"
  29710. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29711. // "RESOURCE_NOT_DELETED"
  29712. // "SCHEMA_VALIDATION_IGNORED"
  29713. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29714. // "UNDECLARED_PROPERTIES"
  29715. // "UNREACHABLE"
  29716. Code string `json:"code,omitempty"`
  29717. // Data: [Output Only] Metadata about this warning in key: value format.
  29718. // For example:
  29719. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29720. Data []*SslCertificateAggregatedListWarningData `json:"data,omitempty"`
  29721. // Message: [Output Only] A human-readable description of the warning
  29722. // code.
  29723. Message string `json:"message,omitempty"`
  29724. // ForceSendFields is a list of field names (e.g. "Code") to
  29725. // unconditionally include in API requests. By default, fields with
  29726. // empty values are omitted from API requests. However, any non-pointer,
  29727. // non-interface field appearing in ForceSendFields will be sent to the
  29728. // server regardless of whether the field is empty or not. This may be
  29729. // used to include empty fields in Patch requests.
  29730. ForceSendFields []string `json:"-"`
  29731. // NullFields is a list of field names (e.g. "Code") to include in API
  29732. // requests with the JSON null value. By default, fields with empty
  29733. // values are omitted from API requests. However, any field with an
  29734. // empty value appearing in NullFields will be sent to the server as
  29735. // null. It is an error if a field in this list has a non-empty value.
  29736. // This may be used to include null fields in Patch requests.
  29737. NullFields []string `json:"-"`
  29738. }
  29739. func (s *SslCertificateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  29740. type NoMethod SslCertificateAggregatedListWarning
  29741. raw := NoMethod(*s)
  29742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29743. }
  29744. type SslCertificateAggregatedListWarningData struct {
  29745. // Key: [Output Only] A key that provides more detail on the warning
  29746. // being returned. For example, for warnings where there are no results
  29747. // in a list request for a particular zone, this key might be scope and
  29748. // the key value might be the zone name. Other examples might be a key
  29749. // indicating a deprecated resource and a suggested replacement, or a
  29750. // warning about invalid network settings (for example, if an instance
  29751. // attempts to perform IP forwarding but is not enabled for IP
  29752. // forwarding).
  29753. Key string `json:"key,omitempty"`
  29754. // Value: [Output Only] A warning data value corresponding to the key.
  29755. Value string `json:"value,omitempty"`
  29756. // ForceSendFields is a list of field names (e.g. "Key") to
  29757. // unconditionally include in API requests. By default, fields with
  29758. // empty values are omitted from API requests. However, any non-pointer,
  29759. // non-interface field appearing in ForceSendFields will be sent to the
  29760. // server regardless of whether the field is empty or not. This may be
  29761. // used to include empty fields in Patch requests.
  29762. ForceSendFields []string `json:"-"`
  29763. // NullFields is a list of field names (e.g. "Key") to include in API
  29764. // requests with the JSON null value. By default, fields with empty
  29765. // values are omitted from API requests. However, any field with an
  29766. // empty value appearing in NullFields will be sent to the server as
  29767. // null. It is an error if a field in this list has a non-empty value.
  29768. // This may be used to include null fields in Patch requests.
  29769. NullFields []string `json:"-"`
  29770. }
  29771. func (s *SslCertificateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  29772. type NoMethod SslCertificateAggregatedListWarningData
  29773. raw := NoMethod(*s)
  29774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29775. }
  29776. // SslCertificateList: Contains a list of SslCertificate resources.
  29777. type SslCertificateList struct {
  29778. // Id: [Output Only] Unique identifier for the resource; defined by the
  29779. // server.
  29780. Id string `json:"id,omitempty"`
  29781. // Items: A list of SslCertificate resources.
  29782. Items []*SslCertificate `json:"items,omitempty"`
  29783. // Kind: Type of resource.
  29784. Kind string `json:"kind,omitempty"`
  29785. // NextPageToken: [Output Only] This token allows you to get the next
  29786. // page of results for list requests. If the number of results is larger
  29787. // than maxResults, use the nextPageToken as a value for the query
  29788. // parameter pageToken in the next list request. Subsequent list
  29789. // requests will have their own nextPageToken to continue paging through
  29790. // the results.
  29791. NextPageToken string `json:"nextPageToken,omitempty"`
  29792. // SelfLink: [Output Only] Server-defined URL for this resource.
  29793. SelfLink string `json:"selfLink,omitempty"`
  29794. // Warning: [Output Only] Informational warning message.
  29795. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  29796. // ServerResponse contains the HTTP response code and headers from the
  29797. // server.
  29798. googleapi.ServerResponse `json:"-"`
  29799. // ForceSendFields is a list of field names (e.g. "Id") to
  29800. // unconditionally include in API requests. By default, fields with
  29801. // empty values are omitted from API requests. However, any non-pointer,
  29802. // non-interface field appearing in ForceSendFields will be sent to the
  29803. // server regardless of whether the field is empty or not. This may be
  29804. // used to include empty fields in Patch requests.
  29805. ForceSendFields []string `json:"-"`
  29806. // NullFields is a list of field names (e.g. "Id") to include in API
  29807. // requests with the JSON null value. By default, fields with empty
  29808. // values are omitted from API requests. However, any field with an
  29809. // empty value appearing in NullFields will be sent to the server as
  29810. // null. It is an error if a field in this list has a non-empty value.
  29811. // This may be used to include null fields in Patch requests.
  29812. NullFields []string `json:"-"`
  29813. }
  29814. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  29815. type NoMethod SslCertificateList
  29816. raw := NoMethod(*s)
  29817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29818. }
  29819. // SslCertificateListWarning: [Output Only] Informational warning
  29820. // message.
  29821. type SslCertificateListWarning struct {
  29822. // Code: [Output Only] A warning code, if applicable. For example,
  29823. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  29824. // the response.
  29825. //
  29826. // Possible values:
  29827. // "CLEANUP_FAILED"
  29828. // "DEPRECATED_RESOURCE_USED"
  29829. // "DEPRECATED_TYPE_USED"
  29830. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  29831. // "EXPERIMENTAL_TYPE_USED"
  29832. // "EXTERNAL_API_WARNING"
  29833. // "FIELD_VALUE_OVERRIDEN"
  29834. // "INJECTED_KERNELS_DEPRECATED"
  29835. // "MISSING_TYPE_DEPENDENCY"
  29836. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  29837. // "NEXT_HOP_CANNOT_IP_FORWARD"
  29838. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  29839. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  29840. // "NEXT_HOP_NOT_RUNNING"
  29841. // "NOT_CRITICAL_ERROR"
  29842. // "NO_RESULTS_ON_PAGE"
  29843. // "REQUIRED_TOS_AGREEMENT"
  29844. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  29845. // "RESOURCE_NOT_DELETED"
  29846. // "SCHEMA_VALIDATION_IGNORED"
  29847. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  29848. // "UNDECLARED_PROPERTIES"
  29849. // "UNREACHABLE"
  29850. Code string `json:"code,omitempty"`
  29851. // Data: [Output Only] Metadata about this warning in key: value format.
  29852. // For example:
  29853. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  29854. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  29855. // Message: [Output Only] A human-readable description of the warning
  29856. // code.
  29857. Message string `json:"message,omitempty"`
  29858. // ForceSendFields is a list of field names (e.g. "Code") to
  29859. // unconditionally include in API requests. By default, fields with
  29860. // empty values are omitted from API requests. However, any non-pointer,
  29861. // non-interface field appearing in ForceSendFields will be sent to the
  29862. // server regardless of whether the field is empty or not. This may be
  29863. // used to include empty fields in Patch requests.
  29864. ForceSendFields []string `json:"-"`
  29865. // NullFields is a list of field names (e.g. "Code") to include in API
  29866. // requests with the JSON null value. By default, fields with empty
  29867. // values are omitted from API requests. However, any field with an
  29868. // empty value appearing in NullFields will be sent to the server as
  29869. // null. It is an error if a field in this list has a non-empty value.
  29870. // This may be used to include null fields in Patch requests.
  29871. NullFields []string `json:"-"`
  29872. }
  29873. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  29874. type NoMethod SslCertificateListWarning
  29875. raw := NoMethod(*s)
  29876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29877. }
  29878. type SslCertificateListWarningData struct {
  29879. // Key: [Output Only] A key that provides more detail on the warning
  29880. // being returned. For example, for warnings where there are no results
  29881. // in a list request for a particular zone, this key might be scope and
  29882. // the key value might be the zone name. Other examples might be a key
  29883. // indicating a deprecated resource and a suggested replacement, or a
  29884. // warning about invalid network settings (for example, if an instance
  29885. // attempts to perform IP forwarding but is not enabled for IP
  29886. // forwarding).
  29887. Key string `json:"key,omitempty"`
  29888. // Value: [Output Only] A warning data value corresponding to the key.
  29889. Value string `json:"value,omitempty"`
  29890. // ForceSendFields is a list of field names (e.g. "Key") to
  29891. // unconditionally include in API requests. By default, fields with
  29892. // empty values are omitted from API requests. However, any non-pointer,
  29893. // non-interface field appearing in ForceSendFields will be sent to the
  29894. // server regardless of whether the field is empty or not. This may be
  29895. // used to include empty fields in Patch requests.
  29896. ForceSendFields []string `json:"-"`
  29897. // NullFields is a list of field names (e.g. "Key") to include in API
  29898. // requests with the JSON null value. By default, fields with empty
  29899. // values are omitted from API requests. However, any field with an
  29900. // empty value appearing in NullFields will be sent to the server as
  29901. // null. It is an error if a field in this list has a non-empty value.
  29902. // This may be used to include null fields in Patch requests.
  29903. NullFields []string `json:"-"`
  29904. }
  29905. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  29906. type NoMethod SslCertificateListWarningData
  29907. raw := NoMethod(*s)
  29908. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29909. }
  29910. // SslCertificateManagedSslCertificate: Configuration and status of a
  29911. // managed SSL certificate.
  29912. type SslCertificateManagedSslCertificate struct {
  29913. // DomainStatus: [Output only] Detailed statuses of the domains
  29914. // specified for managed certificate resource.
  29915. DomainStatus map[string]string `json:"domainStatus,omitempty"`
  29916. // Domains: The domains for which a managed SSL certificate will be
  29917. // generated. Currently only single-domain certs are supported.
  29918. Domains []string `json:"domains,omitempty"`
  29919. // Status: [Output only] Status of the managed certificate resource.
  29920. //
  29921. // Possible values:
  29922. // "ACTIVE"
  29923. // "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED"
  29924. // "PROVISIONING"
  29925. // "PROVISIONING_FAILED"
  29926. // "PROVISIONING_FAILED_PERMANENTLY"
  29927. // "RENEWAL_FAILED"
  29928. Status string `json:"status,omitempty"`
  29929. // ForceSendFields is a list of field names (e.g. "DomainStatus") to
  29930. // unconditionally include in API requests. By default, fields with
  29931. // empty values are omitted from API requests. However, any non-pointer,
  29932. // non-interface field appearing in ForceSendFields will be sent to the
  29933. // server regardless of whether the field is empty or not. This may be
  29934. // used to include empty fields in Patch requests.
  29935. ForceSendFields []string `json:"-"`
  29936. // NullFields is a list of field names (e.g. "DomainStatus") to include
  29937. // in API requests with the JSON null value. By default, fields with
  29938. // empty values are omitted from API requests. However, any field with
  29939. // an empty value appearing in NullFields will be sent to the server as
  29940. // null. It is an error if a field in this list has a non-empty value.
  29941. // This may be used to include null fields in Patch requests.
  29942. NullFields []string `json:"-"`
  29943. }
  29944. func (s *SslCertificateManagedSslCertificate) MarshalJSON() ([]byte, error) {
  29945. type NoMethod SslCertificateManagedSslCertificate
  29946. raw := NoMethod(*s)
  29947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29948. }
  29949. // SslCertificateSelfManagedSslCertificate: Configuration and status of
  29950. // a self-managed SSL certificate.
  29951. type SslCertificateSelfManagedSslCertificate struct {
  29952. // Certificate: A local certificate file. The certificate must be in PEM
  29953. // format. The certificate chain must be no greater than 5 certs long.
  29954. // The chain must include at least one intermediate cert.
  29955. Certificate string `json:"certificate,omitempty"`
  29956. // PrivateKey: A write-only private key in PEM format. Only insert
  29957. // requests will include this field.
  29958. PrivateKey string `json:"privateKey,omitempty"`
  29959. // ForceSendFields is a list of field names (e.g. "Certificate") to
  29960. // unconditionally include in API requests. By default, fields with
  29961. // empty values are omitted from API requests. However, any non-pointer,
  29962. // non-interface field appearing in ForceSendFields will be sent to the
  29963. // server regardless of whether the field is empty or not. This may be
  29964. // used to include empty fields in Patch requests.
  29965. ForceSendFields []string `json:"-"`
  29966. // NullFields is a list of field names (e.g. "Certificate") to include
  29967. // in API requests with the JSON null value. By default, fields with
  29968. // empty values are omitted from API requests. However, any field with
  29969. // an empty value appearing in NullFields will be sent to the server as
  29970. // null. It is an error if a field in this list has a non-empty value.
  29971. // This may be used to include null fields in Patch requests.
  29972. NullFields []string `json:"-"`
  29973. }
  29974. func (s *SslCertificateSelfManagedSslCertificate) MarshalJSON() ([]byte, error) {
  29975. type NoMethod SslCertificateSelfManagedSslCertificate
  29976. raw := NoMethod(*s)
  29977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  29978. }
  29979. type SslCertificatesScopedList struct {
  29980. // SslCertificates: List of SslCertificates contained in this scope.
  29981. SslCertificates []*SslCertificate `json:"sslCertificates,omitempty"`
  29982. // Warning: Informational warning which replaces the list of backend
  29983. // services when the list is empty.
  29984. Warning *SslCertificatesScopedListWarning `json:"warning,omitempty"`
  29985. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  29986. // unconditionally include in API requests. By default, fields with
  29987. // empty values are omitted from API requests. However, any non-pointer,
  29988. // non-interface field appearing in ForceSendFields will be sent to the
  29989. // server regardless of whether the field is empty or not. This may be
  29990. // used to include empty fields in Patch requests.
  29991. ForceSendFields []string `json:"-"`
  29992. // NullFields is a list of field names (e.g. "SslCertificates") to
  29993. // include in API requests with the JSON null value. By default, fields
  29994. // with empty values are omitted from API requests. However, any field
  29995. // with an empty value appearing in NullFields will be sent to the
  29996. // server as null. It is an error if a field in this list has a
  29997. // non-empty value. This may be used to include null fields in Patch
  29998. // requests.
  29999. NullFields []string `json:"-"`
  30000. }
  30001. func (s *SslCertificatesScopedList) MarshalJSON() ([]byte, error) {
  30002. type NoMethod SslCertificatesScopedList
  30003. raw := NoMethod(*s)
  30004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30005. }
  30006. // SslCertificatesScopedListWarning: Informational warning which
  30007. // replaces the list of backend services when the list is empty.
  30008. type SslCertificatesScopedListWarning struct {
  30009. // Code: [Output Only] A warning code, if applicable. For example,
  30010. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30011. // the response.
  30012. //
  30013. // Possible values:
  30014. // "CLEANUP_FAILED"
  30015. // "DEPRECATED_RESOURCE_USED"
  30016. // "DEPRECATED_TYPE_USED"
  30017. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30018. // "EXPERIMENTAL_TYPE_USED"
  30019. // "EXTERNAL_API_WARNING"
  30020. // "FIELD_VALUE_OVERRIDEN"
  30021. // "INJECTED_KERNELS_DEPRECATED"
  30022. // "MISSING_TYPE_DEPENDENCY"
  30023. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30024. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30025. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30026. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30027. // "NEXT_HOP_NOT_RUNNING"
  30028. // "NOT_CRITICAL_ERROR"
  30029. // "NO_RESULTS_ON_PAGE"
  30030. // "REQUIRED_TOS_AGREEMENT"
  30031. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30032. // "RESOURCE_NOT_DELETED"
  30033. // "SCHEMA_VALIDATION_IGNORED"
  30034. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30035. // "UNDECLARED_PROPERTIES"
  30036. // "UNREACHABLE"
  30037. Code string `json:"code,omitempty"`
  30038. // Data: [Output Only] Metadata about this warning in key: value format.
  30039. // For example:
  30040. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30041. Data []*SslCertificatesScopedListWarningData `json:"data,omitempty"`
  30042. // Message: [Output Only] A human-readable description of the warning
  30043. // code.
  30044. Message string `json:"message,omitempty"`
  30045. // ForceSendFields is a list of field names (e.g. "Code") to
  30046. // unconditionally include in API requests. By default, fields with
  30047. // empty values are omitted from API requests. However, any non-pointer,
  30048. // non-interface field appearing in ForceSendFields will be sent to the
  30049. // server regardless of whether the field is empty or not. This may be
  30050. // used to include empty fields in Patch requests.
  30051. ForceSendFields []string `json:"-"`
  30052. // NullFields is a list of field names (e.g. "Code") to include in API
  30053. // requests with the JSON null value. By default, fields with empty
  30054. // values are omitted from API requests. However, any field with an
  30055. // empty value appearing in NullFields will be sent to the server as
  30056. // null. It is an error if a field in this list has a non-empty value.
  30057. // This may be used to include null fields in Patch requests.
  30058. NullFields []string `json:"-"`
  30059. }
  30060. func (s *SslCertificatesScopedListWarning) MarshalJSON() ([]byte, error) {
  30061. type NoMethod SslCertificatesScopedListWarning
  30062. raw := NoMethod(*s)
  30063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30064. }
  30065. type SslCertificatesScopedListWarningData struct {
  30066. // Key: [Output Only] A key that provides more detail on the warning
  30067. // being returned. For example, for warnings where there are no results
  30068. // in a list request for a particular zone, this key might be scope and
  30069. // the key value might be the zone name. Other examples might be a key
  30070. // indicating a deprecated resource and a suggested replacement, or a
  30071. // warning about invalid network settings (for example, if an instance
  30072. // attempts to perform IP forwarding but is not enabled for IP
  30073. // forwarding).
  30074. Key string `json:"key,omitempty"`
  30075. // Value: [Output Only] A warning data value corresponding to the key.
  30076. Value string `json:"value,omitempty"`
  30077. // ForceSendFields is a list of field names (e.g. "Key") to
  30078. // unconditionally include in API requests. By default, fields with
  30079. // empty values are omitted from API requests. However, any non-pointer,
  30080. // non-interface field appearing in ForceSendFields will be sent to the
  30081. // server regardless of whether the field is empty or not. This may be
  30082. // used to include empty fields in Patch requests.
  30083. ForceSendFields []string `json:"-"`
  30084. // NullFields is a list of field names (e.g. "Key") to include in API
  30085. // requests with the JSON null value. By default, fields with empty
  30086. // values are omitted from API requests. However, any field with an
  30087. // empty value appearing in NullFields will be sent to the server as
  30088. // null. It is an error if a field in this list has a non-empty value.
  30089. // This may be used to include null fields in Patch requests.
  30090. NullFields []string `json:"-"`
  30091. }
  30092. func (s *SslCertificatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  30093. type NoMethod SslCertificatesScopedListWarningData
  30094. raw := NoMethod(*s)
  30095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30096. }
  30097. type SslPoliciesList struct {
  30098. // Id: [Output Only] Unique identifier for the resource; defined by the
  30099. // server.
  30100. Id string `json:"id,omitempty"`
  30101. // Items: A list of SslPolicy resources.
  30102. Items []*SslPolicy `json:"items,omitempty"`
  30103. // Kind: [Output Only] Type of the resource. Always
  30104. // compute#sslPoliciesList for lists of sslPolicies.
  30105. Kind string `json:"kind,omitempty"`
  30106. // NextPageToken: [Output Only] This token allows you to get the next
  30107. // page of results for list requests. If the number of results is larger
  30108. // than maxResults, use the nextPageToken as a value for the query
  30109. // parameter pageToken in the next list request. Subsequent list
  30110. // requests will have their own nextPageToken to continue paging through
  30111. // the results.
  30112. NextPageToken string `json:"nextPageToken,omitempty"`
  30113. // SelfLink: [Output Only] Server-defined URL for this resource.
  30114. SelfLink string `json:"selfLink,omitempty"`
  30115. // Warning: [Output Only] Informational warning message.
  30116. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  30117. // ServerResponse contains the HTTP response code and headers from the
  30118. // server.
  30119. googleapi.ServerResponse `json:"-"`
  30120. // ForceSendFields is a list of field names (e.g. "Id") to
  30121. // unconditionally include in API requests. By default, fields with
  30122. // empty values are omitted from API requests. However, any non-pointer,
  30123. // non-interface field appearing in ForceSendFields will be sent to the
  30124. // server regardless of whether the field is empty or not. This may be
  30125. // used to include empty fields in Patch requests.
  30126. ForceSendFields []string `json:"-"`
  30127. // NullFields is a list of field names (e.g. "Id") to include in API
  30128. // requests with the JSON null value. By default, fields with empty
  30129. // values are omitted from API requests. However, any field with an
  30130. // empty value appearing in NullFields will be sent to the server as
  30131. // null. It is an error if a field in this list has a non-empty value.
  30132. // This may be used to include null fields in Patch requests.
  30133. NullFields []string `json:"-"`
  30134. }
  30135. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  30136. type NoMethod SslPoliciesList
  30137. raw := NoMethod(*s)
  30138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30139. }
  30140. // SslPoliciesListWarning: [Output Only] Informational warning message.
  30141. type SslPoliciesListWarning struct {
  30142. // Code: [Output Only] A warning code, if applicable. For example,
  30143. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30144. // the response.
  30145. //
  30146. // Possible values:
  30147. // "CLEANUP_FAILED"
  30148. // "DEPRECATED_RESOURCE_USED"
  30149. // "DEPRECATED_TYPE_USED"
  30150. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30151. // "EXPERIMENTAL_TYPE_USED"
  30152. // "EXTERNAL_API_WARNING"
  30153. // "FIELD_VALUE_OVERRIDEN"
  30154. // "INJECTED_KERNELS_DEPRECATED"
  30155. // "MISSING_TYPE_DEPENDENCY"
  30156. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30157. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30158. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30159. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30160. // "NEXT_HOP_NOT_RUNNING"
  30161. // "NOT_CRITICAL_ERROR"
  30162. // "NO_RESULTS_ON_PAGE"
  30163. // "REQUIRED_TOS_AGREEMENT"
  30164. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30165. // "RESOURCE_NOT_DELETED"
  30166. // "SCHEMA_VALIDATION_IGNORED"
  30167. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30168. // "UNDECLARED_PROPERTIES"
  30169. // "UNREACHABLE"
  30170. Code string `json:"code,omitempty"`
  30171. // Data: [Output Only] Metadata about this warning in key: value format.
  30172. // For example:
  30173. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30174. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  30175. // Message: [Output Only] A human-readable description of the warning
  30176. // code.
  30177. Message string `json:"message,omitempty"`
  30178. // ForceSendFields is a list of field names (e.g. "Code") to
  30179. // unconditionally include in API requests. By default, fields with
  30180. // empty values are omitted from API requests. However, any non-pointer,
  30181. // non-interface field appearing in ForceSendFields will be sent to the
  30182. // server regardless of whether the field is empty or not. This may be
  30183. // used to include empty fields in Patch requests.
  30184. ForceSendFields []string `json:"-"`
  30185. // NullFields is a list of field names (e.g. "Code") to include in API
  30186. // requests with the JSON null value. By default, fields with empty
  30187. // values are omitted from API requests. However, any field with an
  30188. // empty value appearing in NullFields will be sent to the server as
  30189. // null. It is an error if a field in this list has a non-empty value.
  30190. // This may be used to include null fields in Patch requests.
  30191. NullFields []string `json:"-"`
  30192. }
  30193. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  30194. type NoMethod SslPoliciesListWarning
  30195. raw := NoMethod(*s)
  30196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30197. }
  30198. type SslPoliciesListWarningData struct {
  30199. // Key: [Output Only] A key that provides more detail on the warning
  30200. // being returned. For example, for warnings where there are no results
  30201. // in a list request for a particular zone, this key might be scope and
  30202. // the key value might be the zone name. Other examples might be a key
  30203. // indicating a deprecated resource and a suggested replacement, or a
  30204. // warning about invalid network settings (for example, if an instance
  30205. // attempts to perform IP forwarding but is not enabled for IP
  30206. // forwarding).
  30207. Key string `json:"key,omitempty"`
  30208. // Value: [Output Only] A warning data value corresponding to the key.
  30209. Value string `json:"value,omitempty"`
  30210. // ForceSendFields is a list of field names (e.g. "Key") to
  30211. // unconditionally include in API requests. By default, fields with
  30212. // empty values are omitted from API requests. However, any non-pointer,
  30213. // non-interface field appearing in ForceSendFields will be sent to the
  30214. // server regardless of whether the field is empty or not. This may be
  30215. // used to include empty fields in Patch requests.
  30216. ForceSendFields []string `json:"-"`
  30217. // NullFields is a list of field names (e.g. "Key") to include in API
  30218. // requests with the JSON null value. By default, fields with empty
  30219. // values are omitted from API requests. However, any field with an
  30220. // empty value appearing in NullFields will be sent to the server as
  30221. // null. It is an error if a field in this list has a non-empty value.
  30222. // This may be used to include null fields in Patch requests.
  30223. NullFields []string `json:"-"`
  30224. }
  30225. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  30226. type NoMethod SslPoliciesListWarningData
  30227. raw := NoMethod(*s)
  30228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30229. }
  30230. type SslPoliciesListAvailableFeaturesResponse struct {
  30231. Features []string `json:"features,omitempty"`
  30232. // ServerResponse contains the HTTP response code and headers from the
  30233. // server.
  30234. googleapi.ServerResponse `json:"-"`
  30235. // ForceSendFields is a list of field names (e.g. "Features") to
  30236. // unconditionally include in API requests. By default, fields with
  30237. // empty values are omitted from API requests. However, any non-pointer,
  30238. // non-interface field appearing in ForceSendFields will be sent to the
  30239. // server regardless of whether the field is empty or not. This may be
  30240. // used to include empty fields in Patch requests.
  30241. ForceSendFields []string `json:"-"`
  30242. // NullFields is a list of field names (e.g. "Features") to include in
  30243. // API requests with the JSON null value. By default, fields with empty
  30244. // values are omitted from API requests. However, any field with an
  30245. // empty value appearing in NullFields will be sent to the server as
  30246. // null. It is an error if a field in this list has a non-empty value.
  30247. // This may be used to include null fields in Patch requests.
  30248. NullFields []string `json:"-"`
  30249. }
  30250. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  30251. type NoMethod SslPoliciesListAvailableFeaturesResponse
  30252. raw := NoMethod(*s)
  30253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30254. }
  30255. // SslPolicy: A SSL policy specifies the server-side support for SSL
  30256. // features. This can be attached to a TargetHttpsProxy or a
  30257. // TargetSslProxy. This affects connections between clients and the
  30258. // HTTPS or SSL proxy load balancer. They do not affect the connection
  30259. // between the load balancers and the backends.
  30260. type SslPolicy struct {
  30261. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30262. // format.
  30263. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30264. // CustomFeatures: A list of features enabled when the selected profile
  30265. // is CUSTOM. The
  30266. // - method returns the set of features that can be specified in this
  30267. // list. This field must be empty if the profile is not CUSTOM.
  30268. CustomFeatures []string `json:"customFeatures,omitempty"`
  30269. // Description: An optional description of this resource. Provide this
  30270. // property when you create the resource.
  30271. Description string `json:"description,omitempty"`
  30272. // EnabledFeatures: [Output Only] The list of features enabled in the
  30273. // SSL policy.
  30274. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  30275. // Fingerprint: Fingerprint of this resource. A hash of the contents
  30276. // stored in this object. This field is used in optimistic locking. This
  30277. // field will be ignored when inserting a SslPolicy. An up-to-date
  30278. // fingerprint must be provided in order to update the SslPolicy,
  30279. // otherwise the request will fail with error 412 conditionNotMet.
  30280. //
  30281. // To see the latest fingerprint, make a get() request to retrieve an
  30282. // SslPolicy.
  30283. Fingerprint string `json:"fingerprint,omitempty"`
  30284. // Id: [Output Only] The unique identifier for the resource. This
  30285. // identifier is defined by the server.
  30286. Id uint64 `json:"id,omitempty,string"`
  30287. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  30288. // SSL policies.
  30289. Kind string `json:"kind,omitempty"`
  30290. // MinTlsVersion: The minimum version of SSL protocol that can be used
  30291. // by the clients to establish a connection with the load balancer. This
  30292. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  30293. //
  30294. // Possible values:
  30295. // "TLS_1_0"
  30296. // "TLS_1_1"
  30297. // "TLS_1_2"
  30298. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  30299. // Name: Name of the resource. The name must be 1-63 characters long,
  30300. // and comply with RFC1035. Specifically, the name must be 1-63
  30301. // characters long and match the regular expression
  30302. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  30303. // a lowercase letter, and all following characters must be a dash,
  30304. // lowercase letter, or digit, except the last character, which cannot
  30305. // be a dash.
  30306. Name string `json:"name,omitempty"`
  30307. // Profile: Profile specifies the set of SSL features that can be used
  30308. // by the load balancer when negotiating SSL with clients. This can be
  30309. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  30310. // the set of SSL features to enable must be specified in the
  30311. // customFeatures field.
  30312. //
  30313. // Possible values:
  30314. // "COMPATIBLE"
  30315. // "CUSTOM"
  30316. // "MODERN"
  30317. // "RESTRICTED"
  30318. Profile string `json:"profile,omitempty"`
  30319. // SelfLink: [Output Only] Server-defined URL for the resource.
  30320. SelfLink string `json:"selfLink,omitempty"`
  30321. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  30322. // with the resource id.
  30323. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  30324. // TlsSettings: Security settings for the proxy. This field is only
  30325. // applicable to a global backend service with the loadBalancingScheme
  30326. // set to INTERNAL_SELF_MANAGED.
  30327. TlsSettings *ServerTlsSettings `json:"tlsSettings,omitempty"`
  30328. // Warnings: [Output Only] If potential misconfigurations are detected
  30329. // for this SSL policy, this field will be populated with warning
  30330. // messages.
  30331. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  30332. // ServerResponse contains the HTTP response code and headers from the
  30333. // server.
  30334. googleapi.ServerResponse `json:"-"`
  30335. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  30336. // to unconditionally include in API requests. By default, fields with
  30337. // empty values are omitted from API requests. However, any non-pointer,
  30338. // non-interface field appearing in ForceSendFields will be sent to the
  30339. // server regardless of whether the field is empty or not. This may be
  30340. // used to include empty fields in Patch requests.
  30341. ForceSendFields []string `json:"-"`
  30342. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  30343. // include in API requests with the JSON null value. By default, fields
  30344. // with empty values are omitted from API requests. However, any field
  30345. // with an empty value appearing in NullFields will be sent to the
  30346. // server as null. It is an error if a field in this list has a
  30347. // non-empty value. This may be used to include null fields in Patch
  30348. // requests.
  30349. NullFields []string `json:"-"`
  30350. }
  30351. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  30352. type NoMethod SslPolicy
  30353. raw := NoMethod(*s)
  30354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30355. }
  30356. type SslPolicyWarnings struct {
  30357. // Code: [Output Only] A warning code, if applicable. For example,
  30358. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30359. // the response.
  30360. //
  30361. // Possible values:
  30362. // "CLEANUP_FAILED"
  30363. // "DEPRECATED_RESOURCE_USED"
  30364. // "DEPRECATED_TYPE_USED"
  30365. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30366. // "EXPERIMENTAL_TYPE_USED"
  30367. // "EXTERNAL_API_WARNING"
  30368. // "FIELD_VALUE_OVERRIDEN"
  30369. // "INJECTED_KERNELS_DEPRECATED"
  30370. // "MISSING_TYPE_DEPENDENCY"
  30371. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30372. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30373. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30374. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30375. // "NEXT_HOP_NOT_RUNNING"
  30376. // "NOT_CRITICAL_ERROR"
  30377. // "NO_RESULTS_ON_PAGE"
  30378. // "REQUIRED_TOS_AGREEMENT"
  30379. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30380. // "RESOURCE_NOT_DELETED"
  30381. // "SCHEMA_VALIDATION_IGNORED"
  30382. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30383. // "UNDECLARED_PROPERTIES"
  30384. // "UNREACHABLE"
  30385. Code string `json:"code,omitempty"`
  30386. // Data: [Output Only] Metadata about this warning in key: value format.
  30387. // For example:
  30388. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30389. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  30390. // Message: [Output Only] A human-readable description of the warning
  30391. // code.
  30392. Message string `json:"message,omitempty"`
  30393. // ForceSendFields is a list of field names (e.g. "Code") to
  30394. // unconditionally include in API requests. By default, fields with
  30395. // empty values are omitted from API requests. However, any non-pointer,
  30396. // non-interface field appearing in ForceSendFields will be sent to the
  30397. // server regardless of whether the field is empty or not. This may be
  30398. // used to include empty fields in Patch requests.
  30399. ForceSendFields []string `json:"-"`
  30400. // NullFields is a list of field names (e.g. "Code") to include in API
  30401. // requests with the JSON null value. By default, fields with empty
  30402. // values are omitted from API requests. However, any field with an
  30403. // empty value appearing in NullFields will be sent to the server as
  30404. // null. It is an error if a field in this list has a non-empty value.
  30405. // This may be used to include null fields in Patch requests.
  30406. NullFields []string `json:"-"`
  30407. }
  30408. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  30409. type NoMethod SslPolicyWarnings
  30410. raw := NoMethod(*s)
  30411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30412. }
  30413. type SslPolicyWarningsData struct {
  30414. // Key: [Output Only] A key that provides more detail on the warning
  30415. // being returned. For example, for warnings where there are no results
  30416. // in a list request for a particular zone, this key might be scope and
  30417. // the key value might be the zone name. Other examples might be a key
  30418. // indicating a deprecated resource and a suggested replacement, or a
  30419. // warning about invalid network settings (for example, if an instance
  30420. // attempts to perform IP forwarding but is not enabled for IP
  30421. // forwarding).
  30422. Key string `json:"key,omitempty"`
  30423. // Value: [Output Only] A warning data value corresponding to the key.
  30424. Value string `json:"value,omitempty"`
  30425. // ForceSendFields is a list of field names (e.g. "Key") to
  30426. // unconditionally include in API requests. By default, fields with
  30427. // empty values are omitted from API requests. However, any non-pointer,
  30428. // non-interface field appearing in ForceSendFields will be sent to the
  30429. // server regardless of whether the field is empty or not. This may be
  30430. // used to include empty fields in Patch requests.
  30431. ForceSendFields []string `json:"-"`
  30432. // NullFields is a list of field names (e.g. "Key") to include in API
  30433. // requests with the JSON null value. By default, fields with empty
  30434. // values are omitted from API requests. However, any field with an
  30435. // empty value appearing in NullFields will be sent to the server as
  30436. // null. It is an error if a field in this list has a non-empty value.
  30437. // This may be used to include null fields in Patch requests.
  30438. NullFields []string `json:"-"`
  30439. }
  30440. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  30441. type NoMethod SslPolicyWarningsData
  30442. raw := NoMethod(*s)
  30443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30444. }
  30445. type SslPolicyReference struct {
  30446. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  30447. // to clear any existing SSL policy associated with the target proxy
  30448. // resource.
  30449. SslPolicy string `json:"sslPolicy,omitempty"`
  30450. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  30451. // unconditionally include in API requests. By default, fields with
  30452. // empty values are omitted from API requests. However, any non-pointer,
  30453. // non-interface field appearing in ForceSendFields will be sent to the
  30454. // server regardless of whether the field is empty or not. This may be
  30455. // used to include empty fields in Patch requests.
  30456. ForceSendFields []string `json:"-"`
  30457. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  30458. // API requests with the JSON null value. By default, fields with empty
  30459. // values are omitted from API requests. However, any field with an
  30460. // empty value appearing in NullFields will be sent to the server as
  30461. // null. It is an error if a field in this list has a non-empty value.
  30462. // This may be used to include null fields in Patch requests.
  30463. NullFields []string `json:"-"`
  30464. }
  30465. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  30466. type NoMethod SslPolicyReference
  30467. raw := NoMethod(*s)
  30468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30469. }
  30470. type StatefulPolicy struct {
  30471. PreservedResources *StatefulPolicyPreservedResources `json:"preservedResources,omitempty"`
  30472. PreservedState *StatefulPolicyPreservedState `json:"preservedState,omitempty"`
  30473. // ForceSendFields is a list of field names (e.g. "PreservedResources")
  30474. // to unconditionally include in API requests. By default, fields with
  30475. // empty values are omitted from API requests. However, any non-pointer,
  30476. // non-interface field appearing in ForceSendFields will be sent to the
  30477. // server regardless of whether the field is empty or not. This may be
  30478. // used to include empty fields in Patch requests.
  30479. ForceSendFields []string `json:"-"`
  30480. // NullFields is a list of field names (e.g. "PreservedResources") to
  30481. // include in API requests with the JSON null value. By default, fields
  30482. // with empty values are omitted from API requests. However, any field
  30483. // with an empty value appearing in NullFields will be sent to the
  30484. // server as null. It is an error if a field in this list has a
  30485. // non-empty value. This may be used to include null fields in Patch
  30486. // requests.
  30487. NullFields []string `json:"-"`
  30488. }
  30489. func (s *StatefulPolicy) MarshalJSON() ([]byte, error) {
  30490. type NoMethod StatefulPolicy
  30491. raw := NoMethod(*s)
  30492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30493. }
  30494. type StatefulPolicyPreservedDisk struct {
  30495. // DeviceName: Device name of the disk to be preserved
  30496. DeviceName string `json:"deviceName,omitempty"`
  30497. // ForceSendFields is a list of field names (e.g. "DeviceName") to
  30498. // unconditionally include in API requests. By default, fields with
  30499. // empty values are omitted from API requests. However, any non-pointer,
  30500. // non-interface field appearing in ForceSendFields will be sent to the
  30501. // server regardless of whether the field is empty or not. This may be
  30502. // used to include empty fields in Patch requests.
  30503. ForceSendFields []string `json:"-"`
  30504. // NullFields is a list of field names (e.g. "DeviceName") to include in
  30505. // API requests with the JSON null value. By default, fields with empty
  30506. // values are omitted from API requests. However, any field with an
  30507. // empty value appearing in NullFields will be sent to the server as
  30508. // null. It is an error if a field in this list has a non-empty value.
  30509. // This may be used to include null fields in Patch requests.
  30510. NullFields []string `json:"-"`
  30511. }
  30512. func (s *StatefulPolicyPreservedDisk) MarshalJSON() ([]byte, error) {
  30513. type NoMethod StatefulPolicyPreservedDisk
  30514. raw := NoMethod(*s)
  30515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30516. }
  30517. // StatefulPolicyPreservedResources: Configuration of all preserved
  30518. // resources.
  30519. type StatefulPolicyPreservedResources struct {
  30520. // Disks: Disks created on the instances that will be preserved on
  30521. // instance delete, resize down, etc.
  30522. Disks []*StatefulPolicyPreservedDisk `json:"disks,omitempty"`
  30523. // ForceSendFields is a list of field names (e.g. "Disks") to
  30524. // unconditionally include in API requests. By default, fields with
  30525. // empty values are omitted from API requests. However, any non-pointer,
  30526. // non-interface field appearing in ForceSendFields will be sent to the
  30527. // server regardless of whether the field is empty or not. This may be
  30528. // used to include empty fields in Patch requests.
  30529. ForceSendFields []string `json:"-"`
  30530. // NullFields is a list of field names (e.g. "Disks") to include in API
  30531. // requests with the JSON null value. By default, fields with empty
  30532. // values are omitted from API requests. However, any field with an
  30533. // empty value appearing in NullFields will be sent to the server as
  30534. // null. It is an error if a field in this list has a non-empty value.
  30535. // This may be used to include null fields in Patch requests.
  30536. NullFields []string `json:"-"`
  30537. }
  30538. func (s *StatefulPolicyPreservedResources) MarshalJSON() ([]byte, error) {
  30539. type NoMethod StatefulPolicyPreservedResources
  30540. raw := NoMethod(*s)
  30541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30542. }
  30543. // StatefulPolicyPreservedState: Configuration of preserved resources.
  30544. type StatefulPolicyPreservedState struct {
  30545. // Disks: Disks created on the instances that will be preserved on
  30546. // instance delete, resize down, etc. This map is keyed with the device
  30547. // names of the disks.
  30548. Disks map[string]StatefulPolicyPreservedStateDiskDevice `json:"disks,omitempty"`
  30549. // ForceSendFields is a list of field names (e.g. "Disks") to
  30550. // unconditionally include in API requests. By default, fields with
  30551. // empty values are omitted from API requests. However, any non-pointer,
  30552. // non-interface field appearing in ForceSendFields will be sent to the
  30553. // server regardless of whether the field is empty or not. This may be
  30554. // used to include empty fields in Patch requests.
  30555. ForceSendFields []string `json:"-"`
  30556. // NullFields is a list of field names (e.g. "Disks") to include in API
  30557. // requests with the JSON null value. By default, fields with empty
  30558. // values are omitted from API requests. However, any field with an
  30559. // empty value appearing in NullFields will be sent to the server as
  30560. // null. It is an error if a field in this list has a non-empty value.
  30561. // This may be used to include null fields in Patch requests.
  30562. NullFields []string `json:"-"`
  30563. }
  30564. func (s *StatefulPolicyPreservedState) MarshalJSON() ([]byte, error) {
  30565. type NoMethod StatefulPolicyPreservedState
  30566. raw := NoMethod(*s)
  30567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30568. }
  30569. type StatefulPolicyPreservedStateDiskDevice struct {
  30570. // AutoDelete: These stateful disks will never be deleted during
  30571. // autohealing, update or VM instance recreate operations. This flag is
  30572. // used to configure if the disk should be deleted after it is no longer
  30573. // used by the group, e.g. when the given instance or the whole group is
  30574. // deleted. Note: disks attached in READ_ONLY mode cannot be
  30575. // auto-deleted.
  30576. //
  30577. // Possible values:
  30578. // "NEVER"
  30579. // "WHEN_NOT_IN_USE"
  30580. AutoDelete string `json:"autoDelete,omitempty"`
  30581. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  30582. // unconditionally include in API requests. By default, fields with
  30583. // empty values are omitted from API requests. However, any non-pointer,
  30584. // non-interface field appearing in ForceSendFields will be sent to the
  30585. // server regardless of whether the field is empty or not. This may be
  30586. // used to include empty fields in Patch requests.
  30587. ForceSendFields []string `json:"-"`
  30588. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  30589. // API requests with the JSON null value. By default, fields with empty
  30590. // values are omitted from API requests. However, any field with an
  30591. // empty value appearing in NullFields will be sent to the server as
  30592. // null. It is an error if a field in this list has a non-empty value.
  30593. // This may be used to include null fields in Patch requests.
  30594. NullFields []string `json:"-"`
  30595. }
  30596. func (s *StatefulPolicyPreservedStateDiskDevice) MarshalJSON() ([]byte, error) {
  30597. type NoMethod StatefulPolicyPreservedStateDiskDevice
  30598. raw := NoMethod(*s)
  30599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30600. }
  30601. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  30602. // ==) (== resource_for v1.subnetworks ==)
  30603. type Subnetwork struct {
  30604. // AggregationInterval: Can only be specified if VPC flow logging for
  30605. // this subnetwork is enabled. Toggles the aggregation interval for
  30606. // collecting flow logs. Increasing the interval time will reduce the
  30607. // amount of generated flow logs for long lasting connections. Default
  30608. // is an interval of 5 seconds per connection.
  30609. //
  30610. // Possible values:
  30611. // "INTERVAL_10_MIN"
  30612. // "INTERVAL_15_MIN"
  30613. // "INTERVAL_1_MIN"
  30614. // "INTERVAL_30_SEC"
  30615. // "INTERVAL_5_MIN"
  30616. // "INTERVAL_5_SEC"
  30617. AggregationInterval string `json:"aggregationInterval,omitempty"`
  30618. // AllowSubnetCidrRoutesOverlap: Whether this subnetwork can conflict
  30619. // with static routes. Setting this to true allows this subnetwork's
  30620. // primary and secondary ranges to conflict with routes that have
  30621. // already been configured on the corresponding network. Static routes
  30622. // will take precedence over the subnetwork route if the route prefix
  30623. // length is at least as large as the subnetwork prefix length.
  30624. //
  30625. // Also, packets destined to IPs within subnetwork may contain
  30626. // private/sensitive data and are prevented from leaving the virtual
  30627. // network. Setting this field to true will disable this feature.
  30628. //
  30629. // The default value is false and applies to all existing subnetworks
  30630. // and automatically created subnetworks.
  30631. //
  30632. // This field cannot be set to true at resource creation time.
  30633. AllowSubnetCidrRoutesOverlap bool `json:"allowSubnetCidrRoutesOverlap,omitempty"`
  30634. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  30635. // format.
  30636. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  30637. // Description: An optional description of this resource. Provide this
  30638. // property when you create the resource. This field can be set only at
  30639. // resource creation time.
  30640. Description string `json:"description,omitempty"`
  30641. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  30642. // If this field is not explicitly set, it will not appear in get
  30643. // listings. If not set the default behavior is to disable flow logging.
  30644. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  30645. // EnablePrivateV6Access: Deprecated in favor of enable in
  30646. // PrivateIpv6GoogleAccess. Whether the VMs in this subnet can directly
  30647. // access Google services via internal IPv6 addresses. This field can be
  30648. // both set at resource creation time and updated using patch.
  30649. EnablePrivateV6Access bool `json:"enablePrivateV6Access,omitempty"`
  30650. // Fingerprint: Fingerprint of this resource. A hash of the contents
  30651. // stored in this object. This field is used in optimistic locking. This
  30652. // field will be ignored when inserting a Subnetwork. An up-to-date
  30653. // fingerprint must be provided in order to update the Subnetwork,
  30654. // otherwise the request will fail with error 412 conditionNotMet.
  30655. //
  30656. // To see the latest fingerprint, make a get() request to retrieve a
  30657. // Subnetwork.
  30658. Fingerprint string `json:"fingerprint,omitempty"`
  30659. // FlowSampling: Can only be specified if VPC flow logging for this
  30660. // subnetwork is enabled. The value of the field must be in [0, 1]. Set
  30661. // the sampling rate of VPC flow logs within the subnetwork where 1.0
  30662. // means all collected logs are reported and 0.0 means no logs are
  30663. // reported. Default is 0.5 which means half of all collected logs are
  30664. // reported.
  30665. FlowSampling float64 `json:"flowSampling,omitempty"`
  30666. // GatewayAddress: [Output Only] The gateway address for default routes
  30667. // to reach destination addresses outside this subnetwork.
  30668. GatewayAddress string `json:"gatewayAddress,omitempty"`
  30669. // Id: [Output Only] The unique identifier for the resource. This
  30670. // identifier is defined by the server.
  30671. Id uint64 `json:"id,omitempty,string"`
  30672. // IpCidrRange: The range of internal addresses that are owned by this
  30673. // subnetwork. Provide this property when you create the subnetwork. For
  30674. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  30675. // non-overlapping within a network. Only IPv4 is supported. This field
  30676. // can be set only at resource creation time.
  30677. IpCidrRange string `json:"ipCidrRange,omitempty"`
  30678. // Ipv6CidrRange: [Output Only] The range of internal IPv6 addresses
  30679. // that are owned by this subnetwork.
  30680. Ipv6CidrRange string `json:"ipv6CidrRange,omitempty"`
  30681. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  30682. // for Subnetwork resources.
  30683. Kind string `json:"kind,omitempty"`
  30684. // LogConfig: This field denotes the logging options for the load
  30685. // balancer traffic served by this backend service. If logging is
  30686. // enabled, logs will be exported to Stackdriver.
  30687. LogConfig *SubnetworkLogConfig `json:"logConfig,omitempty"`
  30688. // Metadata: Can only be specified if VPC flow logging for this
  30689. // subnetwork is enabled. Configures whether metadata fields should be
  30690. // added to the reported VPC flow logs. Default is INCLUDE_ALL_METADATA.
  30691. //
  30692. // Possible values:
  30693. // "EXCLUDE_ALL_METADATA"
  30694. // "INCLUDE_ALL_METADATA"
  30695. Metadata string `json:"metadata,omitempty"`
  30696. // Name: The name of the resource, provided by the client when initially
  30697. // creating the resource. The name must be 1-63 characters long, and
  30698. // comply with RFC1035. Specifically, the name must be 1-63 characters
  30699. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  30700. // which means the first character must be a lowercase letter, and all
  30701. // following characters must be a dash, lowercase letter, or digit,
  30702. // except the last character, which cannot be a dash.
  30703. Name string `json:"name,omitempty"`
  30704. // Network: The URL of the network to which this subnetwork belongs,
  30705. // provided by the client when initially creating the subnetwork. Only
  30706. // networks that are in the distributed mode can have subnetworks. This
  30707. // field can be set only at resource creation time.
  30708. Network string `json:"network,omitempty"`
  30709. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  30710. // Google services without assigned external IP addresses. This field
  30711. // can be both set at resource creation time and updated using
  30712. // setPrivateIpGoogleAccess.
  30713. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  30714. // PrivateIpv6GoogleAccess: The private IPv6 google access type for the
  30715. // VMs in this subnet. This is an expanded field of
  30716. // enablePrivateV6Access. If both fields are set,
  30717. // privateIpv6GoogleAccess will take priority.
  30718. //
  30719. // This field can be both set at resource creation time and updated
  30720. // using patch.
  30721. //
  30722. // Possible values:
  30723. // "DISABLE_GOOGLE_ACCESS"
  30724. // "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"
  30725. // "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"
  30726. PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"`
  30727. // Purpose: The purpose of the resource. This field can be either
  30728. // PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with
  30729. // purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created
  30730. // subnetwork that is reserved for Internal HTTP(S) Load Balancing. If
  30731. // unspecified, the purpose defaults to PRIVATE_RFC_1918.
  30732. //
  30733. // Possible values:
  30734. // "INTERNAL_HTTPS_LOAD_BALANCER"
  30735. // "PRIVATE"
  30736. // "PRIVATE_RFC_1918"
  30737. Purpose string `json:"purpose,omitempty"`
  30738. // Region: URL of the region where the Subnetwork resides. This field
  30739. // can be set only at resource creation time.
  30740. Region string `json:"region,omitempty"`
  30741. // Role: The role of subnetwork. Currenly, this field is only used when
  30742. // purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to
  30743. // ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being
  30744. // used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork is one
  30745. // that is ready to be promoted to ACTIVE or is currently draining. This
  30746. // field can be updated with a patch request.
  30747. //
  30748. // Possible values:
  30749. // "ACTIVE"
  30750. // "BACKUP"
  30751. Role string `json:"role,omitempty"`
  30752. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  30753. // for VM instances contained in this subnetwork. The primary IP of such
  30754. // VM must belong to the primary ipCidrRange of the subnetwork. The
  30755. // alias IPs may belong to either primary or secondary ranges. This
  30756. // field can be updated with a patch request.
  30757. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  30758. // SelfLink: [Output Only] Server-defined URL for the resource.
  30759. SelfLink string `json:"selfLink,omitempty"`
  30760. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  30761. // with the resource id.
  30762. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  30763. // State: [Output Only] The state of the subnetwork, which can be one of
  30764. // READY or DRAINING. A subnetwork that is READY is ready to be used.
  30765. // The state of DRAINING is only applicable to subnetworks that have the
  30766. // purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that
  30767. // connections to the load balancer are being drained. A subnetwork that
  30768. // is draining cannot be used or modified until it reaches a status of
  30769. // READY.
  30770. //
  30771. // Possible values:
  30772. // "DRAINING"
  30773. // "READY"
  30774. State string `json:"state,omitempty"`
  30775. // ServerResponse contains the HTTP response code and headers from the
  30776. // server.
  30777. googleapi.ServerResponse `json:"-"`
  30778. // ForceSendFields is a list of field names (e.g. "AggregationInterval")
  30779. // to unconditionally include in API requests. By default, fields with
  30780. // empty values are omitted from API requests. However, any non-pointer,
  30781. // non-interface field appearing in ForceSendFields will be sent to the
  30782. // server regardless of whether the field is empty or not. This may be
  30783. // used to include empty fields in Patch requests.
  30784. ForceSendFields []string `json:"-"`
  30785. // NullFields is a list of field names (e.g. "AggregationInterval") to
  30786. // include in API requests with the JSON null value. By default, fields
  30787. // with empty values are omitted from API requests. However, any field
  30788. // with an empty value appearing in NullFields will be sent to the
  30789. // server as null. It is an error if a field in this list has a
  30790. // non-empty value. This may be used to include null fields in Patch
  30791. // requests.
  30792. NullFields []string `json:"-"`
  30793. }
  30794. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  30795. type NoMethod Subnetwork
  30796. raw := NoMethod(*s)
  30797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30798. }
  30799. func (s *Subnetwork) UnmarshalJSON(data []byte) error {
  30800. type NoMethod Subnetwork
  30801. var s1 struct {
  30802. FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
  30803. *NoMethod
  30804. }
  30805. s1.NoMethod = (*NoMethod)(s)
  30806. if err := json.Unmarshal(data, &s1); err != nil {
  30807. return err
  30808. }
  30809. s.FlowSampling = float64(s1.FlowSampling)
  30810. return nil
  30811. }
  30812. type SubnetworkAggregatedList struct {
  30813. // Id: [Output Only] Unique identifier for the resource; defined by the
  30814. // server.
  30815. Id string `json:"id,omitempty"`
  30816. // Items: A list of SubnetworksScopedList resources.
  30817. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  30818. // Kind: [Output Only] Type of resource. Always
  30819. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  30820. Kind string `json:"kind,omitempty"`
  30821. // NextPageToken: [Output Only] This token allows you to get the next
  30822. // page of results for list requests. If the number of results is larger
  30823. // than maxResults, use the nextPageToken as a value for the query
  30824. // parameter pageToken in the next list request. Subsequent list
  30825. // requests will have their own nextPageToken to continue paging through
  30826. // the results.
  30827. NextPageToken string `json:"nextPageToken,omitempty"`
  30828. // SelfLink: [Output Only] Server-defined URL for this resource.
  30829. SelfLink string `json:"selfLink,omitempty"`
  30830. // Warning: [Output Only] Informational warning message.
  30831. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  30832. // ServerResponse contains the HTTP response code and headers from the
  30833. // server.
  30834. googleapi.ServerResponse `json:"-"`
  30835. // ForceSendFields is a list of field names (e.g. "Id") to
  30836. // unconditionally include in API requests. By default, fields with
  30837. // empty values are omitted from API requests. However, any non-pointer,
  30838. // non-interface field appearing in ForceSendFields will be sent to the
  30839. // server regardless of whether the field is empty or not. This may be
  30840. // used to include empty fields in Patch requests.
  30841. ForceSendFields []string `json:"-"`
  30842. // NullFields is a list of field names (e.g. "Id") to include in API
  30843. // requests with the JSON null value. By default, fields with empty
  30844. // values are omitted from API requests. However, any field with an
  30845. // empty value appearing in NullFields will be sent to the server as
  30846. // null. It is an error if a field in this list has a non-empty value.
  30847. // This may be used to include null fields in Patch requests.
  30848. NullFields []string `json:"-"`
  30849. }
  30850. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  30851. type NoMethod SubnetworkAggregatedList
  30852. raw := NoMethod(*s)
  30853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30854. }
  30855. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  30856. // message.
  30857. type SubnetworkAggregatedListWarning struct {
  30858. // Code: [Output Only] A warning code, if applicable. For example,
  30859. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30860. // the response.
  30861. //
  30862. // Possible values:
  30863. // "CLEANUP_FAILED"
  30864. // "DEPRECATED_RESOURCE_USED"
  30865. // "DEPRECATED_TYPE_USED"
  30866. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  30867. // "EXPERIMENTAL_TYPE_USED"
  30868. // "EXTERNAL_API_WARNING"
  30869. // "FIELD_VALUE_OVERRIDEN"
  30870. // "INJECTED_KERNELS_DEPRECATED"
  30871. // "MISSING_TYPE_DEPENDENCY"
  30872. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  30873. // "NEXT_HOP_CANNOT_IP_FORWARD"
  30874. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  30875. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  30876. // "NEXT_HOP_NOT_RUNNING"
  30877. // "NOT_CRITICAL_ERROR"
  30878. // "NO_RESULTS_ON_PAGE"
  30879. // "REQUIRED_TOS_AGREEMENT"
  30880. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  30881. // "RESOURCE_NOT_DELETED"
  30882. // "SCHEMA_VALIDATION_IGNORED"
  30883. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  30884. // "UNDECLARED_PROPERTIES"
  30885. // "UNREACHABLE"
  30886. Code string `json:"code,omitempty"`
  30887. // Data: [Output Only] Metadata about this warning in key: value format.
  30888. // For example:
  30889. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  30890. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  30891. // Message: [Output Only] A human-readable description of the warning
  30892. // code.
  30893. Message string `json:"message,omitempty"`
  30894. // ForceSendFields is a list of field names (e.g. "Code") to
  30895. // unconditionally include in API requests. By default, fields with
  30896. // empty values are omitted from API requests. However, any non-pointer,
  30897. // non-interface field appearing in ForceSendFields will be sent to the
  30898. // server regardless of whether the field is empty or not. This may be
  30899. // used to include empty fields in Patch requests.
  30900. ForceSendFields []string `json:"-"`
  30901. // NullFields is a list of field names (e.g. "Code") to include in API
  30902. // requests with the JSON null value. By default, fields with empty
  30903. // values are omitted from API requests. However, any field with an
  30904. // empty value appearing in NullFields will be sent to the server as
  30905. // null. It is an error if a field in this list has a non-empty value.
  30906. // This may be used to include null fields in Patch requests.
  30907. NullFields []string `json:"-"`
  30908. }
  30909. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  30910. type NoMethod SubnetworkAggregatedListWarning
  30911. raw := NoMethod(*s)
  30912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30913. }
  30914. type SubnetworkAggregatedListWarningData struct {
  30915. // Key: [Output Only] A key that provides more detail on the warning
  30916. // being returned. For example, for warnings where there are no results
  30917. // in a list request for a particular zone, this key might be scope and
  30918. // the key value might be the zone name. Other examples might be a key
  30919. // indicating a deprecated resource and a suggested replacement, or a
  30920. // warning about invalid network settings (for example, if an instance
  30921. // attempts to perform IP forwarding but is not enabled for IP
  30922. // forwarding).
  30923. Key string `json:"key,omitempty"`
  30924. // Value: [Output Only] A warning data value corresponding to the key.
  30925. Value string `json:"value,omitempty"`
  30926. // ForceSendFields is a list of field names (e.g. "Key") to
  30927. // unconditionally include in API requests. By default, fields with
  30928. // empty values are omitted from API requests. However, any non-pointer,
  30929. // non-interface field appearing in ForceSendFields will be sent to the
  30930. // server regardless of whether the field is empty or not. This may be
  30931. // used to include empty fields in Patch requests.
  30932. ForceSendFields []string `json:"-"`
  30933. // NullFields is a list of field names (e.g. "Key") to include in API
  30934. // requests with the JSON null value. By default, fields with empty
  30935. // values are omitted from API requests. However, any field with an
  30936. // empty value appearing in NullFields will be sent to the server as
  30937. // null. It is an error if a field in this list has a non-empty value.
  30938. // This may be used to include null fields in Patch requests.
  30939. NullFields []string `json:"-"`
  30940. }
  30941. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  30942. type NoMethod SubnetworkAggregatedListWarningData
  30943. raw := NoMethod(*s)
  30944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30945. }
  30946. // SubnetworkList: Contains a list of Subnetwork resources.
  30947. type SubnetworkList struct {
  30948. // Id: [Output Only] Unique identifier for the resource; defined by the
  30949. // server.
  30950. Id string `json:"id,omitempty"`
  30951. // Items: A list of Subnetwork resources.
  30952. Items []*Subnetwork `json:"items,omitempty"`
  30953. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  30954. // for lists of subnetworks.
  30955. Kind string `json:"kind,omitempty"`
  30956. // NextPageToken: [Output Only] This token allows you to get the next
  30957. // page of results for list requests. If the number of results is larger
  30958. // than maxResults, use the nextPageToken as a value for the query
  30959. // parameter pageToken in the next list request. Subsequent list
  30960. // requests will have their own nextPageToken to continue paging through
  30961. // the results.
  30962. NextPageToken string `json:"nextPageToken,omitempty"`
  30963. // SelfLink: [Output Only] Server-defined URL for this resource.
  30964. SelfLink string `json:"selfLink,omitempty"`
  30965. // Warning: [Output Only] Informational warning message.
  30966. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  30967. // ServerResponse contains the HTTP response code and headers from the
  30968. // server.
  30969. googleapi.ServerResponse `json:"-"`
  30970. // ForceSendFields is a list of field names (e.g. "Id") to
  30971. // unconditionally include in API requests. By default, fields with
  30972. // empty values are omitted from API requests. However, any non-pointer,
  30973. // non-interface field appearing in ForceSendFields will be sent to the
  30974. // server regardless of whether the field is empty or not. This may be
  30975. // used to include empty fields in Patch requests.
  30976. ForceSendFields []string `json:"-"`
  30977. // NullFields is a list of field names (e.g. "Id") to include in API
  30978. // requests with the JSON null value. By default, fields with empty
  30979. // values are omitted from API requests. However, any field with an
  30980. // empty value appearing in NullFields will be sent to the server as
  30981. // null. It is an error if a field in this list has a non-empty value.
  30982. // This may be used to include null fields in Patch requests.
  30983. NullFields []string `json:"-"`
  30984. }
  30985. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  30986. type NoMethod SubnetworkList
  30987. raw := NoMethod(*s)
  30988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  30989. }
  30990. // SubnetworkListWarning: [Output Only] Informational warning message.
  30991. type SubnetworkListWarning struct {
  30992. // Code: [Output Only] A warning code, if applicable. For example,
  30993. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  30994. // the response.
  30995. //
  30996. // Possible values:
  30997. // "CLEANUP_FAILED"
  30998. // "DEPRECATED_RESOURCE_USED"
  30999. // "DEPRECATED_TYPE_USED"
  31000. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31001. // "EXPERIMENTAL_TYPE_USED"
  31002. // "EXTERNAL_API_WARNING"
  31003. // "FIELD_VALUE_OVERRIDEN"
  31004. // "INJECTED_KERNELS_DEPRECATED"
  31005. // "MISSING_TYPE_DEPENDENCY"
  31006. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31007. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31008. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31009. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31010. // "NEXT_HOP_NOT_RUNNING"
  31011. // "NOT_CRITICAL_ERROR"
  31012. // "NO_RESULTS_ON_PAGE"
  31013. // "REQUIRED_TOS_AGREEMENT"
  31014. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31015. // "RESOURCE_NOT_DELETED"
  31016. // "SCHEMA_VALIDATION_IGNORED"
  31017. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31018. // "UNDECLARED_PROPERTIES"
  31019. // "UNREACHABLE"
  31020. Code string `json:"code,omitempty"`
  31021. // Data: [Output Only] Metadata about this warning in key: value format.
  31022. // For example:
  31023. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31024. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  31025. // Message: [Output Only] A human-readable description of the warning
  31026. // code.
  31027. Message string `json:"message,omitempty"`
  31028. // ForceSendFields is a list of field names (e.g. "Code") to
  31029. // unconditionally include in API requests. By default, fields with
  31030. // empty values are omitted from API requests. However, any non-pointer,
  31031. // non-interface field appearing in ForceSendFields will be sent to the
  31032. // server regardless of whether the field is empty or not. This may be
  31033. // used to include empty fields in Patch requests.
  31034. ForceSendFields []string `json:"-"`
  31035. // NullFields is a list of field names (e.g. "Code") to include in API
  31036. // requests with the JSON null value. By default, fields with empty
  31037. // values are omitted from API requests. However, any field with an
  31038. // empty value appearing in NullFields will be sent to the server as
  31039. // null. It is an error if a field in this list has a non-empty value.
  31040. // This may be used to include null fields in Patch requests.
  31041. NullFields []string `json:"-"`
  31042. }
  31043. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  31044. type NoMethod SubnetworkListWarning
  31045. raw := NoMethod(*s)
  31046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31047. }
  31048. type SubnetworkListWarningData struct {
  31049. // Key: [Output Only] A key that provides more detail on the warning
  31050. // being returned. For example, for warnings where there are no results
  31051. // in a list request for a particular zone, this key might be scope and
  31052. // the key value might be the zone name. Other examples might be a key
  31053. // indicating a deprecated resource and a suggested replacement, or a
  31054. // warning about invalid network settings (for example, if an instance
  31055. // attempts to perform IP forwarding but is not enabled for IP
  31056. // forwarding).
  31057. Key string `json:"key,omitempty"`
  31058. // Value: [Output Only] A warning data value corresponding to the key.
  31059. Value string `json:"value,omitempty"`
  31060. // ForceSendFields is a list of field names (e.g. "Key") to
  31061. // unconditionally include in API requests. By default, fields with
  31062. // empty values are omitted from API requests. However, any non-pointer,
  31063. // non-interface field appearing in ForceSendFields will be sent to the
  31064. // server regardless of whether the field is empty or not. This may be
  31065. // used to include empty fields in Patch requests.
  31066. ForceSendFields []string `json:"-"`
  31067. // NullFields is a list of field names (e.g. "Key") to include in API
  31068. // requests with the JSON null value. By default, fields with empty
  31069. // values are omitted from API requests. However, any field with an
  31070. // empty value appearing in NullFields will be sent to the server as
  31071. // null. It is an error if a field in this list has a non-empty value.
  31072. // This may be used to include null fields in Patch requests.
  31073. NullFields []string `json:"-"`
  31074. }
  31075. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  31076. type NoMethod SubnetworkListWarningData
  31077. raw := NoMethod(*s)
  31078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31079. }
  31080. // SubnetworkLogConfig: The available logging options for this
  31081. // subnetwork.
  31082. type SubnetworkLogConfig struct {
  31083. // AggregationInterval: Can only be specified if VPC flow logging for
  31084. // this subnetwork is enabled. Toggles the aggregation interval for
  31085. // collecting flow logs. Increasing the interval time will reduce the
  31086. // amount of generated flow logs for long lasting connections. Default
  31087. // is an interval of 5 seconds per connection.
  31088. //
  31089. // Possible values:
  31090. // "INTERVAL_10_MIN"
  31091. // "INTERVAL_15_MIN"
  31092. // "INTERVAL_1_MIN"
  31093. // "INTERVAL_30_SEC"
  31094. // "INTERVAL_5_MIN"
  31095. // "INTERVAL_5_SEC"
  31096. AggregationInterval string `json:"aggregationInterval,omitempty"`
  31097. // Enable: Whether to enable flow logging for this subnetwork. If this
  31098. // field is not explicitly set, it will not appear in get listings. If
  31099. // not set the default behavior is to disable flow logging.
  31100. Enable bool `json:"enable,omitempty"`
  31101. // FlowSampling: Can only be specified if VPC flow logging for this
  31102. // subnetwork is enabled. The value of the field must be in [0, 1]. Set
  31103. // the sampling rate of VPC flow logs within the subnetwork where 1.0
  31104. // means all collected logs are reported and 0.0 means no logs are
  31105. // reported. Default is 0.5 which means half of all collected logs are
  31106. // reported.
  31107. FlowSampling float64 `json:"flowSampling,omitempty"`
  31108. // Metadata: Can only be specified if VPC flow logging for this
  31109. // subnetwork is enabled. Configures whether metadata fields should be
  31110. // added to the reported VPC flow logs. Default is INCLUDE_ALL_METADATA.
  31111. //
  31112. // Possible values:
  31113. // "EXCLUDE_ALL_METADATA"
  31114. // "INCLUDE_ALL_METADATA"
  31115. Metadata string `json:"metadata,omitempty"`
  31116. // ForceSendFields is a list of field names (e.g. "AggregationInterval")
  31117. // to unconditionally include in API requests. By default, fields with
  31118. // empty values are omitted from API requests. However, any non-pointer,
  31119. // non-interface field appearing in ForceSendFields will be sent to the
  31120. // server regardless of whether the field is empty or not. This may be
  31121. // used to include empty fields in Patch requests.
  31122. ForceSendFields []string `json:"-"`
  31123. // NullFields is a list of field names (e.g. "AggregationInterval") to
  31124. // include in API requests with the JSON null value. By default, fields
  31125. // with empty values are omitted from API requests. However, any field
  31126. // with an empty value appearing in NullFields will be sent to the
  31127. // server as null. It is an error if a field in this list has a
  31128. // non-empty value. This may be used to include null fields in Patch
  31129. // requests.
  31130. NullFields []string `json:"-"`
  31131. }
  31132. func (s *SubnetworkLogConfig) MarshalJSON() ([]byte, error) {
  31133. type NoMethod SubnetworkLogConfig
  31134. raw := NoMethod(*s)
  31135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31136. }
  31137. func (s *SubnetworkLogConfig) UnmarshalJSON(data []byte) error {
  31138. type NoMethod SubnetworkLogConfig
  31139. var s1 struct {
  31140. FlowSampling gensupport.JSONFloat64 `json:"flowSampling"`
  31141. *NoMethod
  31142. }
  31143. s1.NoMethod = (*NoMethod)(s)
  31144. if err := json.Unmarshal(data, &s1); err != nil {
  31145. return err
  31146. }
  31147. s.FlowSampling = float64(s1.FlowSampling)
  31148. return nil
  31149. }
  31150. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  31151. // subnetwork.
  31152. type SubnetworkSecondaryRange struct {
  31153. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  31154. // secondary range. Provide this property when you create the
  31155. // subnetwork. Ranges must be unique and non-overlapping with all
  31156. // primary and secondary IP ranges within a network. Only IPv4 is
  31157. // supported.
  31158. IpCidrRange string `json:"ipCidrRange,omitempty"`
  31159. // RangeName: The name associated with this subnetwork secondary range,
  31160. // used when adding an alias IP range to a VM instance. The name must be
  31161. // 1-63 characters long, and comply with RFC1035. The name must be
  31162. // unique within the subnetwork.
  31163. RangeName string `json:"rangeName,omitempty"`
  31164. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  31165. // unconditionally include in API requests. By default, fields with
  31166. // empty values are omitted from API requests. However, any non-pointer,
  31167. // non-interface field appearing in ForceSendFields will be sent to the
  31168. // server regardless of whether the field is empty or not. This may be
  31169. // used to include empty fields in Patch requests.
  31170. ForceSendFields []string `json:"-"`
  31171. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  31172. // in API requests with the JSON null value. By default, fields with
  31173. // empty values are omitted from API requests. However, any field with
  31174. // an empty value appearing in NullFields will be sent to the server as
  31175. // null. It is an error if a field in this list has a non-empty value.
  31176. // This may be used to include null fields in Patch requests.
  31177. NullFields []string `json:"-"`
  31178. }
  31179. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  31180. type NoMethod SubnetworkSecondaryRange
  31181. raw := NoMethod(*s)
  31182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31183. }
  31184. type SubnetworksExpandIpCidrRangeRequest struct {
  31185. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  31186. // that are legal on this Subnetwork. This range should be disjoint from
  31187. // other subnetworks within this network. This range can only be larger
  31188. // than (i.e. a superset of) the range previously defined before the
  31189. // update.
  31190. IpCidrRange string `json:"ipCidrRange,omitempty"`
  31191. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  31192. // unconditionally include in API requests. By default, fields with
  31193. // empty values are omitted from API requests. However, any non-pointer,
  31194. // non-interface field appearing in ForceSendFields will be sent to the
  31195. // server regardless of whether the field is empty or not. This may be
  31196. // used to include empty fields in Patch requests.
  31197. ForceSendFields []string `json:"-"`
  31198. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  31199. // in API requests with the JSON null value. By default, fields with
  31200. // empty values are omitted from API requests. However, any field with
  31201. // an empty value appearing in NullFields will be sent to the server as
  31202. // null. It is an error if a field in this list has a non-empty value.
  31203. // This may be used to include null fields in Patch requests.
  31204. NullFields []string `json:"-"`
  31205. }
  31206. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  31207. type NoMethod SubnetworksExpandIpCidrRangeRequest
  31208. raw := NoMethod(*s)
  31209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31210. }
  31211. type SubnetworksScopedList struct {
  31212. // Subnetworks: A list of subnetworks contained in this scope.
  31213. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  31214. // Warning: An informational warning that appears when the list of
  31215. // addresses is empty.
  31216. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  31217. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  31218. // unconditionally include in API requests. By default, fields with
  31219. // empty values are omitted from API requests. However, any non-pointer,
  31220. // non-interface field appearing in ForceSendFields will be sent to the
  31221. // server regardless of whether the field is empty or not. This may be
  31222. // used to include empty fields in Patch requests.
  31223. ForceSendFields []string `json:"-"`
  31224. // NullFields is a list of field names (e.g. "Subnetworks") to include
  31225. // in API requests with the JSON null value. By default, fields with
  31226. // empty values are omitted from API requests. However, any field with
  31227. // an empty value appearing in NullFields will be sent to the server as
  31228. // null. It is an error if a field in this list has a non-empty value.
  31229. // This may be used to include null fields in Patch requests.
  31230. NullFields []string `json:"-"`
  31231. }
  31232. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  31233. type NoMethod SubnetworksScopedList
  31234. raw := NoMethod(*s)
  31235. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31236. }
  31237. // SubnetworksScopedListWarning: An informational warning that appears
  31238. // when the list of addresses is empty.
  31239. type SubnetworksScopedListWarning struct {
  31240. // Code: [Output Only] A warning code, if applicable. For example,
  31241. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31242. // the response.
  31243. //
  31244. // Possible values:
  31245. // "CLEANUP_FAILED"
  31246. // "DEPRECATED_RESOURCE_USED"
  31247. // "DEPRECATED_TYPE_USED"
  31248. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31249. // "EXPERIMENTAL_TYPE_USED"
  31250. // "EXTERNAL_API_WARNING"
  31251. // "FIELD_VALUE_OVERRIDEN"
  31252. // "INJECTED_KERNELS_DEPRECATED"
  31253. // "MISSING_TYPE_DEPENDENCY"
  31254. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31255. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31256. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31257. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31258. // "NEXT_HOP_NOT_RUNNING"
  31259. // "NOT_CRITICAL_ERROR"
  31260. // "NO_RESULTS_ON_PAGE"
  31261. // "REQUIRED_TOS_AGREEMENT"
  31262. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31263. // "RESOURCE_NOT_DELETED"
  31264. // "SCHEMA_VALIDATION_IGNORED"
  31265. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31266. // "UNDECLARED_PROPERTIES"
  31267. // "UNREACHABLE"
  31268. Code string `json:"code,omitempty"`
  31269. // Data: [Output Only] Metadata about this warning in key: value format.
  31270. // For example:
  31271. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31272. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  31273. // Message: [Output Only] A human-readable description of the warning
  31274. // code.
  31275. Message string `json:"message,omitempty"`
  31276. // ForceSendFields is a list of field names (e.g. "Code") to
  31277. // unconditionally include in API requests. By default, fields with
  31278. // empty values are omitted from API requests. However, any non-pointer,
  31279. // non-interface field appearing in ForceSendFields will be sent to the
  31280. // server regardless of whether the field is empty or not. This may be
  31281. // used to include empty fields in Patch requests.
  31282. ForceSendFields []string `json:"-"`
  31283. // NullFields is a list of field names (e.g. "Code") to include in API
  31284. // requests with the JSON null value. By default, fields with empty
  31285. // values are omitted from API requests. However, any field with an
  31286. // empty value appearing in NullFields will be sent to the server as
  31287. // null. It is an error if a field in this list has a non-empty value.
  31288. // This may be used to include null fields in Patch requests.
  31289. NullFields []string `json:"-"`
  31290. }
  31291. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  31292. type NoMethod SubnetworksScopedListWarning
  31293. raw := NoMethod(*s)
  31294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31295. }
  31296. type SubnetworksScopedListWarningData struct {
  31297. // Key: [Output Only] A key that provides more detail on the warning
  31298. // being returned. For example, for warnings where there are no results
  31299. // in a list request for a particular zone, this key might be scope and
  31300. // the key value might be the zone name. Other examples might be a key
  31301. // indicating a deprecated resource and a suggested replacement, or a
  31302. // warning about invalid network settings (for example, if an instance
  31303. // attempts to perform IP forwarding but is not enabled for IP
  31304. // forwarding).
  31305. Key string `json:"key,omitempty"`
  31306. // Value: [Output Only] A warning data value corresponding to the key.
  31307. Value string `json:"value,omitempty"`
  31308. // ForceSendFields is a list of field names (e.g. "Key") to
  31309. // unconditionally include in API requests. By default, fields with
  31310. // empty values are omitted from API requests. However, any non-pointer,
  31311. // non-interface field appearing in ForceSendFields will be sent to the
  31312. // server regardless of whether the field is empty or not. This may be
  31313. // used to include empty fields in Patch requests.
  31314. ForceSendFields []string `json:"-"`
  31315. // NullFields is a list of field names (e.g. "Key") to include in API
  31316. // requests with the JSON null value. By default, fields with empty
  31317. // values are omitted from API requests. However, any field with an
  31318. // empty value appearing in NullFields will be sent to the server as
  31319. // null. It is an error if a field in this list has a non-empty value.
  31320. // This may be used to include null fields in Patch requests.
  31321. NullFields []string `json:"-"`
  31322. }
  31323. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  31324. type NoMethod SubnetworksScopedListWarningData
  31325. raw := NoMethod(*s)
  31326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31327. }
  31328. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  31329. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  31330. // ForceSendFields is a list of field names (e.g.
  31331. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  31332. // By default, fields with empty values are omitted from API requests.
  31333. // However, any non-pointer, non-interface field appearing in
  31334. // ForceSendFields will be sent to the server regardless of whether the
  31335. // field is empty or not. This may be used to include empty fields in
  31336. // Patch requests.
  31337. ForceSendFields []string `json:"-"`
  31338. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  31339. // include in API requests with the JSON null value. By default, fields
  31340. // with empty values are omitted from API requests. However, any field
  31341. // with an empty value appearing in NullFields will be sent to the
  31342. // server as null. It is an error if a field in this list has a
  31343. // non-empty value. This may be used to include null fields in Patch
  31344. // requests.
  31345. NullFields []string `json:"-"`
  31346. }
  31347. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  31348. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  31349. raw := NoMethod(*s)
  31350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31351. }
  31352. type TCPHealthCheck struct {
  31353. // Port: The TCP port number for the health check request. The default
  31354. // value is 80. Valid values are 1 through 65535.
  31355. Port int64 `json:"port,omitempty"`
  31356. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  31357. // both port and port_name are defined, port takes precedence.
  31358. PortName string `json:"portName,omitempty"`
  31359. // PortSpecification: Specifies how port is selected for health
  31360. // checking, can be one of following values:
  31361. // USE_FIXED_PORT: The port number in
  31362. // port
  31363. // is used for health checking.
  31364. // USE_NAMED_PORT: The
  31365. // portName
  31366. // is used for health checking.
  31367. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  31368. // each network endpoint is used for health checking. For other
  31369. // backends, the port or named port specified in the Backend Service is
  31370. // used for health checking.
  31371. //
  31372. //
  31373. // If not specified, TCP health check follows behavior specified
  31374. // in
  31375. // port
  31376. // and
  31377. // portName
  31378. // fields.
  31379. //
  31380. // Possible values:
  31381. // "USE_FIXED_PORT"
  31382. // "USE_NAMED_PORT"
  31383. // "USE_SERVING_PORT"
  31384. PortSpecification string `json:"portSpecification,omitempty"`
  31385. // ProxyHeader: Specifies the type of proxy header to append before
  31386. // sending data to the backend, either NONE or PROXY_V1. The default is
  31387. // NONE.
  31388. //
  31389. // Possible values:
  31390. // "NONE"
  31391. // "PROXY_V1"
  31392. ProxyHeader string `json:"proxyHeader,omitempty"`
  31393. // Request: The application data to send once the TCP connection has
  31394. // been established (default value is empty). If both request and
  31395. // response are empty, the connection establishment alone will indicate
  31396. // health. The request data can only be ASCII.
  31397. Request string `json:"request,omitempty"`
  31398. // Response: The bytes to match against the beginning of the response
  31399. // data. If left empty (the default value), any response will indicate
  31400. // health. The response data can only be ASCII.
  31401. Response string `json:"response,omitempty"`
  31402. // ForceSendFields is a list of field names (e.g. "Port") to
  31403. // unconditionally include in API requests. By default, fields with
  31404. // empty values are omitted from API requests. However, any non-pointer,
  31405. // non-interface field appearing in ForceSendFields will be sent to the
  31406. // server regardless of whether the field is empty or not. This may be
  31407. // used to include empty fields in Patch requests.
  31408. ForceSendFields []string `json:"-"`
  31409. // NullFields is a list of field names (e.g. "Port") to include in API
  31410. // requests with the JSON null value. By default, fields with empty
  31411. // values are omitted from API requests. However, any field with an
  31412. // empty value appearing in NullFields will be sent to the server as
  31413. // null. It is an error if a field in this list has a non-empty value.
  31414. // This may be used to include null fields in Patch requests.
  31415. NullFields []string `json:"-"`
  31416. }
  31417. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  31418. type NoMethod TCPHealthCheck
  31419. raw := NoMethod(*s)
  31420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31421. }
  31422. // Tags: A set of instance tags.
  31423. type Tags struct {
  31424. // Fingerprint: Specifies a fingerprint for this request, which is
  31425. // essentially a hash of the tags' contents and used for optimistic
  31426. // locking. The fingerprint is initially generated by Compute Engine and
  31427. // changes after every request to modify or update tags. You must always
  31428. // provide an up-to-date fingerprint hash in order to update or change
  31429. // tags.
  31430. //
  31431. // To see the latest fingerprint, make get() request to the instance.
  31432. Fingerprint string `json:"fingerprint,omitempty"`
  31433. // Items: An array of tags. Each tag must be 1-63 characters long, and
  31434. // comply with RFC1035.
  31435. Items []string `json:"items,omitempty"`
  31436. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  31437. // unconditionally include in API requests. By default, fields with
  31438. // empty values are omitted from API requests. However, any non-pointer,
  31439. // non-interface field appearing in ForceSendFields will be sent to the
  31440. // server regardless of whether the field is empty or not. This may be
  31441. // used to include empty fields in Patch requests.
  31442. ForceSendFields []string `json:"-"`
  31443. // NullFields is a list of field names (e.g. "Fingerprint") to include
  31444. // in API requests with the JSON null value. By default, fields with
  31445. // empty values are omitted from API requests. However, any field with
  31446. // an empty value appearing in NullFields will be sent to the server as
  31447. // null. It is an error if a field in this list has a non-empty value.
  31448. // This may be used to include null fields in Patch requests.
  31449. NullFields []string `json:"-"`
  31450. }
  31451. func (s *Tags) MarshalJSON() ([]byte, error) {
  31452. type NoMethod Tags
  31453. raw := NoMethod(*s)
  31454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31455. }
  31456. type TargetHttpProxiesScopedList struct {
  31457. // TargetHttpProxies: A list of TargetHttpProxies contained in this
  31458. // scope.
  31459. TargetHttpProxies []*TargetHttpProxy `json:"targetHttpProxies,omitempty"`
  31460. // Warning: Informational warning which replaces the list of backend
  31461. // services when the list is empty.
  31462. Warning *TargetHttpProxiesScopedListWarning `json:"warning,omitempty"`
  31463. // ForceSendFields is a list of field names (e.g. "TargetHttpProxies")
  31464. // to unconditionally include in API requests. By default, fields with
  31465. // empty values are omitted from API requests. However, any non-pointer,
  31466. // non-interface field appearing in ForceSendFields will be sent to the
  31467. // server regardless of whether the field is empty or not. This may be
  31468. // used to include empty fields in Patch requests.
  31469. ForceSendFields []string `json:"-"`
  31470. // NullFields is a list of field names (e.g. "TargetHttpProxies") to
  31471. // include in API requests with the JSON null value. By default, fields
  31472. // with empty values are omitted from API requests. However, any field
  31473. // with an empty value appearing in NullFields will be sent to the
  31474. // server as null. It is an error if a field in this list has a
  31475. // non-empty value. This may be used to include null fields in Patch
  31476. // requests.
  31477. NullFields []string `json:"-"`
  31478. }
  31479. func (s *TargetHttpProxiesScopedList) MarshalJSON() ([]byte, error) {
  31480. type NoMethod TargetHttpProxiesScopedList
  31481. raw := NoMethod(*s)
  31482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31483. }
  31484. // TargetHttpProxiesScopedListWarning: Informational warning which
  31485. // replaces the list of backend services when the list is empty.
  31486. type TargetHttpProxiesScopedListWarning struct {
  31487. // Code: [Output Only] A warning code, if applicable. For example,
  31488. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31489. // the response.
  31490. //
  31491. // Possible values:
  31492. // "CLEANUP_FAILED"
  31493. // "DEPRECATED_RESOURCE_USED"
  31494. // "DEPRECATED_TYPE_USED"
  31495. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31496. // "EXPERIMENTAL_TYPE_USED"
  31497. // "EXTERNAL_API_WARNING"
  31498. // "FIELD_VALUE_OVERRIDEN"
  31499. // "INJECTED_KERNELS_DEPRECATED"
  31500. // "MISSING_TYPE_DEPENDENCY"
  31501. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31502. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31503. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31504. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31505. // "NEXT_HOP_NOT_RUNNING"
  31506. // "NOT_CRITICAL_ERROR"
  31507. // "NO_RESULTS_ON_PAGE"
  31508. // "REQUIRED_TOS_AGREEMENT"
  31509. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31510. // "RESOURCE_NOT_DELETED"
  31511. // "SCHEMA_VALIDATION_IGNORED"
  31512. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31513. // "UNDECLARED_PROPERTIES"
  31514. // "UNREACHABLE"
  31515. Code string `json:"code,omitempty"`
  31516. // Data: [Output Only] Metadata about this warning in key: value format.
  31517. // For example:
  31518. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31519. Data []*TargetHttpProxiesScopedListWarningData `json:"data,omitempty"`
  31520. // Message: [Output Only] A human-readable description of the warning
  31521. // code.
  31522. Message string `json:"message,omitempty"`
  31523. // ForceSendFields is a list of field names (e.g. "Code") to
  31524. // unconditionally include in API requests. By default, fields with
  31525. // empty values are omitted from API requests. However, any non-pointer,
  31526. // non-interface field appearing in ForceSendFields will be sent to the
  31527. // server regardless of whether the field is empty or not. This may be
  31528. // used to include empty fields in Patch requests.
  31529. ForceSendFields []string `json:"-"`
  31530. // NullFields is a list of field names (e.g. "Code") to include in API
  31531. // requests with the JSON null value. By default, fields with empty
  31532. // values are omitted from API requests. However, any field with an
  31533. // empty value appearing in NullFields will be sent to the server as
  31534. // null. It is an error if a field in this list has a non-empty value.
  31535. // This may be used to include null fields in Patch requests.
  31536. NullFields []string `json:"-"`
  31537. }
  31538. func (s *TargetHttpProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
  31539. type NoMethod TargetHttpProxiesScopedListWarning
  31540. raw := NoMethod(*s)
  31541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31542. }
  31543. type TargetHttpProxiesScopedListWarningData struct {
  31544. // Key: [Output Only] A key that provides more detail on the warning
  31545. // being returned. For example, for warnings where there are no results
  31546. // in a list request for a particular zone, this key might be scope and
  31547. // the key value might be the zone name. Other examples might be a key
  31548. // indicating a deprecated resource and a suggested replacement, or a
  31549. // warning about invalid network settings (for example, if an instance
  31550. // attempts to perform IP forwarding but is not enabled for IP
  31551. // forwarding).
  31552. Key string `json:"key,omitempty"`
  31553. // Value: [Output Only] A warning data value corresponding to the key.
  31554. Value string `json:"value,omitempty"`
  31555. // ForceSendFields is a list of field names (e.g. "Key") to
  31556. // unconditionally include in API requests. By default, fields with
  31557. // empty values are omitted from API requests. However, any non-pointer,
  31558. // non-interface field appearing in ForceSendFields will be sent to the
  31559. // server regardless of whether the field is empty or not. This may be
  31560. // used to include empty fields in Patch requests.
  31561. ForceSendFields []string `json:"-"`
  31562. // NullFields is a list of field names (e.g. "Key") to include in API
  31563. // requests with the JSON null value. By default, fields with empty
  31564. // values are omitted from API requests. However, any field with an
  31565. // empty value appearing in NullFields will be sent to the server as
  31566. // null. It is an error if a field in this list has a non-empty value.
  31567. // This may be used to include null fields in Patch requests.
  31568. NullFields []string `json:"-"`
  31569. }
  31570. func (s *TargetHttpProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
  31571. type NoMethod TargetHttpProxiesScopedListWarningData
  31572. raw := NoMethod(*s)
  31573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31574. }
  31575. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  31576. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  31577. // resource_for v1.targetHttpProxies ==)
  31578. type TargetHttpProxy struct {
  31579. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  31580. // format.
  31581. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  31582. // Description: An optional description of this resource. Provide this
  31583. // property when you create the resource.
  31584. Description string `json:"description,omitempty"`
  31585. // Id: [Output Only] The unique identifier for the resource. This
  31586. // identifier is defined by the server.
  31587. Id uint64 `json:"id,omitempty,string"`
  31588. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  31589. // for target HTTP proxies.
  31590. Kind string `json:"kind,omitempty"`
  31591. // Name: Name of the resource. Provided by the client when the resource
  31592. // is created. The name must be 1-63 characters long, and comply with
  31593. // RFC1035. Specifically, the name must be 1-63 characters long and
  31594. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  31595. // the first character must be a lowercase letter, and all following
  31596. // characters must be a dash, lowercase letter, or digit, except the
  31597. // last character, which cannot be a dash.
  31598. Name string `json:"name,omitempty"`
  31599. // ProxyBind: This field only applies when the loadBalancingScheme is
  31600. // INTERNAL_SELF_MANAGED. When set to true the Envoy binds on the IP
  31601. // address specified by the forwarding rule. Default is false.
  31602. ProxyBind bool `json:"proxyBind,omitempty"`
  31603. // Region: [Output Only] URL of the region where the regional Target
  31604. // HTTP Proxy resides. This field is not applicable to global Target
  31605. // HTTP Proxies.
  31606. Region string `json:"region,omitempty"`
  31607. // SelfLink: [Output Only] Server-defined URL for the resource.
  31608. SelfLink string `json:"selfLink,omitempty"`
  31609. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  31610. // with the resource id.
  31611. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  31612. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  31613. // to the BackendService.
  31614. UrlMap string `json:"urlMap,omitempty"`
  31615. // ServerResponse contains the HTTP response code and headers from the
  31616. // server.
  31617. googleapi.ServerResponse `json:"-"`
  31618. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  31619. // to unconditionally include in API requests. By default, fields with
  31620. // empty values are omitted from API requests. However, any non-pointer,
  31621. // non-interface field appearing in ForceSendFields will be sent to the
  31622. // server regardless of whether the field is empty or not. This may be
  31623. // used to include empty fields in Patch requests.
  31624. ForceSendFields []string `json:"-"`
  31625. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  31626. // include in API requests with the JSON null value. By default, fields
  31627. // with empty values are omitted from API requests. However, any field
  31628. // with an empty value appearing in NullFields will be sent to the
  31629. // server as null. It is an error if a field in this list has a
  31630. // non-empty value. This may be used to include null fields in Patch
  31631. // requests.
  31632. NullFields []string `json:"-"`
  31633. }
  31634. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  31635. type NoMethod TargetHttpProxy
  31636. raw := NoMethod(*s)
  31637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31638. }
  31639. type TargetHttpProxyAggregatedList struct {
  31640. // Id: [Output Only] Unique identifier for the resource; defined by the
  31641. // server.
  31642. Id string `json:"id,omitempty"`
  31643. // Items: A list of TargetHttpProxiesScopedList resources.
  31644. Items map[string]TargetHttpProxiesScopedList `json:"items,omitempty"`
  31645. // Kind: [Output Only] Type of resource. Always
  31646. // compute#targetHttpProxyAggregatedList for lists of Target HTTP
  31647. // Proxies.
  31648. Kind string `json:"kind,omitempty"`
  31649. // NextPageToken: [Output Only] This token allows you to get the next
  31650. // page of results for list requests. If the number of results is larger
  31651. // than maxResults, use the nextPageToken as a value for the query
  31652. // parameter pageToken in the next list request. Subsequent list
  31653. // requests will have their own nextPageToken to continue paging through
  31654. // the results.
  31655. NextPageToken string `json:"nextPageToken,omitempty"`
  31656. // SelfLink: [Output Only] Server-defined URL for this resource.
  31657. SelfLink string `json:"selfLink,omitempty"`
  31658. // Warning: [Output Only] Informational warning message.
  31659. Warning *TargetHttpProxyAggregatedListWarning `json:"warning,omitempty"`
  31660. // ServerResponse contains the HTTP response code and headers from the
  31661. // server.
  31662. googleapi.ServerResponse `json:"-"`
  31663. // ForceSendFields is a list of field names (e.g. "Id") to
  31664. // unconditionally include in API requests. By default, fields with
  31665. // empty values are omitted from API requests. However, any non-pointer,
  31666. // non-interface field appearing in ForceSendFields will be sent to the
  31667. // server regardless of whether the field is empty or not. This may be
  31668. // used to include empty fields in Patch requests.
  31669. ForceSendFields []string `json:"-"`
  31670. // NullFields is a list of field names (e.g. "Id") to include in API
  31671. // requests with the JSON null value. By default, fields with empty
  31672. // values are omitted from API requests. However, any field with an
  31673. // empty value appearing in NullFields will be sent to the server as
  31674. // null. It is an error if a field in this list has a non-empty value.
  31675. // This may be used to include null fields in Patch requests.
  31676. NullFields []string `json:"-"`
  31677. }
  31678. func (s *TargetHttpProxyAggregatedList) MarshalJSON() ([]byte, error) {
  31679. type NoMethod TargetHttpProxyAggregatedList
  31680. raw := NoMethod(*s)
  31681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31682. }
  31683. // TargetHttpProxyAggregatedListWarning: [Output Only] Informational
  31684. // warning message.
  31685. type TargetHttpProxyAggregatedListWarning struct {
  31686. // Code: [Output Only] A warning code, if applicable. For example,
  31687. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31688. // the response.
  31689. //
  31690. // Possible values:
  31691. // "CLEANUP_FAILED"
  31692. // "DEPRECATED_RESOURCE_USED"
  31693. // "DEPRECATED_TYPE_USED"
  31694. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31695. // "EXPERIMENTAL_TYPE_USED"
  31696. // "EXTERNAL_API_WARNING"
  31697. // "FIELD_VALUE_OVERRIDEN"
  31698. // "INJECTED_KERNELS_DEPRECATED"
  31699. // "MISSING_TYPE_DEPENDENCY"
  31700. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31701. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31702. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31703. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31704. // "NEXT_HOP_NOT_RUNNING"
  31705. // "NOT_CRITICAL_ERROR"
  31706. // "NO_RESULTS_ON_PAGE"
  31707. // "REQUIRED_TOS_AGREEMENT"
  31708. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31709. // "RESOURCE_NOT_DELETED"
  31710. // "SCHEMA_VALIDATION_IGNORED"
  31711. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31712. // "UNDECLARED_PROPERTIES"
  31713. // "UNREACHABLE"
  31714. Code string `json:"code,omitempty"`
  31715. // Data: [Output Only] Metadata about this warning in key: value format.
  31716. // For example:
  31717. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31718. Data []*TargetHttpProxyAggregatedListWarningData `json:"data,omitempty"`
  31719. // Message: [Output Only] A human-readable description of the warning
  31720. // code.
  31721. Message string `json:"message,omitempty"`
  31722. // ForceSendFields is a list of field names (e.g. "Code") to
  31723. // unconditionally include in API requests. By default, fields with
  31724. // empty values are omitted from API requests. However, any non-pointer,
  31725. // non-interface field appearing in ForceSendFields will be sent to the
  31726. // server regardless of whether the field is empty or not. This may be
  31727. // used to include empty fields in Patch requests.
  31728. ForceSendFields []string `json:"-"`
  31729. // NullFields is a list of field names (e.g. "Code") to include in API
  31730. // requests with the JSON null value. By default, fields with empty
  31731. // values are omitted from API requests. However, any field with an
  31732. // empty value appearing in NullFields will be sent to the server as
  31733. // null. It is an error if a field in this list has a non-empty value.
  31734. // This may be used to include null fields in Patch requests.
  31735. NullFields []string `json:"-"`
  31736. }
  31737. func (s *TargetHttpProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  31738. type NoMethod TargetHttpProxyAggregatedListWarning
  31739. raw := NoMethod(*s)
  31740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31741. }
  31742. type TargetHttpProxyAggregatedListWarningData struct {
  31743. // Key: [Output Only] A key that provides more detail on the warning
  31744. // being returned. For example, for warnings where there are no results
  31745. // in a list request for a particular zone, this key might be scope and
  31746. // the key value might be the zone name. Other examples might be a key
  31747. // indicating a deprecated resource and a suggested replacement, or a
  31748. // warning about invalid network settings (for example, if an instance
  31749. // attempts to perform IP forwarding but is not enabled for IP
  31750. // forwarding).
  31751. Key string `json:"key,omitempty"`
  31752. // Value: [Output Only] A warning data value corresponding to the key.
  31753. Value string `json:"value,omitempty"`
  31754. // ForceSendFields is a list of field names (e.g. "Key") to
  31755. // unconditionally include in API requests. By default, fields with
  31756. // empty values are omitted from API requests. However, any non-pointer,
  31757. // non-interface field appearing in ForceSendFields will be sent to the
  31758. // server regardless of whether the field is empty or not. This may be
  31759. // used to include empty fields in Patch requests.
  31760. ForceSendFields []string `json:"-"`
  31761. // NullFields is a list of field names (e.g. "Key") to include in API
  31762. // requests with the JSON null value. By default, fields with empty
  31763. // values are omitted from API requests. However, any field with an
  31764. // empty value appearing in NullFields will be sent to the server as
  31765. // null. It is an error if a field in this list has a non-empty value.
  31766. // This may be used to include null fields in Patch requests.
  31767. NullFields []string `json:"-"`
  31768. }
  31769. func (s *TargetHttpProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  31770. type NoMethod TargetHttpProxyAggregatedListWarningData
  31771. raw := NoMethod(*s)
  31772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31773. }
  31774. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  31775. type TargetHttpProxyList struct {
  31776. // Id: [Output Only] Unique identifier for the resource; defined by the
  31777. // server.
  31778. Id string `json:"id,omitempty"`
  31779. // Items: A list of TargetHttpProxy resources.
  31780. Items []*TargetHttpProxy `json:"items,omitempty"`
  31781. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  31782. // of target HTTP proxies.
  31783. Kind string `json:"kind,omitempty"`
  31784. // NextPageToken: [Output Only] This token allows you to get the next
  31785. // page of results for list requests. If the number of results is larger
  31786. // than maxResults, use the nextPageToken as a value for the query
  31787. // parameter pageToken in the next list request. Subsequent list
  31788. // requests will have their own nextPageToken to continue paging through
  31789. // the results.
  31790. NextPageToken string `json:"nextPageToken,omitempty"`
  31791. // SelfLink: [Output Only] Server-defined URL for this resource.
  31792. SelfLink string `json:"selfLink,omitempty"`
  31793. // Warning: [Output Only] Informational warning message.
  31794. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  31795. // ServerResponse contains the HTTP response code and headers from the
  31796. // server.
  31797. googleapi.ServerResponse `json:"-"`
  31798. // ForceSendFields is a list of field names (e.g. "Id") to
  31799. // unconditionally include in API requests. By default, fields with
  31800. // empty values are omitted from API requests. However, any non-pointer,
  31801. // non-interface field appearing in ForceSendFields will be sent to the
  31802. // server regardless of whether the field is empty or not. This may be
  31803. // used to include empty fields in Patch requests.
  31804. ForceSendFields []string `json:"-"`
  31805. // NullFields is a list of field names (e.g. "Id") to include in API
  31806. // requests with the JSON null value. By default, fields with empty
  31807. // values are omitted from API requests. However, any field with an
  31808. // empty value appearing in NullFields will be sent to the server as
  31809. // null. It is an error if a field in this list has a non-empty value.
  31810. // This may be used to include null fields in Patch requests.
  31811. NullFields []string `json:"-"`
  31812. }
  31813. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  31814. type NoMethod TargetHttpProxyList
  31815. raw := NoMethod(*s)
  31816. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31817. }
  31818. // TargetHttpProxyListWarning: [Output Only] Informational warning
  31819. // message.
  31820. type TargetHttpProxyListWarning struct {
  31821. // Code: [Output Only] A warning code, if applicable. For example,
  31822. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31823. // the response.
  31824. //
  31825. // Possible values:
  31826. // "CLEANUP_FAILED"
  31827. // "DEPRECATED_RESOURCE_USED"
  31828. // "DEPRECATED_TYPE_USED"
  31829. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31830. // "EXPERIMENTAL_TYPE_USED"
  31831. // "EXTERNAL_API_WARNING"
  31832. // "FIELD_VALUE_OVERRIDEN"
  31833. // "INJECTED_KERNELS_DEPRECATED"
  31834. // "MISSING_TYPE_DEPENDENCY"
  31835. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31836. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31837. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31838. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31839. // "NEXT_HOP_NOT_RUNNING"
  31840. // "NOT_CRITICAL_ERROR"
  31841. // "NO_RESULTS_ON_PAGE"
  31842. // "REQUIRED_TOS_AGREEMENT"
  31843. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31844. // "RESOURCE_NOT_DELETED"
  31845. // "SCHEMA_VALIDATION_IGNORED"
  31846. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31847. // "UNDECLARED_PROPERTIES"
  31848. // "UNREACHABLE"
  31849. Code string `json:"code,omitempty"`
  31850. // Data: [Output Only] Metadata about this warning in key: value format.
  31851. // For example:
  31852. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31853. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  31854. // Message: [Output Only] A human-readable description of the warning
  31855. // code.
  31856. Message string `json:"message,omitempty"`
  31857. // ForceSendFields is a list of field names (e.g. "Code") to
  31858. // unconditionally include in API requests. By default, fields with
  31859. // empty values are omitted from API requests. However, any non-pointer,
  31860. // non-interface field appearing in ForceSendFields will be sent to the
  31861. // server regardless of whether the field is empty or not. This may be
  31862. // used to include empty fields in Patch requests.
  31863. ForceSendFields []string `json:"-"`
  31864. // NullFields is a list of field names (e.g. "Code") to include in API
  31865. // requests with the JSON null value. By default, fields with empty
  31866. // values are omitted from API requests. However, any field with an
  31867. // empty value appearing in NullFields will be sent to the server as
  31868. // null. It is an error if a field in this list has a non-empty value.
  31869. // This may be used to include null fields in Patch requests.
  31870. NullFields []string `json:"-"`
  31871. }
  31872. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  31873. type NoMethod TargetHttpProxyListWarning
  31874. raw := NoMethod(*s)
  31875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31876. }
  31877. type TargetHttpProxyListWarningData struct {
  31878. // Key: [Output Only] A key that provides more detail on the warning
  31879. // being returned. For example, for warnings where there are no results
  31880. // in a list request for a particular zone, this key might be scope and
  31881. // the key value might be the zone name. Other examples might be a key
  31882. // indicating a deprecated resource and a suggested replacement, or a
  31883. // warning about invalid network settings (for example, if an instance
  31884. // attempts to perform IP forwarding but is not enabled for IP
  31885. // forwarding).
  31886. Key string `json:"key,omitempty"`
  31887. // Value: [Output Only] A warning data value corresponding to the key.
  31888. Value string `json:"value,omitempty"`
  31889. // ForceSendFields is a list of field names (e.g. "Key") to
  31890. // unconditionally include in API requests. By default, fields with
  31891. // empty values are omitted from API requests. However, any non-pointer,
  31892. // non-interface field appearing in ForceSendFields will be sent to the
  31893. // server regardless of whether the field is empty or not. This may be
  31894. // used to include empty fields in Patch requests.
  31895. ForceSendFields []string `json:"-"`
  31896. // NullFields is a list of field names (e.g. "Key") to include in API
  31897. // requests with the JSON null value. By default, fields with empty
  31898. // values are omitted from API requests. However, any field with an
  31899. // empty value appearing in NullFields will be sent to the server as
  31900. // null. It is an error if a field in this list has a non-empty value.
  31901. // This may be used to include null fields in Patch requests.
  31902. NullFields []string `json:"-"`
  31903. }
  31904. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  31905. type NoMethod TargetHttpProxyListWarningData
  31906. raw := NoMethod(*s)
  31907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31908. }
  31909. type TargetHttpsProxiesScopedList struct {
  31910. // TargetHttpsProxies: A list of TargetHttpsProxies contained in this
  31911. // scope.
  31912. TargetHttpsProxies []*TargetHttpsProxy `json:"targetHttpsProxies,omitempty"`
  31913. // Warning: Informational warning which replaces the list of backend
  31914. // services when the list is empty.
  31915. Warning *TargetHttpsProxiesScopedListWarning `json:"warning,omitempty"`
  31916. // ForceSendFields is a list of field names (e.g. "TargetHttpsProxies")
  31917. // to unconditionally include in API requests. By default, fields with
  31918. // empty values are omitted from API requests. However, any non-pointer,
  31919. // non-interface field appearing in ForceSendFields will be sent to the
  31920. // server regardless of whether the field is empty or not. This may be
  31921. // used to include empty fields in Patch requests.
  31922. ForceSendFields []string `json:"-"`
  31923. // NullFields is a list of field names (e.g. "TargetHttpsProxies") to
  31924. // include in API requests with the JSON null value. By default, fields
  31925. // with empty values are omitted from API requests. However, any field
  31926. // with an empty value appearing in NullFields will be sent to the
  31927. // server as null. It is an error if a field in this list has a
  31928. // non-empty value. This may be used to include null fields in Patch
  31929. // requests.
  31930. NullFields []string `json:"-"`
  31931. }
  31932. func (s *TargetHttpsProxiesScopedList) MarshalJSON() ([]byte, error) {
  31933. type NoMethod TargetHttpsProxiesScopedList
  31934. raw := NoMethod(*s)
  31935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31936. }
  31937. // TargetHttpsProxiesScopedListWarning: Informational warning which
  31938. // replaces the list of backend services when the list is empty.
  31939. type TargetHttpsProxiesScopedListWarning struct {
  31940. // Code: [Output Only] A warning code, if applicable. For example,
  31941. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  31942. // the response.
  31943. //
  31944. // Possible values:
  31945. // "CLEANUP_FAILED"
  31946. // "DEPRECATED_RESOURCE_USED"
  31947. // "DEPRECATED_TYPE_USED"
  31948. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  31949. // "EXPERIMENTAL_TYPE_USED"
  31950. // "EXTERNAL_API_WARNING"
  31951. // "FIELD_VALUE_OVERRIDEN"
  31952. // "INJECTED_KERNELS_DEPRECATED"
  31953. // "MISSING_TYPE_DEPENDENCY"
  31954. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  31955. // "NEXT_HOP_CANNOT_IP_FORWARD"
  31956. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  31957. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  31958. // "NEXT_HOP_NOT_RUNNING"
  31959. // "NOT_CRITICAL_ERROR"
  31960. // "NO_RESULTS_ON_PAGE"
  31961. // "REQUIRED_TOS_AGREEMENT"
  31962. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  31963. // "RESOURCE_NOT_DELETED"
  31964. // "SCHEMA_VALIDATION_IGNORED"
  31965. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  31966. // "UNDECLARED_PROPERTIES"
  31967. // "UNREACHABLE"
  31968. Code string `json:"code,omitempty"`
  31969. // Data: [Output Only] Metadata about this warning in key: value format.
  31970. // For example:
  31971. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  31972. Data []*TargetHttpsProxiesScopedListWarningData `json:"data,omitempty"`
  31973. // Message: [Output Only] A human-readable description of the warning
  31974. // code.
  31975. Message string `json:"message,omitempty"`
  31976. // ForceSendFields is a list of field names (e.g. "Code") to
  31977. // unconditionally include in API requests. By default, fields with
  31978. // empty values are omitted from API requests. However, any non-pointer,
  31979. // non-interface field appearing in ForceSendFields will be sent to the
  31980. // server regardless of whether the field is empty or not. This may be
  31981. // used to include empty fields in Patch requests.
  31982. ForceSendFields []string `json:"-"`
  31983. // NullFields is a list of field names (e.g. "Code") to include in API
  31984. // requests with the JSON null value. By default, fields with empty
  31985. // values are omitted from API requests. However, any field with an
  31986. // empty value appearing in NullFields will be sent to the server as
  31987. // null. It is an error if a field in this list has a non-empty value.
  31988. // This may be used to include null fields in Patch requests.
  31989. NullFields []string `json:"-"`
  31990. }
  31991. func (s *TargetHttpsProxiesScopedListWarning) MarshalJSON() ([]byte, error) {
  31992. type NoMethod TargetHttpsProxiesScopedListWarning
  31993. raw := NoMethod(*s)
  31994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  31995. }
  31996. type TargetHttpsProxiesScopedListWarningData struct {
  31997. // Key: [Output Only] A key that provides more detail on the warning
  31998. // being returned. For example, for warnings where there are no results
  31999. // in a list request for a particular zone, this key might be scope and
  32000. // the key value might be the zone name. Other examples might be a key
  32001. // indicating a deprecated resource and a suggested replacement, or a
  32002. // warning about invalid network settings (for example, if an instance
  32003. // attempts to perform IP forwarding but is not enabled for IP
  32004. // forwarding).
  32005. Key string `json:"key,omitempty"`
  32006. // Value: [Output Only] A warning data value corresponding to the key.
  32007. Value string `json:"value,omitempty"`
  32008. // ForceSendFields is a list of field names (e.g. "Key") to
  32009. // unconditionally include in API requests. By default, fields with
  32010. // empty values are omitted from API requests. However, any non-pointer,
  32011. // non-interface field appearing in ForceSendFields will be sent to the
  32012. // server regardless of whether the field is empty or not. This may be
  32013. // used to include empty fields in Patch requests.
  32014. ForceSendFields []string `json:"-"`
  32015. // NullFields is a list of field names (e.g. "Key") to include in API
  32016. // requests with the JSON null value. By default, fields with empty
  32017. // values are omitted from API requests. However, any field with an
  32018. // empty value appearing in NullFields will be sent to the server as
  32019. // null. It is an error if a field in this list has a non-empty value.
  32020. // This may be used to include null fields in Patch requests.
  32021. NullFields []string `json:"-"`
  32022. }
  32023. func (s *TargetHttpsProxiesScopedListWarningData) MarshalJSON() ([]byte, error) {
  32024. type NoMethod TargetHttpsProxiesScopedListWarningData
  32025. raw := NoMethod(*s)
  32026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32027. }
  32028. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  32029. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  32030. //
  32031. // Possible values:
  32032. // "DISABLE"
  32033. // "ENABLE"
  32034. // "NONE"
  32035. QuicOverride string `json:"quicOverride,omitempty"`
  32036. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  32037. // unconditionally include in API requests. By default, fields with
  32038. // empty values are omitted from API requests. However, any non-pointer,
  32039. // non-interface field appearing in ForceSendFields will be sent to the
  32040. // server regardless of whether the field is empty or not. This may be
  32041. // used to include empty fields in Patch requests.
  32042. ForceSendFields []string `json:"-"`
  32043. // NullFields is a list of field names (e.g. "QuicOverride") to include
  32044. // in API requests with the JSON null value. By default, fields with
  32045. // empty values are omitted from API requests. However, any field with
  32046. // an empty value appearing in NullFields will be sent to the server as
  32047. // null. It is an error if a field in this list has a non-empty value.
  32048. // This may be used to include null fields in Patch requests.
  32049. NullFields []string `json:"-"`
  32050. }
  32051. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  32052. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  32053. raw := NoMethod(*s)
  32054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32055. }
  32056. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  32057. // SslCertificates: New set of SslCertificate resources to associate
  32058. // with this TargetHttpsProxy resource. Currently exactly one
  32059. // SslCertificate resource must be specified.
  32060. SslCertificates []string `json:"sslCertificates,omitempty"`
  32061. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  32062. // unconditionally include in API requests. By default, fields with
  32063. // empty values are omitted from API requests. However, any non-pointer,
  32064. // non-interface field appearing in ForceSendFields will be sent to the
  32065. // server regardless of whether the field is empty or not. This may be
  32066. // used to include empty fields in Patch requests.
  32067. ForceSendFields []string `json:"-"`
  32068. // NullFields is a list of field names (e.g. "SslCertificates") to
  32069. // include in API requests with the JSON null value. By default, fields
  32070. // with empty values are omitted from API requests. However, any field
  32071. // with an empty value appearing in NullFields will be sent to the
  32072. // server as null. It is an error if a field in this list has a
  32073. // non-empty value. This may be used to include null fields in Patch
  32074. // requests.
  32075. NullFields []string `json:"-"`
  32076. }
  32077. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  32078. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  32079. raw := NoMethod(*s)
  32080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32081. }
  32082. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  32083. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  32084. // resource_for v1.targetHttpsProxies ==)
  32085. type TargetHttpsProxy struct {
  32086. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  32087. // format.
  32088. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  32089. // Description: An optional description of this resource. Provide this
  32090. // property when you create the resource.
  32091. Description string `json:"description,omitempty"`
  32092. // Id: [Output Only] The unique identifier for the resource. This
  32093. // identifier is defined by the server.
  32094. Id uint64 `json:"id,omitempty,string"`
  32095. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  32096. // for target HTTPS proxies.
  32097. Kind string `json:"kind,omitempty"`
  32098. // Name: Name of the resource. Provided by the client when the resource
  32099. // is created. The name must be 1-63 characters long, and comply with
  32100. // RFC1035. Specifically, the name must be 1-63 characters long and
  32101. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  32102. // the first character must be a lowercase letter, and all following
  32103. // characters must be a dash, lowercase letter, or digit, except the
  32104. // last character, which cannot be a dash.
  32105. Name string `json:"name,omitempty"`
  32106. // ProxyBind: This field only applies when the loadBalancingScheme is
  32107. // INTERNAL_SELF_MANAGED. When set to true the Envoy binds on the IP
  32108. // address specified by the forwarding rule. Default is false.
  32109. ProxyBind bool `json:"proxyBind,omitempty"`
  32110. // QuicOverride: Specifies the QUIC override policy for this
  32111. // TargetHttpsProxy resource. This determines whether the load balancer
  32112. // will attempt to negotiate QUIC with clients or not. Can specify one
  32113. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  32114. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  32115. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  32116. // overrides, which is equivalent to DISABLE. Not specifying this field
  32117. // is equivalent to specifying NONE.
  32118. //
  32119. // Possible values:
  32120. // "DISABLE"
  32121. // "ENABLE"
  32122. // "NONE"
  32123. QuicOverride string `json:"quicOverride,omitempty"`
  32124. // Region: [Output Only] URL of the region where the regional
  32125. // TargetHttpsProxy resides. This field is not applicable to global
  32126. // TargetHttpsProxies.
  32127. Region string `json:"region,omitempty"`
  32128. // SelfLink: [Output Only] Server-defined URL for the resource.
  32129. SelfLink string `json:"selfLink,omitempty"`
  32130. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  32131. // with the resource id.
  32132. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  32133. // SslCertificates: URLs to SslCertificate resources that are used to
  32134. // authenticate connections between users and the load balancer. At
  32135. // least one SSL certificate must be specified. Currently, you may
  32136. // specify up to 15 SSL certificates.
  32137. SslCertificates []string `json:"sslCertificates,omitempty"`
  32138. // SslPolicy: URL of SslPolicy resource that will be associated with the
  32139. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  32140. // will not have any SSL policy configured.
  32141. SslPolicy string `json:"sslPolicy,omitempty"`
  32142. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  32143. // that defines the mapping from URL to the BackendService. For example,
  32144. // the following are all valid URLs for specifying a URL map:
  32145. // -
  32146. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  32147. // - projects/project/global/urlMaps/url-map
  32148. // - global/urlMaps/url-map
  32149. UrlMap string `json:"urlMap,omitempty"`
  32150. // ServerResponse contains the HTTP response code and headers from the
  32151. // server.
  32152. googleapi.ServerResponse `json:"-"`
  32153. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  32154. // to unconditionally include in API requests. By default, fields with
  32155. // empty values are omitted from API requests. However, any non-pointer,
  32156. // non-interface field appearing in ForceSendFields will be sent to the
  32157. // server regardless of whether the field is empty or not. This may be
  32158. // used to include empty fields in Patch requests.
  32159. ForceSendFields []string `json:"-"`
  32160. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  32161. // include in API requests with the JSON null value. By default, fields
  32162. // with empty values are omitted from API requests. However, any field
  32163. // with an empty value appearing in NullFields will be sent to the
  32164. // server as null. It is an error if a field in this list has a
  32165. // non-empty value. This may be used to include null fields in Patch
  32166. // requests.
  32167. NullFields []string `json:"-"`
  32168. }
  32169. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  32170. type NoMethod TargetHttpsProxy
  32171. raw := NoMethod(*s)
  32172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32173. }
  32174. type TargetHttpsProxyAggregatedList struct {
  32175. // Id: [Output Only] Unique identifier for the resource; defined by the
  32176. // server.
  32177. Id string `json:"id,omitempty"`
  32178. // Items: A list of TargetHttpsProxiesScopedList resources.
  32179. Items map[string]TargetHttpsProxiesScopedList `json:"items,omitempty"`
  32180. // Kind: [Output Only] Type of resource. Always
  32181. // compute#targetHttpsProxyAggregatedList for lists of Target HTTP
  32182. // Proxies.
  32183. Kind string `json:"kind,omitempty"`
  32184. // NextPageToken: [Output Only] This token allows you to get the next
  32185. // page of results for list requests. If the number of results is larger
  32186. // than maxResults, use the nextPageToken as a value for the query
  32187. // parameter pageToken in the next list request. Subsequent list
  32188. // requests will have their own nextPageToken to continue paging through
  32189. // the results.
  32190. NextPageToken string `json:"nextPageToken,omitempty"`
  32191. // SelfLink: [Output Only] Server-defined URL for this resource.
  32192. SelfLink string `json:"selfLink,omitempty"`
  32193. // Warning: [Output Only] Informational warning message.
  32194. Warning *TargetHttpsProxyAggregatedListWarning `json:"warning,omitempty"`
  32195. // ServerResponse contains the HTTP response code and headers from the
  32196. // server.
  32197. googleapi.ServerResponse `json:"-"`
  32198. // ForceSendFields is a list of field names (e.g. "Id") to
  32199. // unconditionally include in API requests. By default, fields with
  32200. // empty values are omitted from API requests. However, any non-pointer,
  32201. // non-interface field appearing in ForceSendFields will be sent to the
  32202. // server regardless of whether the field is empty or not. This may be
  32203. // used to include empty fields in Patch requests.
  32204. ForceSendFields []string `json:"-"`
  32205. // NullFields is a list of field names (e.g. "Id") to include in API
  32206. // requests with the JSON null value. By default, fields with empty
  32207. // values are omitted from API requests. However, any field with an
  32208. // empty value appearing in NullFields will be sent to the server as
  32209. // null. It is an error if a field in this list has a non-empty value.
  32210. // This may be used to include null fields in Patch requests.
  32211. NullFields []string `json:"-"`
  32212. }
  32213. func (s *TargetHttpsProxyAggregatedList) MarshalJSON() ([]byte, error) {
  32214. type NoMethod TargetHttpsProxyAggregatedList
  32215. raw := NoMethod(*s)
  32216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32217. }
  32218. // TargetHttpsProxyAggregatedListWarning: [Output Only] Informational
  32219. // warning message.
  32220. type TargetHttpsProxyAggregatedListWarning struct {
  32221. // Code: [Output Only] A warning code, if applicable. For example,
  32222. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32223. // the response.
  32224. //
  32225. // Possible values:
  32226. // "CLEANUP_FAILED"
  32227. // "DEPRECATED_RESOURCE_USED"
  32228. // "DEPRECATED_TYPE_USED"
  32229. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32230. // "EXPERIMENTAL_TYPE_USED"
  32231. // "EXTERNAL_API_WARNING"
  32232. // "FIELD_VALUE_OVERRIDEN"
  32233. // "INJECTED_KERNELS_DEPRECATED"
  32234. // "MISSING_TYPE_DEPENDENCY"
  32235. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32236. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32237. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32238. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32239. // "NEXT_HOP_NOT_RUNNING"
  32240. // "NOT_CRITICAL_ERROR"
  32241. // "NO_RESULTS_ON_PAGE"
  32242. // "REQUIRED_TOS_AGREEMENT"
  32243. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32244. // "RESOURCE_NOT_DELETED"
  32245. // "SCHEMA_VALIDATION_IGNORED"
  32246. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32247. // "UNDECLARED_PROPERTIES"
  32248. // "UNREACHABLE"
  32249. Code string `json:"code,omitempty"`
  32250. // Data: [Output Only] Metadata about this warning in key: value format.
  32251. // For example:
  32252. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32253. Data []*TargetHttpsProxyAggregatedListWarningData `json:"data,omitempty"`
  32254. // Message: [Output Only] A human-readable description of the warning
  32255. // code.
  32256. Message string `json:"message,omitempty"`
  32257. // ForceSendFields is a list of field names (e.g. "Code") to
  32258. // unconditionally include in API requests. By default, fields with
  32259. // empty values are omitted from API requests. However, any non-pointer,
  32260. // non-interface field appearing in ForceSendFields will be sent to the
  32261. // server regardless of whether the field is empty or not. This may be
  32262. // used to include empty fields in Patch requests.
  32263. ForceSendFields []string `json:"-"`
  32264. // NullFields is a list of field names (e.g. "Code") to include in API
  32265. // requests with the JSON null value. By default, fields with empty
  32266. // values are omitted from API requests. However, any field with an
  32267. // empty value appearing in NullFields will be sent to the server as
  32268. // null. It is an error if a field in this list has a non-empty value.
  32269. // This may be used to include null fields in Patch requests.
  32270. NullFields []string `json:"-"`
  32271. }
  32272. func (s *TargetHttpsProxyAggregatedListWarning) MarshalJSON() ([]byte, error) {
  32273. type NoMethod TargetHttpsProxyAggregatedListWarning
  32274. raw := NoMethod(*s)
  32275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32276. }
  32277. type TargetHttpsProxyAggregatedListWarningData struct {
  32278. // Key: [Output Only] A key that provides more detail on the warning
  32279. // being returned. For example, for warnings where there are no results
  32280. // in a list request for a particular zone, this key might be scope and
  32281. // the key value might be the zone name. Other examples might be a key
  32282. // indicating a deprecated resource and a suggested replacement, or a
  32283. // warning about invalid network settings (for example, if an instance
  32284. // attempts to perform IP forwarding but is not enabled for IP
  32285. // forwarding).
  32286. Key string `json:"key,omitempty"`
  32287. // Value: [Output Only] A warning data value corresponding to the key.
  32288. Value string `json:"value,omitempty"`
  32289. // ForceSendFields is a list of field names (e.g. "Key") to
  32290. // unconditionally include in API requests. By default, fields with
  32291. // empty values are omitted from API requests. However, any non-pointer,
  32292. // non-interface field appearing in ForceSendFields will be sent to the
  32293. // server regardless of whether the field is empty or not. This may be
  32294. // used to include empty fields in Patch requests.
  32295. ForceSendFields []string `json:"-"`
  32296. // NullFields is a list of field names (e.g. "Key") to include in API
  32297. // requests with the JSON null value. By default, fields with empty
  32298. // values are omitted from API requests. However, any field with an
  32299. // empty value appearing in NullFields will be sent to the server as
  32300. // null. It is an error if a field in this list has a non-empty value.
  32301. // This may be used to include null fields in Patch requests.
  32302. NullFields []string `json:"-"`
  32303. }
  32304. func (s *TargetHttpsProxyAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  32305. type NoMethod TargetHttpsProxyAggregatedListWarningData
  32306. raw := NoMethod(*s)
  32307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32308. }
  32309. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  32310. type TargetHttpsProxyList struct {
  32311. // Id: [Output Only] Unique identifier for the resource; defined by the
  32312. // server.
  32313. Id string `json:"id,omitempty"`
  32314. // Items: A list of TargetHttpsProxy resources.
  32315. Items []*TargetHttpsProxy `json:"items,omitempty"`
  32316. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  32317. // of target HTTPS proxies.
  32318. Kind string `json:"kind,omitempty"`
  32319. // NextPageToken: [Output Only] This token allows you to get the next
  32320. // page of results for list requests. If the number of results is larger
  32321. // than maxResults, use the nextPageToken as a value for the query
  32322. // parameter pageToken in the next list request. Subsequent list
  32323. // requests will have their own nextPageToken to continue paging through
  32324. // the results.
  32325. NextPageToken string `json:"nextPageToken,omitempty"`
  32326. // SelfLink: [Output Only] Server-defined URL for this resource.
  32327. SelfLink string `json:"selfLink,omitempty"`
  32328. // Warning: [Output Only] Informational warning message.
  32329. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  32330. // ServerResponse contains the HTTP response code and headers from the
  32331. // server.
  32332. googleapi.ServerResponse `json:"-"`
  32333. // ForceSendFields is a list of field names (e.g. "Id") to
  32334. // unconditionally include in API requests. By default, fields with
  32335. // empty values are omitted from API requests. However, any non-pointer,
  32336. // non-interface field appearing in ForceSendFields will be sent to the
  32337. // server regardless of whether the field is empty or not. This may be
  32338. // used to include empty fields in Patch requests.
  32339. ForceSendFields []string `json:"-"`
  32340. // NullFields is a list of field names (e.g. "Id") to include in API
  32341. // requests with the JSON null value. By default, fields with empty
  32342. // values are omitted from API requests. However, any field with an
  32343. // empty value appearing in NullFields will be sent to the server as
  32344. // null. It is an error if a field in this list has a non-empty value.
  32345. // This may be used to include null fields in Patch requests.
  32346. NullFields []string `json:"-"`
  32347. }
  32348. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  32349. type NoMethod TargetHttpsProxyList
  32350. raw := NoMethod(*s)
  32351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32352. }
  32353. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  32354. // message.
  32355. type TargetHttpsProxyListWarning struct {
  32356. // Code: [Output Only] A warning code, if applicable. For example,
  32357. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32358. // the response.
  32359. //
  32360. // Possible values:
  32361. // "CLEANUP_FAILED"
  32362. // "DEPRECATED_RESOURCE_USED"
  32363. // "DEPRECATED_TYPE_USED"
  32364. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32365. // "EXPERIMENTAL_TYPE_USED"
  32366. // "EXTERNAL_API_WARNING"
  32367. // "FIELD_VALUE_OVERRIDEN"
  32368. // "INJECTED_KERNELS_DEPRECATED"
  32369. // "MISSING_TYPE_DEPENDENCY"
  32370. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32371. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32372. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32373. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32374. // "NEXT_HOP_NOT_RUNNING"
  32375. // "NOT_CRITICAL_ERROR"
  32376. // "NO_RESULTS_ON_PAGE"
  32377. // "REQUIRED_TOS_AGREEMENT"
  32378. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32379. // "RESOURCE_NOT_DELETED"
  32380. // "SCHEMA_VALIDATION_IGNORED"
  32381. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32382. // "UNDECLARED_PROPERTIES"
  32383. // "UNREACHABLE"
  32384. Code string `json:"code,omitempty"`
  32385. // Data: [Output Only] Metadata about this warning in key: value format.
  32386. // For example:
  32387. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32388. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  32389. // Message: [Output Only] A human-readable description of the warning
  32390. // code.
  32391. Message string `json:"message,omitempty"`
  32392. // ForceSendFields is a list of field names (e.g. "Code") to
  32393. // unconditionally include in API requests. By default, fields with
  32394. // empty values are omitted from API requests. However, any non-pointer,
  32395. // non-interface field appearing in ForceSendFields will be sent to the
  32396. // server regardless of whether the field is empty or not. This may be
  32397. // used to include empty fields in Patch requests.
  32398. ForceSendFields []string `json:"-"`
  32399. // NullFields is a list of field names (e.g. "Code") to include in API
  32400. // requests with the JSON null value. By default, fields with empty
  32401. // values are omitted from API requests. However, any field with an
  32402. // empty value appearing in NullFields will be sent to the server as
  32403. // null. It is an error if a field in this list has a non-empty value.
  32404. // This may be used to include null fields in Patch requests.
  32405. NullFields []string `json:"-"`
  32406. }
  32407. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  32408. type NoMethod TargetHttpsProxyListWarning
  32409. raw := NoMethod(*s)
  32410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32411. }
  32412. type TargetHttpsProxyListWarningData struct {
  32413. // Key: [Output Only] A key that provides more detail on the warning
  32414. // being returned. For example, for warnings where there are no results
  32415. // in a list request for a particular zone, this key might be scope and
  32416. // the key value might be the zone name. Other examples might be a key
  32417. // indicating a deprecated resource and a suggested replacement, or a
  32418. // warning about invalid network settings (for example, if an instance
  32419. // attempts to perform IP forwarding but is not enabled for IP
  32420. // forwarding).
  32421. Key string `json:"key,omitempty"`
  32422. // Value: [Output Only] A warning data value corresponding to the key.
  32423. Value string `json:"value,omitempty"`
  32424. // ForceSendFields is a list of field names (e.g. "Key") to
  32425. // unconditionally include in API requests. By default, fields with
  32426. // empty values are omitted from API requests. However, any non-pointer,
  32427. // non-interface field appearing in ForceSendFields will be sent to the
  32428. // server regardless of whether the field is empty or not. This may be
  32429. // used to include empty fields in Patch requests.
  32430. ForceSendFields []string `json:"-"`
  32431. // NullFields is a list of field names (e.g. "Key") to include in API
  32432. // requests with the JSON null value. By default, fields with empty
  32433. // values are omitted from API requests. However, any field with an
  32434. // empty value appearing in NullFields will be sent to the server as
  32435. // null. It is an error if a field in this list has a non-empty value.
  32436. // This may be used to include null fields in Patch requests.
  32437. NullFields []string `json:"-"`
  32438. }
  32439. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  32440. type NoMethod TargetHttpsProxyListWarningData
  32441. raw := NoMethod(*s)
  32442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32443. }
  32444. // TargetInstance: A TargetInstance resource. This resource defines an
  32445. // endpoint instance that terminates traffic of certain protocols. (==
  32446. // resource_for beta.targetInstances ==) (== resource_for
  32447. // v1.targetInstances ==)
  32448. type TargetInstance struct {
  32449. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  32450. // format.
  32451. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  32452. // Description: An optional description of this resource. Provide this
  32453. // property when you create the resource.
  32454. Description string `json:"description,omitempty"`
  32455. // Id: [Output Only] The unique identifier for the resource. This
  32456. // identifier is defined by the server.
  32457. Id uint64 `json:"id,omitempty,string"`
  32458. // Instance: A URL to the virtual machine instance that handles traffic
  32459. // for this target instance. When creating a target instance, you can
  32460. // provide the fully-qualified URL or a valid partial URL to the desired
  32461. // virtual machine. For example, the following are all valid URLs:
  32462. // -
  32463. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  32464. // - projects/project/zones/zone/instances/instance
  32465. // - zones/zone/instances/instance
  32466. Instance string `json:"instance,omitempty"`
  32467. // Kind: [Output Only] The type of the resource. Always
  32468. // compute#targetInstance for target instances.
  32469. Kind string `json:"kind,omitempty"`
  32470. // Name: Name of the resource. Provided by the client when the resource
  32471. // is created. The name must be 1-63 characters long, and comply with
  32472. // RFC1035. Specifically, the name must be 1-63 characters long and
  32473. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  32474. // the first character must be a lowercase letter, and all following
  32475. // characters must be a dash, lowercase letter, or digit, except the
  32476. // last character, which cannot be a dash.
  32477. Name string `json:"name,omitempty"`
  32478. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  32479. // Currently only NO_NAT (default value) is supported.
  32480. //
  32481. // Possible values:
  32482. // "NO_NAT"
  32483. NatPolicy string `json:"natPolicy,omitempty"`
  32484. // SelfLink: [Output Only] Server-defined URL for the resource.
  32485. SelfLink string `json:"selfLink,omitempty"`
  32486. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  32487. // with the resource id.
  32488. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  32489. // Zone: [Output Only] URL of the zone where the target instance
  32490. // resides. You must specify this field as part of the HTTP request URL.
  32491. // It is not settable as a field in the request body.
  32492. Zone string `json:"zone,omitempty"`
  32493. // ServerResponse contains the HTTP response code and headers from the
  32494. // server.
  32495. googleapi.ServerResponse `json:"-"`
  32496. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  32497. // to unconditionally include in API requests. By default, fields with
  32498. // empty values are omitted from API requests. However, any non-pointer,
  32499. // non-interface field appearing in ForceSendFields will be sent to the
  32500. // server regardless of whether the field is empty or not. This may be
  32501. // used to include empty fields in Patch requests.
  32502. ForceSendFields []string `json:"-"`
  32503. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  32504. // include in API requests with the JSON null value. By default, fields
  32505. // with empty values are omitted from API requests. However, any field
  32506. // with an empty value appearing in NullFields will be sent to the
  32507. // server as null. It is an error if a field in this list has a
  32508. // non-empty value. This may be used to include null fields in Patch
  32509. // requests.
  32510. NullFields []string `json:"-"`
  32511. }
  32512. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  32513. type NoMethod TargetInstance
  32514. raw := NoMethod(*s)
  32515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32516. }
  32517. type TargetInstanceAggregatedList struct {
  32518. // Id: [Output Only] Unique identifier for the resource; defined by the
  32519. // server.
  32520. Id string `json:"id,omitempty"`
  32521. // Items: A list of TargetInstance resources.
  32522. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  32523. // Kind: Type of resource.
  32524. Kind string `json:"kind,omitempty"`
  32525. // NextPageToken: [Output Only] This token allows you to get the next
  32526. // page of results for list requests. If the number of results is larger
  32527. // than maxResults, use the nextPageToken as a value for the query
  32528. // parameter pageToken in the next list request. Subsequent list
  32529. // requests will have their own nextPageToken to continue paging through
  32530. // the results.
  32531. NextPageToken string `json:"nextPageToken,omitempty"`
  32532. // SelfLink: [Output Only] Server-defined URL for this resource.
  32533. SelfLink string `json:"selfLink,omitempty"`
  32534. // Warning: [Output Only] Informational warning message.
  32535. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  32536. // ServerResponse contains the HTTP response code and headers from the
  32537. // server.
  32538. googleapi.ServerResponse `json:"-"`
  32539. // ForceSendFields is a list of field names (e.g. "Id") to
  32540. // unconditionally include in API requests. By default, fields with
  32541. // empty values are omitted from API requests. However, any non-pointer,
  32542. // non-interface field appearing in ForceSendFields will be sent to the
  32543. // server regardless of whether the field is empty or not. This may be
  32544. // used to include empty fields in Patch requests.
  32545. ForceSendFields []string `json:"-"`
  32546. // NullFields is a list of field names (e.g. "Id") to include in API
  32547. // requests with the JSON null value. By default, fields with empty
  32548. // values are omitted from API requests. However, any field with an
  32549. // empty value appearing in NullFields will be sent to the server as
  32550. // null. It is an error if a field in this list has a non-empty value.
  32551. // This may be used to include null fields in Patch requests.
  32552. NullFields []string `json:"-"`
  32553. }
  32554. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  32555. type NoMethod TargetInstanceAggregatedList
  32556. raw := NoMethod(*s)
  32557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32558. }
  32559. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  32560. // warning message.
  32561. type TargetInstanceAggregatedListWarning struct {
  32562. // Code: [Output Only] A warning code, if applicable. For example,
  32563. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32564. // the response.
  32565. //
  32566. // Possible values:
  32567. // "CLEANUP_FAILED"
  32568. // "DEPRECATED_RESOURCE_USED"
  32569. // "DEPRECATED_TYPE_USED"
  32570. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32571. // "EXPERIMENTAL_TYPE_USED"
  32572. // "EXTERNAL_API_WARNING"
  32573. // "FIELD_VALUE_OVERRIDEN"
  32574. // "INJECTED_KERNELS_DEPRECATED"
  32575. // "MISSING_TYPE_DEPENDENCY"
  32576. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32577. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32578. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32579. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32580. // "NEXT_HOP_NOT_RUNNING"
  32581. // "NOT_CRITICAL_ERROR"
  32582. // "NO_RESULTS_ON_PAGE"
  32583. // "REQUIRED_TOS_AGREEMENT"
  32584. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32585. // "RESOURCE_NOT_DELETED"
  32586. // "SCHEMA_VALIDATION_IGNORED"
  32587. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32588. // "UNDECLARED_PROPERTIES"
  32589. // "UNREACHABLE"
  32590. Code string `json:"code,omitempty"`
  32591. // Data: [Output Only] Metadata about this warning in key: value format.
  32592. // For example:
  32593. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32594. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  32595. // Message: [Output Only] A human-readable description of the warning
  32596. // code.
  32597. Message string `json:"message,omitempty"`
  32598. // ForceSendFields is a list of field names (e.g. "Code") to
  32599. // unconditionally include in API requests. By default, fields with
  32600. // empty values are omitted from API requests. However, any non-pointer,
  32601. // non-interface field appearing in ForceSendFields will be sent to the
  32602. // server regardless of whether the field is empty or not. This may be
  32603. // used to include empty fields in Patch requests.
  32604. ForceSendFields []string `json:"-"`
  32605. // NullFields is a list of field names (e.g. "Code") to include in API
  32606. // requests with the JSON null value. By default, fields with empty
  32607. // values are omitted from API requests. However, any field with an
  32608. // empty value appearing in NullFields will be sent to the server as
  32609. // null. It is an error if a field in this list has a non-empty value.
  32610. // This may be used to include null fields in Patch requests.
  32611. NullFields []string `json:"-"`
  32612. }
  32613. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  32614. type NoMethod TargetInstanceAggregatedListWarning
  32615. raw := NoMethod(*s)
  32616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32617. }
  32618. type TargetInstanceAggregatedListWarningData struct {
  32619. // Key: [Output Only] A key that provides more detail on the warning
  32620. // being returned. For example, for warnings where there are no results
  32621. // in a list request for a particular zone, this key might be scope and
  32622. // the key value might be the zone name. Other examples might be a key
  32623. // indicating a deprecated resource and a suggested replacement, or a
  32624. // warning about invalid network settings (for example, if an instance
  32625. // attempts to perform IP forwarding but is not enabled for IP
  32626. // forwarding).
  32627. Key string `json:"key,omitempty"`
  32628. // Value: [Output Only] A warning data value corresponding to the key.
  32629. Value string `json:"value,omitempty"`
  32630. // ForceSendFields is a list of field names (e.g. "Key") to
  32631. // unconditionally include in API requests. By default, fields with
  32632. // empty values are omitted from API requests. However, any non-pointer,
  32633. // non-interface field appearing in ForceSendFields will be sent to the
  32634. // server regardless of whether the field is empty or not. This may be
  32635. // used to include empty fields in Patch requests.
  32636. ForceSendFields []string `json:"-"`
  32637. // NullFields is a list of field names (e.g. "Key") to include in API
  32638. // requests with the JSON null value. By default, fields with empty
  32639. // values are omitted from API requests. However, any field with an
  32640. // empty value appearing in NullFields will be sent to the server as
  32641. // null. It is an error if a field in this list has a non-empty value.
  32642. // This may be used to include null fields in Patch requests.
  32643. NullFields []string `json:"-"`
  32644. }
  32645. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  32646. type NoMethod TargetInstanceAggregatedListWarningData
  32647. raw := NoMethod(*s)
  32648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32649. }
  32650. // TargetInstanceList: Contains a list of TargetInstance resources.
  32651. type TargetInstanceList struct {
  32652. // Id: [Output Only] Unique identifier for the resource; defined by the
  32653. // server.
  32654. Id string `json:"id,omitempty"`
  32655. // Items: A list of TargetInstance resources.
  32656. Items []*TargetInstance `json:"items,omitempty"`
  32657. // Kind: Type of resource.
  32658. Kind string `json:"kind,omitempty"`
  32659. // NextPageToken: [Output Only] This token allows you to get the next
  32660. // page of results for list requests. If the number of results is larger
  32661. // than maxResults, use the nextPageToken as a value for the query
  32662. // parameter pageToken in the next list request. Subsequent list
  32663. // requests will have their own nextPageToken to continue paging through
  32664. // the results.
  32665. NextPageToken string `json:"nextPageToken,omitempty"`
  32666. // SelfLink: [Output Only] Server-defined URL for this resource.
  32667. SelfLink string `json:"selfLink,omitempty"`
  32668. // Warning: [Output Only] Informational warning message.
  32669. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  32670. // ServerResponse contains the HTTP response code and headers from the
  32671. // server.
  32672. googleapi.ServerResponse `json:"-"`
  32673. // ForceSendFields is a list of field names (e.g. "Id") to
  32674. // unconditionally include in API requests. By default, fields with
  32675. // empty values are omitted from API requests. However, any non-pointer,
  32676. // non-interface field appearing in ForceSendFields will be sent to the
  32677. // server regardless of whether the field is empty or not. This may be
  32678. // used to include empty fields in Patch requests.
  32679. ForceSendFields []string `json:"-"`
  32680. // NullFields is a list of field names (e.g. "Id") to include in API
  32681. // requests with the JSON null value. By default, fields with empty
  32682. // values are omitted from API requests. However, any field with an
  32683. // empty value appearing in NullFields will be sent to the server as
  32684. // null. It is an error if a field in this list has a non-empty value.
  32685. // This may be used to include null fields in Patch requests.
  32686. NullFields []string `json:"-"`
  32687. }
  32688. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  32689. type NoMethod TargetInstanceList
  32690. raw := NoMethod(*s)
  32691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32692. }
  32693. // TargetInstanceListWarning: [Output Only] Informational warning
  32694. // message.
  32695. type TargetInstanceListWarning struct {
  32696. // Code: [Output Only] A warning code, if applicable. For example,
  32697. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32698. // the response.
  32699. //
  32700. // Possible values:
  32701. // "CLEANUP_FAILED"
  32702. // "DEPRECATED_RESOURCE_USED"
  32703. // "DEPRECATED_TYPE_USED"
  32704. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32705. // "EXPERIMENTAL_TYPE_USED"
  32706. // "EXTERNAL_API_WARNING"
  32707. // "FIELD_VALUE_OVERRIDEN"
  32708. // "INJECTED_KERNELS_DEPRECATED"
  32709. // "MISSING_TYPE_DEPENDENCY"
  32710. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32711. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32712. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32713. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32714. // "NEXT_HOP_NOT_RUNNING"
  32715. // "NOT_CRITICAL_ERROR"
  32716. // "NO_RESULTS_ON_PAGE"
  32717. // "REQUIRED_TOS_AGREEMENT"
  32718. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32719. // "RESOURCE_NOT_DELETED"
  32720. // "SCHEMA_VALIDATION_IGNORED"
  32721. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32722. // "UNDECLARED_PROPERTIES"
  32723. // "UNREACHABLE"
  32724. Code string `json:"code,omitempty"`
  32725. // Data: [Output Only] Metadata about this warning in key: value format.
  32726. // For example:
  32727. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32728. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  32729. // Message: [Output Only] A human-readable description of the warning
  32730. // code.
  32731. Message string `json:"message,omitempty"`
  32732. // ForceSendFields is a list of field names (e.g. "Code") to
  32733. // unconditionally include in API requests. By default, fields with
  32734. // empty values are omitted from API requests. However, any non-pointer,
  32735. // non-interface field appearing in ForceSendFields will be sent to the
  32736. // server regardless of whether the field is empty or not. This may be
  32737. // used to include empty fields in Patch requests.
  32738. ForceSendFields []string `json:"-"`
  32739. // NullFields is a list of field names (e.g. "Code") to include in API
  32740. // requests with the JSON null value. By default, fields with empty
  32741. // values are omitted from API requests. However, any field with an
  32742. // empty value appearing in NullFields will be sent to the server as
  32743. // null. It is an error if a field in this list has a non-empty value.
  32744. // This may be used to include null fields in Patch requests.
  32745. NullFields []string `json:"-"`
  32746. }
  32747. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  32748. type NoMethod TargetInstanceListWarning
  32749. raw := NoMethod(*s)
  32750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32751. }
  32752. type TargetInstanceListWarningData struct {
  32753. // Key: [Output Only] A key that provides more detail on the warning
  32754. // being returned. For example, for warnings where there are no results
  32755. // in a list request for a particular zone, this key might be scope and
  32756. // the key value might be the zone name. Other examples might be a key
  32757. // indicating a deprecated resource and a suggested replacement, or a
  32758. // warning about invalid network settings (for example, if an instance
  32759. // attempts to perform IP forwarding but is not enabled for IP
  32760. // forwarding).
  32761. Key string `json:"key,omitempty"`
  32762. // Value: [Output Only] A warning data value corresponding to the key.
  32763. Value string `json:"value,omitempty"`
  32764. // ForceSendFields is a list of field names (e.g. "Key") to
  32765. // unconditionally include in API requests. By default, fields with
  32766. // empty values are omitted from API requests. However, any non-pointer,
  32767. // non-interface field appearing in ForceSendFields will be sent to the
  32768. // server regardless of whether the field is empty or not. This may be
  32769. // used to include empty fields in Patch requests.
  32770. ForceSendFields []string `json:"-"`
  32771. // NullFields is a list of field names (e.g. "Key") to include in API
  32772. // requests with the JSON null value. By default, fields with empty
  32773. // values are omitted from API requests. However, any field with an
  32774. // empty value appearing in NullFields will be sent to the server as
  32775. // null. It is an error if a field in this list has a non-empty value.
  32776. // This may be used to include null fields in Patch requests.
  32777. NullFields []string `json:"-"`
  32778. }
  32779. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  32780. type NoMethod TargetInstanceListWarningData
  32781. raw := NoMethod(*s)
  32782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32783. }
  32784. type TargetInstancesScopedList struct {
  32785. // TargetInstances: A list of target instances contained in this scope.
  32786. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  32787. // Warning: Informational warning which replaces the list of addresses
  32788. // when the list is empty.
  32789. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  32790. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  32791. // unconditionally include in API requests. By default, fields with
  32792. // empty values are omitted from API requests. However, any non-pointer,
  32793. // non-interface field appearing in ForceSendFields will be sent to the
  32794. // server regardless of whether the field is empty or not. This may be
  32795. // used to include empty fields in Patch requests.
  32796. ForceSendFields []string `json:"-"`
  32797. // NullFields is a list of field names (e.g. "TargetInstances") to
  32798. // include in API requests with the JSON null value. By default, fields
  32799. // with empty values are omitted from API requests. However, any field
  32800. // with an empty value appearing in NullFields will be sent to the
  32801. // server as null. It is an error if a field in this list has a
  32802. // non-empty value. This may be used to include null fields in Patch
  32803. // requests.
  32804. NullFields []string `json:"-"`
  32805. }
  32806. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  32807. type NoMethod TargetInstancesScopedList
  32808. raw := NoMethod(*s)
  32809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32810. }
  32811. // TargetInstancesScopedListWarning: Informational warning which
  32812. // replaces the list of addresses when the list is empty.
  32813. type TargetInstancesScopedListWarning struct {
  32814. // Code: [Output Only] A warning code, if applicable. For example,
  32815. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  32816. // the response.
  32817. //
  32818. // Possible values:
  32819. // "CLEANUP_FAILED"
  32820. // "DEPRECATED_RESOURCE_USED"
  32821. // "DEPRECATED_TYPE_USED"
  32822. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  32823. // "EXPERIMENTAL_TYPE_USED"
  32824. // "EXTERNAL_API_WARNING"
  32825. // "FIELD_VALUE_OVERRIDEN"
  32826. // "INJECTED_KERNELS_DEPRECATED"
  32827. // "MISSING_TYPE_DEPENDENCY"
  32828. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  32829. // "NEXT_HOP_CANNOT_IP_FORWARD"
  32830. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  32831. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  32832. // "NEXT_HOP_NOT_RUNNING"
  32833. // "NOT_CRITICAL_ERROR"
  32834. // "NO_RESULTS_ON_PAGE"
  32835. // "REQUIRED_TOS_AGREEMENT"
  32836. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  32837. // "RESOURCE_NOT_DELETED"
  32838. // "SCHEMA_VALIDATION_IGNORED"
  32839. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  32840. // "UNDECLARED_PROPERTIES"
  32841. // "UNREACHABLE"
  32842. Code string `json:"code,omitempty"`
  32843. // Data: [Output Only] Metadata about this warning in key: value format.
  32844. // For example:
  32845. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  32846. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  32847. // Message: [Output Only] A human-readable description of the warning
  32848. // code.
  32849. Message string `json:"message,omitempty"`
  32850. // ForceSendFields is a list of field names (e.g. "Code") to
  32851. // unconditionally include in API requests. By default, fields with
  32852. // empty values are omitted from API requests. However, any non-pointer,
  32853. // non-interface field appearing in ForceSendFields will be sent to the
  32854. // server regardless of whether the field is empty or not. This may be
  32855. // used to include empty fields in Patch requests.
  32856. ForceSendFields []string `json:"-"`
  32857. // NullFields is a list of field names (e.g. "Code") to include in API
  32858. // requests with the JSON null value. By default, fields with empty
  32859. // values are omitted from API requests. However, any field with an
  32860. // empty value appearing in NullFields will be sent to the server as
  32861. // null. It is an error if a field in this list has a non-empty value.
  32862. // This may be used to include null fields in Patch requests.
  32863. NullFields []string `json:"-"`
  32864. }
  32865. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  32866. type NoMethod TargetInstancesScopedListWarning
  32867. raw := NoMethod(*s)
  32868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32869. }
  32870. type TargetInstancesScopedListWarningData struct {
  32871. // Key: [Output Only] A key that provides more detail on the warning
  32872. // being returned. For example, for warnings where there are no results
  32873. // in a list request for a particular zone, this key might be scope and
  32874. // the key value might be the zone name. Other examples might be a key
  32875. // indicating a deprecated resource and a suggested replacement, or a
  32876. // warning about invalid network settings (for example, if an instance
  32877. // attempts to perform IP forwarding but is not enabled for IP
  32878. // forwarding).
  32879. Key string `json:"key,omitempty"`
  32880. // Value: [Output Only] A warning data value corresponding to the key.
  32881. Value string `json:"value,omitempty"`
  32882. // ForceSendFields is a list of field names (e.g. "Key") to
  32883. // unconditionally include in API requests. By default, fields with
  32884. // empty values are omitted from API requests. However, any non-pointer,
  32885. // non-interface field appearing in ForceSendFields will be sent to the
  32886. // server regardless of whether the field is empty or not. This may be
  32887. // used to include empty fields in Patch requests.
  32888. ForceSendFields []string `json:"-"`
  32889. // NullFields is a list of field names (e.g. "Key") to include in API
  32890. // requests with the JSON null value. By default, fields with empty
  32891. // values are omitted from API requests. However, any field with an
  32892. // empty value appearing in NullFields will be sent to the server as
  32893. // null. It is an error if a field in this list has a non-empty value.
  32894. // This may be used to include null fields in Patch requests.
  32895. NullFields []string `json:"-"`
  32896. }
  32897. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  32898. type NoMethod TargetInstancesScopedListWarningData
  32899. raw := NoMethod(*s)
  32900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  32901. }
  32902. // TargetPool: A TargetPool resource. This resource defines a pool of
  32903. // instances, an associated HttpHealthCheck resource, and the fallback
  32904. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  32905. // v1.targetPools ==)
  32906. type TargetPool struct {
  32907. // BackupPool: This field is applicable only when the containing target
  32908. // pool is serving a forwarding rule as the primary pool, and its
  32909. // failoverRatio field is properly set to a value between [0,
  32910. // 1].
  32911. //
  32912. // backupPool and failoverRatio together define the fallback behavior of
  32913. // the primary target pool: if the ratio of the healthy instances in the
  32914. // primary pool is at or below failoverRatio, traffic arriving at the
  32915. // load-balanced IP will be directed to the backup pool.
  32916. //
  32917. // In case where failoverRatio and backupPool are not set, or all the
  32918. // instances in the backup pool are unhealthy, the traffic will be
  32919. // directed back to the primary pool in the "force" mode, where traffic
  32920. // will be spread to the healthy instances with the best effort, or to
  32921. // all instances when no instance is healthy.
  32922. BackupPool string `json:"backupPool,omitempty"`
  32923. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  32924. // format.
  32925. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  32926. // Description: An optional description of this resource. Provide this
  32927. // property when you create the resource.
  32928. Description string `json:"description,omitempty"`
  32929. // FailoverRatio: This field is applicable only when the containing
  32930. // target pool is serving a forwarding rule as the primary pool (i.e.,
  32931. // not as a backup pool to some other target pool). The value of the
  32932. // field must be in [0, 1].
  32933. //
  32934. // If set, backupPool must also be set. They together define the
  32935. // fallback behavior of the primary target pool: if the ratio of the
  32936. // healthy instances in the primary pool is at or below this number,
  32937. // traffic arriving at the load-balanced IP will be directed to the
  32938. // backup pool.
  32939. //
  32940. // In case where failoverRatio is not set or all the instances in the
  32941. // backup pool are unhealthy, the traffic will be directed back to the
  32942. // primary pool in the "force" mode, where traffic will be spread to the
  32943. // healthy instances with the best effort, or to all instances when no
  32944. // instance is healthy.
  32945. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  32946. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  32947. // instance in this pool is considered healthy if and only if the health
  32948. // checks pass. An empty list means all member instances will be
  32949. // considered healthy at all times. Only HttpHealthChecks are supported.
  32950. // Only one health check may be specified.
  32951. HealthChecks []string `json:"healthChecks,omitempty"`
  32952. // Id: [Output Only] The unique identifier for the resource. This
  32953. // identifier is defined by the server.
  32954. Id uint64 `json:"id,omitempty,string"`
  32955. // Instances: A list of resource URLs to the virtual machine instances
  32956. // serving this pool. They must live in zones contained in the same
  32957. // region as this pool.
  32958. Instances []string `json:"instances,omitempty"`
  32959. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  32960. // for target pools.
  32961. Kind string `json:"kind,omitempty"`
  32962. // Name: Name of the resource. Provided by the client when the resource
  32963. // is created. The name must be 1-63 characters long, and comply with
  32964. // RFC1035. Specifically, the name must be 1-63 characters long and
  32965. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  32966. // the first character must be a lowercase letter, and all following
  32967. // characters must be a dash, lowercase letter, or digit, except the
  32968. // last character, which cannot be a dash.
  32969. Name string `json:"name,omitempty"`
  32970. // Region: [Output Only] URL of the region where the target pool
  32971. // resides.
  32972. Region string `json:"region,omitempty"`
  32973. // SelfLink: [Output Only] Server-defined URL for the resource.
  32974. SelfLink string `json:"selfLink,omitempty"`
  32975. // SelfLinkWithId: [Output Only] Server-defined URL for this resource
  32976. // with the resource id.
  32977. SelfLinkWithId string `json:"selfLinkWithId,omitempty"`
  32978. // SessionAffinity: Session affinity option, must be one of the
  32979. // following values:
  32980. // NONE: Connections from the same client IP may go to any instance in
  32981. // the pool.
  32982. // CLIENT_IP: Connections from the same client IP will go to the same
  32983. // instance in the pool while that instance remains
  32984. // healthy.
  32985. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  32986. // protocol will go to the same instance in the pool while that instance
  32987. // remains healthy.
  32988. //
  32989. // Possible values:
  32990. // "CLIENT_IP"
  32991. // "CLIENT_IP_PORT_PROTO"
  32992. // "CLIENT_IP_PROTO"
  32993. // "GENERATED_COOKIE"
  32994. // "HEADER_FIELD"
  32995. // "HTTP_COOKIE"
  32996. // "NONE"
  32997. SessionAffinity string `json:"sessionAffinity,omitempty"`
  32998. // ServerResponse contains the HTTP response code and headers from the
  32999. // server.
  33000. googleapi.ServerResponse `json:"-"`
  33001. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  33002. // unconditionally include in API requests. By default, fields with
  33003. // empty values are omitted from API requests. However, any non-pointer,
  33004. // non-interface field appearing in ForceSendFields will be sent to the
  33005. // server regardless of whether the field is empty or not. This may be
  33006. // used to include empty fields in Patch requests.
  33007. ForceSendFields []string `json:"-"`
  33008. // NullFields is a list of field names (e.g. "BackupPool") to include in
  33009. // API requests with the JSON null value. By default, fields with empty
  33010. // values are omitted from API requests. However, any field with an
  33011. // empty value appearing in NullFields will be sent to the server as
  33012. // null. It is an error if a field in this list has a non-empty value.
  33013. // This may be used to include null fields in Patch requests.
  33014. NullFields []string `json:"-"`
  33015. }
  33016. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  33017. type NoMethod TargetPool
  33018. raw := NoMethod(*s)
  33019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33020. }
  33021. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  33022. type NoMethod TargetPool
  33023. var s1 struct {
  33024. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  33025. *NoMethod
  33026. }
  33027. s1.NoMethod = (*NoMethod)(s)
  33028. if err := json.Unmarshal(data, &s1); err != nil {
  33029. return err
  33030. }
  33031. s.FailoverRatio = float64(s1.FailoverRatio)
  33032. return nil
  33033. }
  33034. type TargetPoolAggregatedList struct {
  33035. // Id: [Output Only] Unique identifier for the resource; defined by the
  33036. // server.
  33037. Id string `json:"id,omitempty"`
  33038. // Items: A list of TargetPool resources.
  33039. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  33040. // Kind: [Output Only] Type of resource. Always
  33041. // compute#targetPoolAggregatedList for aggregated lists of target
  33042. // pools.
  33043. Kind string `json:"kind,omitempty"`
  33044. // NextPageToken: [Output Only] This token allows you to get the next
  33045. // page of results for list requests. If the number of results is larger
  33046. // than maxResults, use the nextPageToken as a value for the query
  33047. // parameter pageToken in the next list request. Subsequent list
  33048. // requests will have their own nextPageToken to continue paging through
  33049. // the results.
  33050. NextPageToken string `json:"nextPageToken,omitempty"`
  33051. // SelfLink: [Output Only] Server-defined URL for this resource.
  33052. SelfLink string `json:"selfLink,omitempty"`
  33053. // Warning: [Output Only] Informational warning message.
  33054. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  33055. // ServerResponse contains the HTTP response code and headers from the
  33056. // server.
  33057. googleapi.ServerResponse `json:"-"`
  33058. // ForceSendFields is a list of field names (e.g. "Id") to
  33059. // unconditionally include in API requests. By default, fields with
  33060. // empty values are omitted from API requests. However, any non-pointer,
  33061. // non-interface field appearing in ForceSendFields will be sent to the
  33062. // server regardless of whether the field is empty or not. This may be
  33063. // used to include empty fields in Patch requests.
  33064. ForceSendFields []string `json:"-"`
  33065. // NullFields is a list of field names (e.g. "Id") to include in API
  33066. // requests with the JSON null value. By default, fields with empty
  33067. // values are omitted from API requests. However, any field with an
  33068. // empty value appearing in NullFields will be sent to the server as
  33069. // null. It is an error if a field in this list has a non-empty value.
  33070. // This may be used to include null fields in Patch requests.
  33071. NullFields []string `json:"-"`
  33072. }
  33073. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  33074. type NoMethod TargetPoolAggregatedList
  33075. raw := NoMethod(*s)
  33076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33077. }
  33078. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  33079. // message.
  33080. type TargetPoolAggregatedListWarning struct {
  33081. // Code: [Output Only] A warning code, if applicable. For example,
  33082. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33083. // the response.
  33084. //
  33085. // Possible values:
  33086. // "CLEANUP_FAILED"
  33087. // "DEPRECATED_RESOURCE_USED"
  33088. // "DEPRECATED_TYPE_USED"
  33089. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33090. // "EXPERIMENTAL_TYPE_USED"
  33091. // "EXTERNAL_API_WARNING"
  33092. // "FIELD_VALUE_OVERRIDEN"
  33093. // "INJECTED_KERNELS_DEPRECATED"
  33094. // "MISSING_TYPE_DEPENDENCY"
  33095. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33096. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33097. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33098. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33099. // "NEXT_HOP_NOT_RUNNING"
  33100. // "NOT_CRITICAL_ERROR"
  33101. // "NO_RESULTS_ON_PAGE"
  33102. // "REQUIRED_TOS_AGREEMENT"
  33103. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33104. // "RESOURCE_NOT_DELETED"
  33105. // "SCHEMA_VALIDATION_IGNORED"
  33106. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33107. // "UNDECLARED_PROPERTIES"
  33108. // "UNREACHABLE"
  33109. Code string `json:"code,omitempty"`
  33110. // Data: [Output Only] Metadata about this warning in key: value format.
  33111. // For example:
  33112. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33113. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  33114. // Message: [Output Only] A human-readable description of the warning
  33115. // code.
  33116. Message string `json:"message,omitempty"`
  33117. // ForceSendFields is a list of field names (e.g. "Code") to
  33118. // unconditionally include in API requests. By default, fields with
  33119. // empty values are omitted from API requests. However, any non-pointer,
  33120. // non-interface field appearing in ForceSendFields will be sent to the
  33121. // server regardless of whether the field is empty or not. This may be
  33122. // used to include empty fields in Patch requests.
  33123. ForceSendFields []string `json:"-"`
  33124. // NullFields is a list of field names (e.g. "Code") to include in API
  33125. // requests with the JSON null value. By default, fields with empty
  33126. // values are omitted from API requests. However, any field with an
  33127. // empty value appearing in NullFields will be sent to the server as
  33128. // null. It is an error if a field in this list has a non-empty value.
  33129. // This may be used to include null fields in Patch requests.
  33130. NullFields []string `json:"-"`
  33131. }
  33132. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  33133. type NoMethod TargetPoolAggregatedListWarning
  33134. raw := NoMethod(*s)
  33135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33136. }
  33137. type TargetPoolAggregatedListWarningData struct {
  33138. // Key: [Output Only] A key that provides more detail on the warning
  33139. // being returned. For example, for warnings where there are no results
  33140. // in a list request for a particular zone, this key might be scope and
  33141. // the key value might be the zone name. Other examples might be a key
  33142. // indicating a deprecated resource and a suggested replacement, or a
  33143. // warning about invalid network settings (for example, if an instance
  33144. // attempts to perform IP forwarding but is not enabled for IP
  33145. // forwarding).
  33146. Key string `json:"key,omitempty"`
  33147. // Value: [Output Only] A warning data value corresponding to the key.
  33148. Value string `json:"value,omitempty"`
  33149. // ForceSendFields is a list of field names (e.g. "Key") to
  33150. // unconditionally include in API requests. By default, fields with
  33151. // empty values are omitted from API requests. However, any non-pointer,
  33152. // non-interface field appearing in ForceSendFields will be sent to the
  33153. // server regardless of whether the field is empty or not. This may be
  33154. // used to include empty fields in Patch requests.
  33155. ForceSendFields []string `json:"-"`
  33156. // NullFields is a list of field names (e.g. "Key") to include in API
  33157. // requests with the JSON null value. By default, fields with empty
  33158. // values are omitted from API requests. However, any field with an
  33159. // empty value appearing in NullFields will be sent to the server as
  33160. // null. It is an error if a field in this list has a non-empty value.
  33161. // This may be used to include null fields in Patch requests.
  33162. NullFields []string `json:"-"`
  33163. }
  33164. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  33165. type NoMethod TargetPoolAggregatedListWarningData
  33166. raw := NoMethod(*s)
  33167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33168. }
  33169. type TargetPoolInstanceHealth struct {
  33170. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  33171. // Kind: [Output Only] Type of resource. Always
  33172. // compute#targetPoolInstanceHealth when checking the health of an
  33173. // instance.
  33174. Kind string `json:"kind,omitempty"`
  33175. // ServerResponse contains the HTTP response code and headers from the
  33176. // server.
  33177. googleapi.ServerResponse `json:"-"`
  33178. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  33179. // unconditionally include in API requests. By default, fields with
  33180. // empty values are omitted from API requests. However, any non-pointer,
  33181. // non-interface field appearing in ForceSendFields will be sent to the
  33182. // server regardless of whether the field is empty or not. This may be
  33183. // used to include empty fields in Patch requests.
  33184. ForceSendFields []string `json:"-"`
  33185. // NullFields is a list of field names (e.g. "HealthStatus") to include
  33186. // in API requests with the JSON null value. By default, fields with
  33187. // empty values are omitted from API requests. However, any field with
  33188. // an empty value appearing in NullFields will be sent to the server as
  33189. // null. It is an error if a field in this list has a non-empty value.
  33190. // This may be used to include null fields in Patch requests.
  33191. NullFields []string `json:"-"`
  33192. }
  33193. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  33194. type NoMethod TargetPoolInstanceHealth
  33195. raw := NoMethod(*s)
  33196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33197. }
  33198. // TargetPoolList: Contains a list of TargetPool resources.
  33199. type TargetPoolList struct {
  33200. // Id: [Output Only] Unique identifier for the resource; defined by the
  33201. // server.
  33202. Id string `json:"id,omitempty"`
  33203. // Items: A list of TargetPool resources.
  33204. Items []*TargetPool `json:"items,omitempty"`
  33205. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  33206. // for lists of target pools.
  33207. Kind string `json:"kind,omitempty"`
  33208. // NextPageToken: [Output Only] This token allows you to get the next
  33209. // page of results for list requests. If the number of results is larger
  33210. // than maxResults, use the nextPageToken as a value for the query
  33211. // parameter pageToken in the next list request. Subsequent list
  33212. // requests will have their own nextPageToken to continue paging through
  33213. // the results.
  33214. NextPageToken string `json:"nextPageToken,omitempty"`
  33215. // SelfLink: [Output Only] Server-defined URL for this resource.
  33216. SelfLink string `json:"selfLink,omitempty"`
  33217. // Warning: [Output Only] Informational warning message.
  33218. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  33219. // ServerResponse contains the HTTP response code and headers from the
  33220. // server.
  33221. googleapi.ServerResponse `json:"-"`
  33222. // ForceSendFields is a list of field names (e.g. "Id") to
  33223. // unconditionally include in API requests. By default, fields with
  33224. // empty values are omitted from API requests. However, any non-pointer,
  33225. // non-interface field appearing in ForceSendFields will be sent to the
  33226. // server regardless of whether the field is empty or not. This may be
  33227. // used to include empty fields in Patch requests.
  33228. ForceSendFields []string `json:"-"`
  33229. // NullFields is a list of field names (e.g. "Id") to include in API
  33230. // requests with the JSON null value. By default, fields with empty
  33231. // values are omitted from API requests. However, any field with an
  33232. // empty value appearing in NullFields will be sent to the server as
  33233. // null. It is an error if a field in this list has a non-empty value.
  33234. // This may be used to include null fields in Patch requests.
  33235. NullFields []string `json:"-"`
  33236. }
  33237. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  33238. type NoMethod TargetPoolList
  33239. raw := NoMethod(*s)
  33240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33241. }
  33242. // TargetPoolListWarning: [Output Only] Informational warning message.
  33243. type TargetPoolListWarning struct {
  33244. // Code: [Output Only] A warning code, if applicable. For example,
  33245. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33246. // the response.
  33247. //
  33248. // Possible values:
  33249. // "CLEANUP_FAILED"
  33250. // "DEPRECATED_RESOURCE_USED"
  33251. // "DEPRECATED_TYPE_USED"
  33252. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33253. // "EXPERIMENTAL_TYPE_USED"
  33254. // "EXTERNAL_API_WARNING"
  33255. // "FIELD_VALUE_OVERRIDEN"
  33256. // "INJECTED_KERNELS_DEPRECATED"
  33257. // "MISSING_TYPE_DEPENDENCY"
  33258. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33259. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33260. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33261. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33262. // "NEXT_HOP_NOT_RUNNING"
  33263. // "NOT_CRITICAL_ERROR"
  33264. // "NO_RESULTS_ON_PAGE"
  33265. // "REQUIRED_TOS_AGREEMENT"
  33266. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33267. // "RESOURCE_NOT_DELETED"
  33268. // "SCHEMA_VALIDATION_IGNORED"
  33269. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33270. // "UNDECLARED_PROPERTIES"
  33271. // "UNREACHABLE"
  33272. Code string `json:"code,omitempty"`
  33273. // Data: [Output Only] Metadata about this warning in key: value format.
  33274. // For example:
  33275. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33276. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  33277. // Message: [Output Only] A human-readable description of the warning
  33278. // code.
  33279. Message string `json:"message,omitempty"`
  33280. // ForceSendFields is a list of field names (e.g. "Code") to
  33281. // unconditionally include in API requests. By default, fields with
  33282. // empty values are omitted from API requests. However, any non-pointer,
  33283. // non-interface field appearing in ForceSendFields will be sent to the
  33284. // server regardless of whether the field is empty or not. This may be
  33285. // used to include empty fields in Patch requests.
  33286. ForceSendFields []string `json:"-"`
  33287. // NullFields is a list of field names (e.g. "Code") to include in API
  33288. // requests with the JSON null value. By default, fields with empty
  33289. // values are omitted from API requests. However, any field with an
  33290. // empty value appearing in NullFields will be sent to the server as
  33291. // null. It is an error if a field in this list has a non-empty value.
  33292. // This may be used to include null fields in Patch requests.
  33293. NullFields []string `json:"-"`
  33294. }
  33295. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  33296. type NoMethod TargetPoolListWarning
  33297. raw := NoMethod(*s)
  33298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33299. }
  33300. type TargetPoolListWarningData struct {
  33301. // Key: [Output Only] A key that provides more detail on the warning
  33302. // being returned. For example, for warnings where there are no results
  33303. // in a list request for a particular zone, this key might be scope and
  33304. // the key value might be the zone name. Other examples might be a key
  33305. // indicating a deprecated resource and a suggested replacement, or a
  33306. // warning about invalid network settings (for example, if an instance
  33307. // attempts to perform IP forwarding but is not enabled for IP
  33308. // forwarding).
  33309. Key string `json:"key,omitempty"`
  33310. // Value: [Output Only] A warning data value corresponding to the key.
  33311. Value string `json:"value,omitempty"`
  33312. // ForceSendFields is a list of field names (e.g. "Key") to
  33313. // unconditionally include in API requests. By default, fields with
  33314. // empty values are omitted from API requests. However, any non-pointer,
  33315. // non-interface field appearing in ForceSendFields will be sent to the
  33316. // server regardless of whether the field is empty or not. This may be
  33317. // used to include empty fields in Patch requests.
  33318. ForceSendFields []string `json:"-"`
  33319. // NullFields is a list of field names (e.g. "Key") to include in API
  33320. // requests with the JSON null value. By default, fields with empty
  33321. // values are omitted from API requests. However, any field with an
  33322. // empty value appearing in NullFields will be sent to the server as
  33323. // null. It is an error if a field in this list has a non-empty value.
  33324. // This may be used to include null fields in Patch requests.
  33325. NullFields []string `json:"-"`
  33326. }
  33327. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  33328. type NoMethod TargetPoolListWarningData
  33329. raw := NoMethod(*s)
  33330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33331. }
  33332. type TargetPoolsAddHealthCheckRequest struct {
  33333. // HealthChecks: The HttpHealthCheck to add to the target pool.
  33334. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  33335. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  33336. // unconditionally include in API requests. By default, fields with
  33337. // empty values are omitted from API requests. However, any non-pointer,
  33338. // non-interface field appearing in ForceSendFields will be sent to the
  33339. // server regardless of whether the field is empty or not. This may be
  33340. // used to include empty fields in Patch requests.
  33341. ForceSendFields []string `json:"-"`
  33342. // NullFields is a list of field names (e.g. "HealthChecks") to include
  33343. // in API requests with the JSON null value. By default, fields with
  33344. // empty values are omitted from API requests. However, any field with
  33345. // an empty value appearing in NullFields will be sent to the server as
  33346. // null. It is an error if a field in this list has a non-empty value.
  33347. // This may be used to include null fields in Patch requests.
  33348. NullFields []string `json:"-"`
  33349. }
  33350. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  33351. type NoMethod TargetPoolsAddHealthCheckRequest
  33352. raw := NoMethod(*s)
  33353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33354. }
  33355. type TargetPoolsAddInstanceRequest struct {
  33356. // Instances: A full or partial URL to an instance to add to this target
  33357. // pool. This can be a full or partial URL. For example, the following
  33358. // are valid URLs:
  33359. // -
  33360. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  33361. // - projects/project-id/zones/zone/instances/instance-name
  33362. // - zones/zone/instances/instance-name
  33363. Instances []*InstanceReference `json:"instances,omitempty"`
  33364. // ForceSendFields is a list of field names (e.g. "Instances") to
  33365. // unconditionally include in API requests. By default, fields with
  33366. // empty values are omitted from API requests. However, any non-pointer,
  33367. // non-interface field appearing in ForceSendFields will be sent to the
  33368. // server regardless of whether the field is empty or not. This may be
  33369. // used to include empty fields in Patch requests.
  33370. ForceSendFields []string `json:"-"`
  33371. // NullFields is a list of field names (e.g. "Instances") to include in
  33372. // API requests with the JSON null value. By default, fields with empty
  33373. // values are omitted from API requests. However, any field with an
  33374. // empty value appearing in NullFields will be sent to the server as
  33375. // null. It is an error if a field in this list has a non-empty value.
  33376. // This may be used to include null fields in Patch requests.
  33377. NullFields []string `json:"-"`
  33378. }
  33379. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  33380. type NoMethod TargetPoolsAddInstanceRequest
  33381. raw := NoMethod(*s)
  33382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33383. }
  33384. type TargetPoolsRemoveHealthCheckRequest struct {
  33385. // HealthChecks: Health check URL to be removed. This can be a full or
  33386. // valid partial URL. For example, the following are valid URLs:
  33387. // -
  33388. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  33389. // - projects/project/global/httpHealthChecks/health-check
  33390. // - global/httpHealthChecks/health-check
  33391. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  33392. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  33393. // unconditionally include in API requests. By default, fields with
  33394. // empty values are omitted from API requests. However, any non-pointer,
  33395. // non-interface field appearing in ForceSendFields will be sent to the
  33396. // server regardless of whether the field is empty or not. This may be
  33397. // used to include empty fields in Patch requests.
  33398. ForceSendFields []string `json:"-"`
  33399. // NullFields is a list of field names (e.g. "HealthChecks") to include
  33400. // in API requests with the JSON null value. By default, fields with
  33401. // empty values are omitted from API requests. However, any field with
  33402. // an empty value appearing in NullFields will be sent to the server as
  33403. // null. It is an error if a field in this list has a non-empty value.
  33404. // This may be used to include null fields in Patch requests.
  33405. NullFields []string `json:"-"`
  33406. }
  33407. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  33408. type NoMethod TargetPoolsRemoveHealthCheckRequest
  33409. raw := NoMethod(*s)
  33410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33411. }
  33412. type TargetPoolsRemoveInstanceRequest struct {
  33413. // Instances: URLs of the instances to be removed from target pool.
  33414. Instances []*InstanceReference `json:"instances,omitempty"`
  33415. // ForceSendFields is a list of field names (e.g. "Instances") to
  33416. // unconditionally include in API requests. By default, fields with
  33417. // empty values are omitted from API requests. However, any non-pointer,
  33418. // non-interface field appearing in ForceSendFields will be sent to the
  33419. // server regardless of whether the field is empty or not. This may be
  33420. // used to include empty fields in Patch requests.
  33421. ForceSendFields []string `json:"-"`
  33422. // NullFields is a list of field names (e.g. "Instances") to include in
  33423. // API requests with the JSON null value. By default, fields with empty
  33424. // values are omitted from API requests. However, any field with an
  33425. // empty value appearing in NullFields will be sent to the server as
  33426. // null. It is an error if a field in this list has a non-empty value.
  33427. // This may be used to include null fields in Patch requests.
  33428. NullFields []string `json:"-"`
  33429. }
  33430. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  33431. type NoMethod TargetPoolsRemoveInstanceRequest
  33432. raw := NoMethod(*s)
  33433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33434. }
  33435. type TargetPoolsScopedList struct {
  33436. // TargetPools: A list of target pools contained in this scope.
  33437. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  33438. // Warning: Informational warning which replaces the list of addresses
  33439. // when the list is empty.
  33440. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  33441. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  33442. // unconditionally include in API requests. By default, fields with
  33443. // empty values are omitted from API requests. However, any non-pointer,
  33444. // non-interface field appearing in ForceSendFields will be sent to the
  33445. // server regardless of whether the field is empty or not. This may be
  33446. // used to include empty fields in Patch requests.
  33447. ForceSendFields []string `json:"-"`
  33448. // NullFields is a list of field names (e.g. "TargetPools") to include
  33449. // in API requests with the JSON null value. By default, fields with
  33450. // empty values are omitted from API requests. However, any field with
  33451. // an empty value appearing in NullFields will be sent to the server as
  33452. // null. It is an error if a field in this list has a non-empty value.
  33453. // This may be used to include null fields in Patch requests.
  33454. NullFields []string `json:"-"`
  33455. }
  33456. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  33457. type NoMethod TargetPoolsScopedList
  33458. raw := NoMethod(*s)
  33459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33460. }
  33461. // TargetPoolsScopedListWarning: Informational warning which replaces
  33462. // the list of addresses when the list is empty.
  33463. type TargetPoolsScopedListWarning struct {
  33464. // Code: [Output Only] A warning code, if applicable. For example,
  33465. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33466. // the response.
  33467. //
  33468. // Possible values:
  33469. // "CLEANUP_FAILED"
  33470. // "DEPRECATED_RESOURCE_USED"
  33471. // "DEPRECATED_TYPE_USED"
  33472. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33473. // "EXPERIMENTAL_TYPE_USED"
  33474. // "EXTERNAL_API_WARNING"
  33475. // "FIELD_VALUE_OVERRIDEN"
  33476. // "INJECTED_KERNELS_DEPRECATED"
  33477. // "MISSING_TYPE_DEPENDENCY"
  33478. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33479. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33480. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33481. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33482. // "NEXT_HOP_NOT_RUNNING"
  33483. // "NOT_CRITICAL_ERROR"
  33484. // "NO_RESULTS_ON_PAGE"
  33485. // "REQUIRED_TOS_AGREEMENT"
  33486. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33487. // "RESOURCE_NOT_DELETED"
  33488. // "SCHEMA_VALIDATION_IGNORED"
  33489. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33490. // "UNDECLARED_PROPERTIES"
  33491. // "UNREACHABLE"
  33492. Code string `json:"code,omitempty"`
  33493. // Data: [Output Only] Metadata about this warning in key: value format.
  33494. // For example:
  33495. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33496. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  33497. // Message: [Output Only] A human-readable description of the warning
  33498. // code.
  33499. Message string `json:"message,omitempty"`
  33500. // ForceSendFields is a list of field names (e.g. "Code") to
  33501. // unconditionally include in API requests. By default, fields with
  33502. // empty values are omitted from API requests. However, any non-pointer,
  33503. // non-interface field appearing in ForceSendFields will be sent to the
  33504. // server regardless of whether the field is empty or not. This may be
  33505. // used to include empty fields in Patch requests.
  33506. ForceSendFields []string `json:"-"`
  33507. // NullFields is a list of field names (e.g. "Code") to include in API
  33508. // requests with the JSON null value. By default, fields with empty
  33509. // values are omitted from API requests. However, any field with an
  33510. // empty value appearing in NullFields will be sent to the server as
  33511. // null. It is an error if a field in this list has a non-empty value.
  33512. // This may be used to include null fields in Patch requests.
  33513. NullFields []string `json:"-"`
  33514. }
  33515. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  33516. type NoMethod TargetPoolsScopedListWarning
  33517. raw := NoMethod(*s)
  33518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33519. }
  33520. type TargetPoolsScopedListWarningData struct {
  33521. // Key: [Output Only] A key that provides more detail on the warning
  33522. // being returned. For example, for warnings where there are no results
  33523. // in a list request for a particular zone, this key might be scope and
  33524. // the key value might be the zone name. Other examples might be a key
  33525. // indicating a deprecated resource and a suggested replacement, or a
  33526. // warning about invalid network settings (for example, if an instance
  33527. // attempts to perform IP forwarding but is not enabled for IP
  33528. // forwarding).
  33529. Key string `json:"key,omitempty"`
  33530. // Value: [Output Only] A warning data value corresponding to the key.
  33531. Value string `json:"value,omitempty"`
  33532. // ForceSendFields is a list of field names (e.g. "Key") to
  33533. // unconditionally include in API requests. By default, fields with
  33534. // empty values are omitted from API requests. However, any non-pointer,
  33535. // non-interface field appearing in ForceSendFields will be sent to the
  33536. // server regardless of whether the field is empty or not. This may be
  33537. // used to include empty fields in Patch requests.
  33538. ForceSendFields []string `json:"-"`
  33539. // NullFields is a list of field names (e.g. "Key") to include in API
  33540. // requests with the JSON null value. By default, fields with empty
  33541. // values are omitted from API requests. However, any field with an
  33542. // empty value appearing in NullFields will be sent to the server as
  33543. // null. It is an error if a field in this list has a non-empty value.
  33544. // This may be used to include null fields in Patch requests.
  33545. NullFields []string `json:"-"`
  33546. }
  33547. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  33548. type NoMethod TargetPoolsScopedListWarningData
  33549. raw := NoMethod(*s)
  33550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33551. }
  33552. type TargetReference struct {
  33553. Target string `json:"target,omitempty"`
  33554. // ForceSendFields is a list of field names (e.g. "Target") to
  33555. // unconditionally include in API requests. By default, fields with
  33556. // empty values are omitted from API requests. However, any non-pointer,
  33557. // non-interface field appearing in ForceSendFields will be sent to the
  33558. // server regardless of whether the field is empty or not. This may be
  33559. // used to include empty fields in Patch requests.
  33560. ForceSendFields []string `json:"-"`
  33561. // NullFields is a list of field names (e.g. "Target") to include in API
  33562. // requests with the JSON null value. By default, fields with empty
  33563. // values are omitted from API requests. However, any field with an
  33564. // empty value appearing in NullFields will be sent to the server as
  33565. // null. It is an error if a field in this list has a non-empty value.
  33566. // This may be used to include null fields in Patch requests.
  33567. NullFields []string `json:"-"`
  33568. }
  33569. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  33570. type NoMethod TargetReference
  33571. raw := NoMethod(*s)
  33572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33573. }
  33574. type TargetSslProxiesSetBackendServiceRequest struct {
  33575. // Service: The URL of the new BackendService resource for the
  33576. // targetSslProxy.
  33577. Service string `json:"service,omitempty"`
  33578. // ForceSendFields is a list of field names (e.g. "Service") to
  33579. // unconditionally include in API requests. By default, fields with
  33580. // empty values are omitted from API requests. However, any non-pointer,
  33581. // non-interface field appearing in ForceSendFields will be sent to the
  33582. // server regardless of whether the field is empty or not. This may be
  33583. // used to include empty fields in Patch requests.
  33584. ForceSendFields []string `json:"-"`
  33585. // NullFields is a list of field names (e.g. "Service") to include in
  33586. // API requests with the JSON null value. By default, fields with empty
  33587. // values are omitted from API requests. However, any field with an
  33588. // empty value appearing in NullFields will be sent to the server as
  33589. // null. It is an error if a field in this list has a non-empty value.
  33590. // This may be used to include null fields in Patch requests.
  33591. NullFields []string `json:"-"`
  33592. }
  33593. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  33594. type NoMethod TargetSslProxiesSetBackendServiceRequest
  33595. raw := NoMethod(*s)
  33596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33597. }
  33598. type TargetSslProxiesSetProxyHeaderRequest struct {
  33599. // ProxyHeader: The new type of proxy header to append before sending
  33600. // data to the backend. NONE or PROXY_V1 are allowed.
  33601. //
  33602. // Possible values:
  33603. // "NONE"
  33604. // "PROXY_V1"
  33605. ProxyHeader string `json:"proxyHeader,omitempty"`
  33606. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  33607. // unconditionally include in API requests. By default, fields with
  33608. // empty values are omitted from API requests. However, any non-pointer,
  33609. // non-interface field appearing in ForceSendFields will be sent to the
  33610. // server regardless of whether the field is empty or not. This may be
  33611. // used to include empty fields in Patch requests.
  33612. ForceSendFields []string `json:"-"`
  33613. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  33614. // in API requests with the JSON null value. By default, fields with
  33615. // empty values are omitted from API requests. However, any field with
  33616. // an empty value appearing in NullFields will be sent to the server as
  33617. // null. It is an error if a field in this list has a non-empty value.
  33618. // This may be used to include null fields in Patch requests.
  33619. NullFields []string `json:"-"`
  33620. }
  33621. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  33622. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  33623. raw := NoMethod(*s)
  33624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33625. }
  33626. type TargetSslProxiesSetSslCertificatesRequest struct {
  33627. // SslCertificates: New set of URLs to SslCertificate resources to
  33628. // associate with this TargetSslProxy. Currently exactly one ssl
  33629. // certificate must be specified.
  33630. SslCertificates []string `json:"sslCertificates,omitempty"`
  33631. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  33632. // unconditionally include in API requests. By default, fields with
  33633. // empty values are omitted from API requests. However, any non-pointer,
  33634. // non-interface field appearing in ForceSendFields will be sent to the
  33635. // server regardless of whether the field is empty or not. This may be
  33636. // used to include empty fields in Patch requests.
  33637. ForceSendFields []string `json:"-"`
  33638. // NullFields is a list of field names (e.g. "SslCertificates") to
  33639. // include in API requests with the JSON null value. By default, fields
  33640. // with empty values are omitted from API requests. However, any field
  33641. // with an empty value appearing in NullFields will be sent to the
  33642. // server as null. It is an error if a field in this list has a
  33643. // non-empty value. This may be used to include null fields in Patch
  33644. // requests.
  33645. NullFields []string `json:"-"`
  33646. }
  33647. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  33648. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  33649. raw := NoMethod(*s)
  33650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33651. }
  33652. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  33653. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  33654. // resource_for v1.targetSslProxies ==)
  33655. type TargetSslProxy struct {
  33656. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  33657. // format.
  33658. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  33659. // Description: An optional description of this resource. Provide this
  33660. // property when you create the resource.
  33661. Description string `json:"description,omitempty"`
  33662. // Id: [Output Only] The unique identifier for the resource. This
  33663. // identifier is defined by the server.
  33664. Id uint64 `json:"id,omitempty,string"`
  33665. // Kind: [Output Only] Type of the resource. Always
  33666. // compute#targetSslProxy for target SSL proxies.
  33667. Kind string `json:"kind,omitempty"`
  33668. // Name: Name of the resource. Provided by the client when the resource
  33669. // is created. The name must be 1-63 characters long, and comply with
  33670. // RFC1035. Specifically, the name must be 1-63 characters long and
  33671. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  33672. // the first character must be a lowercase letter, and all following
  33673. // characters must be a dash, lowercase letter, or digit, except the
  33674. // last character, which cannot be a dash.
  33675. Name string `json:"name,omitempty"`
  33676. // ProxyHeader: Specifies the type of proxy header to append before
  33677. // sending data to the backend, either NONE or PROXY_V1. The default is
  33678. // NONE.
  33679. //
  33680. // Possible values:
  33681. // "NONE"
  33682. // "PROXY_V1"
  33683. ProxyHeader string `json:"proxyHeader,omitempty"`
  33684. // SelfLink: [Output Only] Server-defined URL for the resource.
  33685. SelfLink string `json:"selfLink,omitempty"`
  33686. // Service: URL to the BackendService resource.
  33687. Service string `json:"service,omitempty"`
  33688. // SslCertificates: URLs to SslCertificate resources that are used to
  33689. // authenticate connections to Backends. At least one SSL certificate
  33690. // must be specified. Currently, you may specify up to 15 SSL
  33691. // certificates.
  33692. SslCertificates []string `json:"sslCertificates,omitempty"`
  33693. // SslPolicy: URL of SslPolicy resource that will be associated with the
  33694. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  33695. // not have any SSL policy configured.
  33696. SslPolicy string `json:"sslPolicy,omitempty"`
  33697. // ServerResponse contains the HTTP response code and headers from the
  33698. // server.
  33699. googleapi.ServerResponse `json:"-"`
  33700. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  33701. // to unconditionally include in API requests. By default, fields with
  33702. // empty values are omitted from API requests. However, any non-pointer,
  33703. // non-interface field appearing in ForceSendFields will be sent to the
  33704. // server regardless of whether the field is empty or not. This may be
  33705. // used to include empty fields in Patch requests.
  33706. ForceSendFields []string `json:"-"`
  33707. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  33708. // include in API requests with the JSON null value. By default, fields
  33709. // with empty values are omitted from API requests. However, any field
  33710. // with an empty value appearing in NullFields will be sent to the
  33711. // server as null. It is an error if a field in this list has a
  33712. // non-empty value. This may be used to include null fields in Patch
  33713. // requests.
  33714. NullFields []string `json:"-"`
  33715. }
  33716. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  33717. type NoMethod TargetSslProxy
  33718. raw := NoMethod(*s)
  33719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33720. }
  33721. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  33722. type TargetSslProxyList struct {
  33723. // Id: [Output Only] Unique identifier for the resource; defined by the
  33724. // server.
  33725. Id string `json:"id,omitempty"`
  33726. // Items: A list of TargetSslProxy resources.
  33727. Items []*TargetSslProxy `json:"items,omitempty"`
  33728. // Kind: Type of resource.
  33729. Kind string `json:"kind,omitempty"`
  33730. // NextPageToken: [Output Only] This token allows you to get the next
  33731. // page of results for list requests. If the number of results is larger
  33732. // than maxResults, use the nextPageToken as a value for the query
  33733. // parameter pageToken in the next list request. Subsequent list
  33734. // requests will have their own nextPageToken to continue paging through
  33735. // the results.
  33736. NextPageToken string `json:"nextPageToken,omitempty"`
  33737. // SelfLink: [Output Only] Server-defined URL for this resource.
  33738. SelfLink string `json:"selfLink,omitempty"`
  33739. // Warning: [Output Only] Informational warning message.
  33740. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  33741. // ServerResponse contains the HTTP response code and headers from the
  33742. // server.
  33743. googleapi.ServerResponse `json:"-"`
  33744. // ForceSendFields is a list of field names (e.g. "Id") to
  33745. // unconditionally include in API requests. By default, fields with
  33746. // empty values are omitted from API requests. However, any non-pointer,
  33747. // non-interface field appearing in ForceSendFields will be sent to the
  33748. // server regardless of whether the field is empty or not. This may be
  33749. // used to include empty fields in Patch requests.
  33750. ForceSendFields []string `json:"-"`
  33751. // NullFields is a list of field names (e.g. "Id") to include in API
  33752. // requests with the JSON null value. By default, fields with empty
  33753. // values are omitted from API requests. However, any field with an
  33754. // empty value appearing in NullFields will be sent to the server as
  33755. // null. It is an error if a field in this list has a non-empty value.
  33756. // This may be used to include null fields in Patch requests.
  33757. NullFields []string `json:"-"`
  33758. }
  33759. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  33760. type NoMethod TargetSslProxyList
  33761. raw := NoMethod(*s)
  33762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33763. }
  33764. // TargetSslProxyListWarning: [Output Only] Informational warning
  33765. // message.
  33766. type TargetSslProxyListWarning struct {
  33767. // Code: [Output Only] A warning code, if applicable. For example,
  33768. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  33769. // the response.
  33770. //
  33771. // Possible values:
  33772. // "CLEANUP_FAILED"
  33773. // "DEPRECATED_RESOURCE_USED"
  33774. // "DEPRECATED_TYPE_USED"
  33775. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  33776. // "EXPERIMENTAL_TYPE_USED"
  33777. // "EXTERNAL_API_WARNING"
  33778. // "FIELD_VALUE_OVERRIDEN"
  33779. // "INJECTED_KERNELS_DEPRECATED"
  33780. // "MISSING_TYPE_DEPENDENCY"
  33781. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  33782. // "NEXT_HOP_CANNOT_IP_FORWARD"
  33783. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  33784. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  33785. // "NEXT_HOP_NOT_RUNNING"
  33786. // "NOT_CRITICAL_ERROR"
  33787. // "NO_RESULTS_ON_PAGE"
  33788. // "REQUIRED_TOS_AGREEMENT"
  33789. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  33790. // "RESOURCE_NOT_DELETED"
  33791. // "SCHEMA_VALIDATION_IGNORED"
  33792. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  33793. // "UNDECLARED_PROPERTIES"
  33794. // "UNREACHABLE"
  33795. Code string `json:"code,omitempty"`
  33796. // Data: [Output Only] Metadata about this warning in key: value format.
  33797. // For example:
  33798. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  33799. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  33800. // Message: [Output Only] A human-readable description of the warning
  33801. // code.
  33802. Message string `json:"message,omitempty"`
  33803. // ForceSendFields is a list of field names (e.g. "Code") to
  33804. // unconditionally include in API requests. By default, fields with
  33805. // empty values are omitted from API requests. However, any non-pointer,
  33806. // non-interface field appearing in ForceSendFields will be sent to the
  33807. // server regardless of whether the field is empty or not. This may be
  33808. // used to include empty fields in Patch requests.
  33809. ForceSendFields []string `json:"-"`
  33810. // NullFields is a list of field names (e.g. "Code") to include in API
  33811. // requests with the JSON null value. By default, fields with empty
  33812. // values are omitted from API requests. However, any field with an
  33813. // empty value appearing in NullFields will be sent to the server as
  33814. // null. It is an error if a field in this list has a non-empty value.
  33815. // This may be used to include null fields in Patch requests.
  33816. NullFields []string `json:"-"`
  33817. }
  33818. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  33819. type NoMethod TargetSslProxyListWarning
  33820. raw := NoMethod(*s)
  33821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33822. }
  33823. type TargetSslProxyListWarningData struct {
  33824. // Key: [Output Only] A key that provides more detail on the warning
  33825. // being returned. For example, for warnings where there are no results
  33826. // in a list request for a particular zone, this key might be scope and
  33827. // the key value might be the zone name. Other examples might be a key
  33828. // indicating a deprecated resource and a suggested replacement, or a
  33829. // warning about invalid network settings (for example, if an instance
  33830. // attempts to perform IP forwarding but is not enabled for IP
  33831. // forwarding).
  33832. Key string `json:"key,omitempty"`
  33833. // Value: [Output Only] A warning data value corresponding to the key.
  33834. Value string `json:"value,omitempty"`
  33835. // ForceSendFields is a list of field names (e.g. "Key") to
  33836. // unconditionally include in API requests. By default, fields with
  33837. // empty values are omitted from API requests. However, any non-pointer,
  33838. // non-interface field appearing in ForceSendFields will be sent to the
  33839. // server regardless of whether the field is empty or not. This may be
  33840. // used to include empty fields in Patch requests.
  33841. ForceSendFields []string `json:"-"`
  33842. // NullFields is a list of field names (e.g. "Key") to include in API
  33843. // requests with the JSON null value. By default, fields with empty
  33844. // values are omitted from API requests. However, any field with an
  33845. // empty value appearing in NullFields will be sent to the server as
  33846. // null. It is an error if a field in this list has a non-empty value.
  33847. // This may be used to include null fields in Patch requests.
  33848. NullFields []string `json:"-"`
  33849. }
  33850. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  33851. type NoMethod TargetSslProxyListWarningData
  33852. raw := NoMethod(*s)
  33853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33854. }
  33855. type TargetTcpProxiesSetBackendServiceRequest struct {
  33856. // Service: The URL of the new BackendService resource for the
  33857. // targetTcpProxy.
  33858. Service string `json:"service,omitempty"`
  33859. // ForceSendFields is a list of field names (e.g. "Service") to
  33860. // unconditionally include in API requests. By default, fields with
  33861. // empty values are omitted from API requests. However, any non-pointer,
  33862. // non-interface field appearing in ForceSendFields will be sent to the
  33863. // server regardless of whether the field is empty or not. This may be
  33864. // used to include empty fields in Patch requests.
  33865. ForceSendFields []string `json:"-"`
  33866. // NullFields is a list of field names (e.g. "Service") to include in
  33867. // API requests with the JSON null value. By default, fields with empty
  33868. // values are omitted from API requests. However, any field with an
  33869. // empty value appearing in NullFields will be sent to the server as
  33870. // null. It is an error if a field in this list has a non-empty value.
  33871. // This may be used to include null fields in Patch requests.
  33872. NullFields []string `json:"-"`
  33873. }
  33874. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  33875. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  33876. raw := NoMethod(*s)
  33877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33878. }
  33879. type TargetTcpProxiesSetProxyHeaderRequest struct {
  33880. // ProxyHeader: The new type of proxy header to append before sending
  33881. // data to the backend. NONE or PROXY_V1 are allowed.
  33882. //
  33883. // Possible values:
  33884. // "NONE"
  33885. // "PROXY_V1"
  33886. ProxyHeader string `json:"proxyHeader,omitempty"`
  33887. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  33888. // unconditionally include in API requests. By default, fields with
  33889. // empty values are omitted from API requests. However, any non-pointer,
  33890. // non-interface field appearing in ForceSendFields will be sent to the
  33891. // server regardless of whether the field is empty or not. This may be
  33892. // used to include empty fields in Patch requests.
  33893. ForceSendFields []string `json:"-"`
  33894. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  33895. // in API requests with the JSON null value. By default, fields with
  33896. // empty values are omitted from API requests. However, any field with
  33897. // an empty value appearing in NullFields will be sent to the server as
  33898. // null. It is an error if a field in this list has a non-empty value.
  33899. // This may be used to include null fields in Patch requests.
  33900. NullFields []string `json:"-"`
  33901. }
  33902. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  33903. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  33904. raw := NoMethod(*s)
  33905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33906. }
  33907. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  33908. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  33909. // resource_for v1.targetTcpProxies ==)
  33910. type TargetTcpProxy struct {
  33911. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  33912. // format.
  33913. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  33914. // Description: An optional description of this resource. Provide this
  33915. // property when you create the resource.
  33916. Description string `json:"description,omitempty"`
  33917. // Id: [Output Only] The unique identifier for the resource. This
  33918. // identifier is defined by the server.
  33919. Id uint64 `json:"id,omitempty,string"`
  33920. // Kind: [Output Only] Type of the resource. Always
  33921. // compute#targetTcpProxy for target TCP proxies.
  33922. Kind string `json:"kind,omitempty"`
  33923. // Name: Name of the resource. Provided by the client when the resource
  33924. // is created. The name must be 1-63 characters long, and comply with
  33925. // RFC1035. Specifically, the name must be 1-63 characters long and
  33926. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  33927. // the first character must be a lowercase letter, and all following
  33928. // characters must be a dash, lowercase letter, or digit, except the
  33929. // last character, which cannot be a dash.
  33930. Name string `json:"name,omitempty"`
  33931. // ProxyHeader: Specifies the type of proxy header to append before
  33932. // sending data to the backend, either NONE or PROXY_V1. The default is
  33933. // NONE.
  33934. //
  33935. // Possible values:
  33936. // "NONE"
  33937. // "PROXY_V1"
  33938. ProxyHeader string `json:"proxyHeader,omitempty"`
  33939. // SelfLink: [Output Only] Server-defined URL for the resource.
  33940. SelfLink string `json:"selfLink,omitempty"`
  33941. // Service: URL to the BackendService resource.
  33942. Service string `json:"service,omitempty"`
  33943. // ServerResponse contains the HTTP response code and headers from the
  33944. // server.
  33945. googleapi.ServerResponse `json:"-"`
  33946. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  33947. // to unconditionally include in API requests. By default, fields with
  33948. // empty values are omitted from API requests. However, any non-pointer,
  33949. // non-interface field appearing in ForceSendFields will be sent to the
  33950. // server regardless of whether the field is empty or not. This may be
  33951. // used to include empty fields in Patch requests.
  33952. ForceSendFields []string `json:"-"`
  33953. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  33954. // include in API requests with the JSON null value. By default, fields
  33955. // with empty values are omitted from API requests. However, any field
  33956. // with an empty value appearing in NullFields will be sent to the
  33957. // server as null. It is an error if a field in this list has a
  33958. // non-empty value. This may be used to include null fields in Patch
  33959. // requests.
  33960. NullFields []string `json:"-"`
  33961. }
  33962. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  33963. type NoMethod TargetTcpProxy
  33964. raw := NoMethod(*s)
  33965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  33966. }
  33967. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  33968. type TargetTcpProxyList struct {
  33969. // Id: [Output Only] Unique identifier for the resource; defined by the
  33970. // server.
  33971. Id string `json:"id,omitempty"`
  33972. // Items: A list of TargetTcpProxy resources.
  33973. Items []*TargetTcpProxy `json:"items,omitempty"`
  33974. // Kind: Type of resource.
  33975. Kind string `json:"kind,omitempty"`
  33976. // NextPageToken: [Output Only] This token allows you to get the next
  33977. // page of results for list requests. If the number of results is larger
  33978. // than maxResults, use the nextPageToken as a value for the query
  33979. // parameter pageToken in the next list request. Subsequent list
  33980. // requests will have their own nextPageToken to continue paging through
  33981. // the results.
  33982. NextPageToken string `json:"nextPageToken,omitempty"`
  33983. // SelfLink: [Output Only] Server-defined URL for this resource.
  33984. SelfLink string `json:"selfLink,omitempty"`
  33985. // Warning: [Output Only] Informational warning message.
  33986. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  33987. // ServerResponse contains the HTTP response code and headers from the
  33988. // server.
  33989. googleapi.ServerResponse `json:"-"`
  33990. // ForceSendFields is a list of field names (e.g. "Id") to
  33991. // unconditionally include in API requests. By default, fields with
  33992. // empty values are omitted from API requests. However, any non-pointer,
  33993. // non-interface field appearing in ForceSendFields will be sent to the
  33994. // server regardless of whether the field is empty or not. This may be
  33995. // used to include empty fields in Patch requests.
  33996. ForceSendFields []string `json:"-"`
  33997. // NullFields is a list of field names (e.g. "Id") to include in API
  33998. // requests with the JSON null value. By default, fields with empty
  33999. // values are omitted from API requests. However, any field with an
  34000. // empty value appearing in NullFields will be sent to the server as
  34001. // null. It is an error if a field in this list has a non-empty value.
  34002. // This may be used to include null fields in Patch requests.
  34003. NullFields []string `json:"-"`
  34004. }
  34005. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  34006. type NoMethod TargetTcpProxyList
  34007. raw := NoMethod(*s)
  34008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34009. }
  34010. // TargetTcpProxyListWarning: [Output Only] Informational warning
  34011. // message.
  34012. type TargetTcpProxyListWarning struct {
  34013. // Code: [Output Only] A warning code, if applicable. For example,
  34014. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34015. // the response.
  34016. //
  34017. // Possible values:
  34018. // "CLEANUP_FAILED"
  34019. // "DEPRECATED_RESOURCE_USED"
  34020. // "DEPRECATED_TYPE_USED"
  34021. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34022. // "EXPERIMENTAL_TYPE_USED"
  34023. // "EXTERNAL_API_WARNING"
  34024. // "FIELD_VALUE_OVERRIDEN"
  34025. // "INJECTED_KERNELS_DEPRECATED"
  34026. // "MISSING_TYPE_DEPENDENCY"
  34027. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34028. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34029. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34030. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34031. // "NEXT_HOP_NOT_RUNNING"
  34032. // "NOT_CRITICAL_ERROR"
  34033. // "NO_RESULTS_ON_PAGE"
  34034. // "REQUIRED_TOS_AGREEMENT"
  34035. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34036. // "RESOURCE_NOT_DELETED"
  34037. // "SCHEMA_VALIDATION_IGNORED"
  34038. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  34039. // "UNDECLARED_PROPERTIES"
  34040. // "UNREACHABLE"
  34041. Code string `json:"code,omitempty"`
  34042. // Data: [Output Only] Metadata about this warning in key: value format.
  34043. // For example:
  34044. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  34045. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  34046. // Message: [Output Only] A human-readable description of the warning
  34047. // code.
  34048. Message string `json:"message,omitempty"`
  34049. // ForceSendFields is a list of field names (e.g. "Code") to
  34050. // unconditionally include in API requests. By default, fields with
  34051. // empty values are omitted from API requests. However, any non-pointer,
  34052. // non-interface field appearing in ForceSendFields will be sent to the
  34053. // server regardless of whether the field is empty or not. This may be
  34054. // used to include empty fields in Patch requests.
  34055. ForceSendFields []string `json:"-"`
  34056. // NullFields is a list of field names (e.g. "Code") to include in API
  34057. // requests with the JSON null value. By default, fields with empty
  34058. // values are omitted from API requests. However, any field with an
  34059. // empty value appearing in NullFields will be sent to the server as
  34060. // null. It is an error if a field in this list has a non-empty value.
  34061. // This may be used to include null fields in Patch requests.
  34062. NullFields []string `json:"-"`
  34063. }
  34064. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  34065. type NoMethod TargetTcpProxyListWarning
  34066. raw := NoMethod(*s)
  34067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34068. }
  34069. type TargetTcpProxyListWarningData struct {
  34070. // Key: [Output Only] A key that provides more detail on the warning
  34071. // being returned. For example, for warnings where there are no results
  34072. // in a list request for a particular zone, this key might be scope and
  34073. // the key value might be the zone name. Other examples might be a key
  34074. // indicating a deprecated resource and a suggested replacement, or a
  34075. // warning about invalid network settings (for example, if an instance
  34076. // attempts to perform IP forwarding but is not enabled for IP
  34077. // forwarding).
  34078. Key string `json:"key,omitempty"`
  34079. // Value: [Output Only] A warning data value corresponding to the key.
  34080. Value string `json:"value,omitempty"`
  34081. // ForceSendFields is a list of field names (e.g. "Key") to
  34082. // unconditionally include in API requests. By default, fields with
  34083. // empty values are omitted from API requests. However, any non-pointer,
  34084. // non-interface field appearing in ForceSendFields will be sent to the
  34085. // server regardless of whether the field is empty or not. This may be
  34086. // used to include empty fields in Patch requests.
  34087. ForceSendFields []string `json:"-"`
  34088. // NullFields is a list of field names (e.g. "Key") to include in API
  34089. // requests with the JSON null value. By default, fields with empty
  34090. // values are omitted from API requests. However, any field with an
  34091. // empty value appearing in NullFields will be sent to the server as
  34092. // null. It is an error if a field in this list has a non-empty value.
  34093. // This may be used to include null fields in Patch requests.
  34094. NullFields []string `json:"-"`
  34095. }
  34096. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  34097. type NoMethod TargetTcpProxyListWarningData
  34098. raw := NoMethod(*s)
  34099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34100. }
  34101. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  34102. // resource_for beta.targetVpnGateways ==) (== resource_for
  34103. // v1.targetVpnGateways ==)
  34104. type TargetVpnGateway struct {
  34105. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  34106. // format.
  34107. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  34108. // Description: An optional description of this resource. Provide this
  34109. // property when you create the resource.
  34110. Description string `json:"description,omitempty"`
  34111. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  34112. // resources. ForwardingRules are created using
  34113. // compute.forwardingRules.insert and associated with a VPN gateway.
  34114. ForwardingRules []string `json:"forwardingRules,omitempty"`
  34115. // Id: [Output Only] The unique identifier for the resource. This
  34116. // identifier is defined by the server.
  34117. Id uint64 `json:"id,omitempty,string"`
  34118. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  34119. // for target VPN gateways.
  34120. Kind string `json:"kind,omitempty"`
  34121. // LabelFingerprint: A fingerprint for the labels being applied to this
  34122. // TargetVpnGateway, which is essentially a hash of the labels set used
  34123. // for optimistic locking. The fingerprint is initially generated by
  34124. // Compute Engine and changes after every request to modify or update
  34125. // labels. You must always provide an up-to-date fingerprint hash in
  34126. // order to update or change labels, otherwise the request will fail
  34127. // with error 412 conditionNotMet.
  34128. //
  34129. // To see the latest fingerprint, make a get() request to retrieve a
  34130. // TargetVpnGateway.
  34131. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  34132. // Labels: Labels to apply to this TargetVpnGateway resource. These can
  34133. // be later modified by the setLabels method. Each label key/value must
  34134. // comply with RFC1035. Label values may be empty.
  34135. Labels map[string]string `json:"labels,omitempty"`
  34136. // Name: Name of the resource. Provided by the client when the resource
  34137. // is created. The name must be 1-63 characters long, and comply with
  34138. // RFC1035. Specifically, the name must be 1-63 characters long and
  34139. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  34140. // the first character must be a lowercase letter, and all following
  34141. // characters must be a dash, lowercase letter, or digit, except the
  34142. // last character, which cannot be a dash.
  34143. Name string `json:"name,omitempty"`
  34144. // Network: URL of the network to which this VPN gateway is attached.
  34145. // Provided by the client when the VPN gateway is created.
  34146. Network string `json:"network,omitempty"`
  34147. // Region: [Output Only] URL of the region where the target VPN gateway
  34148. // resides. You must specify this field as part of the HTTP request URL.
  34149. // It is not settable as a field in the request body.
  34150. Region string `json:"region,omitempty"`
  34151. // SelfLink: [Output Only] Server-defined URL for the resource.
  34152. SelfLink string `json:"selfLink,omitempty"`
  34153. // Status: [Output Only] The status of the VPN gateway, which can be one
  34154. // of the following: CREATING, READY, FAILED, or DELETING.
  34155. //
  34156. // Possible values:
  34157. // "CREATING"
  34158. // "DELETING"
  34159. // "FAILED"
  34160. // "READY"
  34161. Status string `json:"status,omitempty"`
  34162. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  34163. // VpnTunnels are created using the compute.vpntunnels.insert method and
  34164. // associated with a VPN gateway.
  34165. Tunnels []string `json:"tunnels,omitempty"`
  34166. // ServerResponse contains the HTTP response code and headers from the
  34167. // server.
  34168. googleapi.ServerResponse `json:"-"`
  34169. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  34170. // to unconditionally include in API requests. By default, fields with
  34171. // empty values are omitted from API requests. However, any non-pointer,
  34172. // non-interface field appearing in ForceSendFields will be sent to the
  34173. // server regardless of whether the field is empty or not. This may be
  34174. // used to include empty fields in Patch requests.
  34175. ForceSendFields []string `json:"-"`
  34176. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  34177. // include in API requests with the JSON null value. By default, fields
  34178. // with empty values are omitted from API requests. However, any field
  34179. // with an empty value appearing in NullFields will be sent to the
  34180. // server as null. It is an error if a field in this list has a
  34181. // non-empty value. This may be used to include null fields in Patch
  34182. // requests.
  34183. NullFields []string `json:"-"`
  34184. }
  34185. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  34186. type NoMethod TargetVpnGateway
  34187. raw := NoMethod(*s)
  34188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34189. }
  34190. type TargetVpnGatewayAggregatedList struct {
  34191. // Id: [Output Only] Unique identifier for the resource; defined by the
  34192. // server.
  34193. Id string `json:"id,omitempty"`
  34194. // Items: A list of TargetVpnGateway resources.
  34195. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  34196. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  34197. // for target VPN gateways.
  34198. Kind string `json:"kind,omitempty"`
  34199. // NextPageToken: [Output Only] This token allows you to get the next
  34200. // page of results for list requests. If the number of results is larger
  34201. // than maxResults, use the nextPageToken as a value for the query
  34202. // parameter pageToken in the next list request. Subsequent list
  34203. // requests will have their own nextPageToken to continue paging through
  34204. // the results.
  34205. NextPageToken string `json:"nextPageToken,omitempty"`
  34206. // SelfLink: [Output Only] Server-defined URL for this resource.
  34207. SelfLink string `json:"selfLink,omitempty"`
  34208. // Warning: [Output Only] Informational warning message.
  34209. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  34210. // ServerResponse contains the HTTP response code and headers from the
  34211. // server.
  34212. googleapi.ServerResponse `json:"-"`
  34213. // ForceSendFields is a list of field names (e.g. "Id") to
  34214. // unconditionally include in API requests. By default, fields with
  34215. // empty values are omitted from API requests. However, any non-pointer,
  34216. // non-interface field appearing in ForceSendFields will be sent to the
  34217. // server regardless of whether the field is empty or not. This may be
  34218. // used to include empty fields in Patch requests.
  34219. ForceSendFields []string `json:"-"`
  34220. // NullFields is a list of field names (e.g. "Id") to include in API
  34221. // requests with the JSON null value. By default, fields with empty
  34222. // values are omitted from API requests. However, any field with an
  34223. // empty value appearing in NullFields will be sent to the server as
  34224. // null. It is an error if a field in this list has a non-empty value.
  34225. // This may be used to include null fields in Patch requests.
  34226. NullFields []string `json:"-"`
  34227. }
  34228. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  34229. type NoMethod TargetVpnGatewayAggregatedList
  34230. raw := NoMethod(*s)
  34231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34232. }
  34233. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  34234. // warning message.
  34235. type TargetVpnGatewayAggregatedListWarning struct {
  34236. // Code: [Output Only] A warning code, if applicable. For example,
  34237. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34238. // the response.
  34239. //
  34240. // Possible values:
  34241. // "CLEANUP_FAILED"
  34242. // "DEPRECATED_RESOURCE_USED"
  34243. // "DEPRECATED_TYPE_USED"
  34244. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34245. // "EXPERIMENTAL_TYPE_USED"
  34246. // "EXTERNAL_API_WARNING"
  34247. // "FIELD_VALUE_OVERRIDEN"
  34248. // "INJECTED_KERNELS_DEPRECATED"
  34249. // "MISSING_TYPE_DEPENDENCY"
  34250. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34251. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34252. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34253. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34254. // "NEXT_HOP_NOT_RUNNING"
  34255. // "NOT_CRITICAL_ERROR"
  34256. // "NO_RESULTS_ON_PAGE"
  34257. // "REQUIRED_TOS_AGREEMENT"
  34258. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34259. // "RESOURCE_NOT_DELETED"
  34260. // "SCHEMA_VALIDATION_IGNORED"
  34261. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  34262. // "UNDECLARED_PROPERTIES"
  34263. // "UNREACHABLE"
  34264. Code string `json:"code,omitempty"`
  34265. // Data: [Output Only] Metadata about this warning in key: value format.
  34266. // For example:
  34267. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  34268. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  34269. // Message: [Output Only] A human-readable description of the warning
  34270. // code.
  34271. Message string `json:"message,omitempty"`
  34272. // ForceSendFields is a list of field names (e.g. "Code") to
  34273. // unconditionally include in API requests. By default, fields with
  34274. // empty values are omitted from API requests. However, any non-pointer,
  34275. // non-interface field appearing in ForceSendFields will be sent to the
  34276. // server regardless of whether the field is empty or not. This may be
  34277. // used to include empty fields in Patch requests.
  34278. ForceSendFields []string `json:"-"`
  34279. // NullFields is a list of field names (e.g. "Code") to include in API
  34280. // requests with the JSON null value. By default, fields with empty
  34281. // values are omitted from API requests. However, any field with an
  34282. // empty value appearing in NullFields will be sent to the server as
  34283. // null. It is an error if a field in this list has a non-empty value.
  34284. // This may be used to include null fields in Patch requests.
  34285. NullFields []string `json:"-"`
  34286. }
  34287. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  34288. type NoMethod TargetVpnGatewayAggregatedListWarning
  34289. raw := NoMethod(*s)
  34290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34291. }
  34292. type TargetVpnGatewayAggregatedListWarningData struct {
  34293. // Key: [Output Only] A key that provides more detail on the warning
  34294. // being returned. For example, for warnings where there are no results
  34295. // in a list request for a particular zone, this key might be scope and
  34296. // the key value might be the zone name. Other examples might be a key
  34297. // indicating a deprecated resource and a suggested replacement, or a
  34298. // warning about invalid network settings (for example, if an instance
  34299. // attempts to perform IP forwarding but is not enabled for IP
  34300. // forwarding).
  34301. Key string `json:"key,omitempty"`
  34302. // Value: [Output Only] A warning data value corresponding to the key.
  34303. Value string `json:"value,omitempty"`
  34304. // ForceSendFields is a list of field names (e.g. "Key") to
  34305. // unconditionally include in API requests. By default, fields with
  34306. // empty values are omitted from API requests. However, any non-pointer,
  34307. // non-interface field appearing in ForceSendFields will be sent to the
  34308. // server regardless of whether the field is empty or not. This may be
  34309. // used to include empty fields in Patch requests.
  34310. ForceSendFields []string `json:"-"`
  34311. // NullFields is a list of field names (e.g. "Key") to include in API
  34312. // requests with the JSON null value. By default, fields with empty
  34313. // values are omitted from API requests. However, any field with an
  34314. // empty value appearing in NullFields will be sent to the server as
  34315. // null. It is an error if a field in this list has a non-empty value.
  34316. // This may be used to include null fields in Patch requests.
  34317. NullFields []string `json:"-"`
  34318. }
  34319. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  34320. type NoMethod TargetVpnGatewayAggregatedListWarningData
  34321. raw := NoMethod(*s)
  34322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34323. }
  34324. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  34325. type TargetVpnGatewayList struct {
  34326. // Id: [Output Only] Unique identifier for the resource; defined by the
  34327. // server.
  34328. Id string `json:"id,omitempty"`
  34329. // Items: A list of TargetVpnGateway resources.
  34330. Items []*TargetVpnGateway `json:"items,omitempty"`
  34331. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  34332. // for target VPN gateways.
  34333. Kind string `json:"kind,omitempty"`
  34334. // NextPageToken: [Output Only] This token allows you to get the next
  34335. // page of results for list requests. If the number of results is larger
  34336. // than maxResults, use the nextPageToken as a value for the query
  34337. // parameter pageToken in the next list request. Subsequent list
  34338. // requests will have their own nextPageToken to continue paging through
  34339. // the results.
  34340. NextPageToken string `json:"nextPageToken,omitempty"`
  34341. // SelfLink: [Output Only] Server-defined URL for this resource.
  34342. SelfLink string `json:"selfLink,omitempty"`
  34343. // Warning: [Output Only] Informational warning message.
  34344. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  34345. // ServerResponse contains the HTTP response code and headers from the
  34346. // server.
  34347. googleapi.ServerResponse `json:"-"`
  34348. // ForceSendFields is a list of field names (e.g. "Id") to
  34349. // unconditionally include in API requests. By default, fields with
  34350. // empty values are omitted from API requests. However, any non-pointer,
  34351. // non-interface field appearing in ForceSendFields will be sent to the
  34352. // server regardless of whether the field is empty or not. This may be
  34353. // used to include empty fields in Patch requests.
  34354. ForceSendFields []string `json:"-"`
  34355. // NullFields is a list of field names (e.g. "Id") to include in API
  34356. // requests with the JSON null value. By default, fields with empty
  34357. // values are omitted from API requests. However, any field with an
  34358. // empty value appearing in NullFields will be sent to the server as
  34359. // null. It is an error if a field in this list has a non-empty value.
  34360. // This may be used to include null fields in Patch requests.
  34361. NullFields []string `json:"-"`
  34362. }
  34363. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  34364. type NoMethod TargetVpnGatewayList
  34365. raw := NoMethod(*s)
  34366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34367. }
  34368. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  34369. // message.
  34370. type TargetVpnGatewayListWarning struct {
  34371. // Code: [Output Only] A warning code, if applicable. For example,
  34372. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34373. // the response.
  34374. //
  34375. // Possible values:
  34376. // "CLEANUP_FAILED"
  34377. // "DEPRECATED_RESOURCE_USED"
  34378. // "DEPRECATED_TYPE_USED"
  34379. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34380. // "EXPERIMENTAL_TYPE_USED"
  34381. // "EXTERNAL_API_WARNING"
  34382. // "FIELD_VALUE_OVERRIDEN"
  34383. // "INJECTED_KERNELS_DEPRECATED"
  34384. // "MISSING_TYPE_DEPENDENCY"
  34385. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34386. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34387. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34388. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34389. // "NEXT_HOP_NOT_RUNNING"
  34390. // "NOT_CRITICAL_ERROR"
  34391. // "NO_RESULTS_ON_PAGE"
  34392. // "REQUIRED_TOS_AGREEMENT"
  34393. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34394. // "RESOURCE_NOT_DELETED"
  34395. // "SCHEMA_VALIDATION_IGNORED"
  34396. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  34397. // "UNDECLARED_PROPERTIES"
  34398. // "UNREACHABLE"
  34399. Code string `json:"code,omitempty"`
  34400. // Data: [Output Only] Metadata about this warning in key: value format.
  34401. // For example:
  34402. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  34403. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  34404. // Message: [Output Only] A human-readable description of the warning
  34405. // code.
  34406. Message string `json:"message,omitempty"`
  34407. // ForceSendFields is a list of field names (e.g. "Code") to
  34408. // unconditionally include in API requests. By default, fields with
  34409. // empty values are omitted from API requests. However, any non-pointer,
  34410. // non-interface field appearing in ForceSendFields will be sent to the
  34411. // server regardless of whether the field is empty or not. This may be
  34412. // used to include empty fields in Patch requests.
  34413. ForceSendFields []string `json:"-"`
  34414. // NullFields is a list of field names (e.g. "Code") to include in API
  34415. // requests with the JSON null value. By default, fields with empty
  34416. // values are omitted from API requests. However, any field with an
  34417. // empty value appearing in NullFields will be sent to the server as
  34418. // null. It is an error if a field in this list has a non-empty value.
  34419. // This may be used to include null fields in Patch requests.
  34420. NullFields []string `json:"-"`
  34421. }
  34422. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  34423. type NoMethod TargetVpnGatewayListWarning
  34424. raw := NoMethod(*s)
  34425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34426. }
  34427. type TargetVpnGatewayListWarningData struct {
  34428. // Key: [Output Only] A key that provides more detail on the warning
  34429. // being returned. For example, for warnings where there are no results
  34430. // in a list request for a particular zone, this key might be scope and
  34431. // the key value might be the zone name. Other examples might be a key
  34432. // indicating a deprecated resource and a suggested replacement, or a
  34433. // warning about invalid network settings (for example, if an instance
  34434. // attempts to perform IP forwarding but is not enabled for IP
  34435. // forwarding).
  34436. Key string `json:"key,omitempty"`
  34437. // Value: [Output Only] A warning data value corresponding to the key.
  34438. Value string `json:"value,omitempty"`
  34439. // ForceSendFields is a list of field names (e.g. "Key") to
  34440. // unconditionally include in API requests. By default, fields with
  34441. // empty values are omitted from API requests. However, any non-pointer,
  34442. // non-interface field appearing in ForceSendFields will be sent to the
  34443. // server regardless of whether the field is empty or not. This may be
  34444. // used to include empty fields in Patch requests.
  34445. ForceSendFields []string `json:"-"`
  34446. // NullFields is a list of field names (e.g. "Key") to include in API
  34447. // requests with the JSON null value. By default, fields with empty
  34448. // values are omitted from API requests. However, any field with an
  34449. // empty value appearing in NullFields will be sent to the server as
  34450. // null. It is an error if a field in this list has a non-empty value.
  34451. // This may be used to include null fields in Patch requests.
  34452. NullFields []string `json:"-"`
  34453. }
  34454. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  34455. type NoMethod TargetVpnGatewayListWarningData
  34456. raw := NoMethod(*s)
  34457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34458. }
  34459. type TargetVpnGatewaysScopedList struct {
  34460. // TargetVpnGateways: [Output Only] A list of target VPN gateways
  34461. // contained in this scope.
  34462. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  34463. // Warning: [Output Only] Informational warning which replaces the list
  34464. // of addresses when the list is empty.
  34465. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  34466. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  34467. // to unconditionally include in API requests. By default, fields with
  34468. // empty values are omitted from API requests. However, any non-pointer,
  34469. // non-interface field appearing in ForceSendFields will be sent to the
  34470. // server regardless of whether the field is empty or not. This may be
  34471. // used to include empty fields in Patch requests.
  34472. ForceSendFields []string `json:"-"`
  34473. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  34474. // include in API requests with the JSON null value. By default, fields
  34475. // with empty values are omitted from API requests. However, any field
  34476. // with an empty value appearing in NullFields will be sent to the
  34477. // server as null. It is an error if a field in this list has a
  34478. // non-empty value. This may be used to include null fields in Patch
  34479. // requests.
  34480. NullFields []string `json:"-"`
  34481. }
  34482. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  34483. type NoMethod TargetVpnGatewaysScopedList
  34484. raw := NoMethod(*s)
  34485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34486. }
  34487. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  34488. // warning which replaces the list of addresses when the list is empty.
  34489. type TargetVpnGatewaysScopedListWarning struct {
  34490. // Code: [Output Only] A warning code, if applicable. For example,
  34491. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34492. // the response.
  34493. //
  34494. // Possible values:
  34495. // "CLEANUP_FAILED"
  34496. // "DEPRECATED_RESOURCE_USED"
  34497. // "DEPRECATED_TYPE_USED"
  34498. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34499. // "EXPERIMENTAL_TYPE_USED"
  34500. // "EXTERNAL_API_WARNING"
  34501. // "FIELD_VALUE_OVERRIDEN"
  34502. // "INJECTED_KERNELS_DEPRECATED"
  34503. // "MISSING_TYPE_DEPENDENCY"
  34504. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34505. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34506. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34507. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34508. // "NEXT_HOP_NOT_RUNNING"
  34509. // "NOT_CRITICAL_ERROR"
  34510. // "NO_RESULTS_ON_PAGE"
  34511. // "REQUIRED_TOS_AGREEMENT"
  34512. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34513. // "RESOURCE_NOT_DELETED"
  34514. // "SCHEMA_VALIDATION_IGNORED"
  34515. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  34516. // "UNDECLARED_PROPERTIES"
  34517. // "UNREACHABLE"
  34518. Code string `json:"code,omitempty"`
  34519. // Data: [Output Only] Metadata about this warning in key: value format.
  34520. // For example:
  34521. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  34522. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  34523. // Message: [Output Only] A human-readable description of the warning
  34524. // code.
  34525. Message string `json:"message,omitempty"`
  34526. // ForceSendFields is a list of field names (e.g. "Code") to
  34527. // unconditionally include in API requests. By default, fields with
  34528. // empty values are omitted from API requests. However, any non-pointer,
  34529. // non-interface field appearing in ForceSendFields will be sent to the
  34530. // server regardless of whether the field is empty or not. This may be
  34531. // used to include empty fields in Patch requests.
  34532. ForceSendFields []string `json:"-"`
  34533. // NullFields is a list of field names (e.g. "Code") to include in API
  34534. // requests with the JSON null value. By default, fields with empty
  34535. // values are omitted from API requests. However, any field with an
  34536. // empty value appearing in NullFields will be sent to the server as
  34537. // null. It is an error if a field in this list has a non-empty value.
  34538. // This may be used to include null fields in Patch requests.
  34539. NullFields []string `json:"-"`
  34540. }
  34541. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  34542. type NoMethod TargetVpnGatewaysScopedListWarning
  34543. raw := NoMethod(*s)
  34544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34545. }
  34546. type TargetVpnGatewaysScopedListWarningData struct {
  34547. // Key: [Output Only] A key that provides more detail on the warning
  34548. // being returned. For example, for warnings where there are no results
  34549. // in a list request for a particular zone, this key might be scope and
  34550. // the key value might be the zone name. Other examples might be a key
  34551. // indicating a deprecated resource and a suggested replacement, or a
  34552. // warning about invalid network settings (for example, if an instance
  34553. // attempts to perform IP forwarding but is not enabled for IP
  34554. // forwarding).
  34555. Key string `json:"key,omitempty"`
  34556. // Value: [Output Only] A warning data value corresponding to the key.
  34557. Value string `json:"value,omitempty"`
  34558. // ForceSendFields is a list of field names (e.g. "Key") to
  34559. // unconditionally include in API requests. By default, fields with
  34560. // empty values are omitted from API requests. However, any non-pointer,
  34561. // non-interface field appearing in ForceSendFields will be sent to the
  34562. // server regardless of whether the field is empty or not. This may be
  34563. // used to include empty fields in Patch requests.
  34564. ForceSendFields []string `json:"-"`
  34565. // NullFields is a list of field names (e.g. "Key") to include in API
  34566. // requests with the JSON null value. By default, fields with empty
  34567. // values are omitted from API requests. However, any field with an
  34568. // empty value appearing in NullFields will be sent to the server as
  34569. // null. It is an error if a field in this list has a non-empty value.
  34570. // This may be used to include null fields in Patch requests.
  34571. NullFields []string `json:"-"`
  34572. }
  34573. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  34574. type NoMethod TargetVpnGatewaysScopedListWarningData
  34575. raw := NoMethod(*s)
  34576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34577. }
  34578. type TestFailure struct {
  34579. ActualService string `json:"actualService,omitempty"`
  34580. ExpectedService string `json:"expectedService,omitempty"`
  34581. Host string `json:"host,omitempty"`
  34582. Path string `json:"path,omitempty"`
  34583. // ForceSendFields is a list of field names (e.g. "ActualService") to
  34584. // unconditionally include in API requests. By default, fields with
  34585. // empty values are omitted from API requests. However, any non-pointer,
  34586. // non-interface field appearing in ForceSendFields will be sent to the
  34587. // server regardless of whether the field is empty or not. This may be
  34588. // used to include empty fields in Patch requests.
  34589. ForceSendFields []string `json:"-"`
  34590. // NullFields is a list of field names (e.g. "ActualService") to include
  34591. // in API requests with the JSON null value. By default, fields with
  34592. // empty values are omitted from API requests. However, any field with
  34593. // an empty value appearing in NullFields will be sent to the server as
  34594. // null. It is an error if a field in this list has a non-empty value.
  34595. // This may be used to include null fields in Patch requests.
  34596. NullFields []string `json:"-"`
  34597. }
  34598. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  34599. type NoMethod TestFailure
  34600. raw := NoMethod(*s)
  34601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34602. }
  34603. type TestPermissionsRequest struct {
  34604. // Permissions: The set of permissions to check for the 'resource'.
  34605. // Permissions with wildcards (such as '*' or 'storage.*') are not
  34606. // allowed.
  34607. Permissions []string `json:"permissions,omitempty"`
  34608. // ForceSendFields is a list of field names (e.g. "Permissions") to
  34609. // unconditionally include in API requests. By default, fields with
  34610. // empty values are omitted from API requests. However, any non-pointer,
  34611. // non-interface field appearing in ForceSendFields will be sent to the
  34612. // server regardless of whether the field is empty or not. This may be
  34613. // used to include empty fields in Patch requests.
  34614. ForceSendFields []string `json:"-"`
  34615. // NullFields is a list of field names (e.g. "Permissions") to include
  34616. // in API requests with the JSON null value. By default, fields with
  34617. // empty values are omitted from API requests. However, any field with
  34618. // an empty value appearing in NullFields will be sent to the server as
  34619. // null. It is an error if a field in this list has a non-empty value.
  34620. // This may be used to include null fields in Patch requests.
  34621. NullFields []string `json:"-"`
  34622. }
  34623. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  34624. type NoMethod TestPermissionsRequest
  34625. raw := NoMethod(*s)
  34626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34627. }
  34628. type TestPermissionsResponse struct {
  34629. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  34630. // the caller is allowed.
  34631. Permissions []string `json:"permissions,omitempty"`
  34632. // ServerResponse contains the HTTP response code and headers from the
  34633. // server.
  34634. googleapi.ServerResponse `json:"-"`
  34635. // ForceSendFields is a list of field names (e.g. "Permissions") to
  34636. // unconditionally include in API requests. By default, fields with
  34637. // empty values are omitted from API requests. However, any non-pointer,
  34638. // non-interface field appearing in ForceSendFields will be sent to the
  34639. // server regardless of whether the field is empty or not. This may be
  34640. // used to include empty fields in Patch requests.
  34641. ForceSendFields []string `json:"-"`
  34642. // NullFields is a list of field names (e.g. "Permissions") to include
  34643. // in API requests with the JSON null value. By default, fields with
  34644. // empty values are omitted from API requests. However, any field with
  34645. // an empty value appearing in NullFields will be sent to the server as
  34646. // null. It is an error if a field in this list has a non-empty value.
  34647. // This may be used to include null fields in Patch requests.
  34648. NullFields []string `json:"-"`
  34649. }
  34650. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  34651. type NoMethod TestPermissionsResponse
  34652. raw := NoMethod(*s)
  34653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34654. }
  34655. // TlsCertificateContext: Defines the mechanism to obtain the client or
  34656. // server certificate.
  34657. type TlsCertificateContext struct {
  34658. // CertificatePaths: Specifies the certificate and private key paths.
  34659. // This field is applicable only if tlsCertificateSource is set to
  34660. // USE_PATH.
  34661. CertificatePaths *TlsCertificatePaths `json:"certificatePaths,omitempty"`
  34662. // CertificateSource: Defines how TLS certificates are obtained.
  34663. //
  34664. // Possible values:
  34665. // "INVALID"
  34666. // "USE_PATH"
  34667. // "USE_SDS"
  34668. CertificateSource string `json:"certificateSource,omitempty"`
  34669. // SdsConfig: Specifies the config to retrieve certificates through SDS.
  34670. // This field is applicable only if tlsCertificateSource is set to
  34671. // USE_SDS.
  34672. SdsConfig *SdsConfig `json:"sdsConfig,omitempty"`
  34673. // ForceSendFields is a list of field names (e.g. "CertificatePaths") to
  34674. // unconditionally include in API requests. By default, fields with
  34675. // empty values are omitted from API requests. However, any non-pointer,
  34676. // non-interface field appearing in ForceSendFields will be sent to the
  34677. // server regardless of whether the field is empty or not. This may be
  34678. // used to include empty fields in Patch requests.
  34679. ForceSendFields []string `json:"-"`
  34680. // NullFields is a list of field names (e.g. "CertificatePaths") to
  34681. // include in API requests with the JSON null value. By default, fields
  34682. // with empty values are omitted from API requests. However, any field
  34683. // with an empty value appearing in NullFields will be sent to the
  34684. // server as null. It is an error if a field in this list has a
  34685. // non-empty value. This may be used to include null fields in Patch
  34686. // requests.
  34687. NullFields []string `json:"-"`
  34688. }
  34689. func (s *TlsCertificateContext) MarshalJSON() ([]byte, error) {
  34690. type NoMethod TlsCertificateContext
  34691. raw := NoMethod(*s)
  34692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34693. }
  34694. // TlsCertificatePaths: The paths to the mounted TLS Certificates and
  34695. // private key.
  34696. type TlsCertificatePaths struct {
  34697. // CertificatePath: The path to the file holding the client or server
  34698. // TLS certificate to use.
  34699. CertificatePath string `json:"certificatePath,omitempty"`
  34700. // PrivateKeyPath: The path to the file holding the client or server
  34701. // private key.
  34702. PrivateKeyPath string `json:"privateKeyPath,omitempty"`
  34703. // ForceSendFields is a list of field names (e.g. "CertificatePath") to
  34704. // unconditionally include in API requests. By default, fields with
  34705. // empty values are omitted from API requests. However, any non-pointer,
  34706. // non-interface field appearing in ForceSendFields will be sent to the
  34707. // server regardless of whether the field is empty or not. This may be
  34708. // used to include empty fields in Patch requests.
  34709. ForceSendFields []string `json:"-"`
  34710. // NullFields is a list of field names (e.g. "CertificatePath") to
  34711. // include in API requests with the JSON null value. By default, fields
  34712. // with empty values are omitted from API requests. However, any field
  34713. // with an empty value appearing in NullFields will be sent to the
  34714. // server as null. It is an error if a field in this list has a
  34715. // non-empty value. This may be used to include null fields in Patch
  34716. // requests.
  34717. NullFields []string `json:"-"`
  34718. }
  34719. func (s *TlsCertificatePaths) MarshalJSON() ([]byte, error) {
  34720. type NoMethod TlsCertificatePaths
  34721. raw := NoMethod(*s)
  34722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34723. }
  34724. // TlsContext: The TLS settings for the client or server.
  34725. type TlsContext struct {
  34726. // CertificateContext: Defines the mechanism to obtain the client or
  34727. // server certificate.
  34728. CertificateContext *TlsCertificateContext `json:"certificateContext,omitempty"`
  34729. // ValidationContext: Defines the mechanism to obtain the Certificate
  34730. // Authority certificate to validate the client/server certificate. If
  34731. // omitted, the proxy will not validate the server or client
  34732. // certificate.
  34733. ValidationContext *TlsValidationContext `json:"validationContext,omitempty"`
  34734. // ForceSendFields is a list of field names (e.g. "CertificateContext")
  34735. // to unconditionally include in API requests. By default, fields with
  34736. // empty values are omitted from API requests. However, any non-pointer,
  34737. // non-interface field appearing in ForceSendFields will be sent to the
  34738. // server regardless of whether the field is empty or not. This may be
  34739. // used to include empty fields in Patch requests.
  34740. ForceSendFields []string `json:"-"`
  34741. // NullFields is a list of field names (e.g. "CertificateContext") to
  34742. // include in API requests with the JSON null value. By default, fields
  34743. // with empty values are omitted from API requests. However, any field
  34744. // with an empty value appearing in NullFields will be sent to the
  34745. // server as null. It is an error if a field in this list has a
  34746. // non-empty value. This may be used to include null fields in Patch
  34747. // requests.
  34748. NullFields []string `json:"-"`
  34749. }
  34750. func (s *TlsContext) MarshalJSON() ([]byte, error) {
  34751. type NoMethod TlsContext
  34752. raw := NoMethod(*s)
  34753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34754. }
  34755. // TlsValidationContext: Defines the mechanism to obtain the Certificate
  34756. // Authority certificate to validate the client/server certificate.
  34757. type TlsValidationContext struct {
  34758. // CertificatePath: The path to the file holding the CA certificate to
  34759. // validate the client or server certificate.
  34760. CertificatePath string `json:"certificatePath,omitempty"`
  34761. // SdsConfig: Specifies the config to retrieve certificates through SDS.
  34762. // This field is applicable only if tlsCertificateSource is set to
  34763. // USE_SDS.
  34764. SdsConfig *SdsConfig `json:"sdsConfig,omitempty"`
  34765. // ValidationSource: Defines how TLS certificates are obtained.
  34766. //
  34767. // Possible values:
  34768. // "INVALID"
  34769. // "USE_PATH"
  34770. // "USE_SDS"
  34771. ValidationSource string `json:"validationSource,omitempty"`
  34772. // ForceSendFields is a list of field names (e.g. "CertificatePath") to
  34773. // unconditionally include in API requests. By default, fields with
  34774. // empty values are omitted from API requests. However, any non-pointer,
  34775. // non-interface field appearing in ForceSendFields will be sent to the
  34776. // server regardless of whether the field is empty or not. This may be
  34777. // used to include empty fields in Patch requests.
  34778. ForceSendFields []string `json:"-"`
  34779. // NullFields is a list of field names (e.g. "CertificatePath") to
  34780. // include in API requests with the JSON null value. By default, fields
  34781. // with empty values are omitted from API requests. However, any field
  34782. // with an empty value appearing in NullFields will be sent to the
  34783. // server as null. It is an error if a field in this list has a
  34784. // non-empty value. This may be used to include null fields in Patch
  34785. // requests.
  34786. NullFields []string `json:"-"`
  34787. }
  34788. func (s *TlsValidationContext) MarshalJSON() ([]byte, error) {
  34789. type NoMethod TlsValidationContext
  34790. raw := NoMethod(*s)
  34791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34792. }
  34793. type UDPHealthCheck struct {
  34794. // Port: The UDP port number for the health check request. Valid values
  34795. // are 1 through 65535.
  34796. Port int64 `json:"port,omitempty"`
  34797. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  34798. // both port and port_name are defined, port takes precedence.
  34799. PortName string `json:"portName,omitempty"`
  34800. // Request: Raw data of request to send in payload of UDP packet. It is
  34801. // an error if this is empty. The request data can only be ASCII.
  34802. Request string `json:"request,omitempty"`
  34803. // Response: The bytes to match against the beginning of the response
  34804. // data. It is an error if this is empty. The response data can only be
  34805. // ASCII.
  34806. Response string `json:"response,omitempty"`
  34807. // ForceSendFields is a list of field names (e.g. "Port") to
  34808. // unconditionally include in API requests. By default, fields with
  34809. // empty values are omitted from API requests. However, any non-pointer,
  34810. // non-interface field appearing in ForceSendFields will be sent to the
  34811. // server regardless of whether the field is empty or not. This may be
  34812. // used to include empty fields in Patch requests.
  34813. ForceSendFields []string `json:"-"`
  34814. // NullFields is a list of field names (e.g. "Port") to include in API
  34815. // requests with the JSON null value. By default, fields with empty
  34816. // values are omitted from API requests. However, any field with an
  34817. // empty value appearing in NullFields will be sent to the server as
  34818. // null. It is an error if a field in this list has a non-empty value.
  34819. // This may be used to include null fields in Patch requests.
  34820. NullFields []string `json:"-"`
  34821. }
  34822. func (s *UDPHealthCheck) MarshalJSON() ([]byte, error) {
  34823. type NoMethod UDPHealthCheck
  34824. raw := NoMethod(*s)
  34825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34826. }
  34827. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  34828. // to the BackendService resource, based on the "longest-match" of the
  34829. // URL's host and path.
  34830. type UrlMap struct {
  34831. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  34832. // format.
  34833. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  34834. // DefaultRouteAction: defaultRouteAction takes effect when none of the
  34835. // hostRules match. The load balancer performs advanced routing actions
  34836. // like URL rewrites, header transformations, etc. prior to forwarding
  34837. // the request to the selected backend. If defaultRouteAction specifies
  34838. // any weightedBackendServices, defaultService must not be set.
  34839. // Conversely if defaultService is set, defaultRouteAction cannot
  34840. // contain any weightedBackendServices.
  34841. // Only one of defaultRouteAction or defaultUrlRedirect must be set.
  34842. DefaultRouteAction *HttpRouteAction `json:"defaultRouteAction,omitempty"`
  34843. // DefaultService: The full or partial URL of the defaultService
  34844. // resource to which traffic is directed if none of the hostRules match.
  34845. // If defaultRouteAction is additionally specified, advanced routing
  34846. // actions like URL Rewrites, etc. take effect prior to sending the
  34847. // request to the backend. However, if defaultService is specified,
  34848. // defaultRouteAction cannot contain any weightedBackendServices.
  34849. // Conversely, if routeAction specifies any weightedBackendServices,
  34850. // service must not be specified.
  34851. // Only one of defaultService, defaultUrlRedirect or
  34852. // defaultRouteAction.weightedBackendService must be set.
  34853. DefaultService string `json:"defaultService,omitempty"`
  34854. // DefaultUrlRedirect: When none of the specified hostRules match, the
  34855. // request is redirected to a URL specified by defaultUrlRedirect.
  34856. // If defaultUrlRedirect is specified, defaultService or
  34857. // defaultRouteAction must not be set.
  34858. DefaultUrlRedirect *HttpRedirectAction `json:"defaultUrlRedirect,omitempty"`
  34859. // Description: An optional description of this resource. Provide this
  34860. // property when you create the resource.
  34861. Description string `json:"description,omitempty"`
  34862. // Fingerprint: Fingerprint of this resource. A hash of the contents
  34863. // stored in this object. This field is used in optimistic locking. This
  34864. // field will be ignored when inserting a UrlMap. An up-to-date
  34865. // fingerprint must be provided in order to update the UrlMap, otherwise
  34866. // the request will fail with error 412 conditionNotMet.
  34867. //
  34868. // To see the latest fingerprint, make a get() request to retrieve a
  34869. // UrlMap.
  34870. Fingerprint string `json:"fingerprint,omitempty"`
  34871. // HeaderAction: Specifies changes to request and response headers that
  34872. // need to take effect for the selected backendService.
  34873. // The headerAction specified here take effect after headerAction
  34874. // specified under pathMatcher.
  34875. HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
  34876. // HostRules: The list of HostRules to use against the URL.
  34877. HostRules []*HostRule `json:"hostRules,omitempty"`
  34878. // Id: [Output Only] The unique identifier for the resource. This
  34879. // identifier is defined by the server.
  34880. Id uint64 `json:"id,omitempty,string"`
  34881. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  34882. // url maps.
  34883. Kind string `json:"kind,omitempty"`
  34884. // Name: Name of the resource. Provided by the client when the resource
  34885. // is created. The name must be 1-63 characters long, and comply with
  34886. // RFC1035. Specifically, the name must be 1-63 characters long and
  34887. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  34888. // the first character must be a lowercase letter, and all following
  34889. // characters must be a dash, lowercase letter, or digit, except the
  34890. // last character, which cannot be a dash.
  34891. Name string `json:"name,omitempty"`
  34892. // PathMatchers: The list of named PathMatchers to use against the URL.
  34893. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  34894. // Region: [Output Only] URL of the region where the regional URL map
  34895. // resides. This field is not applicable to global URL maps. You must
  34896. // specify this field as part of the HTTP request URL. It is not
  34897. // settable as a field in the request body.
  34898. Region string `json:"region,omitempty"`
  34899. // SelfLink: [Output Only] Server-defined URL for the resource.
  34900. SelfLink string `json:"selfLink,omitempty"`
  34901. // Tests: The list of expected URL mapping tests. Request to update this
  34902. // UrlMap will succeed only if all of the test cases pass. You can
  34903. // specify a maximum of 100 tests per UrlMap.
  34904. Tests []*UrlMapTest `json:"tests,omitempty"`
  34905. // ServerResponse contains the HTTP response code and headers from the
  34906. // server.
  34907. googleapi.ServerResponse `json:"-"`
  34908. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  34909. // to unconditionally include in API requests. By default, fields with
  34910. // empty values are omitted from API requests. However, any non-pointer,
  34911. // non-interface field appearing in ForceSendFields will be sent to the
  34912. // server regardless of whether the field is empty or not. This may be
  34913. // used to include empty fields in Patch requests.
  34914. ForceSendFields []string `json:"-"`
  34915. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  34916. // include in API requests with the JSON null value. By default, fields
  34917. // with empty values are omitted from API requests. However, any field
  34918. // with an empty value appearing in NullFields will be sent to the
  34919. // server as null. It is an error if a field in this list has a
  34920. // non-empty value. This may be used to include null fields in Patch
  34921. // requests.
  34922. NullFields []string `json:"-"`
  34923. }
  34924. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  34925. type NoMethod UrlMap
  34926. raw := NoMethod(*s)
  34927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34928. }
  34929. // UrlMapList: Contains a list of UrlMap resources.
  34930. type UrlMapList struct {
  34931. // Id: [Output Only] Unique identifier for the resource; defined by the
  34932. // server.
  34933. Id string `json:"id,omitempty"`
  34934. // Items: A list of UrlMap resources.
  34935. Items []*UrlMap `json:"items,omitempty"`
  34936. // Kind: Type of resource.
  34937. Kind string `json:"kind,omitempty"`
  34938. // NextPageToken: [Output Only] This token allows you to get the next
  34939. // page of results for list requests. If the number of results is larger
  34940. // than maxResults, use the nextPageToken as a value for the query
  34941. // parameter pageToken in the next list request. Subsequent list
  34942. // requests will have their own nextPageToken to continue paging through
  34943. // the results.
  34944. NextPageToken string `json:"nextPageToken,omitempty"`
  34945. // SelfLink: [Output Only] Server-defined URL for this resource.
  34946. SelfLink string `json:"selfLink,omitempty"`
  34947. // Warning: [Output Only] Informational warning message.
  34948. Warning *UrlMapListWarning `json:"warning,omitempty"`
  34949. // ServerResponse contains the HTTP response code and headers from the
  34950. // server.
  34951. googleapi.ServerResponse `json:"-"`
  34952. // ForceSendFields is a list of field names (e.g. "Id") to
  34953. // unconditionally include in API requests. By default, fields with
  34954. // empty values are omitted from API requests. However, any non-pointer,
  34955. // non-interface field appearing in ForceSendFields will be sent to the
  34956. // server regardless of whether the field is empty or not. This may be
  34957. // used to include empty fields in Patch requests.
  34958. ForceSendFields []string `json:"-"`
  34959. // NullFields is a list of field names (e.g. "Id") to include in API
  34960. // requests with the JSON null value. By default, fields with empty
  34961. // values are omitted from API requests. However, any field with an
  34962. // empty value appearing in NullFields will be sent to the server as
  34963. // null. It is an error if a field in this list has a non-empty value.
  34964. // This may be used to include null fields in Patch requests.
  34965. NullFields []string `json:"-"`
  34966. }
  34967. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  34968. type NoMethod UrlMapList
  34969. raw := NoMethod(*s)
  34970. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  34971. }
  34972. // UrlMapListWarning: [Output Only] Informational warning message.
  34973. type UrlMapListWarning struct {
  34974. // Code: [Output Only] A warning code, if applicable. For example,
  34975. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  34976. // the response.
  34977. //
  34978. // Possible values:
  34979. // "CLEANUP_FAILED"
  34980. // "DEPRECATED_RESOURCE_USED"
  34981. // "DEPRECATED_TYPE_USED"
  34982. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  34983. // "EXPERIMENTAL_TYPE_USED"
  34984. // "EXTERNAL_API_WARNING"
  34985. // "FIELD_VALUE_OVERRIDEN"
  34986. // "INJECTED_KERNELS_DEPRECATED"
  34987. // "MISSING_TYPE_DEPENDENCY"
  34988. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  34989. // "NEXT_HOP_CANNOT_IP_FORWARD"
  34990. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  34991. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  34992. // "NEXT_HOP_NOT_RUNNING"
  34993. // "NOT_CRITICAL_ERROR"
  34994. // "NO_RESULTS_ON_PAGE"
  34995. // "REQUIRED_TOS_AGREEMENT"
  34996. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  34997. // "RESOURCE_NOT_DELETED"
  34998. // "SCHEMA_VALIDATION_IGNORED"
  34999. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35000. // "UNDECLARED_PROPERTIES"
  35001. // "UNREACHABLE"
  35002. Code string `json:"code,omitempty"`
  35003. // Data: [Output Only] Metadata about this warning in key: value format.
  35004. // For example:
  35005. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35006. Data []*UrlMapListWarningData `json:"data,omitempty"`
  35007. // Message: [Output Only] A human-readable description of the warning
  35008. // code.
  35009. Message string `json:"message,omitempty"`
  35010. // ForceSendFields is a list of field names (e.g. "Code") to
  35011. // unconditionally include in API requests. By default, fields with
  35012. // empty values are omitted from API requests. However, any non-pointer,
  35013. // non-interface field appearing in ForceSendFields will be sent to the
  35014. // server regardless of whether the field is empty or not. This may be
  35015. // used to include empty fields in Patch requests.
  35016. ForceSendFields []string `json:"-"`
  35017. // NullFields is a list of field names (e.g. "Code") to include in API
  35018. // requests with the JSON null value. By default, fields with empty
  35019. // values are omitted from API requests. However, any field with an
  35020. // empty value appearing in NullFields will be sent to the server as
  35021. // null. It is an error if a field in this list has a non-empty value.
  35022. // This may be used to include null fields in Patch requests.
  35023. NullFields []string `json:"-"`
  35024. }
  35025. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  35026. type NoMethod UrlMapListWarning
  35027. raw := NoMethod(*s)
  35028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35029. }
  35030. type UrlMapListWarningData struct {
  35031. // Key: [Output Only] A key that provides more detail on the warning
  35032. // being returned. For example, for warnings where there are no results
  35033. // in a list request for a particular zone, this key might be scope and
  35034. // the key value might be the zone name. Other examples might be a key
  35035. // indicating a deprecated resource and a suggested replacement, or a
  35036. // warning about invalid network settings (for example, if an instance
  35037. // attempts to perform IP forwarding but is not enabled for IP
  35038. // forwarding).
  35039. Key string `json:"key,omitempty"`
  35040. // Value: [Output Only] A warning data value corresponding to the key.
  35041. Value string `json:"value,omitempty"`
  35042. // ForceSendFields is a list of field names (e.g. "Key") to
  35043. // unconditionally include in API requests. By default, fields with
  35044. // empty values are omitted from API requests. However, any non-pointer,
  35045. // non-interface field appearing in ForceSendFields will be sent to the
  35046. // server regardless of whether the field is empty or not. This may be
  35047. // used to include empty fields in Patch requests.
  35048. ForceSendFields []string `json:"-"`
  35049. // NullFields is a list of field names (e.g. "Key") to include in API
  35050. // requests with the JSON null value. By default, fields with empty
  35051. // values are omitted from API requests. However, any field with an
  35052. // empty value appearing in NullFields will be sent to the server as
  35053. // null. It is an error if a field in this list has a non-empty value.
  35054. // This may be used to include null fields in Patch requests.
  35055. NullFields []string `json:"-"`
  35056. }
  35057. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  35058. type NoMethod UrlMapListWarningData
  35059. raw := NoMethod(*s)
  35060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35061. }
  35062. type UrlMapReference struct {
  35063. UrlMap string `json:"urlMap,omitempty"`
  35064. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  35065. // unconditionally include in API requests. By default, fields with
  35066. // empty values are omitted from API requests. However, any non-pointer,
  35067. // non-interface field appearing in ForceSendFields will be sent to the
  35068. // server regardless of whether the field is empty or not. This may be
  35069. // used to include empty fields in Patch requests.
  35070. ForceSendFields []string `json:"-"`
  35071. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  35072. // requests with the JSON null value. By default, fields with empty
  35073. // values are omitted from API requests. However, any field with an
  35074. // empty value appearing in NullFields will be sent to the server as
  35075. // null. It is an error if a field in this list has a non-empty value.
  35076. // This may be used to include null fields in Patch requests.
  35077. NullFields []string `json:"-"`
  35078. }
  35079. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  35080. type NoMethod UrlMapReference
  35081. raw := NoMethod(*s)
  35082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35083. }
  35084. // UrlMapTest: Message for the expected URL mappings.
  35085. type UrlMapTest struct {
  35086. // BackendServiceWeight: The weight to use for the supplied host and
  35087. // path when using advanced routing rules that involve traffic
  35088. // splitting.
  35089. BackendServiceWeight int64 `json:"backendServiceWeight,omitempty"`
  35090. // Description: Description of this test case.
  35091. Description string `json:"description,omitempty"`
  35092. // ExpectedUrlRedirect: The expected URL that should be redirected to
  35093. // for the host and path being tested.
  35094. ExpectedUrlRedirect string `json:"expectedUrlRedirect,omitempty"`
  35095. // Host: Host portion of the URL.
  35096. Host string `json:"host,omitempty"`
  35097. // Path: Path portion of the URL.
  35098. Path string `json:"path,omitempty"`
  35099. // Service: Expected BackendService resource the given URL should be
  35100. // mapped to.
  35101. Service string `json:"service,omitempty"`
  35102. // ForceSendFields is a list of field names (e.g.
  35103. // "BackendServiceWeight") to unconditionally include in API requests.
  35104. // By default, fields with empty values are omitted from API requests.
  35105. // However, any non-pointer, non-interface field appearing in
  35106. // ForceSendFields will be sent to the server regardless of whether the
  35107. // field is empty or not. This may be used to include empty fields in
  35108. // Patch requests.
  35109. ForceSendFields []string `json:"-"`
  35110. // NullFields is a list of field names (e.g. "BackendServiceWeight") to
  35111. // include in API requests with the JSON null value. By default, fields
  35112. // with empty values are omitted from API requests. However, any field
  35113. // with an empty value appearing in NullFields will be sent to the
  35114. // server as null. It is an error if a field in this list has a
  35115. // non-empty value. This may be used to include null fields in Patch
  35116. // requests.
  35117. NullFields []string `json:"-"`
  35118. }
  35119. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  35120. type NoMethod UrlMapTest
  35121. raw := NoMethod(*s)
  35122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35123. }
  35124. // UrlMapValidationResult: Message representing the validation result
  35125. // for a UrlMap.
  35126. type UrlMapValidationResult struct {
  35127. LoadErrors []string `json:"loadErrors,omitempty"`
  35128. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  35129. // If false, 'loadErrors' indicates the reasons.
  35130. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  35131. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  35132. // TestPassed: If successfully loaded, this field indicates whether the
  35133. // test passed. If false, 'testFailures's indicate the reason of
  35134. // failure.
  35135. TestPassed bool `json:"testPassed,omitempty"`
  35136. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  35137. // unconditionally include in API requests. By default, fields with
  35138. // empty values are omitted from API requests. However, any non-pointer,
  35139. // non-interface field appearing in ForceSendFields will be sent to the
  35140. // server regardless of whether the field is empty or not. This may be
  35141. // used to include empty fields in Patch requests.
  35142. ForceSendFields []string `json:"-"`
  35143. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  35144. // API requests with the JSON null value. By default, fields with empty
  35145. // values are omitted from API requests. However, any field with an
  35146. // empty value appearing in NullFields will be sent to the server as
  35147. // null. It is an error if a field in this list has a non-empty value.
  35148. // This may be used to include null fields in Patch requests.
  35149. NullFields []string `json:"-"`
  35150. }
  35151. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  35152. type NoMethod UrlMapValidationResult
  35153. raw := NoMethod(*s)
  35154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35155. }
  35156. type UrlMapsAggregatedList struct {
  35157. // Id: [Output Only] Unique identifier for the resource; defined by the
  35158. // server.
  35159. Id string `json:"id,omitempty"`
  35160. // Items: A list of UrlMapsScopedList resources.
  35161. Items map[string]UrlMapsScopedList `json:"items,omitempty"`
  35162. // Kind: Type of resource.
  35163. Kind string `json:"kind,omitempty"`
  35164. // NextPageToken: [Output Only] This token allows you to get the next
  35165. // page of results for list requests. If the number of results is larger
  35166. // than maxResults, use the nextPageToken as a value for the query
  35167. // parameter pageToken in the next list request. Subsequent list
  35168. // requests will have their own nextPageToken to continue paging through
  35169. // the results.
  35170. NextPageToken string `json:"nextPageToken,omitempty"`
  35171. // SelfLink: [Output Only] Server-defined URL for this resource.
  35172. SelfLink string `json:"selfLink,omitempty"`
  35173. // Warning: [Output Only] Informational warning message.
  35174. Warning *UrlMapsAggregatedListWarning `json:"warning,omitempty"`
  35175. // ServerResponse contains the HTTP response code and headers from the
  35176. // server.
  35177. googleapi.ServerResponse `json:"-"`
  35178. // ForceSendFields is a list of field names (e.g. "Id") to
  35179. // unconditionally include in API requests. By default, fields with
  35180. // empty values are omitted from API requests. However, any non-pointer,
  35181. // non-interface field appearing in ForceSendFields will be sent to the
  35182. // server regardless of whether the field is empty or not. This may be
  35183. // used to include empty fields in Patch requests.
  35184. ForceSendFields []string `json:"-"`
  35185. // NullFields is a list of field names (e.g. "Id") to include in API
  35186. // requests with the JSON null value. By default, fields with empty
  35187. // values are omitted from API requests. However, any field with an
  35188. // empty value appearing in NullFields will be sent to the server as
  35189. // null. It is an error if a field in this list has a non-empty value.
  35190. // This may be used to include null fields in Patch requests.
  35191. NullFields []string `json:"-"`
  35192. }
  35193. func (s *UrlMapsAggregatedList) MarshalJSON() ([]byte, error) {
  35194. type NoMethod UrlMapsAggregatedList
  35195. raw := NoMethod(*s)
  35196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35197. }
  35198. // UrlMapsAggregatedListWarning: [Output Only] Informational warning
  35199. // message.
  35200. type UrlMapsAggregatedListWarning struct {
  35201. // Code: [Output Only] A warning code, if applicable. For example,
  35202. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35203. // the response.
  35204. //
  35205. // Possible values:
  35206. // "CLEANUP_FAILED"
  35207. // "DEPRECATED_RESOURCE_USED"
  35208. // "DEPRECATED_TYPE_USED"
  35209. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35210. // "EXPERIMENTAL_TYPE_USED"
  35211. // "EXTERNAL_API_WARNING"
  35212. // "FIELD_VALUE_OVERRIDEN"
  35213. // "INJECTED_KERNELS_DEPRECATED"
  35214. // "MISSING_TYPE_DEPENDENCY"
  35215. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  35216. // "NEXT_HOP_CANNOT_IP_FORWARD"
  35217. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  35218. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  35219. // "NEXT_HOP_NOT_RUNNING"
  35220. // "NOT_CRITICAL_ERROR"
  35221. // "NO_RESULTS_ON_PAGE"
  35222. // "REQUIRED_TOS_AGREEMENT"
  35223. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  35224. // "RESOURCE_NOT_DELETED"
  35225. // "SCHEMA_VALIDATION_IGNORED"
  35226. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35227. // "UNDECLARED_PROPERTIES"
  35228. // "UNREACHABLE"
  35229. Code string `json:"code,omitempty"`
  35230. // Data: [Output Only] Metadata about this warning in key: value format.
  35231. // For example:
  35232. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35233. Data []*UrlMapsAggregatedListWarningData `json:"data,omitempty"`
  35234. // Message: [Output Only] A human-readable description of the warning
  35235. // code.
  35236. Message string `json:"message,omitempty"`
  35237. // ForceSendFields is a list of field names (e.g. "Code") to
  35238. // unconditionally include in API requests. By default, fields with
  35239. // empty values are omitted from API requests. However, any non-pointer,
  35240. // non-interface field appearing in ForceSendFields will be sent to the
  35241. // server regardless of whether the field is empty or not. This may be
  35242. // used to include empty fields in Patch requests.
  35243. ForceSendFields []string `json:"-"`
  35244. // NullFields is a list of field names (e.g. "Code") to include in API
  35245. // requests with the JSON null value. By default, fields with empty
  35246. // values are omitted from API requests. However, any field with an
  35247. // empty value appearing in NullFields will be sent to the server as
  35248. // null. It is an error if a field in this list has a non-empty value.
  35249. // This may be used to include null fields in Patch requests.
  35250. NullFields []string `json:"-"`
  35251. }
  35252. func (s *UrlMapsAggregatedListWarning) MarshalJSON() ([]byte, error) {
  35253. type NoMethod UrlMapsAggregatedListWarning
  35254. raw := NoMethod(*s)
  35255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35256. }
  35257. type UrlMapsAggregatedListWarningData struct {
  35258. // Key: [Output Only] A key that provides more detail on the warning
  35259. // being returned. For example, for warnings where there are no results
  35260. // in a list request for a particular zone, this key might be scope and
  35261. // the key value might be the zone name. Other examples might be a key
  35262. // indicating a deprecated resource and a suggested replacement, or a
  35263. // warning about invalid network settings (for example, if an instance
  35264. // attempts to perform IP forwarding but is not enabled for IP
  35265. // forwarding).
  35266. Key string `json:"key,omitempty"`
  35267. // Value: [Output Only] A warning data value corresponding to the key.
  35268. Value string `json:"value,omitempty"`
  35269. // ForceSendFields is a list of field names (e.g. "Key") to
  35270. // unconditionally include in API requests. By default, fields with
  35271. // empty values are omitted from API requests. However, any non-pointer,
  35272. // non-interface field appearing in ForceSendFields will be sent to the
  35273. // server regardless of whether the field is empty or not. This may be
  35274. // used to include empty fields in Patch requests.
  35275. ForceSendFields []string `json:"-"`
  35276. // NullFields is a list of field names (e.g. "Key") to include in API
  35277. // requests with the JSON null value. By default, fields with empty
  35278. // values are omitted from API requests. However, any field with an
  35279. // empty value appearing in NullFields will be sent to the server as
  35280. // null. It is an error if a field in this list has a non-empty value.
  35281. // This may be used to include null fields in Patch requests.
  35282. NullFields []string `json:"-"`
  35283. }
  35284. func (s *UrlMapsAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  35285. type NoMethod UrlMapsAggregatedListWarningData
  35286. raw := NoMethod(*s)
  35287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35288. }
  35289. type UrlMapsScopedList struct {
  35290. // UrlMaps: A list of UrlMaps contained in this scope.
  35291. UrlMaps []*UrlMap `json:"urlMaps,omitempty"`
  35292. // Warning: Informational warning which replaces the list of backend
  35293. // services when the list is empty.
  35294. Warning *UrlMapsScopedListWarning `json:"warning,omitempty"`
  35295. // ForceSendFields is a list of field names (e.g. "UrlMaps") to
  35296. // unconditionally include in API requests. By default, fields with
  35297. // empty values are omitted from API requests. However, any non-pointer,
  35298. // non-interface field appearing in ForceSendFields will be sent to the
  35299. // server regardless of whether the field is empty or not. This may be
  35300. // used to include empty fields in Patch requests.
  35301. ForceSendFields []string `json:"-"`
  35302. // NullFields is a list of field names (e.g. "UrlMaps") to include in
  35303. // API requests with the JSON null value. By default, fields with empty
  35304. // values are omitted from API requests. However, any field with an
  35305. // empty value appearing in NullFields will be sent to the server as
  35306. // null. It is an error if a field in this list has a non-empty value.
  35307. // This may be used to include null fields in Patch requests.
  35308. NullFields []string `json:"-"`
  35309. }
  35310. func (s *UrlMapsScopedList) MarshalJSON() ([]byte, error) {
  35311. type NoMethod UrlMapsScopedList
  35312. raw := NoMethod(*s)
  35313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35314. }
  35315. // UrlMapsScopedListWarning: Informational warning which replaces the
  35316. // list of backend services when the list is empty.
  35317. type UrlMapsScopedListWarning struct {
  35318. // Code: [Output Only] A warning code, if applicable. For example,
  35319. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35320. // the response.
  35321. //
  35322. // Possible values:
  35323. // "CLEANUP_FAILED"
  35324. // "DEPRECATED_RESOURCE_USED"
  35325. // "DEPRECATED_TYPE_USED"
  35326. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35327. // "EXPERIMENTAL_TYPE_USED"
  35328. // "EXTERNAL_API_WARNING"
  35329. // "FIELD_VALUE_OVERRIDEN"
  35330. // "INJECTED_KERNELS_DEPRECATED"
  35331. // "MISSING_TYPE_DEPENDENCY"
  35332. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  35333. // "NEXT_HOP_CANNOT_IP_FORWARD"
  35334. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  35335. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  35336. // "NEXT_HOP_NOT_RUNNING"
  35337. // "NOT_CRITICAL_ERROR"
  35338. // "NO_RESULTS_ON_PAGE"
  35339. // "REQUIRED_TOS_AGREEMENT"
  35340. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  35341. // "RESOURCE_NOT_DELETED"
  35342. // "SCHEMA_VALIDATION_IGNORED"
  35343. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35344. // "UNDECLARED_PROPERTIES"
  35345. // "UNREACHABLE"
  35346. Code string `json:"code,omitempty"`
  35347. // Data: [Output Only] Metadata about this warning in key: value format.
  35348. // For example:
  35349. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35350. Data []*UrlMapsScopedListWarningData `json:"data,omitempty"`
  35351. // Message: [Output Only] A human-readable description of the warning
  35352. // code.
  35353. Message string `json:"message,omitempty"`
  35354. // ForceSendFields is a list of field names (e.g. "Code") to
  35355. // unconditionally include in API requests. By default, fields with
  35356. // empty values are omitted from API requests. However, any non-pointer,
  35357. // non-interface field appearing in ForceSendFields will be sent to the
  35358. // server regardless of whether the field is empty or not. This may be
  35359. // used to include empty fields in Patch requests.
  35360. ForceSendFields []string `json:"-"`
  35361. // NullFields is a list of field names (e.g. "Code") to include in API
  35362. // requests with the JSON null value. By default, fields with empty
  35363. // values are omitted from API requests. However, any field with an
  35364. // empty value appearing in NullFields will be sent to the server as
  35365. // null. It is an error if a field in this list has a non-empty value.
  35366. // This may be used to include null fields in Patch requests.
  35367. NullFields []string `json:"-"`
  35368. }
  35369. func (s *UrlMapsScopedListWarning) MarshalJSON() ([]byte, error) {
  35370. type NoMethod UrlMapsScopedListWarning
  35371. raw := NoMethod(*s)
  35372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35373. }
  35374. type UrlMapsScopedListWarningData struct {
  35375. // Key: [Output Only] A key that provides more detail on the warning
  35376. // being returned. For example, for warnings where there are no results
  35377. // in a list request for a particular zone, this key might be scope and
  35378. // the key value might be the zone name. Other examples might be a key
  35379. // indicating a deprecated resource and a suggested replacement, or a
  35380. // warning about invalid network settings (for example, if an instance
  35381. // attempts to perform IP forwarding but is not enabled for IP
  35382. // forwarding).
  35383. Key string `json:"key,omitempty"`
  35384. // Value: [Output Only] A warning data value corresponding to the key.
  35385. Value string `json:"value,omitempty"`
  35386. // ForceSendFields is a list of field names (e.g. "Key") to
  35387. // unconditionally include in API requests. By default, fields with
  35388. // empty values are omitted from API requests. However, any non-pointer,
  35389. // non-interface field appearing in ForceSendFields will be sent to the
  35390. // server regardless of whether the field is empty or not. This may be
  35391. // used to include empty fields in Patch requests.
  35392. ForceSendFields []string `json:"-"`
  35393. // NullFields is a list of field names (e.g. "Key") to include in API
  35394. // requests with the JSON null value. By default, fields with empty
  35395. // values are omitted from API requests. However, any field with an
  35396. // empty value appearing in NullFields will be sent to the server as
  35397. // null. It is an error if a field in this list has a non-empty value.
  35398. // This may be used to include null fields in Patch requests.
  35399. NullFields []string `json:"-"`
  35400. }
  35401. func (s *UrlMapsScopedListWarningData) MarshalJSON() ([]byte, error) {
  35402. type NoMethod UrlMapsScopedListWarningData
  35403. raw := NoMethod(*s)
  35404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35405. }
  35406. type UrlMapsValidateRequest struct {
  35407. // Resource: Content of the UrlMap to be validated.
  35408. Resource *UrlMap `json:"resource,omitempty"`
  35409. // ForceSendFields is a list of field names (e.g. "Resource") to
  35410. // unconditionally include in API requests. By default, fields with
  35411. // empty values are omitted from API requests. However, any non-pointer,
  35412. // non-interface field appearing in ForceSendFields will be sent to the
  35413. // server regardless of whether the field is empty or not. This may be
  35414. // used to include empty fields in Patch requests.
  35415. ForceSendFields []string `json:"-"`
  35416. // NullFields is a list of field names (e.g. "Resource") to include in
  35417. // API requests with the JSON null value. By default, fields with empty
  35418. // values are omitted from API requests. However, any field with an
  35419. // empty value appearing in NullFields will be sent to the server as
  35420. // null. It is an error if a field in this list has a non-empty value.
  35421. // This may be used to include null fields in Patch requests.
  35422. NullFields []string `json:"-"`
  35423. }
  35424. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  35425. type NoMethod UrlMapsValidateRequest
  35426. raw := NoMethod(*s)
  35427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35428. }
  35429. type UrlMapsValidateResponse struct {
  35430. Result *UrlMapValidationResult `json:"result,omitempty"`
  35431. // ServerResponse contains the HTTP response code and headers from the
  35432. // server.
  35433. googleapi.ServerResponse `json:"-"`
  35434. // ForceSendFields is a list of field names (e.g. "Result") to
  35435. // unconditionally include in API requests. By default, fields with
  35436. // empty values are omitted from API requests. However, any non-pointer,
  35437. // non-interface field appearing in ForceSendFields will be sent to the
  35438. // server regardless of whether the field is empty or not. This may be
  35439. // used to include empty fields in Patch requests.
  35440. ForceSendFields []string `json:"-"`
  35441. // NullFields is a list of field names (e.g. "Result") to include in API
  35442. // requests with the JSON null value. By default, fields with empty
  35443. // values are omitted from API requests. However, any field with an
  35444. // empty value appearing in NullFields will be sent to the server as
  35445. // null. It is an error if a field in this list has a non-empty value.
  35446. // This may be used to include null fields in Patch requests.
  35447. NullFields []string `json:"-"`
  35448. }
  35449. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  35450. type NoMethod UrlMapsValidateResponse
  35451. raw := NoMethod(*s)
  35452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35453. }
  35454. // UrlRewrite: The spec for modifying the path before sending the
  35455. // request to the matched backend service.
  35456. type UrlRewrite struct {
  35457. // HostRewrite: Prior to forwarding the request to the selected service,
  35458. // the request's host header is replaced with contents of
  35459. // hostRewrite.
  35460. // The value must be between 1 and 255 characters.
  35461. HostRewrite string `json:"hostRewrite,omitempty"`
  35462. // PathPrefixRewrite: Prior to forwarding the request to the selected
  35463. // backend service, the matching portion of the request's path is
  35464. // replaced by pathPrefixRewrite.
  35465. // The value must be between 1 and 1024 characters.
  35466. PathPrefixRewrite string `json:"pathPrefixRewrite,omitempty"`
  35467. // ForceSendFields is a list of field names (e.g. "HostRewrite") to
  35468. // unconditionally include in API requests. By default, fields with
  35469. // empty values are omitted from API requests. However, any non-pointer,
  35470. // non-interface field appearing in ForceSendFields will be sent to the
  35471. // server regardless of whether the field is empty or not. This may be
  35472. // used to include empty fields in Patch requests.
  35473. ForceSendFields []string `json:"-"`
  35474. // NullFields is a list of field names (e.g. "HostRewrite") to include
  35475. // in API requests with the JSON null value. By default, fields with
  35476. // empty values are omitted from API requests. However, any field with
  35477. // an empty value appearing in NullFields will be sent to the server as
  35478. // null. It is an error if a field in this list has a non-empty value.
  35479. // This may be used to include null fields in Patch requests.
  35480. NullFields []string `json:"-"`
  35481. }
  35482. func (s *UrlRewrite) MarshalJSON() ([]byte, error) {
  35483. type NoMethod UrlRewrite
  35484. raw := NoMethod(*s)
  35485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35486. }
  35487. // UsableSubnetwork: Subnetwork which the current user has
  35488. // compute.subnetworks.use permission on.
  35489. type UsableSubnetwork struct {
  35490. // IpCidrRange: The range of internal addresses that are owned by this
  35491. // subnetwork.
  35492. IpCidrRange string `json:"ipCidrRange,omitempty"`
  35493. // Network: Network URL.
  35494. Network string `json:"network,omitempty"`
  35495. // SecondaryIpRanges: Secondary IP ranges.
  35496. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  35497. // Subnetwork: Subnetwork URL.
  35498. Subnetwork string `json:"subnetwork,omitempty"`
  35499. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  35500. // unconditionally include in API requests. By default, fields with
  35501. // empty values are omitted from API requests. However, any non-pointer,
  35502. // non-interface field appearing in ForceSendFields will be sent to the
  35503. // server regardless of whether the field is empty or not. This may be
  35504. // used to include empty fields in Patch requests.
  35505. ForceSendFields []string `json:"-"`
  35506. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  35507. // in API requests with the JSON null value. By default, fields with
  35508. // empty values are omitted from API requests. However, any field with
  35509. // an empty value appearing in NullFields will be sent to the server as
  35510. // null. It is an error if a field in this list has a non-empty value.
  35511. // This may be used to include null fields in Patch requests.
  35512. NullFields []string `json:"-"`
  35513. }
  35514. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  35515. type NoMethod UsableSubnetwork
  35516. raw := NoMethod(*s)
  35517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35518. }
  35519. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  35520. // subnetwork.
  35521. type UsableSubnetworkSecondaryRange struct {
  35522. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  35523. // secondary range.
  35524. IpCidrRange string `json:"ipCidrRange,omitempty"`
  35525. // RangeName: The name associated with this subnetwork secondary range,
  35526. // used when adding an alias IP range to a VM instance. The name must be
  35527. // 1-63 characters long, and comply with RFC1035. The name must be
  35528. // unique within the subnetwork.
  35529. RangeName string `json:"rangeName,omitempty"`
  35530. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  35531. // unconditionally include in API requests. By default, fields with
  35532. // empty values are omitted from API requests. However, any non-pointer,
  35533. // non-interface field appearing in ForceSendFields will be sent to the
  35534. // server regardless of whether the field is empty or not. This may be
  35535. // used to include empty fields in Patch requests.
  35536. ForceSendFields []string `json:"-"`
  35537. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  35538. // in API requests with the JSON null value. By default, fields with
  35539. // empty values are omitted from API requests. However, any field with
  35540. // an empty value appearing in NullFields will be sent to the server as
  35541. // null. It is an error if a field in this list has a non-empty value.
  35542. // This may be used to include null fields in Patch requests.
  35543. NullFields []string `json:"-"`
  35544. }
  35545. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  35546. type NoMethod UsableSubnetworkSecondaryRange
  35547. raw := NoMethod(*s)
  35548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35549. }
  35550. type UsableSubnetworksAggregatedList struct {
  35551. // Id: [Output Only] The unique identifier for the resource. This
  35552. // identifier is defined by the server.
  35553. Id string `json:"id,omitempty"`
  35554. // Items: [Output] A list of usable subnetwork URLs.
  35555. Items []*UsableSubnetwork `json:"items,omitempty"`
  35556. // Kind: [Output Only] Type of resource. Always
  35557. // compute#usableSubnetworksAggregatedList for aggregated lists of
  35558. // usable subnetworks.
  35559. Kind string `json:"kind,omitempty"`
  35560. // NextPageToken: [Output Only] This token allows you to get the next
  35561. // page of results for list requests. If the number of results is larger
  35562. // than maxResults, use the nextPageToken as a value for the query
  35563. // parameter pageToken in the next list request. Subsequent list
  35564. // requests will have their own nextPageToken to continue paging through
  35565. // the results.
  35566. NextPageToken string `json:"nextPageToken,omitempty"`
  35567. // SelfLink: [Output Only] Server-defined URL for this resource.
  35568. SelfLink string `json:"selfLink,omitempty"`
  35569. // Warning: [Output Only] Informational warning message.
  35570. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  35571. // ServerResponse contains the HTTP response code and headers from the
  35572. // server.
  35573. googleapi.ServerResponse `json:"-"`
  35574. // ForceSendFields is a list of field names (e.g. "Id") to
  35575. // unconditionally include in API requests. By default, fields with
  35576. // empty values are omitted from API requests. However, any non-pointer,
  35577. // non-interface field appearing in ForceSendFields will be sent to the
  35578. // server regardless of whether the field is empty or not. This may be
  35579. // used to include empty fields in Patch requests.
  35580. ForceSendFields []string `json:"-"`
  35581. // NullFields is a list of field names (e.g. "Id") to include in API
  35582. // requests with the JSON null value. By default, fields with empty
  35583. // values are omitted from API requests. However, any field with an
  35584. // empty value appearing in NullFields will be sent to the server as
  35585. // null. It is an error if a field in this list has a non-empty value.
  35586. // This may be used to include null fields in Patch requests.
  35587. NullFields []string `json:"-"`
  35588. }
  35589. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  35590. type NoMethod UsableSubnetworksAggregatedList
  35591. raw := NoMethod(*s)
  35592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35593. }
  35594. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  35595. // warning message.
  35596. type UsableSubnetworksAggregatedListWarning struct {
  35597. // Code: [Output Only] A warning code, if applicable. For example,
  35598. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35599. // the response.
  35600. //
  35601. // Possible values:
  35602. // "CLEANUP_FAILED"
  35603. // "DEPRECATED_RESOURCE_USED"
  35604. // "DEPRECATED_TYPE_USED"
  35605. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35606. // "EXPERIMENTAL_TYPE_USED"
  35607. // "EXTERNAL_API_WARNING"
  35608. // "FIELD_VALUE_OVERRIDEN"
  35609. // "INJECTED_KERNELS_DEPRECATED"
  35610. // "MISSING_TYPE_DEPENDENCY"
  35611. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  35612. // "NEXT_HOP_CANNOT_IP_FORWARD"
  35613. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  35614. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  35615. // "NEXT_HOP_NOT_RUNNING"
  35616. // "NOT_CRITICAL_ERROR"
  35617. // "NO_RESULTS_ON_PAGE"
  35618. // "REQUIRED_TOS_AGREEMENT"
  35619. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  35620. // "RESOURCE_NOT_DELETED"
  35621. // "SCHEMA_VALIDATION_IGNORED"
  35622. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35623. // "UNDECLARED_PROPERTIES"
  35624. // "UNREACHABLE"
  35625. Code string `json:"code,omitempty"`
  35626. // Data: [Output Only] Metadata about this warning in key: value format.
  35627. // For example:
  35628. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35629. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  35630. // Message: [Output Only] A human-readable description of the warning
  35631. // code.
  35632. Message string `json:"message,omitempty"`
  35633. // ForceSendFields is a list of field names (e.g. "Code") to
  35634. // unconditionally include in API requests. By default, fields with
  35635. // empty values are omitted from API requests. However, any non-pointer,
  35636. // non-interface field appearing in ForceSendFields will be sent to the
  35637. // server regardless of whether the field is empty or not. This may be
  35638. // used to include empty fields in Patch requests.
  35639. ForceSendFields []string `json:"-"`
  35640. // NullFields is a list of field names (e.g. "Code") to include in API
  35641. // requests with the JSON null value. By default, fields with empty
  35642. // values are omitted from API requests. However, any field with an
  35643. // empty value appearing in NullFields will be sent to the server as
  35644. // null. It is an error if a field in this list has a non-empty value.
  35645. // This may be used to include null fields in Patch requests.
  35646. NullFields []string `json:"-"`
  35647. }
  35648. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  35649. type NoMethod UsableSubnetworksAggregatedListWarning
  35650. raw := NoMethod(*s)
  35651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35652. }
  35653. type UsableSubnetworksAggregatedListWarningData struct {
  35654. // Key: [Output Only] A key that provides more detail on the warning
  35655. // being returned. For example, for warnings where there are no results
  35656. // in a list request for a particular zone, this key might be scope and
  35657. // the key value might be the zone name. Other examples might be a key
  35658. // indicating a deprecated resource and a suggested replacement, or a
  35659. // warning about invalid network settings (for example, if an instance
  35660. // attempts to perform IP forwarding but is not enabled for IP
  35661. // forwarding).
  35662. Key string `json:"key,omitempty"`
  35663. // Value: [Output Only] A warning data value corresponding to the key.
  35664. Value string `json:"value,omitempty"`
  35665. // ForceSendFields is a list of field names (e.g. "Key") to
  35666. // unconditionally include in API requests. By default, fields with
  35667. // empty values are omitted from API requests. However, any non-pointer,
  35668. // non-interface field appearing in ForceSendFields will be sent to the
  35669. // server regardless of whether the field is empty or not. This may be
  35670. // used to include empty fields in Patch requests.
  35671. ForceSendFields []string `json:"-"`
  35672. // NullFields is a list of field names (e.g. "Key") to include in API
  35673. // requests with the JSON null value. By default, fields with empty
  35674. // values are omitted from API requests. However, any field with an
  35675. // empty value appearing in NullFields will be sent to the server as
  35676. // null. It is an error if a field in this list has a non-empty value.
  35677. // This may be used to include null fields in Patch requests.
  35678. NullFields []string `json:"-"`
  35679. }
  35680. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  35681. type NoMethod UsableSubnetworksAggregatedListWarningData
  35682. raw := NoMethod(*s)
  35683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35684. }
  35685. // UsageExportLocation: The location in Cloud Storage and naming method
  35686. // of the daily usage report. Contains bucket_name and report_name
  35687. // prefix.
  35688. type UsageExportLocation struct {
  35689. // BucketName: The name of an existing bucket in Cloud Storage where the
  35690. // usage report object is stored. The Google Service Account is granted
  35691. // write access to this bucket. This can either be the bucket name by
  35692. // itself, such as example-bucket, or the bucket name with gs:// or
  35693. // https://storage.googleapis.com/ in front of it, such as
  35694. // gs://example-bucket.
  35695. BucketName string `json:"bucketName,omitempty"`
  35696. // ReportNamePrefix: An optional prefix for the name of the usage report
  35697. // object stored in bucketName. If not supplied, defaults to usage. The
  35698. // report is stored as a CSV file named
  35699. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  35700. // usage according to Pacific Time. If you supply a prefix, it should
  35701. // conform to Cloud Storage object naming conventions.
  35702. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  35703. // ForceSendFields is a list of field names (e.g. "BucketName") to
  35704. // unconditionally include in API requests. By default, fields with
  35705. // empty values are omitted from API requests. However, any non-pointer,
  35706. // non-interface field appearing in ForceSendFields will be sent to the
  35707. // server regardless of whether the field is empty or not. This may be
  35708. // used to include empty fields in Patch requests.
  35709. ForceSendFields []string `json:"-"`
  35710. // NullFields is a list of field names (e.g. "BucketName") to include in
  35711. // API requests with the JSON null value. By default, fields with empty
  35712. // values are omitted from API requests. However, any field with an
  35713. // empty value appearing in NullFields will be sent to the server as
  35714. // null. It is an error if a field in this list has a non-empty value.
  35715. // This may be used to include null fields in Patch requests.
  35716. NullFields []string `json:"-"`
  35717. }
  35718. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  35719. type NoMethod UsageExportLocation
  35720. raw := NoMethod(*s)
  35721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35722. }
  35723. // VmEndpointNatMappings: Contain information of Nat mapping for a VM
  35724. // endpoint (i.e., NIC).
  35725. type VmEndpointNatMappings struct {
  35726. // InstanceName: Name of the VM instance which the endpoint belongs to
  35727. InstanceName string `json:"instanceName,omitempty"`
  35728. InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
  35729. // ForceSendFields is a list of field names (e.g. "InstanceName") to
  35730. // unconditionally include in API requests. By default, fields with
  35731. // empty values are omitted from API requests. However, any non-pointer,
  35732. // non-interface field appearing in ForceSendFields will be sent to the
  35733. // server regardless of whether the field is empty or not. This may be
  35734. // used to include empty fields in Patch requests.
  35735. ForceSendFields []string `json:"-"`
  35736. // NullFields is a list of field names (e.g. "InstanceName") to include
  35737. // in API requests with the JSON null value. By default, fields with
  35738. // empty values are omitted from API requests. However, any field with
  35739. // an empty value appearing in NullFields will be sent to the server as
  35740. // null. It is an error if a field in this list has a non-empty value.
  35741. // This may be used to include null fields in Patch requests.
  35742. NullFields []string `json:"-"`
  35743. }
  35744. func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
  35745. type NoMethod VmEndpointNatMappings
  35746. raw := NoMethod(*s)
  35747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35748. }
  35749. // VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
  35750. // mapping for an interface of this endpoint.
  35751. type VmEndpointNatMappingsInterfaceNatMappings struct {
  35752. // NatIpPortRanges: A list of all IP:port-range mappings assigned to
  35753. // this interface. These ranges are inclusive, that is, both the first
  35754. // and the last ports can be used for NAT. Example:
  35755. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  35756. NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
  35757. // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
  35758. // to this interface. It equals to the aggregated port number in the
  35759. // field nat_ip_port_ranges.
  35760. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
  35761. // SourceAliasIpRange: Alias IP range for this interface endpoint. It
  35762. // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
  35763. // "192.168.5.0/24".
  35764. SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
  35765. // SourceVirtualIp: Primary IP of the VM for this NIC.
  35766. SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
  35767. // ForceSendFields is a list of field names (e.g. "NatIpPortRanges") to
  35768. // unconditionally include in API requests. By default, fields with
  35769. // empty values are omitted from API requests. However, any non-pointer,
  35770. // non-interface field appearing in ForceSendFields will be sent to the
  35771. // server regardless of whether the field is empty or not. This may be
  35772. // used to include empty fields in Patch requests.
  35773. ForceSendFields []string `json:"-"`
  35774. // NullFields is a list of field names (e.g. "NatIpPortRanges") to
  35775. // include in API requests with the JSON null value. By default, fields
  35776. // with empty values are omitted from API requests. However, any field
  35777. // with an empty value appearing in NullFields will be sent to the
  35778. // server as null. It is an error if a field in this list has a
  35779. // non-empty value. This may be used to include null fields in Patch
  35780. // requests.
  35781. NullFields []string `json:"-"`
  35782. }
  35783. func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
  35784. type NoMethod VmEndpointNatMappingsInterfaceNatMappings
  35785. raw := NoMethod(*s)
  35786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35787. }
  35788. // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
  35789. type VmEndpointNatMappingsList struct {
  35790. // Id: [Output Only] The unique identifier for the resource. This
  35791. // identifier is defined by the server.
  35792. Id string `json:"id,omitempty"`
  35793. // Kind: [Output Only] Type of resource. Always
  35794. // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
  35795. // endpoints.
  35796. Kind string `json:"kind,omitempty"`
  35797. // NextPageToken: [Output Only] This token allows you to get the next
  35798. // page of results for list requests. If the number of results is larger
  35799. // than maxResults, use the nextPageToken as a value for the query
  35800. // parameter pageToken in the next list request. Subsequent list
  35801. // requests will have their own nextPageToken to continue paging through
  35802. // the results.
  35803. NextPageToken string `json:"nextPageToken,omitempty"`
  35804. // Result: [Output Only] A list of Nat mapping information of VM
  35805. // endpoints.
  35806. Result []*VmEndpointNatMappings `json:"result,omitempty"`
  35807. // SelfLink: [Output Only] Server-defined URL for this resource.
  35808. SelfLink string `json:"selfLink,omitempty"`
  35809. // Warning: [Output Only] Informational warning message.
  35810. Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
  35811. // ServerResponse contains the HTTP response code and headers from the
  35812. // server.
  35813. googleapi.ServerResponse `json:"-"`
  35814. // ForceSendFields is a list of field names (e.g. "Id") to
  35815. // unconditionally include in API requests. By default, fields with
  35816. // empty values are omitted from API requests. However, any non-pointer,
  35817. // non-interface field appearing in ForceSendFields will be sent to the
  35818. // server regardless of whether the field is empty or not. This may be
  35819. // used to include empty fields in Patch requests.
  35820. ForceSendFields []string `json:"-"`
  35821. // NullFields is a list of field names (e.g. "Id") to include in API
  35822. // requests with the JSON null value. By default, fields with empty
  35823. // values are omitted from API requests. However, any field with an
  35824. // empty value appearing in NullFields will be sent to the server as
  35825. // null. It is an error if a field in this list has a non-empty value.
  35826. // This may be used to include null fields in Patch requests.
  35827. NullFields []string `json:"-"`
  35828. }
  35829. func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
  35830. type NoMethod VmEndpointNatMappingsList
  35831. raw := NoMethod(*s)
  35832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35833. }
  35834. // VmEndpointNatMappingsListWarning: [Output Only] Informational warning
  35835. // message.
  35836. type VmEndpointNatMappingsListWarning struct {
  35837. // Code: [Output Only] A warning code, if applicable. For example,
  35838. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  35839. // the response.
  35840. //
  35841. // Possible values:
  35842. // "CLEANUP_FAILED"
  35843. // "DEPRECATED_RESOURCE_USED"
  35844. // "DEPRECATED_TYPE_USED"
  35845. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  35846. // "EXPERIMENTAL_TYPE_USED"
  35847. // "EXTERNAL_API_WARNING"
  35848. // "FIELD_VALUE_OVERRIDEN"
  35849. // "INJECTED_KERNELS_DEPRECATED"
  35850. // "MISSING_TYPE_DEPENDENCY"
  35851. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  35852. // "NEXT_HOP_CANNOT_IP_FORWARD"
  35853. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  35854. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  35855. // "NEXT_HOP_NOT_RUNNING"
  35856. // "NOT_CRITICAL_ERROR"
  35857. // "NO_RESULTS_ON_PAGE"
  35858. // "REQUIRED_TOS_AGREEMENT"
  35859. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  35860. // "RESOURCE_NOT_DELETED"
  35861. // "SCHEMA_VALIDATION_IGNORED"
  35862. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  35863. // "UNDECLARED_PROPERTIES"
  35864. // "UNREACHABLE"
  35865. Code string `json:"code,omitempty"`
  35866. // Data: [Output Only] Metadata about this warning in key: value format.
  35867. // For example:
  35868. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  35869. Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
  35870. // Message: [Output Only] A human-readable description of the warning
  35871. // code.
  35872. Message string `json:"message,omitempty"`
  35873. // ForceSendFields is a list of field names (e.g. "Code") to
  35874. // unconditionally include in API requests. By default, fields with
  35875. // empty values are omitted from API requests. However, any non-pointer,
  35876. // non-interface field appearing in ForceSendFields will be sent to the
  35877. // server regardless of whether the field is empty or not. This may be
  35878. // used to include empty fields in Patch requests.
  35879. ForceSendFields []string `json:"-"`
  35880. // NullFields is a list of field names (e.g. "Code") to include in API
  35881. // requests with the JSON null value. By default, fields with empty
  35882. // values are omitted from API requests. However, any field with an
  35883. // empty value appearing in NullFields will be sent to the server as
  35884. // null. It is an error if a field in this list has a non-empty value.
  35885. // This may be used to include null fields in Patch requests.
  35886. NullFields []string `json:"-"`
  35887. }
  35888. func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
  35889. type NoMethod VmEndpointNatMappingsListWarning
  35890. raw := NoMethod(*s)
  35891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35892. }
  35893. type VmEndpointNatMappingsListWarningData struct {
  35894. // Key: [Output Only] A key that provides more detail on the warning
  35895. // being returned. For example, for warnings where there are no results
  35896. // in a list request for a particular zone, this key might be scope and
  35897. // the key value might be the zone name. Other examples might be a key
  35898. // indicating a deprecated resource and a suggested replacement, or a
  35899. // warning about invalid network settings (for example, if an instance
  35900. // attempts to perform IP forwarding but is not enabled for IP
  35901. // forwarding).
  35902. Key string `json:"key,omitempty"`
  35903. // Value: [Output Only] A warning data value corresponding to the key.
  35904. Value string `json:"value,omitempty"`
  35905. // ForceSendFields is a list of field names (e.g. "Key") to
  35906. // unconditionally include in API requests. By default, fields with
  35907. // empty values are omitted from API requests. However, any non-pointer,
  35908. // non-interface field appearing in ForceSendFields will be sent to the
  35909. // server regardless of whether the field is empty or not. This may be
  35910. // used to include empty fields in Patch requests.
  35911. ForceSendFields []string `json:"-"`
  35912. // NullFields is a list of field names (e.g. "Key") to include in API
  35913. // requests with the JSON null value. By default, fields with empty
  35914. // values are omitted from API requests. However, any field with an
  35915. // empty value appearing in NullFields will be sent to the server as
  35916. // null. It is an error if a field in this list has a non-empty value.
  35917. // This may be used to include null fields in Patch requests.
  35918. NullFields []string `json:"-"`
  35919. }
  35920. func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
  35921. type NoMethod VmEndpointNatMappingsListWarningData
  35922. raw := NoMethod(*s)
  35923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35924. }
  35925. // VpnGateway: Represents a VPN gateway resource.
  35926. type VpnGateway struct {
  35927. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  35928. // format.
  35929. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  35930. // Description: An optional description of this resource. Provide this
  35931. // property when you create the resource.
  35932. Description string `json:"description,omitempty"`
  35933. // Id: [Output Only] The unique identifier for the resource. This
  35934. // identifier is defined by the server.
  35935. Id uint64 `json:"id,omitempty,string"`
  35936. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  35937. // VPN gateways.
  35938. Kind string `json:"kind,omitempty"`
  35939. // LabelFingerprint: A fingerprint for the labels being applied to this
  35940. // VpnGateway, which is essentially a hash of the labels set used for
  35941. // optimistic locking. The fingerprint is initially generated by Compute
  35942. // Engine and changes after every request to modify or update labels.
  35943. // You must always provide an up-to-date fingerprint hash in order to
  35944. // update or change labels, otherwise the request will fail with error
  35945. // 412 conditionNotMet.
  35946. //
  35947. // To see the latest fingerprint, make a get() request to retrieve an
  35948. // VpnGateway.
  35949. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  35950. // Labels: Labels to apply to this VpnGateway resource. These can be
  35951. // later modified by the setLabels method. Each label key/value must
  35952. // comply with RFC1035. Label values may be empty.
  35953. Labels map[string]string `json:"labels,omitempty"`
  35954. // Name: Name of the resource. Provided by the client when the resource
  35955. // is created. The name must be 1-63 characters long, and comply with
  35956. // RFC1035. Specifically, the name must be 1-63 characters long and
  35957. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  35958. // the first character must be a lowercase letter, and all following
  35959. // characters must be a dash, lowercase letter, or digit, except the
  35960. // last character, which cannot be a dash.
  35961. Name string `json:"name,omitempty"`
  35962. // Network: URL of the network to which this VPN gateway is attached.
  35963. // Provided by the client when the VPN gateway is created.
  35964. Network string `json:"network,omitempty"`
  35965. // Region: [Output Only] URL of the region where the VPN gateway
  35966. // resides.
  35967. Region string `json:"region,omitempty"`
  35968. // SelfLink: [Output Only] Server-defined URL for the resource.
  35969. SelfLink string `json:"selfLink,omitempty"`
  35970. // VpnInterfaces: [Output Only] A list of interfaces on this VPN
  35971. // gateway.
  35972. VpnInterfaces []*VpnGatewayVpnGatewayInterface `json:"vpnInterfaces,omitempty"`
  35973. // ServerResponse contains the HTTP response code and headers from the
  35974. // server.
  35975. googleapi.ServerResponse `json:"-"`
  35976. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  35977. // to unconditionally include in API requests. By default, fields with
  35978. // empty values are omitted from API requests. However, any non-pointer,
  35979. // non-interface field appearing in ForceSendFields will be sent to the
  35980. // server regardless of whether the field is empty or not. This may be
  35981. // used to include empty fields in Patch requests.
  35982. ForceSendFields []string `json:"-"`
  35983. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  35984. // include in API requests with the JSON null value. By default, fields
  35985. // with empty values are omitted from API requests. However, any field
  35986. // with an empty value appearing in NullFields will be sent to the
  35987. // server as null. It is an error if a field in this list has a
  35988. // non-empty value. This may be used to include null fields in Patch
  35989. // requests.
  35990. NullFields []string `json:"-"`
  35991. }
  35992. func (s *VpnGateway) MarshalJSON() ([]byte, error) {
  35993. type NoMethod VpnGateway
  35994. raw := NoMethod(*s)
  35995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  35996. }
  35997. type VpnGatewayAggregatedList struct {
  35998. // Id: [Output Only] Unique identifier for the resource; defined by the
  35999. // server.
  36000. Id string `json:"id,omitempty"`
  36001. // Items: A list of VpnGateway resources.
  36002. Items map[string]VpnGatewaysScopedList `json:"items,omitempty"`
  36003. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  36004. // VPN gateways.
  36005. Kind string `json:"kind,omitempty"`
  36006. // NextPageToken: [Output Only] This token allows you to get the next
  36007. // page of results for list requests. If the number of results is larger
  36008. // than maxResults, use the nextPageToken as a value for the query
  36009. // parameter pageToken in the next list request. Subsequent list
  36010. // requests will have their own nextPageToken to continue paging through
  36011. // the results.
  36012. NextPageToken string `json:"nextPageToken,omitempty"`
  36013. // SelfLink: [Output Only] Server-defined URL for this resource.
  36014. SelfLink string `json:"selfLink,omitempty"`
  36015. // Warning: [Output Only] Informational warning message.
  36016. Warning *VpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  36017. // ServerResponse contains the HTTP response code and headers from the
  36018. // server.
  36019. googleapi.ServerResponse `json:"-"`
  36020. // ForceSendFields is a list of field names (e.g. "Id") to
  36021. // unconditionally include in API requests. By default, fields with
  36022. // empty values are omitted from API requests. However, any non-pointer,
  36023. // non-interface field appearing in ForceSendFields will be sent to the
  36024. // server regardless of whether the field is empty or not. This may be
  36025. // used to include empty fields in Patch requests.
  36026. ForceSendFields []string `json:"-"`
  36027. // NullFields is a list of field names (e.g. "Id") to include in API
  36028. // requests with the JSON null value. By default, fields with empty
  36029. // values are omitted from API requests. However, any field with an
  36030. // empty value appearing in NullFields will be sent to the server as
  36031. // null. It is an error if a field in this list has a non-empty value.
  36032. // This may be used to include null fields in Patch requests.
  36033. NullFields []string `json:"-"`
  36034. }
  36035. func (s *VpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  36036. type NoMethod VpnGatewayAggregatedList
  36037. raw := NoMethod(*s)
  36038. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36039. }
  36040. // VpnGatewayAggregatedListWarning: [Output Only] Informational warning
  36041. // message.
  36042. type VpnGatewayAggregatedListWarning struct {
  36043. // Code: [Output Only] A warning code, if applicable. For example,
  36044. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36045. // the response.
  36046. //
  36047. // Possible values:
  36048. // "CLEANUP_FAILED"
  36049. // "DEPRECATED_RESOURCE_USED"
  36050. // "DEPRECATED_TYPE_USED"
  36051. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36052. // "EXPERIMENTAL_TYPE_USED"
  36053. // "EXTERNAL_API_WARNING"
  36054. // "FIELD_VALUE_OVERRIDEN"
  36055. // "INJECTED_KERNELS_DEPRECATED"
  36056. // "MISSING_TYPE_DEPENDENCY"
  36057. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36058. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36059. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36060. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36061. // "NEXT_HOP_NOT_RUNNING"
  36062. // "NOT_CRITICAL_ERROR"
  36063. // "NO_RESULTS_ON_PAGE"
  36064. // "REQUIRED_TOS_AGREEMENT"
  36065. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36066. // "RESOURCE_NOT_DELETED"
  36067. // "SCHEMA_VALIDATION_IGNORED"
  36068. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36069. // "UNDECLARED_PROPERTIES"
  36070. // "UNREACHABLE"
  36071. Code string `json:"code,omitempty"`
  36072. // Data: [Output Only] Metadata about this warning in key: value format.
  36073. // For example:
  36074. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36075. Data []*VpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  36076. // Message: [Output Only] A human-readable description of the warning
  36077. // code.
  36078. Message string `json:"message,omitempty"`
  36079. // ForceSendFields is a list of field names (e.g. "Code") to
  36080. // unconditionally include in API requests. By default, fields with
  36081. // empty values are omitted from API requests. However, any non-pointer,
  36082. // non-interface field appearing in ForceSendFields will be sent to the
  36083. // server regardless of whether the field is empty or not. This may be
  36084. // used to include empty fields in Patch requests.
  36085. ForceSendFields []string `json:"-"`
  36086. // NullFields is a list of field names (e.g. "Code") to include in API
  36087. // requests with the JSON null value. By default, fields with empty
  36088. // values are omitted from API requests. However, any field with an
  36089. // empty value appearing in NullFields will be sent to the server as
  36090. // null. It is an error if a field in this list has a non-empty value.
  36091. // This may be used to include null fields in Patch requests.
  36092. NullFields []string `json:"-"`
  36093. }
  36094. func (s *VpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  36095. type NoMethod VpnGatewayAggregatedListWarning
  36096. raw := NoMethod(*s)
  36097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36098. }
  36099. type VpnGatewayAggregatedListWarningData struct {
  36100. // Key: [Output Only] A key that provides more detail on the warning
  36101. // being returned. For example, for warnings where there are no results
  36102. // in a list request for a particular zone, this key might be scope and
  36103. // the key value might be the zone name. Other examples might be a key
  36104. // indicating a deprecated resource and a suggested replacement, or a
  36105. // warning about invalid network settings (for example, if an instance
  36106. // attempts to perform IP forwarding but is not enabled for IP
  36107. // forwarding).
  36108. Key string `json:"key,omitempty"`
  36109. // Value: [Output Only] A warning data value corresponding to the key.
  36110. Value string `json:"value,omitempty"`
  36111. // ForceSendFields is a list of field names (e.g. "Key") to
  36112. // unconditionally include in API requests. By default, fields with
  36113. // empty values are omitted from API requests. However, any non-pointer,
  36114. // non-interface field appearing in ForceSendFields will be sent to the
  36115. // server regardless of whether the field is empty or not. This may be
  36116. // used to include empty fields in Patch requests.
  36117. ForceSendFields []string `json:"-"`
  36118. // NullFields is a list of field names (e.g. "Key") to include in API
  36119. // requests with the JSON null value. By default, fields with empty
  36120. // values are omitted from API requests. However, any field with an
  36121. // empty value appearing in NullFields will be sent to the server as
  36122. // null. It is an error if a field in this list has a non-empty value.
  36123. // This may be used to include null fields in Patch requests.
  36124. NullFields []string `json:"-"`
  36125. }
  36126. func (s *VpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  36127. type NoMethod VpnGatewayAggregatedListWarningData
  36128. raw := NoMethod(*s)
  36129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36130. }
  36131. // VpnGatewayList: Contains a list of VpnGateway resources.
  36132. type VpnGatewayList struct {
  36133. // Id: [Output Only] Unique identifier for the resource; defined by the
  36134. // server.
  36135. Id string `json:"id,omitempty"`
  36136. // Items: A list of VpnGateway resources.
  36137. Items []*VpnGateway `json:"items,omitempty"`
  36138. // Kind: [Output Only] Type of resource. Always compute#vpnGateway for
  36139. // VPN gateways.
  36140. Kind string `json:"kind,omitempty"`
  36141. // NextPageToken: [Output Only] This token allows you to get the next
  36142. // page of results for list requests. If the number of results is larger
  36143. // than maxResults, use the nextPageToken as a value for the query
  36144. // parameter pageToken in the next list request. Subsequent list
  36145. // requests will have their own nextPageToken to continue paging through
  36146. // the results.
  36147. NextPageToken string `json:"nextPageToken,omitempty"`
  36148. // SelfLink: [Output Only] Server-defined URL for this resource.
  36149. SelfLink string `json:"selfLink,omitempty"`
  36150. // Warning: [Output Only] Informational warning message.
  36151. Warning *VpnGatewayListWarning `json:"warning,omitempty"`
  36152. // ServerResponse contains the HTTP response code and headers from the
  36153. // server.
  36154. googleapi.ServerResponse `json:"-"`
  36155. // ForceSendFields is a list of field names (e.g. "Id") to
  36156. // unconditionally include in API requests. By default, fields with
  36157. // empty values are omitted from API requests. However, any non-pointer,
  36158. // non-interface field appearing in ForceSendFields will be sent to the
  36159. // server regardless of whether the field is empty or not. This may be
  36160. // used to include empty fields in Patch requests.
  36161. ForceSendFields []string `json:"-"`
  36162. // NullFields is a list of field names (e.g. "Id") to include in API
  36163. // requests with the JSON null value. By default, fields with empty
  36164. // values are omitted from API requests. However, any field with an
  36165. // empty value appearing in NullFields will be sent to the server as
  36166. // null. It is an error if a field in this list has a non-empty value.
  36167. // This may be used to include null fields in Patch requests.
  36168. NullFields []string `json:"-"`
  36169. }
  36170. func (s *VpnGatewayList) MarshalJSON() ([]byte, error) {
  36171. type NoMethod VpnGatewayList
  36172. raw := NoMethod(*s)
  36173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36174. }
  36175. // VpnGatewayListWarning: [Output Only] Informational warning message.
  36176. type VpnGatewayListWarning struct {
  36177. // Code: [Output Only] A warning code, if applicable. For example,
  36178. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36179. // the response.
  36180. //
  36181. // Possible values:
  36182. // "CLEANUP_FAILED"
  36183. // "DEPRECATED_RESOURCE_USED"
  36184. // "DEPRECATED_TYPE_USED"
  36185. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36186. // "EXPERIMENTAL_TYPE_USED"
  36187. // "EXTERNAL_API_WARNING"
  36188. // "FIELD_VALUE_OVERRIDEN"
  36189. // "INJECTED_KERNELS_DEPRECATED"
  36190. // "MISSING_TYPE_DEPENDENCY"
  36191. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36192. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36193. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36194. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36195. // "NEXT_HOP_NOT_RUNNING"
  36196. // "NOT_CRITICAL_ERROR"
  36197. // "NO_RESULTS_ON_PAGE"
  36198. // "REQUIRED_TOS_AGREEMENT"
  36199. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36200. // "RESOURCE_NOT_DELETED"
  36201. // "SCHEMA_VALIDATION_IGNORED"
  36202. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36203. // "UNDECLARED_PROPERTIES"
  36204. // "UNREACHABLE"
  36205. Code string `json:"code,omitempty"`
  36206. // Data: [Output Only] Metadata about this warning in key: value format.
  36207. // For example:
  36208. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36209. Data []*VpnGatewayListWarningData `json:"data,omitempty"`
  36210. // Message: [Output Only] A human-readable description of the warning
  36211. // code.
  36212. Message string `json:"message,omitempty"`
  36213. // ForceSendFields is a list of field names (e.g. "Code") to
  36214. // unconditionally include in API requests. By default, fields with
  36215. // empty values are omitted from API requests. However, any non-pointer,
  36216. // non-interface field appearing in ForceSendFields will be sent to the
  36217. // server regardless of whether the field is empty or not. This may be
  36218. // used to include empty fields in Patch requests.
  36219. ForceSendFields []string `json:"-"`
  36220. // NullFields is a list of field names (e.g. "Code") to include in API
  36221. // requests with the JSON null value. By default, fields with empty
  36222. // values are omitted from API requests. However, any field with an
  36223. // empty value appearing in NullFields will be sent to the server as
  36224. // null. It is an error if a field in this list has a non-empty value.
  36225. // This may be used to include null fields in Patch requests.
  36226. NullFields []string `json:"-"`
  36227. }
  36228. func (s *VpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  36229. type NoMethod VpnGatewayListWarning
  36230. raw := NoMethod(*s)
  36231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36232. }
  36233. type VpnGatewayListWarningData struct {
  36234. // Key: [Output Only] A key that provides more detail on the warning
  36235. // being returned. For example, for warnings where there are no results
  36236. // in a list request for a particular zone, this key might be scope and
  36237. // the key value might be the zone name. Other examples might be a key
  36238. // indicating a deprecated resource and a suggested replacement, or a
  36239. // warning about invalid network settings (for example, if an instance
  36240. // attempts to perform IP forwarding but is not enabled for IP
  36241. // forwarding).
  36242. Key string `json:"key,omitempty"`
  36243. // Value: [Output Only] A warning data value corresponding to the key.
  36244. Value string `json:"value,omitempty"`
  36245. // ForceSendFields is a list of field names (e.g. "Key") to
  36246. // unconditionally include in API requests. By default, fields with
  36247. // empty values are omitted from API requests. However, any non-pointer,
  36248. // non-interface field appearing in ForceSendFields will be sent to the
  36249. // server regardless of whether the field is empty or not. This may be
  36250. // used to include empty fields in Patch requests.
  36251. ForceSendFields []string `json:"-"`
  36252. // NullFields is a list of field names (e.g. "Key") to include in API
  36253. // requests with the JSON null value. By default, fields with empty
  36254. // values are omitted from API requests. However, any field with an
  36255. // empty value appearing in NullFields will be sent to the server as
  36256. // null. It is an error if a field in this list has a non-empty value.
  36257. // This may be used to include null fields in Patch requests.
  36258. NullFields []string `json:"-"`
  36259. }
  36260. func (s *VpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  36261. type NoMethod VpnGatewayListWarningData
  36262. raw := NoMethod(*s)
  36263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36264. }
  36265. // VpnGatewayVpnGatewayInterface: A VPN gateway interface.
  36266. type VpnGatewayVpnGatewayInterface struct {
  36267. // Id: The numeric ID of this VPN gateway interface.
  36268. Id int64 `json:"id,omitempty"`
  36269. // IpAddress: The external IP address for this VPN gateway interface.
  36270. IpAddress string `json:"ipAddress,omitempty"`
  36271. // ForceSendFields is a list of field names (e.g. "Id") to
  36272. // unconditionally include in API requests. By default, fields with
  36273. // empty values are omitted from API requests. However, any non-pointer,
  36274. // non-interface field appearing in ForceSendFields will be sent to the
  36275. // server regardless of whether the field is empty or not. This may be
  36276. // used to include empty fields in Patch requests.
  36277. ForceSendFields []string `json:"-"`
  36278. // NullFields is a list of field names (e.g. "Id") to include in API
  36279. // requests with the JSON null value. By default, fields with empty
  36280. // values are omitted from API requests. However, any field with an
  36281. // empty value appearing in NullFields will be sent to the server as
  36282. // null. It is an error if a field in this list has a non-empty value.
  36283. // This may be used to include null fields in Patch requests.
  36284. NullFields []string `json:"-"`
  36285. }
  36286. func (s *VpnGatewayVpnGatewayInterface) MarshalJSON() ([]byte, error) {
  36287. type NoMethod VpnGatewayVpnGatewayInterface
  36288. raw := NoMethod(*s)
  36289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36290. }
  36291. type VpnGatewaysScopedList struct {
  36292. // VpnGateways: [Output Only] A list of VPN gateways contained in this
  36293. // scope.
  36294. VpnGateways []*VpnGateway `json:"vpnGateways,omitempty"`
  36295. // Warning: [Output Only] Informational warning which replaces the list
  36296. // of addresses when the list is empty.
  36297. Warning *VpnGatewaysScopedListWarning `json:"warning,omitempty"`
  36298. // ForceSendFields is a list of field names (e.g. "VpnGateways") to
  36299. // unconditionally include in API requests. By default, fields with
  36300. // empty values are omitted from API requests. However, any non-pointer,
  36301. // non-interface field appearing in ForceSendFields will be sent to the
  36302. // server regardless of whether the field is empty or not. This may be
  36303. // used to include empty fields in Patch requests.
  36304. ForceSendFields []string `json:"-"`
  36305. // NullFields is a list of field names (e.g. "VpnGateways") to include
  36306. // in API requests with the JSON null value. By default, fields with
  36307. // empty values are omitted from API requests. However, any field with
  36308. // an empty value appearing in NullFields will be sent to the server as
  36309. // null. It is an error if a field in this list has a non-empty value.
  36310. // This may be used to include null fields in Patch requests.
  36311. NullFields []string `json:"-"`
  36312. }
  36313. func (s *VpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  36314. type NoMethod VpnGatewaysScopedList
  36315. raw := NoMethod(*s)
  36316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36317. }
  36318. // VpnGatewaysScopedListWarning: [Output Only] Informational warning
  36319. // which replaces the list of addresses when the list is empty.
  36320. type VpnGatewaysScopedListWarning struct {
  36321. // Code: [Output Only] A warning code, if applicable. For example,
  36322. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36323. // the response.
  36324. //
  36325. // Possible values:
  36326. // "CLEANUP_FAILED"
  36327. // "DEPRECATED_RESOURCE_USED"
  36328. // "DEPRECATED_TYPE_USED"
  36329. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36330. // "EXPERIMENTAL_TYPE_USED"
  36331. // "EXTERNAL_API_WARNING"
  36332. // "FIELD_VALUE_OVERRIDEN"
  36333. // "INJECTED_KERNELS_DEPRECATED"
  36334. // "MISSING_TYPE_DEPENDENCY"
  36335. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36336. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36337. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36338. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36339. // "NEXT_HOP_NOT_RUNNING"
  36340. // "NOT_CRITICAL_ERROR"
  36341. // "NO_RESULTS_ON_PAGE"
  36342. // "REQUIRED_TOS_AGREEMENT"
  36343. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36344. // "RESOURCE_NOT_DELETED"
  36345. // "SCHEMA_VALIDATION_IGNORED"
  36346. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36347. // "UNDECLARED_PROPERTIES"
  36348. // "UNREACHABLE"
  36349. Code string `json:"code,omitempty"`
  36350. // Data: [Output Only] Metadata about this warning in key: value format.
  36351. // For example:
  36352. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36353. Data []*VpnGatewaysScopedListWarningData `json:"data,omitempty"`
  36354. // Message: [Output Only] A human-readable description of the warning
  36355. // code.
  36356. Message string `json:"message,omitempty"`
  36357. // ForceSendFields is a list of field names (e.g. "Code") to
  36358. // unconditionally include in API requests. By default, fields with
  36359. // empty values are omitted from API requests. However, any non-pointer,
  36360. // non-interface field appearing in ForceSendFields will be sent to the
  36361. // server regardless of whether the field is empty or not. This may be
  36362. // used to include empty fields in Patch requests.
  36363. ForceSendFields []string `json:"-"`
  36364. // NullFields is a list of field names (e.g. "Code") to include in API
  36365. // requests with the JSON null value. By default, fields with empty
  36366. // values are omitted from API requests. However, any field with an
  36367. // empty value appearing in NullFields will be sent to the server as
  36368. // null. It is an error if a field in this list has a non-empty value.
  36369. // This may be used to include null fields in Patch requests.
  36370. NullFields []string `json:"-"`
  36371. }
  36372. func (s *VpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  36373. type NoMethod VpnGatewaysScopedListWarning
  36374. raw := NoMethod(*s)
  36375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36376. }
  36377. type VpnGatewaysScopedListWarningData struct {
  36378. // Key: [Output Only] A key that provides more detail on the warning
  36379. // being returned. For example, for warnings where there are no results
  36380. // in a list request for a particular zone, this key might be scope and
  36381. // the key value might be the zone name. Other examples might be a key
  36382. // indicating a deprecated resource and a suggested replacement, or a
  36383. // warning about invalid network settings (for example, if an instance
  36384. // attempts to perform IP forwarding but is not enabled for IP
  36385. // forwarding).
  36386. Key string `json:"key,omitempty"`
  36387. // Value: [Output Only] A warning data value corresponding to the key.
  36388. Value string `json:"value,omitempty"`
  36389. // ForceSendFields is a list of field names (e.g. "Key") to
  36390. // unconditionally include in API requests. By default, fields with
  36391. // empty values are omitted from API requests. However, any non-pointer,
  36392. // non-interface field appearing in ForceSendFields will be sent to the
  36393. // server regardless of whether the field is empty or not. This may be
  36394. // used to include empty fields in Patch requests.
  36395. ForceSendFields []string `json:"-"`
  36396. // NullFields is a list of field names (e.g. "Key") to include in API
  36397. // requests with the JSON null value. By default, fields with empty
  36398. // values are omitted from API requests. However, any field with an
  36399. // empty value appearing in NullFields will be sent to the server as
  36400. // null. It is an error if a field in this list has a non-empty value.
  36401. // This may be used to include null fields in Patch requests.
  36402. NullFields []string `json:"-"`
  36403. }
  36404. func (s *VpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  36405. type NoMethod VpnGatewaysScopedListWarningData
  36406. raw := NoMethod(*s)
  36407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36408. }
  36409. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  36410. // (== resource_for v1.vpnTunnels ==)
  36411. type VpnTunnel struct {
  36412. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  36413. // format.
  36414. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  36415. // Description: An optional description of this resource. Provide this
  36416. // property when you create the resource.
  36417. Description string `json:"description,omitempty"`
  36418. // DetailedStatus: [Output Only] Detailed status message for the VPN
  36419. // tunnel.
  36420. DetailedStatus string `json:"detailedStatus,omitempty"`
  36421. // Id: [Output Only] The unique identifier for the resource. This
  36422. // identifier is defined by the server.
  36423. Id uint64 `json:"id,omitempty,string"`
  36424. // IkeVersion: IKE protocol version to use when establishing the VPN
  36425. // tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2.
  36426. // The default version is 2.
  36427. IkeVersion int64 `json:"ikeVersion,omitempty"`
  36428. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  36429. // VPN tunnels.
  36430. Kind string `json:"kind,omitempty"`
  36431. // LabelFingerprint: A fingerprint for the labels being applied to this
  36432. // VpnTunnel, which is essentially a hash of the labels set used for
  36433. // optimistic locking. The fingerprint is initially generated by Compute
  36434. // Engine and changes after every request to modify or update labels.
  36435. // You must always provide an up-to-date fingerprint hash in order to
  36436. // update or change labels, otherwise the request will fail with error
  36437. // 412 conditionNotMet.
  36438. //
  36439. // To see the latest fingerprint, make a get() request to retrieve a
  36440. // VpnTunnel.
  36441. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  36442. // Labels: Labels to apply to this VpnTunnel. These can be later
  36443. // modified by the setLabels method. Each label key/value pair must
  36444. // comply with RFC1035. Label values may be empty.
  36445. Labels map[string]string `json:"labels,omitempty"`
  36446. // LocalTrafficSelector: Local traffic selector to use when establishing
  36447. // the VPN tunnel with the peer VPN gateway. The value should be a CIDR
  36448. // formatted string, for example: 192.168.0.0/16. The ranges must be
  36449. // disjoint. Only IPv4 is supported.
  36450. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  36451. // Name: Name of the resource. Provided by the client when the resource
  36452. // is created. The name must be 1-63 characters long, and comply with
  36453. // RFC1035. Specifically, the name must be 1-63 characters long and
  36454. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  36455. // the first character must be a lowercase letter, and all following
  36456. // characters must be a dash, lowercase letter, or digit, except the
  36457. // last character, which cannot be a dash.
  36458. Name string `json:"name,omitempty"`
  36459. // PeerExternalGateway: URL of the peer side external VPN gateway to
  36460. // which this VPN tunnel is connected. Provided by the client when the
  36461. // VPN tunnel is created. This field is exclusive with the field
  36462. // peerGcpGateway.
  36463. PeerExternalGateway string `json:"peerExternalGateway,omitempty"`
  36464. // PeerExternalGatewayInterface: The interface ID of the external VPN
  36465. // gateway to which this VPN tunnel is connected. Provided by the client
  36466. // when the VPN tunnel is created.
  36467. PeerExternalGatewayInterface int64 `json:"peerExternalGatewayInterface,omitempty"`
  36468. // PeerGcpGateway: URL of the peer side HA GCP VPN gateway to which this
  36469. // VPN tunnel is connected. Provided by the client when the VPN tunnel
  36470. // is created. This field can be used when creating highly available VPN
  36471. // from VPC network to VPC network, the field is exclusive with the
  36472. // field peerExternalGateway. If provided, the VPN tunnel will
  36473. // automatically use the same vpnGatewayInterface ID in the peer GCP VPN
  36474. // gateway.
  36475. PeerGcpGateway string `json:"peerGcpGateway,omitempty"`
  36476. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  36477. PeerIp string `json:"peerIp,omitempty"`
  36478. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  36479. // You must specify this field as part of the HTTP request URL. It is
  36480. // not settable as a field in the request body.
  36481. Region string `json:"region,omitempty"`
  36482. // RemoteTrafficSelector: Remote traffic selectors to use when
  36483. // establishing the VPN tunnel with the peer VPN gateway. The value
  36484. // should be a CIDR formatted string, for example: 192.168.0.0/16. The
  36485. // ranges should be disjoint. Only IPv4 is supported.
  36486. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  36487. // Router: URL of the router resource to be used for dynamic routing.
  36488. Router string `json:"router,omitempty"`
  36489. // SelfLink: [Output Only] Server-defined URL for the resource.
  36490. SelfLink string `json:"selfLink,omitempty"`
  36491. // SharedSecret: Shared secret used to set the secure session between
  36492. // the Cloud VPN gateway and the peer VPN gateway.
  36493. SharedSecret string `json:"sharedSecret,omitempty"`
  36494. // SharedSecretHash: Hash of the shared secret.
  36495. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  36496. // Status: [Output Only] The status of the VPN tunnel, which can be one
  36497. // of the following:
  36498. // - PROVISIONING: Resource is being allocated for the VPN tunnel.
  36499. // - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs
  36500. // from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule,
  36501. // and Route resources are needed to setup the VPN tunnel.
  36502. // - FIRST_HANDSHAKE: Successful first handshake with the peer VPN.
  36503. // - ESTABLISHED: Secure session is successfully established with the
  36504. // peer VPN.
  36505. // - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS
  36506. // - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret).
  36507. //
  36508. // - NEGOTIATION_FAILURE: Handshake failed.
  36509. // - DEPROVISIONING: Resources are being deallocated for the VPN tunnel.
  36510. //
  36511. // - FAILED: Tunnel creation has failed and the tunnel is not ready to
  36512. // be used.
  36513. //
  36514. // Possible values:
  36515. // "ALLOCATING_RESOURCES"
  36516. // "AUTHORIZATION_ERROR"
  36517. // "DEPROVISIONING"
  36518. // "ESTABLISHED"
  36519. // "FAILED"
  36520. // "FIRST_HANDSHAKE"
  36521. // "NEGOTIATION_FAILURE"
  36522. // "NETWORK_ERROR"
  36523. // "NO_INCOMING_PACKETS"
  36524. // "PROVISIONING"
  36525. // "REJECTED"
  36526. // "WAITING_FOR_FULL_CONFIG"
  36527. Status string `json:"status,omitempty"`
  36528. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  36529. // tunnel is associated. Provided by the client when the VPN tunnel is
  36530. // created.
  36531. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  36532. // VpnGateway: URL of the VPN gateway with which this VPN tunnel is
  36533. // associated. Provided by the client when the VPN tunnel is created.
  36534. // This must be used (instead of target_vpn_gateway) if a High
  36535. // Availability VPN gateway resource is created.
  36536. VpnGateway string `json:"vpnGateway,omitempty"`
  36537. // VpnGatewayInterface: The interface ID of the VPN gateway with which
  36538. // this VPN tunnel is associated.
  36539. VpnGatewayInterface int64 `json:"vpnGatewayInterface,omitempty"`
  36540. // ServerResponse contains the HTTP response code and headers from the
  36541. // server.
  36542. googleapi.ServerResponse `json:"-"`
  36543. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  36544. // to unconditionally include in API requests. By default, fields with
  36545. // empty values are omitted from API requests. However, any non-pointer,
  36546. // non-interface field appearing in ForceSendFields will be sent to the
  36547. // server regardless of whether the field is empty or not. This may be
  36548. // used to include empty fields in Patch requests.
  36549. ForceSendFields []string `json:"-"`
  36550. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  36551. // include in API requests with the JSON null value. By default, fields
  36552. // with empty values are omitted from API requests. However, any field
  36553. // with an empty value appearing in NullFields will be sent to the
  36554. // server as null. It is an error if a field in this list has a
  36555. // non-empty value. This may be used to include null fields in Patch
  36556. // requests.
  36557. NullFields []string `json:"-"`
  36558. }
  36559. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  36560. type NoMethod VpnTunnel
  36561. raw := NoMethod(*s)
  36562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36563. }
  36564. type VpnTunnelAggregatedList struct {
  36565. // Id: [Output Only] Unique identifier for the resource; defined by the
  36566. // server.
  36567. Id string `json:"id,omitempty"`
  36568. // Items: A list of VpnTunnelsScopedList resources.
  36569. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  36570. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  36571. // VPN tunnels.
  36572. Kind string `json:"kind,omitempty"`
  36573. // NextPageToken: [Output Only] This token allows you to get the next
  36574. // page of results for list requests. If the number of results is larger
  36575. // than maxResults, use the nextPageToken as a value for the query
  36576. // parameter pageToken in the next list request. Subsequent list
  36577. // requests will have their own nextPageToken to continue paging through
  36578. // the results.
  36579. NextPageToken string `json:"nextPageToken,omitempty"`
  36580. // SelfLink: [Output Only] Server-defined URL for this resource.
  36581. SelfLink string `json:"selfLink,omitempty"`
  36582. // Warning: [Output Only] Informational warning message.
  36583. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  36584. // ServerResponse contains the HTTP response code and headers from the
  36585. // server.
  36586. googleapi.ServerResponse `json:"-"`
  36587. // ForceSendFields is a list of field names (e.g. "Id") to
  36588. // unconditionally include in API requests. By default, fields with
  36589. // empty values are omitted from API requests. However, any non-pointer,
  36590. // non-interface field appearing in ForceSendFields will be sent to the
  36591. // server regardless of whether the field is empty or not. This may be
  36592. // used to include empty fields in Patch requests.
  36593. ForceSendFields []string `json:"-"`
  36594. // NullFields is a list of field names (e.g. "Id") to include in API
  36595. // requests with the JSON null value. By default, fields with empty
  36596. // values are omitted from API requests. However, any field with an
  36597. // empty value appearing in NullFields will be sent to the server as
  36598. // null. It is an error if a field in this list has a non-empty value.
  36599. // This may be used to include null fields in Patch requests.
  36600. NullFields []string `json:"-"`
  36601. }
  36602. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  36603. type NoMethod VpnTunnelAggregatedList
  36604. raw := NoMethod(*s)
  36605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36606. }
  36607. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  36608. // message.
  36609. type VpnTunnelAggregatedListWarning struct {
  36610. // Code: [Output Only] A warning code, if applicable. For example,
  36611. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36612. // the response.
  36613. //
  36614. // Possible values:
  36615. // "CLEANUP_FAILED"
  36616. // "DEPRECATED_RESOURCE_USED"
  36617. // "DEPRECATED_TYPE_USED"
  36618. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36619. // "EXPERIMENTAL_TYPE_USED"
  36620. // "EXTERNAL_API_WARNING"
  36621. // "FIELD_VALUE_OVERRIDEN"
  36622. // "INJECTED_KERNELS_DEPRECATED"
  36623. // "MISSING_TYPE_DEPENDENCY"
  36624. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36625. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36626. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36627. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36628. // "NEXT_HOP_NOT_RUNNING"
  36629. // "NOT_CRITICAL_ERROR"
  36630. // "NO_RESULTS_ON_PAGE"
  36631. // "REQUIRED_TOS_AGREEMENT"
  36632. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36633. // "RESOURCE_NOT_DELETED"
  36634. // "SCHEMA_VALIDATION_IGNORED"
  36635. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36636. // "UNDECLARED_PROPERTIES"
  36637. // "UNREACHABLE"
  36638. Code string `json:"code,omitempty"`
  36639. // Data: [Output Only] Metadata about this warning in key: value format.
  36640. // For example:
  36641. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36642. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  36643. // Message: [Output Only] A human-readable description of the warning
  36644. // code.
  36645. Message string `json:"message,omitempty"`
  36646. // ForceSendFields is a list of field names (e.g. "Code") to
  36647. // unconditionally include in API requests. By default, fields with
  36648. // empty values are omitted from API requests. However, any non-pointer,
  36649. // non-interface field appearing in ForceSendFields will be sent to the
  36650. // server regardless of whether the field is empty or not. This may be
  36651. // used to include empty fields in Patch requests.
  36652. ForceSendFields []string `json:"-"`
  36653. // NullFields is a list of field names (e.g. "Code") to include in API
  36654. // requests with the JSON null value. By default, fields with empty
  36655. // values are omitted from API requests. However, any field with an
  36656. // empty value appearing in NullFields will be sent to the server as
  36657. // null. It is an error if a field in this list has a non-empty value.
  36658. // This may be used to include null fields in Patch requests.
  36659. NullFields []string `json:"-"`
  36660. }
  36661. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  36662. type NoMethod VpnTunnelAggregatedListWarning
  36663. raw := NoMethod(*s)
  36664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36665. }
  36666. type VpnTunnelAggregatedListWarningData struct {
  36667. // Key: [Output Only] A key that provides more detail on the warning
  36668. // being returned. For example, for warnings where there are no results
  36669. // in a list request for a particular zone, this key might be scope and
  36670. // the key value might be the zone name. Other examples might be a key
  36671. // indicating a deprecated resource and a suggested replacement, or a
  36672. // warning about invalid network settings (for example, if an instance
  36673. // attempts to perform IP forwarding but is not enabled for IP
  36674. // forwarding).
  36675. Key string `json:"key,omitempty"`
  36676. // Value: [Output Only] A warning data value corresponding to the key.
  36677. Value string `json:"value,omitempty"`
  36678. // ForceSendFields is a list of field names (e.g. "Key") to
  36679. // unconditionally include in API requests. By default, fields with
  36680. // empty values are omitted from API requests. However, any non-pointer,
  36681. // non-interface field appearing in ForceSendFields will be sent to the
  36682. // server regardless of whether the field is empty or not. This may be
  36683. // used to include empty fields in Patch requests.
  36684. ForceSendFields []string `json:"-"`
  36685. // NullFields is a list of field names (e.g. "Key") to include in API
  36686. // requests with the JSON null value. By default, fields with empty
  36687. // values are omitted from API requests. However, any field with an
  36688. // empty value appearing in NullFields will be sent to the server as
  36689. // null. It is an error if a field in this list has a non-empty value.
  36690. // This may be used to include null fields in Patch requests.
  36691. NullFields []string `json:"-"`
  36692. }
  36693. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  36694. type NoMethod VpnTunnelAggregatedListWarningData
  36695. raw := NoMethod(*s)
  36696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36697. }
  36698. // VpnTunnelList: Contains a list of VpnTunnel resources.
  36699. type VpnTunnelList struct {
  36700. // Id: [Output Only] Unique identifier for the resource; defined by the
  36701. // server.
  36702. Id string `json:"id,omitempty"`
  36703. // Items: A list of VpnTunnel resources.
  36704. Items []*VpnTunnel `json:"items,omitempty"`
  36705. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  36706. // VPN tunnels.
  36707. Kind string `json:"kind,omitempty"`
  36708. // NextPageToken: [Output Only] This token allows you to get the next
  36709. // page of results for list requests. If the number of results is larger
  36710. // than maxResults, use the nextPageToken as a value for the query
  36711. // parameter pageToken in the next list request. Subsequent list
  36712. // requests will have their own nextPageToken to continue paging through
  36713. // the results.
  36714. NextPageToken string `json:"nextPageToken,omitempty"`
  36715. // SelfLink: [Output Only] Server-defined URL for this resource.
  36716. SelfLink string `json:"selfLink,omitempty"`
  36717. // Warning: [Output Only] Informational warning message.
  36718. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  36719. // ServerResponse contains the HTTP response code and headers from the
  36720. // server.
  36721. googleapi.ServerResponse `json:"-"`
  36722. // ForceSendFields is a list of field names (e.g. "Id") to
  36723. // unconditionally include in API requests. By default, fields with
  36724. // empty values are omitted from API requests. However, any non-pointer,
  36725. // non-interface field appearing in ForceSendFields will be sent to the
  36726. // server regardless of whether the field is empty or not. This may be
  36727. // used to include empty fields in Patch requests.
  36728. ForceSendFields []string `json:"-"`
  36729. // NullFields is a list of field names (e.g. "Id") to include in API
  36730. // requests with the JSON null value. By default, fields with empty
  36731. // values are omitted from API requests. However, any field with an
  36732. // empty value appearing in NullFields will be sent to the server as
  36733. // null. It is an error if a field in this list has a non-empty value.
  36734. // This may be used to include null fields in Patch requests.
  36735. NullFields []string `json:"-"`
  36736. }
  36737. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  36738. type NoMethod VpnTunnelList
  36739. raw := NoMethod(*s)
  36740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36741. }
  36742. // VpnTunnelListWarning: [Output Only] Informational warning message.
  36743. type VpnTunnelListWarning struct {
  36744. // Code: [Output Only] A warning code, if applicable. For example,
  36745. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36746. // the response.
  36747. //
  36748. // Possible values:
  36749. // "CLEANUP_FAILED"
  36750. // "DEPRECATED_RESOURCE_USED"
  36751. // "DEPRECATED_TYPE_USED"
  36752. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36753. // "EXPERIMENTAL_TYPE_USED"
  36754. // "EXTERNAL_API_WARNING"
  36755. // "FIELD_VALUE_OVERRIDEN"
  36756. // "INJECTED_KERNELS_DEPRECATED"
  36757. // "MISSING_TYPE_DEPENDENCY"
  36758. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36759. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36760. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36761. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36762. // "NEXT_HOP_NOT_RUNNING"
  36763. // "NOT_CRITICAL_ERROR"
  36764. // "NO_RESULTS_ON_PAGE"
  36765. // "REQUIRED_TOS_AGREEMENT"
  36766. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36767. // "RESOURCE_NOT_DELETED"
  36768. // "SCHEMA_VALIDATION_IGNORED"
  36769. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36770. // "UNDECLARED_PROPERTIES"
  36771. // "UNREACHABLE"
  36772. Code string `json:"code,omitempty"`
  36773. // Data: [Output Only] Metadata about this warning in key: value format.
  36774. // For example:
  36775. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36776. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  36777. // Message: [Output Only] A human-readable description of the warning
  36778. // code.
  36779. Message string `json:"message,omitempty"`
  36780. // ForceSendFields is a list of field names (e.g. "Code") to
  36781. // unconditionally include in API requests. By default, fields with
  36782. // empty values are omitted from API requests. However, any non-pointer,
  36783. // non-interface field appearing in ForceSendFields will be sent to the
  36784. // server regardless of whether the field is empty or not. This may be
  36785. // used to include empty fields in Patch requests.
  36786. ForceSendFields []string `json:"-"`
  36787. // NullFields is a list of field names (e.g. "Code") to include in API
  36788. // requests with the JSON null value. By default, fields with empty
  36789. // values are omitted from API requests. However, any field with an
  36790. // empty value appearing in NullFields will be sent to the server as
  36791. // null. It is an error if a field in this list has a non-empty value.
  36792. // This may be used to include null fields in Patch requests.
  36793. NullFields []string `json:"-"`
  36794. }
  36795. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  36796. type NoMethod VpnTunnelListWarning
  36797. raw := NoMethod(*s)
  36798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36799. }
  36800. type VpnTunnelListWarningData struct {
  36801. // Key: [Output Only] A key that provides more detail on the warning
  36802. // being returned. For example, for warnings where there are no results
  36803. // in a list request for a particular zone, this key might be scope and
  36804. // the key value might be the zone name. Other examples might be a key
  36805. // indicating a deprecated resource and a suggested replacement, or a
  36806. // warning about invalid network settings (for example, if an instance
  36807. // attempts to perform IP forwarding but is not enabled for IP
  36808. // forwarding).
  36809. Key string `json:"key,omitempty"`
  36810. // Value: [Output Only] A warning data value corresponding to the key.
  36811. Value string `json:"value,omitempty"`
  36812. // ForceSendFields is a list of field names (e.g. "Key") to
  36813. // unconditionally include in API requests. By default, fields with
  36814. // empty values are omitted from API requests. However, any non-pointer,
  36815. // non-interface field appearing in ForceSendFields will be sent to the
  36816. // server regardless of whether the field is empty or not. This may be
  36817. // used to include empty fields in Patch requests.
  36818. ForceSendFields []string `json:"-"`
  36819. // NullFields is a list of field names (e.g. "Key") to include in API
  36820. // requests with the JSON null value. By default, fields with empty
  36821. // values are omitted from API requests. However, any field with an
  36822. // empty value appearing in NullFields will be sent to the server as
  36823. // null. It is an error if a field in this list has a non-empty value.
  36824. // This may be used to include null fields in Patch requests.
  36825. NullFields []string `json:"-"`
  36826. }
  36827. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  36828. type NoMethod VpnTunnelListWarningData
  36829. raw := NoMethod(*s)
  36830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36831. }
  36832. type VpnTunnelsScopedList struct {
  36833. // VpnTunnels: A list of VPN tunnels contained in this scope.
  36834. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  36835. // Warning: Informational warning which replaces the list of addresses
  36836. // when the list is empty.
  36837. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  36838. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  36839. // unconditionally include in API requests. By default, fields with
  36840. // empty values are omitted from API requests. However, any non-pointer,
  36841. // non-interface field appearing in ForceSendFields will be sent to the
  36842. // server regardless of whether the field is empty or not. This may be
  36843. // used to include empty fields in Patch requests.
  36844. ForceSendFields []string `json:"-"`
  36845. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  36846. // API requests with the JSON null value. By default, fields with empty
  36847. // values are omitted from API requests. However, any field with an
  36848. // empty value appearing in NullFields will be sent to the server as
  36849. // null. It is an error if a field in this list has a non-empty value.
  36850. // This may be used to include null fields in Patch requests.
  36851. NullFields []string `json:"-"`
  36852. }
  36853. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  36854. type NoMethod VpnTunnelsScopedList
  36855. raw := NoMethod(*s)
  36856. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36857. }
  36858. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  36859. // list of addresses when the list is empty.
  36860. type VpnTunnelsScopedListWarning struct {
  36861. // Code: [Output Only] A warning code, if applicable. For example,
  36862. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  36863. // the response.
  36864. //
  36865. // Possible values:
  36866. // "CLEANUP_FAILED"
  36867. // "DEPRECATED_RESOURCE_USED"
  36868. // "DEPRECATED_TYPE_USED"
  36869. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  36870. // "EXPERIMENTAL_TYPE_USED"
  36871. // "EXTERNAL_API_WARNING"
  36872. // "FIELD_VALUE_OVERRIDEN"
  36873. // "INJECTED_KERNELS_DEPRECATED"
  36874. // "MISSING_TYPE_DEPENDENCY"
  36875. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  36876. // "NEXT_HOP_CANNOT_IP_FORWARD"
  36877. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  36878. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  36879. // "NEXT_HOP_NOT_RUNNING"
  36880. // "NOT_CRITICAL_ERROR"
  36881. // "NO_RESULTS_ON_PAGE"
  36882. // "REQUIRED_TOS_AGREEMENT"
  36883. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  36884. // "RESOURCE_NOT_DELETED"
  36885. // "SCHEMA_VALIDATION_IGNORED"
  36886. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  36887. // "UNDECLARED_PROPERTIES"
  36888. // "UNREACHABLE"
  36889. Code string `json:"code,omitempty"`
  36890. // Data: [Output Only] Metadata about this warning in key: value format.
  36891. // For example:
  36892. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  36893. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  36894. // Message: [Output Only] A human-readable description of the warning
  36895. // code.
  36896. Message string `json:"message,omitempty"`
  36897. // ForceSendFields is a list of field names (e.g. "Code") to
  36898. // unconditionally include in API requests. By default, fields with
  36899. // empty values are omitted from API requests. However, any non-pointer,
  36900. // non-interface field appearing in ForceSendFields will be sent to the
  36901. // server regardless of whether the field is empty or not. This may be
  36902. // used to include empty fields in Patch requests.
  36903. ForceSendFields []string `json:"-"`
  36904. // NullFields is a list of field names (e.g. "Code") to include in API
  36905. // requests with the JSON null value. By default, fields with empty
  36906. // values are omitted from API requests. However, any field with an
  36907. // empty value appearing in NullFields will be sent to the server as
  36908. // null. It is an error if a field in this list has a non-empty value.
  36909. // This may be used to include null fields in Patch requests.
  36910. NullFields []string `json:"-"`
  36911. }
  36912. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  36913. type NoMethod VpnTunnelsScopedListWarning
  36914. raw := NoMethod(*s)
  36915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36916. }
  36917. type VpnTunnelsScopedListWarningData struct {
  36918. // Key: [Output Only] A key that provides more detail on the warning
  36919. // being returned. For example, for warnings where there are no results
  36920. // in a list request for a particular zone, this key might be scope and
  36921. // the key value might be the zone name. Other examples might be a key
  36922. // indicating a deprecated resource and a suggested replacement, or a
  36923. // warning about invalid network settings (for example, if an instance
  36924. // attempts to perform IP forwarding but is not enabled for IP
  36925. // forwarding).
  36926. Key string `json:"key,omitempty"`
  36927. // Value: [Output Only] A warning data value corresponding to the key.
  36928. Value string `json:"value,omitempty"`
  36929. // ForceSendFields is a list of field names (e.g. "Key") to
  36930. // unconditionally include in API requests. By default, fields with
  36931. // empty values are omitted from API requests. However, any non-pointer,
  36932. // non-interface field appearing in ForceSendFields will be sent to the
  36933. // server regardless of whether the field is empty or not. This may be
  36934. // used to include empty fields in Patch requests.
  36935. ForceSendFields []string `json:"-"`
  36936. // NullFields is a list of field names (e.g. "Key") to include in API
  36937. // requests with the JSON null value. By default, fields with empty
  36938. // values are omitted from API requests. However, any field with an
  36939. // empty value appearing in NullFields will be sent to the server as
  36940. // null. It is an error if a field in this list has a non-empty value.
  36941. // This may be used to include null fields in Patch requests.
  36942. NullFields []string `json:"-"`
  36943. }
  36944. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  36945. type NoMethod VpnTunnelsScopedListWarningData
  36946. raw := NoMethod(*s)
  36947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36948. }
  36949. type WafExpressionSet struct {
  36950. // Aliases: A list of alternate IDs. The format should be: - E.g.
  36951. // XSS-stable Generic suffix like "stable" is particularly useful if a
  36952. // policy likes to avail newer set of expressions without having to
  36953. // change the policy. A given alias name can't be used for more than one
  36954. // entity set.
  36955. Aliases []string `json:"aliases,omitempty"`
  36956. // Expressions: List of available expressions.
  36957. Expressions []*WafExpressionSetExpression `json:"expressions,omitempty"`
  36958. // Id: Google specified expression set ID. The format should be: - E.g.
  36959. // XSS-20170329
  36960. Id string `json:"id,omitempty"`
  36961. // ForceSendFields is a list of field names (e.g. "Aliases") to
  36962. // unconditionally include in API requests. By default, fields with
  36963. // empty values are omitted from API requests. However, any non-pointer,
  36964. // non-interface field appearing in ForceSendFields will be sent to the
  36965. // server regardless of whether the field is empty or not. This may be
  36966. // used to include empty fields in Patch requests.
  36967. ForceSendFields []string `json:"-"`
  36968. // NullFields is a list of field names (e.g. "Aliases") to include in
  36969. // API requests with the JSON null value. By default, fields with empty
  36970. // values are omitted from API requests. However, any field with an
  36971. // empty value appearing in NullFields will be sent to the server as
  36972. // null. It is an error if a field in this list has a non-empty value.
  36973. // This may be used to include null fields in Patch requests.
  36974. NullFields []string `json:"-"`
  36975. }
  36976. func (s *WafExpressionSet) MarshalJSON() ([]byte, error) {
  36977. type NoMethod WafExpressionSet
  36978. raw := NoMethod(*s)
  36979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  36980. }
  36981. type WafExpressionSetExpression struct {
  36982. // Id: Expression ID should uniquely identify the origin of the
  36983. // expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core
  36984. // rule set version 2.9.1 rule id 973337. The ID could be used to
  36985. // determine the individual attack definition that has been detected. It
  36986. // could also be used to exclude it from the policy in case of false
  36987. // positive.
  36988. Id string `json:"id,omitempty"`
  36989. // ForceSendFields is a list of field names (e.g. "Id") to
  36990. // unconditionally include in API requests. By default, fields with
  36991. // empty values are omitted from API requests. However, any non-pointer,
  36992. // non-interface field appearing in ForceSendFields will be sent to the
  36993. // server regardless of whether the field is empty or not. This may be
  36994. // used to include empty fields in Patch requests.
  36995. ForceSendFields []string `json:"-"`
  36996. // NullFields is a list of field names (e.g. "Id") to include in API
  36997. // requests with the JSON null value. By default, fields with empty
  36998. // values are omitted from API requests. However, any field with an
  36999. // empty value appearing in NullFields will be sent to the server as
  37000. // null. It is an error if a field in this list has a non-empty value.
  37001. // This may be used to include null fields in Patch requests.
  37002. NullFields []string `json:"-"`
  37003. }
  37004. func (s *WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
  37005. type NoMethod WafExpressionSetExpression
  37006. raw := NoMethod(*s)
  37007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37008. }
  37009. // WeightedBackendService: In contrast to a single BackendService in
  37010. // HttpRouteAction to which all matching traffic is directed to,
  37011. // WeightedBackendService allows traffic to be split across multiple
  37012. // BackendServices. The volume of traffic for each BackendService is
  37013. // proportional to the weight specified in each WeightedBackendService
  37014. type WeightedBackendService struct {
  37015. // BackendService: The full or partial URL to the default BackendService
  37016. // resource. Before forwarding the request to backendService, the
  37017. // loadbalancer applies any relevant headerActions specified as part of
  37018. // this backendServiceWeight.
  37019. BackendService string `json:"backendService,omitempty"`
  37020. // HeaderAction: Specifies changes to request and response headers that
  37021. // need to take effect for the selected backendService.
  37022. // headerAction specified here take effect before headerAction in the
  37023. // enclosing HttpRouteRule, PathMatcher and UrlMap.
  37024. HeaderAction *HttpHeaderAction `json:"headerAction,omitempty"`
  37025. // Weight: Specifies the fraction of traffic sent to backendService,
  37026. // computed as weight / (sum of all weightedBackendService weights in
  37027. // routeAction) .
  37028. // The selection of a backend service is determined only for new
  37029. // traffic. Once a user's request has been directed to a backendService,
  37030. // subsequent requests will be sent to the same backendService as
  37031. // determined by the BackendService's session affinity policy.
  37032. // The value must be between 0 and 1000
  37033. Weight int64 `json:"weight,omitempty"`
  37034. // ForceSendFields is a list of field names (e.g. "BackendService") to
  37035. // unconditionally include in API requests. By default, fields with
  37036. // empty values are omitted from API requests. However, any non-pointer,
  37037. // non-interface field appearing in ForceSendFields will be sent to the
  37038. // server regardless of whether the field is empty or not. This may be
  37039. // used to include empty fields in Patch requests.
  37040. ForceSendFields []string `json:"-"`
  37041. // NullFields is a list of field names (e.g. "BackendService") to
  37042. // include in API requests with the JSON null value. By default, fields
  37043. // with empty values are omitted from API requests. However, any field
  37044. // with an empty value appearing in NullFields will be sent to the
  37045. // server as null. It is an error if a field in this list has a
  37046. // non-empty value. This may be used to include null fields in Patch
  37047. // requests.
  37048. NullFields []string `json:"-"`
  37049. }
  37050. func (s *WeightedBackendService) MarshalJSON() ([]byte, error) {
  37051. type NoMethod WeightedBackendService
  37052. raw := NoMethod(*s)
  37053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37054. }
  37055. type XpnHostList struct {
  37056. // Id: [Output Only] Unique identifier for the resource; defined by the
  37057. // server.
  37058. Id string `json:"id,omitempty"`
  37059. // Items: [Output Only] A list of shared VPC host project URLs.
  37060. Items []*Project `json:"items,omitempty"`
  37061. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  37062. // lists of shared VPC hosts.
  37063. Kind string `json:"kind,omitempty"`
  37064. // NextPageToken: [Output Only] This token allows you to get the next
  37065. // page of results for list requests. If the number of results is larger
  37066. // than maxResults, use the nextPageToken as a value for the query
  37067. // parameter pageToken in the next list request. Subsequent list
  37068. // requests will have their own nextPageToken to continue paging through
  37069. // the results.
  37070. NextPageToken string `json:"nextPageToken,omitempty"`
  37071. // SelfLink: [Output Only] Server-defined URL for this resource.
  37072. SelfLink string `json:"selfLink,omitempty"`
  37073. // Warning: [Output Only] Informational warning message.
  37074. Warning *XpnHostListWarning `json:"warning,omitempty"`
  37075. // ServerResponse contains the HTTP response code and headers from the
  37076. // server.
  37077. googleapi.ServerResponse `json:"-"`
  37078. // ForceSendFields is a list of field names (e.g. "Id") to
  37079. // unconditionally include in API requests. By default, fields with
  37080. // empty values are omitted from API requests. However, any non-pointer,
  37081. // non-interface field appearing in ForceSendFields will be sent to the
  37082. // server regardless of whether the field is empty or not. This may be
  37083. // used to include empty fields in Patch requests.
  37084. ForceSendFields []string `json:"-"`
  37085. // NullFields is a list of field names (e.g. "Id") to include in API
  37086. // requests with the JSON null value. By default, fields with empty
  37087. // values are omitted from API requests. However, any field with an
  37088. // empty value appearing in NullFields will be sent to the server as
  37089. // null. It is an error if a field in this list has a non-empty value.
  37090. // This may be used to include null fields in Patch requests.
  37091. NullFields []string `json:"-"`
  37092. }
  37093. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  37094. type NoMethod XpnHostList
  37095. raw := NoMethod(*s)
  37096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37097. }
  37098. // XpnHostListWarning: [Output Only] Informational warning message.
  37099. type XpnHostListWarning struct {
  37100. // Code: [Output Only] A warning code, if applicable. For example,
  37101. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  37102. // the response.
  37103. //
  37104. // Possible values:
  37105. // "CLEANUP_FAILED"
  37106. // "DEPRECATED_RESOURCE_USED"
  37107. // "DEPRECATED_TYPE_USED"
  37108. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  37109. // "EXPERIMENTAL_TYPE_USED"
  37110. // "EXTERNAL_API_WARNING"
  37111. // "FIELD_VALUE_OVERRIDEN"
  37112. // "INJECTED_KERNELS_DEPRECATED"
  37113. // "MISSING_TYPE_DEPENDENCY"
  37114. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  37115. // "NEXT_HOP_CANNOT_IP_FORWARD"
  37116. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  37117. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  37118. // "NEXT_HOP_NOT_RUNNING"
  37119. // "NOT_CRITICAL_ERROR"
  37120. // "NO_RESULTS_ON_PAGE"
  37121. // "REQUIRED_TOS_AGREEMENT"
  37122. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  37123. // "RESOURCE_NOT_DELETED"
  37124. // "SCHEMA_VALIDATION_IGNORED"
  37125. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  37126. // "UNDECLARED_PROPERTIES"
  37127. // "UNREACHABLE"
  37128. Code string `json:"code,omitempty"`
  37129. // Data: [Output Only] Metadata about this warning in key: value format.
  37130. // For example:
  37131. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  37132. Data []*XpnHostListWarningData `json:"data,omitempty"`
  37133. // Message: [Output Only] A human-readable description of the warning
  37134. // code.
  37135. Message string `json:"message,omitempty"`
  37136. // ForceSendFields is a list of field names (e.g. "Code") to
  37137. // unconditionally include in API requests. By default, fields with
  37138. // empty values are omitted from API requests. However, any non-pointer,
  37139. // non-interface field appearing in ForceSendFields will be sent to the
  37140. // server regardless of whether the field is empty or not. This may be
  37141. // used to include empty fields in Patch requests.
  37142. ForceSendFields []string `json:"-"`
  37143. // NullFields is a list of field names (e.g. "Code") to include in API
  37144. // requests with the JSON null value. By default, fields with empty
  37145. // values are omitted from API requests. However, any field with an
  37146. // empty value appearing in NullFields will be sent to the server as
  37147. // null. It is an error if a field in this list has a non-empty value.
  37148. // This may be used to include null fields in Patch requests.
  37149. NullFields []string `json:"-"`
  37150. }
  37151. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  37152. type NoMethod XpnHostListWarning
  37153. raw := NoMethod(*s)
  37154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37155. }
  37156. type XpnHostListWarningData struct {
  37157. // Key: [Output Only] A key that provides more detail on the warning
  37158. // being returned. For example, for warnings where there are no results
  37159. // in a list request for a particular zone, this key might be scope and
  37160. // the key value might be the zone name. Other examples might be a key
  37161. // indicating a deprecated resource and a suggested replacement, or a
  37162. // warning about invalid network settings (for example, if an instance
  37163. // attempts to perform IP forwarding but is not enabled for IP
  37164. // forwarding).
  37165. Key string `json:"key,omitempty"`
  37166. // Value: [Output Only] A warning data value corresponding to the key.
  37167. Value string `json:"value,omitempty"`
  37168. // ForceSendFields is a list of field names (e.g. "Key") to
  37169. // unconditionally include in API requests. By default, fields with
  37170. // empty values are omitted from API requests. However, any non-pointer,
  37171. // non-interface field appearing in ForceSendFields will be sent to the
  37172. // server regardless of whether the field is empty or not. This may be
  37173. // used to include empty fields in Patch requests.
  37174. ForceSendFields []string `json:"-"`
  37175. // NullFields is a list of field names (e.g. "Key") to include in API
  37176. // requests with the JSON null value. By default, fields with empty
  37177. // values are omitted from API requests. However, any field with an
  37178. // empty value appearing in NullFields will be sent to the server as
  37179. // null. It is an error if a field in this list has a non-empty value.
  37180. // This may be used to include null fields in Patch requests.
  37181. NullFields []string `json:"-"`
  37182. }
  37183. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  37184. type NoMethod XpnHostListWarningData
  37185. raw := NoMethod(*s)
  37186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37187. }
  37188. // XpnResourceId: Service resource (a.k.a service project) ID.
  37189. type XpnResourceId struct {
  37190. // Id: The ID of the service resource. In the case of projects, this
  37191. // field supports project id (e.g., my-project-123) and project number
  37192. // (e.g. 12345678).
  37193. Id string `json:"id,omitempty"`
  37194. // Type: The type of the service resource.
  37195. //
  37196. // Possible values:
  37197. // "PROJECT"
  37198. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  37199. Type string `json:"type,omitempty"`
  37200. // ForceSendFields is a list of field names (e.g. "Id") to
  37201. // unconditionally include in API requests. By default, fields with
  37202. // empty values are omitted from API requests. However, any non-pointer,
  37203. // non-interface field appearing in ForceSendFields will be sent to the
  37204. // server regardless of whether the field is empty or not. This may be
  37205. // used to include empty fields in Patch requests.
  37206. ForceSendFields []string `json:"-"`
  37207. // NullFields is a list of field names (e.g. "Id") to include in API
  37208. // requests with the JSON null value. By default, fields with empty
  37209. // values are omitted from API requests. However, any field with an
  37210. // empty value appearing in NullFields will be sent to the server as
  37211. // null. It is an error if a field in this list has a non-empty value.
  37212. // This may be used to include null fields in Patch requests.
  37213. NullFields []string `json:"-"`
  37214. }
  37215. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  37216. type NoMethod XpnResourceId
  37217. raw := NoMethod(*s)
  37218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37219. }
  37220. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  37221. // resource_for v1.zones ==)
  37222. type Zone struct {
  37223. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  37224. // selections for the zone.
  37225. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  37226. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  37227. // format.
  37228. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  37229. // Deprecated: [Output Only] The deprecation status associated with this
  37230. // zone.
  37231. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  37232. // Description: [Output Only] Textual description of the resource.
  37233. Description string `json:"description,omitempty"`
  37234. // Id: [Output Only] The unique identifier for the resource. This
  37235. // identifier is defined by the server.
  37236. Id uint64 `json:"id,omitempty,string"`
  37237. // Kind: [Output Only] Type of the resource. Always compute#zone for
  37238. // zones.
  37239. Kind string `json:"kind,omitempty"`
  37240. // Name: [Output Only] Name of the resource.
  37241. Name string `json:"name,omitempty"`
  37242. // Region: [Output Only] Full URL reference to the region which hosts
  37243. // the zone.
  37244. Region string `json:"region,omitempty"`
  37245. // SelfLink: [Output Only] Server-defined URL for the resource.
  37246. SelfLink string `json:"selfLink,omitempty"`
  37247. // Status: [Output Only] Status of the zone, either UP or DOWN.
  37248. //
  37249. // Possible values:
  37250. // "DOWN"
  37251. // "UP"
  37252. Status string `json:"status,omitempty"`
  37253. // ServerResponse contains the HTTP response code and headers from the
  37254. // server.
  37255. googleapi.ServerResponse `json:"-"`
  37256. // ForceSendFields is a list of field names (e.g.
  37257. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  37258. // By default, fields with empty values are omitted from API requests.
  37259. // However, any non-pointer, non-interface field appearing in
  37260. // ForceSendFields will be sent to the server regardless of whether the
  37261. // field is empty or not. This may be used to include empty fields in
  37262. // Patch requests.
  37263. ForceSendFields []string `json:"-"`
  37264. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  37265. // include in API requests with the JSON null value. By default, fields
  37266. // with empty values are omitted from API requests. However, any field
  37267. // with an empty value appearing in NullFields will be sent to the
  37268. // server as null. It is an error if a field in this list has a
  37269. // non-empty value. This may be used to include null fields in Patch
  37270. // requests.
  37271. NullFields []string `json:"-"`
  37272. }
  37273. func (s *Zone) MarshalJSON() ([]byte, error) {
  37274. type NoMethod Zone
  37275. raw := NoMethod(*s)
  37276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37277. }
  37278. // ZoneList: Contains a list of zone resources.
  37279. type ZoneList struct {
  37280. // Id: [Output Only] Unique identifier for the resource; defined by the
  37281. // server.
  37282. Id string `json:"id,omitempty"`
  37283. // Items: A list of Zone resources.
  37284. Items []*Zone `json:"items,omitempty"`
  37285. // Kind: Type of resource.
  37286. Kind string `json:"kind,omitempty"`
  37287. // NextPageToken: [Output Only] This token allows you to get the next
  37288. // page of results for list requests. If the number of results is larger
  37289. // than maxResults, use the nextPageToken as a value for the query
  37290. // parameter pageToken in the next list request. Subsequent list
  37291. // requests will have their own nextPageToken to continue paging through
  37292. // the results.
  37293. NextPageToken string `json:"nextPageToken,omitempty"`
  37294. // SelfLink: [Output Only] Server-defined URL for this resource.
  37295. SelfLink string `json:"selfLink,omitempty"`
  37296. // Warning: [Output Only] Informational warning message.
  37297. Warning *ZoneListWarning `json:"warning,omitempty"`
  37298. // ServerResponse contains the HTTP response code and headers from the
  37299. // server.
  37300. googleapi.ServerResponse `json:"-"`
  37301. // ForceSendFields is a list of field names (e.g. "Id") to
  37302. // unconditionally include in API requests. By default, fields with
  37303. // empty values are omitted from API requests. However, any non-pointer,
  37304. // non-interface field appearing in ForceSendFields will be sent to the
  37305. // server regardless of whether the field is empty or not. This may be
  37306. // used to include empty fields in Patch requests.
  37307. ForceSendFields []string `json:"-"`
  37308. // NullFields is a list of field names (e.g. "Id") to include in API
  37309. // requests with the JSON null value. By default, fields with empty
  37310. // values are omitted from API requests. However, any field with an
  37311. // empty value appearing in NullFields will be sent to the server as
  37312. // null. It is an error if a field in this list has a non-empty value.
  37313. // This may be used to include null fields in Patch requests.
  37314. NullFields []string `json:"-"`
  37315. }
  37316. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  37317. type NoMethod ZoneList
  37318. raw := NoMethod(*s)
  37319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37320. }
  37321. // ZoneListWarning: [Output Only] Informational warning message.
  37322. type ZoneListWarning struct {
  37323. // Code: [Output Only] A warning code, if applicable. For example,
  37324. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  37325. // the response.
  37326. //
  37327. // Possible values:
  37328. // "CLEANUP_FAILED"
  37329. // "DEPRECATED_RESOURCE_USED"
  37330. // "DEPRECATED_TYPE_USED"
  37331. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  37332. // "EXPERIMENTAL_TYPE_USED"
  37333. // "EXTERNAL_API_WARNING"
  37334. // "FIELD_VALUE_OVERRIDEN"
  37335. // "INJECTED_KERNELS_DEPRECATED"
  37336. // "MISSING_TYPE_DEPENDENCY"
  37337. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  37338. // "NEXT_HOP_CANNOT_IP_FORWARD"
  37339. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  37340. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  37341. // "NEXT_HOP_NOT_RUNNING"
  37342. // "NOT_CRITICAL_ERROR"
  37343. // "NO_RESULTS_ON_PAGE"
  37344. // "REQUIRED_TOS_AGREEMENT"
  37345. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  37346. // "RESOURCE_NOT_DELETED"
  37347. // "SCHEMA_VALIDATION_IGNORED"
  37348. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  37349. // "UNDECLARED_PROPERTIES"
  37350. // "UNREACHABLE"
  37351. Code string `json:"code,omitempty"`
  37352. // Data: [Output Only] Metadata about this warning in key: value format.
  37353. // For example:
  37354. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  37355. Data []*ZoneListWarningData `json:"data,omitempty"`
  37356. // Message: [Output Only] A human-readable description of the warning
  37357. // code.
  37358. Message string `json:"message,omitempty"`
  37359. // ForceSendFields is a list of field names (e.g. "Code") to
  37360. // unconditionally include in API requests. By default, fields with
  37361. // empty values are omitted from API requests. However, any non-pointer,
  37362. // non-interface field appearing in ForceSendFields will be sent to the
  37363. // server regardless of whether the field is empty or not. This may be
  37364. // used to include empty fields in Patch requests.
  37365. ForceSendFields []string `json:"-"`
  37366. // NullFields is a list of field names (e.g. "Code") to include in API
  37367. // requests with the JSON null value. By default, fields with empty
  37368. // values are omitted from API requests. However, any field with an
  37369. // empty value appearing in NullFields will be sent to the server as
  37370. // null. It is an error if a field in this list has a non-empty value.
  37371. // This may be used to include null fields in Patch requests.
  37372. NullFields []string `json:"-"`
  37373. }
  37374. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  37375. type NoMethod ZoneListWarning
  37376. raw := NoMethod(*s)
  37377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37378. }
  37379. type ZoneListWarningData struct {
  37380. // Key: [Output Only] A key that provides more detail on the warning
  37381. // being returned. For example, for warnings where there are no results
  37382. // in a list request for a particular zone, this key might be scope and
  37383. // the key value might be the zone name. Other examples might be a key
  37384. // indicating a deprecated resource and a suggested replacement, or a
  37385. // warning about invalid network settings (for example, if an instance
  37386. // attempts to perform IP forwarding but is not enabled for IP
  37387. // forwarding).
  37388. Key string `json:"key,omitempty"`
  37389. // Value: [Output Only] A warning data value corresponding to the key.
  37390. Value string `json:"value,omitempty"`
  37391. // ForceSendFields is a list of field names (e.g. "Key") to
  37392. // unconditionally include in API requests. By default, fields with
  37393. // empty values are omitted from API requests. However, any non-pointer,
  37394. // non-interface field appearing in ForceSendFields will be sent to the
  37395. // server regardless of whether the field is empty or not. This may be
  37396. // used to include empty fields in Patch requests.
  37397. ForceSendFields []string `json:"-"`
  37398. // NullFields is a list of field names (e.g. "Key") to include in API
  37399. // requests with the JSON null value. By default, fields with empty
  37400. // values are omitted from API requests. However, any field with an
  37401. // empty value appearing in NullFields will be sent to the server as
  37402. // null. It is an error if a field in this list has a non-empty value.
  37403. // This may be used to include null fields in Patch requests.
  37404. NullFields []string `json:"-"`
  37405. }
  37406. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  37407. type NoMethod ZoneListWarningData
  37408. raw := NoMethod(*s)
  37409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37410. }
  37411. type ZoneSetLabelsRequest struct {
  37412. // LabelFingerprint: The fingerprint of the previous set of labels for
  37413. // this resource, used to detect conflicts. The fingerprint is initially
  37414. // generated by Compute Engine and changes after every request to modify
  37415. // or update labels. You must always provide an up-to-date fingerprint
  37416. // hash in order to update or change labels. Make a get() request to the
  37417. // resource to get the latest fingerprint.
  37418. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  37419. // Labels: The labels to set for this resource.
  37420. Labels map[string]string `json:"labels,omitempty"`
  37421. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  37422. // unconditionally include in API requests. By default, fields with
  37423. // empty values are omitted from API requests. However, any non-pointer,
  37424. // non-interface field appearing in ForceSendFields will be sent to the
  37425. // server regardless of whether the field is empty or not. This may be
  37426. // used to include empty fields in Patch requests.
  37427. ForceSendFields []string `json:"-"`
  37428. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  37429. // include in API requests with the JSON null value. By default, fields
  37430. // with empty values are omitted from API requests. However, any field
  37431. // with an empty value appearing in NullFields will be sent to the
  37432. // server as null. It is an error if a field in this list has a
  37433. // non-empty value. This may be used to include null fields in Patch
  37434. // requests.
  37435. NullFields []string `json:"-"`
  37436. }
  37437. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  37438. type NoMethod ZoneSetLabelsRequest
  37439. raw := NoMethod(*s)
  37440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37441. }
  37442. type ZoneSetPolicyRequest struct {
  37443. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  37444. // Deprecated. Use 'policy' to specify bindings.
  37445. Bindings []*Binding `json:"bindings,omitempty"`
  37446. // Etag: Flatten Policy to create a backward compatible wire-format.
  37447. // Deprecated. Use 'policy' to specify the etag.
  37448. Etag string `json:"etag,omitempty"`
  37449. // Policy: REQUIRED: The complete policy to be applied to the
  37450. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  37451. // empty policy is in general a valid policy but certain services (like
  37452. // Projects) might reject them.
  37453. Policy *Policy `json:"policy,omitempty"`
  37454. // ForceSendFields is a list of field names (e.g. "Bindings") to
  37455. // unconditionally include in API requests. By default, fields with
  37456. // empty values are omitted from API requests. However, any non-pointer,
  37457. // non-interface field appearing in ForceSendFields will be sent to the
  37458. // server regardless of whether the field is empty or not. This may be
  37459. // used to include empty fields in Patch requests.
  37460. ForceSendFields []string `json:"-"`
  37461. // NullFields is a list of field names (e.g. "Bindings") to include in
  37462. // API requests with the JSON null value. By default, fields with empty
  37463. // values are omitted from API requests. However, any field with an
  37464. // empty value appearing in NullFields will be sent to the server as
  37465. // null. It is an error if a field in this list has a non-empty value.
  37466. // This may be used to include null fields in Patch requests.
  37467. NullFields []string `json:"-"`
  37468. }
  37469. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  37470. type NoMethod ZoneSetPolicyRequest
  37471. raw := NoMethod(*s)
  37472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  37473. }
  37474. // method id "compute.acceleratorTypes.aggregatedList":
  37475. type AcceleratorTypesAggregatedListCall struct {
  37476. s *Service
  37477. project string
  37478. urlParams_ gensupport.URLParams
  37479. ifNoneMatch_ string
  37480. ctx_ context.Context
  37481. header_ http.Header
  37482. }
  37483. // AggregatedList: Retrieves an aggregated list of accelerator types.
  37484. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  37485. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37486. c.project = project
  37487. return c
  37488. }
  37489. // Filter sets the optional parameter "filter": A filter expression that
  37490. // filters resources listed in the response. The expression must specify
  37491. // the field name, a comparison operator, and the value that you want to
  37492. // use for filtering. The value must be a string, a number, or a
  37493. // boolean. The comparison operator must be either =, !=, >, or <.
  37494. //
  37495. // For example, if you are filtering Compute Engine instances, you can
  37496. // exclude instances named example-instance by specifying name !=
  37497. // example-instance.
  37498. //
  37499. // You can also filter nested fields. For example, you could specify
  37500. // scheduling.automaticRestart = false to include instances only if they
  37501. // are not scheduled for automatic restarts. You can use filtering on
  37502. // nested fields to filter based on resource labels.
  37503. //
  37504. // To filter on multiple expressions, provide each separate expression
  37505. // within parentheses. For example, (scheduling.automaticRestart = true)
  37506. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37507. // AND expression. However, you can include AND and OR expressions
  37508. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37509. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37510. // true).
  37511. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  37512. c.urlParams_.Set("filter", filter)
  37513. return c
  37514. }
  37515. // MaxResults sets the optional parameter "maxResults": The maximum
  37516. // number of results per page that should be returned. If the number of
  37517. // available results is larger than maxResults, Compute Engine returns a
  37518. // nextPageToken that can be used to get the next page of results in
  37519. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37520. // (Default: 500)
  37521. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  37522. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37523. return c
  37524. }
  37525. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37526. // a certain order. By default, results are returned in alphanumerical
  37527. // order based on the resource name.
  37528. //
  37529. // You can also sort results in descending order based on the creation
  37530. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37531. // based on the creationTimestamp field in reverse chronological order
  37532. // (newest result first). Use this to sort resources like operations so
  37533. // that the newest operation is returned first.
  37534. //
  37535. // Currently, only sorting by name or creationTimestamp desc is
  37536. // supported.
  37537. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  37538. c.urlParams_.Set("orderBy", orderBy)
  37539. return c
  37540. }
  37541. // PageToken sets the optional parameter "pageToken": Specifies a page
  37542. // token to use. Set pageToken to the nextPageToken returned by a
  37543. // previous list request to get the next page of results.
  37544. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  37545. c.urlParams_.Set("pageToken", pageToken)
  37546. return c
  37547. }
  37548. // Fields allows partial responses to be retrieved. See
  37549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37550. // for more information.
  37551. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  37552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37553. return c
  37554. }
  37555. // IfNoneMatch sets the optional parameter which makes the operation
  37556. // fail if the object's ETag matches the given value. This is useful for
  37557. // getting updates only after the object has changed since the last
  37558. // request. Use googleapi.IsNotModified to check whether the response
  37559. // error from Do is the result of In-None-Match.
  37560. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  37561. c.ifNoneMatch_ = entityTag
  37562. return c
  37563. }
  37564. // Context sets the context to be used in this call's Do method. Any
  37565. // pending HTTP request will be aborted if the provided context is
  37566. // canceled.
  37567. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  37568. c.ctx_ = ctx
  37569. return c
  37570. }
  37571. // Header returns an http.Header that can be modified by the caller to
  37572. // add HTTP headers to the request.
  37573. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  37574. if c.header_ == nil {
  37575. c.header_ = make(http.Header)
  37576. }
  37577. return c.header_
  37578. }
  37579. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  37580. reqHeaders := make(http.Header)
  37581. for k, v := range c.header_ {
  37582. reqHeaders[k] = v
  37583. }
  37584. reqHeaders.Set("User-Agent", c.s.userAgent())
  37585. if c.ifNoneMatch_ != "" {
  37586. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37587. }
  37588. var body io.Reader = nil
  37589. c.urlParams_.Set("alt", alt)
  37590. c.urlParams_.Set("prettyPrint", "false")
  37591. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  37592. urls += "?" + c.urlParams_.Encode()
  37593. req, err := http.NewRequest("GET", urls, body)
  37594. if err != nil {
  37595. return nil, err
  37596. }
  37597. req.Header = reqHeaders
  37598. googleapi.Expand(req.URL, map[string]string{
  37599. "project": c.project,
  37600. })
  37601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37602. }
  37603. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  37604. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  37605. // non-nil. Any non-2xx status code is an error. Response headers are in
  37606. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  37607. // response was returned at all) in error.(*googleapi.Error).Header. Use
  37608. // googleapi.IsNotModified to check whether the returned error was
  37609. // because http.StatusNotModified was returned.
  37610. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  37611. gensupport.SetOptions(c.urlParams_, opts...)
  37612. res, err := c.doRequest("json")
  37613. if res != nil && res.StatusCode == http.StatusNotModified {
  37614. if res.Body != nil {
  37615. res.Body.Close()
  37616. }
  37617. return nil, &googleapi.Error{
  37618. Code: res.StatusCode,
  37619. Header: res.Header,
  37620. }
  37621. }
  37622. if err != nil {
  37623. return nil, err
  37624. }
  37625. defer googleapi.CloseBody(res)
  37626. if err := googleapi.CheckResponse(res); err != nil {
  37627. return nil, err
  37628. }
  37629. ret := &AcceleratorTypeAggregatedList{
  37630. ServerResponse: googleapi.ServerResponse{
  37631. Header: res.Header,
  37632. HTTPStatusCode: res.StatusCode,
  37633. },
  37634. }
  37635. target := &ret
  37636. if err := gensupport.DecodeResponse(target, res); err != nil {
  37637. return nil, err
  37638. }
  37639. return ret, nil
  37640. // {
  37641. // "description": "Retrieves an aggregated list of accelerator types.",
  37642. // "httpMethod": "GET",
  37643. // "id": "compute.acceleratorTypes.aggregatedList",
  37644. // "parameterOrder": [
  37645. // "project"
  37646. // ],
  37647. // "parameters": {
  37648. // "filter": {
  37649. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  37650. // "location": "query",
  37651. // "type": "string"
  37652. // },
  37653. // "maxResults": {
  37654. // "default": "500",
  37655. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  37656. // "format": "uint32",
  37657. // "location": "query",
  37658. // "minimum": "0",
  37659. // "type": "integer"
  37660. // },
  37661. // "orderBy": {
  37662. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  37663. // "location": "query",
  37664. // "type": "string"
  37665. // },
  37666. // "pageToken": {
  37667. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  37668. // "location": "query",
  37669. // "type": "string"
  37670. // },
  37671. // "project": {
  37672. // "description": "Project ID for this request.",
  37673. // "location": "path",
  37674. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37675. // "required": true,
  37676. // "type": "string"
  37677. // }
  37678. // },
  37679. // "path": "{project}/aggregated/acceleratorTypes",
  37680. // "response": {
  37681. // "$ref": "AcceleratorTypeAggregatedList"
  37682. // },
  37683. // "scopes": [
  37684. // "https://www.googleapis.com/auth/cloud-platform",
  37685. // "https://www.googleapis.com/auth/compute",
  37686. // "https://www.googleapis.com/auth/compute.readonly"
  37687. // ]
  37688. // }
  37689. }
  37690. // Pages invokes f for each page of results.
  37691. // A non-nil error returned from f will halt the iteration.
  37692. // The provided context supersedes any context provided to the Context method.
  37693. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  37694. c.ctx_ = ctx
  37695. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37696. for {
  37697. x, err := c.Do()
  37698. if err != nil {
  37699. return err
  37700. }
  37701. if err := f(x); err != nil {
  37702. return err
  37703. }
  37704. if x.NextPageToken == "" {
  37705. return nil
  37706. }
  37707. c.PageToken(x.NextPageToken)
  37708. }
  37709. }
  37710. // method id "compute.acceleratorTypes.get":
  37711. type AcceleratorTypesGetCall struct {
  37712. s *Service
  37713. project string
  37714. zone string
  37715. acceleratorType string
  37716. urlParams_ gensupport.URLParams
  37717. ifNoneMatch_ string
  37718. ctx_ context.Context
  37719. header_ http.Header
  37720. }
  37721. // Get: Returns the specified accelerator type.
  37722. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  37723. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37724. c.project = project
  37725. c.zone = zone
  37726. c.acceleratorType = acceleratorType
  37727. return c
  37728. }
  37729. // Fields allows partial responses to be retrieved. See
  37730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37731. // for more information.
  37732. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  37733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37734. return c
  37735. }
  37736. // IfNoneMatch sets the optional parameter which makes the operation
  37737. // fail if the object's ETag matches the given value. This is useful for
  37738. // getting updates only after the object has changed since the last
  37739. // request. Use googleapi.IsNotModified to check whether the response
  37740. // error from Do is the result of In-None-Match.
  37741. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  37742. c.ifNoneMatch_ = entityTag
  37743. return c
  37744. }
  37745. // Context sets the context to be used in this call's Do method. Any
  37746. // pending HTTP request will be aborted if the provided context is
  37747. // canceled.
  37748. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  37749. c.ctx_ = ctx
  37750. return c
  37751. }
  37752. // Header returns an http.Header that can be modified by the caller to
  37753. // add HTTP headers to the request.
  37754. func (c *AcceleratorTypesGetCall) Header() http.Header {
  37755. if c.header_ == nil {
  37756. c.header_ = make(http.Header)
  37757. }
  37758. return c.header_
  37759. }
  37760. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  37761. reqHeaders := make(http.Header)
  37762. for k, v := range c.header_ {
  37763. reqHeaders[k] = v
  37764. }
  37765. reqHeaders.Set("User-Agent", c.s.userAgent())
  37766. if c.ifNoneMatch_ != "" {
  37767. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37768. }
  37769. var body io.Reader = nil
  37770. c.urlParams_.Set("alt", alt)
  37771. c.urlParams_.Set("prettyPrint", "false")
  37772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  37773. urls += "?" + c.urlParams_.Encode()
  37774. req, err := http.NewRequest("GET", urls, body)
  37775. if err != nil {
  37776. return nil, err
  37777. }
  37778. req.Header = reqHeaders
  37779. googleapi.Expand(req.URL, map[string]string{
  37780. "project": c.project,
  37781. "zone": c.zone,
  37782. "acceleratorType": c.acceleratorType,
  37783. })
  37784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37785. }
  37786. // Do executes the "compute.acceleratorTypes.get" call.
  37787. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  37788. // status code is an error. Response headers are in either
  37789. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  37790. // at all) in error.(*googleapi.Error).Header. Use
  37791. // googleapi.IsNotModified to check whether the returned error was
  37792. // because http.StatusNotModified was returned.
  37793. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  37794. gensupport.SetOptions(c.urlParams_, opts...)
  37795. res, err := c.doRequest("json")
  37796. if res != nil && res.StatusCode == http.StatusNotModified {
  37797. if res.Body != nil {
  37798. res.Body.Close()
  37799. }
  37800. return nil, &googleapi.Error{
  37801. Code: res.StatusCode,
  37802. Header: res.Header,
  37803. }
  37804. }
  37805. if err != nil {
  37806. return nil, err
  37807. }
  37808. defer googleapi.CloseBody(res)
  37809. if err := googleapi.CheckResponse(res); err != nil {
  37810. return nil, err
  37811. }
  37812. ret := &AcceleratorType{
  37813. ServerResponse: googleapi.ServerResponse{
  37814. Header: res.Header,
  37815. HTTPStatusCode: res.StatusCode,
  37816. },
  37817. }
  37818. target := &ret
  37819. if err := gensupport.DecodeResponse(target, res); err != nil {
  37820. return nil, err
  37821. }
  37822. return ret, nil
  37823. // {
  37824. // "description": "Returns the specified accelerator type.",
  37825. // "httpMethod": "GET",
  37826. // "id": "compute.acceleratorTypes.get",
  37827. // "parameterOrder": [
  37828. // "project",
  37829. // "zone",
  37830. // "acceleratorType"
  37831. // ],
  37832. // "parameters": {
  37833. // "acceleratorType": {
  37834. // "description": "Name of the accelerator type to return.",
  37835. // "location": "path",
  37836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37837. // "required": true,
  37838. // "type": "string"
  37839. // },
  37840. // "project": {
  37841. // "description": "Project ID for this request.",
  37842. // "location": "path",
  37843. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37844. // "required": true,
  37845. // "type": "string"
  37846. // },
  37847. // "zone": {
  37848. // "description": "The name of the zone for this request.",
  37849. // "location": "path",
  37850. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37851. // "required": true,
  37852. // "type": "string"
  37853. // }
  37854. // },
  37855. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  37856. // "response": {
  37857. // "$ref": "AcceleratorType"
  37858. // },
  37859. // "scopes": [
  37860. // "https://www.googleapis.com/auth/cloud-platform",
  37861. // "https://www.googleapis.com/auth/compute",
  37862. // "https://www.googleapis.com/auth/compute.readonly"
  37863. // ]
  37864. // }
  37865. }
  37866. // method id "compute.acceleratorTypes.list":
  37867. type AcceleratorTypesListCall struct {
  37868. s *Service
  37869. project string
  37870. zone string
  37871. urlParams_ gensupport.URLParams
  37872. ifNoneMatch_ string
  37873. ctx_ context.Context
  37874. header_ http.Header
  37875. }
  37876. // List: Retrieves a list of accelerator types available to the
  37877. // specified project.
  37878. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  37879. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37880. c.project = project
  37881. c.zone = zone
  37882. return c
  37883. }
  37884. // Filter sets the optional parameter "filter": A filter expression that
  37885. // filters resources listed in the response. The expression must specify
  37886. // the field name, a comparison operator, and the value that you want to
  37887. // use for filtering. The value must be a string, a number, or a
  37888. // boolean. The comparison operator must be either =, !=, >, or <.
  37889. //
  37890. // For example, if you are filtering Compute Engine instances, you can
  37891. // exclude instances named example-instance by specifying name !=
  37892. // example-instance.
  37893. //
  37894. // You can also filter nested fields. For example, you could specify
  37895. // scheduling.automaticRestart = false to include instances only if they
  37896. // are not scheduled for automatic restarts. You can use filtering on
  37897. // nested fields to filter based on resource labels.
  37898. //
  37899. // To filter on multiple expressions, provide each separate expression
  37900. // within parentheses. For example, (scheduling.automaticRestart = true)
  37901. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37902. // AND expression. However, you can include AND and OR expressions
  37903. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37904. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37905. // true).
  37906. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  37907. c.urlParams_.Set("filter", filter)
  37908. return c
  37909. }
  37910. // MaxResults sets the optional parameter "maxResults": The maximum
  37911. // number of results per page that should be returned. If the number of
  37912. // available results is larger than maxResults, Compute Engine returns a
  37913. // nextPageToken that can be used to get the next page of results in
  37914. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37915. // (Default: 500)
  37916. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  37917. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37918. return c
  37919. }
  37920. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37921. // a certain order. By default, results are returned in alphanumerical
  37922. // order based on the resource name.
  37923. //
  37924. // You can also sort results in descending order based on the creation
  37925. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37926. // based on the creationTimestamp field in reverse chronological order
  37927. // (newest result first). Use this to sort resources like operations so
  37928. // that the newest operation is returned first.
  37929. //
  37930. // Currently, only sorting by name or creationTimestamp desc is
  37931. // supported.
  37932. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  37933. c.urlParams_.Set("orderBy", orderBy)
  37934. return c
  37935. }
  37936. // PageToken sets the optional parameter "pageToken": Specifies a page
  37937. // token to use. Set pageToken to the nextPageToken returned by a
  37938. // previous list request to get the next page of results.
  37939. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  37940. c.urlParams_.Set("pageToken", pageToken)
  37941. return c
  37942. }
  37943. // Fields allows partial responses to be retrieved. See
  37944. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37945. // for more information.
  37946. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  37947. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37948. return c
  37949. }
  37950. // IfNoneMatch sets the optional parameter which makes the operation
  37951. // fail if the object's ETag matches the given value. This is useful for
  37952. // getting updates only after the object has changed since the last
  37953. // request. Use googleapi.IsNotModified to check whether the response
  37954. // error from Do is the result of In-None-Match.
  37955. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  37956. c.ifNoneMatch_ = entityTag
  37957. return c
  37958. }
  37959. // Context sets the context to be used in this call's Do method. Any
  37960. // pending HTTP request will be aborted if the provided context is
  37961. // canceled.
  37962. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  37963. c.ctx_ = ctx
  37964. return c
  37965. }
  37966. // Header returns an http.Header that can be modified by the caller to
  37967. // add HTTP headers to the request.
  37968. func (c *AcceleratorTypesListCall) Header() http.Header {
  37969. if c.header_ == nil {
  37970. c.header_ = make(http.Header)
  37971. }
  37972. return c.header_
  37973. }
  37974. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  37975. reqHeaders := make(http.Header)
  37976. for k, v := range c.header_ {
  37977. reqHeaders[k] = v
  37978. }
  37979. reqHeaders.Set("User-Agent", c.s.userAgent())
  37980. if c.ifNoneMatch_ != "" {
  37981. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37982. }
  37983. var body io.Reader = nil
  37984. c.urlParams_.Set("alt", alt)
  37985. c.urlParams_.Set("prettyPrint", "false")
  37986. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  37987. urls += "?" + c.urlParams_.Encode()
  37988. req, err := http.NewRequest("GET", urls, body)
  37989. if err != nil {
  37990. return nil, err
  37991. }
  37992. req.Header = reqHeaders
  37993. googleapi.Expand(req.URL, map[string]string{
  37994. "project": c.project,
  37995. "zone": c.zone,
  37996. })
  37997. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37998. }
  37999. // Do executes the "compute.acceleratorTypes.list" call.
  38000. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  38001. // non-2xx status code is an error. Response headers are in either
  38002. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  38003. // returned at all) in error.(*googleapi.Error).Header. Use
  38004. // googleapi.IsNotModified to check whether the returned error was
  38005. // because http.StatusNotModified was returned.
  38006. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  38007. gensupport.SetOptions(c.urlParams_, opts...)
  38008. res, err := c.doRequest("json")
  38009. if res != nil && res.StatusCode == http.StatusNotModified {
  38010. if res.Body != nil {
  38011. res.Body.Close()
  38012. }
  38013. return nil, &googleapi.Error{
  38014. Code: res.StatusCode,
  38015. Header: res.Header,
  38016. }
  38017. }
  38018. if err != nil {
  38019. return nil, err
  38020. }
  38021. defer googleapi.CloseBody(res)
  38022. if err := googleapi.CheckResponse(res); err != nil {
  38023. return nil, err
  38024. }
  38025. ret := &AcceleratorTypeList{
  38026. ServerResponse: googleapi.ServerResponse{
  38027. Header: res.Header,
  38028. HTTPStatusCode: res.StatusCode,
  38029. },
  38030. }
  38031. target := &ret
  38032. if err := gensupport.DecodeResponse(target, res); err != nil {
  38033. return nil, err
  38034. }
  38035. return ret, nil
  38036. // {
  38037. // "description": "Retrieves a list of accelerator types available to the specified project.",
  38038. // "httpMethod": "GET",
  38039. // "id": "compute.acceleratorTypes.list",
  38040. // "parameterOrder": [
  38041. // "project",
  38042. // "zone"
  38043. // ],
  38044. // "parameters": {
  38045. // "filter": {
  38046. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38047. // "location": "query",
  38048. // "type": "string"
  38049. // },
  38050. // "maxResults": {
  38051. // "default": "500",
  38052. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38053. // "format": "uint32",
  38054. // "location": "query",
  38055. // "minimum": "0",
  38056. // "type": "integer"
  38057. // },
  38058. // "orderBy": {
  38059. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38060. // "location": "query",
  38061. // "type": "string"
  38062. // },
  38063. // "pageToken": {
  38064. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38065. // "location": "query",
  38066. // "type": "string"
  38067. // },
  38068. // "project": {
  38069. // "description": "Project ID for this request.",
  38070. // "location": "path",
  38071. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38072. // "required": true,
  38073. // "type": "string"
  38074. // },
  38075. // "zone": {
  38076. // "description": "The name of the zone for this request.",
  38077. // "location": "path",
  38078. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38079. // "required": true,
  38080. // "type": "string"
  38081. // }
  38082. // },
  38083. // "path": "{project}/zones/{zone}/acceleratorTypes",
  38084. // "response": {
  38085. // "$ref": "AcceleratorTypeList"
  38086. // },
  38087. // "scopes": [
  38088. // "https://www.googleapis.com/auth/cloud-platform",
  38089. // "https://www.googleapis.com/auth/compute",
  38090. // "https://www.googleapis.com/auth/compute.readonly"
  38091. // ]
  38092. // }
  38093. }
  38094. // Pages invokes f for each page of results.
  38095. // A non-nil error returned from f will halt the iteration.
  38096. // The provided context supersedes any context provided to the Context method.
  38097. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  38098. c.ctx_ = ctx
  38099. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38100. for {
  38101. x, err := c.Do()
  38102. if err != nil {
  38103. return err
  38104. }
  38105. if err := f(x); err != nil {
  38106. return err
  38107. }
  38108. if x.NextPageToken == "" {
  38109. return nil
  38110. }
  38111. c.PageToken(x.NextPageToken)
  38112. }
  38113. }
  38114. // method id "compute.addresses.aggregatedList":
  38115. type AddressesAggregatedListCall struct {
  38116. s *Service
  38117. project string
  38118. urlParams_ gensupport.URLParams
  38119. ifNoneMatch_ string
  38120. ctx_ context.Context
  38121. header_ http.Header
  38122. }
  38123. // AggregatedList: Retrieves an aggregated list of addresses.
  38124. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  38125. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  38126. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38127. c.project = project
  38128. return c
  38129. }
  38130. // Filter sets the optional parameter "filter": A filter expression that
  38131. // filters resources listed in the response. The expression must specify
  38132. // the field name, a comparison operator, and the value that you want to
  38133. // use for filtering. The value must be a string, a number, or a
  38134. // boolean. The comparison operator must be either =, !=, >, or <.
  38135. //
  38136. // For example, if you are filtering Compute Engine instances, you can
  38137. // exclude instances named example-instance by specifying name !=
  38138. // example-instance.
  38139. //
  38140. // You can also filter nested fields. For example, you could specify
  38141. // scheduling.automaticRestart = false to include instances only if they
  38142. // are not scheduled for automatic restarts. You can use filtering on
  38143. // nested fields to filter based on resource labels.
  38144. //
  38145. // To filter on multiple expressions, provide each separate expression
  38146. // within parentheses. For example, (scheduling.automaticRestart = true)
  38147. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38148. // AND expression. However, you can include AND and OR expressions
  38149. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38150. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38151. // true).
  38152. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  38153. c.urlParams_.Set("filter", filter)
  38154. return c
  38155. }
  38156. // MaxResults sets the optional parameter "maxResults": The maximum
  38157. // number of results per page that should be returned. If the number of
  38158. // available results is larger than maxResults, Compute Engine returns a
  38159. // nextPageToken that can be used to get the next page of results in
  38160. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38161. // (Default: 500)
  38162. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  38163. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38164. return c
  38165. }
  38166. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38167. // a certain order. By default, results are returned in alphanumerical
  38168. // order based on the resource name.
  38169. //
  38170. // You can also sort results in descending order based on the creation
  38171. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38172. // based on the creationTimestamp field in reverse chronological order
  38173. // (newest result first). Use this to sort resources like operations so
  38174. // that the newest operation is returned first.
  38175. //
  38176. // Currently, only sorting by name or creationTimestamp desc is
  38177. // supported.
  38178. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  38179. c.urlParams_.Set("orderBy", orderBy)
  38180. return c
  38181. }
  38182. // PageToken sets the optional parameter "pageToken": Specifies a page
  38183. // token to use. Set pageToken to the nextPageToken returned by a
  38184. // previous list request to get the next page of results.
  38185. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  38186. c.urlParams_.Set("pageToken", pageToken)
  38187. return c
  38188. }
  38189. // Fields allows partial responses to be retrieved. See
  38190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38191. // for more information.
  38192. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  38193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38194. return c
  38195. }
  38196. // IfNoneMatch sets the optional parameter which makes the operation
  38197. // fail if the object's ETag matches the given value. This is useful for
  38198. // getting updates only after the object has changed since the last
  38199. // request. Use googleapi.IsNotModified to check whether the response
  38200. // error from Do is the result of In-None-Match.
  38201. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  38202. c.ifNoneMatch_ = entityTag
  38203. return c
  38204. }
  38205. // Context sets the context to be used in this call's Do method. Any
  38206. // pending HTTP request will be aborted if the provided context is
  38207. // canceled.
  38208. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  38209. c.ctx_ = ctx
  38210. return c
  38211. }
  38212. // Header returns an http.Header that can be modified by the caller to
  38213. // add HTTP headers to the request.
  38214. func (c *AddressesAggregatedListCall) Header() http.Header {
  38215. if c.header_ == nil {
  38216. c.header_ = make(http.Header)
  38217. }
  38218. return c.header_
  38219. }
  38220. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  38221. reqHeaders := make(http.Header)
  38222. for k, v := range c.header_ {
  38223. reqHeaders[k] = v
  38224. }
  38225. reqHeaders.Set("User-Agent", c.s.userAgent())
  38226. if c.ifNoneMatch_ != "" {
  38227. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38228. }
  38229. var body io.Reader = nil
  38230. c.urlParams_.Set("alt", alt)
  38231. c.urlParams_.Set("prettyPrint", "false")
  38232. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  38233. urls += "?" + c.urlParams_.Encode()
  38234. req, err := http.NewRequest("GET", urls, body)
  38235. if err != nil {
  38236. return nil, err
  38237. }
  38238. req.Header = reqHeaders
  38239. googleapi.Expand(req.URL, map[string]string{
  38240. "project": c.project,
  38241. })
  38242. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38243. }
  38244. // Do executes the "compute.addresses.aggregatedList" call.
  38245. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  38246. // non-2xx status code is an error. Response headers are in either
  38247. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  38248. // returned at all) in error.(*googleapi.Error).Header. Use
  38249. // googleapi.IsNotModified to check whether the returned error was
  38250. // because http.StatusNotModified was returned.
  38251. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  38252. gensupport.SetOptions(c.urlParams_, opts...)
  38253. res, err := c.doRequest("json")
  38254. if res != nil && res.StatusCode == http.StatusNotModified {
  38255. if res.Body != nil {
  38256. res.Body.Close()
  38257. }
  38258. return nil, &googleapi.Error{
  38259. Code: res.StatusCode,
  38260. Header: res.Header,
  38261. }
  38262. }
  38263. if err != nil {
  38264. return nil, err
  38265. }
  38266. defer googleapi.CloseBody(res)
  38267. if err := googleapi.CheckResponse(res); err != nil {
  38268. return nil, err
  38269. }
  38270. ret := &AddressAggregatedList{
  38271. ServerResponse: googleapi.ServerResponse{
  38272. Header: res.Header,
  38273. HTTPStatusCode: res.StatusCode,
  38274. },
  38275. }
  38276. target := &ret
  38277. if err := gensupport.DecodeResponse(target, res); err != nil {
  38278. return nil, err
  38279. }
  38280. return ret, nil
  38281. // {
  38282. // "description": "Retrieves an aggregated list of addresses.",
  38283. // "httpMethod": "GET",
  38284. // "id": "compute.addresses.aggregatedList",
  38285. // "parameterOrder": [
  38286. // "project"
  38287. // ],
  38288. // "parameters": {
  38289. // "filter": {
  38290. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38291. // "location": "query",
  38292. // "type": "string"
  38293. // },
  38294. // "maxResults": {
  38295. // "default": "500",
  38296. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38297. // "format": "uint32",
  38298. // "location": "query",
  38299. // "minimum": "0",
  38300. // "type": "integer"
  38301. // },
  38302. // "orderBy": {
  38303. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38304. // "location": "query",
  38305. // "type": "string"
  38306. // },
  38307. // "pageToken": {
  38308. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38309. // "location": "query",
  38310. // "type": "string"
  38311. // },
  38312. // "project": {
  38313. // "description": "Project ID for this request.",
  38314. // "location": "path",
  38315. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38316. // "required": true,
  38317. // "type": "string"
  38318. // }
  38319. // },
  38320. // "path": "{project}/aggregated/addresses",
  38321. // "response": {
  38322. // "$ref": "AddressAggregatedList"
  38323. // },
  38324. // "scopes": [
  38325. // "https://www.googleapis.com/auth/cloud-platform",
  38326. // "https://www.googleapis.com/auth/compute",
  38327. // "https://www.googleapis.com/auth/compute.readonly"
  38328. // ]
  38329. // }
  38330. }
  38331. // Pages invokes f for each page of results.
  38332. // A non-nil error returned from f will halt the iteration.
  38333. // The provided context supersedes any context provided to the Context method.
  38334. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  38335. c.ctx_ = ctx
  38336. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38337. for {
  38338. x, err := c.Do()
  38339. if err != nil {
  38340. return err
  38341. }
  38342. if err := f(x); err != nil {
  38343. return err
  38344. }
  38345. if x.NextPageToken == "" {
  38346. return nil
  38347. }
  38348. c.PageToken(x.NextPageToken)
  38349. }
  38350. }
  38351. // method id "compute.addresses.delete":
  38352. type AddressesDeleteCall struct {
  38353. s *Service
  38354. project string
  38355. region string
  38356. address string
  38357. urlParams_ gensupport.URLParams
  38358. ctx_ context.Context
  38359. header_ http.Header
  38360. }
  38361. // Delete: Deletes the specified address resource.
  38362. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  38363. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  38364. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38365. c.project = project
  38366. c.region = region
  38367. c.address = address
  38368. return c
  38369. }
  38370. // RequestId sets the optional parameter "requestId": An optional
  38371. // request ID to identify requests. Specify a unique request ID so that
  38372. // if you must retry your request, the server will know to ignore the
  38373. // request if it has already been completed.
  38374. //
  38375. // For example, consider a situation where you make an initial request
  38376. // and the request times out. If you make the request again with the
  38377. // same request ID, the server can check if original operation with the
  38378. // same request ID was received, and if so, will ignore the second
  38379. // request. This prevents clients from accidentally creating duplicate
  38380. // commitments.
  38381. //
  38382. // The request ID must be a valid UUID with the exception that zero UUID
  38383. // is not supported (00000000-0000-0000-0000-000000000000).
  38384. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  38385. c.urlParams_.Set("requestId", requestId)
  38386. return c
  38387. }
  38388. // Fields allows partial responses to be retrieved. See
  38389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38390. // for more information.
  38391. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  38392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38393. return c
  38394. }
  38395. // Context sets the context to be used in this call's Do method. Any
  38396. // pending HTTP request will be aborted if the provided context is
  38397. // canceled.
  38398. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  38399. c.ctx_ = ctx
  38400. return c
  38401. }
  38402. // Header returns an http.Header that can be modified by the caller to
  38403. // add HTTP headers to the request.
  38404. func (c *AddressesDeleteCall) Header() http.Header {
  38405. if c.header_ == nil {
  38406. c.header_ = make(http.Header)
  38407. }
  38408. return c.header_
  38409. }
  38410. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  38411. reqHeaders := make(http.Header)
  38412. for k, v := range c.header_ {
  38413. reqHeaders[k] = v
  38414. }
  38415. reqHeaders.Set("User-Agent", c.s.userAgent())
  38416. var body io.Reader = nil
  38417. c.urlParams_.Set("alt", alt)
  38418. c.urlParams_.Set("prettyPrint", "false")
  38419. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  38420. urls += "?" + c.urlParams_.Encode()
  38421. req, err := http.NewRequest("DELETE", urls, body)
  38422. if err != nil {
  38423. return nil, err
  38424. }
  38425. req.Header = reqHeaders
  38426. googleapi.Expand(req.URL, map[string]string{
  38427. "project": c.project,
  38428. "region": c.region,
  38429. "address": c.address,
  38430. })
  38431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38432. }
  38433. // Do executes the "compute.addresses.delete" call.
  38434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38435. // status code is an error. Response headers are in either
  38436. // *Operation.ServerResponse.Header or (if a response was returned at
  38437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38438. // to check whether the returned error was because
  38439. // http.StatusNotModified was returned.
  38440. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38441. gensupport.SetOptions(c.urlParams_, opts...)
  38442. res, err := c.doRequest("json")
  38443. if res != nil && res.StatusCode == http.StatusNotModified {
  38444. if res.Body != nil {
  38445. res.Body.Close()
  38446. }
  38447. return nil, &googleapi.Error{
  38448. Code: res.StatusCode,
  38449. Header: res.Header,
  38450. }
  38451. }
  38452. if err != nil {
  38453. return nil, err
  38454. }
  38455. defer googleapi.CloseBody(res)
  38456. if err := googleapi.CheckResponse(res); err != nil {
  38457. return nil, err
  38458. }
  38459. ret := &Operation{
  38460. ServerResponse: googleapi.ServerResponse{
  38461. Header: res.Header,
  38462. HTTPStatusCode: res.StatusCode,
  38463. },
  38464. }
  38465. target := &ret
  38466. if err := gensupport.DecodeResponse(target, res); err != nil {
  38467. return nil, err
  38468. }
  38469. return ret, nil
  38470. // {
  38471. // "description": "Deletes the specified address resource.",
  38472. // "httpMethod": "DELETE",
  38473. // "id": "compute.addresses.delete",
  38474. // "parameterOrder": [
  38475. // "project",
  38476. // "region",
  38477. // "address"
  38478. // ],
  38479. // "parameters": {
  38480. // "address": {
  38481. // "description": "Name of the address resource to delete.",
  38482. // "location": "path",
  38483. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38484. // "required": true,
  38485. // "type": "string"
  38486. // },
  38487. // "project": {
  38488. // "description": "Project ID for this request.",
  38489. // "location": "path",
  38490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38491. // "required": true,
  38492. // "type": "string"
  38493. // },
  38494. // "region": {
  38495. // "description": "Name of the region for this request.",
  38496. // "location": "path",
  38497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38498. // "required": true,
  38499. // "type": "string"
  38500. // },
  38501. // "requestId": {
  38502. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38503. // "location": "query",
  38504. // "type": "string"
  38505. // }
  38506. // },
  38507. // "path": "{project}/regions/{region}/addresses/{address}",
  38508. // "response": {
  38509. // "$ref": "Operation"
  38510. // },
  38511. // "scopes": [
  38512. // "https://www.googleapis.com/auth/cloud-platform",
  38513. // "https://www.googleapis.com/auth/compute"
  38514. // ]
  38515. // }
  38516. }
  38517. // method id "compute.addresses.get":
  38518. type AddressesGetCall struct {
  38519. s *Service
  38520. project string
  38521. region string
  38522. address string
  38523. urlParams_ gensupport.URLParams
  38524. ifNoneMatch_ string
  38525. ctx_ context.Context
  38526. header_ http.Header
  38527. }
  38528. // Get: Returns the specified address resource.
  38529. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  38530. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  38531. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38532. c.project = project
  38533. c.region = region
  38534. c.address = address
  38535. return c
  38536. }
  38537. // Fields allows partial responses to be retrieved. See
  38538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38539. // for more information.
  38540. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  38541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38542. return c
  38543. }
  38544. // IfNoneMatch sets the optional parameter which makes the operation
  38545. // fail if the object's ETag matches the given value. This is useful for
  38546. // getting updates only after the object has changed since the last
  38547. // request. Use googleapi.IsNotModified to check whether the response
  38548. // error from Do is the result of In-None-Match.
  38549. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  38550. c.ifNoneMatch_ = entityTag
  38551. return c
  38552. }
  38553. // Context sets the context to be used in this call's Do method. Any
  38554. // pending HTTP request will be aborted if the provided context is
  38555. // canceled.
  38556. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  38557. c.ctx_ = ctx
  38558. return c
  38559. }
  38560. // Header returns an http.Header that can be modified by the caller to
  38561. // add HTTP headers to the request.
  38562. func (c *AddressesGetCall) Header() http.Header {
  38563. if c.header_ == nil {
  38564. c.header_ = make(http.Header)
  38565. }
  38566. return c.header_
  38567. }
  38568. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  38569. reqHeaders := make(http.Header)
  38570. for k, v := range c.header_ {
  38571. reqHeaders[k] = v
  38572. }
  38573. reqHeaders.Set("User-Agent", c.s.userAgent())
  38574. if c.ifNoneMatch_ != "" {
  38575. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38576. }
  38577. var body io.Reader = nil
  38578. c.urlParams_.Set("alt", alt)
  38579. c.urlParams_.Set("prettyPrint", "false")
  38580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  38581. urls += "?" + c.urlParams_.Encode()
  38582. req, err := http.NewRequest("GET", urls, body)
  38583. if err != nil {
  38584. return nil, err
  38585. }
  38586. req.Header = reqHeaders
  38587. googleapi.Expand(req.URL, map[string]string{
  38588. "project": c.project,
  38589. "region": c.region,
  38590. "address": c.address,
  38591. })
  38592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38593. }
  38594. // Do executes the "compute.addresses.get" call.
  38595. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  38596. // code is an error. Response headers are in either
  38597. // *Address.ServerResponse.Header or (if a response was returned at all)
  38598. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38599. // check whether the returned error was because http.StatusNotModified
  38600. // was returned.
  38601. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  38602. gensupport.SetOptions(c.urlParams_, opts...)
  38603. res, err := c.doRequest("json")
  38604. if res != nil && res.StatusCode == http.StatusNotModified {
  38605. if res.Body != nil {
  38606. res.Body.Close()
  38607. }
  38608. return nil, &googleapi.Error{
  38609. Code: res.StatusCode,
  38610. Header: res.Header,
  38611. }
  38612. }
  38613. if err != nil {
  38614. return nil, err
  38615. }
  38616. defer googleapi.CloseBody(res)
  38617. if err := googleapi.CheckResponse(res); err != nil {
  38618. return nil, err
  38619. }
  38620. ret := &Address{
  38621. ServerResponse: googleapi.ServerResponse{
  38622. Header: res.Header,
  38623. HTTPStatusCode: res.StatusCode,
  38624. },
  38625. }
  38626. target := &ret
  38627. if err := gensupport.DecodeResponse(target, res); err != nil {
  38628. return nil, err
  38629. }
  38630. return ret, nil
  38631. // {
  38632. // "description": "Returns the specified address resource.",
  38633. // "httpMethod": "GET",
  38634. // "id": "compute.addresses.get",
  38635. // "parameterOrder": [
  38636. // "project",
  38637. // "region",
  38638. // "address"
  38639. // ],
  38640. // "parameters": {
  38641. // "address": {
  38642. // "description": "Name of the address resource to return.",
  38643. // "location": "path",
  38644. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38645. // "required": true,
  38646. // "type": "string"
  38647. // },
  38648. // "project": {
  38649. // "description": "Project ID for this request.",
  38650. // "location": "path",
  38651. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38652. // "required": true,
  38653. // "type": "string"
  38654. // },
  38655. // "region": {
  38656. // "description": "Name of the region for this request.",
  38657. // "location": "path",
  38658. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38659. // "required": true,
  38660. // "type": "string"
  38661. // }
  38662. // },
  38663. // "path": "{project}/regions/{region}/addresses/{address}",
  38664. // "response": {
  38665. // "$ref": "Address"
  38666. // },
  38667. // "scopes": [
  38668. // "https://www.googleapis.com/auth/cloud-platform",
  38669. // "https://www.googleapis.com/auth/compute",
  38670. // "https://www.googleapis.com/auth/compute.readonly"
  38671. // ]
  38672. // }
  38673. }
  38674. // method id "compute.addresses.insert":
  38675. type AddressesInsertCall struct {
  38676. s *Service
  38677. project string
  38678. region string
  38679. address *Address
  38680. urlParams_ gensupport.URLParams
  38681. ctx_ context.Context
  38682. header_ http.Header
  38683. }
  38684. // Insert: Creates an address resource in the specified project using
  38685. // the data included in the request.
  38686. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  38687. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  38688. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38689. c.project = project
  38690. c.region = region
  38691. c.address = address
  38692. return c
  38693. }
  38694. // RequestId sets the optional parameter "requestId": An optional
  38695. // request ID to identify requests. Specify a unique request ID so that
  38696. // if you must retry your request, the server will know to ignore the
  38697. // request if it has already been completed.
  38698. //
  38699. // For example, consider a situation where you make an initial request
  38700. // and the request times out. If you make the request again with the
  38701. // same request ID, the server can check if original operation with the
  38702. // same request ID was received, and if so, will ignore the second
  38703. // request. This prevents clients from accidentally creating duplicate
  38704. // commitments.
  38705. //
  38706. // The request ID must be a valid UUID with the exception that zero UUID
  38707. // is not supported (00000000-0000-0000-0000-000000000000).
  38708. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  38709. c.urlParams_.Set("requestId", requestId)
  38710. return c
  38711. }
  38712. // Fields allows partial responses to be retrieved. See
  38713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38714. // for more information.
  38715. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  38716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38717. return c
  38718. }
  38719. // Context sets the context to be used in this call's Do method. Any
  38720. // pending HTTP request will be aborted if the provided context is
  38721. // canceled.
  38722. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  38723. c.ctx_ = ctx
  38724. return c
  38725. }
  38726. // Header returns an http.Header that can be modified by the caller to
  38727. // add HTTP headers to the request.
  38728. func (c *AddressesInsertCall) Header() http.Header {
  38729. if c.header_ == nil {
  38730. c.header_ = make(http.Header)
  38731. }
  38732. return c.header_
  38733. }
  38734. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  38735. reqHeaders := make(http.Header)
  38736. for k, v := range c.header_ {
  38737. reqHeaders[k] = v
  38738. }
  38739. reqHeaders.Set("User-Agent", c.s.userAgent())
  38740. var body io.Reader = nil
  38741. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  38742. if err != nil {
  38743. return nil, err
  38744. }
  38745. reqHeaders.Set("Content-Type", "application/json")
  38746. c.urlParams_.Set("alt", alt)
  38747. c.urlParams_.Set("prettyPrint", "false")
  38748. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  38749. urls += "?" + c.urlParams_.Encode()
  38750. req, err := http.NewRequest("POST", urls, body)
  38751. if err != nil {
  38752. return nil, err
  38753. }
  38754. req.Header = reqHeaders
  38755. googleapi.Expand(req.URL, map[string]string{
  38756. "project": c.project,
  38757. "region": c.region,
  38758. })
  38759. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38760. }
  38761. // Do executes the "compute.addresses.insert" call.
  38762. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38763. // status code is an error. Response headers are in either
  38764. // *Operation.ServerResponse.Header or (if a response was returned at
  38765. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38766. // to check whether the returned error was because
  38767. // http.StatusNotModified was returned.
  38768. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38769. gensupport.SetOptions(c.urlParams_, opts...)
  38770. res, err := c.doRequest("json")
  38771. if res != nil && res.StatusCode == http.StatusNotModified {
  38772. if res.Body != nil {
  38773. res.Body.Close()
  38774. }
  38775. return nil, &googleapi.Error{
  38776. Code: res.StatusCode,
  38777. Header: res.Header,
  38778. }
  38779. }
  38780. if err != nil {
  38781. return nil, err
  38782. }
  38783. defer googleapi.CloseBody(res)
  38784. if err := googleapi.CheckResponse(res); err != nil {
  38785. return nil, err
  38786. }
  38787. ret := &Operation{
  38788. ServerResponse: googleapi.ServerResponse{
  38789. Header: res.Header,
  38790. HTTPStatusCode: res.StatusCode,
  38791. },
  38792. }
  38793. target := &ret
  38794. if err := gensupport.DecodeResponse(target, res); err != nil {
  38795. return nil, err
  38796. }
  38797. return ret, nil
  38798. // {
  38799. // "description": "Creates an address resource in the specified project using the data included in the request.",
  38800. // "httpMethod": "POST",
  38801. // "id": "compute.addresses.insert",
  38802. // "parameterOrder": [
  38803. // "project",
  38804. // "region"
  38805. // ],
  38806. // "parameters": {
  38807. // "project": {
  38808. // "description": "Project ID for this request.",
  38809. // "location": "path",
  38810. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38811. // "required": true,
  38812. // "type": "string"
  38813. // },
  38814. // "region": {
  38815. // "description": "Name of the region for this request.",
  38816. // "location": "path",
  38817. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38818. // "required": true,
  38819. // "type": "string"
  38820. // },
  38821. // "requestId": {
  38822. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38823. // "location": "query",
  38824. // "type": "string"
  38825. // }
  38826. // },
  38827. // "path": "{project}/regions/{region}/addresses",
  38828. // "request": {
  38829. // "$ref": "Address"
  38830. // },
  38831. // "response": {
  38832. // "$ref": "Operation"
  38833. // },
  38834. // "scopes": [
  38835. // "https://www.googleapis.com/auth/cloud-platform",
  38836. // "https://www.googleapis.com/auth/compute"
  38837. // ]
  38838. // }
  38839. }
  38840. // method id "compute.addresses.list":
  38841. type AddressesListCall struct {
  38842. s *Service
  38843. project string
  38844. region string
  38845. urlParams_ gensupport.URLParams
  38846. ifNoneMatch_ string
  38847. ctx_ context.Context
  38848. header_ http.Header
  38849. }
  38850. // List: Retrieves a list of addresses contained within the specified
  38851. // region.
  38852. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  38853. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  38854. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38855. c.project = project
  38856. c.region = region
  38857. return c
  38858. }
  38859. // Filter sets the optional parameter "filter": A filter expression that
  38860. // filters resources listed in the response. The expression must specify
  38861. // the field name, a comparison operator, and the value that you want to
  38862. // use for filtering. The value must be a string, a number, or a
  38863. // boolean. The comparison operator must be either =, !=, >, or <.
  38864. //
  38865. // For example, if you are filtering Compute Engine instances, you can
  38866. // exclude instances named example-instance by specifying name !=
  38867. // example-instance.
  38868. //
  38869. // You can also filter nested fields. For example, you could specify
  38870. // scheduling.automaticRestart = false to include instances only if they
  38871. // are not scheduled for automatic restarts. You can use filtering on
  38872. // nested fields to filter based on resource labels.
  38873. //
  38874. // To filter on multiple expressions, provide each separate expression
  38875. // within parentheses. For example, (scheduling.automaticRestart = true)
  38876. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38877. // AND expression. However, you can include AND and OR expressions
  38878. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38879. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38880. // true).
  38881. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  38882. c.urlParams_.Set("filter", filter)
  38883. return c
  38884. }
  38885. // MaxResults sets the optional parameter "maxResults": The maximum
  38886. // number of results per page that should be returned. If the number of
  38887. // available results is larger than maxResults, Compute Engine returns a
  38888. // nextPageToken that can be used to get the next page of results in
  38889. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38890. // (Default: 500)
  38891. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  38892. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38893. return c
  38894. }
  38895. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38896. // a certain order. By default, results are returned in alphanumerical
  38897. // order based on the resource name.
  38898. //
  38899. // You can also sort results in descending order based on the creation
  38900. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38901. // based on the creationTimestamp field in reverse chronological order
  38902. // (newest result first). Use this to sort resources like operations so
  38903. // that the newest operation is returned first.
  38904. //
  38905. // Currently, only sorting by name or creationTimestamp desc is
  38906. // supported.
  38907. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  38908. c.urlParams_.Set("orderBy", orderBy)
  38909. return c
  38910. }
  38911. // PageToken sets the optional parameter "pageToken": Specifies a page
  38912. // token to use. Set pageToken to the nextPageToken returned by a
  38913. // previous list request to get the next page of results.
  38914. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  38915. c.urlParams_.Set("pageToken", pageToken)
  38916. return c
  38917. }
  38918. // Fields allows partial responses to be retrieved. See
  38919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38920. // for more information.
  38921. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  38922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38923. return c
  38924. }
  38925. // IfNoneMatch sets the optional parameter which makes the operation
  38926. // fail if the object's ETag matches the given value. This is useful for
  38927. // getting updates only after the object has changed since the last
  38928. // request. Use googleapi.IsNotModified to check whether the response
  38929. // error from Do is the result of In-None-Match.
  38930. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  38931. c.ifNoneMatch_ = entityTag
  38932. return c
  38933. }
  38934. // Context sets the context to be used in this call's Do method. Any
  38935. // pending HTTP request will be aborted if the provided context is
  38936. // canceled.
  38937. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  38938. c.ctx_ = ctx
  38939. return c
  38940. }
  38941. // Header returns an http.Header that can be modified by the caller to
  38942. // add HTTP headers to the request.
  38943. func (c *AddressesListCall) Header() http.Header {
  38944. if c.header_ == nil {
  38945. c.header_ = make(http.Header)
  38946. }
  38947. return c.header_
  38948. }
  38949. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  38950. reqHeaders := make(http.Header)
  38951. for k, v := range c.header_ {
  38952. reqHeaders[k] = v
  38953. }
  38954. reqHeaders.Set("User-Agent", c.s.userAgent())
  38955. if c.ifNoneMatch_ != "" {
  38956. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38957. }
  38958. var body io.Reader = nil
  38959. c.urlParams_.Set("alt", alt)
  38960. c.urlParams_.Set("prettyPrint", "false")
  38961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  38962. urls += "?" + c.urlParams_.Encode()
  38963. req, err := http.NewRequest("GET", urls, body)
  38964. if err != nil {
  38965. return nil, err
  38966. }
  38967. req.Header = reqHeaders
  38968. googleapi.Expand(req.URL, map[string]string{
  38969. "project": c.project,
  38970. "region": c.region,
  38971. })
  38972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38973. }
  38974. // Do executes the "compute.addresses.list" call.
  38975. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  38976. // status code is an error. Response headers are in either
  38977. // *AddressList.ServerResponse.Header or (if a response was returned at
  38978. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38979. // to check whether the returned error was because
  38980. // http.StatusNotModified was returned.
  38981. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  38982. gensupport.SetOptions(c.urlParams_, opts...)
  38983. res, err := c.doRequest("json")
  38984. if res != nil && res.StatusCode == http.StatusNotModified {
  38985. if res.Body != nil {
  38986. res.Body.Close()
  38987. }
  38988. return nil, &googleapi.Error{
  38989. Code: res.StatusCode,
  38990. Header: res.Header,
  38991. }
  38992. }
  38993. if err != nil {
  38994. return nil, err
  38995. }
  38996. defer googleapi.CloseBody(res)
  38997. if err := googleapi.CheckResponse(res); err != nil {
  38998. return nil, err
  38999. }
  39000. ret := &AddressList{
  39001. ServerResponse: googleapi.ServerResponse{
  39002. Header: res.Header,
  39003. HTTPStatusCode: res.StatusCode,
  39004. },
  39005. }
  39006. target := &ret
  39007. if err := gensupport.DecodeResponse(target, res); err != nil {
  39008. return nil, err
  39009. }
  39010. return ret, nil
  39011. // {
  39012. // "description": "Retrieves a list of addresses contained within the specified region.",
  39013. // "httpMethod": "GET",
  39014. // "id": "compute.addresses.list",
  39015. // "parameterOrder": [
  39016. // "project",
  39017. // "region"
  39018. // ],
  39019. // "parameters": {
  39020. // "filter": {
  39021. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39022. // "location": "query",
  39023. // "type": "string"
  39024. // },
  39025. // "maxResults": {
  39026. // "default": "500",
  39027. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39028. // "format": "uint32",
  39029. // "location": "query",
  39030. // "minimum": "0",
  39031. // "type": "integer"
  39032. // },
  39033. // "orderBy": {
  39034. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39035. // "location": "query",
  39036. // "type": "string"
  39037. // },
  39038. // "pageToken": {
  39039. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39040. // "location": "query",
  39041. // "type": "string"
  39042. // },
  39043. // "project": {
  39044. // "description": "Project ID for this request.",
  39045. // "location": "path",
  39046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39047. // "required": true,
  39048. // "type": "string"
  39049. // },
  39050. // "region": {
  39051. // "description": "Name of the region for this request.",
  39052. // "location": "path",
  39053. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39054. // "required": true,
  39055. // "type": "string"
  39056. // }
  39057. // },
  39058. // "path": "{project}/regions/{region}/addresses",
  39059. // "response": {
  39060. // "$ref": "AddressList"
  39061. // },
  39062. // "scopes": [
  39063. // "https://www.googleapis.com/auth/cloud-platform",
  39064. // "https://www.googleapis.com/auth/compute",
  39065. // "https://www.googleapis.com/auth/compute.readonly"
  39066. // ]
  39067. // }
  39068. }
  39069. // Pages invokes f for each page of results.
  39070. // A non-nil error returned from f will halt the iteration.
  39071. // The provided context supersedes any context provided to the Context method.
  39072. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  39073. c.ctx_ = ctx
  39074. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39075. for {
  39076. x, err := c.Do()
  39077. if err != nil {
  39078. return err
  39079. }
  39080. if err := f(x); err != nil {
  39081. return err
  39082. }
  39083. if x.NextPageToken == "" {
  39084. return nil
  39085. }
  39086. c.PageToken(x.NextPageToken)
  39087. }
  39088. }
  39089. // method id "compute.addresses.setLabels":
  39090. type AddressesSetLabelsCall struct {
  39091. s *Service
  39092. project string
  39093. region string
  39094. resource string
  39095. regionsetlabelsrequest *RegionSetLabelsRequest
  39096. urlParams_ gensupport.URLParams
  39097. ctx_ context.Context
  39098. header_ http.Header
  39099. }
  39100. // SetLabels: Sets the labels on an Address. To learn more about labels,
  39101. // read the Labeling Resources documentation.
  39102. func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
  39103. c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39104. c.project = project
  39105. c.region = region
  39106. c.resource = resource
  39107. c.regionsetlabelsrequest = regionsetlabelsrequest
  39108. return c
  39109. }
  39110. // RequestId sets the optional parameter "requestId": An optional
  39111. // request ID to identify requests. Specify a unique request ID so that
  39112. // if you must retry your request, the server will know to ignore the
  39113. // request if it has already been completed.
  39114. //
  39115. // For example, consider a situation where you make an initial request
  39116. // and the request times out. If you make the request again with the
  39117. // same request ID, the server can check if original operation with the
  39118. // same request ID was received, and if so, will ignore the second
  39119. // request. This prevents clients from accidentally creating duplicate
  39120. // commitments.
  39121. //
  39122. // The request ID must be a valid UUID with the exception that zero UUID
  39123. // is not supported (00000000-0000-0000-0000-000000000000).
  39124. func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
  39125. c.urlParams_.Set("requestId", requestId)
  39126. return c
  39127. }
  39128. // Fields allows partial responses to be retrieved. See
  39129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39130. // for more information.
  39131. func (c *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
  39132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39133. return c
  39134. }
  39135. // Context sets the context to be used in this call's Do method. Any
  39136. // pending HTTP request will be aborted if the provided context is
  39137. // canceled.
  39138. func (c *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
  39139. c.ctx_ = ctx
  39140. return c
  39141. }
  39142. // Header returns an http.Header that can be modified by the caller to
  39143. // add HTTP headers to the request.
  39144. func (c *AddressesSetLabelsCall) Header() http.Header {
  39145. if c.header_ == nil {
  39146. c.header_ = make(http.Header)
  39147. }
  39148. return c.header_
  39149. }
  39150. func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  39151. reqHeaders := make(http.Header)
  39152. for k, v := range c.header_ {
  39153. reqHeaders[k] = v
  39154. }
  39155. reqHeaders.Set("User-Agent", c.s.userAgent())
  39156. var body io.Reader = nil
  39157. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  39158. if err != nil {
  39159. return nil, err
  39160. }
  39161. reqHeaders.Set("Content-Type", "application/json")
  39162. c.urlParams_.Set("alt", alt)
  39163. c.urlParams_.Set("prettyPrint", "false")
  39164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/setLabels")
  39165. urls += "?" + c.urlParams_.Encode()
  39166. req, err := http.NewRequest("POST", urls, body)
  39167. if err != nil {
  39168. return nil, err
  39169. }
  39170. req.Header = reqHeaders
  39171. googleapi.Expand(req.URL, map[string]string{
  39172. "project": c.project,
  39173. "region": c.region,
  39174. "resource": c.resource,
  39175. })
  39176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39177. }
  39178. // Do executes the "compute.addresses.setLabels" call.
  39179. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39180. // status code is an error. Response headers are in either
  39181. // *Operation.ServerResponse.Header or (if a response was returned at
  39182. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39183. // to check whether the returned error was because
  39184. // http.StatusNotModified was returned.
  39185. func (c *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39186. gensupport.SetOptions(c.urlParams_, opts...)
  39187. res, err := c.doRequest("json")
  39188. if res != nil && res.StatusCode == http.StatusNotModified {
  39189. if res.Body != nil {
  39190. res.Body.Close()
  39191. }
  39192. return nil, &googleapi.Error{
  39193. Code: res.StatusCode,
  39194. Header: res.Header,
  39195. }
  39196. }
  39197. if err != nil {
  39198. return nil, err
  39199. }
  39200. defer googleapi.CloseBody(res)
  39201. if err := googleapi.CheckResponse(res); err != nil {
  39202. return nil, err
  39203. }
  39204. ret := &Operation{
  39205. ServerResponse: googleapi.ServerResponse{
  39206. Header: res.Header,
  39207. HTTPStatusCode: res.StatusCode,
  39208. },
  39209. }
  39210. target := &ret
  39211. if err := gensupport.DecodeResponse(target, res); err != nil {
  39212. return nil, err
  39213. }
  39214. return ret, nil
  39215. // {
  39216. // "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.",
  39217. // "httpMethod": "POST",
  39218. // "id": "compute.addresses.setLabels",
  39219. // "parameterOrder": [
  39220. // "project",
  39221. // "region",
  39222. // "resource"
  39223. // ],
  39224. // "parameters": {
  39225. // "project": {
  39226. // "description": "Project ID for this request.",
  39227. // "location": "path",
  39228. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39229. // "required": true,
  39230. // "type": "string"
  39231. // },
  39232. // "region": {
  39233. // "description": "The region for this request.",
  39234. // "location": "path",
  39235. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39236. // "required": true,
  39237. // "type": "string"
  39238. // },
  39239. // "requestId": {
  39240. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39241. // "location": "query",
  39242. // "type": "string"
  39243. // },
  39244. // "resource": {
  39245. // "description": "Name or id of the resource for this request.",
  39246. // "location": "path",
  39247. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39248. // "required": true,
  39249. // "type": "string"
  39250. // }
  39251. // },
  39252. // "path": "{project}/regions/{region}/addresses/{resource}/setLabels",
  39253. // "request": {
  39254. // "$ref": "RegionSetLabelsRequest"
  39255. // },
  39256. // "response": {
  39257. // "$ref": "Operation"
  39258. // },
  39259. // "scopes": [
  39260. // "https://www.googleapis.com/auth/cloud-platform",
  39261. // "https://www.googleapis.com/auth/compute"
  39262. // ]
  39263. // }
  39264. }
  39265. // method id "compute.addresses.testIamPermissions":
  39266. type AddressesTestIamPermissionsCall struct {
  39267. s *Service
  39268. project string
  39269. region string
  39270. resource string
  39271. testpermissionsrequest *TestPermissionsRequest
  39272. urlParams_ gensupport.URLParams
  39273. ctx_ context.Context
  39274. header_ http.Header
  39275. }
  39276. // TestIamPermissions: Returns permissions that a caller has on the
  39277. // specified resource.
  39278. func (r *AddressesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *AddressesTestIamPermissionsCall {
  39279. c := &AddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39280. c.project = project
  39281. c.region = region
  39282. c.resource = resource
  39283. c.testpermissionsrequest = testpermissionsrequest
  39284. return c
  39285. }
  39286. // Fields allows partial responses to be retrieved. See
  39287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39288. // for more information.
  39289. func (c *AddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *AddressesTestIamPermissionsCall {
  39290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39291. return c
  39292. }
  39293. // Context sets the context to be used in this call's Do method. Any
  39294. // pending HTTP request will be aborted if the provided context is
  39295. // canceled.
  39296. func (c *AddressesTestIamPermissionsCall) Context(ctx context.Context) *AddressesTestIamPermissionsCall {
  39297. c.ctx_ = ctx
  39298. return c
  39299. }
  39300. // Header returns an http.Header that can be modified by the caller to
  39301. // add HTTP headers to the request.
  39302. func (c *AddressesTestIamPermissionsCall) Header() http.Header {
  39303. if c.header_ == nil {
  39304. c.header_ = make(http.Header)
  39305. }
  39306. return c.header_
  39307. }
  39308. func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  39309. reqHeaders := make(http.Header)
  39310. for k, v := range c.header_ {
  39311. reqHeaders[k] = v
  39312. }
  39313. reqHeaders.Set("User-Agent", c.s.userAgent())
  39314. var body io.Reader = nil
  39315. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  39316. if err != nil {
  39317. return nil, err
  39318. }
  39319. reqHeaders.Set("Content-Type", "application/json")
  39320. c.urlParams_.Set("alt", alt)
  39321. c.urlParams_.Set("prettyPrint", "false")
  39322. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/testIamPermissions")
  39323. urls += "?" + c.urlParams_.Encode()
  39324. req, err := http.NewRequest("POST", urls, body)
  39325. if err != nil {
  39326. return nil, err
  39327. }
  39328. req.Header = reqHeaders
  39329. googleapi.Expand(req.URL, map[string]string{
  39330. "project": c.project,
  39331. "region": c.region,
  39332. "resource": c.resource,
  39333. })
  39334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39335. }
  39336. // Do executes the "compute.addresses.testIamPermissions" call.
  39337. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  39338. // non-2xx status code is an error. Response headers are in either
  39339. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  39340. // returned at all) in error.(*googleapi.Error).Header. Use
  39341. // googleapi.IsNotModified to check whether the returned error was
  39342. // because http.StatusNotModified was returned.
  39343. func (c *AddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  39344. gensupport.SetOptions(c.urlParams_, opts...)
  39345. res, err := c.doRequest("json")
  39346. if res != nil && res.StatusCode == http.StatusNotModified {
  39347. if res.Body != nil {
  39348. res.Body.Close()
  39349. }
  39350. return nil, &googleapi.Error{
  39351. Code: res.StatusCode,
  39352. Header: res.Header,
  39353. }
  39354. }
  39355. if err != nil {
  39356. return nil, err
  39357. }
  39358. defer googleapi.CloseBody(res)
  39359. if err := googleapi.CheckResponse(res); err != nil {
  39360. return nil, err
  39361. }
  39362. ret := &TestPermissionsResponse{
  39363. ServerResponse: googleapi.ServerResponse{
  39364. Header: res.Header,
  39365. HTTPStatusCode: res.StatusCode,
  39366. },
  39367. }
  39368. target := &ret
  39369. if err := gensupport.DecodeResponse(target, res); err != nil {
  39370. return nil, err
  39371. }
  39372. return ret, nil
  39373. // {
  39374. // "description": "Returns permissions that a caller has on the specified resource.",
  39375. // "httpMethod": "POST",
  39376. // "id": "compute.addresses.testIamPermissions",
  39377. // "parameterOrder": [
  39378. // "project",
  39379. // "region",
  39380. // "resource"
  39381. // ],
  39382. // "parameters": {
  39383. // "project": {
  39384. // "description": "Project ID for this request.",
  39385. // "location": "path",
  39386. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39387. // "required": true,
  39388. // "type": "string"
  39389. // },
  39390. // "region": {
  39391. // "description": "The name of the region for this request.",
  39392. // "location": "path",
  39393. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39394. // "required": true,
  39395. // "type": "string"
  39396. // },
  39397. // "resource": {
  39398. // "description": "Name or id of the resource for this request.",
  39399. // "location": "path",
  39400. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39401. // "required": true,
  39402. // "type": "string"
  39403. // }
  39404. // },
  39405. // "path": "{project}/regions/{region}/addresses/{resource}/testIamPermissions",
  39406. // "request": {
  39407. // "$ref": "TestPermissionsRequest"
  39408. // },
  39409. // "response": {
  39410. // "$ref": "TestPermissionsResponse"
  39411. // },
  39412. // "scopes": [
  39413. // "https://www.googleapis.com/auth/cloud-platform",
  39414. // "https://www.googleapis.com/auth/compute",
  39415. // "https://www.googleapis.com/auth/compute.readonly"
  39416. // ]
  39417. // }
  39418. }
  39419. // method id "compute.allocations.aggregatedList":
  39420. type AllocationsAggregatedListCall struct {
  39421. s *Service
  39422. project string
  39423. urlParams_ gensupport.URLParams
  39424. ifNoneMatch_ string
  39425. ctx_ context.Context
  39426. header_ http.Header
  39427. }
  39428. // AggregatedList: Retrieves an aggregated list of allocations.
  39429. func (r *AllocationsService) AggregatedList(project string) *AllocationsAggregatedListCall {
  39430. c := &AllocationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39431. c.project = project
  39432. return c
  39433. }
  39434. // Filter sets the optional parameter "filter": A filter expression that
  39435. // filters resources listed in the response. The expression must specify
  39436. // the field name, a comparison operator, and the value that you want to
  39437. // use for filtering. The value must be a string, a number, or a
  39438. // boolean. The comparison operator must be either =, !=, >, or <.
  39439. //
  39440. // For example, if you are filtering Compute Engine instances, you can
  39441. // exclude instances named example-instance by specifying name !=
  39442. // example-instance.
  39443. //
  39444. // You can also filter nested fields. For example, you could specify
  39445. // scheduling.automaticRestart = false to include instances only if they
  39446. // are not scheduled for automatic restarts. You can use filtering on
  39447. // nested fields to filter based on resource labels.
  39448. //
  39449. // To filter on multiple expressions, provide each separate expression
  39450. // within parentheses. For example, (scheduling.automaticRestart = true)
  39451. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39452. // AND expression. However, you can include AND and OR expressions
  39453. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39454. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39455. // true).
  39456. func (c *AllocationsAggregatedListCall) Filter(filter string) *AllocationsAggregatedListCall {
  39457. c.urlParams_.Set("filter", filter)
  39458. return c
  39459. }
  39460. // MaxResults sets the optional parameter "maxResults": The maximum
  39461. // number of results per page that should be returned. If the number of
  39462. // available results is larger than maxResults, Compute Engine returns a
  39463. // nextPageToken that can be used to get the next page of results in
  39464. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39465. // (Default: 500)
  39466. func (c *AllocationsAggregatedListCall) MaxResults(maxResults int64) *AllocationsAggregatedListCall {
  39467. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39468. return c
  39469. }
  39470. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39471. // a certain order. By default, results are returned in alphanumerical
  39472. // order based on the resource name.
  39473. //
  39474. // You can also sort results in descending order based on the creation
  39475. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39476. // based on the creationTimestamp field in reverse chronological order
  39477. // (newest result first). Use this to sort resources like operations so
  39478. // that the newest operation is returned first.
  39479. //
  39480. // Currently, only sorting by name or creationTimestamp desc is
  39481. // supported.
  39482. func (c *AllocationsAggregatedListCall) OrderBy(orderBy string) *AllocationsAggregatedListCall {
  39483. c.urlParams_.Set("orderBy", orderBy)
  39484. return c
  39485. }
  39486. // PageToken sets the optional parameter "pageToken": Specifies a page
  39487. // token to use. Set pageToken to the nextPageToken returned by a
  39488. // previous list request to get the next page of results.
  39489. func (c *AllocationsAggregatedListCall) PageToken(pageToken string) *AllocationsAggregatedListCall {
  39490. c.urlParams_.Set("pageToken", pageToken)
  39491. return c
  39492. }
  39493. // Fields allows partial responses to be retrieved. See
  39494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39495. // for more information.
  39496. func (c *AllocationsAggregatedListCall) Fields(s ...googleapi.Field) *AllocationsAggregatedListCall {
  39497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39498. return c
  39499. }
  39500. // IfNoneMatch sets the optional parameter which makes the operation
  39501. // fail if the object's ETag matches the given value. This is useful for
  39502. // getting updates only after the object has changed since the last
  39503. // request. Use googleapi.IsNotModified to check whether the response
  39504. // error from Do is the result of In-None-Match.
  39505. func (c *AllocationsAggregatedListCall) IfNoneMatch(entityTag string) *AllocationsAggregatedListCall {
  39506. c.ifNoneMatch_ = entityTag
  39507. return c
  39508. }
  39509. // Context sets the context to be used in this call's Do method. Any
  39510. // pending HTTP request will be aborted if the provided context is
  39511. // canceled.
  39512. func (c *AllocationsAggregatedListCall) Context(ctx context.Context) *AllocationsAggregatedListCall {
  39513. c.ctx_ = ctx
  39514. return c
  39515. }
  39516. // Header returns an http.Header that can be modified by the caller to
  39517. // add HTTP headers to the request.
  39518. func (c *AllocationsAggregatedListCall) Header() http.Header {
  39519. if c.header_ == nil {
  39520. c.header_ = make(http.Header)
  39521. }
  39522. return c.header_
  39523. }
  39524. func (c *AllocationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  39525. reqHeaders := make(http.Header)
  39526. for k, v := range c.header_ {
  39527. reqHeaders[k] = v
  39528. }
  39529. reqHeaders.Set("User-Agent", c.s.userAgent())
  39530. if c.ifNoneMatch_ != "" {
  39531. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39532. }
  39533. var body io.Reader = nil
  39534. c.urlParams_.Set("alt", alt)
  39535. c.urlParams_.Set("prettyPrint", "false")
  39536. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/allocations")
  39537. urls += "?" + c.urlParams_.Encode()
  39538. req, err := http.NewRequest("GET", urls, body)
  39539. if err != nil {
  39540. return nil, err
  39541. }
  39542. req.Header = reqHeaders
  39543. googleapi.Expand(req.URL, map[string]string{
  39544. "project": c.project,
  39545. })
  39546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39547. }
  39548. // Do executes the "compute.allocations.aggregatedList" call.
  39549. // Exactly one of *AllocationAggregatedList or error will be non-nil.
  39550. // Any non-2xx status code is an error. Response headers are in either
  39551. // *AllocationAggregatedList.ServerResponse.Header or (if a response was
  39552. // returned at all) in error.(*googleapi.Error).Header. Use
  39553. // googleapi.IsNotModified to check whether the returned error was
  39554. // because http.StatusNotModified was returned.
  39555. func (c *AllocationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*AllocationAggregatedList, error) {
  39556. gensupport.SetOptions(c.urlParams_, opts...)
  39557. res, err := c.doRequest("json")
  39558. if res != nil && res.StatusCode == http.StatusNotModified {
  39559. if res.Body != nil {
  39560. res.Body.Close()
  39561. }
  39562. return nil, &googleapi.Error{
  39563. Code: res.StatusCode,
  39564. Header: res.Header,
  39565. }
  39566. }
  39567. if err != nil {
  39568. return nil, err
  39569. }
  39570. defer googleapi.CloseBody(res)
  39571. if err := googleapi.CheckResponse(res); err != nil {
  39572. return nil, err
  39573. }
  39574. ret := &AllocationAggregatedList{
  39575. ServerResponse: googleapi.ServerResponse{
  39576. Header: res.Header,
  39577. HTTPStatusCode: res.StatusCode,
  39578. },
  39579. }
  39580. target := &ret
  39581. if err := gensupport.DecodeResponse(target, res); err != nil {
  39582. return nil, err
  39583. }
  39584. return ret, nil
  39585. // {
  39586. // "description": "Retrieves an aggregated list of allocations.",
  39587. // "httpMethod": "GET",
  39588. // "id": "compute.allocations.aggregatedList",
  39589. // "parameterOrder": [
  39590. // "project"
  39591. // ],
  39592. // "parameters": {
  39593. // "filter": {
  39594. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39595. // "location": "query",
  39596. // "type": "string"
  39597. // },
  39598. // "maxResults": {
  39599. // "default": "500",
  39600. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39601. // "format": "uint32",
  39602. // "location": "query",
  39603. // "minimum": "0",
  39604. // "type": "integer"
  39605. // },
  39606. // "orderBy": {
  39607. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39608. // "location": "query",
  39609. // "type": "string"
  39610. // },
  39611. // "pageToken": {
  39612. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39613. // "location": "query",
  39614. // "type": "string"
  39615. // },
  39616. // "project": {
  39617. // "description": "Project ID for this request.",
  39618. // "location": "path",
  39619. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39620. // "required": true,
  39621. // "type": "string"
  39622. // }
  39623. // },
  39624. // "path": "{project}/aggregated/allocations",
  39625. // "response": {
  39626. // "$ref": "AllocationAggregatedList"
  39627. // },
  39628. // "scopes": [
  39629. // "https://www.googleapis.com/auth/cloud-platform",
  39630. // "https://www.googleapis.com/auth/compute",
  39631. // "https://www.googleapis.com/auth/compute.readonly"
  39632. // ]
  39633. // }
  39634. }
  39635. // Pages invokes f for each page of results.
  39636. // A non-nil error returned from f will halt the iteration.
  39637. // The provided context supersedes any context provided to the Context method.
  39638. func (c *AllocationsAggregatedListCall) Pages(ctx context.Context, f func(*AllocationAggregatedList) error) error {
  39639. c.ctx_ = ctx
  39640. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39641. for {
  39642. x, err := c.Do()
  39643. if err != nil {
  39644. return err
  39645. }
  39646. if err := f(x); err != nil {
  39647. return err
  39648. }
  39649. if x.NextPageToken == "" {
  39650. return nil
  39651. }
  39652. c.PageToken(x.NextPageToken)
  39653. }
  39654. }
  39655. // method id "compute.allocations.delete":
  39656. type AllocationsDeleteCall struct {
  39657. s *Service
  39658. project string
  39659. zone string
  39660. allocation string
  39661. urlParams_ gensupport.URLParams
  39662. ctx_ context.Context
  39663. header_ http.Header
  39664. }
  39665. // Delete: Deletes the specified allocation.
  39666. func (r *AllocationsService) Delete(project string, zone string, allocation string) *AllocationsDeleteCall {
  39667. c := &AllocationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39668. c.project = project
  39669. c.zone = zone
  39670. c.allocation = allocation
  39671. return c
  39672. }
  39673. // RequestId sets the optional parameter "requestId": An optional
  39674. // request ID to identify requests. Specify a unique request ID so that
  39675. // if you must retry your request, the server will know to ignore the
  39676. // request if it has already been completed.
  39677. //
  39678. // For example, consider a situation where you make an initial request
  39679. // and the request times out. If you make the request again with the
  39680. // same request ID, the server can check if original operation with the
  39681. // same request ID was received, and if so, will ignore the second
  39682. // request. This prevents clients from accidentally creating duplicate
  39683. // commitments.
  39684. //
  39685. // The request ID must be a valid UUID with the exception that zero UUID
  39686. // is not supported (00000000-0000-0000-0000-000000000000).
  39687. func (c *AllocationsDeleteCall) RequestId(requestId string) *AllocationsDeleteCall {
  39688. c.urlParams_.Set("requestId", requestId)
  39689. return c
  39690. }
  39691. // Fields allows partial responses to be retrieved. See
  39692. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39693. // for more information.
  39694. func (c *AllocationsDeleteCall) Fields(s ...googleapi.Field) *AllocationsDeleteCall {
  39695. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39696. return c
  39697. }
  39698. // Context sets the context to be used in this call's Do method. Any
  39699. // pending HTTP request will be aborted if the provided context is
  39700. // canceled.
  39701. func (c *AllocationsDeleteCall) Context(ctx context.Context) *AllocationsDeleteCall {
  39702. c.ctx_ = ctx
  39703. return c
  39704. }
  39705. // Header returns an http.Header that can be modified by the caller to
  39706. // add HTTP headers to the request.
  39707. func (c *AllocationsDeleteCall) Header() http.Header {
  39708. if c.header_ == nil {
  39709. c.header_ = make(http.Header)
  39710. }
  39711. return c.header_
  39712. }
  39713. func (c *AllocationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  39714. reqHeaders := make(http.Header)
  39715. for k, v := range c.header_ {
  39716. reqHeaders[k] = v
  39717. }
  39718. reqHeaders.Set("User-Agent", c.s.userAgent())
  39719. var body io.Reader = nil
  39720. c.urlParams_.Set("alt", alt)
  39721. c.urlParams_.Set("prettyPrint", "false")
  39722. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}")
  39723. urls += "?" + c.urlParams_.Encode()
  39724. req, err := http.NewRequest("DELETE", urls, body)
  39725. if err != nil {
  39726. return nil, err
  39727. }
  39728. req.Header = reqHeaders
  39729. googleapi.Expand(req.URL, map[string]string{
  39730. "project": c.project,
  39731. "zone": c.zone,
  39732. "allocation": c.allocation,
  39733. })
  39734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39735. }
  39736. // Do executes the "compute.allocations.delete" call.
  39737. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39738. // status code is an error. Response headers are in either
  39739. // *Operation.ServerResponse.Header or (if a response was returned at
  39740. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39741. // to check whether the returned error was because
  39742. // http.StatusNotModified was returned.
  39743. func (c *AllocationsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39744. gensupport.SetOptions(c.urlParams_, opts...)
  39745. res, err := c.doRequest("json")
  39746. if res != nil && res.StatusCode == http.StatusNotModified {
  39747. if res.Body != nil {
  39748. res.Body.Close()
  39749. }
  39750. return nil, &googleapi.Error{
  39751. Code: res.StatusCode,
  39752. Header: res.Header,
  39753. }
  39754. }
  39755. if err != nil {
  39756. return nil, err
  39757. }
  39758. defer googleapi.CloseBody(res)
  39759. if err := googleapi.CheckResponse(res); err != nil {
  39760. return nil, err
  39761. }
  39762. ret := &Operation{
  39763. ServerResponse: googleapi.ServerResponse{
  39764. Header: res.Header,
  39765. HTTPStatusCode: res.StatusCode,
  39766. },
  39767. }
  39768. target := &ret
  39769. if err := gensupport.DecodeResponse(target, res); err != nil {
  39770. return nil, err
  39771. }
  39772. return ret, nil
  39773. // {
  39774. // "description": "Deletes the specified allocation.",
  39775. // "httpMethod": "DELETE",
  39776. // "id": "compute.allocations.delete",
  39777. // "parameterOrder": [
  39778. // "project",
  39779. // "zone",
  39780. // "allocation"
  39781. // ],
  39782. // "parameters": {
  39783. // "allocation": {
  39784. // "description": "Name of the allocation to delete.",
  39785. // "location": "path",
  39786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39787. // "required": true,
  39788. // "type": "string"
  39789. // },
  39790. // "project": {
  39791. // "description": "Project ID for this request.",
  39792. // "location": "path",
  39793. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39794. // "required": true,
  39795. // "type": "string"
  39796. // },
  39797. // "requestId": {
  39798. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39799. // "location": "query",
  39800. // "type": "string"
  39801. // },
  39802. // "zone": {
  39803. // "description": "Name of the zone for this request.",
  39804. // "location": "path",
  39805. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39806. // "required": true,
  39807. // "type": "string"
  39808. // }
  39809. // },
  39810. // "path": "{project}/zones/{zone}/allocations/{allocation}",
  39811. // "response": {
  39812. // "$ref": "Operation"
  39813. // },
  39814. // "scopes": [
  39815. // "https://www.googleapis.com/auth/cloud-platform",
  39816. // "https://www.googleapis.com/auth/compute"
  39817. // ]
  39818. // }
  39819. }
  39820. // method id "compute.allocations.get":
  39821. type AllocationsGetCall struct {
  39822. s *Service
  39823. project string
  39824. zone string
  39825. allocation string
  39826. urlParams_ gensupport.URLParams
  39827. ifNoneMatch_ string
  39828. ctx_ context.Context
  39829. header_ http.Header
  39830. }
  39831. // Get: Retrieves all information of the specified allocation.
  39832. func (r *AllocationsService) Get(project string, zone string, allocation string) *AllocationsGetCall {
  39833. c := &AllocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39834. c.project = project
  39835. c.zone = zone
  39836. c.allocation = allocation
  39837. return c
  39838. }
  39839. // Fields allows partial responses to be retrieved. See
  39840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39841. // for more information.
  39842. func (c *AllocationsGetCall) Fields(s ...googleapi.Field) *AllocationsGetCall {
  39843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39844. return c
  39845. }
  39846. // IfNoneMatch sets the optional parameter which makes the operation
  39847. // fail if the object's ETag matches the given value. This is useful for
  39848. // getting updates only after the object has changed since the last
  39849. // request. Use googleapi.IsNotModified to check whether the response
  39850. // error from Do is the result of In-None-Match.
  39851. func (c *AllocationsGetCall) IfNoneMatch(entityTag string) *AllocationsGetCall {
  39852. c.ifNoneMatch_ = entityTag
  39853. return c
  39854. }
  39855. // Context sets the context to be used in this call's Do method. Any
  39856. // pending HTTP request will be aborted if the provided context is
  39857. // canceled.
  39858. func (c *AllocationsGetCall) Context(ctx context.Context) *AllocationsGetCall {
  39859. c.ctx_ = ctx
  39860. return c
  39861. }
  39862. // Header returns an http.Header that can be modified by the caller to
  39863. // add HTTP headers to the request.
  39864. func (c *AllocationsGetCall) Header() http.Header {
  39865. if c.header_ == nil {
  39866. c.header_ = make(http.Header)
  39867. }
  39868. return c.header_
  39869. }
  39870. func (c *AllocationsGetCall) doRequest(alt string) (*http.Response, error) {
  39871. reqHeaders := make(http.Header)
  39872. for k, v := range c.header_ {
  39873. reqHeaders[k] = v
  39874. }
  39875. reqHeaders.Set("User-Agent", c.s.userAgent())
  39876. if c.ifNoneMatch_ != "" {
  39877. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39878. }
  39879. var body io.Reader = nil
  39880. c.urlParams_.Set("alt", alt)
  39881. c.urlParams_.Set("prettyPrint", "false")
  39882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}")
  39883. urls += "?" + c.urlParams_.Encode()
  39884. req, err := http.NewRequest("GET", urls, body)
  39885. if err != nil {
  39886. return nil, err
  39887. }
  39888. req.Header = reqHeaders
  39889. googleapi.Expand(req.URL, map[string]string{
  39890. "project": c.project,
  39891. "zone": c.zone,
  39892. "allocation": c.allocation,
  39893. })
  39894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39895. }
  39896. // Do executes the "compute.allocations.get" call.
  39897. // Exactly one of *Allocation or error will be non-nil. Any non-2xx
  39898. // status code is an error. Response headers are in either
  39899. // *Allocation.ServerResponse.Header or (if a response was returned at
  39900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39901. // to check whether the returned error was because
  39902. // http.StatusNotModified was returned.
  39903. func (c *AllocationsGetCall) Do(opts ...googleapi.CallOption) (*Allocation, error) {
  39904. gensupport.SetOptions(c.urlParams_, opts...)
  39905. res, err := c.doRequest("json")
  39906. if res != nil && res.StatusCode == http.StatusNotModified {
  39907. if res.Body != nil {
  39908. res.Body.Close()
  39909. }
  39910. return nil, &googleapi.Error{
  39911. Code: res.StatusCode,
  39912. Header: res.Header,
  39913. }
  39914. }
  39915. if err != nil {
  39916. return nil, err
  39917. }
  39918. defer googleapi.CloseBody(res)
  39919. if err := googleapi.CheckResponse(res); err != nil {
  39920. return nil, err
  39921. }
  39922. ret := &Allocation{
  39923. ServerResponse: googleapi.ServerResponse{
  39924. Header: res.Header,
  39925. HTTPStatusCode: res.StatusCode,
  39926. },
  39927. }
  39928. target := &ret
  39929. if err := gensupport.DecodeResponse(target, res); err != nil {
  39930. return nil, err
  39931. }
  39932. return ret, nil
  39933. // {
  39934. // "description": "Retrieves all information of the specified allocation.",
  39935. // "httpMethod": "GET",
  39936. // "id": "compute.allocations.get",
  39937. // "parameterOrder": [
  39938. // "project",
  39939. // "zone",
  39940. // "allocation"
  39941. // ],
  39942. // "parameters": {
  39943. // "allocation": {
  39944. // "description": "Name of the allocation to retrieve.",
  39945. // "location": "path",
  39946. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39947. // "required": true,
  39948. // "type": "string"
  39949. // },
  39950. // "project": {
  39951. // "description": "Project ID for this request.",
  39952. // "location": "path",
  39953. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39954. // "required": true,
  39955. // "type": "string"
  39956. // },
  39957. // "zone": {
  39958. // "description": "Name of the zone for this request.",
  39959. // "location": "path",
  39960. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39961. // "required": true,
  39962. // "type": "string"
  39963. // }
  39964. // },
  39965. // "path": "{project}/zones/{zone}/allocations/{allocation}",
  39966. // "response": {
  39967. // "$ref": "Allocation"
  39968. // },
  39969. // "scopes": [
  39970. // "https://www.googleapis.com/auth/cloud-platform",
  39971. // "https://www.googleapis.com/auth/compute",
  39972. // "https://www.googleapis.com/auth/compute.readonly"
  39973. // ]
  39974. // }
  39975. }
  39976. // method id "compute.allocations.getIamPolicy":
  39977. type AllocationsGetIamPolicyCall struct {
  39978. s *Service
  39979. project string
  39980. zone string
  39981. resource string
  39982. urlParams_ gensupport.URLParams
  39983. ifNoneMatch_ string
  39984. ctx_ context.Context
  39985. header_ http.Header
  39986. }
  39987. // GetIamPolicy: Gets the access control policy for a resource. May be
  39988. // empty if no such policy or resource exists.
  39989. func (r *AllocationsService) GetIamPolicy(project string, zone string, resource string) *AllocationsGetIamPolicyCall {
  39990. c := &AllocationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39991. c.project = project
  39992. c.zone = zone
  39993. c.resource = resource
  39994. return c
  39995. }
  39996. // Fields allows partial responses to be retrieved. See
  39997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39998. // for more information.
  39999. func (c *AllocationsGetIamPolicyCall) Fields(s ...googleapi.Field) *AllocationsGetIamPolicyCall {
  40000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40001. return c
  40002. }
  40003. // IfNoneMatch sets the optional parameter which makes the operation
  40004. // fail if the object's ETag matches the given value. This is useful for
  40005. // getting updates only after the object has changed since the last
  40006. // request. Use googleapi.IsNotModified to check whether the response
  40007. // error from Do is the result of In-None-Match.
  40008. func (c *AllocationsGetIamPolicyCall) IfNoneMatch(entityTag string) *AllocationsGetIamPolicyCall {
  40009. c.ifNoneMatch_ = entityTag
  40010. return c
  40011. }
  40012. // Context sets the context to be used in this call's Do method. Any
  40013. // pending HTTP request will be aborted if the provided context is
  40014. // canceled.
  40015. func (c *AllocationsGetIamPolicyCall) Context(ctx context.Context) *AllocationsGetIamPolicyCall {
  40016. c.ctx_ = ctx
  40017. return c
  40018. }
  40019. // Header returns an http.Header that can be modified by the caller to
  40020. // add HTTP headers to the request.
  40021. func (c *AllocationsGetIamPolicyCall) Header() http.Header {
  40022. if c.header_ == nil {
  40023. c.header_ = make(http.Header)
  40024. }
  40025. return c.header_
  40026. }
  40027. func (c *AllocationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  40028. reqHeaders := make(http.Header)
  40029. for k, v := range c.header_ {
  40030. reqHeaders[k] = v
  40031. }
  40032. reqHeaders.Set("User-Agent", c.s.userAgent())
  40033. if c.ifNoneMatch_ != "" {
  40034. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40035. }
  40036. var body io.Reader = nil
  40037. c.urlParams_.Set("alt", alt)
  40038. c.urlParams_.Set("prettyPrint", "false")
  40039. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/getIamPolicy")
  40040. urls += "?" + c.urlParams_.Encode()
  40041. req, err := http.NewRequest("GET", urls, body)
  40042. if err != nil {
  40043. return nil, err
  40044. }
  40045. req.Header = reqHeaders
  40046. googleapi.Expand(req.URL, map[string]string{
  40047. "project": c.project,
  40048. "zone": c.zone,
  40049. "resource": c.resource,
  40050. })
  40051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40052. }
  40053. // Do executes the "compute.allocations.getIamPolicy" call.
  40054. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  40055. // code is an error. Response headers are in either
  40056. // *Policy.ServerResponse.Header or (if a response was returned at all)
  40057. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40058. // check whether the returned error was because http.StatusNotModified
  40059. // was returned.
  40060. func (c *AllocationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  40061. gensupport.SetOptions(c.urlParams_, opts...)
  40062. res, err := c.doRequest("json")
  40063. if res != nil && res.StatusCode == http.StatusNotModified {
  40064. if res.Body != nil {
  40065. res.Body.Close()
  40066. }
  40067. return nil, &googleapi.Error{
  40068. Code: res.StatusCode,
  40069. Header: res.Header,
  40070. }
  40071. }
  40072. if err != nil {
  40073. return nil, err
  40074. }
  40075. defer googleapi.CloseBody(res)
  40076. if err := googleapi.CheckResponse(res); err != nil {
  40077. return nil, err
  40078. }
  40079. ret := &Policy{
  40080. ServerResponse: googleapi.ServerResponse{
  40081. Header: res.Header,
  40082. HTTPStatusCode: res.StatusCode,
  40083. },
  40084. }
  40085. target := &ret
  40086. if err := gensupport.DecodeResponse(target, res); err != nil {
  40087. return nil, err
  40088. }
  40089. return ret, nil
  40090. // {
  40091. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  40092. // "httpMethod": "GET",
  40093. // "id": "compute.allocations.getIamPolicy",
  40094. // "parameterOrder": [
  40095. // "project",
  40096. // "zone",
  40097. // "resource"
  40098. // ],
  40099. // "parameters": {
  40100. // "project": {
  40101. // "description": "Project ID for this request.",
  40102. // "location": "path",
  40103. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40104. // "required": true,
  40105. // "type": "string"
  40106. // },
  40107. // "resource": {
  40108. // "description": "Name or id of the resource for this request.",
  40109. // "location": "path",
  40110. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40111. // "required": true,
  40112. // "type": "string"
  40113. // },
  40114. // "zone": {
  40115. // "description": "The name of the zone for this request.",
  40116. // "location": "path",
  40117. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40118. // "required": true,
  40119. // "type": "string"
  40120. // }
  40121. // },
  40122. // "path": "{project}/zones/{zone}/allocations/{resource}/getIamPolicy",
  40123. // "response": {
  40124. // "$ref": "Policy"
  40125. // },
  40126. // "scopes": [
  40127. // "https://www.googleapis.com/auth/cloud-platform",
  40128. // "https://www.googleapis.com/auth/compute",
  40129. // "https://www.googleapis.com/auth/compute.readonly"
  40130. // ]
  40131. // }
  40132. }
  40133. // method id "compute.allocations.insert":
  40134. type AllocationsInsertCall struct {
  40135. s *Service
  40136. project string
  40137. zone string
  40138. allocation *Allocation
  40139. urlParams_ gensupport.URLParams
  40140. ctx_ context.Context
  40141. header_ http.Header
  40142. }
  40143. // Insert: Creates a new allocation.
  40144. func (r *AllocationsService) Insert(project string, zone string, allocation *Allocation) *AllocationsInsertCall {
  40145. c := &AllocationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40146. c.project = project
  40147. c.zone = zone
  40148. c.allocation = allocation
  40149. return c
  40150. }
  40151. // RequestId sets the optional parameter "requestId": An optional
  40152. // request ID to identify requests. Specify a unique request ID so that
  40153. // if you must retry your request, the server will know to ignore the
  40154. // request if it has already been completed.
  40155. //
  40156. // For example, consider a situation where you make an initial request
  40157. // and the request times out. If you make the request again with the
  40158. // same request ID, the server can check if original operation with the
  40159. // same request ID was received, and if so, will ignore the second
  40160. // request. This prevents clients from accidentally creating duplicate
  40161. // commitments.
  40162. //
  40163. // The request ID must be a valid UUID with the exception that zero UUID
  40164. // is not supported (00000000-0000-0000-0000-000000000000).
  40165. func (c *AllocationsInsertCall) RequestId(requestId string) *AllocationsInsertCall {
  40166. c.urlParams_.Set("requestId", requestId)
  40167. return c
  40168. }
  40169. // Fields allows partial responses to be retrieved. See
  40170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40171. // for more information.
  40172. func (c *AllocationsInsertCall) Fields(s ...googleapi.Field) *AllocationsInsertCall {
  40173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40174. return c
  40175. }
  40176. // Context sets the context to be used in this call's Do method. Any
  40177. // pending HTTP request will be aborted if the provided context is
  40178. // canceled.
  40179. func (c *AllocationsInsertCall) Context(ctx context.Context) *AllocationsInsertCall {
  40180. c.ctx_ = ctx
  40181. return c
  40182. }
  40183. // Header returns an http.Header that can be modified by the caller to
  40184. // add HTTP headers to the request.
  40185. func (c *AllocationsInsertCall) Header() http.Header {
  40186. if c.header_ == nil {
  40187. c.header_ = make(http.Header)
  40188. }
  40189. return c.header_
  40190. }
  40191. func (c *AllocationsInsertCall) doRequest(alt string) (*http.Response, error) {
  40192. reqHeaders := make(http.Header)
  40193. for k, v := range c.header_ {
  40194. reqHeaders[k] = v
  40195. }
  40196. reqHeaders.Set("User-Agent", c.s.userAgent())
  40197. var body io.Reader = nil
  40198. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocation)
  40199. if err != nil {
  40200. return nil, err
  40201. }
  40202. reqHeaders.Set("Content-Type", "application/json")
  40203. c.urlParams_.Set("alt", alt)
  40204. c.urlParams_.Set("prettyPrint", "false")
  40205. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations")
  40206. urls += "?" + c.urlParams_.Encode()
  40207. req, err := http.NewRequest("POST", urls, body)
  40208. if err != nil {
  40209. return nil, err
  40210. }
  40211. req.Header = reqHeaders
  40212. googleapi.Expand(req.URL, map[string]string{
  40213. "project": c.project,
  40214. "zone": c.zone,
  40215. })
  40216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40217. }
  40218. // Do executes the "compute.allocations.insert" call.
  40219. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40220. // status code is an error. Response headers are in either
  40221. // *Operation.ServerResponse.Header or (if a response was returned at
  40222. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40223. // to check whether the returned error was because
  40224. // http.StatusNotModified was returned.
  40225. func (c *AllocationsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40226. gensupport.SetOptions(c.urlParams_, opts...)
  40227. res, err := c.doRequest("json")
  40228. if res != nil && res.StatusCode == http.StatusNotModified {
  40229. if res.Body != nil {
  40230. res.Body.Close()
  40231. }
  40232. return nil, &googleapi.Error{
  40233. Code: res.StatusCode,
  40234. Header: res.Header,
  40235. }
  40236. }
  40237. if err != nil {
  40238. return nil, err
  40239. }
  40240. defer googleapi.CloseBody(res)
  40241. if err := googleapi.CheckResponse(res); err != nil {
  40242. return nil, err
  40243. }
  40244. ret := &Operation{
  40245. ServerResponse: googleapi.ServerResponse{
  40246. Header: res.Header,
  40247. HTTPStatusCode: res.StatusCode,
  40248. },
  40249. }
  40250. target := &ret
  40251. if err := gensupport.DecodeResponse(target, res); err != nil {
  40252. return nil, err
  40253. }
  40254. return ret, nil
  40255. // {
  40256. // "description": "Creates a new allocation.",
  40257. // "httpMethod": "POST",
  40258. // "id": "compute.allocations.insert",
  40259. // "parameterOrder": [
  40260. // "project",
  40261. // "zone"
  40262. // ],
  40263. // "parameters": {
  40264. // "project": {
  40265. // "description": "Project ID for this request.",
  40266. // "location": "path",
  40267. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40268. // "required": true,
  40269. // "type": "string"
  40270. // },
  40271. // "requestId": {
  40272. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40273. // "location": "query",
  40274. // "type": "string"
  40275. // },
  40276. // "zone": {
  40277. // "description": "Name of the zone for this request.",
  40278. // "location": "path",
  40279. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40280. // "required": true,
  40281. // "type": "string"
  40282. // }
  40283. // },
  40284. // "path": "{project}/zones/{zone}/allocations",
  40285. // "request": {
  40286. // "$ref": "Allocation"
  40287. // },
  40288. // "response": {
  40289. // "$ref": "Operation"
  40290. // },
  40291. // "scopes": [
  40292. // "https://www.googleapis.com/auth/cloud-platform",
  40293. // "https://www.googleapis.com/auth/compute"
  40294. // ]
  40295. // }
  40296. }
  40297. // method id "compute.allocations.list":
  40298. type AllocationsListCall struct {
  40299. s *Service
  40300. project string
  40301. zone string
  40302. urlParams_ gensupport.URLParams
  40303. ifNoneMatch_ string
  40304. ctx_ context.Context
  40305. header_ http.Header
  40306. }
  40307. // List: A list all the allocations that have been configured for the
  40308. // specified project in specified zone.
  40309. func (r *AllocationsService) List(project string, zone string) *AllocationsListCall {
  40310. c := &AllocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40311. c.project = project
  40312. c.zone = zone
  40313. return c
  40314. }
  40315. // Filter sets the optional parameter "filter": A filter expression that
  40316. // filters resources listed in the response. The expression must specify
  40317. // the field name, a comparison operator, and the value that you want to
  40318. // use for filtering. The value must be a string, a number, or a
  40319. // boolean. The comparison operator must be either =, !=, >, or <.
  40320. //
  40321. // For example, if you are filtering Compute Engine instances, you can
  40322. // exclude instances named example-instance by specifying name !=
  40323. // example-instance.
  40324. //
  40325. // You can also filter nested fields. For example, you could specify
  40326. // scheduling.automaticRestart = false to include instances only if they
  40327. // are not scheduled for automatic restarts. You can use filtering on
  40328. // nested fields to filter based on resource labels.
  40329. //
  40330. // To filter on multiple expressions, provide each separate expression
  40331. // within parentheses. For example, (scheduling.automaticRestart = true)
  40332. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40333. // AND expression. However, you can include AND and OR expressions
  40334. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40335. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40336. // true).
  40337. func (c *AllocationsListCall) Filter(filter string) *AllocationsListCall {
  40338. c.urlParams_.Set("filter", filter)
  40339. return c
  40340. }
  40341. // MaxResults sets the optional parameter "maxResults": The maximum
  40342. // number of results per page that should be returned. If the number of
  40343. // available results is larger than maxResults, Compute Engine returns a
  40344. // nextPageToken that can be used to get the next page of results in
  40345. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40346. // (Default: 500)
  40347. func (c *AllocationsListCall) MaxResults(maxResults int64) *AllocationsListCall {
  40348. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40349. return c
  40350. }
  40351. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40352. // a certain order. By default, results are returned in alphanumerical
  40353. // order based on the resource name.
  40354. //
  40355. // You can also sort results in descending order based on the creation
  40356. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40357. // based on the creationTimestamp field in reverse chronological order
  40358. // (newest result first). Use this to sort resources like operations so
  40359. // that the newest operation is returned first.
  40360. //
  40361. // Currently, only sorting by name or creationTimestamp desc is
  40362. // supported.
  40363. func (c *AllocationsListCall) OrderBy(orderBy string) *AllocationsListCall {
  40364. c.urlParams_.Set("orderBy", orderBy)
  40365. return c
  40366. }
  40367. // PageToken sets the optional parameter "pageToken": Specifies a page
  40368. // token to use. Set pageToken to the nextPageToken returned by a
  40369. // previous list request to get the next page of results.
  40370. func (c *AllocationsListCall) PageToken(pageToken string) *AllocationsListCall {
  40371. c.urlParams_.Set("pageToken", pageToken)
  40372. return c
  40373. }
  40374. // Fields allows partial responses to be retrieved. See
  40375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40376. // for more information.
  40377. func (c *AllocationsListCall) Fields(s ...googleapi.Field) *AllocationsListCall {
  40378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40379. return c
  40380. }
  40381. // IfNoneMatch sets the optional parameter which makes the operation
  40382. // fail if the object's ETag matches the given value. This is useful for
  40383. // getting updates only after the object has changed since the last
  40384. // request. Use googleapi.IsNotModified to check whether the response
  40385. // error from Do is the result of In-None-Match.
  40386. func (c *AllocationsListCall) IfNoneMatch(entityTag string) *AllocationsListCall {
  40387. c.ifNoneMatch_ = entityTag
  40388. return c
  40389. }
  40390. // Context sets the context to be used in this call's Do method. Any
  40391. // pending HTTP request will be aborted if the provided context is
  40392. // canceled.
  40393. func (c *AllocationsListCall) Context(ctx context.Context) *AllocationsListCall {
  40394. c.ctx_ = ctx
  40395. return c
  40396. }
  40397. // Header returns an http.Header that can be modified by the caller to
  40398. // add HTTP headers to the request.
  40399. func (c *AllocationsListCall) Header() http.Header {
  40400. if c.header_ == nil {
  40401. c.header_ = make(http.Header)
  40402. }
  40403. return c.header_
  40404. }
  40405. func (c *AllocationsListCall) doRequest(alt string) (*http.Response, error) {
  40406. reqHeaders := make(http.Header)
  40407. for k, v := range c.header_ {
  40408. reqHeaders[k] = v
  40409. }
  40410. reqHeaders.Set("User-Agent", c.s.userAgent())
  40411. if c.ifNoneMatch_ != "" {
  40412. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40413. }
  40414. var body io.Reader = nil
  40415. c.urlParams_.Set("alt", alt)
  40416. c.urlParams_.Set("prettyPrint", "false")
  40417. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations")
  40418. urls += "?" + c.urlParams_.Encode()
  40419. req, err := http.NewRequest("GET", urls, body)
  40420. if err != nil {
  40421. return nil, err
  40422. }
  40423. req.Header = reqHeaders
  40424. googleapi.Expand(req.URL, map[string]string{
  40425. "project": c.project,
  40426. "zone": c.zone,
  40427. })
  40428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40429. }
  40430. // Do executes the "compute.allocations.list" call.
  40431. // Exactly one of *AllocationList or error will be non-nil. Any non-2xx
  40432. // status code is an error. Response headers are in either
  40433. // *AllocationList.ServerResponse.Header or (if a response was returned
  40434. // at all) in error.(*googleapi.Error).Header. Use
  40435. // googleapi.IsNotModified to check whether the returned error was
  40436. // because http.StatusNotModified was returned.
  40437. func (c *AllocationsListCall) Do(opts ...googleapi.CallOption) (*AllocationList, error) {
  40438. gensupport.SetOptions(c.urlParams_, opts...)
  40439. res, err := c.doRequest("json")
  40440. if res != nil && res.StatusCode == http.StatusNotModified {
  40441. if res.Body != nil {
  40442. res.Body.Close()
  40443. }
  40444. return nil, &googleapi.Error{
  40445. Code: res.StatusCode,
  40446. Header: res.Header,
  40447. }
  40448. }
  40449. if err != nil {
  40450. return nil, err
  40451. }
  40452. defer googleapi.CloseBody(res)
  40453. if err := googleapi.CheckResponse(res); err != nil {
  40454. return nil, err
  40455. }
  40456. ret := &AllocationList{
  40457. ServerResponse: googleapi.ServerResponse{
  40458. Header: res.Header,
  40459. HTTPStatusCode: res.StatusCode,
  40460. },
  40461. }
  40462. target := &ret
  40463. if err := gensupport.DecodeResponse(target, res); err != nil {
  40464. return nil, err
  40465. }
  40466. return ret, nil
  40467. // {
  40468. // "description": "A list all the allocations that have been configured for the specified project in specified zone.",
  40469. // "httpMethod": "GET",
  40470. // "id": "compute.allocations.list",
  40471. // "parameterOrder": [
  40472. // "project",
  40473. // "zone"
  40474. // ],
  40475. // "parameters": {
  40476. // "filter": {
  40477. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  40478. // "location": "query",
  40479. // "type": "string"
  40480. // },
  40481. // "maxResults": {
  40482. // "default": "500",
  40483. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  40484. // "format": "uint32",
  40485. // "location": "query",
  40486. // "minimum": "0",
  40487. // "type": "integer"
  40488. // },
  40489. // "orderBy": {
  40490. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  40491. // "location": "query",
  40492. // "type": "string"
  40493. // },
  40494. // "pageToken": {
  40495. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  40496. // "location": "query",
  40497. // "type": "string"
  40498. // },
  40499. // "project": {
  40500. // "description": "Project ID for this request.",
  40501. // "location": "path",
  40502. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40503. // "required": true,
  40504. // "type": "string"
  40505. // },
  40506. // "zone": {
  40507. // "description": "Name of the zone for this request.",
  40508. // "location": "path",
  40509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40510. // "required": true,
  40511. // "type": "string"
  40512. // }
  40513. // },
  40514. // "path": "{project}/zones/{zone}/allocations",
  40515. // "response": {
  40516. // "$ref": "AllocationList"
  40517. // },
  40518. // "scopes": [
  40519. // "https://www.googleapis.com/auth/cloud-platform",
  40520. // "https://www.googleapis.com/auth/compute",
  40521. // "https://www.googleapis.com/auth/compute.readonly"
  40522. // ]
  40523. // }
  40524. }
  40525. // Pages invokes f for each page of results.
  40526. // A non-nil error returned from f will halt the iteration.
  40527. // The provided context supersedes any context provided to the Context method.
  40528. func (c *AllocationsListCall) Pages(ctx context.Context, f func(*AllocationList) error) error {
  40529. c.ctx_ = ctx
  40530. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40531. for {
  40532. x, err := c.Do()
  40533. if err != nil {
  40534. return err
  40535. }
  40536. if err := f(x); err != nil {
  40537. return err
  40538. }
  40539. if x.NextPageToken == "" {
  40540. return nil
  40541. }
  40542. c.PageToken(x.NextPageToken)
  40543. }
  40544. }
  40545. // method id "compute.allocations.resize":
  40546. type AllocationsResizeCall struct {
  40547. s *Service
  40548. project string
  40549. zone string
  40550. allocation string
  40551. allocationsresizerequest *AllocationsResizeRequest
  40552. urlParams_ gensupport.URLParams
  40553. ctx_ context.Context
  40554. header_ http.Header
  40555. }
  40556. // Resize: Resizes the allocation (applicable to standalone allocations
  40557. // only)
  40558. func (r *AllocationsService) Resize(project string, zone string, allocation string, allocationsresizerequest *AllocationsResizeRequest) *AllocationsResizeCall {
  40559. c := &AllocationsResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40560. c.project = project
  40561. c.zone = zone
  40562. c.allocation = allocation
  40563. c.allocationsresizerequest = allocationsresizerequest
  40564. return c
  40565. }
  40566. // RequestId sets the optional parameter "requestId": An optional
  40567. // request ID to identify requests. Specify a unique request ID so that
  40568. // if you must retry your request, the server will know to ignore the
  40569. // request if it has already been completed.
  40570. //
  40571. // For example, consider a situation where you make an initial request
  40572. // and the request times out. If you make the request again with the
  40573. // same request ID, the server can check if original operation with the
  40574. // same request ID was received, and if so, will ignore the second
  40575. // request. This prevents clients from accidentally creating duplicate
  40576. // commitments.
  40577. //
  40578. // The request ID must be a valid UUID with the exception that zero UUID
  40579. // is not supported (00000000-0000-0000-0000-000000000000).
  40580. func (c *AllocationsResizeCall) RequestId(requestId string) *AllocationsResizeCall {
  40581. c.urlParams_.Set("requestId", requestId)
  40582. return c
  40583. }
  40584. // Fields allows partial responses to be retrieved. See
  40585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40586. // for more information.
  40587. func (c *AllocationsResizeCall) Fields(s ...googleapi.Field) *AllocationsResizeCall {
  40588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40589. return c
  40590. }
  40591. // Context sets the context to be used in this call's Do method. Any
  40592. // pending HTTP request will be aborted if the provided context is
  40593. // canceled.
  40594. func (c *AllocationsResizeCall) Context(ctx context.Context) *AllocationsResizeCall {
  40595. c.ctx_ = ctx
  40596. return c
  40597. }
  40598. // Header returns an http.Header that can be modified by the caller to
  40599. // add HTTP headers to the request.
  40600. func (c *AllocationsResizeCall) Header() http.Header {
  40601. if c.header_ == nil {
  40602. c.header_ = make(http.Header)
  40603. }
  40604. return c.header_
  40605. }
  40606. func (c *AllocationsResizeCall) doRequest(alt string) (*http.Response, error) {
  40607. reqHeaders := make(http.Header)
  40608. for k, v := range c.header_ {
  40609. reqHeaders[k] = v
  40610. }
  40611. reqHeaders.Set("User-Agent", c.s.userAgent())
  40612. var body io.Reader = nil
  40613. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocationsresizerequest)
  40614. if err != nil {
  40615. return nil, err
  40616. }
  40617. reqHeaders.Set("Content-Type", "application/json")
  40618. c.urlParams_.Set("alt", alt)
  40619. c.urlParams_.Set("prettyPrint", "false")
  40620. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{allocation}/resize")
  40621. urls += "?" + c.urlParams_.Encode()
  40622. req, err := http.NewRequest("POST", urls, body)
  40623. if err != nil {
  40624. return nil, err
  40625. }
  40626. req.Header = reqHeaders
  40627. googleapi.Expand(req.URL, map[string]string{
  40628. "project": c.project,
  40629. "zone": c.zone,
  40630. "allocation": c.allocation,
  40631. })
  40632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40633. }
  40634. // Do executes the "compute.allocations.resize" call.
  40635. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40636. // status code is an error. Response headers are in either
  40637. // *Operation.ServerResponse.Header or (if a response was returned at
  40638. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40639. // to check whether the returned error was because
  40640. // http.StatusNotModified was returned.
  40641. func (c *AllocationsResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40642. gensupport.SetOptions(c.urlParams_, opts...)
  40643. res, err := c.doRequest("json")
  40644. if res != nil && res.StatusCode == http.StatusNotModified {
  40645. if res.Body != nil {
  40646. res.Body.Close()
  40647. }
  40648. return nil, &googleapi.Error{
  40649. Code: res.StatusCode,
  40650. Header: res.Header,
  40651. }
  40652. }
  40653. if err != nil {
  40654. return nil, err
  40655. }
  40656. defer googleapi.CloseBody(res)
  40657. if err := googleapi.CheckResponse(res); err != nil {
  40658. return nil, err
  40659. }
  40660. ret := &Operation{
  40661. ServerResponse: googleapi.ServerResponse{
  40662. Header: res.Header,
  40663. HTTPStatusCode: res.StatusCode,
  40664. },
  40665. }
  40666. target := &ret
  40667. if err := gensupport.DecodeResponse(target, res); err != nil {
  40668. return nil, err
  40669. }
  40670. return ret, nil
  40671. // {
  40672. // "description": "Resizes the allocation (applicable to standalone allocations only)",
  40673. // "httpMethod": "POST",
  40674. // "id": "compute.allocations.resize",
  40675. // "parameterOrder": [
  40676. // "project",
  40677. // "zone",
  40678. // "allocation"
  40679. // ],
  40680. // "parameters": {
  40681. // "allocation": {
  40682. // "description": "Name of the allocation to update.",
  40683. // "location": "path",
  40684. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40685. // "required": true,
  40686. // "type": "string"
  40687. // },
  40688. // "project": {
  40689. // "description": "Project ID for this request.",
  40690. // "location": "path",
  40691. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40692. // "required": true,
  40693. // "type": "string"
  40694. // },
  40695. // "requestId": {
  40696. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40697. // "location": "query",
  40698. // "type": "string"
  40699. // },
  40700. // "zone": {
  40701. // "description": "Name of the zone for this request.",
  40702. // "location": "path",
  40703. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40704. // "required": true,
  40705. // "type": "string"
  40706. // }
  40707. // },
  40708. // "path": "{project}/zones/{zone}/allocations/{allocation}/resize",
  40709. // "request": {
  40710. // "$ref": "AllocationsResizeRequest"
  40711. // },
  40712. // "response": {
  40713. // "$ref": "Operation"
  40714. // },
  40715. // "scopes": [
  40716. // "https://www.googleapis.com/auth/cloud-platform",
  40717. // "https://www.googleapis.com/auth/compute"
  40718. // ]
  40719. // }
  40720. }
  40721. // method id "compute.allocations.setIamPolicy":
  40722. type AllocationsSetIamPolicyCall struct {
  40723. s *Service
  40724. project string
  40725. zone string
  40726. resource string
  40727. zonesetpolicyrequest *ZoneSetPolicyRequest
  40728. urlParams_ gensupport.URLParams
  40729. ctx_ context.Context
  40730. header_ http.Header
  40731. }
  40732. // SetIamPolicy: Sets the access control policy on the specified
  40733. // resource. Replaces any existing policy.
  40734. func (r *AllocationsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *AllocationsSetIamPolicyCall {
  40735. c := &AllocationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40736. c.project = project
  40737. c.zone = zone
  40738. c.resource = resource
  40739. c.zonesetpolicyrequest = zonesetpolicyrequest
  40740. return c
  40741. }
  40742. // Fields allows partial responses to be retrieved. See
  40743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40744. // for more information.
  40745. func (c *AllocationsSetIamPolicyCall) Fields(s ...googleapi.Field) *AllocationsSetIamPolicyCall {
  40746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40747. return c
  40748. }
  40749. // Context sets the context to be used in this call's Do method. Any
  40750. // pending HTTP request will be aborted if the provided context is
  40751. // canceled.
  40752. func (c *AllocationsSetIamPolicyCall) Context(ctx context.Context) *AllocationsSetIamPolicyCall {
  40753. c.ctx_ = ctx
  40754. return c
  40755. }
  40756. // Header returns an http.Header that can be modified by the caller to
  40757. // add HTTP headers to the request.
  40758. func (c *AllocationsSetIamPolicyCall) Header() http.Header {
  40759. if c.header_ == nil {
  40760. c.header_ = make(http.Header)
  40761. }
  40762. return c.header_
  40763. }
  40764. func (c *AllocationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  40765. reqHeaders := make(http.Header)
  40766. for k, v := range c.header_ {
  40767. reqHeaders[k] = v
  40768. }
  40769. reqHeaders.Set("User-Agent", c.s.userAgent())
  40770. var body io.Reader = nil
  40771. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  40772. if err != nil {
  40773. return nil, err
  40774. }
  40775. reqHeaders.Set("Content-Type", "application/json")
  40776. c.urlParams_.Set("alt", alt)
  40777. c.urlParams_.Set("prettyPrint", "false")
  40778. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/setIamPolicy")
  40779. urls += "?" + c.urlParams_.Encode()
  40780. req, err := http.NewRequest("POST", urls, body)
  40781. if err != nil {
  40782. return nil, err
  40783. }
  40784. req.Header = reqHeaders
  40785. googleapi.Expand(req.URL, map[string]string{
  40786. "project": c.project,
  40787. "zone": c.zone,
  40788. "resource": c.resource,
  40789. })
  40790. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40791. }
  40792. // Do executes the "compute.allocations.setIamPolicy" call.
  40793. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  40794. // code is an error. Response headers are in either
  40795. // *Policy.ServerResponse.Header or (if a response was returned at all)
  40796. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40797. // check whether the returned error was because http.StatusNotModified
  40798. // was returned.
  40799. func (c *AllocationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  40800. gensupport.SetOptions(c.urlParams_, opts...)
  40801. res, err := c.doRequest("json")
  40802. if res != nil && res.StatusCode == http.StatusNotModified {
  40803. if res.Body != nil {
  40804. res.Body.Close()
  40805. }
  40806. return nil, &googleapi.Error{
  40807. Code: res.StatusCode,
  40808. Header: res.Header,
  40809. }
  40810. }
  40811. if err != nil {
  40812. return nil, err
  40813. }
  40814. defer googleapi.CloseBody(res)
  40815. if err := googleapi.CheckResponse(res); err != nil {
  40816. return nil, err
  40817. }
  40818. ret := &Policy{
  40819. ServerResponse: googleapi.ServerResponse{
  40820. Header: res.Header,
  40821. HTTPStatusCode: res.StatusCode,
  40822. },
  40823. }
  40824. target := &ret
  40825. if err := gensupport.DecodeResponse(target, res); err != nil {
  40826. return nil, err
  40827. }
  40828. return ret, nil
  40829. // {
  40830. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  40831. // "httpMethod": "POST",
  40832. // "id": "compute.allocations.setIamPolicy",
  40833. // "parameterOrder": [
  40834. // "project",
  40835. // "zone",
  40836. // "resource"
  40837. // ],
  40838. // "parameters": {
  40839. // "project": {
  40840. // "description": "Project ID for this request.",
  40841. // "location": "path",
  40842. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40843. // "required": true,
  40844. // "type": "string"
  40845. // },
  40846. // "resource": {
  40847. // "description": "Name or id of the resource for this request.",
  40848. // "location": "path",
  40849. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40850. // "required": true,
  40851. // "type": "string"
  40852. // },
  40853. // "zone": {
  40854. // "description": "The name of the zone for this request.",
  40855. // "location": "path",
  40856. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40857. // "required": true,
  40858. // "type": "string"
  40859. // }
  40860. // },
  40861. // "path": "{project}/zones/{zone}/allocations/{resource}/setIamPolicy",
  40862. // "request": {
  40863. // "$ref": "ZoneSetPolicyRequest"
  40864. // },
  40865. // "response": {
  40866. // "$ref": "Policy"
  40867. // },
  40868. // "scopes": [
  40869. // "https://www.googleapis.com/auth/cloud-platform",
  40870. // "https://www.googleapis.com/auth/compute"
  40871. // ]
  40872. // }
  40873. }
  40874. // method id "compute.allocations.testIamPermissions":
  40875. type AllocationsTestIamPermissionsCall struct {
  40876. s *Service
  40877. project string
  40878. zone string
  40879. resource string
  40880. testpermissionsrequest *TestPermissionsRequest
  40881. urlParams_ gensupport.URLParams
  40882. ctx_ context.Context
  40883. header_ http.Header
  40884. }
  40885. // TestIamPermissions: Returns permissions that a caller has on the
  40886. // specified resource.
  40887. func (r *AllocationsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AllocationsTestIamPermissionsCall {
  40888. c := &AllocationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40889. c.project = project
  40890. c.zone = zone
  40891. c.resource = resource
  40892. c.testpermissionsrequest = testpermissionsrequest
  40893. return c
  40894. }
  40895. // Fields allows partial responses to be retrieved. See
  40896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40897. // for more information.
  40898. func (c *AllocationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *AllocationsTestIamPermissionsCall {
  40899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40900. return c
  40901. }
  40902. // Context sets the context to be used in this call's Do method. Any
  40903. // pending HTTP request will be aborted if the provided context is
  40904. // canceled.
  40905. func (c *AllocationsTestIamPermissionsCall) Context(ctx context.Context) *AllocationsTestIamPermissionsCall {
  40906. c.ctx_ = ctx
  40907. return c
  40908. }
  40909. // Header returns an http.Header that can be modified by the caller to
  40910. // add HTTP headers to the request.
  40911. func (c *AllocationsTestIamPermissionsCall) Header() http.Header {
  40912. if c.header_ == nil {
  40913. c.header_ = make(http.Header)
  40914. }
  40915. return c.header_
  40916. }
  40917. func (c *AllocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  40918. reqHeaders := make(http.Header)
  40919. for k, v := range c.header_ {
  40920. reqHeaders[k] = v
  40921. }
  40922. reqHeaders.Set("User-Agent", c.s.userAgent())
  40923. var body io.Reader = nil
  40924. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  40925. if err != nil {
  40926. return nil, err
  40927. }
  40928. reqHeaders.Set("Content-Type", "application/json")
  40929. c.urlParams_.Set("alt", alt)
  40930. c.urlParams_.Set("prettyPrint", "false")
  40931. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/allocations/{resource}/testIamPermissions")
  40932. urls += "?" + c.urlParams_.Encode()
  40933. req, err := http.NewRequest("POST", urls, body)
  40934. if err != nil {
  40935. return nil, err
  40936. }
  40937. req.Header = reqHeaders
  40938. googleapi.Expand(req.URL, map[string]string{
  40939. "project": c.project,
  40940. "zone": c.zone,
  40941. "resource": c.resource,
  40942. })
  40943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40944. }
  40945. // Do executes the "compute.allocations.testIamPermissions" call.
  40946. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  40947. // non-2xx status code is an error. Response headers are in either
  40948. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  40949. // returned at all) in error.(*googleapi.Error).Header. Use
  40950. // googleapi.IsNotModified to check whether the returned error was
  40951. // because http.StatusNotModified was returned.
  40952. func (c *AllocationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  40953. gensupport.SetOptions(c.urlParams_, opts...)
  40954. res, err := c.doRequest("json")
  40955. if res != nil && res.StatusCode == http.StatusNotModified {
  40956. if res.Body != nil {
  40957. res.Body.Close()
  40958. }
  40959. return nil, &googleapi.Error{
  40960. Code: res.StatusCode,
  40961. Header: res.Header,
  40962. }
  40963. }
  40964. if err != nil {
  40965. return nil, err
  40966. }
  40967. defer googleapi.CloseBody(res)
  40968. if err := googleapi.CheckResponse(res); err != nil {
  40969. return nil, err
  40970. }
  40971. ret := &TestPermissionsResponse{
  40972. ServerResponse: googleapi.ServerResponse{
  40973. Header: res.Header,
  40974. HTTPStatusCode: res.StatusCode,
  40975. },
  40976. }
  40977. target := &ret
  40978. if err := gensupport.DecodeResponse(target, res); err != nil {
  40979. return nil, err
  40980. }
  40981. return ret, nil
  40982. // {
  40983. // "description": "Returns permissions that a caller has on the specified resource.",
  40984. // "httpMethod": "POST",
  40985. // "id": "compute.allocations.testIamPermissions",
  40986. // "parameterOrder": [
  40987. // "project",
  40988. // "zone",
  40989. // "resource"
  40990. // ],
  40991. // "parameters": {
  40992. // "project": {
  40993. // "description": "Project ID for this request.",
  40994. // "location": "path",
  40995. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40996. // "required": true,
  40997. // "type": "string"
  40998. // },
  40999. // "resource": {
  41000. // "description": "Name or id of the resource for this request.",
  41001. // "location": "path",
  41002. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41003. // "required": true,
  41004. // "type": "string"
  41005. // },
  41006. // "zone": {
  41007. // "description": "The name of the zone for this request.",
  41008. // "location": "path",
  41009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41010. // "required": true,
  41011. // "type": "string"
  41012. // }
  41013. // },
  41014. // "path": "{project}/zones/{zone}/allocations/{resource}/testIamPermissions",
  41015. // "request": {
  41016. // "$ref": "TestPermissionsRequest"
  41017. // },
  41018. // "response": {
  41019. // "$ref": "TestPermissionsResponse"
  41020. // },
  41021. // "scopes": [
  41022. // "https://www.googleapis.com/auth/cloud-platform",
  41023. // "https://www.googleapis.com/auth/compute",
  41024. // "https://www.googleapis.com/auth/compute.readonly"
  41025. // ]
  41026. // }
  41027. }
  41028. // method id "compute.autoscalers.aggregatedList":
  41029. type AutoscalersAggregatedListCall struct {
  41030. s *Service
  41031. project string
  41032. urlParams_ gensupport.URLParams
  41033. ifNoneMatch_ string
  41034. ctx_ context.Context
  41035. header_ http.Header
  41036. }
  41037. // AggregatedList: Retrieves an aggregated list of autoscalers.
  41038. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  41039. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41040. c.project = project
  41041. return c
  41042. }
  41043. // Filter sets the optional parameter "filter": A filter expression that
  41044. // filters resources listed in the response. The expression must specify
  41045. // the field name, a comparison operator, and the value that you want to
  41046. // use for filtering. The value must be a string, a number, or a
  41047. // boolean. The comparison operator must be either =, !=, >, or <.
  41048. //
  41049. // For example, if you are filtering Compute Engine instances, you can
  41050. // exclude instances named example-instance by specifying name !=
  41051. // example-instance.
  41052. //
  41053. // You can also filter nested fields. For example, you could specify
  41054. // scheduling.automaticRestart = false to include instances only if they
  41055. // are not scheduled for automatic restarts. You can use filtering on
  41056. // nested fields to filter based on resource labels.
  41057. //
  41058. // To filter on multiple expressions, provide each separate expression
  41059. // within parentheses. For example, (scheduling.automaticRestart = true)
  41060. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41061. // AND expression. However, you can include AND and OR expressions
  41062. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41063. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41064. // true).
  41065. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  41066. c.urlParams_.Set("filter", filter)
  41067. return c
  41068. }
  41069. // MaxResults sets the optional parameter "maxResults": The maximum
  41070. // number of results per page that should be returned. If the number of
  41071. // available results is larger than maxResults, Compute Engine returns a
  41072. // nextPageToken that can be used to get the next page of results in
  41073. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41074. // (Default: 500)
  41075. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  41076. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41077. return c
  41078. }
  41079. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41080. // a certain order. By default, results are returned in alphanumerical
  41081. // order based on the resource name.
  41082. //
  41083. // You can also sort results in descending order based on the creation
  41084. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41085. // based on the creationTimestamp field in reverse chronological order
  41086. // (newest result first). Use this to sort resources like operations so
  41087. // that the newest operation is returned first.
  41088. //
  41089. // Currently, only sorting by name or creationTimestamp desc is
  41090. // supported.
  41091. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  41092. c.urlParams_.Set("orderBy", orderBy)
  41093. return c
  41094. }
  41095. // PageToken sets the optional parameter "pageToken": Specifies a page
  41096. // token to use. Set pageToken to the nextPageToken returned by a
  41097. // previous list request to get the next page of results.
  41098. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  41099. c.urlParams_.Set("pageToken", pageToken)
  41100. return c
  41101. }
  41102. // Fields allows partial responses to be retrieved. See
  41103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41104. // for more information.
  41105. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  41106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41107. return c
  41108. }
  41109. // IfNoneMatch sets the optional parameter which makes the operation
  41110. // fail if the object's ETag matches the given value. This is useful for
  41111. // getting updates only after the object has changed since the last
  41112. // request. Use googleapi.IsNotModified to check whether the response
  41113. // error from Do is the result of In-None-Match.
  41114. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  41115. c.ifNoneMatch_ = entityTag
  41116. return c
  41117. }
  41118. // Context sets the context to be used in this call's Do method. Any
  41119. // pending HTTP request will be aborted if the provided context is
  41120. // canceled.
  41121. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  41122. c.ctx_ = ctx
  41123. return c
  41124. }
  41125. // Header returns an http.Header that can be modified by the caller to
  41126. // add HTTP headers to the request.
  41127. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  41128. if c.header_ == nil {
  41129. c.header_ = make(http.Header)
  41130. }
  41131. return c.header_
  41132. }
  41133. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  41134. reqHeaders := make(http.Header)
  41135. for k, v := range c.header_ {
  41136. reqHeaders[k] = v
  41137. }
  41138. reqHeaders.Set("User-Agent", c.s.userAgent())
  41139. if c.ifNoneMatch_ != "" {
  41140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41141. }
  41142. var body io.Reader = nil
  41143. c.urlParams_.Set("alt", alt)
  41144. c.urlParams_.Set("prettyPrint", "false")
  41145. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  41146. urls += "?" + c.urlParams_.Encode()
  41147. req, err := http.NewRequest("GET", urls, body)
  41148. if err != nil {
  41149. return nil, err
  41150. }
  41151. req.Header = reqHeaders
  41152. googleapi.Expand(req.URL, map[string]string{
  41153. "project": c.project,
  41154. })
  41155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41156. }
  41157. // Do executes the "compute.autoscalers.aggregatedList" call.
  41158. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  41159. // Any non-2xx status code is an error. Response headers are in either
  41160. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  41161. // returned at all) in error.(*googleapi.Error).Header. Use
  41162. // googleapi.IsNotModified to check whether the returned error was
  41163. // because http.StatusNotModified was returned.
  41164. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  41165. gensupport.SetOptions(c.urlParams_, opts...)
  41166. res, err := c.doRequest("json")
  41167. if res != nil && res.StatusCode == http.StatusNotModified {
  41168. if res.Body != nil {
  41169. res.Body.Close()
  41170. }
  41171. return nil, &googleapi.Error{
  41172. Code: res.StatusCode,
  41173. Header: res.Header,
  41174. }
  41175. }
  41176. if err != nil {
  41177. return nil, err
  41178. }
  41179. defer googleapi.CloseBody(res)
  41180. if err := googleapi.CheckResponse(res); err != nil {
  41181. return nil, err
  41182. }
  41183. ret := &AutoscalerAggregatedList{
  41184. ServerResponse: googleapi.ServerResponse{
  41185. Header: res.Header,
  41186. HTTPStatusCode: res.StatusCode,
  41187. },
  41188. }
  41189. target := &ret
  41190. if err := gensupport.DecodeResponse(target, res); err != nil {
  41191. return nil, err
  41192. }
  41193. return ret, nil
  41194. // {
  41195. // "description": "Retrieves an aggregated list of autoscalers.",
  41196. // "httpMethod": "GET",
  41197. // "id": "compute.autoscalers.aggregatedList",
  41198. // "parameterOrder": [
  41199. // "project"
  41200. // ],
  41201. // "parameters": {
  41202. // "filter": {
  41203. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  41204. // "location": "query",
  41205. // "type": "string"
  41206. // },
  41207. // "maxResults": {
  41208. // "default": "500",
  41209. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41210. // "format": "uint32",
  41211. // "location": "query",
  41212. // "minimum": "0",
  41213. // "type": "integer"
  41214. // },
  41215. // "orderBy": {
  41216. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41217. // "location": "query",
  41218. // "type": "string"
  41219. // },
  41220. // "pageToken": {
  41221. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41222. // "location": "query",
  41223. // "type": "string"
  41224. // },
  41225. // "project": {
  41226. // "description": "Project ID for this request.",
  41227. // "location": "path",
  41228. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41229. // "required": true,
  41230. // "type": "string"
  41231. // }
  41232. // },
  41233. // "path": "{project}/aggregated/autoscalers",
  41234. // "response": {
  41235. // "$ref": "AutoscalerAggregatedList"
  41236. // },
  41237. // "scopes": [
  41238. // "https://www.googleapis.com/auth/cloud-platform",
  41239. // "https://www.googleapis.com/auth/compute",
  41240. // "https://www.googleapis.com/auth/compute.readonly"
  41241. // ]
  41242. // }
  41243. }
  41244. // Pages invokes f for each page of results.
  41245. // A non-nil error returned from f will halt the iteration.
  41246. // The provided context supersedes any context provided to the Context method.
  41247. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  41248. c.ctx_ = ctx
  41249. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41250. for {
  41251. x, err := c.Do()
  41252. if err != nil {
  41253. return err
  41254. }
  41255. if err := f(x); err != nil {
  41256. return err
  41257. }
  41258. if x.NextPageToken == "" {
  41259. return nil
  41260. }
  41261. c.PageToken(x.NextPageToken)
  41262. }
  41263. }
  41264. // method id "compute.autoscalers.delete":
  41265. type AutoscalersDeleteCall struct {
  41266. s *Service
  41267. project string
  41268. zone string
  41269. autoscaler string
  41270. urlParams_ gensupport.URLParams
  41271. ctx_ context.Context
  41272. header_ http.Header
  41273. }
  41274. // Delete: Deletes the specified autoscaler.
  41275. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  41276. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41277. c.project = project
  41278. c.zone = zone
  41279. c.autoscaler = autoscaler
  41280. return c
  41281. }
  41282. // RequestId sets the optional parameter "requestId": An optional
  41283. // request ID to identify requests. Specify a unique request ID so that
  41284. // if you must retry your request, the server will know to ignore the
  41285. // request if it has already been completed.
  41286. //
  41287. // For example, consider a situation where you make an initial request
  41288. // and the request times out. If you make the request again with the
  41289. // same request ID, the server can check if original operation with the
  41290. // same request ID was received, and if so, will ignore the second
  41291. // request. This prevents clients from accidentally creating duplicate
  41292. // commitments.
  41293. //
  41294. // The request ID must be a valid UUID with the exception that zero UUID
  41295. // is not supported (00000000-0000-0000-0000-000000000000).
  41296. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  41297. c.urlParams_.Set("requestId", requestId)
  41298. return c
  41299. }
  41300. // Fields allows partial responses to be retrieved. See
  41301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41302. // for more information.
  41303. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  41304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41305. return c
  41306. }
  41307. // Context sets the context to be used in this call's Do method. Any
  41308. // pending HTTP request will be aborted if the provided context is
  41309. // canceled.
  41310. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  41311. c.ctx_ = ctx
  41312. return c
  41313. }
  41314. // Header returns an http.Header that can be modified by the caller to
  41315. // add HTTP headers to the request.
  41316. func (c *AutoscalersDeleteCall) Header() http.Header {
  41317. if c.header_ == nil {
  41318. c.header_ = make(http.Header)
  41319. }
  41320. return c.header_
  41321. }
  41322. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  41323. reqHeaders := make(http.Header)
  41324. for k, v := range c.header_ {
  41325. reqHeaders[k] = v
  41326. }
  41327. reqHeaders.Set("User-Agent", c.s.userAgent())
  41328. var body io.Reader = nil
  41329. c.urlParams_.Set("alt", alt)
  41330. c.urlParams_.Set("prettyPrint", "false")
  41331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  41332. urls += "?" + c.urlParams_.Encode()
  41333. req, err := http.NewRequest("DELETE", urls, body)
  41334. if err != nil {
  41335. return nil, err
  41336. }
  41337. req.Header = reqHeaders
  41338. googleapi.Expand(req.URL, map[string]string{
  41339. "project": c.project,
  41340. "zone": c.zone,
  41341. "autoscaler": c.autoscaler,
  41342. })
  41343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41344. }
  41345. // Do executes the "compute.autoscalers.delete" call.
  41346. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41347. // status code is an error. Response headers are in either
  41348. // *Operation.ServerResponse.Header or (if a response was returned at
  41349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41350. // to check whether the returned error was because
  41351. // http.StatusNotModified was returned.
  41352. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41353. gensupport.SetOptions(c.urlParams_, opts...)
  41354. res, err := c.doRequest("json")
  41355. if res != nil && res.StatusCode == http.StatusNotModified {
  41356. if res.Body != nil {
  41357. res.Body.Close()
  41358. }
  41359. return nil, &googleapi.Error{
  41360. Code: res.StatusCode,
  41361. Header: res.Header,
  41362. }
  41363. }
  41364. if err != nil {
  41365. return nil, err
  41366. }
  41367. defer googleapi.CloseBody(res)
  41368. if err := googleapi.CheckResponse(res); err != nil {
  41369. return nil, err
  41370. }
  41371. ret := &Operation{
  41372. ServerResponse: googleapi.ServerResponse{
  41373. Header: res.Header,
  41374. HTTPStatusCode: res.StatusCode,
  41375. },
  41376. }
  41377. target := &ret
  41378. if err := gensupport.DecodeResponse(target, res); err != nil {
  41379. return nil, err
  41380. }
  41381. return ret, nil
  41382. // {
  41383. // "description": "Deletes the specified autoscaler.",
  41384. // "httpMethod": "DELETE",
  41385. // "id": "compute.autoscalers.delete",
  41386. // "parameterOrder": [
  41387. // "project",
  41388. // "zone",
  41389. // "autoscaler"
  41390. // ],
  41391. // "parameters": {
  41392. // "autoscaler": {
  41393. // "description": "Name of the autoscaler to delete.",
  41394. // "location": "path",
  41395. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41396. // "required": true,
  41397. // "type": "string"
  41398. // },
  41399. // "project": {
  41400. // "description": "Project ID for this request.",
  41401. // "location": "path",
  41402. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41403. // "required": true,
  41404. // "type": "string"
  41405. // },
  41406. // "requestId": {
  41407. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41408. // "location": "query",
  41409. // "type": "string"
  41410. // },
  41411. // "zone": {
  41412. // "description": "Name of the zone for this request.",
  41413. // "location": "path",
  41414. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41415. // "required": true,
  41416. // "type": "string"
  41417. // }
  41418. // },
  41419. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  41420. // "response": {
  41421. // "$ref": "Operation"
  41422. // },
  41423. // "scopes": [
  41424. // "https://www.googleapis.com/auth/cloud-platform",
  41425. // "https://www.googleapis.com/auth/compute"
  41426. // ]
  41427. // }
  41428. }
  41429. // method id "compute.autoscalers.get":
  41430. type AutoscalersGetCall struct {
  41431. s *Service
  41432. project string
  41433. zone string
  41434. autoscaler string
  41435. urlParams_ gensupport.URLParams
  41436. ifNoneMatch_ string
  41437. ctx_ context.Context
  41438. header_ http.Header
  41439. }
  41440. // Get: Returns the specified autoscaler resource. Gets a list of
  41441. // available autoscalers by making a list() request.
  41442. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  41443. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41444. c.project = project
  41445. c.zone = zone
  41446. c.autoscaler = autoscaler
  41447. return c
  41448. }
  41449. // Fields allows partial responses to be retrieved. See
  41450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41451. // for more information.
  41452. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  41453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41454. return c
  41455. }
  41456. // IfNoneMatch sets the optional parameter which makes the operation
  41457. // fail if the object's ETag matches the given value. This is useful for
  41458. // getting updates only after the object has changed since the last
  41459. // request. Use googleapi.IsNotModified to check whether the response
  41460. // error from Do is the result of In-None-Match.
  41461. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  41462. c.ifNoneMatch_ = entityTag
  41463. return c
  41464. }
  41465. // Context sets the context to be used in this call's Do method. Any
  41466. // pending HTTP request will be aborted if the provided context is
  41467. // canceled.
  41468. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  41469. c.ctx_ = ctx
  41470. return c
  41471. }
  41472. // Header returns an http.Header that can be modified by the caller to
  41473. // add HTTP headers to the request.
  41474. func (c *AutoscalersGetCall) Header() http.Header {
  41475. if c.header_ == nil {
  41476. c.header_ = make(http.Header)
  41477. }
  41478. return c.header_
  41479. }
  41480. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  41481. reqHeaders := make(http.Header)
  41482. for k, v := range c.header_ {
  41483. reqHeaders[k] = v
  41484. }
  41485. reqHeaders.Set("User-Agent", c.s.userAgent())
  41486. if c.ifNoneMatch_ != "" {
  41487. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41488. }
  41489. var body io.Reader = nil
  41490. c.urlParams_.Set("alt", alt)
  41491. c.urlParams_.Set("prettyPrint", "false")
  41492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  41493. urls += "?" + c.urlParams_.Encode()
  41494. req, err := http.NewRequest("GET", urls, body)
  41495. if err != nil {
  41496. return nil, err
  41497. }
  41498. req.Header = reqHeaders
  41499. googleapi.Expand(req.URL, map[string]string{
  41500. "project": c.project,
  41501. "zone": c.zone,
  41502. "autoscaler": c.autoscaler,
  41503. })
  41504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41505. }
  41506. // Do executes the "compute.autoscalers.get" call.
  41507. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  41508. // status code is an error. Response headers are in either
  41509. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  41510. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41511. // to check whether the returned error was because
  41512. // http.StatusNotModified was returned.
  41513. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  41514. gensupport.SetOptions(c.urlParams_, opts...)
  41515. res, err := c.doRequest("json")
  41516. if res != nil && res.StatusCode == http.StatusNotModified {
  41517. if res.Body != nil {
  41518. res.Body.Close()
  41519. }
  41520. return nil, &googleapi.Error{
  41521. Code: res.StatusCode,
  41522. Header: res.Header,
  41523. }
  41524. }
  41525. if err != nil {
  41526. return nil, err
  41527. }
  41528. defer googleapi.CloseBody(res)
  41529. if err := googleapi.CheckResponse(res); err != nil {
  41530. return nil, err
  41531. }
  41532. ret := &Autoscaler{
  41533. ServerResponse: googleapi.ServerResponse{
  41534. Header: res.Header,
  41535. HTTPStatusCode: res.StatusCode,
  41536. },
  41537. }
  41538. target := &ret
  41539. if err := gensupport.DecodeResponse(target, res); err != nil {
  41540. return nil, err
  41541. }
  41542. return ret, nil
  41543. // {
  41544. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  41545. // "httpMethod": "GET",
  41546. // "id": "compute.autoscalers.get",
  41547. // "parameterOrder": [
  41548. // "project",
  41549. // "zone",
  41550. // "autoscaler"
  41551. // ],
  41552. // "parameters": {
  41553. // "autoscaler": {
  41554. // "description": "Name of the autoscaler to return.",
  41555. // "location": "path",
  41556. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41557. // "required": true,
  41558. // "type": "string"
  41559. // },
  41560. // "project": {
  41561. // "description": "Project ID for this request.",
  41562. // "location": "path",
  41563. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41564. // "required": true,
  41565. // "type": "string"
  41566. // },
  41567. // "zone": {
  41568. // "description": "Name of the zone for this request.",
  41569. // "location": "path",
  41570. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41571. // "required": true,
  41572. // "type": "string"
  41573. // }
  41574. // },
  41575. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  41576. // "response": {
  41577. // "$ref": "Autoscaler"
  41578. // },
  41579. // "scopes": [
  41580. // "https://www.googleapis.com/auth/cloud-platform",
  41581. // "https://www.googleapis.com/auth/compute",
  41582. // "https://www.googleapis.com/auth/compute.readonly"
  41583. // ]
  41584. // }
  41585. }
  41586. // method id "compute.autoscalers.insert":
  41587. type AutoscalersInsertCall struct {
  41588. s *Service
  41589. project string
  41590. zone string
  41591. autoscaler *Autoscaler
  41592. urlParams_ gensupport.URLParams
  41593. ctx_ context.Context
  41594. header_ http.Header
  41595. }
  41596. // Insert: Creates an autoscaler in the specified project using the data
  41597. // included in the request.
  41598. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  41599. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41600. c.project = project
  41601. c.zone = zone
  41602. c.autoscaler = autoscaler
  41603. return c
  41604. }
  41605. // RequestId sets the optional parameter "requestId": An optional
  41606. // request ID to identify requests. Specify a unique request ID so that
  41607. // if you must retry your request, the server will know to ignore the
  41608. // request if it has already been completed.
  41609. //
  41610. // For example, consider a situation where you make an initial request
  41611. // and the request times out. If you make the request again with the
  41612. // same request ID, the server can check if original operation with the
  41613. // same request ID was received, and if so, will ignore the second
  41614. // request. This prevents clients from accidentally creating duplicate
  41615. // commitments.
  41616. //
  41617. // The request ID must be a valid UUID with the exception that zero UUID
  41618. // is not supported (00000000-0000-0000-0000-000000000000).
  41619. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  41620. c.urlParams_.Set("requestId", requestId)
  41621. return c
  41622. }
  41623. // Fields allows partial responses to be retrieved. See
  41624. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41625. // for more information.
  41626. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  41627. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41628. return c
  41629. }
  41630. // Context sets the context to be used in this call's Do method. Any
  41631. // pending HTTP request will be aborted if the provided context is
  41632. // canceled.
  41633. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  41634. c.ctx_ = ctx
  41635. return c
  41636. }
  41637. // Header returns an http.Header that can be modified by the caller to
  41638. // add HTTP headers to the request.
  41639. func (c *AutoscalersInsertCall) Header() http.Header {
  41640. if c.header_ == nil {
  41641. c.header_ = make(http.Header)
  41642. }
  41643. return c.header_
  41644. }
  41645. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  41646. reqHeaders := make(http.Header)
  41647. for k, v := range c.header_ {
  41648. reqHeaders[k] = v
  41649. }
  41650. reqHeaders.Set("User-Agent", c.s.userAgent())
  41651. var body io.Reader = nil
  41652. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  41653. if err != nil {
  41654. return nil, err
  41655. }
  41656. reqHeaders.Set("Content-Type", "application/json")
  41657. c.urlParams_.Set("alt", alt)
  41658. c.urlParams_.Set("prettyPrint", "false")
  41659. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  41660. urls += "?" + c.urlParams_.Encode()
  41661. req, err := http.NewRequest("POST", urls, body)
  41662. if err != nil {
  41663. return nil, err
  41664. }
  41665. req.Header = reqHeaders
  41666. googleapi.Expand(req.URL, map[string]string{
  41667. "project": c.project,
  41668. "zone": c.zone,
  41669. })
  41670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41671. }
  41672. // Do executes the "compute.autoscalers.insert" call.
  41673. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41674. // status code is an error. Response headers are in either
  41675. // *Operation.ServerResponse.Header or (if a response was returned at
  41676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41677. // to check whether the returned error was because
  41678. // http.StatusNotModified was returned.
  41679. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41680. gensupport.SetOptions(c.urlParams_, opts...)
  41681. res, err := c.doRequest("json")
  41682. if res != nil && res.StatusCode == http.StatusNotModified {
  41683. if res.Body != nil {
  41684. res.Body.Close()
  41685. }
  41686. return nil, &googleapi.Error{
  41687. Code: res.StatusCode,
  41688. Header: res.Header,
  41689. }
  41690. }
  41691. if err != nil {
  41692. return nil, err
  41693. }
  41694. defer googleapi.CloseBody(res)
  41695. if err := googleapi.CheckResponse(res); err != nil {
  41696. return nil, err
  41697. }
  41698. ret := &Operation{
  41699. ServerResponse: googleapi.ServerResponse{
  41700. Header: res.Header,
  41701. HTTPStatusCode: res.StatusCode,
  41702. },
  41703. }
  41704. target := &ret
  41705. if err := gensupport.DecodeResponse(target, res); err != nil {
  41706. return nil, err
  41707. }
  41708. return ret, nil
  41709. // {
  41710. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  41711. // "httpMethod": "POST",
  41712. // "id": "compute.autoscalers.insert",
  41713. // "parameterOrder": [
  41714. // "project",
  41715. // "zone"
  41716. // ],
  41717. // "parameters": {
  41718. // "project": {
  41719. // "description": "Project ID for this request.",
  41720. // "location": "path",
  41721. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41722. // "required": true,
  41723. // "type": "string"
  41724. // },
  41725. // "requestId": {
  41726. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41727. // "location": "query",
  41728. // "type": "string"
  41729. // },
  41730. // "zone": {
  41731. // "description": "Name of the zone for this request.",
  41732. // "location": "path",
  41733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41734. // "required": true,
  41735. // "type": "string"
  41736. // }
  41737. // },
  41738. // "path": "{project}/zones/{zone}/autoscalers",
  41739. // "request": {
  41740. // "$ref": "Autoscaler"
  41741. // },
  41742. // "response": {
  41743. // "$ref": "Operation"
  41744. // },
  41745. // "scopes": [
  41746. // "https://www.googleapis.com/auth/cloud-platform",
  41747. // "https://www.googleapis.com/auth/compute"
  41748. // ]
  41749. // }
  41750. }
  41751. // method id "compute.autoscalers.list":
  41752. type AutoscalersListCall struct {
  41753. s *Service
  41754. project string
  41755. zone string
  41756. urlParams_ gensupport.URLParams
  41757. ifNoneMatch_ string
  41758. ctx_ context.Context
  41759. header_ http.Header
  41760. }
  41761. // List: Retrieves a list of autoscalers contained within the specified
  41762. // zone.
  41763. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  41764. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41765. c.project = project
  41766. c.zone = zone
  41767. return c
  41768. }
  41769. // Filter sets the optional parameter "filter": A filter expression that
  41770. // filters resources listed in the response. The expression must specify
  41771. // the field name, a comparison operator, and the value that you want to
  41772. // use for filtering. The value must be a string, a number, or a
  41773. // boolean. The comparison operator must be either =, !=, >, or <.
  41774. //
  41775. // For example, if you are filtering Compute Engine instances, you can
  41776. // exclude instances named example-instance by specifying name !=
  41777. // example-instance.
  41778. //
  41779. // You can also filter nested fields. For example, you could specify
  41780. // scheduling.automaticRestart = false to include instances only if they
  41781. // are not scheduled for automatic restarts. You can use filtering on
  41782. // nested fields to filter based on resource labels.
  41783. //
  41784. // To filter on multiple expressions, provide each separate expression
  41785. // within parentheses. For example, (scheduling.automaticRestart = true)
  41786. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41787. // AND expression. However, you can include AND and OR expressions
  41788. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41789. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41790. // true).
  41791. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  41792. c.urlParams_.Set("filter", filter)
  41793. return c
  41794. }
  41795. // MaxResults sets the optional parameter "maxResults": The maximum
  41796. // number of results per page that should be returned. If the number of
  41797. // available results is larger than maxResults, Compute Engine returns a
  41798. // nextPageToken that can be used to get the next page of results in
  41799. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41800. // (Default: 500)
  41801. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  41802. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41803. return c
  41804. }
  41805. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41806. // a certain order. By default, results are returned in alphanumerical
  41807. // order based on the resource name.
  41808. //
  41809. // You can also sort results in descending order based on the creation
  41810. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41811. // based on the creationTimestamp field in reverse chronological order
  41812. // (newest result first). Use this to sort resources like operations so
  41813. // that the newest operation is returned first.
  41814. //
  41815. // Currently, only sorting by name or creationTimestamp desc is
  41816. // supported.
  41817. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  41818. c.urlParams_.Set("orderBy", orderBy)
  41819. return c
  41820. }
  41821. // PageToken sets the optional parameter "pageToken": Specifies a page
  41822. // token to use. Set pageToken to the nextPageToken returned by a
  41823. // previous list request to get the next page of results.
  41824. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  41825. c.urlParams_.Set("pageToken", pageToken)
  41826. return c
  41827. }
  41828. // Fields allows partial responses to be retrieved. See
  41829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41830. // for more information.
  41831. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  41832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41833. return c
  41834. }
  41835. // IfNoneMatch sets the optional parameter which makes the operation
  41836. // fail if the object's ETag matches the given value. This is useful for
  41837. // getting updates only after the object has changed since the last
  41838. // request. Use googleapi.IsNotModified to check whether the response
  41839. // error from Do is the result of In-None-Match.
  41840. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  41841. c.ifNoneMatch_ = entityTag
  41842. return c
  41843. }
  41844. // Context sets the context to be used in this call's Do method. Any
  41845. // pending HTTP request will be aborted if the provided context is
  41846. // canceled.
  41847. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  41848. c.ctx_ = ctx
  41849. return c
  41850. }
  41851. // Header returns an http.Header that can be modified by the caller to
  41852. // add HTTP headers to the request.
  41853. func (c *AutoscalersListCall) Header() http.Header {
  41854. if c.header_ == nil {
  41855. c.header_ = make(http.Header)
  41856. }
  41857. return c.header_
  41858. }
  41859. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  41860. reqHeaders := make(http.Header)
  41861. for k, v := range c.header_ {
  41862. reqHeaders[k] = v
  41863. }
  41864. reqHeaders.Set("User-Agent", c.s.userAgent())
  41865. if c.ifNoneMatch_ != "" {
  41866. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41867. }
  41868. var body io.Reader = nil
  41869. c.urlParams_.Set("alt", alt)
  41870. c.urlParams_.Set("prettyPrint", "false")
  41871. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  41872. urls += "?" + c.urlParams_.Encode()
  41873. req, err := http.NewRequest("GET", urls, body)
  41874. if err != nil {
  41875. return nil, err
  41876. }
  41877. req.Header = reqHeaders
  41878. googleapi.Expand(req.URL, map[string]string{
  41879. "project": c.project,
  41880. "zone": c.zone,
  41881. })
  41882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41883. }
  41884. // Do executes the "compute.autoscalers.list" call.
  41885. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  41886. // status code is an error. Response headers are in either
  41887. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  41888. // at all) in error.(*googleapi.Error).Header. Use
  41889. // googleapi.IsNotModified to check whether the returned error was
  41890. // because http.StatusNotModified was returned.
  41891. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  41892. gensupport.SetOptions(c.urlParams_, opts...)
  41893. res, err := c.doRequest("json")
  41894. if res != nil && res.StatusCode == http.StatusNotModified {
  41895. if res.Body != nil {
  41896. res.Body.Close()
  41897. }
  41898. return nil, &googleapi.Error{
  41899. Code: res.StatusCode,
  41900. Header: res.Header,
  41901. }
  41902. }
  41903. if err != nil {
  41904. return nil, err
  41905. }
  41906. defer googleapi.CloseBody(res)
  41907. if err := googleapi.CheckResponse(res); err != nil {
  41908. return nil, err
  41909. }
  41910. ret := &AutoscalerList{
  41911. ServerResponse: googleapi.ServerResponse{
  41912. Header: res.Header,
  41913. HTTPStatusCode: res.StatusCode,
  41914. },
  41915. }
  41916. target := &ret
  41917. if err := gensupport.DecodeResponse(target, res); err != nil {
  41918. return nil, err
  41919. }
  41920. return ret, nil
  41921. // {
  41922. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  41923. // "httpMethod": "GET",
  41924. // "id": "compute.autoscalers.list",
  41925. // "parameterOrder": [
  41926. // "project",
  41927. // "zone"
  41928. // ],
  41929. // "parameters": {
  41930. // "filter": {
  41931. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  41932. // "location": "query",
  41933. // "type": "string"
  41934. // },
  41935. // "maxResults": {
  41936. // "default": "500",
  41937. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41938. // "format": "uint32",
  41939. // "location": "query",
  41940. // "minimum": "0",
  41941. // "type": "integer"
  41942. // },
  41943. // "orderBy": {
  41944. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41945. // "location": "query",
  41946. // "type": "string"
  41947. // },
  41948. // "pageToken": {
  41949. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41950. // "location": "query",
  41951. // "type": "string"
  41952. // },
  41953. // "project": {
  41954. // "description": "Project ID for this request.",
  41955. // "location": "path",
  41956. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41957. // "required": true,
  41958. // "type": "string"
  41959. // },
  41960. // "zone": {
  41961. // "description": "Name of the zone for this request.",
  41962. // "location": "path",
  41963. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41964. // "required": true,
  41965. // "type": "string"
  41966. // }
  41967. // },
  41968. // "path": "{project}/zones/{zone}/autoscalers",
  41969. // "response": {
  41970. // "$ref": "AutoscalerList"
  41971. // },
  41972. // "scopes": [
  41973. // "https://www.googleapis.com/auth/cloud-platform",
  41974. // "https://www.googleapis.com/auth/compute",
  41975. // "https://www.googleapis.com/auth/compute.readonly"
  41976. // ]
  41977. // }
  41978. }
  41979. // Pages invokes f for each page of results.
  41980. // A non-nil error returned from f will halt the iteration.
  41981. // The provided context supersedes any context provided to the Context method.
  41982. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  41983. c.ctx_ = ctx
  41984. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41985. for {
  41986. x, err := c.Do()
  41987. if err != nil {
  41988. return err
  41989. }
  41990. if err := f(x); err != nil {
  41991. return err
  41992. }
  41993. if x.NextPageToken == "" {
  41994. return nil
  41995. }
  41996. c.PageToken(x.NextPageToken)
  41997. }
  41998. }
  41999. // method id "compute.autoscalers.patch":
  42000. type AutoscalersPatchCall struct {
  42001. s *Service
  42002. project string
  42003. zone string
  42004. autoscaler *Autoscaler
  42005. urlParams_ gensupport.URLParams
  42006. ctx_ context.Context
  42007. header_ http.Header
  42008. }
  42009. // Patch: Updates an autoscaler in the specified project using the data
  42010. // included in the request. This method supports PATCH semantics and
  42011. // uses the JSON merge patch format and processing rules.
  42012. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  42013. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42014. c.project = project
  42015. c.zone = zone
  42016. c.autoscaler = autoscaler
  42017. return c
  42018. }
  42019. // Autoscaler sets the optional parameter "autoscaler": Name of the
  42020. // autoscaler to patch.
  42021. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  42022. c.urlParams_.Set("autoscaler", autoscaler)
  42023. return c
  42024. }
  42025. // RequestId sets the optional parameter "requestId": An optional
  42026. // request ID to identify requests. Specify a unique request ID so that
  42027. // if you must retry your request, the server will know to ignore the
  42028. // request if it has already been completed.
  42029. //
  42030. // For example, consider a situation where you make an initial request
  42031. // and the request times out. If you make the request again with the
  42032. // same request ID, the server can check if original operation with the
  42033. // same request ID was received, and if so, will ignore the second
  42034. // request. This prevents clients from accidentally creating duplicate
  42035. // commitments.
  42036. //
  42037. // The request ID must be a valid UUID with the exception that zero UUID
  42038. // is not supported (00000000-0000-0000-0000-000000000000).
  42039. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  42040. c.urlParams_.Set("requestId", requestId)
  42041. return c
  42042. }
  42043. // Fields allows partial responses to be retrieved. See
  42044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42045. // for more information.
  42046. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  42047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42048. return c
  42049. }
  42050. // Context sets the context to be used in this call's Do method. Any
  42051. // pending HTTP request will be aborted if the provided context is
  42052. // canceled.
  42053. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  42054. c.ctx_ = ctx
  42055. return c
  42056. }
  42057. // Header returns an http.Header that can be modified by the caller to
  42058. // add HTTP headers to the request.
  42059. func (c *AutoscalersPatchCall) Header() http.Header {
  42060. if c.header_ == nil {
  42061. c.header_ = make(http.Header)
  42062. }
  42063. return c.header_
  42064. }
  42065. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  42066. reqHeaders := make(http.Header)
  42067. for k, v := range c.header_ {
  42068. reqHeaders[k] = v
  42069. }
  42070. reqHeaders.Set("User-Agent", c.s.userAgent())
  42071. var body io.Reader = nil
  42072. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  42073. if err != nil {
  42074. return nil, err
  42075. }
  42076. reqHeaders.Set("Content-Type", "application/json")
  42077. c.urlParams_.Set("alt", alt)
  42078. c.urlParams_.Set("prettyPrint", "false")
  42079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  42080. urls += "?" + c.urlParams_.Encode()
  42081. req, err := http.NewRequest("PATCH", urls, body)
  42082. if err != nil {
  42083. return nil, err
  42084. }
  42085. req.Header = reqHeaders
  42086. googleapi.Expand(req.URL, map[string]string{
  42087. "project": c.project,
  42088. "zone": c.zone,
  42089. })
  42090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42091. }
  42092. // Do executes the "compute.autoscalers.patch" call.
  42093. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42094. // status code is an error. Response headers are in either
  42095. // *Operation.ServerResponse.Header or (if a response was returned at
  42096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42097. // to check whether the returned error was because
  42098. // http.StatusNotModified was returned.
  42099. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42100. gensupport.SetOptions(c.urlParams_, opts...)
  42101. res, err := c.doRequest("json")
  42102. if res != nil && res.StatusCode == http.StatusNotModified {
  42103. if res.Body != nil {
  42104. res.Body.Close()
  42105. }
  42106. return nil, &googleapi.Error{
  42107. Code: res.StatusCode,
  42108. Header: res.Header,
  42109. }
  42110. }
  42111. if err != nil {
  42112. return nil, err
  42113. }
  42114. defer googleapi.CloseBody(res)
  42115. if err := googleapi.CheckResponse(res); err != nil {
  42116. return nil, err
  42117. }
  42118. ret := &Operation{
  42119. ServerResponse: googleapi.ServerResponse{
  42120. Header: res.Header,
  42121. HTTPStatusCode: res.StatusCode,
  42122. },
  42123. }
  42124. target := &ret
  42125. if err := gensupport.DecodeResponse(target, res); err != nil {
  42126. return nil, err
  42127. }
  42128. return ret, nil
  42129. // {
  42130. // "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  42131. // "httpMethod": "PATCH",
  42132. // "id": "compute.autoscalers.patch",
  42133. // "parameterOrder": [
  42134. // "project",
  42135. // "zone"
  42136. // ],
  42137. // "parameters": {
  42138. // "autoscaler": {
  42139. // "description": "Name of the autoscaler to patch.",
  42140. // "location": "query",
  42141. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42142. // "type": "string"
  42143. // },
  42144. // "project": {
  42145. // "description": "Project ID for this request.",
  42146. // "location": "path",
  42147. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42148. // "required": true,
  42149. // "type": "string"
  42150. // },
  42151. // "requestId": {
  42152. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42153. // "location": "query",
  42154. // "type": "string"
  42155. // },
  42156. // "zone": {
  42157. // "description": "Name of the zone for this request.",
  42158. // "location": "path",
  42159. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42160. // "required": true,
  42161. // "type": "string"
  42162. // }
  42163. // },
  42164. // "path": "{project}/zones/{zone}/autoscalers",
  42165. // "request": {
  42166. // "$ref": "Autoscaler"
  42167. // },
  42168. // "response": {
  42169. // "$ref": "Operation"
  42170. // },
  42171. // "scopes": [
  42172. // "https://www.googleapis.com/auth/cloud-platform",
  42173. // "https://www.googleapis.com/auth/compute"
  42174. // ]
  42175. // }
  42176. }
  42177. // method id "compute.autoscalers.testIamPermissions":
  42178. type AutoscalersTestIamPermissionsCall struct {
  42179. s *Service
  42180. project string
  42181. zone string
  42182. resource string
  42183. testpermissionsrequest *TestPermissionsRequest
  42184. urlParams_ gensupport.URLParams
  42185. ctx_ context.Context
  42186. header_ http.Header
  42187. }
  42188. // TestIamPermissions: Returns permissions that a caller has on the
  42189. // specified resource.
  42190. func (r *AutoscalersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AutoscalersTestIamPermissionsCall {
  42191. c := &AutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42192. c.project = project
  42193. c.zone = zone
  42194. c.resource = resource
  42195. c.testpermissionsrequest = testpermissionsrequest
  42196. return c
  42197. }
  42198. // Fields allows partial responses to be retrieved. See
  42199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42200. // for more information.
  42201. func (c *AutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *AutoscalersTestIamPermissionsCall {
  42202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42203. return c
  42204. }
  42205. // Context sets the context to be used in this call's Do method. Any
  42206. // pending HTTP request will be aborted if the provided context is
  42207. // canceled.
  42208. func (c *AutoscalersTestIamPermissionsCall) Context(ctx context.Context) *AutoscalersTestIamPermissionsCall {
  42209. c.ctx_ = ctx
  42210. return c
  42211. }
  42212. // Header returns an http.Header that can be modified by the caller to
  42213. // add HTTP headers to the request.
  42214. func (c *AutoscalersTestIamPermissionsCall) Header() http.Header {
  42215. if c.header_ == nil {
  42216. c.header_ = make(http.Header)
  42217. }
  42218. return c.header_
  42219. }
  42220. func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  42221. reqHeaders := make(http.Header)
  42222. for k, v := range c.header_ {
  42223. reqHeaders[k] = v
  42224. }
  42225. reqHeaders.Set("User-Agent", c.s.userAgent())
  42226. var body io.Reader = nil
  42227. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  42228. if err != nil {
  42229. return nil, err
  42230. }
  42231. reqHeaders.Set("Content-Type", "application/json")
  42232. c.urlParams_.Set("alt", alt)
  42233. c.urlParams_.Set("prettyPrint", "false")
  42234. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions")
  42235. urls += "?" + c.urlParams_.Encode()
  42236. req, err := http.NewRequest("POST", urls, body)
  42237. if err != nil {
  42238. return nil, err
  42239. }
  42240. req.Header = reqHeaders
  42241. googleapi.Expand(req.URL, map[string]string{
  42242. "project": c.project,
  42243. "zone": c.zone,
  42244. "resource": c.resource,
  42245. })
  42246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42247. }
  42248. // Do executes the "compute.autoscalers.testIamPermissions" call.
  42249. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  42250. // non-2xx status code is an error. Response headers are in either
  42251. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  42252. // returned at all) in error.(*googleapi.Error).Header. Use
  42253. // googleapi.IsNotModified to check whether the returned error was
  42254. // because http.StatusNotModified was returned.
  42255. func (c *AutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  42256. gensupport.SetOptions(c.urlParams_, opts...)
  42257. res, err := c.doRequest("json")
  42258. if res != nil && res.StatusCode == http.StatusNotModified {
  42259. if res.Body != nil {
  42260. res.Body.Close()
  42261. }
  42262. return nil, &googleapi.Error{
  42263. Code: res.StatusCode,
  42264. Header: res.Header,
  42265. }
  42266. }
  42267. if err != nil {
  42268. return nil, err
  42269. }
  42270. defer googleapi.CloseBody(res)
  42271. if err := googleapi.CheckResponse(res); err != nil {
  42272. return nil, err
  42273. }
  42274. ret := &TestPermissionsResponse{
  42275. ServerResponse: googleapi.ServerResponse{
  42276. Header: res.Header,
  42277. HTTPStatusCode: res.StatusCode,
  42278. },
  42279. }
  42280. target := &ret
  42281. if err := gensupport.DecodeResponse(target, res); err != nil {
  42282. return nil, err
  42283. }
  42284. return ret, nil
  42285. // {
  42286. // "description": "Returns permissions that a caller has on the specified resource.",
  42287. // "httpMethod": "POST",
  42288. // "id": "compute.autoscalers.testIamPermissions",
  42289. // "parameterOrder": [
  42290. // "project",
  42291. // "zone",
  42292. // "resource"
  42293. // ],
  42294. // "parameters": {
  42295. // "project": {
  42296. // "description": "Project ID for this request.",
  42297. // "location": "path",
  42298. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42299. // "required": true,
  42300. // "type": "string"
  42301. // },
  42302. // "resource": {
  42303. // "description": "Name or id of the resource for this request.",
  42304. // "location": "path",
  42305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42306. // "required": true,
  42307. // "type": "string"
  42308. // },
  42309. // "zone": {
  42310. // "description": "The name of the zone for this request.",
  42311. // "location": "path",
  42312. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42313. // "required": true,
  42314. // "type": "string"
  42315. // }
  42316. // },
  42317. // "path": "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions",
  42318. // "request": {
  42319. // "$ref": "TestPermissionsRequest"
  42320. // },
  42321. // "response": {
  42322. // "$ref": "TestPermissionsResponse"
  42323. // },
  42324. // "scopes": [
  42325. // "https://www.googleapis.com/auth/cloud-platform",
  42326. // "https://www.googleapis.com/auth/compute",
  42327. // "https://www.googleapis.com/auth/compute.readonly"
  42328. // ]
  42329. // }
  42330. }
  42331. // method id "compute.autoscalers.update":
  42332. type AutoscalersUpdateCall struct {
  42333. s *Service
  42334. project string
  42335. zone string
  42336. autoscaler *Autoscaler
  42337. urlParams_ gensupport.URLParams
  42338. ctx_ context.Context
  42339. header_ http.Header
  42340. }
  42341. // Update: Updates an autoscaler in the specified project using the data
  42342. // included in the request.
  42343. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  42344. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42345. c.project = project
  42346. c.zone = zone
  42347. c.autoscaler = autoscaler
  42348. return c
  42349. }
  42350. // Autoscaler sets the optional parameter "autoscaler": Name of the
  42351. // autoscaler to update.
  42352. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  42353. c.urlParams_.Set("autoscaler", autoscaler)
  42354. return c
  42355. }
  42356. // RequestId sets the optional parameter "requestId": An optional
  42357. // request ID to identify requests. Specify a unique request ID so that
  42358. // if you must retry your request, the server will know to ignore the
  42359. // request if it has already been completed.
  42360. //
  42361. // For example, consider a situation where you make an initial request
  42362. // and the request times out. If you make the request again with the
  42363. // same request ID, the server can check if original operation with the
  42364. // same request ID was received, and if so, will ignore the second
  42365. // request. This prevents clients from accidentally creating duplicate
  42366. // commitments.
  42367. //
  42368. // The request ID must be a valid UUID with the exception that zero UUID
  42369. // is not supported (00000000-0000-0000-0000-000000000000).
  42370. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  42371. c.urlParams_.Set("requestId", requestId)
  42372. return c
  42373. }
  42374. // Fields allows partial responses to be retrieved. See
  42375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42376. // for more information.
  42377. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  42378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42379. return c
  42380. }
  42381. // Context sets the context to be used in this call's Do method. Any
  42382. // pending HTTP request will be aborted if the provided context is
  42383. // canceled.
  42384. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  42385. c.ctx_ = ctx
  42386. return c
  42387. }
  42388. // Header returns an http.Header that can be modified by the caller to
  42389. // add HTTP headers to the request.
  42390. func (c *AutoscalersUpdateCall) Header() http.Header {
  42391. if c.header_ == nil {
  42392. c.header_ = make(http.Header)
  42393. }
  42394. return c.header_
  42395. }
  42396. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  42397. reqHeaders := make(http.Header)
  42398. for k, v := range c.header_ {
  42399. reqHeaders[k] = v
  42400. }
  42401. reqHeaders.Set("User-Agent", c.s.userAgent())
  42402. var body io.Reader = nil
  42403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  42404. if err != nil {
  42405. return nil, err
  42406. }
  42407. reqHeaders.Set("Content-Type", "application/json")
  42408. c.urlParams_.Set("alt", alt)
  42409. c.urlParams_.Set("prettyPrint", "false")
  42410. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  42411. urls += "?" + c.urlParams_.Encode()
  42412. req, err := http.NewRequest("PUT", urls, body)
  42413. if err != nil {
  42414. return nil, err
  42415. }
  42416. req.Header = reqHeaders
  42417. googleapi.Expand(req.URL, map[string]string{
  42418. "project": c.project,
  42419. "zone": c.zone,
  42420. })
  42421. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42422. }
  42423. // Do executes the "compute.autoscalers.update" call.
  42424. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42425. // status code is an error. Response headers are in either
  42426. // *Operation.ServerResponse.Header or (if a response was returned at
  42427. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42428. // to check whether the returned error was because
  42429. // http.StatusNotModified was returned.
  42430. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42431. gensupport.SetOptions(c.urlParams_, opts...)
  42432. res, err := c.doRequest("json")
  42433. if res != nil && res.StatusCode == http.StatusNotModified {
  42434. if res.Body != nil {
  42435. res.Body.Close()
  42436. }
  42437. return nil, &googleapi.Error{
  42438. Code: res.StatusCode,
  42439. Header: res.Header,
  42440. }
  42441. }
  42442. if err != nil {
  42443. return nil, err
  42444. }
  42445. defer googleapi.CloseBody(res)
  42446. if err := googleapi.CheckResponse(res); err != nil {
  42447. return nil, err
  42448. }
  42449. ret := &Operation{
  42450. ServerResponse: googleapi.ServerResponse{
  42451. Header: res.Header,
  42452. HTTPStatusCode: res.StatusCode,
  42453. },
  42454. }
  42455. target := &ret
  42456. if err := gensupport.DecodeResponse(target, res); err != nil {
  42457. return nil, err
  42458. }
  42459. return ret, nil
  42460. // {
  42461. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  42462. // "httpMethod": "PUT",
  42463. // "id": "compute.autoscalers.update",
  42464. // "parameterOrder": [
  42465. // "project",
  42466. // "zone"
  42467. // ],
  42468. // "parameters": {
  42469. // "autoscaler": {
  42470. // "description": "Name of the autoscaler to update.",
  42471. // "location": "query",
  42472. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42473. // "type": "string"
  42474. // },
  42475. // "project": {
  42476. // "description": "Project ID for this request.",
  42477. // "location": "path",
  42478. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42479. // "required": true,
  42480. // "type": "string"
  42481. // },
  42482. // "requestId": {
  42483. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42484. // "location": "query",
  42485. // "type": "string"
  42486. // },
  42487. // "zone": {
  42488. // "description": "Name of the zone for this request.",
  42489. // "location": "path",
  42490. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42491. // "required": true,
  42492. // "type": "string"
  42493. // }
  42494. // },
  42495. // "path": "{project}/zones/{zone}/autoscalers",
  42496. // "request": {
  42497. // "$ref": "Autoscaler"
  42498. // },
  42499. // "response": {
  42500. // "$ref": "Operation"
  42501. // },
  42502. // "scopes": [
  42503. // "https://www.googleapis.com/auth/cloud-platform",
  42504. // "https://www.googleapis.com/auth/compute"
  42505. // ]
  42506. // }
  42507. }
  42508. // method id "compute.backendBuckets.addSignedUrlKey":
  42509. type BackendBucketsAddSignedUrlKeyCall struct {
  42510. s *Service
  42511. project string
  42512. backendBucket string
  42513. signedurlkey *SignedUrlKey
  42514. urlParams_ gensupport.URLParams
  42515. ctx_ context.Context
  42516. header_ http.Header
  42517. }
  42518. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  42519. // for this backend bucket.
  42520. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  42521. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42522. c.project = project
  42523. c.backendBucket = backendBucket
  42524. c.signedurlkey = signedurlkey
  42525. return c
  42526. }
  42527. // RequestId sets the optional parameter "requestId": An optional
  42528. // request ID to identify requests. Specify a unique request ID so that
  42529. // if you must retry your request, the server will know to ignore the
  42530. // request if it has already been completed.
  42531. //
  42532. // For example, consider a situation where you make an initial request
  42533. // and the request times out. If you make the request again with the
  42534. // same request ID, the server can check if original operation with the
  42535. // same request ID was received, and if so, will ignore the second
  42536. // request. This prevents clients from accidentally creating duplicate
  42537. // commitments.
  42538. //
  42539. // The request ID must be a valid UUID with the exception that zero UUID
  42540. // is not supported (00000000-0000-0000-0000-000000000000).
  42541. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  42542. c.urlParams_.Set("requestId", requestId)
  42543. return c
  42544. }
  42545. // Fields allows partial responses to be retrieved. See
  42546. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42547. // for more information.
  42548. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  42549. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42550. return c
  42551. }
  42552. // Context sets the context to be used in this call's Do method. Any
  42553. // pending HTTP request will be aborted if the provided context is
  42554. // canceled.
  42555. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  42556. c.ctx_ = ctx
  42557. return c
  42558. }
  42559. // Header returns an http.Header that can be modified by the caller to
  42560. // add HTTP headers to the request.
  42561. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  42562. if c.header_ == nil {
  42563. c.header_ = make(http.Header)
  42564. }
  42565. return c.header_
  42566. }
  42567. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  42568. reqHeaders := make(http.Header)
  42569. for k, v := range c.header_ {
  42570. reqHeaders[k] = v
  42571. }
  42572. reqHeaders.Set("User-Agent", c.s.userAgent())
  42573. var body io.Reader = nil
  42574. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  42575. if err != nil {
  42576. return nil, err
  42577. }
  42578. reqHeaders.Set("Content-Type", "application/json")
  42579. c.urlParams_.Set("alt", alt)
  42580. c.urlParams_.Set("prettyPrint", "false")
  42581. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  42582. urls += "?" + c.urlParams_.Encode()
  42583. req, err := http.NewRequest("POST", urls, body)
  42584. if err != nil {
  42585. return nil, err
  42586. }
  42587. req.Header = reqHeaders
  42588. googleapi.Expand(req.URL, map[string]string{
  42589. "project": c.project,
  42590. "backendBucket": c.backendBucket,
  42591. })
  42592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42593. }
  42594. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  42595. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42596. // status code is an error. Response headers are in either
  42597. // *Operation.ServerResponse.Header or (if a response was returned at
  42598. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42599. // to check whether the returned error was because
  42600. // http.StatusNotModified was returned.
  42601. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42602. gensupport.SetOptions(c.urlParams_, opts...)
  42603. res, err := c.doRequest("json")
  42604. if res != nil && res.StatusCode == http.StatusNotModified {
  42605. if res.Body != nil {
  42606. res.Body.Close()
  42607. }
  42608. return nil, &googleapi.Error{
  42609. Code: res.StatusCode,
  42610. Header: res.Header,
  42611. }
  42612. }
  42613. if err != nil {
  42614. return nil, err
  42615. }
  42616. defer googleapi.CloseBody(res)
  42617. if err := googleapi.CheckResponse(res); err != nil {
  42618. return nil, err
  42619. }
  42620. ret := &Operation{
  42621. ServerResponse: googleapi.ServerResponse{
  42622. Header: res.Header,
  42623. HTTPStatusCode: res.StatusCode,
  42624. },
  42625. }
  42626. target := &ret
  42627. if err := gensupport.DecodeResponse(target, res); err != nil {
  42628. return nil, err
  42629. }
  42630. return ret, nil
  42631. // {
  42632. // "description": "Adds a key for validating requests with signed URLs for this backend bucket.",
  42633. // "httpMethod": "POST",
  42634. // "id": "compute.backendBuckets.addSignedUrlKey",
  42635. // "parameterOrder": [
  42636. // "project",
  42637. // "backendBucket"
  42638. // ],
  42639. // "parameters": {
  42640. // "backendBucket": {
  42641. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  42642. // "location": "path",
  42643. // "required": true,
  42644. // "type": "string"
  42645. // },
  42646. // "project": {
  42647. // "description": "Project ID for this request.",
  42648. // "location": "path",
  42649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42650. // "required": true,
  42651. // "type": "string"
  42652. // },
  42653. // "requestId": {
  42654. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42655. // "location": "query",
  42656. // "type": "string"
  42657. // }
  42658. // },
  42659. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  42660. // "request": {
  42661. // "$ref": "SignedUrlKey"
  42662. // },
  42663. // "response": {
  42664. // "$ref": "Operation"
  42665. // },
  42666. // "scopes": [
  42667. // "https://www.googleapis.com/auth/cloud-platform",
  42668. // "https://www.googleapis.com/auth/compute"
  42669. // ]
  42670. // }
  42671. }
  42672. // method id "compute.backendBuckets.delete":
  42673. type BackendBucketsDeleteCall struct {
  42674. s *Service
  42675. project string
  42676. backendBucket string
  42677. urlParams_ gensupport.URLParams
  42678. ctx_ context.Context
  42679. header_ http.Header
  42680. }
  42681. // Delete: Deletes the specified BackendBucket resource.
  42682. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  42683. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42684. c.project = project
  42685. c.backendBucket = backendBucket
  42686. return c
  42687. }
  42688. // RequestId sets the optional parameter "requestId": An optional
  42689. // request ID to identify requests. Specify a unique request ID so that
  42690. // if you must retry your request, the server will know to ignore the
  42691. // request if it has already been completed.
  42692. //
  42693. // For example, consider a situation where you make an initial request
  42694. // and the request times out. If you make the request again with the
  42695. // same request ID, the server can check if original operation with the
  42696. // same request ID was received, and if so, will ignore the second
  42697. // request. This prevents clients from accidentally creating duplicate
  42698. // commitments.
  42699. //
  42700. // The request ID must be a valid UUID with the exception that zero UUID
  42701. // is not supported (00000000-0000-0000-0000-000000000000).
  42702. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  42703. c.urlParams_.Set("requestId", requestId)
  42704. return c
  42705. }
  42706. // Fields allows partial responses to be retrieved. See
  42707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42708. // for more information.
  42709. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  42710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42711. return c
  42712. }
  42713. // Context sets the context to be used in this call's Do method. Any
  42714. // pending HTTP request will be aborted if the provided context is
  42715. // canceled.
  42716. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  42717. c.ctx_ = ctx
  42718. return c
  42719. }
  42720. // Header returns an http.Header that can be modified by the caller to
  42721. // add HTTP headers to the request.
  42722. func (c *BackendBucketsDeleteCall) Header() http.Header {
  42723. if c.header_ == nil {
  42724. c.header_ = make(http.Header)
  42725. }
  42726. return c.header_
  42727. }
  42728. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  42729. reqHeaders := make(http.Header)
  42730. for k, v := range c.header_ {
  42731. reqHeaders[k] = v
  42732. }
  42733. reqHeaders.Set("User-Agent", c.s.userAgent())
  42734. var body io.Reader = nil
  42735. c.urlParams_.Set("alt", alt)
  42736. c.urlParams_.Set("prettyPrint", "false")
  42737. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  42738. urls += "?" + c.urlParams_.Encode()
  42739. req, err := http.NewRequest("DELETE", urls, body)
  42740. if err != nil {
  42741. return nil, err
  42742. }
  42743. req.Header = reqHeaders
  42744. googleapi.Expand(req.URL, map[string]string{
  42745. "project": c.project,
  42746. "backendBucket": c.backendBucket,
  42747. })
  42748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42749. }
  42750. // Do executes the "compute.backendBuckets.delete" call.
  42751. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42752. // status code is an error. Response headers are in either
  42753. // *Operation.ServerResponse.Header or (if a response was returned at
  42754. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42755. // to check whether the returned error was because
  42756. // http.StatusNotModified was returned.
  42757. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42758. gensupport.SetOptions(c.urlParams_, opts...)
  42759. res, err := c.doRequest("json")
  42760. if res != nil && res.StatusCode == http.StatusNotModified {
  42761. if res.Body != nil {
  42762. res.Body.Close()
  42763. }
  42764. return nil, &googleapi.Error{
  42765. Code: res.StatusCode,
  42766. Header: res.Header,
  42767. }
  42768. }
  42769. if err != nil {
  42770. return nil, err
  42771. }
  42772. defer googleapi.CloseBody(res)
  42773. if err := googleapi.CheckResponse(res); err != nil {
  42774. return nil, err
  42775. }
  42776. ret := &Operation{
  42777. ServerResponse: googleapi.ServerResponse{
  42778. Header: res.Header,
  42779. HTTPStatusCode: res.StatusCode,
  42780. },
  42781. }
  42782. target := &ret
  42783. if err := gensupport.DecodeResponse(target, res); err != nil {
  42784. return nil, err
  42785. }
  42786. return ret, nil
  42787. // {
  42788. // "description": "Deletes the specified BackendBucket resource.",
  42789. // "httpMethod": "DELETE",
  42790. // "id": "compute.backendBuckets.delete",
  42791. // "parameterOrder": [
  42792. // "project",
  42793. // "backendBucket"
  42794. // ],
  42795. // "parameters": {
  42796. // "backendBucket": {
  42797. // "description": "Name of the BackendBucket resource to delete.",
  42798. // "location": "path",
  42799. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42800. // "required": true,
  42801. // "type": "string"
  42802. // },
  42803. // "project": {
  42804. // "description": "Project ID for this request.",
  42805. // "location": "path",
  42806. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42807. // "required": true,
  42808. // "type": "string"
  42809. // },
  42810. // "requestId": {
  42811. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42812. // "location": "query",
  42813. // "type": "string"
  42814. // }
  42815. // },
  42816. // "path": "{project}/global/backendBuckets/{backendBucket}",
  42817. // "response": {
  42818. // "$ref": "Operation"
  42819. // },
  42820. // "scopes": [
  42821. // "https://www.googleapis.com/auth/cloud-platform",
  42822. // "https://www.googleapis.com/auth/compute"
  42823. // ]
  42824. // }
  42825. }
  42826. // method id "compute.backendBuckets.deleteSignedUrlKey":
  42827. type BackendBucketsDeleteSignedUrlKeyCall struct {
  42828. s *Service
  42829. project string
  42830. backendBucket string
  42831. urlParams_ gensupport.URLParams
  42832. ctx_ context.Context
  42833. header_ http.Header
  42834. }
  42835. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  42836. // URLs for this backend bucket.
  42837. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  42838. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42839. c.project = project
  42840. c.backendBucket = backendBucket
  42841. c.urlParams_.Set("keyName", keyName)
  42842. return c
  42843. }
  42844. // RequestId sets the optional parameter "requestId": An optional
  42845. // request ID to identify requests. Specify a unique request ID so that
  42846. // if you must retry your request, the server will know to ignore the
  42847. // request if it has already been completed.
  42848. //
  42849. // For example, consider a situation where you make an initial request
  42850. // and the request times out. If you make the request again with the
  42851. // same request ID, the server can check if original operation with the
  42852. // same request ID was received, and if so, will ignore the second
  42853. // request. This prevents clients from accidentally creating duplicate
  42854. // commitments.
  42855. //
  42856. // The request ID must be a valid UUID with the exception that zero UUID
  42857. // is not supported (00000000-0000-0000-0000-000000000000).
  42858. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  42859. c.urlParams_.Set("requestId", requestId)
  42860. return c
  42861. }
  42862. // Fields allows partial responses to be retrieved. See
  42863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42864. // for more information.
  42865. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  42866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42867. return c
  42868. }
  42869. // Context sets the context to be used in this call's Do method. Any
  42870. // pending HTTP request will be aborted if the provided context is
  42871. // canceled.
  42872. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  42873. c.ctx_ = ctx
  42874. return c
  42875. }
  42876. // Header returns an http.Header that can be modified by the caller to
  42877. // add HTTP headers to the request.
  42878. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  42879. if c.header_ == nil {
  42880. c.header_ = make(http.Header)
  42881. }
  42882. return c.header_
  42883. }
  42884. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  42885. reqHeaders := make(http.Header)
  42886. for k, v := range c.header_ {
  42887. reqHeaders[k] = v
  42888. }
  42889. reqHeaders.Set("User-Agent", c.s.userAgent())
  42890. var body io.Reader = nil
  42891. c.urlParams_.Set("alt", alt)
  42892. c.urlParams_.Set("prettyPrint", "false")
  42893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  42894. urls += "?" + c.urlParams_.Encode()
  42895. req, err := http.NewRequest("POST", urls, body)
  42896. if err != nil {
  42897. return nil, err
  42898. }
  42899. req.Header = reqHeaders
  42900. googleapi.Expand(req.URL, map[string]string{
  42901. "project": c.project,
  42902. "backendBucket": c.backendBucket,
  42903. })
  42904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42905. }
  42906. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  42907. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42908. // status code is an error. Response headers are in either
  42909. // *Operation.ServerResponse.Header or (if a response was returned at
  42910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42911. // to check whether the returned error was because
  42912. // http.StatusNotModified was returned.
  42913. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42914. gensupport.SetOptions(c.urlParams_, opts...)
  42915. res, err := c.doRequest("json")
  42916. if res != nil && res.StatusCode == http.StatusNotModified {
  42917. if res.Body != nil {
  42918. res.Body.Close()
  42919. }
  42920. return nil, &googleapi.Error{
  42921. Code: res.StatusCode,
  42922. Header: res.Header,
  42923. }
  42924. }
  42925. if err != nil {
  42926. return nil, err
  42927. }
  42928. defer googleapi.CloseBody(res)
  42929. if err := googleapi.CheckResponse(res); err != nil {
  42930. return nil, err
  42931. }
  42932. ret := &Operation{
  42933. ServerResponse: googleapi.ServerResponse{
  42934. Header: res.Header,
  42935. HTTPStatusCode: res.StatusCode,
  42936. },
  42937. }
  42938. target := &ret
  42939. if err := gensupport.DecodeResponse(target, res); err != nil {
  42940. return nil, err
  42941. }
  42942. return ret, nil
  42943. // {
  42944. // "description": "Deletes a key for validating requests with signed URLs for this backend bucket.",
  42945. // "httpMethod": "POST",
  42946. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  42947. // "parameterOrder": [
  42948. // "project",
  42949. // "backendBucket",
  42950. // "keyName"
  42951. // ],
  42952. // "parameters": {
  42953. // "backendBucket": {
  42954. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  42955. // "location": "path",
  42956. // "required": true,
  42957. // "type": "string"
  42958. // },
  42959. // "keyName": {
  42960. // "description": "The name of the Signed URL Key to delete.",
  42961. // "location": "query",
  42962. // "required": true,
  42963. // "type": "string"
  42964. // },
  42965. // "project": {
  42966. // "description": "Project ID for this request.",
  42967. // "location": "path",
  42968. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42969. // "required": true,
  42970. // "type": "string"
  42971. // },
  42972. // "requestId": {
  42973. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42974. // "location": "query",
  42975. // "type": "string"
  42976. // }
  42977. // },
  42978. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  42979. // "response": {
  42980. // "$ref": "Operation"
  42981. // },
  42982. // "scopes": [
  42983. // "https://www.googleapis.com/auth/cloud-platform",
  42984. // "https://www.googleapis.com/auth/compute"
  42985. // ]
  42986. // }
  42987. }
  42988. // method id "compute.backendBuckets.get":
  42989. type BackendBucketsGetCall struct {
  42990. s *Service
  42991. project string
  42992. backendBucket string
  42993. urlParams_ gensupport.URLParams
  42994. ifNoneMatch_ string
  42995. ctx_ context.Context
  42996. header_ http.Header
  42997. }
  42998. // Get: Returns the specified BackendBucket resource. Gets a list of
  42999. // available backend buckets by making a list() request.
  43000. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  43001. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43002. c.project = project
  43003. c.backendBucket = backendBucket
  43004. return c
  43005. }
  43006. // Fields allows partial responses to be retrieved. See
  43007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43008. // for more information.
  43009. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  43010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43011. return c
  43012. }
  43013. // IfNoneMatch sets the optional parameter which makes the operation
  43014. // fail if the object's ETag matches the given value. This is useful for
  43015. // getting updates only after the object has changed since the last
  43016. // request. Use googleapi.IsNotModified to check whether the response
  43017. // error from Do is the result of In-None-Match.
  43018. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  43019. c.ifNoneMatch_ = entityTag
  43020. return c
  43021. }
  43022. // Context sets the context to be used in this call's Do method. Any
  43023. // pending HTTP request will be aborted if the provided context is
  43024. // canceled.
  43025. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  43026. c.ctx_ = ctx
  43027. return c
  43028. }
  43029. // Header returns an http.Header that can be modified by the caller to
  43030. // add HTTP headers to the request.
  43031. func (c *BackendBucketsGetCall) Header() http.Header {
  43032. if c.header_ == nil {
  43033. c.header_ = make(http.Header)
  43034. }
  43035. return c.header_
  43036. }
  43037. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  43038. reqHeaders := make(http.Header)
  43039. for k, v := range c.header_ {
  43040. reqHeaders[k] = v
  43041. }
  43042. reqHeaders.Set("User-Agent", c.s.userAgent())
  43043. if c.ifNoneMatch_ != "" {
  43044. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43045. }
  43046. var body io.Reader = nil
  43047. c.urlParams_.Set("alt", alt)
  43048. c.urlParams_.Set("prettyPrint", "false")
  43049. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  43050. urls += "?" + c.urlParams_.Encode()
  43051. req, err := http.NewRequest("GET", urls, body)
  43052. if err != nil {
  43053. return nil, err
  43054. }
  43055. req.Header = reqHeaders
  43056. googleapi.Expand(req.URL, map[string]string{
  43057. "project": c.project,
  43058. "backendBucket": c.backendBucket,
  43059. })
  43060. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43061. }
  43062. // Do executes the "compute.backendBuckets.get" call.
  43063. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  43064. // status code is an error. Response headers are in either
  43065. // *BackendBucket.ServerResponse.Header or (if a response was returned
  43066. // at all) in error.(*googleapi.Error).Header. Use
  43067. // googleapi.IsNotModified to check whether the returned error was
  43068. // because http.StatusNotModified was returned.
  43069. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  43070. gensupport.SetOptions(c.urlParams_, opts...)
  43071. res, err := c.doRequest("json")
  43072. if res != nil && res.StatusCode == http.StatusNotModified {
  43073. if res.Body != nil {
  43074. res.Body.Close()
  43075. }
  43076. return nil, &googleapi.Error{
  43077. Code: res.StatusCode,
  43078. Header: res.Header,
  43079. }
  43080. }
  43081. if err != nil {
  43082. return nil, err
  43083. }
  43084. defer googleapi.CloseBody(res)
  43085. if err := googleapi.CheckResponse(res); err != nil {
  43086. return nil, err
  43087. }
  43088. ret := &BackendBucket{
  43089. ServerResponse: googleapi.ServerResponse{
  43090. Header: res.Header,
  43091. HTTPStatusCode: res.StatusCode,
  43092. },
  43093. }
  43094. target := &ret
  43095. if err := gensupport.DecodeResponse(target, res); err != nil {
  43096. return nil, err
  43097. }
  43098. return ret, nil
  43099. // {
  43100. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  43101. // "httpMethod": "GET",
  43102. // "id": "compute.backendBuckets.get",
  43103. // "parameterOrder": [
  43104. // "project",
  43105. // "backendBucket"
  43106. // ],
  43107. // "parameters": {
  43108. // "backendBucket": {
  43109. // "description": "Name of the BackendBucket resource to return.",
  43110. // "location": "path",
  43111. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43112. // "required": true,
  43113. // "type": "string"
  43114. // },
  43115. // "project": {
  43116. // "description": "Project ID for this request.",
  43117. // "location": "path",
  43118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43119. // "required": true,
  43120. // "type": "string"
  43121. // }
  43122. // },
  43123. // "path": "{project}/global/backendBuckets/{backendBucket}",
  43124. // "response": {
  43125. // "$ref": "BackendBucket"
  43126. // },
  43127. // "scopes": [
  43128. // "https://www.googleapis.com/auth/cloud-platform",
  43129. // "https://www.googleapis.com/auth/compute",
  43130. // "https://www.googleapis.com/auth/compute.readonly"
  43131. // ]
  43132. // }
  43133. }
  43134. // method id "compute.backendBuckets.getIamPolicy":
  43135. type BackendBucketsGetIamPolicyCall struct {
  43136. s *Service
  43137. project string
  43138. resource string
  43139. urlParams_ gensupport.URLParams
  43140. ifNoneMatch_ string
  43141. ctx_ context.Context
  43142. header_ http.Header
  43143. }
  43144. // GetIamPolicy: Gets the access control policy for a resource. May be
  43145. // empty if no such policy or resource exists.
  43146. func (r *BackendBucketsService) GetIamPolicy(project string, resource string) *BackendBucketsGetIamPolicyCall {
  43147. c := &BackendBucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43148. c.project = project
  43149. c.resource = resource
  43150. return c
  43151. }
  43152. // Fields allows partial responses to be retrieved. See
  43153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43154. // for more information.
  43155. func (c *BackendBucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsGetIamPolicyCall {
  43156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43157. return c
  43158. }
  43159. // IfNoneMatch sets the optional parameter which makes the operation
  43160. // fail if the object's ETag matches the given value. This is useful for
  43161. // getting updates only after the object has changed since the last
  43162. // request. Use googleapi.IsNotModified to check whether the response
  43163. // error from Do is the result of In-None-Match.
  43164. func (c *BackendBucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BackendBucketsGetIamPolicyCall {
  43165. c.ifNoneMatch_ = entityTag
  43166. return c
  43167. }
  43168. // Context sets the context to be used in this call's Do method. Any
  43169. // pending HTTP request will be aborted if the provided context is
  43170. // canceled.
  43171. func (c *BackendBucketsGetIamPolicyCall) Context(ctx context.Context) *BackendBucketsGetIamPolicyCall {
  43172. c.ctx_ = ctx
  43173. return c
  43174. }
  43175. // Header returns an http.Header that can be modified by the caller to
  43176. // add HTTP headers to the request.
  43177. func (c *BackendBucketsGetIamPolicyCall) Header() http.Header {
  43178. if c.header_ == nil {
  43179. c.header_ = make(http.Header)
  43180. }
  43181. return c.header_
  43182. }
  43183. func (c *BackendBucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  43184. reqHeaders := make(http.Header)
  43185. for k, v := range c.header_ {
  43186. reqHeaders[k] = v
  43187. }
  43188. reqHeaders.Set("User-Agent", c.s.userAgent())
  43189. if c.ifNoneMatch_ != "" {
  43190. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43191. }
  43192. var body io.Reader = nil
  43193. c.urlParams_.Set("alt", alt)
  43194. c.urlParams_.Set("prettyPrint", "false")
  43195. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/getIamPolicy")
  43196. urls += "?" + c.urlParams_.Encode()
  43197. req, err := http.NewRequest("GET", urls, body)
  43198. if err != nil {
  43199. return nil, err
  43200. }
  43201. req.Header = reqHeaders
  43202. googleapi.Expand(req.URL, map[string]string{
  43203. "project": c.project,
  43204. "resource": c.resource,
  43205. })
  43206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43207. }
  43208. // Do executes the "compute.backendBuckets.getIamPolicy" call.
  43209. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  43210. // code is an error. Response headers are in either
  43211. // *Policy.ServerResponse.Header or (if a response was returned at all)
  43212. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  43213. // check whether the returned error was because http.StatusNotModified
  43214. // was returned.
  43215. func (c *BackendBucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  43216. gensupport.SetOptions(c.urlParams_, opts...)
  43217. res, err := c.doRequest("json")
  43218. if res != nil && res.StatusCode == http.StatusNotModified {
  43219. if res.Body != nil {
  43220. res.Body.Close()
  43221. }
  43222. return nil, &googleapi.Error{
  43223. Code: res.StatusCode,
  43224. Header: res.Header,
  43225. }
  43226. }
  43227. if err != nil {
  43228. return nil, err
  43229. }
  43230. defer googleapi.CloseBody(res)
  43231. if err := googleapi.CheckResponse(res); err != nil {
  43232. return nil, err
  43233. }
  43234. ret := &Policy{
  43235. ServerResponse: googleapi.ServerResponse{
  43236. Header: res.Header,
  43237. HTTPStatusCode: res.StatusCode,
  43238. },
  43239. }
  43240. target := &ret
  43241. if err := gensupport.DecodeResponse(target, res); err != nil {
  43242. return nil, err
  43243. }
  43244. return ret, nil
  43245. // {
  43246. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  43247. // "httpMethod": "GET",
  43248. // "id": "compute.backendBuckets.getIamPolicy",
  43249. // "parameterOrder": [
  43250. // "project",
  43251. // "resource"
  43252. // ],
  43253. // "parameters": {
  43254. // "project": {
  43255. // "description": "Project ID for this request.",
  43256. // "location": "path",
  43257. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43258. // "required": true,
  43259. // "type": "string"
  43260. // },
  43261. // "resource": {
  43262. // "description": "Name or id of the resource for this request.",
  43263. // "location": "path",
  43264. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43265. // "required": true,
  43266. // "type": "string"
  43267. // }
  43268. // },
  43269. // "path": "{project}/global/backendBuckets/{resource}/getIamPolicy",
  43270. // "response": {
  43271. // "$ref": "Policy"
  43272. // },
  43273. // "scopes": [
  43274. // "https://www.googleapis.com/auth/cloud-platform",
  43275. // "https://www.googleapis.com/auth/compute",
  43276. // "https://www.googleapis.com/auth/compute.readonly"
  43277. // ]
  43278. // }
  43279. }
  43280. // method id "compute.backendBuckets.insert":
  43281. type BackendBucketsInsertCall struct {
  43282. s *Service
  43283. project string
  43284. backendbucket *BackendBucket
  43285. urlParams_ gensupport.URLParams
  43286. ctx_ context.Context
  43287. header_ http.Header
  43288. }
  43289. // Insert: Creates a BackendBucket resource in the specified project
  43290. // using the data included in the request.
  43291. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  43292. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43293. c.project = project
  43294. c.backendbucket = backendbucket
  43295. return c
  43296. }
  43297. // RequestId sets the optional parameter "requestId": An optional
  43298. // request ID to identify requests. Specify a unique request ID so that
  43299. // if you must retry your request, the server will know to ignore the
  43300. // request if it has already been completed.
  43301. //
  43302. // For example, consider a situation where you make an initial request
  43303. // and the request times out. If you make the request again with the
  43304. // same request ID, the server can check if original operation with the
  43305. // same request ID was received, and if so, will ignore the second
  43306. // request. This prevents clients from accidentally creating duplicate
  43307. // commitments.
  43308. //
  43309. // The request ID must be a valid UUID with the exception that zero UUID
  43310. // is not supported (00000000-0000-0000-0000-000000000000).
  43311. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  43312. c.urlParams_.Set("requestId", requestId)
  43313. return c
  43314. }
  43315. // Fields allows partial responses to be retrieved. See
  43316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43317. // for more information.
  43318. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  43319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43320. return c
  43321. }
  43322. // Context sets the context to be used in this call's Do method. Any
  43323. // pending HTTP request will be aborted if the provided context is
  43324. // canceled.
  43325. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  43326. c.ctx_ = ctx
  43327. return c
  43328. }
  43329. // Header returns an http.Header that can be modified by the caller to
  43330. // add HTTP headers to the request.
  43331. func (c *BackendBucketsInsertCall) Header() http.Header {
  43332. if c.header_ == nil {
  43333. c.header_ = make(http.Header)
  43334. }
  43335. return c.header_
  43336. }
  43337. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  43338. reqHeaders := make(http.Header)
  43339. for k, v := range c.header_ {
  43340. reqHeaders[k] = v
  43341. }
  43342. reqHeaders.Set("User-Agent", c.s.userAgent())
  43343. var body io.Reader = nil
  43344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  43345. if err != nil {
  43346. return nil, err
  43347. }
  43348. reqHeaders.Set("Content-Type", "application/json")
  43349. c.urlParams_.Set("alt", alt)
  43350. c.urlParams_.Set("prettyPrint", "false")
  43351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  43352. urls += "?" + c.urlParams_.Encode()
  43353. req, err := http.NewRequest("POST", urls, body)
  43354. if err != nil {
  43355. return nil, err
  43356. }
  43357. req.Header = reqHeaders
  43358. googleapi.Expand(req.URL, map[string]string{
  43359. "project": c.project,
  43360. })
  43361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43362. }
  43363. // Do executes the "compute.backendBuckets.insert" call.
  43364. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43365. // status code is an error. Response headers are in either
  43366. // *Operation.ServerResponse.Header or (if a response was returned at
  43367. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43368. // to check whether the returned error was because
  43369. // http.StatusNotModified was returned.
  43370. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43371. gensupport.SetOptions(c.urlParams_, opts...)
  43372. res, err := c.doRequest("json")
  43373. if res != nil && res.StatusCode == http.StatusNotModified {
  43374. if res.Body != nil {
  43375. res.Body.Close()
  43376. }
  43377. return nil, &googleapi.Error{
  43378. Code: res.StatusCode,
  43379. Header: res.Header,
  43380. }
  43381. }
  43382. if err != nil {
  43383. return nil, err
  43384. }
  43385. defer googleapi.CloseBody(res)
  43386. if err := googleapi.CheckResponse(res); err != nil {
  43387. return nil, err
  43388. }
  43389. ret := &Operation{
  43390. ServerResponse: googleapi.ServerResponse{
  43391. Header: res.Header,
  43392. HTTPStatusCode: res.StatusCode,
  43393. },
  43394. }
  43395. target := &ret
  43396. if err := gensupport.DecodeResponse(target, res); err != nil {
  43397. return nil, err
  43398. }
  43399. return ret, nil
  43400. // {
  43401. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  43402. // "httpMethod": "POST",
  43403. // "id": "compute.backendBuckets.insert",
  43404. // "parameterOrder": [
  43405. // "project"
  43406. // ],
  43407. // "parameters": {
  43408. // "project": {
  43409. // "description": "Project ID for this request.",
  43410. // "location": "path",
  43411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43412. // "required": true,
  43413. // "type": "string"
  43414. // },
  43415. // "requestId": {
  43416. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43417. // "location": "query",
  43418. // "type": "string"
  43419. // }
  43420. // },
  43421. // "path": "{project}/global/backendBuckets",
  43422. // "request": {
  43423. // "$ref": "BackendBucket"
  43424. // },
  43425. // "response": {
  43426. // "$ref": "Operation"
  43427. // },
  43428. // "scopes": [
  43429. // "https://www.googleapis.com/auth/cloud-platform",
  43430. // "https://www.googleapis.com/auth/compute"
  43431. // ]
  43432. // }
  43433. }
  43434. // method id "compute.backendBuckets.list":
  43435. type BackendBucketsListCall struct {
  43436. s *Service
  43437. project string
  43438. urlParams_ gensupport.URLParams
  43439. ifNoneMatch_ string
  43440. ctx_ context.Context
  43441. header_ http.Header
  43442. }
  43443. // List: Retrieves the list of BackendBucket resources available to the
  43444. // specified project.
  43445. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  43446. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43447. c.project = project
  43448. return c
  43449. }
  43450. // Filter sets the optional parameter "filter": A filter expression that
  43451. // filters resources listed in the response. The expression must specify
  43452. // the field name, a comparison operator, and the value that you want to
  43453. // use for filtering. The value must be a string, a number, or a
  43454. // boolean. The comparison operator must be either =, !=, >, or <.
  43455. //
  43456. // For example, if you are filtering Compute Engine instances, you can
  43457. // exclude instances named example-instance by specifying name !=
  43458. // example-instance.
  43459. //
  43460. // You can also filter nested fields. For example, you could specify
  43461. // scheduling.automaticRestart = false to include instances only if they
  43462. // are not scheduled for automatic restarts. You can use filtering on
  43463. // nested fields to filter based on resource labels.
  43464. //
  43465. // To filter on multiple expressions, provide each separate expression
  43466. // within parentheses. For example, (scheduling.automaticRestart = true)
  43467. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43468. // AND expression. However, you can include AND and OR expressions
  43469. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43470. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43471. // true).
  43472. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  43473. c.urlParams_.Set("filter", filter)
  43474. return c
  43475. }
  43476. // MaxResults sets the optional parameter "maxResults": The maximum
  43477. // number of results per page that should be returned. If the number of
  43478. // available results is larger than maxResults, Compute Engine returns a
  43479. // nextPageToken that can be used to get the next page of results in
  43480. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43481. // (Default: 500)
  43482. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  43483. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43484. return c
  43485. }
  43486. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43487. // a certain order. By default, results are returned in alphanumerical
  43488. // order based on the resource name.
  43489. //
  43490. // You can also sort results in descending order based on the creation
  43491. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43492. // based on the creationTimestamp field in reverse chronological order
  43493. // (newest result first). Use this to sort resources like operations so
  43494. // that the newest operation is returned first.
  43495. //
  43496. // Currently, only sorting by name or creationTimestamp desc is
  43497. // supported.
  43498. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  43499. c.urlParams_.Set("orderBy", orderBy)
  43500. return c
  43501. }
  43502. // PageToken sets the optional parameter "pageToken": Specifies a page
  43503. // token to use. Set pageToken to the nextPageToken returned by a
  43504. // previous list request to get the next page of results.
  43505. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  43506. c.urlParams_.Set("pageToken", pageToken)
  43507. return c
  43508. }
  43509. // Fields allows partial responses to be retrieved. See
  43510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43511. // for more information.
  43512. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  43513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43514. return c
  43515. }
  43516. // IfNoneMatch sets the optional parameter which makes the operation
  43517. // fail if the object's ETag matches the given value. This is useful for
  43518. // getting updates only after the object has changed since the last
  43519. // request. Use googleapi.IsNotModified to check whether the response
  43520. // error from Do is the result of In-None-Match.
  43521. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  43522. c.ifNoneMatch_ = entityTag
  43523. return c
  43524. }
  43525. // Context sets the context to be used in this call's Do method. Any
  43526. // pending HTTP request will be aborted if the provided context is
  43527. // canceled.
  43528. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  43529. c.ctx_ = ctx
  43530. return c
  43531. }
  43532. // Header returns an http.Header that can be modified by the caller to
  43533. // add HTTP headers to the request.
  43534. func (c *BackendBucketsListCall) Header() http.Header {
  43535. if c.header_ == nil {
  43536. c.header_ = make(http.Header)
  43537. }
  43538. return c.header_
  43539. }
  43540. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  43541. reqHeaders := make(http.Header)
  43542. for k, v := range c.header_ {
  43543. reqHeaders[k] = v
  43544. }
  43545. reqHeaders.Set("User-Agent", c.s.userAgent())
  43546. if c.ifNoneMatch_ != "" {
  43547. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43548. }
  43549. var body io.Reader = nil
  43550. c.urlParams_.Set("alt", alt)
  43551. c.urlParams_.Set("prettyPrint", "false")
  43552. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  43553. urls += "?" + c.urlParams_.Encode()
  43554. req, err := http.NewRequest("GET", urls, body)
  43555. if err != nil {
  43556. return nil, err
  43557. }
  43558. req.Header = reqHeaders
  43559. googleapi.Expand(req.URL, map[string]string{
  43560. "project": c.project,
  43561. })
  43562. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43563. }
  43564. // Do executes the "compute.backendBuckets.list" call.
  43565. // Exactly one of *BackendBucketList or error will be non-nil. Any
  43566. // non-2xx status code is an error. Response headers are in either
  43567. // *BackendBucketList.ServerResponse.Header or (if a response was
  43568. // returned at all) in error.(*googleapi.Error).Header. Use
  43569. // googleapi.IsNotModified to check whether the returned error was
  43570. // because http.StatusNotModified was returned.
  43571. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  43572. gensupport.SetOptions(c.urlParams_, opts...)
  43573. res, err := c.doRequest("json")
  43574. if res != nil && res.StatusCode == http.StatusNotModified {
  43575. if res.Body != nil {
  43576. res.Body.Close()
  43577. }
  43578. return nil, &googleapi.Error{
  43579. Code: res.StatusCode,
  43580. Header: res.Header,
  43581. }
  43582. }
  43583. if err != nil {
  43584. return nil, err
  43585. }
  43586. defer googleapi.CloseBody(res)
  43587. if err := googleapi.CheckResponse(res); err != nil {
  43588. return nil, err
  43589. }
  43590. ret := &BackendBucketList{
  43591. ServerResponse: googleapi.ServerResponse{
  43592. Header: res.Header,
  43593. HTTPStatusCode: res.StatusCode,
  43594. },
  43595. }
  43596. target := &ret
  43597. if err := gensupport.DecodeResponse(target, res); err != nil {
  43598. return nil, err
  43599. }
  43600. return ret, nil
  43601. // {
  43602. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  43603. // "httpMethod": "GET",
  43604. // "id": "compute.backendBuckets.list",
  43605. // "parameterOrder": [
  43606. // "project"
  43607. // ],
  43608. // "parameters": {
  43609. // "filter": {
  43610. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  43611. // "location": "query",
  43612. // "type": "string"
  43613. // },
  43614. // "maxResults": {
  43615. // "default": "500",
  43616. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43617. // "format": "uint32",
  43618. // "location": "query",
  43619. // "minimum": "0",
  43620. // "type": "integer"
  43621. // },
  43622. // "orderBy": {
  43623. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43624. // "location": "query",
  43625. // "type": "string"
  43626. // },
  43627. // "pageToken": {
  43628. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43629. // "location": "query",
  43630. // "type": "string"
  43631. // },
  43632. // "project": {
  43633. // "description": "Project ID for this request.",
  43634. // "location": "path",
  43635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43636. // "required": true,
  43637. // "type": "string"
  43638. // }
  43639. // },
  43640. // "path": "{project}/global/backendBuckets",
  43641. // "response": {
  43642. // "$ref": "BackendBucketList"
  43643. // },
  43644. // "scopes": [
  43645. // "https://www.googleapis.com/auth/cloud-platform",
  43646. // "https://www.googleapis.com/auth/compute",
  43647. // "https://www.googleapis.com/auth/compute.readonly"
  43648. // ]
  43649. // }
  43650. }
  43651. // Pages invokes f for each page of results.
  43652. // A non-nil error returned from f will halt the iteration.
  43653. // The provided context supersedes any context provided to the Context method.
  43654. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  43655. c.ctx_ = ctx
  43656. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43657. for {
  43658. x, err := c.Do()
  43659. if err != nil {
  43660. return err
  43661. }
  43662. if err := f(x); err != nil {
  43663. return err
  43664. }
  43665. if x.NextPageToken == "" {
  43666. return nil
  43667. }
  43668. c.PageToken(x.NextPageToken)
  43669. }
  43670. }
  43671. // method id "compute.backendBuckets.patch":
  43672. type BackendBucketsPatchCall struct {
  43673. s *Service
  43674. project string
  43675. backendBucket string
  43676. backendbucket *BackendBucket
  43677. urlParams_ gensupport.URLParams
  43678. ctx_ context.Context
  43679. header_ http.Header
  43680. }
  43681. // Patch: Updates the specified BackendBucket resource with the data
  43682. // included in the request. This method supports PATCH semantics and
  43683. // uses the JSON merge patch format and processing rules.
  43684. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  43685. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43686. c.project = project
  43687. c.backendBucket = backendBucket
  43688. c.backendbucket = backendbucket
  43689. return c
  43690. }
  43691. // RequestId sets the optional parameter "requestId": An optional
  43692. // request ID to identify requests. Specify a unique request ID so that
  43693. // if you must retry your request, the server will know to ignore the
  43694. // request if it has already been completed.
  43695. //
  43696. // For example, consider a situation where you make an initial request
  43697. // and the request times out. If you make the request again with the
  43698. // same request ID, the server can check if original operation with the
  43699. // same request ID was received, and if so, will ignore the second
  43700. // request. This prevents clients from accidentally creating duplicate
  43701. // commitments.
  43702. //
  43703. // The request ID must be a valid UUID with the exception that zero UUID
  43704. // is not supported (00000000-0000-0000-0000-000000000000).
  43705. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  43706. c.urlParams_.Set("requestId", requestId)
  43707. return c
  43708. }
  43709. // Fields allows partial responses to be retrieved. See
  43710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43711. // for more information.
  43712. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  43713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43714. return c
  43715. }
  43716. // Context sets the context to be used in this call's Do method. Any
  43717. // pending HTTP request will be aborted if the provided context is
  43718. // canceled.
  43719. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  43720. c.ctx_ = ctx
  43721. return c
  43722. }
  43723. // Header returns an http.Header that can be modified by the caller to
  43724. // add HTTP headers to the request.
  43725. func (c *BackendBucketsPatchCall) Header() http.Header {
  43726. if c.header_ == nil {
  43727. c.header_ = make(http.Header)
  43728. }
  43729. return c.header_
  43730. }
  43731. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  43732. reqHeaders := make(http.Header)
  43733. for k, v := range c.header_ {
  43734. reqHeaders[k] = v
  43735. }
  43736. reqHeaders.Set("User-Agent", c.s.userAgent())
  43737. var body io.Reader = nil
  43738. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  43739. if err != nil {
  43740. return nil, err
  43741. }
  43742. reqHeaders.Set("Content-Type", "application/json")
  43743. c.urlParams_.Set("alt", alt)
  43744. c.urlParams_.Set("prettyPrint", "false")
  43745. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  43746. urls += "?" + c.urlParams_.Encode()
  43747. req, err := http.NewRequest("PATCH", urls, body)
  43748. if err != nil {
  43749. return nil, err
  43750. }
  43751. req.Header = reqHeaders
  43752. googleapi.Expand(req.URL, map[string]string{
  43753. "project": c.project,
  43754. "backendBucket": c.backendBucket,
  43755. })
  43756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43757. }
  43758. // Do executes the "compute.backendBuckets.patch" call.
  43759. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43760. // status code is an error. Response headers are in either
  43761. // *Operation.ServerResponse.Header or (if a response was returned at
  43762. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43763. // to check whether the returned error was because
  43764. // http.StatusNotModified was returned.
  43765. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43766. gensupport.SetOptions(c.urlParams_, opts...)
  43767. res, err := c.doRequest("json")
  43768. if res != nil && res.StatusCode == http.StatusNotModified {
  43769. if res.Body != nil {
  43770. res.Body.Close()
  43771. }
  43772. return nil, &googleapi.Error{
  43773. Code: res.StatusCode,
  43774. Header: res.Header,
  43775. }
  43776. }
  43777. if err != nil {
  43778. return nil, err
  43779. }
  43780. defer googleapi.CloseBody(res)
  43781. if err := googleapi.CheckResponse(res); err != nil {
  43782. return nil, err
  43783. }
  43784. ret := &Operation{
  43785. ServerResponse: googleapi.ServerResponse{
  43786. Header: res.Header,
  43787. HTTPStatusCode: res.StatusCode,
  43788. },
  43789. }
  43790. target := &ret
  43791. if err := gensupport.DecodeResponse(target, res); err != nil {
  43792. return nil, err
  43793. }
  43794. return ret, nil
  43795. // {
  43796. // "description": "Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  43797. // "httpMethod": "PATCH",
  43798. // "id": "compute.backendBuckets.patch",
  43799. // "parameterOrder": [
  43800. // "project",
  43801. // "backendBucket"
  43802. // ],
  43803. // "parameters": {
  43804. // "backendBucket": {
  43805. // "description": "Name of the BackendBucket resource to patch.",
  43806. // "location": "path",
  43807. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43808. // "required": true,
  43809. // "type": "string"
  43810. // },
  43811. // "project": {
  43812. // "description": "Project ID for this request.",
  43813. // "location": "path",
  43814. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43815. // "required": true,
  43816. // "type": "string"
  43817. // },
  43818. // "requestId": {
  43819. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43820. // "location": "query",
  43821. // "type": "string"
  43822. // }
  43823. // },
  43824. // "path": "{project}/global/backendBuckets/{backendBucket}",
  43825. // "request": {
  43826. // "$ref": "BackendBucket"
  43827. // },
  43828. // "response": {
  43829. // "$ref": "Operation"
  43830. // },
  43831. // "scopes": [
  43832. // "https://www.googleapis.com/auth/cloud-platform",
  43833. // "https://www.googleapis.com/auth/compute"
  43834. // ]
  43835. // }
  43836. }
  43837. // method id "compute.backendBuckets.setIamPolicy":
  43838. type BackendBucketsSetIamPolicyCall struct {
  43839. s *Service
  43840. project string
  43841. resource string
  43842. globalsetpolicyrequest *GlobalSetPolicyRequest
  43843. urlParams_ gensupport.URLParams
  43844. ctx_ context.Context
  43845. header_ http.Header
  43846. }
  43847. // SetIamPolicy: Sets the access control policy on the specified
  43848. // resource. Replaces any existing policy.
  43849. func (r *BackendBucketsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *BackendBucketsSetIamPolicyCall {
  43850. c := &BackendBucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43851. c.project = project
  43852. c.resource = resource
  43853. c.globalsetpolicyrequest = globalsetpolicyrequest
  43854. return c
  43855. }
  43856. // Fields allows partial responses to be retrieved. See
  43857. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43858. // for more information.
  43859. func (c *BackendBucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BackendBucketsSetIamPolicyCall {
  43860. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43861. return c
  43862. }
  43863. // Context sets the context to be used in this call's Do method. Any
  43864. // pending HTTP request will be aborted if the provided context is
  43865. // canceled.
  43866. func (c *BackendBucketsSetIamPolicyCall) Context(ctx context.Context) *BackendBucketsSetIamPolicyCall {
  43867. c.ctx_ = ctx
  43868. return c
  43869. }
  43870. // Header returns an http.Header that can be modified by the caller to
  43871. // add HTTP headers to the request.
  43872. func (c *BackendBucketsSetIamPolicyCall) Header() http.Header {
  43873. if c.header_ == nil {
  43874. c.header_ = make(http.Header)
  43875. }
  43876. return c.header_
  43877. }
  43878. func (c *BackendBucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  43879. reqHeaders := make(http.Header)
  43880. for k, v := range c.header_ {
  43881. reqHeaders[k] = v
  43882. }
  43883. reqHeaders.Set("User-Agent", c.s.userAgent())
  43884. var body io.Reader = nil
  43885. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  43886. if err != nil {
  43887. return nil, err
  43888. }
  43889. reqHeaders.Set("Content-Type", "application/json")
  43890. c.urlParams_.Set("alt", alt)
  43891. c.urlParams_.Set("prettyPrint", "false")
  43892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/setIamPolicy")
  43893. urls += "?" + c.urlParams_.Encode()
  43894. req, err := http.NewRequest("POST", urls, body)
  43895. if err != nil {
  43896. return nil, err
  43897. }
  43898. req.Header = reqHeaders
  43899. googleapi.Expand(req.URL, map[string]string{
  43900. "project": c.project,
  43901. "resource": c.resource,
  43902. })
  43903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43904. }
  43905. // Do executes the "compute.backendBuckets.setIamPolicy" call.
  43906. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  43907. // code is an error. Response headers are in either
  43908. // *Policy.ServerResponse.Header or (if a response was returned at all)
  43909. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  43910. // check whether the returned error was because http.StatusNotModified
  43911. // was returned.
  43912. func (c *BackendBucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  43913. gensupport.SetOptions(c.urlParams_, opts...)
  43914. res, err := c.doRequest("json")
  43915. if res != nil && res.StatusCode == http.StatusNotModified {
  43916. if res.Body != nil {
  43917. res.Body.Close()
  43918. }
  43919. return nil, &googleapi.Error{
  43920. Code: res.StatusCode,
  43921. Header: res.Header,
  43922. }
  43923. }
  43924. if err != nil {
  43925. return nil, err
  43926. }
  43927. defer googleapi.CloseBody(res)
  43928. if err := googleapi.CheckResponse(res); err != nil {
  43929. return nil, err
  43930. }
  43931. ret := &Policy{
  43932. ServerResponse: googleapi.ServerResponse{
  43933. Header: res.Header,
  43934. HTTPStatusCode: res.StatusCode,
  43935. },
  43936. }
  43937. target := &ret
  43938. if err := gensupport.DecodeResponse(target, res); err != nil {
  43939. return nil, err
  43940. }
  43941. return ret, nil
  43942. // {
  43943. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  43944. // "httpMethod": "POST",
  43945. // "id": "compute.backendBuckets.setIamPolicy",
  43946. // "parameterOrder": [
  43947. // "project",
  43948. // "resource"
  43949. // ],
  43950. // "parameters": {
  43951. // "project": {
  43952. // "description": "Project ID for this request.",
  43953. // "location": "path",
  43954. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43955. // "required": true,
  43956. // "type": "string"
  43957. // },
  43958. // "resource": {
  43959. // "description": "Name or id of the resource for this request.",
  43960. // "location": "path",
  43961. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43962. // "required": true,
  43963. // "type": "string"
  43964. // }
  43965. // },
  43966. // "path": "{project}/global/backendBuckets/{resource}/setIamPolicy",
  43967. // "request": {
  43968. // "$ref": "GlobalSetPolicyRequest"
  43969. // },
  43970. // "response": {
  43971. // "$ref": "Policy"
  43972. // },
  43973. // "scopes": [
  43974. // "https://www.googleapis.com/auth/cloud-platform",
  43975. // "https://www.googleapis.com/auth/compute"
  43976. // ]
  43977. // }
  43978. }
  43979. // method id "compute.backendBuckets.testIamPermissions":
  43980. type BackendBucketsTestIamPermissionsCall struct {
  43981. s *Service
  43982. project string
  43983. resource string
  43984. testpermissionsrequest *TestPermissionsRequest
  43985. urlParams_ gensupport.URLParams
  43986. ctx_ context.Context
  43987. header_ http.Header
  43988. }
  43989. // TestIamPermissions: Returns permissions that a caller has on the
  43990. // specified resource.
  43991. func (r *BackendBucketsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendBucketsTestIamPermissionsCall {
  43992. c := &BackendBucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43993. c.project = project
  43994. c.resource = resource
  43995. c.testpermissionsrequest = testpermissionsrequest
  43996. return c
  43997. }
  43998. // Fields allows partial responses to be retrieved. See
  43999. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44000. // for more information.
  44001. func (c *BackendBucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendBucketsTestIamPermissionsCall {
  44002. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44003. return c
  44004. }
  44005. // Context sets the context to be used in this call's Do method. Any
  44006. // pending HTTP request will be aborted if the provided context is
  44007. // canceled.
  44008. func (c *BackendBucketsTestIamPermissionsCall) Context(ctx context.Context) *BackendBucketsTestIamPermissionsCall {
  44009. c.ctx_ = ctx
  44010. return c
  44011. }
  44012. // Header returns an http.Header that can be modified by the caller to
  44013. // add HTTP headers to the request.
  44014. func (c *BackendBucketsTestIamPermissionsCall) Header() http.Header {
  44015. if c.header_ == nil {
  44016. c.header_ = make(http.Header)
  44017. }
  44018. return c.header_
  44019. }
  44020. func (c *BackendBucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  44021. reqHeaders := make(http.Header)
  44022. for k, v := range c.header_ {
  44023. reqHeaders[k] = v
  44024. }
  44025. reqHeaders.Set("User-Agent", c.s.userAgent())
  44026. var body io.Reader = nil
  44027. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  44028. if err != nil {
  44029. return nil, err
  44030. }
  44031. reqHeaders.Set("Content-Type", "application/json")
  44032. c.urlParams_.Set("alt", alt)
  44033. c.urlParams_.Set("prettyPrint", "false")
  44034. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{resource}/testIamPermissions")
  44035. urls += "?" + c.urlParams_.Encode()
  44036. req, err := http.NewRequest("POST", urls, body)
  44037. if err != nil {
  44038. return nil, err
  44039. }
  44040. req.Header = reqHeaders
  44041. googleapi.Expand(req.URL, map[string]string{
  44042. "project": c.project,
  44043. "resource": c.resource,
  44044. })
  44045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44046. }
  44047. // Do executes the "compute.backendBuckets.testIamPermissions" call.
  44048. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  44049. // non-2xx status code is an error. Response headers are in either
  44050. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  44051. // returned at all) in error.(*googleapi.Error).Header. Use
  44052. // googleapi.IsNotModified to check whether the returned error was
  44053. // because http.StatusNotModified was returned.
  44054. func (c *BackendBucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  44055. gensupport.SetOptions(c.urlParams_, opts...)
  44056. res, err := c.doRequest("json")
  44057. if res != nil && res.StatusCode == http.StatusNotModified {
  44058. if res.Body != nil {
  44059. res.Body.Close()
  44060. }
  44061. return nil, &googleapi.Error{
  44062. Code: res.StatusCode,
  44063. Header: res.Header,
  44064. }
  44065. }
  44066. if err != nil {
  44067. return nil, err
  44068. }
  44069. defer googleapi.CloseBody(res)
  44070. if err := googleapi.CheckResponse(res); err != nil {
  44071. return nil, err
  44072. }
  44073. ret := &TestPermissionsResponse{
  44074. ServerResponse: googleapi.ServerResponse{
  44075. Header: res.Header,
  44076. HTTPStatusCode: res.StatusCode,
  44077. },
  44078. }
  44079. target := &ret
  44080. if err := gensupport.DecodeResponse(target, res); err != nil {
  44081. return nil, err
  44082. }
  44083. return ret, nil
  44084. // {
  44085. // "description": "Returns permissions that a caller has on the specified resource.",
  44086. // "httpMethod": "POST",
  44087. // "id": "compute.backendBuckets.testIamPermissions",
  44088. // "parameterOrder": [
  44089. // "project",
  44090. // "resource"
  44091. // ],
  44092. // "parameters": {
  44093. // "project": {
  44094. // "description": "Project ID for this request.",
  44095. // "location": "path",
  44096. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44097. // "required": true,
  44098. // "type": "string"
  44099. // },
  44100. // "resource": {
  44101. // "description": "Name or id of the resource for this request.",
  44102. // "location": "path",
  44103. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44104. // "required": true,
  44105. // "type": "string"
  44106. // }
  44107. // },
  44108. // "path": "{project}/global/backendBuckets/{resource}/testIamPermissions",
  44109. // "request": {
  44110. // "$ref": "TestPermissionsRequest"
  44111. // },
  44112. // "response": {
  44113. // "$ref": "TestPermissionsResponse"
  44114. // },
  44115. // "scopes": [
  44116. // "https://www.googleapis.com/auth/cloud-platform",
  44117. // "https://www.googleapis.com/auth/compute",
  44118. // "https://www.googleapis.com/auth/compute.readonly"
  44119. // ]
  44120. // }
  44121. }
  44122. // method id "compute.backendBuckets.update":
  44123. type BackendBucketsUpdateCall struct {
  44124. s *Service
  44125. project string
  44126. backendBucket string
  44127. backendbucket *BackendBucket
  44128. urlParams_ gensupport.URLParams
  44129. ctx_ context.Context
  44130. header_ http.Header
  44131. }
  44132. // Update: Updates the specified BackendBucket resource with the data
  44133. // included in the request.
  44134. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  44135. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44136. c.project = project
  44137. c.backendBucket = backendBucket
  44138. c.backendbucket = backendbucket
  44139. return c
  44140. }
  44141. // RequestId sets the optional parameter "requestId": An optional
  44142. // request ID to identify requests. Specify a unique request ID so that
  44143. // if you must retry your request, the server will know to ignore the
  44144. // request if it has already been completed.
  44145. //
  44146. // For example, consider a situation where you make an initial request
  44147. // and the request times out. If you make the request again with the
  44148. // same request ID, the server can check if original operation with the
  44149. // same request ID was received, and if so, will ignore the second
  44150. // request. This prevents clients from accidentally creating duplicate
  44151. // commitments.
  44152. //
  44153. // The request ID must be a valid UUID with the exception that zero UUID
  44154. // is not supported (00000000-0000-0000-0000-000000000000).
  44155. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  44156. c.urlParams_.Set("requestId", requestId)
  44157. return c
  44158. }
  44159. // Fields allows partial responses to be retrieved. See
  44160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44161. // for more information.
  44162. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  44163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44164. return c
  44165. }
  44166. // Context sets the context to be used in this call's Do method. Any
  44167. // pending HTTP request will be aborted if the provided context is
  44168. // canceled.
  44169. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  44170. c.ctx_ = ctx
  44171. return c
  44172. }
  44173. // Header returns an http.Header that can be modified by the caller to
  44174. // add HTTP headers to the request.
  44175. func (c *BackendBucketsUpdateCall) Header() http.Header {
  44176. if c.header_ == nil {
  44177. c.header_ = make(http.Header)
  44178. }
  44179. return c.header_
  44180. }
  44181. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  44182. reqHeaders := make(http.Header)
  44183. for k, v := range c.header_ {
  44184. reqHeaders[k] = v
  44185. }
  44186. reqHeaders.Set("User-Agent", c.s.userAgent())
  44187. var body io.Reader = nil
  44188. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  44189. if err != nil {
  44190. return nil, err
  44191. }
  44192. reqHeaders.Set("Content-Type", "application/json")
  44193. c.urlParams_.Set("alt", alt)
  44194. c.urlParams_.Set("prettyPrint", "false")
  44195. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  44196. urls += "?" + c.urlParams_.Encode()
  44197. req, err := http.NewRequest("PUT", urls, body)
  44198. if err != nil {
  44199. return nil, err
  44200. }
  44201. req.Header = reqHeaders
  44202. googleapi.Expand(req.URL, map[string]string{
  44203. "project": c.project,
  44204. "backendBucket": c.backendBucket,
  44205. })
  44206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44207. }
  44208. // Do executes the "compute.backendBuckets.update" call.
  44209. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44210. // status code is an error. Response headers are in either
  44211. // *Operation.ServerResponse.Header or (if a response was returned at
  44212. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44213. // to check whether the returned error was because
  44214. // http.StatusNotModified was returned.
  44215. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44216. gensupport.SetOptions(c.urlParams_, opts...)
  44217. res, err := c.doRequest("json")
  44218. if res != nil && res.StatusCode == http.StatusNotModified {
  44219. if res.Body != nil {
  44220. res.Body.Close()
  44221. }
  44222. return nil, &googleapi.Error{
  44223. Code: res.StatusCode,
  44224. Header: res.Header,
  44225. }
  44226. }
  44227. if err != nil {
  44228. return nil, err
  44229. }
  44230. defer googleapi.CloseBody(res)
  44231. if err := googleapi.CheckResponse(res); err != nil {
  44232. return nil, err
  44233. }
  44234. ret := &Operation{
  44235. ServerResponse: googleapi.ServerResponse{
  44236. Header: res.Header,
  44237. HTTPStatusCode: res.StatusCode,
  44238. },
  44239. }
  44240. target := &ret
  44241. if err := gensupport.DecodeResponse(target, res); err != nil {
  44242. return nil, err
  44243. }
  44244. return ret, nil
  44245. // {
  44246. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  44247. // "httpMethod": "PUT",
  44248. // "id": "compute.backendBuckets.update",
  44249. // "parameterOrder": [
  44250. // "project",
  44251. // "backendBucket"
  44252. // ],
  44253. // "parameters": {
  44254. // "backendBucket": {
  44255. // "description": "Name of the BackendBucket resource to update.",
  44256. // "location": "path",
  44257. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44258. // "required": true,
  44259. // "type": "string"
  44260. // },
  44261. // "project": {
  44262. // "description": "Project ID for this request.",
  44263. // "location": "path",
  44264. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44265. // "required": true,
  44266. // "type": "string"
  44267. // },
  44268. // "requestId": {
  44269. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44270. // "location": "query",
  44271. // "type": "string"
  44272. // }
  44273. // },
  44274. // "path": "{project}/global/backendBuckets/{backendBucket}",
  44275. // "request": {
  44276. // "$ref": "BackendBucket"
  44277. // },
  44278. // "response": {
  44279. // "$ref": "Operation"
  44280. // },
  44281. // "scopes": [
  44282. // "https://www.googleapis.com/auth/cloud-platform",
  44283. // "https://www.googleapis.com/auth/compute"
  44284. // ]
  44285. // }
  44286. }
  44287. // method id "compute.backendServices.addSignedUrlKey":
  44288. type BackendServicesAddSignedUrlKeyCall struct {
  44289. s *Service
  44290. project string
  44291. backendService string
  44292. signedurlkey *SignedUrlKey
  44293. urlParams_ gensupport.URLParams
  44294. ctx_ context.Context
  44295. header_ http.Header
  44296. }
  44297. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  44298. // for this backend service.
  44299. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  44300. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44301. c.project = project
  44302. c.backendService = backendService
  44303. c.signedurlkey = signedurlkey
  44304. return c
  44305. }
  44306. // RequestId sets the optional parameter "requestId": An optional
  44307. // request ID to identify requests. Specify a unique request ID so that
  44308. // if you must retry your request, the server will know to ignore the
  44309. // request if it has already been completed.
  44310. //
  44311. // For example, consider a situation where you make an initial request
  44312. // and the request times out. If you make the request again with the
  44313. // same request ID, the server can check if original operation with the
  44314. // same request ID was received, and if so, will ignore the second
  44315. // request. This prevents clients from accidentally creating duplicate
  44316. // commitments.
  44317. //
  44318. // The request ID must be a valid UUID with the exception that zero UUID
  44319. // is not supported (00000000-0000-0000-0000-000000000000).
  44320. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  44321. c.urlParams_.Set("requestId", requestId)
  44322. return c
  44323. }
  44324. // Fields allows partial responses to be retrieved. See
  44325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44326. // for more information.
  44327. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  44328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44329. return c
  44330. }
  44331. // Context sets the context to be used in this call's Do method. Any
  44332. // pending HTTP request will be aborted if the provided context is
  44333. // canceled.
  44334. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  44335. c.ctx_ = ctx
  44336. return c
  44337. }
  44338. // Header returns an http.Header that can be modified by the caller to
  44339. // add HTTP headers to the request.
  44340. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  44341. if c.header_ == nil {
  44342. c.header_ = make(http.Header)
  44343. }
  44344. return c.header_
  44345. }
  44346. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  44347. reqHeaders := make(http.Header)
  44348. for k, v := range c.header_ {
  44349. reqHeaders[k] = v
  44350. }
  44351. reqHeaders.Set("User-Agent", c.s.userAgent())
  44352. var body io.Reader = nil
  44353. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  44354. if err != nil {
  44355. return nil, err
  44356. }
  44357. reqHeaders.Set("Content-Type", "application/json")
  44358. c.urlParams_.Set("alt", alt)
  44359. c.urlParams_.Set("prettyPrint", "false")
  44360. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  44361. urls += "?" + c.urlParams_.Encode()
  44362. req, err := http.NewRequest("POST", urls, body)
  44363. if err != nil {
  44364. return nil, err
  44365. }
  44366. req.Header = reqHeaders
  44367. googleapi.Expand(req.URL, map[string]string{
  44368. "project": c.project,
  44369. "backendService": c.backendService,
  44370. })
  44371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44372. }
  44373. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  44374. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44375. // status code is an error. Response headers are in either
  44376. // *Operation.ServerResponse.Header or (if a response was returned at
  44377. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44378. // to check whether the returned error was because
  44379. // http.StatusNotModified was returned.
  44380. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44381. gensupport.SetOptions(c.urlParams_, opts...)
  44382. res, err := c.doRequest("json")
  44383. if res != nil && res.StatusCode == http.StatusNotModified {
  44384. if res.Body != nil {
  44385. res.Body.Close()
  44386. }
  44387. return nil, &googleapi.Error{
  44388. Code: res.StatusCode,
  44389. Header: res.Header,
  44390. }
  44391. }
  44392. if err != nil {
  44393. return nil, err
  44394. }
  44395. defer googleapi.CloseBody(res)
  44396. if err := googleapi.CheckResponse(res); err != nil {
  44397. return nil, err
  44398. }
  44399. ret := &Operation{
  44400. ServerResponse: googleapi.ServerResponse{
  44401. Header: res.Header,
  44402. HTTPStatusCode: res.StatusCode,
  44403. },
  44404. }
  44405. target := &ret
  44406. if err := gensupport.DecodeResponse(target, res); err != nil {
  44407. return nil, err
  44408. }
  44409. return ret, nil
  44410. // {
  44411. // "description": "Adds a key for validating requests with signed URLs for this backend service.",
  44412. // "httpMethod": "POST",
  44413. // "id": "compute.backendServices.addSignedUrlKey",
  44414. // "parameterOrder": [
  44415. // "project",
  44416. // "backendService"
  44417. // ],
  44418. // "parameters": {
  44419. // "backendService": {
  44420. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  44421. // "location": "path",
  44422. // "required": true,
  44423. // "type": "string"
  44424. // },
  44425. // "project": {
  44426. // "description": "Project ID for this request.",
  44427. // "location": "path",
  44428. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44429. // "required": true,
  44430. // "type": "string"
  44431. // },
  44432. // "requestId": {
  44433. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44434. // "location": "query",
  44435. // "type": "string"
  44436. // }
  44437. // },
  44438. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  44439. // "request": {
  44440. // "$ref": "SignedUrlKey"
  44441. // },
  44442. // "response": {
  44443. // "$ref": "Operation"
  44444. // },
  44445. // "scopes": [
  44446. // "https://www.googleapis.com/auth/cloud-platform",
  44447. // "https://www.googleapis.com/auth/compute"
  44448. // ]
  44449. // }
  44450. }
  44451. // method id "compute.backendServices.aggregatedList":
  44452. type BackendServicesAggregatedListCall struct {
  44453. s *Service
  44454. project string
  44455. urlParams_ gensupport.URLParams
  44456. ifNoneMatch_ string
  44457. ctx_ context.Context
  44458. header_ http.Header
  44459. }
  44460. // AggregatedList: Retrieves the list of all BackendService resources,
  44461. // regional and global, available to the specified project.
  44462. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  44463. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44464. c.project = project
  44465. return c
  44466. }
  44467. // Filter sets the optional parameter "filter": A filter expression that
  44468. // filters resources listed in the response. The expression must specify
  44469. // the field name, a comparison operator, and the value that you want to
  44470. // use for filtering. The value must be a string, a number, or a
  44471. // boolean. The comparison operator must be either =, !=, >, or <.
  44472. //
  44473. // For example, if you are filtering Compute Engine instances, you can
  44474. // exclude instances named example-instance by specifying name !=
  44475. // example-instance.
  44476. //
  44477. // You can also filter nested fields. For example, you could specify
  44478. // scheduling.automaticRestart = false to include instances only if they
  44479. // are not scheduled for automatic restarts. You can use filtering on
  44480. // nested fields to filter based on resource labels.
  44481. //
  44482. // To filter on multiple expressions, provide each separate expression
  44483. // within parentheses. For example, (scheduling.automaticRestart = true)
  44484. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44485. // AND expression. However, you can include AND and OR expressions
  44486. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44487. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44488. // true).
  44489. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  44490. c.urlParams_.Set("filter", filter)
  44491. return c
  44492. }
  44493. // MaxResults sets the optional parameter "maxResults": The maximum
  44494. // number of results per page that should be returned. If the number of
  44495. // available results is larger than maxResults, Compute Engine returns a
  44496. // nextPageToken that can be used to get the next page of results in
  44497. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44498. // (Default: 500)
  44499. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  44500. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44501. return c
  44502. }
  44503. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44504. // a certain order. By default, results are returned in alphanumerical
  44505. // order based on the resource name.
  44506. //
  44507. // You can also sort results in descending order based on the creation
  44508. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44509. // based on the creationTimestamp field in reverse chronological order
  44510. // (newest result first). Use this to sort resources like operations so
  44511. // that the newest operation is returned first.
  44512. //
  44513. // Currently, only sorting by name or creationTimestamp desc is
  44514. // supported.
  44515. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  44516. c.urlParams_.Set("orderBy", orderBy)
  44517. return c
  44518. }
  44519. // PageToken sets the optional parameter "pageToken": Specifies a page
  44520. // token to use. Set pageToken to the nextPageToken returned by a
  44521. // previous list request to get the next page of results.
  44522. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  44523. c.urlParams_.Set("pageToken", pageToken)
  44524. return c
  44525. }
  44526. // Fields allows partial responses to be retrieved. See
  44527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44528. // for more information.
  44529. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  44530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44531. return c
  44532. }
  44533. // IfNoneMatch sets the optional parameter which makes the operation
  44534. // fail if the object's ETag matches the given value. This is useful for
  44535. // getting updates only after the object has changed since the last
  44536. // request. Use googleapi.IsNotModified to check whether the response
  44537. // error from Do is the result of In-None-Match.
  44538. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  44539. c.ifNoneMatch_ = entityTag
  44540. return c
  44541. }
  44542. // Context sets the context to be used in this call's Do method. Any
  44543. // pending HTTP request will be aborted if the provided context is
  44544. // canceled.
  44545. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  44546. c.ctx_ = ctx
  44547. return c
  44548. }
  44549. // Header returns an http.Header that can be modified by the caller to
  44550. // add HTTP headers to the request.
  44551. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  44552. if c.header_ == nil {
  44553. c.header_ = make(http.Header)
  44554. }
  44555. return c.header_
  44556. }
  44557. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  44558. reqHeaders := make(http.Header)
  44559. for k, v := range c.header_ {
  44560. reqHeaders[k] = v
  44561. }
  44562. reqHeaders.Set("User-Agent", c.s.userAgent())
  44563. if c.ifNoneMatch_ != "" {
  44564. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44565. }
  44566. var body io.Reader = nil
  44567. c.urlParams_.Set("alt", alt)
  44568. c.urlParams_.Set("prettyPrint", "false")
  44569. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  44570. urls += "?" + c.urlParams_.Encode()
  44571. req, err := http.NewRequest("GET", urls, body)
  44572. if err != nil {
  44573. return nil, err
  44574. }
  44575. req.Header = reqHeaders
  44576. googleapi.Expand(req.URL, map[string]string{
  44577. "project": c.project,
  44578. })
  44579. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44580. }
  44581. // Do executes the "compute.backendServices.aggregatedList" call.
  44582. // Exactly one of *BackendServiceAggregatedList or error will be
  44583. // non-nil. Any non-2xx status code is an error. Response headers are in
  44584. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  44585. // response was returned at all) in error.(*googleapi.Error).Header. Use
  44586. // googleapi.IsNotModified to check whether the returned error was
  44587. // because http.StatusNotModified was returned.
  44588. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  44589. gensupport.SetOptions(c.urlParams_, opts...)
  44590. res, err := c.doRequest("json")
  44591. if res != nil && res.StatusCode == http.StatusNotModified {
  44592. if res.Body != nil {
  44593. res.Body.Close()
  44594. }
  44595. return nil, &googleapi.Error{
  44596. Code: res.StatusCode,
  44597. Header: res.Header,
  44598. }
  44599. }
  44600. if err != nil {
  44601. return nil, err
  44602. }
  44603. defer googleapi.CloseBody(res)
  44604. if err := googleapi.CheckResponse(res); err != nil {
  44605. return nil, err
  44606. }
  44607. ret := &BackendServiceAggregatedList{
  44608. ServerResponse: googleapi.ServerResponse{
  44609. Header: res.Header,
  44610. HTTPStatusCode: res.StatusCode,
  44611. },
  44612. }
  44613. target := &ret
  44614. if err := gensupport.DecodeResponse(target, res); err != nil {
  44615. return nil, err
  44616. }
  44617. return ret, nil
  44618. // {
  44619. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  44620. // "httpMethod": "GET",
  44621. // "id": "compute.backendServices.aggregatedList",
  44622. // "parameterOrder": [
  44623. // "project"
  44624. // ],
  44625. // "parameters": {
  44626. // "filter": {
  44627. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  44628. // "location": "query",
  44629. // "type": "string"
  44630. // },
  44631. // "maxResults": {
  44632. // "default": "500",
  44633. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  44634. // "format": "uint32",
  44635. // "location": "query",
  44636. // "minimum": "0",
  44637. // "type": "integer"
  44638. // },
  44639. // "orderBy": {
  44640. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  44641. // "location": "query",
  44642. // "type": "string"
  44643. // },
  44644. // "pageToken": {
  44645. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  44646. // "location": "query",
  44647. // "type": "string"
  44648. // },
  44649. // "project": {
  44650. // "description": "Name of the project scoping this request.",
  44651. // "location": "path",
  44652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44653. // "required": true,
  44654. // "type": "string"
  44655. // }
  44656. // },
  44657. // "path": "{project}/aggregated/backendServices",
  44658. // "response": {
  44659. // "$ref": "BackendServiceAggregatedList"
  44660. // },
  44661. // "scopes": [
  44662. // "https://www.googleapis.com/auth/cloud-platform",
  44663. // "https://www.googleapis.com/auth/compute",
  44664. // "https://www.googleapis.com/auth/compute.readonly"
  44665. // ]
  44666. // }
  44667. }
  44668. // Pages invokes f for each page of results.
  44669. // A non-nil error returned from f will halt the iteration.
  44670. // The provided context supersedes any context provided to the Context method.
  44671. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  44672. c.ctx_ = ctx
  44673. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44674. for {
  44675. x, err := c.Do()
  44676. if err != nil {
  44677. return err
  44678. }
  44679. if err := f(x); err != nil {
  44680. return err
  44681. }
  44682. if x.NextPageToken == "" {
  44683. return nil
  44684. }
  44685. c.PageToken(x.NextPageToken)
  44686. }
  44687. }
  44688. // method id "compute.backendServices.delete":
  44689. type BackendServicesDeleteCall struct {
  44690. s *Service
  44691. project string
  44692. backendService string
  44693. urlParams_ gensupport.URLParams
  44694. ctx_ context.Context
  44695. header_ http.Header
  44696. }
  44697. // Delete: Deletes the specified BackendService resource.
  44698. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  44699. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  44700. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44701. c.project = project
  44702. c.backendService = backendService
  44703. return c
  44704. }
  44705. // RequestId sets the optional parameter "requestId": An optional
  44706. // request ID to identify requests. Specify a unique request ID so that
  44707. // if you must retry your request, the server will know to ignore the
  44708. // request if it has already been completed.
  44709. //
  44710. // For example, consider a situation where you make an initial request
  44711. // and the request times out. If you make the request again with the
  44712. // same request ID, the server can check if original operation with the
  44713. // same request ID was received, and if so, will ignore the second
  44714. // request. This prevents clients from accidentally creating duplicate
  44715. // commitments.
  44716. //
  44717. // The request ID must be a valid UUID with the exception that zero UUID
  44718. // is not supported (00000000-0000-0000-0000-000000000000).
  44719. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  44720. c.urlParams_.Set("requestId", requestId)
  44721. return c
  44722. }
  44723. // Fields allows partial responses to be retrieved. See
  44724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44725. // for more information.
  44726. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  44727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44728. return c
  44729. }
  44730. // Context sets the context to be used in this call's Do method. Any
  44731. // pending HTTP request will be aborted if the provided context is
  44732. // canceled.
  44733. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  44734. c.ctx_ = ctx
  44735. return c
  44736. }
  44737. // Header returns an http.Header that can be modified by the caller to
  44738. // add HTTP headers to the request.
  44739. func (c *BackendServicesDeleteCall) Header() http.Header {
  44740. if c.header_ == nil {
  44741. c.header_ = make(http.Header)
  44742. }
  44743. return c.header_
  44744. }
  44745. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  44746. reqHeaders := make(http.Header)
  44747. for k, v := range c.header_ {
  44748. reqHeaders[k] = v
  44749. }
  44750. reqHeaders.Set("User-Agent", c.s.userAgent())
  44751. var body io.Reader = nil
  44752. c.urlParams_.Set("alt", alt)
  44753. c.urlParams_.Set("prettyPrint", "false")
  44754. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  44755. urls += "?" + c.urlParams_.Encode()
  44756. req, err := http.NewRequest("DELETE", urls, body)
  44757. if err != nil {
  44758. return nil, err
  44759. }
  44760. req.Header = reqHeaders
  44761. googleapi.Expand(req.URL, map[string]string{
  44762. "project": c.project,
  44763. "backendService": c.backendService,
  44764. })
  44765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44766. }
  44767. // Do executes the "compute.backendServices.delete" call.
  44768. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44769. // status code is an error. Response headers are in either
  44770. // *Operation.ServerResponse.Header or (if a response was returned at
  44771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44772. // to check whether the returned error was because
  44773. // http.StatusNotModified was returned.
  44774. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44775. gensupport.SetOptions(c.urlParams_, opts...)
  44776. res, err := c.doRequest("json")
  44777. if res != nil && res.StatusCode == http.StatusNotModified {
  44778. if res.Body != nil {
  44779. res.Body.Close()
  44780. }
  44781. return nil, &googleapi.Error{
  44782. Code: res.StatusCode,
  44783. Header: res.Header,
  44784. }
  44785. }
  44786. if err != nil {
  44787. return nil, err
  44788. }
  44789. defer googleapi.CloseBody(res)
  44790. if err := googleapi.CheckResponse(res); err != nil {
  44791. return nil, err
  44792. }
  44793. ret := &Operation{
  44794. ServerResponse: googleapi.ServerResponse{
  44795. Header: res.Header,
  44796. HTTPStatusCode: res.StatusCode,
  44797. },
  44798. }
  44799. target := &ret
  44800. if err := gensupport.DecodeResponse(target, res); err != nil {
  44801. return nil, err
  44802. }
  44803. return ret, nil
  44804. // {
  44805. // "description": "Deletes the specified BackendService resource.",
  44806. // "httpMethod": "DELETE",
  44807. // "id": "compute.backendServices.delete",
  44808. // "parameterOrder": [
  44809. // "project",
  44810. // "backendService"
  44811. // ],
  44812. // "parameters": {
  44813. // "backendService": {
  44814. // "description": "Name of the BackendService resource to delete.",
  44815. // "location": "path",
  44816. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44817. // "required": true,
  44818. // "type": "string"
  44819. // },
  44820. // "project": {
  44821. // "description": "Project ID for this request.",
  44822. // "location": "path",
  44823. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44824. // "required": true,
  44825. // "type": "string"
  44826. // },
  44827. // "requestId": {
  44828. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44829. // "location": "query",
  44830. // "type": "string"
  44831. // }
  44832. // },
  44833. // "path": "{project}/global/backendServices/{backendService}",
  44834. // "response": {
  44835. // "$ref": "Operation"
  44836. // },
  44837. // "scopes": [
  44838. // "https://www.googleapis.com/auth/cloud-platform",
  44839. // "https://www.googleapis.com/auth/compute"
  44840. // ]
  44841. // }
  44842. }
  44843. // method id "compute.backendServices.deleteSignedUrlKey":
  44844. type BackendServicesDeleteSignedUrlKeyCall struct {
  44845. s *Service
  44846. project string
  44847. backendService string
  44848. urlParams_ gensupport.URLParams
  44849. ctx_ context.Context
  44850. header_ http.Header
  44851. }
  44852. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  44853. // URLs for this backend service.
  44854. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  44855. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44856. c.project = project
  44857. c.backendService = backendService
  44858. c.urlParams_.Set("keyName", keyName)
  44859. return c
  44860. }
  44861. // RequestId sets the optional parameter "requestId": An optional
  44862. // request ID to identify requests. Specify a unique request ID so that
  44863. // if you must retry your request, the server will know to ignore the
  44864. // request if it has already been completed.
  44865. //
  44866. // For example, consider a situation where you make an initial request
  44867. // and the request times out. If you make the request again with the
  44868. // same request ID, the server can check if original operation with the
  44869. // same request ID was received, and if so, will ignore the second
  44870. // request. This prevents clients from accidentally creating duplicate
  44871. // commitments.
  44872. //
  44873. // The request ID must be a valid UUID with the exception that zero UUID
  44874. // is not supported (00000000-0000-0000-0000-000000000000).
  44875. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  44876. c.urlParams_.Set("requestId", requestId)
  44877. return c
  44878. }
  44879. // Fields allows partial responses to be retrieved. See
  44880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44881. // for more information.
  44882. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  44883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44884. return c
  44885. }
  44886. // Context sets the context to be used in this call's Do method. Any
  44887. // pending HTTP request will be aborted if the provided context is
  44888. // canceled.
  44889. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  44890. c.ctx_ = ctx
  44891. return c
  44892. }
  44893. // Header returns an http.Header that can be modified by the caller to
  44894. // add HTTP headers to the request.
  44895. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  44896. if c.header_ == nil {
  44897. c.header_ = make(http.Header)
  44898. }
  44899. return c.header_
  44900. }
  44901. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  44902. reqHeaders := make(http.Header)
  44903. for k, v := range c.header_ {
  44904. reqHeaders[k] = v
  44905. }
  44906. reqHeaders.Set("User-Agent", c.s.userAgent())
  44907. var body io.Reader = nil
  44908. c.urlParams_.Set("alt", alt)
  44909. c.urlParams_.Set("prettyPrint", "false")
  44910. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  44911. urls += "?" + c.urlParams_.Encode()
  44912. req, err := http.NewRequest("POST", urls, body)
  44913. if err != nil {
  44914. return nil, err
  44915. }
  44916. req.Header = reqHeaders
  44917. googleapi.Expand(req.URL, map[string]string{
  44918. "project": c.project,
  44919. "backendService": c.backendService,
  44920. })
  44921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44922. }
  44923. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  44924. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44925. // status code is an error. Response headers are in either
  44926. // *Operation.ServerResponse.Header or (if a response was returned at
  44927. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44928. // to check whether the returned error was because
  44929. // http.StatusNotModified was returned.
  44930. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44931. gensupport.SetOptions(c.urlParams_, opts...)
  44932. res, err := c.doRequest("json")
  44933. if res != nil && res.StatusCode == http.StatusNotModified {
  44934. if res.Body != nil {
  44935. res.Body.Close()
  44936. }
  44937. return nil, &googleapi.Error{
  44938. Code: res.StatusCode,
  44939. Header: res.Header,
  44940. }
  44941. }
  44942. if err != nil {
  44943. return nil, err
  44944. }
  44945. defer googleapi.CloseBody(res)
  44946. if err := googleapi.CheckResponse(res); err != nil {
  44947. return nil, err
  44948. }
  44949. ret := &Operation{
  44950. ServerResponse: googleapi.ServerResponse{
  44951. Header: res.Header,
  44952. HTTPStatusCode: res.StatusCode,
  44953. },
  44954. }
  44955. target := &ret
  44956. if err := gensupport.DecodeResponse(target, res); err != nil {
  44957. return nil, err
  44958. }
  44959. return ret, nil
  44960. // {
  44961. // "description": "Deletes a key for validating requests with signed URLs for this backend service.",
  44962. // "httpMethod": "POST",
  44963. // "id": "compute.backendServices.deleteSignedUrlKey",
  44964. // "parameterOrder": [
  44965. // "project",
  44966. // "backendService",
  44967. // "keyName"
  44968. // ],
  44969. // "parameters": {
  44970. // "backendService": {
  44971. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  44972. // "location": "path",
  44973. // "required": true,
  44974. // "type": "string"
  44975. // },
  44976. // "keyName": {
  44977. // "description": "The name of the Signed URL Key to delete.",
  44978. // "location": "query",
  44979. // "required": true,
  44980. // "type": "string"
  44981. // },
  44982. // "project": {
  44983. // "description": "Project ID for this request.",
  44984. // "location": "path",
  44985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44986. // "required": true,
  44987. // "type": "string"
  44988. // },
  44989. // "requestId": {
  44990. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44991. // "location": "query",
  44992. // "type": "string"
  44993. // }
  44994. // },
  44995. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  44996. // "response": {
  44997. // "$ref": "Operation"
  44998. // },
  44999. // "scopes": [
  45000. // "https://www.googleapis.com/auth/cloud-platform",
  45001. // "https://www.googleapis.com/auth/compute"
  45002. // ]
  45003. // }
  45004. }
  45005. // method id "compute.backendServices.get":
  45006. type BackendServicesGetCall struct {
  45007. s *Service
  45008. project string
  45009. backendService string
  45010. urlParams_ gensupport.URLParams
  45011. ifNoneMatch_ string
  45012. ctx_ context.Context
  45013. header_ http.Header
  45014. }
  45015. // Get: Returns the specified BackendService resource. Gets a list of
  45016. // available backend services.
  45017. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  45018. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  45019. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45020. c.project = project
  45021. c.backendService = backendService
  45022. return c
  45023. }
  45024. // Fields allows partial responses to be retrieved. See
  45025. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45026. // for more information.
  45027. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  45028. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45029. return c
  45030. }
  45031. // IfNoneMatch sets the optional parameter which makes the operation
  45032. // fail if the object's ETag matches the given value. This is useful for
  45033. // getting updates only after the object has changed since the last
  45034. // request. Use googleapi.IsNotModified to check whether the response
  45035. // error from Do is the result of In-None-Match.
  45036. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  45037. c.ifNoneMatch_ = entityTag
  45038. return c
  45039. }
  45040. // Context sets the context to be used in this call's Do method. Any
  45041. // pending HTTP request will be aborted if the provided context is
  45042. // canceled.
  45043. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  45044. c.ctx_ = ctx
  45045. return c
  45046. }
  45047. // Header returns an http.Header that can be modified by the caller to
  45048. // add HTTP headers to the request.
  45049. func (c *BackendServicesGetCall) Header() http.Header {
  45050. if c.header_ == nil {
  45051. c.header_ = make(http.Header)
  45052. }
  45053. return c.header_
  45054. }
  45055. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  45056. reqHeaders := make(http.Header)
  45057. for k, v := range c.header_ {
  45058. reqHeaders[k] = v
  45059. }
  45060. reqHeaders.Set("User-Agent", c.s.userAgent())
  45061. if c.ifNoneMatch_ != "" {
  45062. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45063. }
  45064. var body io.Reader = nil
  45065. c.urlParams_.Set("alt", alt)
  45066. c.urlParams_.Set("prettyPrint", "false")
  45067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  45068. urls += "?" + c.urlParams_.Encode()
  45069. req, err := http.NewRequest("GET", urls, body)
  45070. if err != nil {
  45071. return nil, err
  45072. }
  45073. req.Header = reqHeaders
  45074. googleapi.Expand(req.URL, map[string]string{
  45075. "project": c.project,
  45076. "backendService": c.backendService,
  45077. })
  45078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45079. }
  45080. // Do executes the "compute.backendServices.get" call.
  45081. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  45082. // status code is an error. Response headers are in either
  45083. // *BackendService.ServerResponse.Header or (if a response was returned
  45084. // at all) in error.(*googleapi.Error).Header. Use
  45085. // googleapi.IsNotModified to check whether the returned error was
  45086. // because http.StatusNotModified was returned.
  45087. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  45088. gensupport.SetOptions(c.urlParams_, opts...)
  45089. res, err := c.doRequest("json")
  45090. if res != nil && res.StatusCode == http.StatusNotModified {
  45091. if res.Body != nil {
  45092. res.Body.Close()
  45093. }
  45094. return nil, &googleapi.Error{
  45095. Code: res.StatusCode,
  45096. Header: res.Header,
  45097. }
  45098. }
  45099. if err != nil {
  45100. return nil, err
  45101. }
  45102. defer googleapi.CloseBody(res)
  45103. if err := googleapi.CheckResponse(res); err != nil {
  45104. return nil, err
  45105. }
  45106. ret := &BackendService{
  45107. ServerResponse: googleapi.ServerResponse{
  45108. Header: res.Header,
  45109. HTTPStatusCode: res.StatusCode,
  45110. },
  45111. }
  45112. target := &ret
  45113. if err := gensupport.DecodeResponse(target, res); err != nil {
  45114. return nil, err
  45115. }
  45116. return ret, nil
  45117. // {
  45118. // "description": "Returns the specified BackendService resource. Gets a list of available backend services.",
  45119. // "httpMethod": "GET",
  45120. // "id": "compute.backendServices.get",
  45121. // "parameterOrder": [
  45122. // "project",
  45123. // "backendService"
  45124. // ],
  45125. // "parameters": {
  45126. // "backendService": {
  45127. // "description": "Name of the BackendService resource to return.",
  45128. // "location": "path",
  45129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45130. // "required": true,
  45131. // "type": "string"
  45132. // },
  45133. // "project": {
  45134. // "description": "Project ID for this request.",
  45135. // "location": "path",
  45136. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45137. // "required": true,
  45138. // "type": "string"
  45139. // }
  45140. // },
  45141. // "path": "{project}/global/backendServices/{backendService}",
  45142. // "response": {
  45143. // "$ref": "BackendService"
  45144. // },
  45145. // "scopes": [
  45146. // "https://www.googleapis.com/auth/cloud-platform",
  45147. // "https://www.googleapis.com/auth/compute",
  45148. // "https://www.googleapis.com/auth/compute.readonly"
  45149. // ]
  45150. // }
  45151. }
  45152. // method id "compute.backendServices.getHealth":
  45153. type BackendServicesGetHealthCall struct {
  45154. s *Service
  45155. project string
  45156. backendService string
  45157. resourcegroupreference *ResourceGroupReference
  45158. urlParams_ gensupport.URLParams
  45159. ctx_ context.Context
  45160. header_ http.Header
  45161. }
  45162. // GetHealth: Gets the most recent health check results for this
  45163. // BackendService.
  45164. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  45165. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  45166. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45167. c.project = project
  45168. c.backendService = backendService
  45169. c.resourcegroupreference = resourcegroupreference
  45170. return c
  45171. }
  45172. // Fields allows partial responses to be retrieved. See
  45173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45174. // for more information.
  45175. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  45176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45177. return c
  45178. }
  45179. // Context sets the context to be used in this call's Do method. Any
  45180. // pending HTTP request will be aborted if the provided context is
  45181. // canceled.
  45182. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  45183. c.ctx_ = ctx
  45184. return c
  45185. }
  45186. // Header returns an http.Header that can be modified by the caller to
  45187. // add HTTP headers to the request.
  45188. func (c *BackendServicesGetHealthCall) Header() http.Header {
  45189. if c.header_ == nil {
  45190. c.header_ = make(http.Header)
  45191. }
  45192. return c.header_
  45193. }
  45194. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  45195. reqHeaders := make(http.Header)
  45196. for k, v := range c.header_ {
  45197. reqHeaders[k] = v
  45198. }
  45199. reqHeaders.Set("User-Agent", c.s.userAgent())
  45200. var body io.Reader = nil
  45201. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  45202. if err != nil {
  45203. return nil, err
  45204. }
  45205. reqHeaders.Set("Content-Type", "application/json")
  45206. c.urlParams_.Set("alt", alt)
  45207. c.urlParams_.Set("prettyPrint", "false")
  45208. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  45209. urls += "?" + c.urlParams_.Encode()
  45210. req, err := http.NewRequest("POST", urls, body)
  45211. if err != nil {
  45212. return nil, err
  45213. }
  45214. req.Header = reqHeaders
  45215. googleapi.Expand(req.URL, map[string]string{
  45216. "project": c.project,
  45217. "backendService": c.backendService,
  45218. })
  45219. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45220. }
  45221. // Do executes the "compute.backendServices.getHealth" call.
  45222. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  45223. // Any non-2xx status code is an error. Response headers are in either
  45224. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  45225. // was returned at all) in error.(*googleapi.Error).Header. Use
  45226. // googleapi.IsNotModified to check whether the returned error was
  45227. // because http.StatusNotModified was returned.
  45228. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  45229. gensupport.SetOptions(c.urlParams_, opts...)
  45230. res, err := c.doRequest("json")
  45231. if res != nil && res.StatusCode == http.StatusNotModified {
  45232. if res.Body != nil {
  45233. res.Body.Close()
  45234. }
  45235. return nil, &googleapi.Error{
  45236. Code: res.StatusCode,
  45237. Header: res.Header,
  45238. }
  45239. }
  45240. if err != nil {
  45241. return nil, err
  45242. }
  45243. defer googleapi.CloseBody(res)
  45244. if err := googleapi.CheckResponse(res); err != nil {
  45245. return nil, err
  45246. }
  45247. ret := &BackendServiceGroupHealth{
  45248. ServerResponse: googleapi.ServerResponse{
  45249. Header: res.Header,
  45250. HTTPStatusCode: res.StatusCode,
  45251. },
  45252. }
  45253. target := &ret
  45254. if err := gensupport.DecodeResponse(target, res); err != nil {
  45255. return nil, err
  45256. }
  45257. return ret, nil
  45258. // {
  45259. // "description": "Gets the most recent health check results for this BackendService.",
  45260. // "httpMethod": "POST",
  45261. // "id": "compute.backendServices.getHealth",
  45262. // "parameterOrder": [
  45263. // "project",
  45264. // "backendService"
  45265. // ],
  45266. // "parameters": {
  45267. // "backendService": {
  45268. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  45269. // "location": "path",
  45270. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45271. // "required": true,
  45272. // "type": "string"
  45273. // },
  45274. // "project": {
  45275. // "location": "path",
  45276. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45277. // "required": true,
  45278. // "type": "string"
  45279. // }
  45280. // },
  45281. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  45282. // "request": {
  45283. // "$ref": "ResourceGroupReference"
  45284. // },
  45285. // "response": {
  45286. // "$ref": "BackendServiceGroupHealth"
  45287. // },
  45288. // "scopes": [
  45289. // "https://www.googleapis.com/auth/cloud-platform",
  45290. // "https://www.googleapis.com/auth/compute",
  45291. // "https://www.googleapis.com/auth/compute.readonly"
  45292. // ]
  45293. // }
  45294. }
  45295. // method id "compute.backendServices.insert":
  45296. type BackendServicesInsertCall struct {
  45297. s *Service
  45298. project string
  45299. backendservice *BackendService
  45300. urlParams_ gensupport.URLParams
  45301. ctx_ context.Context
  45302. header_ http.Header
  45303. }
  45304. // Insert: Creates a BackendService resource in the specified project
  45305. // using the data included in the request. There are several
  45306. // restrictions and guidelines to keep in mind when creating a backend
  45307. // service. Read Restrictions and Guidelines for more information.
  45308. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  45309. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  45310. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45311. c.project = project
  45312. c.backendservice = backendservice
  45313. return c
  45314. }
  45315. // RequestId sets the optional parameter "requestId": An optional
  45316. // request ID to identify requests. Specify a unique request ID so that
  45317. // if you must retry your request, the server will know to ignore the
  45318. // request if it has already been completed.
  45319. //
  45320. // For example, consider a situation where you make an initial request
  45321. // and the request times out. If you make the request again with the
  45322. // same request ID, the server can check if original operation with the
  45323. // same request ID was received, and if so, will ignore the second
  45324. // request. This prevents clients from accidentally creating duplicate
  45325. // commitments.
  45326. //
  45327. // The request ID must be a valid UUID with the exception that zero UUID
  45328. // is not supported (00000000-0000-0000-0000-000000000000).
  45329. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  45330. c.urlParams_.Set("requestId", requestId)
  45331. return c
  45332. }
  45333. // Fields allows partial responses to be retrieved. See
  45334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45335. // for more information.
  45336. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  45337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45338. return c
  45339. }
  45340. // Context sets the context to be used in this call's Do method. Any
  45341. // pending HTTP request will be aborted if the provided context is
  45342. // canceled.
  45343. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  45344. c.ctx_ = ctx
  45345. return c
  45346. }
  45347. // Header returns an http.Header that can be modified by the caller to
  45348. // add HTTP headers to the request.
  45349. func (c *BackendServicesInsertCall) Header() http.Header {
  45350. if c.header_ == nil {
  45351. c.header_ = make(http.Header)
  45352. }
  45353. return c.header_
  45354. }
  45355. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  45356. reqHeaders := make(http.Header)
  45357. for k, v := range c.header_ {
  45358. reqHeaders[k] = v
  45359. }
  45360. reqHeaders.Set("User-Agent", c.s.userAgent())
  45361. var body io.Reader = nil
  45362. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  45363. if err != nil {
  45364. return nil, err
  45365. }
  45366. reqHeaders.Set("Content-Type", "application/json")
  45367. c.urlParams_.Set("alt", alt)
  45368. c.urlParams_.Set("prettyPrint", "false")
  45369. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  45370. urls += "?" + c.urlParams_.Encode()
  45371. req, err := http.NewRequest("POST", urls, body)
  45372. if err != nil {
  45373. return nil, err
  45374. }
  45375. req.Header = reqHeaders
  45376. googleapi.Expand(req.URL, map[string]string{
  45377. "project": c.project,
  45378. })
  45379. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45380. }
  45381. // Do executes the "compute.backendServices.insert" call.
  45382. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45383. // status code is an error. Response headers are in either
  45384. // *Operation.ServerResponse.Header or (if a response was returned at
  45385. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45386. // to check whether the returned error was because
  45387. // http.StatusNotModified was returned.
  45388. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45389. gensupport.SetOptions(c.urlParams_, opts...)
  45390. res, err := c.doRequest("json")
  45391. if res != nil && res.StatusCode == http.StatusNotModified {
  45392. if res.Body != nil {
  45393. res.Body.Close()
  45394. }
  45395. return nil, &googleapi.Error{
  45396. Code: res.StatusCode,
  45397. Header: res.Header,
  45398. }
  45399. }
  45400. if err != nil {
  45401. return nil, err
  45402. }
  45403. defer googleapi.CloseBody(res)
  45404. if err := googleapi.CheckResponse(res); err != nil {
  45405. return nil, err
  45406. }
  45407. ret := &Operation{
  45408. ServerResponse: googleapi.ServerResponse{
  45409. Header: res.Header,
  45410. HTTPStatusCode: res.StatusCode,
  45411. },
  45412. }
  45413. target := &ret
  45414. if err := gensupport.DecodeResponse(target, res); err != nil {
  45415. return nil, err
  45416. }
  45417. return ret, nil
  45418. // {
  45419. // "description": "Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information.",
  45420. // "httpMethod": "POST",
  45421. // "id": "compute.backendServices.insert",
  45422. // "parameterOrder": [
  45423. // "project"
  45424. // ],
  45425. // "parameters": {
  45426. // "project": {
  45427. // "description": "Project ID for this request.",
  45428. // "location": "path",
  45429. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45430. // "required": true,
  45431. // "type": "string"
  45432. // },
  45433. // "requestId": {
  45434. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45435. // "location": "query",
  45436. // "type": "string"
  45437. // }
  45438. // },
  45439. // "path": "{project}/global/backendServices",
  45440. // "request": {
  45441. // "$ref": "BackendService"
  45442. // },
  45443. // "response": {
  45444. // "$ref": "Operation"
  45445. // },
  45446. // "scopes": [
  45447. // "https://www.googleapis.com/auth/cloud-platform",
  45448. // "https://www.googleapis.com/auth/compute"
  45449. // ]
  45450. // }
  45451. }
  45452. // method id "compute.backendServices.list":
  45453. type BackendServicesListCall struct {
  45454. s *Service
  45455. project string
  45456. urlParams_ gensupport.URLParams
  45457. ifNoneMatch_ string
  45458. ctx_ context.Context
  45459. header_ http.Header
  45460. }
  45461. // List: Retrieves the list of BackendService resources available to the
  45462. // specified project.
  45463. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  45464. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  45465. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45466. c.project = project
  45467. return c
  45468. }
  45469. // Filter sets the optional parameter "filter": A filter expression that
  45470. // filters resources listed in the response. The expression must specify
  45471. // the field name, a comparison operator, and the value that you want to
  45472. // use for filtering. The value must be a string, a number, or a
  45473. // boolean. The comparison operator must be either =, !=, >, or <.
  45474. //
  45475. // For example, if you are filtering Compute Engine instances, you can
  45476. // exclude instances named example-instance by specifying name !=
  45477. // example-instance.
  45478. //
  45479. // You can also filter nested fields. For example, you could specify
  45480. // scheduling.automaticRestart = false to include instances only if they
  45481. // are not scheduled for automatic restarts. You can use filtering on
  45482. // nested fields to filter based on resource labels.
  45483. //
  45484. // To filter on multiple expressions, provide each separate expression
  45485. // within parentheses. For example, (scheduling.automaticRestart = true)
  45486. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45487. // AND expression. However, you can include AND and OR expressions
  45488. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  45489. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  45490. // true).
  45491. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  45492. c.urlParams_.Set("filter", filter)
  45493. return c
  45494. }
  45495. // MaxResults sets the optional parameter "maxResults": The maximum
  45496. // number of results per page that should be returned. If the number of
  45497. // available results is larger than maxResults, Compute Engine returns a
  45498. // nextPageToken that can be used to get the next page of results in
  45499. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45500. // (Default: 500)
  45501. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  45502. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45503. return c
  45504. }
  45505. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  45506. // a certain order. By default, results are returned in alphanumerical
  45507. // order based on the resource name.
  45508. //
  45509. // You can also sort results in descending order based on the creation
  45510. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45511. // based on the creationTimestamp field in reverse chronological order
  45512. // (newest result first). Use this to sort resources like operations so
  45513. // that the newest operation is returned first.
  45514. //
  45515. // Currently, only sorting by name or creationTimestamp desc is
  45516. // supported.
  45517. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  45518. c.urlParams_.Set("orderBy", orderBy)
  45519. return c
  45520. }
  45521. // PageToken sets the optional parameter "pageToken": Specifies a page
  45522. // token to use. Set pageToken to the nextPageToken returned by a
  45523. // previous list request to get the next page of results.
  45524. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  45525. c.urlParams_.Set("pageToken", pageToken)
  45526. return c
  45527. }
  45528. // Fields allows partial responses to be retrieved. See
  45529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45530. // for more information.
  45531. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  45532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45533. return c
  45534. }
  45535. // IfNoneMatch sets the optional parameter which makes the operation
  45536. // fail if the object's ETag matches the given value. This is useful for
  45537. // getting updates only after the object has changed since the last
  45538. // request. Use googleapi.IsNotModified to check whether the response
  45539. // error from Do is the result of In-None-Match.
  45540. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  45541. c.ifNoneMatch_ = entityTag
  45542. return c
  45543. }
  45544. // Context sets the context to be used in this call's Do method. Any
  45545. // pending HTTP request will be aborted if the provided context is
  45546. // canceled.
  45547. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  45548. c.ctx_ = ctx
  45549. return c
  45550. }
  45551. // Header returns an http.Header that can be modified by the caller to
  45552. // add HTTP headers to the request.
  45553. func (c *BackendServicesListCall) Header() http.Header {
  45554. if c.header_ == nil {
  45555. c.header_ = make(http.Header)
  45556. }
  45557. return c.header_
  45558. }
  45559. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  45560. reqHeaders := make(http.Header)
  45561. for k, v := range c.header_ {
  45562. reqHeaders[k] = v
  45563. }
  45564. reqHeaders.Set("User-Agent", c.s.userAgent())
  45565. if c.ifNoneMatch_ != "" {
  45566. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45567. }
  45568. var body io.Reader = nil
  45569. c.urlParams_.Set("alt", alt)
  45570. c.urlParams_.Set("prettyPrint", "false")
  45571. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  45572. urls += "?" + c.urlParams_.Encode()
  45573. req, err := http.NewRequest("GET", urls, body)
  45574. if err != nil {
  45575. return nil, err
  45576. }
  45577. req.Header = reqHeaders
  45578. googleapi.Expand(req.URL, map[string]string{
  45579. "project": c.project,
  45580. })
  45581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45582. }
  45583. // Do executes the "compute.backendServices.list" call.
  45584. // Exactly one of *BackendServiceList or error will be non-nil. Any
  45585. // non-2xx status code is an error. Response headers are in either
  45586. // *BackendServiceList.ServerResponse.Header or (if a response was
  45587. // returned at all) in error.(*googleapi.Error).Header. Use
  45588. // googleapi.IsNotModified to check whether the returned error was
  45589. // because http.StatusNotModified was returned.
  45590. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  45591. gensupport.SetOptions(c.urlParams_, opts...)
  45592. res, err := c.doRequest("json")
  45593. if res != nil && res.StatusCode == http.StatusNotModified {
  45594. if res.Body != nil {
  45595. res.Body.Close()
  45596. }
  45597. return nil, &googleapi.Error{
  45598. Code: res.StatusCode,
  45599. Header: res.Header,
  45600. }
  45601. }
  45602. if err != nil {
  45603. return nil, err
  45604. }
  45605. defer googleapi.CloseBody(res)
  45606. if err := googleapi.CheckResponse(res); err != nil {
  45607. return nil, err
  45608. }
  45609. ret := &BackendServiceList{
  45610. ServerResponse: googleapi.ServerResponse{
  45611. Header: res.Header,
  45612. HTTPStatusCode: res.StatusCode,
  45613. },
  45614. }
  45615. target := &ret
  45616. if err := gensupport.DecodeResponse(target, res); err != nil {
  45617. return nil, err
  45618. }
  45619. return ret, nil
  45620. // {
  45621. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  45622. // "httpMethod": "GET",
  45623. // "id": "compute.backendServices.list",
  45624. // "parameterOrder": [
  45625. // "project"
  45626. // ],
  45627. // "parameters": {
  45628. // "filter": {
  45629. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  45630. // "location": "query",
  45631. // "type": "string"
  45632. // },
  45633. // "maxResults": {
  45634. // "default": "500",
  45635. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  45636. // "format": "uint32",
  45637. // "location": "query",
  45638. // "minimum": "0",
  45639. // "type": "integer"
  45640. // },
  45641. // "orderBy": {
  45642. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  45643. // "location": "query",
  45644. // "type": "string"
  45645. // },
  45646. // "pageToken": {
  45647. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  45648. // "location": "query",
  45649. // "type": "string"
  45650. // },
  45651. // "project": {
  45652. // "description": "Project ID for this request.",
  45653. // "location": "path",
  45654. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45655. // "required": true,
  45656. // "type": "string"
  45657. // }
  45658. // },
  45659. // "path": "{project}/global/backendServices",
  45660. // "response": {
  45661. // "$ref": "BackendServiceList"
  45662. // },
  45663. // "scopes": [
  45664. // "https://www.googleapis.com/auth/cloud-platform",
  45665. // "https://www.googleapis.com/auth/compute",
  45666. // "https://www.googleapis.com/auth/compute.readonly"
  45667. // ]
  45668. // }
  45669. }
  45670. // Pages invokes f for each page of results.
  45671. // A non-nil error returned from f will halt the iteration.
  45672. // The provided context supersedes any context provided to the Context method.
  45673. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  45674. c.ctx_ = ctx
  45675. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45676. for {
  45677. x, err := c.Do()
  45678. if err != nil {
  45679. return err
  45680. }
  45681. if err := f(x); err != nil {
  45682. return err
  45683. }
  45684. if x.NextPageToken == "" {
  45685. return nil
  45686. }
  45687. c.PageToken(x.NextPageToken)
  45688. }
  45689. }
  45690. // method id "compute.backendServices.patch":
  45691. type BackendServicesPatchCall struct {
  45692. s *Service
  45693. project string
  45694. backendService string
  45695. backendservice *BackendService
  45696. urlParams_ gensupport.URLParams
  45697. ctx_ context.Context
  45698. header_ http.Header
  45699. }
  45700. // Patch: Patches the specified BackendService resource with the data
  45701. // included in the request. There are several restrictions and
  45702. // guidelines to keep in mind when updating a backend service. Read
  45703. // Restrictions and Guidelines for more information. This method
  45704. // supports PATCH semantics and uses the JSON merge patch format and
  45705. // processing rules.
  45706. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  45707. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  45708. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45709. c.project = project
  45710. c.backendService = backendService
  45711. c.backendservice = backendservice
  45712. return c
  45713. }
  45714. // RequestId sets the optional parameter "requestId": An optional
  45715. // request ID to identify requests. Specify a unique request ID so that
  45716. // if you must retry your request, the server will know to ignore the
  45717. // request if it has already been completed.
  45718. //
  45719. // For example, consider a situation where you make an initial request
  45720. // and the request times out. If you make the request again with the
  45721. // same request ID, the server can check if original operation with the
  45722. // same request ID was received, and if so, will ignore the second
  45723. // request. This prevents clients from accidentally creating duplicate
  45724. // commitments.
  45725. //
  45726. // The request ID must be a valid UUID with the exception that zero UUID
  45727. // is not supported (00000000-0000-0000-0000-000000000000).
  45728. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  45729. c.urlParams_.Set("requestId", requestId)
  45730. return c
  45731. }
  45732. // Fields allows partial responses to be retrieved. See
  45733. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45734. // for more information.
  45735. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  45736. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45737. return c
  45738. }
  45739. // Context sets the context to be used in this call's Do method. Any
  45740. // pending HTTP request will be aborted if the provided context is
  45741. // canceled.
  45742. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  45743. c.ctx_ = ctx
  45744. return c
  45745. }
  45746. // Header returns an http.Header that can be modified by the caller to
  45747. // add HTTP headers to the request.
  45748. func (c *BackendServicesPatchCall) Header() http.Header {
  45749. if c.header_ == nil {
  45750. c.header_ = make(http.Header)
  45751. }
  45752. return c.header_
  45753. }
  45754. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  45755. reqHeaders := make(http.Header)
  45756. for k, v := range c.header_ {
  45757. reqHeaders[k] = v
  45758. }
  45759. reqHeaders.Set("User-Agent", c.s.userAgent())
  45760. var body io.Reader = nil
  45761. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  45762. if err != nil {
  45763. return nil, err
  45764. }
  45765. reqHeaders.Set("Content-Type", "application/json")
  45766. c.urlParams_.Set("alt", alt)
  45767. c.urlParams_.Set("prettyPrint", "false")
  45768. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  45769. urls += "?" + c.urlParams_.Encode()
  45770. req, err := http.NewRequest("PATCH", urls, body)
  45771. if err != nil {
  45772. return nil, err
  45773. }
  45774. req.Header = reqHeaders
  45775. googleapi.Expand(req.URL, map[string]string{
  45776. "project": c.project,
  45777. "backendService": c.backendService,
  45778. })
  45779. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45780. }
  45781. // Do executes the "compute.backendServices.patch" call.
  45782. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45783. // status code is an error. Response headers are in either
  45784. // *Operation.ServerResponse.Header or (if a response was returned at
  45785. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45786. // to check whether the returned error was because
  45787. // http.StatusNotModified was returned.
  45788. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45789. gensupport.SetOptions(c.urlParams_, opts...)
  45790. res, err := c.doRequest("json")
  45791. if res != nil && res.StatusCode == http.StatusNotModified {
  45792. if res.Body != nil {
  45793. res.Body.Close()
  45794. }
  45795. return nil, &googleapi.Error{
  45796. Code: res.StatusCode,
  45797. Header: res.Header,
  45798. }
  45799. }
  45800. if err != nil {
  45801. return nil, err
  45802. }
  45803. defer googleapi.CloseBody(res)
  45804. if err := googleapi.CheckResponse(res); err != nil {
  45805. return nil, err
  45806. }
  45807. ret := &Operation{
  45808. ServerResponse: googleapi.ServerResponse{
  45809. Header: res.Header,
  45810. HTTPStatusCode: res.StatusCode,
  45811. },
  45812. }
  45813. target := &ret
  45814. if err := gensupport.DecodeResponse(target, res); err != nil {
  45815. return nil, err
  45816. }
  45817. return ret, nil
  45818. // {
  45819. // "description": "Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  45820. // "httpMethod": "PATCH",
  45821. // "id": "compute.backendServices.patch",
  45822. // "parameterOrder": [
  45823. // "project",
  45824. // "backendService"
  45825. // ],
  45826. // "parameters": {
  45827. // "backendService": {
  45828. // "description": "Name of the BackendService resource to patch.",
  45829. // "location": "path",
  45830. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45831. // "required": true,
  45832. // "type": "string"
  45833. // },
  45834. // "project": {
  45835. // "description": "Project ID for this request.",
  45836. // "location": "path",
  45837. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45838. // "required": true,
  45839. // "type": "string"
  45840. // },
  45841. // "requestId": {
  45842. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45843. // "location": "query",
  45844. // "type": "string"
  45845. // }
  45846. // },
  45847. // "path": "{project}/global/backendServices/{backendService}",
  45848. // "request": {
  45849. // "$ref": "BackendService"
  45850. // },
  45851. // "response": {
  45852. // "$ref": "Operation"
  45853. // },
  45854. // "scopes": [
  45855. // "https://www.googleapis.com/auth/cloud-platform",
  45856. // "https://www.googleapis.com/auth/compute"
  45857. // ]
  45858. // }
  45859. }
  45860. // method id "compute.backendServices.setSecurityPolicy":
  45861. type BackendServicesSetSecurityPolicyCall struct {
  45862. s *Service
  45863. project string
  45864. backendService string
  45865. securitypolicyreference *SecurityPolicyReference
  45866. urlParams_ gensupport.URLParams
  45867. ctx_ context.Context
  45868. header_ http.Header
  45869. }
  45870. // SetSecurityPolicy: Sets the security policy for the specified backend
  45871. // service.
  45872. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  45873. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45874. c.project = project
  45875. c.backendService = backendService
  45876. c.securitypolicyreference = securitypolicyreference
  45877. return c
  45878. }
  45879. // RequestId sets the optional parameter "requestId": An optional
  45880. // request ID to identify requests. Specify a unique request ID so that
  45881. // if you must retry your request, the server will know to ignore the
  45882. // request if it has already been completed.
  45883. //
  45884. // For example, consider a situation where you make an initial request
  45885. // and the request times out. If you make the request again with the
  45886. // same request ID, the server can check if original operation with the
  45887. // same request ID was received, and if so, will ignore the second
  45888. // request. This prevents clients from accidentally creating duplicate
  45889. // commitments.
  45890. //
  45891. // The request ID must be a valid UUID with the exception that zero UUID
  45892. // is not supported (00000000-0000-0000-0000-000000000000).
  45893. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  45894. c.urlParams_.Set("requestId", requestId)
  45895. return c
  45896. }
  45897. // Fields allows partial responses to be retrieved. See
  45898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45899. // for more information.
  45900. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  45901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45902. return c
  45903. }
  45904. // Context sets the context to be used in this call's Do method. Any
  45905. // pending HTTP request will be aborted if the provided context is
  45906. // canceled.
  45907. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  45908. c.ctx_ = ctx
  45909. return c
  45910. }
  45911. // Header returns an http.Header that can be modified by the caller to
  45912. // add HTTP headers to the request.
  45913. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  45914. if c.header_ == nil {
  45915. c.header_ = make(http.Header)
  45916. }
  45917. return c.header_
  45918. }
  45919. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  45920. reqHeaders := make(http.Header)
  45921. for k, v := range c.header_ {
  45922. reqHeaders[k] = v
  45923. }
  45924. reqHeaders.Set("User-Agent", c.s.userAgent())
  45925. var body io.Reader = nil
  45926. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  45927. if err != nil {
  45928. return nil, err
  45929. }
  45930. reqHeaders.Set("Content-Type", "application/json")
  45931. c.urlParams_.Set("alt", alt)
  45932. c.urlParams_.Set("prettyPrint", "false")
  45933. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  45934. urls += "?" + c.urlParams_.Encode()
  45935. req, err := http.NewRequest("POST", urls, body)
  45936. if err != nil {
  45937. return nil, err
  45938. }
  45939. req.Header = reqHeaders
  45940. googleapi.Expand(req.URL, map[string]string{
  45941. "project": c.project,
  45942. "backendService": c.backendService,
  45943. })
  45944. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45945. }
  45946. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  45947. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45948. // status code is an error. Response headers are in either
  45949. // *Operation.ServerResponse.Header or (if a response was returned at
  45950. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45951. // to check whether the returned error was because
  45952. // http.StatusNotModified was returned.
  45953. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45954. gensupport.SetOptions(c.urlParams_, opts...)
  45955. res, err := c.doRequest("json")
  45956. if res != nil && res.StatusCode == http.StatusNotModified {
  45957. if res.Body != nil {
  45958. res.Body.Close()
  45959. }
  45960. return nil, &googleapi.Error{
  45961. Code: res.StatusCode,
  45962. Header: res.Header,
  45963. }
  45964. }
  45965. if err != nil {
  45966. return nil, err
  45967. }
  45968. defer googleapi.CloseBody(res)
  45969. if err := googleapi.CheckResponse(res); err != nil {
  45970. return nil, err
  45971. }
  45972. ret := &Operation{
  45973. ServerResponse: googleapi.ServerResponse{
  45974. Header: res.Header,
  45975. HTTPStatusCode: res.StatusCode,
  45976. },
  45977. }
  45978. target := &ret
  45979. if err := gensupport.DecodeResponse(target, res); err != nil {
  45980. return nil, err
  45981. }
  45982. return ret, nil
  45983. // {
  45984. // "description": "Sets the security policy for the specified backend service.",
  45985. // "httpMethod": "POST",
  45986. // "id": "compute.backendServices.setSecurityPolicy",
  45987. // "parameterOrder": [
  45988. // "project",
  45989. // "backendService"
  45990. // ],
  45991. // "parameters": {
  45992. // "backendService": {
  45993. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  45994. // "location": "path",
  45995. // "required": true,
  45996. // "type": "string"
  45997. // },
  45998. // "project": {
  45999. // "description": "Project ID for this request.",
  46000. // "location": "path",
  46001. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46002. // "required": true,
  46003. // "type": "string"
  46004. // },
  46005. // "requestId": {
  46006. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46007. // "location": "query",
  46008. // "type": "string"
  46009. // }
  46010. // },
  46011. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  46012. // "request": {
  46013. // "$ref": "SecurityPolicyReference"
  46014. // },
  46015. // "response": {
  46016. // "$ref": "Operation"
  46017. // },
  46018. // "scopes": [
  46019. // "https://www.googleapis.com/auth/cloud-platform",
  46020. // "https://www.googleapis.com/auth/compute"
  46021. // ]
  46022. // }
  46023. }
  46024. // method id "compute.backendServices.testIamPermissions":
  46025. type BackendServicesTestIamPermissionsCall struct {
  46026. s *Service
  46027. project string
  46028. resource string
  46029. testpermissionsrequest *TestPermissionsRequest
  46030. urlParams_ gensupport.URLParams
  46031. ctx_ context.Context
  46032. header_ http.Header
  46033. }
  46034. // TestIamPermissions: Returns permissions that a caller has on the
  46035. // specified resource.
  46036. func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
  46037. c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46038. c.project = project
  46039. c.resource = resource
  46040. c.testpermissionsrequest = testpermissionsrequest
  46041. return c
  46042. }
  46043. // Fields allows partial responses to be retrieved. See
  46044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46045. // for more information.
  46046. func (c *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
  46047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46048. return c
  46049. }
  46050. // Context sets the context to be used in this call's Do method. Any
  46051. // pending HTTP request will be aborted if the provided context is
  46052. // canceled.
  46053. func (c *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
  46054. c.ctx_ = ctx
  46055. return c
  46056. }
  46057. // Header returns an http.Header that can be modified by the caller to
  46058. // add HTTP headers to the request.
  46059. func (c *BackendServicesTestIamPermissionsCall) Header() http.Header {
  46060. if c.header_ == nil {
  46061. c.header_ = make(http.Header)
  46062. }
  46063. return c.header_
  46064. }
  46065. func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  46066. reqHeaders := make(http.Header)
  46067. for k, v := range c.header_ {
  46068. reqHeaders[k] = v
  46069. }
  46070. reqHeaders.Set("User-Agent", c.s.userAgent())
  46071. var body io.Reader = nil
  46072. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  46073. if err != nil {
  46074. return nil, err
  46075. }
  46076. reqHeaders.Set("Content-Type", "application/json")
  46077. c.urlParams_.Set("alt", alt)
  46078. c.urlParams_.Set("prettyPrint", "false")
  46079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{resource}/testIamPermissions")
  46080. urls += "?" + c.urlParams_.Encode()
  46081. req, err := http.NewRequest("POST", urls, body)
  46082. if err != nil {
  46083. return nil, err
  46084. }
  46085. req.Header = reqHeaders
  46086. googleapi.Expand(req.URL, map[string]string{
  46087. "project": c.project,
  46088. "resource": c.resource,
  46089. })
  46090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46091. }
  46092. // Do executes the "compute.backendServices.testIamPermissions" call.
  46093. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  46094. // non-2xx status code is an error. Response headers are in either
  46095. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  46096. // returned at all) in error.(*googleapi.Error).Header. Use
  46097. // googleapi.IsNotModified to check whether the returned error was
  46098. // because http.StatusNotModified was returned.
  46099. func (c *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  46100. gensupport.SetOptions(c.urlParams_, opts...)
  46101. res, err := c.doRequest("json")
  46102. if res != nil && res.StatusCode == http.StatusNotModified {
  46103. if res.Body != nil {
  46104. res.Body.Close()
  46105. }
  46106. return nil, &googleapi.Error{
  46107. Code: res.StatusCode,
  46108. Header: res.Header,
  46109. }
  46110. }
  46111. if err != nil {
  46112. return nil, err
  46113. }
  46114. defer googleapi.CloseBody(res)
  46115. if err := googleapi.CheckResponse(res); err != nil {
  46116. return nil, err
  46117. }
  46118. ret := &TestPermissionsResponse{
  46119. ServerResponse: googleapi.ServerResponse{
  46120. Header: res.Header,
  46121. HTTPStatusCode: res.StatusCode,
  46122. },
  46123. }
  46124. target := &ret
  46125. if err := gensupport.DecodeResponse(target, res); err != nil {
  46126. return nil, err
  46127. }
  46128. return ret, nil
  46129. // {
  46130. // "description": "Returns permissions that a caller has on the specified resource.",
  46131. // "httpMethod": "POST",
  46132. // "id": "compute.backendServices.testIamPermissions",
  46133. // "parameterOrder": [
  46134. // "project",
  46135. // "resource"
  46136. // ],
  46137. // "parameters": {
  46138. // "project": {
  46139. // "description": "Project ID for this request.",
  46140. // "location": "path",
  46141. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46142. // "required": true,
  46143. // "type": "string"
  46144. // },
  46145. // "resource": {
  46146. // "description": "Name or id of the resource for this request.",
  46147. // "location": "path",
  46148. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46149. // "required": true,
  46150. // "type": "string"
  46151. // }
  46152. // },
  46153. // "path": "{project}/global/backendServices/{resource}/testIamPermissions",
  46154. // "request": {
  46155. // "$ref": "TestPermissionsRequest"
  46156. // },
  46157. // "response": {
  46158. // "$ref": "TestPermissionsResponse"
  46159. // },
  46160. // "scopes": [
  46161. // "https://www.googleapis.com/auth/cloud-platform",
  46162. // "https://www.googleapis.com/auth/compute",
  46163. // "https://www.googleapis.com/auth/compute.readonly"
  46164. // ]
  46165. // }
  46166. }
  46167. // method id "compute.backendServices.update":
  46168. type BackendServicesUpdateCall struct {
  46169. s *Service
  46170. project string
  46171. backendService string
  46172. backendservice *BackendService
  46173. urlParams_ gensupport.URLParams
  46174. ctx_ context.Context
  46175. header_ http.Header
  46176. }
  46177. // Update: Updates the specified BackendService resource with the data
  46178. // included in the request. There are several restrictions and
  46179. // guidelines to keep in mind when updating a backend service. Read
  46180. // Restrictions and Guidelines for more information.
  46181. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  46182. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  46183. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46184. c.project = project
  46185. c.backendService = backendService
  46186. c.backendservice = backendservice
  46187. return c
  46188. }
  46189. // RequestId sets the optional parameter "requestId": An optional
  46190. // request ID to identify requests. Specify a unique request ID so that
  46191. // if you must retry your request, the server will know to ignore the
  46192. // request if it has already been completed.
  46193. //
  46194. // For example, consider a situation where you make an initial request
  46195. // and the request times out. If you make the request again with the
  46196. // same request ID, the server can check if original operation with the
  46197. // same request ID was received, and if so, will ignore the second
  46198. // request. This prevents clients from accidentally creating duplicate
  46199. // commitments.
  46200. //
  46201. // The request ID must be a valid UUID with the exception that zero UUID
  46202. // is not supported (00000000-0000-0000-0000-000000000000).
  46203. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  46204. c.urlParams_.Set("requestId", requestId)
  46205. return c
  46206. }
  46207. // Fields allows partial responses to be retrieved. See
  46208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46209. // for more information.
  46210. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  46211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46212. return c
  46213. }
  46214. // Context sets the context to be used in this call's Do method. Any
  46215. // pending HTTP request will be aborted if the provided context is
  46216. // canceled.
  46217. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  46218. c.ctx_ = ctx
  46219. return c
  46220. }
  46221. // Header returns an http.Header that can be modified by the caller to
  46222. // add HTTP headers to the request.
  46223. func (c *BackendServicesUpdateCall) Header() http.Header {
  46224. if c.header_ == nil {
  46225. c.header_ = make(http.Header)
  46226. }
  46227. return c.header_
  46228. }
  46229. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  46230. reqHeaders := make(http.Header)
  46231. for k, v := range c.header_ {
  46232. reqHeaders[k] = v
  46233. }
  46234. reqHeaders.Set("User-Agent", c.s.userAgent())
  46235. var body io.Reader = nil
  46236. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  46237. if err != nil {
  46238. return nil, err
  46239. }
  46240. reqHeaders.Set("Content-Type", "application/json")
  46241. c.urlParams_.Set("alt", alt)
  46242. c.urlParams_.Set("prettyPrint", "false")
  46243. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  46244. urls += "?" + c.urlParams_.Encode()
  46245. req, err := http.NewRequest("PUT", urls, body)
  46246. if err != nil {
  46247. return nil, err
  46248. }
  46249. req.Header = reqHeaders
  46250. googleapi.Expand(req.URL, map[string]string{
  46251. "project": c.project,
  46252. "backendService": c.backendService,
  46253. })
  46254. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46255. }
  46256. // Do executes the "compute.backendServices.update" call.
  46257. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46258. // status code is an error. Response headers are in either
  46259. // *Operation.ServerResponse.Header or (if a response was returned at
  46260. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46261. // to check whether the returned error was because
  46262. // http.StatusNotModified was returned.
  46263. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46264. gensupport.SetOptions(c.urlParams_, opts...)
  46265. res, err := c.doRequest("json")
  46266. if res != nil && res.StatusCode == http.StatusNotModified {
  46267. if res.Body != nil {
  46268. res.Body.Close()
  46269. }
  46270. return nil, &googleapi.Error{
  46271. Code: res.StatusCode,
  46272. Header: res.Header,
  46273. }
  46274. }
  46275. if err != nil {
  46276. return nil, err
  46277. }
  46278. defer googleapi.CloseBody(res)
  46279. if err := googleapi.CheckResponse(res); err != nil {
  46280. return nil, err
  46281. }
  46282. ret := &Operation{
  46283. ServerResponse: googleapi.ServerResponse{
  46284. Header: res.Header,
  46285. HTTPStatusCode: res.StatusCode,
  46286. },
  46287. }
  46288. target := &ret
  46289. if err := gensupport.DecodeResponse(target, res); err != nil {
  46290. return nil, err
  46291. }
  46292. return ret, nil
  46293. // {
  46294. // "description": "Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  46295. // "httpMethod": "PUT",
  46296. // "id": "compute.backendServices.update",
  46297. // "parameterOrder": [
  46298. // "project",
  46299. // "backendService"
  46300. // ],
  46301. // "parameters": {
  46302. // "backendService": {
  46303. // "description": "Name of the BackendService resource to update.",
  46304. // "location": "path",
  46305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46306. // "required": true,
  46307. // "type": "string"
  46308. // },
  46309. // "project": {
  46310. // "description": "Project ID for this request.",
  46311. // "location": "path",
  46312. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46313. // "required": true,
  46314. // "type": "string"
  46315. // },
  46316. // "requestId": {
  46317. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46318. // "location": "query",
  46319. // "type": "string"
  46320. // }
  46321. // },
  46322. // "path": "{project}/global/backendServices/{backendService}",
  46323. // "request": {
  46324. // "$ref": "BackendService"
  46325. // },
  46326. // "response": {
  46327. // "$ref": "Operation"
  46328. // },
  46329. // "scopes": [
  46330. // "https://www.googleapis.com/auth/cloud-platform",
  46331. // "https://www.googleapis.com/auth/compute"
  46332. // ]
  46333. // }
  46334. }
  46335. // method id "compute.diskTypes.aggregatedList":
  46336. type DiskTypesAggregatedListCall struct {
  46337. s *Service
  46338. project string
  46339. urlParams_ gensupport.URLParams
  46340. ifNoneMatch_ string
  46341. ctx_ context.Context
  46342. header_ http.Header
  46343. }
  46344. // AggregatedList: Retrieves an aggregated list of disk types.
  46345. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  46346. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  46347. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46348. c.project = project
  46349. return c
  46350. }
  46351. // Filter sets the optional parameter "filter": A filter expression that
  46352. // filters resources listed in the response. The expression must specify
  46353. // the field name, a comparison operator, and the value that you want to
  46354. // use for filtering. The value must be a string, a number, or a
  46355. // boolean. The comparison operator must be either =, !=, >, or <.
  46356. //
  46357. // For example, if you are filtering Compute Engine instances, you can
  46358. // exclude instances named example-instance by specifying name !=
  46359. // example-instance.
  46360. //
  46361. // You can also filter nested fields. For example, you could specify
  46362. // scheduling.automaticRestart = false to include instances only if they
  46363. // are not scheduled for automatic restarts. You can use filtering on
  46364. // nested fields to filter based on resource labels.
  46365. //
  46366. // To filter on multiple expressions, provide each separate expression
  46367. // within parentheses. For example, (scheduling.automaticRestart = true)
  46368. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46369. // AND expression. However, you can include AND and OR expressions
  46370. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46371. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46372. // true).
  46373. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  46374. c.urlParams_.Set("filter", filter)
  46375. return c
  46376. }
  46377. // MaxResults sets the optional parameter "maxResults": The maximum
  46378. // number of results per page that should be returned. If the number of
  46379. // available results is larger than maxResults, Compute Engine returns a
  46380. // nextPageToken that can be used to get the next page of results in
  46381. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46382. // (Default: 500)
  46383. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  46384. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46385. return c
  46386. }
  46387. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46388. // a certain order. By default, results are returned in alphanumerical
  46389. // order based on the resource name.
  46390. //
  46391. // You can also sort results in descending order based on the creation
  46392. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46393. // based on the creationTimestamp field in reverse chronological order
  46394. // (newest result first). Use this to sort resources like operations so
  46395. // that the newest operation is returned first.
  46396. //
  46397. // Currently, only sorting by name or creationTimestamp desc is
  46398. // supported.
  46399. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  46400. c.urlParams_.Set("orderBy", orderBy)
  46401. return c
  46402. }
  46403. // PageToken sets the optional parameter "pageToken": Specifies a page
  46404. // token to use. Set pageToken to the nextPageToken returned by a
  46405. // previous list request to get the next page of results.
  46406. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  46407. c.urlParams_.Set("pageToken", pageToken)
  46408. return c
  46409. }
  46410. // Fields allows partial responses to be retrieved. See
  46411. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46412. // for more information.
  46413. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  46414. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46415. return c
  46416. }
  46417. // IfNoneMatch sets the optional parameter which makes the operation
  46418. // fail if the object's ETag matches the given value. This is useful for
  46419. // getting updates only after the object has changed since the last
  46420. // request. Use googleapi.IsNotModified to check whether the response
  46421. // error from Do is the result of In-None-Match.
  46422. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  46423. c.ifNoneMatch_ = entityTag
  46424. return c
  46425. }
  46426. // Context sets the context to be used in this call's Do method. Any
  46427. // pending HTTP request will be aborted if the provided context is
  46428. // canceled.
  46429. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  46430. c.ctx_ = ctx
  46431. return c
  46432. }
  46433. // Header returns an http.Header that can be modified by the caller to
  46434. // add HTTP headers to the request.
  46435. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  46436. if c.header_ == nil {
  46437. c.header_ = make(http.Header)
  46438. }
  46439. return c.header_
  46440. }
  46441. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  46442. reqHeaders := make(http.Header)
  46443. for k, v := range c.header_ {
  46444. reqHeaders[k] = v
  46445. }
  46446. reqHeaders.Set("User-Agent", c.s.userAgent())
  46447. if c.ifNoneMatch_ != "" {
  46448. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46449. }
  46450. var body io.Reader = nil
  46451. c.urlParams_.Set("alt", alt)
  46452. c.urlParams_.Set("prettyPrint", "false")
  46453. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  46454. urls += "?" + c.urlParams_.Encode()
  46455. req, err := http.NewRequest("GET", urls, body)
  46456. if err != nil {
  46457. return nil, err
  46458. }
  46459. req.Header = reqHeaders
  46460. googleapi.Expand(req.URL, map[string]string{
  46461. "project": c.project,
  46462. })
  46463. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46464. }
  46465. // Do executes the "compute.diskTypes.aggregatedList" call.
  46466. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  46467. // non-2xx status code is an error. Response headers are in either
  46468. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  46469. // returned at all) in error.(*googleapi.Error).Header. Use
  46470. // googleapi.IsNotModified to check whether the returned error was
  46471. // because http.StatusNotModified was returned.
  46472. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  46473. gensupport.SetOptions(c.urlParams_, opts...)
  46474. res, err := c.doRequest("json")
  46475. if res != nil && res.StatusCode == http.StatusNotModified {
  46476. if res.Body != nil {
  46477. res.Body.Close()
  46478. }
  46479. return nil, &googleapi.Error{
  46480. Code: res.StatusCode,
  46481. Header: res.Header,
  46482. }
  46483. }
  46484. if err != nil {
  46485. return nil, err
  46486. }
  46487. defer googleapi.CloseBody(res)
  46488. if err := googleapi.CheckResponse(res); err != nil {
  46489. return nil, err
  46490. }
  46491. ret := &DiskTypeAggregatedList{
  46492. ServerResponse: googleapi.ServerResponse{
  46493. Header: res.Header,
  46494. HTTPStatusCode: res.StatusCode,
  46495. },
  46496. }
  46497. target := &ret
  46498. if err := gensupport.DecodeResponse(target, res); err != nil {
  46499. return nil, err
  46500. }
  46501. return ret, nil
  46502. // {
  46503. // "description": "Retrieves an aggregated list of disk types.",
  46504. // "httpMethod": "GET",
  46505. // "id": "compute.diskTypes.aggregatedList",
  46506. // "parameterOrder": [
  46507. // "project"
  46508. // ],
  46509. // "parameters": {
  46510. // "filter": {
  46511. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46512. // "location": "query",
  46513. // "type": "string"
  46514. // },
  46515. // "maxResults": {
  46516. // "default": "500",
  46517. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46518. // "format": "uint32",
  46519. // "location": "query",
  46520. // "minimum": "0",
  46521. // "type": "integer"
  46522. // },
  46523. // "orderBy": {
  46524. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46525. // "location": "query",
  46526. // "type": "string"
  46527. // },
  46528. // "pageToken": {
  46529. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46530. // "location": "query",
  46531. // "type": "string"
  46532. // },
  46533. // "project": {
  46534. // "description": "Project ID for this request.",
  46535. // "location": "path",
  46536. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46537. // "required": true,
  46538. // "type": "string"
  46539. // }
  46540. // },
  46541. // "path": "{project}/aggregated/diskTypes",
  46542. // "response": {
  46543. // "$ref": "DiskTypeAggregatedList"
  46544. // },
  46545. // "scopes": [
  46546. // "https://www.googleapis.com/auth/cloud-platform",
  46547. // "https://www.googleapis.com/auth/compute",
  46548. // "https://www.googleapis.com/auth/compute.readonly"
  46549. // ]
  46550. // }
  46551. }
  46552. // Pages invokes f for each page of results.
  46553. // A non-nil error returned from f will halt the iteration.
  46554. // The provided context supersedes any context provided to the Context method.
  46555. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  46556. c.ctx_ = ctx
  46557. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46558. for {
  46559. x, err := c.Do()
  46560. if err != nil {
  46561. return err
  46562. }
  46563. if err := f(x); err != nil {
  46564. return err
  46565. }
  46566. if x.NextPageToken == "" {
  46567. return nil
  46568. }
  46569. c.PageToken(x.NextPageToken)
  46570. }
  46571. }
  46572. // method id "compute.diskTypes.get":
  46573. type DiskTypesGetCall struct {
  46574. s *Service
  46575. project string
  46576. zone string
  46577. diskType string
  46578. urlParams_ gensupport.URLParams
  46579. ifNoneMatch_ string
  46580. ctx_ context.Context
  46581. header_ http.Header
  46582. }
  46583. // Get: Returns the specified disk type. Gets a list of available disk
  46584. // types by making a list() request.
  46585. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  46586. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  46587. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46588. c.project = project
  46589. c.zone = zone
  46590. c.diskType = diskType
  46591. return c
  46592. }
  46593. // Fields allows partial responses to be retrieved. See
  46594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46595. // for more information.
  46596. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  46597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46598. return c
  46599. }
  46600. // IfNoneMatch sets the optional parameter which makes the operation
  46601. // fail if the object's ETag matches the given value. This is useful for
  46602. // getting updates only after the object has changed since the last
  46603. // request. Use googleapi.IsNotModified to check whether the response
  46604. // error from Do is the result of In-None-Match.
  46605. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  46606. c.ifNoneMatch_ = entityTag
  46607. return c
  46608. }
  46609. // Context sets the context to be used in this call's Do method. Any
  46610. // pending HTTP request will be aborted if the provided context is
  46611. // canceled.
  46612. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  46613. c.ctx_ = ctx
  46614. return c
  46615. }
  46616. // Header returns an http.Header that can be modified by the caller to
  46617. // add HTTP headers to the request.
  46618. func (c *DiskTypesGetCall) Header() http.Header {
  46619. if c.header_ == nil {
  46620. c.header_ = make(http.Header)
  46621. }
  46622. return c.header_
  46623. }
  46624. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  46625. reqHeaders := make(http.Header)
  46626. for k, v := range c.header_ {
  46627. reqHeaders[k] = v
  46628. }
  46629. reqHeaders.Set("User-Agent", c.s.userAgent())
  46630. if c.ifNoneMatch_ != "" {
  46631. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46632. }
  46633. var body io.Reader = nil
  46634. c.urlParams_.Set("alt", alt)
  46635. c.urlParams_.Set("prettyPrint", "false")
  46636. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  46637. urls += "?" + c.urlParams_.Encode()
  46638. req, err := http.NewRequest("GET", urls, body)
  46639. if err != nil {
  46640. return nil, err
  46641. }
  46642. req.Header = reqHeaders
  46643. googleapi.Expand(req.URL, map[string]string{
  46644. "project": c.project,
  46645. "zone": c.zone,
  46646. "diskType": c.diskType,
  46647. })
  46648. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46649. }
  46650. // Do executes the "compute.diskTypes.get" call.
  46651. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  46652. // code is an error. Response headers are in either
  46653. // *DiskType.ServerResponse.Header or (if a response was returned at
  46654. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46655. // to check whether the returned error was because
  46656. // http.StatusNotModified was returned.
  46657. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  46658. gensupport.SetOptions(c.urlParams_, opts...)
  46659. res, err := c.doRequest("json")
  46660. if res != nil && res.StatusCode == http.StatusNotModified {
  46661. if res.Body != nil {
  46662. res.Body.Close()
  46663. }
  46664. return nil, &googleapi.Error{
  46665. Code: res.StatusCode,
  46666. Header: res.Header,
  46667. }
  46668. }
  46669. if err != nil {
  46670. return nil, err
  46671. }
  46672. defer googleapi.CloseBody(res)
  46673. if err := googleapi.CheckResponse(res); err != nil {
  46674. return nil, err
  46675. }
  46676. ret := &DiskType{
  46677. ServerResponse: googleapi.ServerResponse{
  46678. Header: res.Header,
  46679. HTTPStatusCode: res.StatusCode,
  46680. },
  46681. }
  46682. target := &ret
  46683. if err := gensupport.DecodeResponse(target, res); err != nil {
  46684. return nil, err
  46685. }
  46686. return ret, nil
  46687. // {
  46688. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  46689. // "httpMethod": "GET",
  46690. // "id": "compute.diskTypes.get",
  46691. // "parameterOrder": [
  46692. // "project",
  46693. // "zone",
  46694. // "diskType"
  46695. // ],
  46696. // "parameters": {
  46697. // "diskType": {
  46698. // "description": "Name of the disk type to return.",
  46699. // "location": "path",
  46700. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  46701. // "required": true,
  46702. // "type": "string"
  46703. // },
  46704. // "project": {
  46705. // "description": "Project ID for this request.",
  46706. // "location": "path",
  46707. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46708. // "required": true,
  46709. // "type": "string"
  46710. // },
  46711. // "zone": {
  46712. // "description": "The name of the zone for this request.",
  46713. // "location": "path",
  46714. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46715. // "required": true,
  46716. // "type": "string"
  46717. // }
  46718. // },
  46719. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  46720. // "response": {
  46721. // "$ref": "DiskType"
  46722. // },
  46723. // "scopes": [
  46724. // "https://www.googleapis.com/auth/cloud-platform",
  46725. // "https://www.googleapis.com/auth/compute",
  46726. // "https://www.googleapis.com/auth/compute.readonly"
  46727. // ]
  46728. // }
  46729. }
  46730. // method id "compute.diskTypes.list":
  46731. type DiskTypesListCall struct {
  46732. s *Service
  46733. project string
  46734. zone string
  46735. urlParams_ gensupport.URLParams
  46736. ifNoneMatch_ string
  46737. ctx_ context.Context
  46738. header_ http.Header
  46739. }
  46740. // List: Retrieves a list of disk types available to the specified
  46741. // project.
  46742. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  46743. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  46744. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46745. c.project = project
  46746. c.zone = zone
  46747. return c
  46748. }
  46749. // Filter sets the optional parameter "filter": A filter expression that
  46750. // filters resources listed in the response. The expression must specify
  46751. // the field name, a comparison operator, and the value that you want to
  46752. // use for filtering. The value must be a string, a number, or a
  46753. // boolean. The comparison operator must be either =, !=, >, or <.
  46754. //
  46755. // For example, if you are filtering Compute Engine instances, you can
  46756. // exclude instances named example-instance by specifying name !=
  46757. // example-instance.
  46758. //
  46759. // You can also filter nested fields. For example, you could specify
  46760. // scheduling.automaticRestart = false to include instances only if they
  46761. // are not scheduled for automatic restarts. You can use filtering on
  46762. // nested fields to filter based on resource labels.
  46763. //
  46764. // To filter on multiple expressions, provide each separate expression
  46765. // within parentheses. For example, (scheduling.automaticRestart = true)
  46766. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46767. // AND expression. However, you can include AND and OR expressions
  46768. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46769. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46770. // true).
  46771. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  46772. c.urlParams_.Set("filter", filter)
  46773. return c
  46774. }
  46775. // MaxResults sets the optional parameter "maxResults": The maximum
  46776. // number of results per page that should be returned. If the number of
  46777. // available results is larger than maxResults, Compute Engine returns a
  46778. // nextPageToken that can be used to get the next page of results in
  46779. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46780. // (Default: 500)
  46781. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  46782. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46783. return c
  46784. }
  46785. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46786. // a certain order. By default, results are returned in alphanumerical
  46787. // order based on the resource name.
  46788. //
  46789. // You can also sort results in descending order based on the creation
  46790. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46791. // based on the creationTimestamp field in reverse chronological order
  46792. // (newest result first). Use this to sort resources like operations so
  46793. // that the newest operation is returned first.
  46794. //
  46795. // Currently, only sorting by name or creationTimestamp desc is
  46796. // supported.
  46797. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  46798. c.urlParams_.Set("orderBy", orderBy)
  46799. return c
  46800. }
  46801. // PageToken sets the optional parameter "pageToken": Specifies a page
  46802. // token to use. Set pageToken to the nextPageToken returned by a
  46803. // previous list request to get the next page of results.
  46804. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  46805. c.urlParams_.Set("pageToken", pageToken)
  46806. return c
  46807. }
  46808. // Fields allows partial responses to be retrieved. See
  46809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46810. // for more information.
  46811. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  46812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46813. return c
  46814. }
  46815. // IfNoneMatch sets the optional parameter which makes the operation
  46816. // fail if the object's ETag matches the given value. This is useful for
  46817. // getting updates only after the object has changed since the last
  46818. // request. Use googleapi.IsNotModified to check whether the response
  46819. // error from Do is the result of In-None-Match.
  46820. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  46821. c.ifNoneMatch_ = entityTag
  46822. return c
  46823. }
  46824. // Context sets the context to be used in this call's Do method. Any
  46825. // pending HTTP request will be aborted if the provided context is
  46826. // canceled.
  46827. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  46828. c.ctx_ = ctx
  46829. return c
  46830. }
  46831. // Header returns an http.Header that can be modified by the caller to
  46832. // add HTTP headers to the request.
  46833. func (c *DiskTypesListCall) Header() http.Header {
  46834. if c.header_ == nil {
  46835. c.header_ = make(http.Header)
  46836. }
  46837. return c.header_
  46838. }
  46839. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  46840. reqHeaders := make(http.Header)
  46841. for k, v := range c.header_ {
  46842. reqHeaders[k] = v
  46843. }
  46844. reqHeaders.Set("User-Agent", c.s.userAgent())
  46845. if c.ifNoneMatch_ != "" {
  46846. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46847. }
  46848. var body io.Reader = nil
  46849. c.urlParams_.Set("alt", alt)
  46850. c.urlParams_.Set("prettyPrint", "false")
  46851. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  46852. urls += "?" + c.urlParams_.Encode()
  46853. req, err := http.NewRequest("GET", urls, body)
  46854. if err != nil {
  46855. return nil, err
  46856. }
  46857. req.Header = reqHeaders
  46858. googleapi.Expand(req.URL, map[string]string{
  46859. "project": c.project,
  46860. "zone": c.zone,
  46861. })
  46862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46863. }
  46864. // Do executes the "compute.diskTypes.list" call.
  46865. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  46866. // status code is an error. Response headers are in either
  46867. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  46868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46869. // to check whether the returned error was because
  46870. // http.StatusNotModified was returned.
  46871. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  46872. gensupport.SetOptions(c.urlParams_, opts...)
  46873. res, err := c.doRequest("json")
  46874. if res != nil && res.StatusCode == http.StatusNotModified {
  46875. if res.Body != nil {
  46876. res.Body.Close()
  46877. }
  46878. return nil, &googleapi.Error{
  46879. Code: res.StatusCode,
  46880. Header: res.Header,
  46881. }
  46882. }
  46883. if err != nil {
  46884. return nil, err
  46885. }
  46886. defer googleapi.CloseBody(res)
  46887. if err := googleapi.CheckResponse(res); err != nil {
  46888. return nil, err
  46889. }
  46890. ret := &DiskTypeList{
  46891. ServerResponse: googleapi.ServerResponse{
  46892. Header: res.Header,
  46893. HTTPStatusCode: res.StatusCode,
  46894. },
  46895. }
  46896. target := &ret
  46897. if err := gensupport.DecodeResponse(target, res); err != nil {
  46898. return nil, err
  46899. }
  46900. return ret, nil
  46901. // {
  46902. // "description": "Retrieves a list of disk types available to the specified project.",
  46903. // "httpMethod": "GET",
  46904. // "id": "compute.diskTypes.list",
  46905. // "parameterOrder": [
  46906. // "project",
  46907. // "zone"
  46908. // ],
  46909. // "parameters": {
  46910. // "filter": {
  46911. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46912. // "location": "query",
  46913. // "type": "string"
  46914. // },
  46915. // "maxResults": {
  46916. // "default": "500",
  46917. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46918. // "format": "uint32",
  46919. // "location": "query",
  46920. // "minimum": "0",
  46921. // "type": "integer"
  46922. // },
  46923. // "orderBy": {
  46924. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46925. // "location": "query",
  46926. // "type": "string"
  46927. // },
  46928. // "pageToken": {
  46929. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46930. // "location": "query",
  46931. // "type": "string"
  46932. // },
  46933. // "project": {
  46934. // "description": "Project ID for this request.",
  46935. // "location": "path",
  46936. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46937. // "required": true,
  46938. // "type": "string"
  46939. // },
  46940. // "zone": {
  46941. // "description": "The name of the zone for this request.",
  46942. // "location": "path",
  46943. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  46944. // "required": true,
  46945. // "type": "string"
  46946. // }
  46947. // },
  46948. // "path": "{project}/zones/{zone}/diskTypes",
  46949. // "response": {
  46950. // "$ref": "DiskTypeList"
  46951. // },
  46952. // "scopes": [
  46953. // "https://www.googleapis.com/auth/cloud-platform",
  46954. // "https://www.googleapis.com/auth/compute",
  46955. // "https://www.googleapis.com/auth/compute.readonly"
  46956. // ]
  46957. // }
  46958. }
  46959. // Pages invokes f for each page of results.
  46960. // A non-nil error returned from f will halt the iteration.
  46961. // The provided context supersedes any context provided to the Context method.
  46962. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  46963. c.ctx_ = ctx
  46964. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46965. for {
  46966. x, err := c.Do()
  46967. if err != nil {
  46968. return err
  46969. }
  46970. if err := f(x); err != nil {
  46971. return err
  46972. }
  46973. if x.NextPageToken == "" {
  46974. return nil
  46975. }
  46976. c.PageToken(x.NextPageToken)
  46977. }
  46978. }
  46979. // method id "compute.disks.addResourcePolicies":
  46980. type DisksAddResourcePoliciesCall struct {
  46981. s *Service
  46982. project string
  46983. zone string
  46984. disk string
  46985. disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest
  46986. urlParams_ gensupport.URLParams
  46987. ctx_ context.Context
  46988. header_ http.Header
  46989. }
  46990. // AddResourcePolicies: Adds existing resource policies to a disk. You
  46991. // can only add one policy which will be applied to this disk for
  46992. // scheduling snapshot creation.
  46993. func (r *DisksService) AddResourcePolicies(project string, zone string, disk string, disksaddresourcepoliciesrequest *DisksAddResourcePoliciesRequest) *DisksAddResourcePoliciesCall {
  46994. c := &DisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46995. c.project = project
  46996. c.zone = zone
  46997. c.disk = disk
  46998. c.disksaddresourcepoliciesrequest = disksaddresourcepoliciesrequest
  46999. return c
  47000. }
  47001. // RequestId sets the optional parameter "requestId": An optional
  47002. // request ID to identify requests. Specify a unique request ID so that
  47003. // if you must retry your request, the server will know to ignore the
  47004. // request if it has already been completed.
  47005. //
  47006. // For example, consider a situation where you make an initial request
  47007. // and the request times out. If you make the request again with the
  47008. // same request ID, the server can check if original operation with the
  47009. // same request ID was received, and if so, will ignore the second
  47010. // request. This prevents clients from accidentally creating duplicate
  47011. // commitments.
  47012. //
  47013. // The request ID must be a valid UUID with the exception that zero UUID
  47014. // is not supported (00000000-0000-0000-0000-000000000000).
  47015. func (c *DisksAddResourcePoliciesCall) RequestId(requestId string) *DisksAddResourcePoliciesCall {
  47016. c.urlParams_.Set("requestId", requestId)
  47017. return c
  47018. }
  47019. // Fields allows partial responses to be retrieved. See
  47020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47021. // for more information.
  47022. func (c *DisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksAddResourcePoliciesCall {
  47023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47024. return c
  47025. }
  47026. // Context sets the context to be used in this call's Do method. Any
  47027. // pending HTTP request will be aborted if the provided context is
  47028. // canceled.
  47029. func (c *DisksAddResourcePoliciesCall) Context(ctx context.Context) *DisksAddResourcePoliciesCall {
  47030. c.ctx_ = ctx
  47031. return c
  47032. }
  47033. // Header returns an http.Header that can be modified by the caller to
  47034. // add HTTP headers to the request.
  47035. func (c *DisksAddResourcePoliciesCall) Header() http.Header {
  47036. if c.header_ == nil {
  47037. c.header_ = make(http.Header)
  47038. }
  47039. return c.header_
  47040. }
  47041. func (c *DisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  47042. reqHeaders := make(http.Header)
  47043. for k, v := range c.header_ {
  47044. reqHeaders[k] = v
  47045. }
  47046. reqHeaders.Set("User-Agent", c.s.userAgent())
  47047. var body io.Reader = nil
  47048. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksaddresourcepoliciesrequest)
  47049. if err != nil {
  47050. return nil, err
  47051. }
  47052. reqHeaders.Set("Content-Type", "application/json")
  47053. c.urlParams_.Set("alt", alt)
  47054. c.urlParams_.Set("prettyPrint", "false")
  47055. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/addResourcePolicies")
  47056. urls += "?" + c.urlParams_.Encode()
  47057. req, err := http.NewRequest("POST", urls, body)
  47058. if err != nil {
  47059. return nil, err
  47060. }
  47061. req.Header = reqHeaders
  47062. googleapi.Expand(req.URL, map[string]string{
  47063. "project": c.project,
  47064. "zone": c.zone,
  47065. "disk": c.disk,
  47066. })
  47067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47068. }
  47069. // Do executes the "compute.disks.addResourcePolicies" call.
  47070. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47071. // status code is an error. Response headers are in either
  47072. // *Operation.ServerResponse.Header or (if a response was returned at
  47073. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47074. // to check whether the returned error was because
  47075. // http.StatusNotModified was returned.
  47076. func (c *DisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47077. gensupport.SetOptions(c.urlParams_, opts...)
  47078. res, err := c.doRequest("json")
  47079. if res != nil && res.StatusCode == http.StatusNotModified {
  47080. if res.Body != nil {
  47081. res.Body.Close()
  47082. }
  47083. return nil, &googleapi.Error{
  47084. Code: res.StatusCode,
  47085. Header: res.Header,
  47086. }
  47087. }
  47088. if err != nil {
  47089. return nil, err
  47090. }
  47091. defer googleapi.CloseBody(res)
  47092. if err := googleapi.CheckResponse(res); err != nil {
  47093. return nil, err
  47094. }
  47095. ret := &Operation{
  47096. ServerResponse: googleapi.ServerResponse{
  47097. Header: res.Header,
  47098. HTTPStatusCode: res.StatusCode,
  47099. },
  47100. }
  47101. target := &ret
  47102. if err := gensupport.DecodeResponse(target, res); err != nil {
  47103. return nil, err
  47104. }
  47105. return ret, nil
  47106. // {
  47107. // "description": "Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.",
  47108. // "httpMethod": "POST",
  47109. // "id": "compute.disks.addResourcePolicies",
  47110. // "parameterOrder": [
  47111. // "project",
  47112. // "zone",
  47113. // "disk"
  47114. // ],
  47115. // "parameters": {
  47116. // "disk": {
  47117. // "description": "The disk name for this request.",
  47118. // "location": "path",
  47119. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47120. // "required": true,
  47121. // "type": "string"
  47122. // },
  47123. // "project": {
  47124. // "description": "Project ID for this request.",
  47125. // "location": "path",
  47126. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47127. // "required": true,
  47128. // "type": "string"
  47129. // },
  47130. // "requestId": {
  47131. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47132. // "location": "query",
  47133. // "type": "string"
  47134. // },
  47135. // "zone": {
  47136. // "description": "The name of the zone for this request.",
  47137. // "location": "path",
  47138. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47139. // "required": true,
  47140. // "type": "string"
  47141. // }
  47142. // },
  47143. // "path": "{project}/zones/{zone}/disks/{disk}/addResourcePolicies",
  47144. // "request": {
  47145. // "$ref": "DisksAddResourcePoliciesRequest"
  47146. // },
  47147. // "response": {
  47148. // "$ref": "Operation"
  47149. // },
  47150. // "scopes": [
  47151. // "https://www.googleapis.com/auth/cloud-platform",
  47152. // "https://www.googleapis.com/auth/compute"
  47153. // ]
  47154. // }
  47155. }
  47156. // method id "compute.disks.aggregatedList":
  47157. type DisksAggregatedListCall struct {
  47158. s *Service
  47159. project string
  47160. urlParams_ gensupport.URLParams
  47161. ifNoneMatch_ string
  47162. ctx_ context.Context
  47163. header_ http.Header
  47164. }
  47165. // AggregatedList: Retrieves an aggregated list of persistent disks.
  47166. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  47167. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  47168. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47169. c.project = project
  47170. return c
  47171. }
  47172. // Filter sets the optional parameter "filter": A filter expression that
  47173. // filters resources listed in the response. The expression must specify
  47174. // the field name, a comparison operator, and the value that you want to
  47175. // use for filtering. The value must be a string, a number, or a
  47176. // boolean. The comparison operator must be either =, !=, >, or <.
  47177. //
  47178. // For example, if you are filtering Compute Engine instances, you can
  47179. // exclude instances named example-instance by specifying name !=
  47180. // example-instance.
  47181. //
  47182. // You can also filter nested fields. For example, you could specify
  47183. // scheduling.automaticRestart = false to include instances only if they
  47184. // are not scheduled for automatic restarts. You can use filtering on
  47185. // nested fields to filter based on resource labels.
  47186. //
  47187. // To filter on multiple expressions, provide each separate expression
  47188. // within parentheses. For example, (scheduling.automaticRestart = true)
  47189. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47190. // AND expression. However, you can include AND and OR expressions
  47191. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47192. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47193. // true).
  47194. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  47195. c.urlParams_.Set("filter", filter)
  47196. return c
  47197. }
  47198. // MaxResults sets the optional parameter "maxResults": The maximum
  47199. // number of results per page that should be returned. If the number of
  47200. // available results is larger than maxResults, Compute Engine returns a
  47201. // nextPageToken that can be used to get the next page of results in
  47202. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47203. // (Default: 500)
  47204. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  47205. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47206. return c
  47207. }
  47208. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47209. // a certain order. By default, results are returned in alphanumerical
  47210. // order based on the resource name.
  47211. //
  47212. // You can also sort results in descending order based on the creation
  47213. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47214. // based on the creationTimestamp field in reverse chronological order
  47215. // (newest result first). Use this to sort resources like operations so
  47216. // that the newest operation is returned first.
  47217. //
  47218. // Currently, only sorting by name or creationTimestamp desc is
  47219. // supported.
  47220. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  47221. c.urlParams_.Set("orderBy", orderBy)
  47222. return c
  47223. }
  47224. // PageToken sets the optional parameter "pageToken": Specifies a page
  47225. // token to use. Set pageToken to the nextPageToken returned by a
  47226. // previous list request to get the next page of results.
  47227. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  47228. c.urlParams_.Set("pageToken", pageToken)
  47229. return c
  47230. }
  47231. // Fields allows partial responses to be retrieved. See
  47232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47233. // for more information.
  47234. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  47235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47236. return c
  47237. }
  47238. // IfNoneMatch sets the optional parameter which makes the operation
  47239. // fail if the object's ETag matches the given value. This is useful for
  47240. // getting updates only after the object has changed since the last
  47241. // request. Use googleapi.IsNotModified to check whether the response
  47242. // error from Do is the result of In-None-Match.
  47243. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  47244. c.ifNoneMatch_ = entityTag
  47245. return c
  47246. }
  47247. // Context sets the context to be used in this call's Do method. Any
  47248. // pending HTTP request will be aborted if the provided context is
  47249. // canceled.
  47250. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  47251. c.ctx_ = ctx
  47252. return c
  47253. }
  47254. // Header returns an http.Header that can be modified by the caller to
  47255. // add HTTP headers to the request.
  47256. func (c *DisksAggregatedListCall) Header() http.Header {
  47257. if c.header_ == nil {
  47258. c.header_ = make(http.Header)
  47259. }
  47260. return c.header_
  47261. }
  47262. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  47263. reqHeaders := make(http.Header)
  47264. for k, v := range c.header_ {
  47265. reqHeaders[k] = v
  47266. }
  47267. reqHeaders.Set("User-Agent", c.s.userAgent())
  47268. if c.ifNoneMatch_ != "" {
  47269. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47270. }
  47271. var body io.Reader = nil
  47272. c.urlParams_.Set("alt", alt)
  47273. c.urlParams_.Set("prettyPrint", "false")
  47274. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  47275. urls += "?" + c.urlParams_.Encode()
  47276. req, err := http.NewRequest("GET", urls, body)
  47277. if err != nil {
  47278. return nil, err
  47279. }
  47280. req.Header = reqHeaders
  47281. googleapi.Expand(req.URL, map[string]string{
  47282. "project": c.project,
  47283. })
  47284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47285. }
  47286. // Do executes the "compute.disks.aggregatedList" call.
  47287. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  47288. // non-2xx status code is an error. Response headers are in either
  47289. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  47290. // returned at all) in error.(*googleapi.Error).Header. Use
  47291. // googleapi.IsNotModified to check whether the returned error was
  47292. // because http.StatusNotModified was returned.
  47293. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  47294. gensupport.SetOptions(c.urlParams_, opts...)
  47295. res, err := c.doRequest("json")
  47296. if res != nil && res.StatusCode == http.StatusNotModified {
  47297. if res.Body != nil {
  47298. res.Body.Close()
  47299. }
  47300. return nil, &googleapi.Error{
  47301. Code: res.StatusCode,
  47302. Header: res.Header,
  47303. }
  47304. }
  47305. if err != nil {
  47306. return nil, err
  47307. }
  47308. defer googleapi.CloseBody(res)
  47309. if err := googleapi.CheckResponse(res); err != nil {
  47310. return nil, err
  47311. }
  47312. ret := &DiskAggregatedList{
  47313. ServerResponse: googleapi.ServerResponse{
  47314. Header: res.Header,
  47315. HTTPStatusCode: res.StatusCode,
  47316. },
  47317. }
  47318. target := &ret
  47319. if err := gensupport.DecodeResponse(target, res); err != nil {
  47320. return nil, err
  47321. }
  47322. return ret, nil
  47323. // {
  47324. // "description": "Retrieves an aggregated list of persistent disks.",
  47325. // "httpMethod": "GET",
  47326. // "id": "compute.disks.aggregatedList",
  47327. // "parameterOrder": [
  47328. // "project"
  47329. // ],
  47330. // "parameters": {
  47331. // "filter": {
  47332. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  47333. // "location": "query",
  47334. // "type": "string"
  47335. // },
  47336. // "maxResults": {
  47337. // "default": "500",
  47338. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  47339. // "format": "uint32",
  47340. // "location": "query",
  47341. // "minimum": "0",
  47342. // "type": "integer"
  47343. // },
  47344. // "orderBy": {
  47345. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  47346. // "location": "query",
  47347. // "type": "string"
  47348. // },
  47349. // "pageToken": {
  47350. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  47351. // "location": "query",
  47352. // "type": "string"
  47353. // },
  47354. // "project": {
  47355. // "description": "Project ID for this request.",
  47356. // "location": "path",
  47357. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47358. // "required": true,
  47359. // "type": "string"
  47360. // }
  47361. // },
  47362. // "path": "{project}/aggregated/disks",
  47363. // "response": {
  47364. // "$ref": "DiskAggregatedList"
  47365. // },
  47366. // "scopes": [
  47367. // "https://www.googleapis.com/auth/cloud-platform",
  47368. // "https://www.googleapis.com/auth/compute",
  47369. // "https://www.googleapis.com/auth/compute.readonly"
  47370. // ]
  47371. // }
  47372. }
  47373. // Pages invokes f for each page of results.
  47374. // A non-nil error returned from f will halt the iteration.
  47375. // The provided context supersedes any context provided to the Context method.
  47376. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  47377. c.ctx_ = ctx
  47378. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47379. for {
  47380. x, err := c.Do()
  47381. if err != nil {
  47382. return err
  47383. }
  47384. if err := f(x); err != nil {
  47385. return err
  47386. }
  47387. if x.NextPageToken == "" {
  47388. return nil
  47389. }
  47390. c.PageToken(x.NextPageToken)
  47391. }
  47392. }
  47393. // method id "compute.disks.createSnapshot":
  47394. type DisksCreateSnapshotCall struct {
  47395. s *Service
  47396. project string
  47397. zone string
  47398. disk string
  47399. snapshot *Snapshot
  47400. urlParams_ gensupport.URLParams
  47401. ctx_ context.Context
  47402. header_ http.Header
  47403. }
  47404. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  47405. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  47406. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  47407. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47408. c.project = project
  47409. c.zone = zone
  47410. c.disk = disk
  47411. c.snapshot = snapshot
  47412. return c
  47413. }
  47414. // GuestFlush sets the optional parameter "guestFlush":
  47415. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  47416. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  47417. return c
  47418. }
  47419. // RequestId sets the optional parameter "requestId": An optional
  47420. // request ID to identify requests. Specify a unique request ID so that
  47421. // if you must retry your request, the server will know to ignore the
  47422. // request if it has already been completed.
  47423. //
  47424. // For example, consider a situation where you make an initial request
  47425. // and the request times out. If you make the request again with the
  47426. // same request ID, the server can check if original operation with the
  47427. // same request ID was received, and if so, will ignore the second
  47428. // request. This prevents clients from accidentally creating duplicate
  47429. // commitments.
  47430. //
  47431. // The request ID must be a valid UUID with the exception that zero UUID
  47432. // is not supported (00000000-0000-0000-0000-000000000000).
  47433. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  47434. c.urlParams_.Set("requestId", requestId)
  47435. return c
  47436. }
  47437. // Fields allows partial responses to be retrieved. See
  47438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47439. // for more information.
  47440. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  47441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47442. return c
  47443. }
  47444. // Context sets the context to be used in this call's Do method. Any
  47445. // pending HTTP request will be aborted if the provided context is
  47446. // canceled.
  47447. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  47448. c.ctx_ = ctx
  47449. return c
  47450. }
  47451. // Header returns an http.Header that can be modified by the caller to
  47452. // add HTTP headers to the request.
  47453. func (c *DisksCreateSnapshotCall) Header() http.Header {
  47454. if c.header_ == nil {
  47455. c.header_ = make(http.Header)
  47456. }
  47457. return c.header_
  47458. }
  47459. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  47460. reqHeaders := make(http.Header)
  47461. for k, v := range c.header_ {
  47462. reqHeaders[k] = v
  47463. }
  47464. reqHeaders.Set("User-Agent", c.s.userAgent())
  47465. var body io.Reader = nil
  47466. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  47467. if err != nil {
  47468. return nil, err
  47469. }
  47470. reqHeaders.Set("Content-Type", "application/json")
  47471. c.urlParams_.Set("alt", alt)
  47472. c.urlParams_.Set("prettyPrint", "false")
  47473. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  47474. urls += "?" + c.urlParams_.Encode()
  47475. req, err := http.NewRequest("POST", urls, body)
  47476. if err != nil {
  47477. return nil, err
  47478. }
  47479. req.Header = reqHeaders
  47480. googleapi.Expand(req.URL, map[string]string{
  47481. "project": c.project,
  47482. "zone": c.zone,
  47483. "disk": c.disk,
  47484. })
  47485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47486. }
  47487. // Do executes the "compute.disks.createSnapshot" call.
  47488. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47489. // status code is an error. Response headers are in either
  47490. // *Operation.ServerResponse.Header or (if a response was returned at
  47491. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47492. // to check whether the returned error was because
  47493. // http.StatusNotModified was returned.
  47494. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47495. gensupport.SetOptions(c.urlParams_, opts...)
  47496. res, err := c.doRequest("json")
  47497. if res != nil && res.StatusCode == http.StatusNotModified {
  47498. if res.Body != nil {
  47499. res.Body.Close()
  47500. }
  47501. return nil, &googleapi.Error{
  47502. Code: res.StatusCode,
  47503. Header: res.Header,
  47504. }
  47505. }
  47506. if err != nil {
  47507. return nil, err
  47508. }
  47509. defer googleapi.CloseBody(res)
  47510. if err := googleapi.CheckResponse(res); err != nil {
  47511. return nil, err
  47512. }
  47513. ret := &Operation{
  47514. ServerResponse: googleapi.ServerResponse{
  47515. Header: res.Header,
  47516. HTTPStatusCode: res.StatusCode,
  47517. },
  47518. }
  47519. target := &ret
  47520. if err := gensupport.DecodeResponse(target, res); err != nil {
  47521. return nil, err
  47522. }
  47523. return ret, nil
  47524. // {
  47525. // "description": "Creates a snapshot of a specified persistent disk.",
  47526. // "httpMethod": "POST",
  47527. // "id": "compute.disks.createSnapshot",
  47528. // "parameterOrder": [
  47529. // "project",
  47530. // "zone",
  47531. // "disk"
  47532. // ],
  47533. // "parameters": {
  47534. // "disk": {
  47535. // "description": "Name of the persistent disk to snapshot.",
  47536. // "location": "path",
  47537. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47538. // "required": true,
  47539. // "type": "string"
  47540. // },
  47541. // "guestFlush": {
  47542. // "location": "query",
  47543. // "type": "boolean"
  47544. // },
  47545. // "project": {
  47546. // "description": "Project ID for this request.",
  47547. // "location": "path",
  47548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47549. // "required": true,
  47550. // "type": "string"
  47551. // },
  47552. // "requestId": {
  47553. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47554. // "location": "query",
  47555. // "type": "string"
  47556. // },
  47557. // "zone": {
  47558. // "description": "The name of the zone for this request.",
  47559. // "location": "path",
  47560. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47561. // "required": true,
  47562. // "type": "string"
  47563. // }
  47564. // },
  47565. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  47566. // "request": {
  47567. // "$ref": "Snapshot"
  47568. // },
  47569. // "response": {
  47570. // "$ref": "Operation"
  47571. // },
  47572. // "scopes": [
  47573. // "https://www.googleapis.com/auth/cloud-platform",
  47574. // "https://www.googleapis.com/auth/compute"
  47575. // ]
  47576. // }
  47577. }
  47578. // method id "compute.disks.delete":
  47579. type DisksDeleteCall struct {
  47580. s *Service
  47581. project string
  47582. zone string
  47583. disk string
  47584. urlParams_ gensupport.URLParams
  47585. ctx_ context.Context
  47586. header_ http.Header
  47587. }
  47588. // Delete: Deletes the specified persistent disk. Deleting a disk
  47589. // removes its data permanently and is irreversible. However, deleting a
  47590. // disk does not delete any snapshots previously made from the disk. You
  47591. // must separately delete snapshots.
  47592. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  47593. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  47594. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47595. c.project = project
  47596. c.zone = zone
  47597. c.disk = disk
  47598. return c
  47599. }
  47600. // RequestId sets the optional parameter "requestId": An optional
  47601. // request ID to identify requests. Specify a unique request ID so that
  47602. // if you must retry your request, the server will know to ignore the
  47603. // request if it has already been completed.
  47604. //
  47605. // For example, consider a situation where you make an initial request
  47606. // and the request times out. If you make the request again with the
  47607. // same request ID, the server can check if original operation with the
  47608. // same request ID was received, and if so, will ignore the second
  47609. // request. This prevents clients from accidentally creating duplicate
  47610. // commitments.
  47611. //
  47612. // The request ID must be a valid UUID with the exception that zero UUID
  47613. // is not supported (00000000-0000-0000-0000-000000000000).
  47614. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  47615. c.urlParams_.Set("requestId", requestId)
  47616. return c
  47617. }
  47618. // Fields allows partial responses to be retrieved. See
  47619. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47620. // for more information.
  47621. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  47622. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47623. return c
  47624. }
  47625. // Context sets the context to be used in this call's Do method. Any
  47626. // pending HTTP request will be aborted if the provided context is
  47627. // canceled.
  47628. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  47629. c.ctx_ = ctx
  47630. return c
  47631. }
  47632. // Header returns an http.Header that can be modified by the caller to
  47633. // add HTTP headers to the request.
  47634. func (c *DisksDeleteCall) Header() http.Header {
  47635. if c.header_ == nil {
  47636. c.header_ = make(http.Header)
  47637. }
  47638. return c.header_
  47639. }
  47640. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  47641. reqHeaders := make(http.Header)
  47642. for k, v := range c.header_ {
  47643. reqHeaders[k] = v
  47644. }
  47645. reqHeaders.Set("User-Agent", c.s.userAgent())
  47646. var body io.Reader = nil
  47647. c.urlParams_.Set("alt", alt)
  47648. c.urlParams_.Set("prettyPrint", "false")
  47649. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  47650. urls += "?" + c.urlParams_.Encode()
  47651. req, err := http.NewRequest("DELETE", urls, body)
  47652. if err != nil {
  47653. return nil, err
  47654. }
  47655. req.Header = reqHeaders
  47656. googleapi.Expand(req.URL, map[string]string{
  47657. "project": c.project,
  47658. "zone": c.zone,
  47659. "disk": c.disk,
  47660. })
  47661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47662. }
  47663. // Do executes the "compute.disks.delete" call.
  47664. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47665. // status code is an error. Response headers are in either
  47666. // *Operation.ServerResponse.Header or (if a response was returned at
  47667. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47668. // to check whether the returned error was because
  47669. // http.StatusNotModified was returned.
  47670. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47671. gensupport.SetOptions(c.urlParams_, opts...)
  47672. res, err := c.doRequest("json")
  47673. if res != nil && res.StatusCode == http.StatusNotModified {
  47674. if res.Body != nil {
  47675. res.Body.Close()
  47676. }
  47677. return nil, &googleapi.Error{
  47678. Code: res.StatusCode,
  47679. Header: res.Header,
  47680. }
  47681. }
  47682. if err != nil {
  47683. return nil, err
  47684. }
  47685. defer googleapi.CloseBody(res)
  47686. if err := googleapi.CheckResponse(res); err != nil {
  47687. return nil, err
  47688. }
  47689. ret := &Operation{
  47690. ServerResponse: googleapi.ServerResponse{
  47691. Header: res.Header,
  47692. HTTPStatusCode: res.StatusCode,
  47693. },
  47694. }
  47695. target := &ret
  47696. if err := gensupport.DecodeResponse(target, res); err != nil {
  47697. return nil, err
  47698. }
  47699. return ret, nil
  47700. // {
  47701. // "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.",
  47702. // "httpMethod": "DELETE",
  47703. // "id": "compute.disks.delete",
  47704. // "parameterOrder": [
  47705. // "project",
  47706. // "zone",
  47707. // "disk"
  47708. // ],
  47709. // "parameters": {
  47710. // "disk": {
  47711. // "description": "Name of the persistent disk to delete.",
  47712. // "location": "path",
  47713. // "required": true,
  47714. // "type": "string"
  47715. // },
  47716. // "project": {
  47717. // "description": "Project ID for this request.",
  47718. // "location": "path",
  47719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47720. // "required": true,
  47721. // "type": "string"
  47722. // },
  47723. // "requestId": {
  47724. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47725. // "location": "query",
  47726. // "type": "string"
  47727. // },
  47728. // "zone": {
  47729. // "description": "The name of the zone for this request.",
  47730. // "location": "path",
  47731. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47732. // "required": true,
  47733. // "type": "string"
  47734. // }
  47735. // },
  47736. // "path": "{project}/zones/{zone}/disks/{disk}",
  47737. // "response": {
  47738. // "$ref": "Operation"
  47739. // },
  47740. // "scopes": [
  47741. // "https://www.googleapis.com/auth/cloud-platform",
  47742. // "https://www.googleapis.com/auth/compute"
  47743. // ]
  47744. // }
  47745. }
  47746. // method id "compute.disks.get":
  47747. type DisksGetCall struct {
  47748. s *Service
  47749. project string
  47750. zone string
  47751. disk string
  47752. urlParams_ gensupport.URLParams
  47753. ifNoneMatch_ string
  47754. ctx_ context.Context
  47755. header_ http.Header
  47756. }
  47757. // Get: Returns a specified persistent disk. Gets a list of available
  47758. // persistent disks by making a list() request.
  47759. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  47760. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  47761. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47762. c.project = project
  47763. c.zone = zone
  47764. c.disk = disk
  47765. return c
  47766. }
  47767. // Fields allows partial responses to be retrieved. See
  47768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47769. // for more information.
  47770. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  47771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47772. return c
  47773. }
  47774. // IfNoneMatch sets the optional parameter which makes the operation
  47775. // fail if the object's ETag matches the given value. This is useful for
  47776. // getting updates only after the object has changed since the last
  47777. // request. Use googleapi.IsNotModified to check whether the response
  47778. // error from Do is the result of In-None-Match.
  47779. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  47780. c.ifNoneMatch_ = entityTag
  47781. return c
  47782. }
  47783. // Context sets the context to be used in this call's Do method. Any
  47784. // pending HTTP request will be aborted if the provided context is
  47785. // canceled.
  47786. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  47787. c.ctx_ = ctx
  47788. return c
  47789. }
  47790. // Header returns an http.Header that can be modified by the caller to
  47791. // add HTTP headers to the request.
  47792. func (c *DisksGetCall) Header() http.Header {
  47793. if c.header_ == nil {
  47794. c.header_ = make(http.Header)
  47795. }
  47796. return c.header_
  47797. }
  47798. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  47799. reqHeaders := make(http.Header)
  47800. for k, v := range c.header_ {
  47801. reqHeaders[k] = v
  47802. }
  47803. reqHeaders.Set("User-Agent", c.s.userAgent())
  47804. if c.ifNoneMatch_ != "" {
  47805. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47806. }
  47807. var body io.Reader = nil
  47808. c.urlParams_.Set("alt", alt)
  47809. c.urlParams_.Set("prettyPrint", "false")
  47810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  47811. urls += "?" + c.urlParams_.Encode()
  47812. req, err := http.NewRequest("GET", urls, body)
  47813. if err != nil {
  47814. return nil, err
  47815. }
  47816. req.Header = reqHeaders
  47817. googleapi.Expand(req.URL, map[string]string{
  47818. "project": c.project,
  47819. "zone": c.zone,
  47820. "disk": c.disk,
  47821. })
  47822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47823. }
  47824. // Do executes the "compute.disks.get" call.
  47825. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  47826. // code is an error. Response headers are in either
  47827. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  47828. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  47829. // whether the returned error was because http.StatusNotModified was
  47830. // returned.
  47831. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  47832. gensupport.SetOptions(c.urlParams_, opts...)
  47833. res, err := c.doRequest("json")
  47834. if res != nil && res.StatusCode == http.StatusNotModified {
  47835. if res.Body != nil {
  47836. res.Body.Close()
  47837. }
  47838. return nil, &googleapi.Error{
  47839. Code: res.StatusCode,
  47840. Header: res.Header,
  47841. }
  47842. }
  47843. if err != nil {
  47844. return nil, err
  47845. }
  47846. defer googleapi.CloseBody(res)
  47847. if err := googleapi.CheckResponse(res); err != nil {
  47848. return nil, err
  47849. }
  47850. ret := &Disk{
  47851. ServerResponse: googleapi.ServerResponse{
  47852. Header: res.Header,
  47853. HTTPStatusCode: res.StatusCode,
  47854. },
  47855. }
  47856. target := &ret
  47857. if err := gensupport.DecodeResponse(target, res); err != nil {
  47858. return nil, err
  47859. }
  47860. return ret, nil
  47861. // {
  47862. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  47863. // "httpMethod": "GET",
  47864. // "id": "compute.disks.get",
  47865. // "parameterOrder": [
  47866. // "project",
  47867. // "zone",
  47868. // "disk"
  47869. // ],
  47870. // "parameters": {
  47871. // "disk": {
  47872. // "description": "Name of the persistent disk to return.",
  47873. // "location": "path",
  47874. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  47875. // "required": true,
  47876. // "type": "string"
  47877. // },
  47878. // "project": {
  47879. // "description": "Project ID for this request.",
  47880. // "location": "path",
  47881. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47882. // "required": true,
  47883. // "type": "string"
  47884. // },
  47885. // "zone": {
  47886. // "description": "The name of the zone for this request.",
  47887. // "location": "path",
  47888. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  47889. // "required": true,
  47890. // "type": "string"
  47891. // }
  47892. // },
  47893. // "path": "{project}/zones/{zone}/disks/{disk}",
  47894. // "response": {
  47895. // "$ref": "Disk"
  47896. // },
  47897. // "scopes": [
  47898. // "https://www.googleapis.com/auth/cloud-platform",
  47899. // "https://www.googleapis.com/auth/compute",
  47900. // "https://www.googleapis.com/auth/compute.readonly"
  47901. // ]
  47902. // }
  47903. }
  47904. // method id "compute.disks.getIamPolicy":
  47905. type DisksGetIamPolicyCall struct {
  47906. s *Service
  47907. project string
  47908. zone string
  47909. resource string
  47910. urlParams_ gensupport.URLParams
  47911. ifNoneMatch_ string
  47912. ctx_ context.Context
  47913. header_ http.Header
  47914. }
  47915. // GetIamPolicy: Gets the access control policy for a resource. May be
  47916. // empty if no such policy or resource exists.
  47917. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  47918. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47919. c.project = project
  47920. c.zone = zone
  47921. c.resource = resource
  47922. return c
  47923. }
  47924. // Fields allows partial responses to be retrieved. See
  47925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47926. // for more information.
  47927. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  47928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47929. return c
  47930. }
  47931. // IfNoneMatch sets the optional parameter which makes the operation
  47932. // fail if the object's ETag matches the given value. This is useful for
  47933. // getting updates only after the object has changed since the last
  47934. // request. Use googleapi.IsNotModified to check whether the response
  47935. // error from Do is the result of In-None-Match.
  47936. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  47937. c.ifNoneMatch_ = entityTag
  47938. return c
  47939. }
  47940. // Context sets the context to be used in this call's Do method. Any
  47941. // pending HTTP request will be aborted if the provided context is
  47942. // canceled.
  47943. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  47944. c.ctx_ = ctx
  47945. return c
  47946. }
  47947. // Header returns an http.Header that can be modified by the caller to
  47948. // add HTTP headers to the request.
  47949. func (c *DisksGetIamPolicyCall) Header() http.Header {
  47950. if c.header_ == nil {
  47951. c.header_ = make(http.Header)
  47952. }
  47953. return c.header_
  47954. }
  47955. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  47956. reqHeaders := make(http.Header)
  47957. for k, v := range c.header_ {
  47958. reqHeaders[k] = v
  47959. }
  47960. reqHeaders.Set("User-Agent", c.s.userAgent())
  47961. if c.ifNoneMatch_ != "" {
  47962. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47963. }
  47964. var body io.Reader = nil
  47965. c.urlParams_.Set("alt", alt)
  47966. c.urlParams_.Set("prettyPrint", "false")
  47967. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  47968. urls += "?" + c.urlParams_.Encode()
  47969. req, err := http.NewRequest("GET", urls, body)
  47970. if err != nil {
  47971. return nil, err
  47972. }
  47973. req.Header = reqHeaders
  47974. googleapi.Expand(req.URL, map[string]string{
  47975. "project": c.project,
  47976. "zone": c.zone,
  47977. "resource": c.resource,
  47978. })
  47979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47980. }
  47981. // Do executes the "compute.disks.getIamPolicy" call.
  47982. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  47983. // code is an error. Response headers are in either
  47984. // *Policy.ServerResponse.Header or (if a response was returned at all)
  47985. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  47986. // check whether the returned error was because http.StatusNotModified
  47987. // was returned.
  47988. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  47989. gensupport.SetOptions(c.urlParams_, opts...)
  47990. res, err := c.doRequest("json")
  47991. if res != nil && res.StatusCode == http.StatusNotModified {
  47992. if res.Body != nil {
  47993. res.Body.Close()
  47994. }
  47995. return nil, &googleapi.Error{
  47996. Code: res.StatusCode,
  47997. Header: res.Header,
  47998. }
  47999. }
  48000. if err != nil {
  48001. return nil, err
  48002. }
  48003. defer googleapi.CloseBody(res)
  48004. if err := googleapi.CheckResponse(res); err != nil {
  48005. return nil, err
  48006. }
  48007. ret := &Policy{
  48008. ServerResponse: googleapi.ServerResponse{
  48009. Header: res.Header,
  48010. HTTPStatusCode: res.StatusCode,
  48011. },
  48012. }
  48013. target := &ret
  48014. if err := gensupport.DecodeResponse(target, res); err != nil {
  48015. return nil, err
  48016. }
  48017. return ret, nil
  48018. // {
  48019. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  48020. // "httpMethod": "GET",
  48021. // "id": "compute.disks.getIamPolicy",
  48022. // "parameterOrder": [
  48023. // "project",
  48024. // "zone",
  48025. // "resource"
  48026. // ],
  48027. // "parameters": {
  48028. // "project": {
  48029. // "description": "Project ID for this request.",
  48030. // "location": "path",
  48031. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48032. // "required": true,
  48033. // "type": "string"
  48034. // },
  48035. // "resource": {
  48036. // "description": "Name or id of the resource for this request.",
  48037. // "location": "path",
  48038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48039. // "required": true,
  48040. // "type": "string"
  48041. // },
  48042. // "zone": {
  48043. // "description": "The name of the zone for this request.",
  48044. // "location": "path",
  48045. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48046. // "required": true,
  48047. // "type": "string"
  48048. // }
  48049. // },
  48050. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  48051. // "response": {
  48052. // "$ref": "Policy"
  48053. // },
  48054. // "scopes": [
  48055. // "https://www.googleapis.com/auth/cloud-platform",
  48056. // "https://www.googleapis.com/auth/compute",
  48057. // "https://www.googleapis.com/auth/compute.readonly"
  48058. // ]
  48059. // }
  48060. }
  48061. // method id "compute.disks.insert":
  48062. type DisksInsertCall struct {
  48063. s *Service
  48064. project string
  48065. zone string
  48066. disk *Disk
  48067. urlParams_ gensupport.URLParams
  48068. ctx_ context.Context
  48069. header_ http.Header
  48070. }
  48071. // Insert: Creates a persistent disk in the specified project using the
  48072. // data in the request. You can create a disk with a sourceImage, a
  48073. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  48074. // properties. You can also create a disk that is larger than the
  48075. // default size by specifying the sizeGb property.
  48076. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  48077. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  48078. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48079. c.project = project
  48080. c.zone = zone
  48081. c.disk = disk
  48082. return c
  48083. }
  48084. // RequestId sets the optional parameter "requestId": An optional
  48085. // request ID to identify requests. Specify a unique request ID so that
  48086. // if you must retry your request, the server will know to ignore the
  48087. // request if it has already been completed.
  48088. //
  48089. // For example, consider a situation where you make an initial request
  48090. // and the request times out. If you make the request again with the
  48091. // same request ID, the server can check if original operation with the
  48092. // same request ID was received, and if so, will ignore the second
  48093. // request. This prevents clients from accidentally creating duplicate
  48094. // commitments.
  48095. //
  48096. // The request ID must be a valid UUID with the exception that zero UUID
  48097. // is not supported (00000000-0000-0000-0000-000000000000).
  48098. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  48099. c.urlParams_.Set("requestId", requestId)
  48100. return c
  48101. }
  48102. // SourceImage sets the optional parameter "sourceImage": Source image
  48103. // to restore onto a disk.
  48104. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  48105. c.urlParams_.Set("sourceImage", sourceImage)
  48106. return c
  48107. }
  48108. // Fields allows partial responses to be retrieved. See
  48109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48110. // for more information.
  48111. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  48112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48113. return c
  48114. }
  48115. // Context sets the context to be used in this call's Do method. Any
  48116. // pending HTTP request will be aborted if the provided context is
  48117. // canceled.
  48118. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  48119. c.ctx_ = ctx
  48120. return c
  48121. }
  48122. // Header returns an http.Header that can be modified by the caller to
  48123. // add HTTP headers to the request.
  48124. func (c *DisksInsertCall) Header() http.Header {
  48125. if c.header_ == nil {
  48126. c.header_ = make(http.Header)
  48127. }
  48128. return c.header_
  48129. }
  48130. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  48131. reqHeaders := make(http.Header)
  48132. for k, v := range c.header_ {
  48133. reqHeaders[k] = v
  48134. }
  48135. reqHeaders.Set("User-Agent", c.s.userAgent())
  48136. var body io.Reader = nil
  48137. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  48138. if err != nil {
  48139. return nil, err
  48140. }
  48141. reqHeaders.Set("Content-Type", "application/json")
  48142. c.urlParams_.Set("alt", alt)
  48143. c.urlParams_.Set("prettyPrint", "false")
  48144. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  48145. urls += "?" + c.urlParams_.Encode()
  48146. req, err := http.NewRequest("POST", urls, body)
  48147. if err != nil {
  48148. return nil, err
  48149. }
  48150. req.Header = reqHeaders
  48151. googleapi.Expand(req.URL, map[string]string{
  48152. "project": c.project,
  48153. "zone": c.zone,
  48154. })
  48155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48156. }
  48157. // Do executes the "compute.disks.insert" call.
  48158. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48159. // status code is an error. Response headers are in either
  48160. // *Operation.ServerResponse.Header or (if a response was returned at
  48161. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48162. // to check whether the returned error was because
  48163. // http.StatusNotModified was returned.
  48164. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48165. gensupport.SetOptions(c.urlParams_, opts...)
  48166. res, err := c.doRequest("json")
  48167. if res != nil && res.StatusCode == http.StatusNotModified {
  48168. if res.Body != nil {
  48169. res.Body.Close()
  48170. }
  48171. return nil, &googleapi.Error{
  48172. Code: res.StatusCode,
  48173. Header: res.Header,
  48174. }
  48175. }
  48176. if err != nil {
  48177. return nil, err
  48178. }
  48179. defer googleapi.CloseBody(res)
  48180. if err := googleapi.CheckResponse(res); err != nil {
  48181. return nil, err
  48182. }
  48183. ret := &Operation{
  48184. ServerResponse: googleapi.ServerResponse{
  48185. Header: res.Header,
  48186. HTTPStatusCode: res.StatusCode,
  48187. },
  48188. }
  48189. target := &ret
  48190. if err := gensupport.DecodeResponse(target, res); err != nil {
  48191. return nil, err
  48192. }
  48193. return ret, nil
  48194. // {
  48195. // "description": "Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.",
  48196. // "httpMethod": "POST",
  48197. // "id": "compute.disks.insert",
  48198. // "parameterOrder": [
  48199. // "project",
  48200. // "zone"
  48201. // ],
  48202. // "parameters": {
  48203. // "project": {
  48204. // "description": "Project ID for this request.",
  48205. // "location": "path",
  48206. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48207. // "required": true,
  48208. // "type": "string"
  48209. // },
  48210. // "requestId": {
  48211. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48212. // "location": "query",
  48213. // "type": "string"
  48214. // },
  48215. // "sourceImage": {
  48216. // "description": "Optional. Source image to restore onto a disk.",
  48217. // "location": "query",
  48218. // "type": "string"
  48219. // },
  48220. // "zone": {
  48221. // "description": "The name of the zone for this request.",
  48222. // "location": "path",
  48223. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48224. // "required": true,
  48225. // "type": "string"
  48226. // }
  48227. // },
  48228. // "path": "{project}/zones/{zone}/disks",
  48229. // "request": {
  48230. // "$ref": "Disk"
  48231. // },
  48232. // "response": {
  48233. // "$ref": "Operation"
  48234. // },
  48235. // "scopes": [
  48236. // "https://www.googleapis.com/auth/cloud-platform",
  48237. // "https://www.googleapis.com/auth/compute"
  48238. // ]
  48239. // }
  48240. }
  48241. // method id "compute.disks.list":
  48242. type DisksListCall struct {
  48243. s *Service
  48244. project string
  48245. zone string
  48246. urlParams_ gensupport.URLParams
  48247. ifNoneMatch_ string
  48248. ctx_ context.Context
  48249. header_ http.Header
  48250. }
  48251. // List: Retrieves a list of persistent disks contained within the
  48252. // specified zone.
  48253. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  48254. func (r *DisksService) List(project string, zone string) *DisksListCall {
  48255. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48256. c.project = project
  48257. c.zone = zone
  48258. return c
  48259. }
  48260. // Filter sets the optional parameter "filter": A filter expression that
  48261. // filters resources listed in the response. The expression must specify
  48262. // the field name, a comparison operator, and the value that you want to
  48263. // use for filtering. The value must be a string, a number, or a
  48264. // boolean. The comparison operator must be either =, !=, >, or <.
  48265. //
  48266. // For example, if you are filtering Compute Engine instances, you can
  48267. // exclude instances named example-instance by specifying name !=
  48268. // example-instance.
  48269. //
  48270. // You can also filter nested fields. For example, you could specify
  48271. // scheduling.automaticRestart = false to include instances only if they
  48272. // are not scheduled for automatic restarts. You can use filtering on
  48273. // nested fields to filter based on resource labels.
  48274. //
  48275. // To filter on multiple expressions, provide each separate expression
  48276. // within parentheses. For example, (scheduling.automaticRestart = true)
  48277. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48278. // AND expression. However, you can include AND and OR expressions
  48279. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48280. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48281. // true).
  48282. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  48283. c.urlParams_.Set("filter", filter)
  48284. return c
  48285. }
  48286. // MaxResults sets the optional parameter "maxResults": The maximum
  48287. // number of results per page that should be returned. If the number of
  48288. // available results is larger than maxResults, Compute Engine returns a
  48289. // nextPageToken that can be used to get the next page of results in
  48290. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48291. // (Default: 500)
  48292. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  48293. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48294. return c
  48295. }
  48296. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48297. // a certain order. By default, results are returned in alphanumerical
  48298. // order based on the resource name.
  48299. //
  48300. // You can also sort results in descending order based on the creation
  48301. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48302. // based on the creationTimestamp field in reverse chronological order
  48303. // (newest result first). Use this to sort resources like operations so
  48304. // that the newest operation is returned first.
  48305. //
  48306. // Currently, only sorting by name or creationTimestamp desc is
  48307. // supported.
  48308. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  48309. c.urlParams_.Set("orderBy", orderBy)
  48310. return c
  48311. }
  48312. // PageToken sets the optional parameter "pageToken": Specifies a page
  48313. // token to use. Set pageToken to the nextPageToken returned by a
  48314. // previous list request to get the next page of results.
  48315. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  48316. c.urlParams_.Set("pageToken", pageToken)
  48317. return c
  48318. }
  48319. // Fields allows partial responses to be retrieved. See
  48320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48321. // for more information.
  48322. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  48323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48324. return c
  48325. }
  48326. // IfNoneMatch sets the optional parameter which makes the operation
  48327. // fail if the object's ETag matches the given value. This is useful for
  48328. // getting updates only after the object has changed since the last
  48329. // request. Use googleapi.IsNotModified to check whether the response
  48330. // error from Do is the result of In-None-Match.
  48331. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  48332. c.ifNoneMatch_ = entityTag
  48333. return c
  48334. }
  48335. // Context sets the context to be used in this call's Do method. Any
  48336. // pending HTTP request will be aborted if the provided context is
  48337. // canceled.
  48338. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  48339. c.ctx_ = ctx
  48340. return c
  48341. }
  48342. // Header returns an http.Header that can be modified by the caller to
  48343. // add HTTP headers to the request.
  48344. func (c *DisksListCall) Header() http.Header {
  48345. if c.header_ == nil {
  48346. c.header_ = make(http.Header)
  48347. }
  48348. return c.header_
  48349. }
  48350. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  48351. reqHeaders := make(http.Header)
  48352. for k, v := range c.header_ {
  48353. reqHeaders[k] = v
  48354. }
  48355. reqHeaders.Set("User-Agent", c.s.userAgent())
  48356. if c.ifNoneMatch_ != "" {
  48357. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48358. }
  48359. var body io.Reader = nil
  48360. c.urlParams_.Set("alt", alt)
  48361. c.urlParams_.Set("prettyPrint", "false")
  48362. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  48363. urls += "?" + c.urlParams_.Encode()
  48364. req, err := http.NewRequest("GET", urls, body)
  48365. if err != nil {
  48366. return nil, err
  48367. }
  48368. req.Header = reqHeaders
  48369. googleapi.Expand(req.URL, map[string]string{
  48370. "project": c.project,
  48371. "zone": c.zone,
  48372. })
  48373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48374. }
  48375. // Do executes the "compute.disks.list" call.
  48376. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  48377. // code is an error. Response headers are in either
  48378. // *DiskList.ServerResponse.Header or (if a response was returned at
  48379. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48380. // to check whether the returned error was because
  48381. // http.StatusNotModified was returned.
  48382. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  48383. gensupport.SetOptions(c.urlParams_, opts...)
  48384. res, err := c.doRequest("json")
  48385. if res != nil && res.StatusCode == http.StatusNotModified {
  48386. if res.Body != nil {
  48387. res.Body.Close()
  48388. }
  48389. return nil, &googleapi.Error{
  48390. Code: res.StatusCode,
  48391. Header: res.Header,
  48392. }
  48393. }
  48394. if err != nil {
  48395. return nil, err
  48396. }
  48397. defer googleapi.CloseBody(res)
  48398. if err := googleapi.CheckResponse(res); err != nil {
  48399. return nil, err
  48400. }
  48401. ret := &DiskList{
  48402. ServerResponse: googleapi.ServerResponse{
  48403. Header: res.Header,
  48404. HTTPStatusCode: res.StatusCode,
  48405. },
  48406. }
  48407. target := &ret
  48408. if err := gensupport.DecodeResponse(target, res); err != nil {
  48409. return nil, err
  48410. }
  48411. return ret, nil
  48412. // {
  48413. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  48414. // "httpMethod": "GET",
  48415. // "id": "compute.disks.list",
  48416. // "parameterOrder": [
  48417. // "project",
  48418. // "zone"
  48419. // ],
  48420. // "parameters": {
  48421. // "filter": {
  48422. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  48423. // "location": "query",
  48424. // "type": "string"
  48425. // },
  48426. // "maxResults": {
  48427. // "default": "500",
  48428. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  48429. // "format": "uint32",
  48430. // "location": "query",
  48431. // "minimum": "0",
  48432. // "type": "integer"
  48433. // },
  48434. // "orderBy": {
  48435. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  48436. // "location": "query",
  48437. // "type": "string"
  48438. // },
  48439. // "pageToken": {
  48440. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  48441. // "location": "query",
  48442. // "type": "string"
  48443. // },
  48444. // "project": {
  48445. // "description": "Project ID for this request.",
  48446. // "location": "path",
  48447. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48448. // "required": true,
  48449. // "type": "string"
  48450. // },
  48451. // "zone": {
  48452. // "description": "The name of the zone for this request.",
  48453. // "location": "path",
  48454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48455. // "required": true,
  48456. // "type": "string"
  48457. // }
  48458. // },
  48459. // "path": "{project}/zones/{zone}/disks",
  48460. // "response": {
  48461. // "$ref": "DiskList"
  48462. // },
  48463. // "scopes": [
  48464. // "https://www.googleapis.com/auth/cloud-platform",
  48465. // "https://www.googleapis.com/auth/compute",
  48466. // "https://www.googleapis.com/auth/compute.readonly"
  48467. // ]
  48468. // }
  48469. }
  48470. // Pages invokes f for each page of results.
  48471. // A non-nil error returned from f will halt the iteration.
  48472. // The provided context supersedes any context provided to the Context method.
  48473. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  48474. c.ctx_ = ctx
  48475. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48476. for {
  48477. x, err := c.Do()
  48478. if err != nil {
  48479. return err
  48480. }
  48481. if err := f(x); err != nil {
  48482. return err
  48483. }
  48484. if x.NextPageToken == "" {
  48485. return nil
  48486. }
  48487. c.PageToken(x.NextPageToken)
  48488. }
  48489. }
  48490. // method id "compute.disks.removeResourcePolicies":
  48491. type DisksRemoveResourcePoliciesCall struct {
  48492. s *Service
  48493. project string
  48494. zone string
  48495. disk string
  48496. disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest
  48497. urlParams_ gensupport.URLParams
  48498. ctx_ context.Context
  48499. header_ http.Header
  48500. }
  48501. // RemoveResourcePolicies: Removes resource policies from a disk.
  48502. func (r *DisksService) RemoveResourcePolicies(project string, zone string, disk string, disksremoveresourcepoliciesrequest *DisksRemoveResourcePoliciesRequest) *DisksRemoveResourcePoliciesCall {
  48503. c := &DisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48504. c.project = project
  48505. c.zone = zone
  48506. c.disk = disk
  48507. c.disksremoveresourcepoliciesrequest = disksremoveresourcepoliciesrequest
  48508. return c
  48509. }
  48510. // RequestId sets the optional parameter "requestId": An optional
  48511. // request ID to identify requests. Specify a unique request ID so that
  48512. // if you must retry your request, the server will know to ignore the
  48513. // request if it has already been completed.
  48514. //
  48515. // For example, consider a situation where you make an initial request
  48516. // and the request times out. If you make the request again with the
  48517. // same request ID, the server can check if original operation with the
  48518. // same request ID was received, and if so, will ignore the second
  48519. // request. This prevents clients from accidentally creating duplicate
  48520. // commitments.
  48521. //
  48522. // The request ID must be a valid UUID with the exception that zero UUID
  48523. // is not supported (00000000-0000-0000-0000-000000000000).
  48524. func (c *DisksRemoveResourcePoliciesCall) RequestId(requestId string) *DisksRemoveResourcePoliciesCall {
  48525. c.urlParams_.Set("requestId", requestId)
  48526. return c
  48527. }
  48528. // Fields allows partial responses to be retrieved. See
  48529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48530. // for more information.
  48531. func (c *DisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *DisksRemoveResourcePoliciesCall {
  48532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48533. return c
  48534. }
  48535. // Context sets the context to be used in this call's Do method. Any
  48536. // pending HTTP request will be aborted if the provided context is
  48537. // canceled.
  48538. func (c *DisksRemoveResourcePoliciesCall) Context(ctx context.Context) *DisksRemoveResourcePoliciesCall {
  48539. c.ctx_ = ctx
  48540. return c
  48541. }
  48542. // Header returns an http.Header that can be modified by the caller to
  48543. // add HTTP headers to the request.
  48544. func (c *DisksRemoveResourcePoliciesCall) Header() http.Header {
  48545. if c.header_ == nil {
  48546. c.header_ = make(http.Header)
  48547. }
  48548. return c.header_
  48549. }
  48550. func (c *DisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  48551. reqHeaders := make(http.Header)
  48552. for k, v := range c.header_ {
  48553. reqHeaders[k] = v
  48554. }
  48555. reqHeaders.Set("User-Agent", c.s.userAgent())
  48556. var body io.Reader = nil
  48557. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksremoveresourcepoliciesrequest)
  48558. if err != nil {
  48559. return nil, err
  48560. }
  48561. reqHeaders.Set("Content-Type", "application/json")
  48562. c.urlParams_.Set("alt", alt)
  48563. c.urlParams_.Set("prettyPrint", "false")
  48564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies")
  48565. urls += "?" + c.urlParams_.Encode()
  48566. req, err := http.NewRequest("POST", urls, body)
  48567. if err != nil {
  48568. return nil, err
  48569. }
  48570. req.Header = reqHeaders
  48571. googleapi.Expand(req.URL, map[string]string{
  48572. "project": c.project,
  48573. "zone": c.zone,
  48574. "disk": c.disk,
  48575. })
  48576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48577. }
  48578. // Do executes the "compute.disks.removeResourcePolicies" call.
  48579. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48580. // status code is an error. Response headers are in either
  48581. // *Operation.ServerResponse.Header or (if a response was returned at
  48582. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48583. // to check whether the returned error was because
  48584. // http.StatusNotModified was returned.
  48585. func (c *DisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48586. gensupport.SetOptions(c.urlParams_, opts...)
  48587. res, err := c.doRequest("json")
  48588. if res != nil && res.StatusCode == http.StatusNotModified {
  48589. if res.Body != nil {
  48590. res.Body.Close()
  48591. }
  48592. return nil, &googleapi.Error{
  48593. Code: res.StatusCode,
  48594. Header: res.Header,
  48595. }
  48596. }
  48597. if err != nil {
  48598. return nil, err
  48599. }
  48600. defer googleapi.CloseBody(res)
  48601. if err := googleapi.CheckResponse(res); err != nil {
  48602. return nil, err
  48603. }
  48604. ret := &Operation{
  48605. ServerResponse: googleapi.ServerResponse{
  48606. Header: res.Header,
  48607. HTTPStatusCode: res.StatusCode,
  48608. },
  48609. }
  48610. target := &ret
  48611. if err := gensupport.DecodeResponse(target, res); err != nil {
  48612. return nil, err
  48613. }
  48614. return ret, nil
  48615. // {
  48616. // "description": "Removes resource policies from a disk.",
  48617. // "httpMethod": "POST",
  48618. // "id": "compute.disks.removeResourcePolicies",
  48619. // "parameterOrder": [
  48620. // "project",
  48621. // "zone",
  48622. // "disk"
  48623. // ],
  48624. // "parameters": {
  48625. // "disk": {
  48626. // "description": "The disk name for this request.",
  48627. // "location": "path",
  48628. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48629. // "required": true,
  48630. // "type": "string"
  48631. // },
  48632. // "project": {
  48633. // "description": "Project ID for this request.",
  48634. // "location": "path",
  48635. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48636. // "required": true,
  48637. // "type": "string"
  48638. // },
  48639. // "requestId": {
  48640. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48641. // "location": "query",
  48642. // "type": "string"
  48643. // },
  48644. // "zone": {
  48645. // "description": "The name of the zone for this request.",
  48646. // "location": "path",
  48647. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48648. // "required": true,
  48649. // "type": "string"
  48650. // }
  48651. // },
  48652. // "path": "{project}/zones/{zone}/disks/{disk}/removeResourcePolicies",
  48653. // "request": {
  48654. // "$ref": "DisksRemoveResourcePoliciesRequest"
  48655. // },
  48656. // "response": {
  48657. // "$ref": "Operation"
  48658. // },
  48659. // "scopes": [
  48660. // "https://www.googleapis.com/auth/cloud-platform",
  48661. // "https://www.googleapis.com/auth/compute"
  48662. // ]
  48663. // }
  48664. }
  48665. // method id "compute.disks.resize":
  48666. type DisksResizeCall struct {
  48667. s *Service
  48668. project string
  48669. zone string
  48670. disk string
  48671. disksresizerequest *DisksResizeRequest
  48672. urlParams_ gensupport.URLParams
  48673. ctx_ context.Context
  48674. header_ http.Header
  48675. }
  48676. // Resize: Resizes the specified persistent disk. You can only increase
  48677. // the size of the disk.
  48678. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  48679. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48680. c.project = project
  48681. c.zone = zone
  48682. c.disk = disk
  48683. c.disksresizerequest = disksresizerequest
  48684. return c
  48685. }
  48686. // RequestId sets the optional parameter "requestId": An optional
  48687. // request ID to identify requests. Specify a unique request ID so that
  48688. // if you must retry your request, the server will know to ignore the
  48689. // request if it has already been completed.
  48690. //
  48691. // For example, consider a situation where you make an initial request
  48692. // and the request times out. If you make the request again with the
  48693. // same request ID, the server can check if original operation with the
  48694. // same request ID was received, and if so, will ignore the second
  48695. // request. This prevents clients from accidentally creating duplicate
  48696. // commitments.
  48697. //
  48698. // The request ID must be a valid UUID with the exception that zero UUID
  48699. // is not supported (00000000-0000-0000-0000-000000000000).
  48700. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  48701. c.urlParams_.Set("requestId", requestId)
  48702. return c
  48703. }
  48704. // Fields allows partial responses to be retrieved. See
  48705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48706. // for more information.
  48707. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  48708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48709. return c
  48710. }
  48711. // Context sets the context to be used in this call's Do method. Any
  48712. // pending HTTP request will be aborted if the provided context is
  48713. // canceled.
  48714. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  48715. c.ctx_ = ctx
  48716. return c
  48717. }
  48718. // Header returns an http.Header that can be modified by the caller to
  48719. // add HTTP headers to the request.
  48720. func (c *DisksResizeCall) Header() http.Header {
  48721. if c.header_ == nil {
  48722. c.header_ = make(http.Header)
  48723. }
  48724. return c.header_
  48725. }
  48726. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  48727. reqHeaders := make(http.Header)
  48728. for k, v := range c.header_ {
  48729. reqHeaders[k] = v
  48730. }
  48731. reqHeaders.Set("User-Agent", c.s.userAgent())
  48732. var body io.Reader = nil
  48733. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  48734. if err != nil {
  48735. return nil, err
  48736. }
  48737. reqHeaders.Set("Content-Type", "application/json")
  48738. c.urlParams_.Set("alt", alt)
  48739. c.urlParams_.Set("prettyPrint", "false")
  48740. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  48741. urls += "?" + c.urlParams_.Encode()
  48742. req, err := http.NewRequest("POST", urls, body)
  48743. if err != nil {
  48744. return nil, err
  48745. }
  48746. req.Header = reqHeaders
  48747. googleapi.Expand(req.URL, map[string]string{
  48748. "project": c.project,
  48749. "zone": c.zone,
  48750. "disk": c.disk,
  48751. })
  48752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48753. }
  48754. // Do executes the "compute.disks.resize" call.
  48755. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48756. // status code is an error. Response headers are in either
  48757. // *Operation.ServerResponse.Header or (if a response was returned at
  48758. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48759. // to check whether the returned error was because
  48760. // http.StatusNotModified was returned.
  48761. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48762. gensupport.SetOptions(c.urlParams_, opts...)
  48763. res, err := c.doRequest("json")
  48764. if res != nil && res.StatusCode == http.StatusNotModified {
  48765. if res.Body != nil {
  48766. res.Body.Close()
  48767. }
  48768. return nil, &googleapi.Error{
  48769. Code: res.StatusCode,
  48770. Header: res.Header,
  48771. }
  48772. }
  48773. if err != nil {
  48774. return nil, err
  48775. }
  48776. defer googleapi.CloseBody(res)
  48777. if err := googleapi.CheckResponse(res); err != nil {
  48778. return nil, err
  48779. }
  48780. ret := &Operation{
  48781. ServerResponse: googleapi.ServerResponse{
  48782. Header: res.Header,
  48783. HTTPStatusCode: res.StatusCode,
  48784. },
  48785. }
  48786. target := &ret
  48787. if err := gensupport.DecodeResponse(target, res); err != nil {
  48788. return nil, err
  48789. }
  48790. return ret, nil
  48791. // {
  48792. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  48793. // "httpMethod": "POST",
  48794. // "id": "compute.disks.resize",
  48795. // "parameterOrder": [
  48796. // "project",
  48797. // "zone",
  48798. // "disk"
  48799. // ],
  48800. // "parameters": {
  48801. // "disk": {
  48802. // "description": "The name of the persistent disk.",
  48803. // "location": "path",
  48804. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48805. // "required": true,
  48806. // "type": "string"
  48807. // },
  48808. // "project": {
  48809. // "description": "Project ID for this request.",
  48810. // "location": "path",
  48811. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48812. // "required": true,
  48813. // "type": "string"
  48814. // },
  48815. // "requestId": {
  48816. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48817. // "location": "query",
  48818. // "type": "string"
  48819. // },
  48820. // "zone": {
  48821. // "description": "The name of the zone for this request.",
  48822. // "location": "path",
  48823. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48824. // "required": true,
  48825. // "type": "string"
  48826. // }
  48827. // },
  48828. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  48829. // "request": {
  48830. // "$ref": "DisksResizeRequest"
  48831. // },
  48832. // "response": {
  48833. // "$ref": "Operation"
  48834. // },
  48835. // "scopes": [
  48836. // "https://www.googleapis.com/auth/cloud-platform",
  48837. // "https://www.googleapis.com/auth/compute"
  48838. // ]
  48839. // }
  48840. }
  48841. // method id "compute.disks.setIamPolicy":
  48842. type DisksSetIamPolicyCall struct {
  48843. s *Service
  48844. project string
  48845. zone string
  48846. resource string
  48847. zonesetpolicyrequest *ZoneSetPolicyRequest
  48848. urlParams_ gensupport.URLParams
  48849. ctx_ context.Context
  48850. header_ http.Header
  48851. }
  48852. // SetIamPolicy: Sets the access control policy on the specified
  48853. // resource. Replaces any existing policy.
  48854. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  48855. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48856. c.project = project
  48857. c.zone = zone
  48858. c.resource = resource
  48859. c.zonesetpolicyrequest = zonesetpolicyrequest
  48860. return c
  48861. }
  48862. // Fields allows partial responses to be retrieved. See
  48863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48864. // for more information.
  48865. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  48866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48867. return c
  48868. }
  48869. // Context sets the context to be used in this call's Do method. Any
  48870. // pending HTTP request will be aborted if the provided context is
  48871. // canceled.
  48872. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  48873. c.ctx_ = ctx
  48874. return c
  48875. }
  48876. // Header returns an http.Header that can be modified by the caller to
  48877. // add HTTP headers to the request.
  48878. func (c *DisksSetIamPolicyCall) Header() http.Header {
  48879. if c.header_ == nil {
  48880. c.header_ = make(http.Header)
  48881. }
  48882. return c.header_
  48883. }
  48884. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  48885. reqHeaders := make(http.Header)
  48886. for k, v := range c.header_ {
  48887. reqHeaders[k] = v
  48888. }
  48889. reqHeaders.Set("User-Agent", c.s.userAgent())
  48890. var body io.Reader = nil
  48891. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  48892. if err != nil {
  48893. return nil, err
  48894. }
  48895. reqHeaders.Set("Content-Type", "application/json")
  48896. c.urlParams_.Set("alt", alt)
  48897. c.urlParams_.Set("prettyPrint", "false")
  48898. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  48899. urls += "?" + c.urlParams_.Encode()
  48900. req, err := http.NewRequest("POST", urls, body)
  48901. if err != nil {
  48902. return nil, err
  48903. }
  48904. req.Header = reqHeaders
  48905. googleapi.Expand(req.URL, map[string]string{
  48906. "project": c.project,
  48907. "zone": c.zone,
  48908. "resource": c.resource,
  48909. })
  48910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48911. }
  48912. // Do executes the "compute.disks.setIamPolicy" call.
  48913. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  48914. // code is an error. Response headers are in either
  48915. // *Policy.ServerResponse.Header or (if a response was returned at all)
  48916. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  48917. // check whether the returned error was because http.StatusNotModified
  48918. // was returned.
  48919. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  48920. gensupport.SetOptions(c.urlParams_, opts...)
  48921. res, err := c.doRequest("json")
  48922. if res != nil && res.StatusCode == http.StatusNotModified {
  48923. if res.Body != nil {
  48924. res.Body.Close()
  48925. }
  48926. return nil, &googleapi.Error{
  48927. Code: res.StatusCode,
  48928. Header: res.Header,
  48929. }
  48930. }
  48931. if err != nil {
  48932. return nil, err
  48933. }
  48934. defer googleapi.CloseBody(res)
  48935. if err := googleapi.CheckResponse(res); err != nil {
  48936. return nil, err
  48937. }
  48938. ret := &Policy{
  48939. ServerResponse: googleapi.ServerResponse{
  48940. Header: res.Header,
  48941. HTTPStatusCode: res.StatusCode,
  48942. },
  48943. }
  48944. target := &ret
  48945. if err := gensupport.DecodeResponse(target, res); err != nil {
  48946. return nil, err
  48947. }
  48948. return ret, nil
  48949. // {
  48950. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  48951. // "httpMethod": "POST",
  48952. // "id": "compute.disks.setIamPolicy",
  48953. // "parameterOrder": [
  48954. // "project",
  48955. // "zone",
  48956. // "resource"
  48957. // ],
  48958. // "parameters": {
  48959. // "project": {
  48960. // "description": "Project ID for this request.",
  48961. // "location": "path",
  48962. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48963. // "required": true,
  48964. // "type": "string"
  48965. // },
  48966. // "resource": {
  48967. // "description": "Name or id of the resource for this request.",
  48968. // "location": "path",
  48969. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  48970. // "required": true,
  48971. // "type": "string"
  48972. // },
  48973. // "zone": {
  48974. // "description": "The name of the zone for this request.",
  48975. // "location": "path",
  48976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48977. // "required": true,
  48978. // "type": "string"
  48979. // }
  48980. // },
  48981. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  48982. // "request": {
  48983. // "$ref": "ZoneSetPolicyRequest"
  48984. // },
  48985. // "response": {
  48986. // "$ref": "Policy"
  48987. // },
  48988. // "scopes": [
  48989. // "https://www.googleapis.com/auth/cloud-platform",
  48990. // "https://www.googleapis.com/auth/compute"
  48991. // ]
  48992. // }
  48993. }
  48994. // method id "compute.disks.setLabels":
  48995. type DisksSetLabelsCall struct {
  48996. s *Service
  48997. project string
  48998. zone string
  48999. resource string
  49000. zonesetlabelsrequest *ZoneSetLabelsRequest
  49001. urlParams_ gensupport.URLParams
  49002. ctx_ context.Context
  49003. header_ http.Header
  49004. }
  49005. // SetLabels: Sets the labels on a disk. To learn more about labels,
  49006. // read the Labeling Resources documentation.
  49007. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  49008. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49009. c.project = project
  49010. c.zone = zone
  49011. c.resource = resource
  49012. c.zonesetlabelsrequest = zonesetlabelsrequest
  49013. return c
  49014. }
  49015. // RequestId sets the optional parameter "requestId": An optional
  49016. // request ID to identify requests. Specify a unique request ID so that
  49017. // if you must retry your request, the server will know to ignore the
  49018. // request if it has already been completed.
  49019. //
  49020. // For example, consider a situation where you make an initial request
  49021. // and the request times out. If you make the request again with the
  49022. // same request ID, the server can check if original operation with the
  49023. // same request ID was received, and if so, will ignore the second
  49024. // request. This prevents clients from accidentally creating duplicate
  49025. // commitments.
  49026. //
  49027. // The request ID must be a valid UUID with the exception that zero UUID
  49028. // is not supported (00000000-0000-0000-0000-000000000000).
  49029. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  49030. c.urlParams_.Set("requestId", requestId)
  49031. return c
  49032. }
  49033. // Fields allows partial responses to be retrieved. See
  49034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49035. // for more information.
  49036. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  49037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49038. return c
  49039. }
  49040. // Context sets the context to be used in this call's Do method. Any
  49041. // pending HTTP request will be aborted if the provided context is
  49042. // canceled.
  49043. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  49044. c.ctx_ = ctx
  49045. return c
  49046. }
  49047. // Header returns an http.Header that can be modified by the caller to
  49048. // add HTTP headers to the request.
  49049. func (c *DisksSetLabelsCall) Header() http.Header {
  49050. if c.header_ == nil {
  49051. c.header_ = make(http.Header)
  49052. }
  49053. return c.header_
  49054. }
  49055. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  49056. reqHeaders := make(http.Header)
  49057. for k, v := range c.header_ {
  49058. reqHeaders[k] = v
  49059. }
  49060. reqHeaders.Set("User-Agent", c.s.userAgent())
  49061. var body io.Reader = nil
  49062. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  49063. if err != nil {
  49064. return nil, err
  49065. }
  49066. reqHeaders.Set("Content-Type", "application/json")
  49067. c.urlParams_.Set("alt", alt)
  49068. c.urlParams_.Set("prettyPrint", "false")
  49069. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  49070. urls += "?" + c.urlParams_.Encode()
  49071. req, err := http.NewRequest("POST", urls, body)
  49072. if err != nil {
  49073. return nil, err
  49074. }
  49075. req.Header = reqHeaders
  49076. googleapi.Expand(req.URL, map[string]string{
  49077. "project": c.project,
  49078. "zone": c.zone,
  49079. "resource": c.resource,
  49080. })
  49081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49082. }
  49083. // Do executes the "compute.disks.setLabels" call.
  49084. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49085. // status code is an error. Response headers are in either
  49086. // *Operation.ServerResponse.Header or (if a response was returned at
  49087. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49088. // to check whether the returned error was because
  49089. // http.StatusNotModified was returned.
  49090. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49091. gensupport.SetOptions(c.urlParams_, opts...)
  49092. res, err := c.doRequest("json")
  49093. if res != nil && res.StatusCode == http.StatusNotModified {
  49094. if res.Body != nil {
  49095. res.Body.Close()
  49096. }
  49097. return nil, &googleapi.Error{
  49098. Code: res.StatusCode,
  49099. Header: res.Header,
  49100. }
  49101. }
  49102. if err != nil {
  49103. return nil, err
  49104. }
  49105. defer googleapi.CloseBody(res)
  49106. if err := googleapi.CheckResponse(res); err != nil {
  49107. return nil, err
  49108. }
  49109. ret := &Operation{
  49110. ServerResponse: googleapi.ServerResponse{
  49111. Header: res.Header,
  49112. HTTPStatusCode: res.StatusCode,
  49113. },
  49114. }
  49115. target := &ret
  49116. if err := gensupport.DecodeResponse(target, res); err != nil {
  49117. return nil, err
  49118. }
  49119. return ret, nil
  49120. // {
  49121. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  49122. // "httpMethod": "POST",
  49123. // "id": "compute.disks.setLabels",
  49124. // "parameterOrder": [
  49125. // "project",
  49126. // "zone",
  49127. // "resource"
  49128. // ],
  49129. // "parameters": {
  49130. // "project": {
  49131. // "description": "Project ID for this request.",
  49132. // "location": "path",
  49133. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49134. // "required": true,
  49135. // "type": "string"
  49136. // },
  49137. // "requestId": {
  49138. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49139. // "location": "query",
  49140. // "type": "string"
  49141. // },
  49142. // "resource": {
  49143. // "description": "Name or id of the resource for this request.",
  49144. // "location": "path",
  49145. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49146. // "required": true,
  49147. // "type": "string"
  49148. // },
  49149. // "zone": {
  49150. // "description": "The name of the zone for this request.",
  49151. // "location": "path",
  49152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49153. // "required": true,
  49154. // "type": "string"
  49155. // }
  49156. // },
  49157. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  49158. // "request": {
  49159. // "$ref": "ZoneSetLabelsRequest"
  49160. // },
  49161. // "response": {
  49162. // "$ref": "Operation"
  49163. // },
  49164. // "scopes": [
  49165. // "https://www.googleapis.com/auth/cloud-platform",
  49166. // "https://www.googleapis.com/auth/compute"
  49167. // ]
  49168. // }
  49169. }
  49170. // method id "compute.disks.testIamPermissions":
  49171. type DisksTestIamPermissionsCall struct {
  49172. s *Service
  49173. project string
  49174. zone string
  49175. resource string
  49176. testpermissionsrequest *TestPermissionsRequest
  49177. urlParams_ gensupport.URLParams
  49178. ctx_ context.Context
  49179. header_ http.Header
  49180. }
  49181. // TestIamPermissions: Returns permissions that a caller has on the
  49182. // specified resource.
  49183. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  49184. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49185. c.project = project
  49186. c.zone = zone
  49187. c.resource = resource
  49188. c.testpermissionsrequest = testpermissionsrequest
  49189. return c
  49190. }
  49191. // Fields allows partial responses to be retrieved. See
  49192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49193. // for more information.
  49194. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  49195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49196. return c
  49197. }
  49198. // Context sets the context to be used in this call's Do method. Any
  49199. // pending HTTP request will be aborted if the provided context is
  49200. // canceled.
  49201. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  49202. c.ctx_ = ctx
  49203. return c
  49204. }
  49205. // Header returns an http.Header that can be modified by the caller to
  49206. // add HTTP headers to the request.
  49207. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  49208. if c.header_ == nil {
  49209. c.header_ = make(http.Header)
  49210. }
  49211. return c.header_
  49212. }
  49213. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  49214. reqHeaders := make(http.Header)
  49215. for k, v := range c.header_ {
  49216. reqHeaders[k] = v
  49217. }
  49218. reqHeaders.Set("User-Agent", c.s.userAgent())
  49219. var body io.Reader = nil
  49220. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  49221. if err != nil {
  49222. return nil, err
  49223. }
  49224. reqHeaders.Set("Content-Type", "application/json")
  49225. c.urlParams_.Set("alt", alt)
  49226. c.urlParams_.Set("prettyPrint", "false")
  49227. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  49228. urls += "?" + c.urlParams_.Encode()
  49229. req, err := http.NewRequest("POST", urls, body)
  49230. if err != nil {
  49231. return nil, err
  49232. }
  49233. req.Header = reqHeaders
  49234. googleapi.Expand(req.URL, map[string]string{
  49235. "project": c.project,
  49236. "zone": c.zone,
  49237. "resource": c.resource,
  49238. })
  49239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49240. }
  49241. // Do executes the "compute.disks.testIamPermissions" call.
  49242. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  49243. // non-2xx status code is an error. Response headers are in either
  49244. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  49245. // returned at all) in error.(*googleapi.Error).Header. Use
  49246. // googleapi.IsNotModified to check whether the returned error was
  49247. // because http.StatusNotModified was returned.
  49248. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  49249. gensupport.SetOptions(c.urlParams_, opts...)
  49250. res, err := c.doRequest("json")
  49251. if res != nil && res.StatusCode == http.StatusNotModified {
  49252. if res.Body != nil {
  49253. res.Body.Close()
  49254. }
  49255. return nil, &googleapi.Error{
  49256. Code: res.StatusCode,
  49257. Header: res.Header,
  49258. }
  49259. }
  49260. if err != nil {
  49261. return nil, err
  49262. }
  49263. defer googleapi.CloseBody(res)
  49264. if err := googleapi.CheckResponse(res); err != nil {
  49265. return nil, err
  49266. }
  49267. ret := &TestPermissionsResponse{
  49268. ServerResponse: googleapi.ServerResponse{
  49269. Header: res.Header,
  49270. HTTPStatusCode: res.StatusCode,
  49271. },
  49272. }
  49273. target := &ret
  49274. if err := gensupport.DecodeResponse(target, res); err != nil {
  49275. return nil, err
  49276. }
  49277. return ret, nil
  49278. // {
  49279. // "description": "Returns permissions that a caller has on the specified resource.",
  49280. // "httpMethod": "POST",
  49281. // "id": "compute.disks.testIamPermissions",
  49282. // "parameterOrder": [
  49283. // "project",
  49284. // "zone",
  49285. // "resource"
  49286. // ],
  49287. // "parameters": {
  49288. // "project": {
  49289. // "description": "Project ID for this request.",
  49290. // "location": "path",
  49291. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49292. // "required": true,
  49293. // "type": "string"
  49294. // },
  49295. // "resource": {
  49296. // "description": "Name or id of the resource for this request.",
  49297. // "location": "path",
  49298. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49299. // "required": true,
  49300. // "type": "string"
  49301. // },
  49302. // "zone": {
  49303. // "description": "The name of the zone for this request.",
  49304. // "location": "path",
  49305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49306. // "required": true,
  49307. // "type": "string"
  49308. // }
  49309. // },
  49310. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  49311. // "request": {
  49312. // "$ref": "TestPermissionsRequest"
  49313. // },
  49314. // "response": {
  49315. // "$ref": "TestPermissionsResponse"
  49316. // },
  49317. // "scopes": [
  49318. // "https://www.googleapis.com/auth/cloud-platform",
  49319. // "https://www.googleapis.com/auth/compute",
  49320. // "https://www.googleapis.com/auth/compute.readonly"
  49321. // ]
  49322. // }
  49323. }
  49324. // method id "compute.externalVpnGateways.delete":
  49325. type ExternalVpnGatewaysDeleteCall struct {
  49326. s *Service
  49327. project string
  49328. externalVpnGateway string
  49329. urlParams_ gensupport.URLParams
  49330. ctx_ context.Context
  49331. header_ http.Header
  49332. }
  49333. // Delete: Deletes the specified externalVpnGateway.
  49334. func (r *ExternalVpnGatewaysService) Delete(project string, externalVpnGateway string) *ExternalVpnGatewaysDeleteCall {
  49335. c := &ExternalVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49336. c.project = project
  49337. c.externalVpnGateway = externalVpnGateway
  49338. return c
  49339. }
  49340. // RequestId sets the optional parameter "requestId": An optional
  49341. // request ID to identify requests. Specify a unique request ID so that
  49342. // if you must retry your request, the server will know to ignore the
  49343. // request if it has already been completed.
  49344. //
  49345. // For example, consider a situation where you make an initial request
  49346. // and the request times out. If you make the request again with the
  49347. // same request ID, the server can check if original operation with the
  49348. // same request ID was received, and if so, will ignore the second
  49349. // request. This prevents clients from accidentally creating duplicate
  49350. // commitments.
  49351. //
  49352. // The request ID must be a valid UUID with the exception that zero UUID
  49353. // is not supported (00000000-0000-0000-0000-000000000000).
  49354. func (c *ExternalVpnGatewaysDeleteCall) RequestId(requestId string) *ExternalVpnGatewaysDeleteCall {
  49355. c.urlParams_.Set("requestId", requestId)
  49356. return c
  49357. }
  49358. // Fields allows partial responses to be retrieved. See
  49359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49360. // for more information.
  49361. func (c *ExternalVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysDeleteCall {
  49362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49363. return c
  49364. }
  49365. // Context sets the context to be used in this call's Do method. Any
  49366. // pending HTTP request will be aborted if the provided context is
  49367. // canceled.
  49368. func (c *ExternalVpnGatewaysDeleteCall) Context(ctx context.Context) *ExternalVpnGatewaysDeleteCall {
  49369. c.ctx_ = ctx
  49370. return c
  49371. }
  49372. // Header returns an http.Header that can be modified by the caller to
  49373. // add HTTP headers to the request.
  49374. func (c *ExternalVpnGatewaysDeleteCall) Header() http.Header {
  49375. if c.header_ == nil {
  49376. c.header_ = make(http.Header)
  49377. }
  49378. return c.header_
  49379. }
  49380. func (c *ExternalVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  49381. reqHeaders := make(http.Header)
  49382. for k, v := range c.header_ {
  49383. reqHeaders[k] = v
  49384. }
  49385. reqHeaders.Set("User-Agent", c.s.userAgent())
  49386. var body io.Reader = nil
  49387. c.urlParams_.Set("alt", alt)
  49388. c.urlParams_.Set("prettyPrint", "false")
  49389. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{externalVpnGateway}")
  49390. urls += "?" + c.urlParams_.Encode()
  49391. req, err := http.NewRequest("DELETE", urls, body)
  49392. if err != nil {
  49393. return nil, err
  49394. }
  49395. req.Header = reqHeaders
  49396. googleapi.Expand(req.URL, map[string]string{
  49397. "project": c.project,
  49398. "externalVpnGateway": c.externalVpnGateway,
  49399. })
  49400. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49401. }
  49402. // Do executes the "compute.externalVpnGateways.delete" call.
  49403. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49404. // status code is an error. Response headers are in either
  49405. // *Operation.ServerResponse.Header or (if a response was returned at
  49406. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49407. // to check whether the returned error was because
  49408. // http.StatusNotModified was returned.
  49409. func (c *ExternalVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49410. gensupport.SetOptions(c.urlParams_, opts...)
  49411. res, err := c.doRequest("json")
  49412. if res != nil && res.StatusCode == http.StatusNotModified {
  49413. if res.Body != nil {
  49414. res.Body.Close()
  49415. }
  49416. return nil, &googleapi.Error{
  49417. Code: res.StatusCode,
  49418. Header: res.Header,
  49419. }
  49420. }
  49421. if err != nil {
  49422. return nil, err
  49423. }
  49424. defer googleapi.CloseBody(res)
  49425. if err := googleapi.CheckResponse(res); err != nil {
  49426. return nil, err
  49427. }
  49428. ret := &Operation{
  49429. ServerResponse: googleapi.ServerResponse{
  49430. Header: res.Header,
  49431. HTTPStatusCode: res.StatusCode,
  49432. },
  49433. }
  49434. target := &ret
  49435. if err := gensupport.DecodeResponse(target, res); err != nil {
  49436. return nil, err
  49437. }
  49438. return ret, nil
  49439. // {
  49440. // "description": "Deletes the specified externalVpnGateway.",
  49441. // "httpMethod": "DELETE",
  49442. // "id": "compute.externalVpnGateways.delete",
  49443. // "parameterOrder": [
  49444. // "project",
  49445. // "externalVpnGateway"
  49446. // ],
  49447. // "parameters": {
  49448. // "externalVpnGateway": {
  49449. // "description": "Name of the externalVpnGateways to delete.",
  49450. // "location": "path",
  49451. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49452. // "required": true,
  49453. // "type": "string"
  49454. // },
  49455. // "project": {
  49456. // "description": "Project ID for this request.",
  49457. // "location": "path",
  49458. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49459. // "required": true,
  49460. // "type": "string"
  49461. // },
  49462. // "requestId": {
  49463. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49464. // "location": "query",
  49465. // "type": "string"
  49466. // }
  49467. // },
  49468. // "path": "{project}/global/externalVpnGateways/{externalVpnGateway}",
  49469. // "response": {
  49470. // "$ref": "Operation"
  49471. // },
  49472. // "scopes": [
  49473. // "https://www.googleapis.com/auth/cloud-platform",
  49474. // "https://www.googleapis.com/auth/compute"
  49475. // ]
  49476. // }
  49477. }
  49478. // method id "compute.externalVpnGateways.get":
  49479. type ExternalVpnGatewaysGetCall struct {
  49480. s *Service
  49481. project string
  49482. externalVpnGateway string
  49483. urlParams_ gensupport.URLParams
  49484. ifNoneMatch_ string
  49485. ctx_ context.Context
  49486. header_ http.Header
  49487. }
  49488. // Get: Returns the specified externalVpnGateway. Get a list of
  49489. // available externalVpnGateways by making a list() request.
  49490. func (r *ExternalVpnGatewaysService) Get(project string, externalVpnGateway string) *ExternalVpnGatewaysGetCall {
  49491. c := &ExternalVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49492. c.project = project
  49493. c.externalVpnGateway = externalVpnGateway
  49494. return c
  49495. }
  49496. // Fields allows partial responses to be retrieved. See
  49497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49498. // for more information.
  49499. func (c *ExternalVpnGatewaysGetCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysGetCall {
  49500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49501. return c
  49502. }
  49503. // IfNoneMatch sets the optional parameter which makes the operation
  49504. // fail if the object's ETag matches the given value. This is useful for
  49505. // getting updates only after the object has changed since the last
  49506. // request. Use googleapi.IsNotModified to check whether the response
  49507. // error from Do is the result of In-None-Match.
  49508. func (c *ExternalVpnGatewaysGetCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysGetCall {
  49509. c.ifNoneMatch_ = entityTag
  49510. return c
  49511. }
  49512. // Context sets the context to be used in this call's Do method. Any
  49513. // pending HTTP request will be aborted if the provided context is
  49514. // canceled.
  49515. func (c *ExternalVpnGatewaysGetCall) Context(ctx context.Context) *ExternalVpnGatewaysGetCall {
  49516. c.ctx_ = ctx
  49517. return c
  49518. }
  49519. // Header returns an http.Header that can be modified by the caller to
  49520. // add HTTP headers to the request.
  49521. func (c *ExternalVpnGatewaysGetCall) Header() http.Header {
  49522. if c.header_ == nil {
  49523. c.header_ = make(http.Header)
  49524. }
  49525. return c.header_
  49526. }
  49527. func (c *ExternalVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  49528. reqHeaders := make(http.Header)
  49529. for k, v := range c.header_ {
  49530. reqHeaders[k] = v
  49531. }
  49532. reqHeaders.Set("User-Agent", c.s.userAgent())
  49533. if c.ifNoneMatch_ != "" {
  49534. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49535. }
  49536. var body io.Reader = nil
  49537. c.urlParams_.Set("alt", alt)
  49538. c.urlParams_.Set("prettyPrint", "false")
  49539. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{externalVpnGateway}")
  49540. urls += "?" + c.urlParams_.Encode()
  49541. req, err := http.NewRequest("GET", urls, body)
  49542. if err != nil {
  49543. return nil, err
  49544. }
  49545. req.Header = reqHeaders
  49546. googleapi.Expand(req.URL, map[string]string{
  49547. "project": c.project,
  49548. "externalVpnGateway": c.externalVpnGateway,
  49549. })
  49550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49551. }
  49552. // Do executes the "compute.externalVpnGateways.get" call.
  49553. // Exactly one of *ExternalVpnGateway or error will be non-nil. Any
  49554. // non-2xx status code is an error. Response headers are in either
  49555. // *ExternalVpnGateway.ServerResponse.Header or (if a response was
  49556. // returned at all) in error.(*googleapi.Error).Header. Use
  49557. // googleapi.IsNotModified to check whether the returned error was
  49558. // because http.StatusNotModified was returned.
  49559. func (c *ExternalVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGateway, error) {
  49560. gensupport.SetOptions(c.urlParams_, opts...)
  49561. res, err := c.doRequest("json")
  49562. if res != nil && res.StatusCode == http.StatusNotModified {
  49563. if res.Body != nil {
  49564. res.Body.Close()
  49565. }
  49566. return nil, &googleapi.Error{
  49567. Code: res.StatusCode,
  49568. Header: res.Header,
  49569. }
  49570. }
  49571. if err != nil {
  49572. return nil, err
  49573. }
  49574. defer googleapi.CloseBody(res)
  49575. if err := googleapi.CheckResponse(res); err != nil {
  49576. return nil, err
  49577. }
  49578. ret := &ExternalVpnGateway{
  49579. ServerResponse: googleapi.ServerResponse{
  49580. Header: res.Header,
  49581. HTTPStatusCode: res.StatusCode,
  49582. },
  49583. }
  49584. target := &ret
  49585. if err := gensupport.DecodeResponse(target, res); err != nil {
  49586. return nil, err
  49587. }
  49588. return ret, nil
  49589. // {
  49590. // "description": "Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request.",
  49591. // "httpMethod": "GET",
  49592. // "id": "compute.externalVpnGateways.get",
  49593. // "parameterOrder": [
  49594. // "project",
  49595. // "externalVpnGateway"
  49596. // ],
  49597. // "parameters": {
  49598. // "externalVpnGateway": {
  49599. // "description": "Name of the externalVpnGateway to return.",
  49600. // "location": "path",
  49601. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  49602. // "required": true,
  49603. // "type": "string"
  49604. // },
  49605. // "project": {
  49606. // "description": "Project ID for this request.",
  49607. // "location": "path",
  49608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49609. // "required": true,
  49610. // "type": "string"
  49611. // }
  49612. // },
  49613. // "path": "{project}/global/externalVpnGateways/{externalVpnGateway}",
  49614. // "response": {
  49615. // "$ref": "ExternalVpnGateway"
  49616. // },
  49617. // "scopes": [
  49618. // "https://www.googleapis.com/auth/cloud-platform",
  49619. // "https://www.googleapis.com/auth/compute",
  49620. // "https://www.googleapis.com/auth/compute.readonly"
  49621. // ]
  49622. // }
  49623. }
  49624. // method id "compute.externalVpnGateways.insert":
  49625. type ExternalVpnGatewaysInsertCall struct {
  49626. s *Service
  49627. project string
  49628. externalvpngateway *ExternalVpnGateway
  49629. urlParams_ gensupport.URLParams
  49630. ctx_ context.Context
  49631. header_ http.Header
  49632. }
  49633. // Insert: Creates a ExternalVpnGateway in the specified project using
  49634. // the data included in the request.
  49635. func (r *ExternalVpnGatewaysService) Insert(project string, externalvpngateway *ExternalVpnGateway) *ExternalVpnGatewaysInsertCall {
  49636. c := &ExternalVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49637. c.project = project
  49638. c.externalvpngateway = externalvpngateway
  49639. return c
  49640. }
  49641. // RequestId sets the optional parameter "requestId": An optional
  49642. // request ID to identify requests. Specify a unique request ID so that
  49643. // if you must retry your request, the server will know to ignore the
  49644. // request if it has already been completed.
  49645. //
  49646. // For example, consider a situation where you make an initial request
  49647. // and the request times out. If you make the request again with the
  49648. // same request ID, the server can check if original operation with the
  49649. // same request ID was received, and if so, will ignore the second
  49650. // request. This prevents clients from accidentally creating duplicate
  49651. // commitments.
  49652. //
  49653. // The request ID must be a valid UUID with the exception that zero UUID
  49654. // is not supported (00000000-0000-0000-0000-000000000000).
  49655. func (c *ExternalVpnGatewaysInsertCall) RequestId(requestId string) *ExternalVpnGatewaysInsertCall {
  49656. c.urlParams_.Set("requestId", requestId)
  49657. return c
  49658. }
  49659. // Fields allows partial responses to be retrieved. See
  49660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49661. // for more information.
  49662. func (c *ExternalVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysInsertCall {
  49663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49664. return c
  49665. }
  49666. // Context sets the context to be used in this call's Do method. Any
  49667. // pending HTTP request will be aborted if the provided context is
  49668. // canceled.
  49669. func (c *ExternalVpnGatewaysInsertCall) Context(ctx context.Context) *ExternalVpnGatewaysInsertCall {
  49670. c.ctx_ = ctx
  49671. return c
  49672. }
  49673. // Header returns an http.Header that can be modified by the caller to
  49674. // add HTTP headers to the request.
  49675. func (c *ExternalVpnGatewaysInsertCall) Header() http.Header {
  49676. if c.header_ == nil {
  49677. c.header_ = make(http.Header)
  49678. }
  49679. return c.header_
  49680. }
  49681. func (c *ExternalVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  49682. reqHeaders := make(http.Header)
  49683. for k, v := range c.header_ {
  49684. reqHeaders[k] = v
  49685. }
  49686. reqHeaders.Set("User-Agent", c.s.userAgent())
  49687. var body io.Reader = nil
  49688. body, err := googleapi.WithoutDataWrapper.JSONReader(c.externalvpngateway)
  49689. if err != nil {
  49690. return nil, err
  49691. }
  49692. reqHeaders.Set("Content-Type", "application/json")
  49693. c.urlParams_.Set("alt", alt)
  49694. c.urlParams_.Set("prettyPrint", "false")
  49695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways")
  49696. urls += "?" + c.urlParams_.Encode()
  49697. req, err := http.NewRequest("POST", urls, body)
  49698. if err != nil {
  49699. return nil, err
  49700. }
  49701. req.Header = reqHeaders
  49702. googleapi.Expand(req.URL, map[string]string{
  49703. "project": c.project,
  49704. })
  49705. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49706. }
  49707. // Do executes the "compute.externalVpnGateways.insert" call.
  49708. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49709. // status code is an error. Response headers are in either
  49710. // *Operation.ServerResponse.Header or (if a response was returned at
  49711. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49712. // to check whether the returned error was because
  49713. // http.StatusNotModified was returned.
  49714. func (c *ExternalVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49715. gensupport.SetOptions(c.urlParams_, opts...)
  49716. res, err := c.doRequest("json")
  49717. if res != nil && res.StatusCode == http.StatusNotModified {
  49718. if res.Body != nil {
  49719. res.Body.Close()
  49720. }
  49721. return nil, &googleapi.Error{
  49722. Code: res.StatusCode,
  49723. Header: res.Header,
  49724. }
  49725. }
  49726. if err != nil {
  49727. return nil, err
  49728. }
  49729. defer googleapi.CloseBody(res)
  49730. if err := googleapi.CheckResponse(res); err != nil {
  49731. return nil, err
  49732. }
  49733. ret := &Operation{
  49734. ServerResponse: googleapi.ServerResponse{
  49735. Header: res.Header,
  49736. HTTPStatusCode: res.StatusCode,
  49737. },
  49738. }
  49739. target := &ret
  49740. if err := gensupport.DecodeResponse(target, res); err != nil {
  49741. return nil, err
  49742. }
  49743. return ret, nil
  49744. // {
  49745. // "description": "Creates a ExternalVpnGateway in the specified project using the data included in the request.",
  49746. // "httpMethod": "POST",
  49747. // "id": "compute.externalVpnGateways.insert",
  49748. // "parameterOrder": [
  49749. // "project"
  49750. // ],
  49751. // "parameters": {
  49752. // "project": {
  49753. // "description": "Project ID for this request.",
  49754. // "location": "path",
  49755. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49756. // "required": true,
  49757. // "type": "string"
  49758. // },
  49759. // "requestId": {
  49760. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49761. // "location": "query",
  49762. // "type": "string"
  49763. // }
  49764. // },
  49765. // "path": "{project}/global/externalVpnGateways",
  49766. // "request": {
  49767. // "$ref": "ExternalVpnGateway"
  49768. // },
  49769. // "response": {
  49770. // "$ref": "Operation"
  49771. // },
  49772. // "scopes": [
  49773. // "https://www.googleapis.com/auth/cloud-platform",
  49774. // "https://www.googleapis.com/auth/compute"
  49775. // ]
  49776. // }
  49777. }
  49778. // method id "compute.externalVpnGateways.list":
  49779. type ExternalVpnGatewaysListCall struct {
  49780. s *Service
  49781. project string
  49782. urlParams_ gensupport.URLParams
  49783. ifNoneMatch_ string
  49784. ctx_ context.Context
  49785. header_ http.Header
  49786. }
  49787. // List: Retrieves the list of ExternalVpnGateway available to the
  49788. // specified project.
  49789. func (r *ExternalVpnGatewaysService) List(project string) *ExternalVpnGatewaysListCall {
  49790. c := &ExternalVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49791. c.project = project
  49792. return c
  49793. }
  49794. // Filter sets the optional parameter "filter": A filter expression that
  49795. // filters resources listed in the response. The expression must specify
  49796. // the field name, a comparison operator, and the value that you want to
  49797. // use for filtering. The value must be a string, a number, or a
  49798. // boolean. The comparison operator must be either =, !=, >, or <.
  49799. //
  49800. // For example, if you are filtering Compute Engine instances, you can
  49801. // exclude instances named example-instance by specifying name !=
  49802. // example-instance.
  49803. //
  49804. // You can also filter nested fields. For example, you could specify
  49805. // scheduling.automaticRestart = false to include instances only if they
  49806. // are not scheduled for automatic restarts. You can use filtering on
  49807. // nested fields to filter based on resource labels.
  49808. //
  49809. // To filter on multiple expressions, provide each separate expression
  49810. // within parentheses. For example, (scheduling.automaticRestart = true)
  49811. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49812. // AND expression. However, you can include AND and OR expressions
  49813. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49814. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49815. // true).
  49816. func (c *ExternalVpnGatewaysListCall) Filter(filter string) *ExternalVpnGatewaysListCall {
  49817. c.urlParams_.Set("filter", filter)
  49818. return c
  49819. }
  49820. // MaxResults sets the optional parameter "maxResults": The maximum
  49821. // number of results per page that should be returned. If the number of
  49822. // available results is larger than maxResults, Compute Engine returns a
  49823. // nextPageToken that can be used to get the next page of results in
  49824. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49825. // (Default: 500)
  49826. func (c *ExternalVpnGatewaysListCall) MaxResults(maxResults int64) *ExternalVpnGatewaysListCall {
  49827. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49828. return c
  49829. }
  49830. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49831. // a certain order. By default, results are returned in alphanumerical
  49832. // order based on the resource name.
  49833. //
  49834. // You can also sort results in descending order based on the creation
  49835. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49836. // based on the creationTimestamp field in reverse chronological order
  49837. // (newest result first). Use this to sort resources like operations so
  49838. // that the newest operation is returned first.
  49839. //
  49840. // Currently, only sorting by name or creationTimestamp desc is
  49841. // supported.
  49842. func (c *ExternalVpnGatewaysListCall) OrderBy(orderBy string) *ExternalVpnGatewaysListCall {
  49843. c.urlParams_.Set("orderBy", orderBy)
  49844. return c
  49845. }
  49846. // PageToken sets the optional parameter "pageToken": Specifies a page
  49847. // token to use. Set pageToken to the nextPageToken returned by a
  49848. // previous list request to get the next page of results.
  49849. func (c *ExternalVpnGatewaysListCall) PageToken(pageToken string) *ExternalVpnGatewaysListCall {
  49850. c.urlParams_.Set("pageToken", pageToken)
  49851. return c
  49852. }
  49853. // Fields allows partial responses to be retrieved. See
  49854. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49855. // for more information.
  49856. func (c *ExternalVpnGatewaysListCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysListCall {
  49857. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49858. return c
  49859. }
  49860. // IfNoneMatch sets the optional parameter which makes the operation
  49861. // fail if the object's ETag matches the given value. This is useful for
  49862. // getting updates only after the object has changed since the last
  49863. // request. Use googleapi.IsNotModified to check whether the response
  49864. // error from Do is the result of In-None-Match.
  49865. func (c *ExternalVpnGatewaysListCall) IfNoneMatch(entityTag string) *ExternalVpnGatewaysListCall {
  49866. c.ifNoneMatch_ = entityTag
  49867. return c
  49868. }
  49869. // Context sets the context to be used in this call's Do method. Any
  49870. // pending HTTP request will be aborted if the provided context is
  49871. // canceled.
  49872. func (c *ExternalVpnGatewaysListCall) Context(ctx context.Context) *ExternalVpnGatewaysListCall {
  49873. c.ctx_ = ctx
  49874. return c
  49875. }
  49876. // Header returns an http.Header that can be modified by the caller to
  49877. // add HTTP headers to the request.
  49878. func (c *ExternalVpnGatewaysListCall) Header() http.Header {
  49879. if c.header_ == nil {
  49880. c.header_ = make(http.Header)
  49881. }
  49882. return c.header_
  49883. }
  49884. func (c *ExternalVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  49885. reqHeaders := make(http.Header)
  49886. for k, v := range c.header_ {
  49887. reqHeaders[k] = v
  49888. }
  49889. reqHeaders.Set("User-Agent", c.s.userAgent())
  49890. if c.ifNoneMatch_ != "" {
  49891. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49892. }
  49893. var body io.Reader = nil
  49894. c.urlParams_.Set("alt", alt)
  49895. c.urlParams_.Set("prettyPrint", "false")
  49896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways")
  49897. urls += "?" + c.urlParams_.Encode()
  49898. req, err := http.NewRequest("GET", urls, body)
  49899. if err != nil {
  49900. return nil, err
  49901. }
  49902. req.Header = reqHeaders
  49903. googleapi.Expand(req.URL, map[string]string{
  49904. "project": c.project,
  49905. })
  49906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49907. }
  49908. // Do executes the "compute.externalVpnGateways.list" call.
  49909. // Exactly one of *ExternalVpnGatewayList or error will be non-nil. Any
  49910. // non-2xx status code is an error. Response headers are in either
  49911. // *ExternalVpnGatewayList.ServerResponse.Header or (if a response was
  49912. // returned at all) in error.(*googleapi.Error).Header. Use
  49913. // googleapi.IsNotModified to check whether the returned error was
  49914. // because http.StatusNotModified was returned.
  49915. func (c *ExternalVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*ExternalVpnGatewayList, error) {
  49916. gensupport.SetOptions(c.urlParams_, opts...)
  49917. res, err := c.doRequest("json")
  49918. if res != nil && res.StatusCode == http.StatusNotModified {
  49919. if res.Body != nil {
  49920. res.Body.Close()
  49921. }
  49922. return nil, &googleapi.Error{
  49923. Code: res.StatusCode,
  49924. Header: res.Header,
  49925. }
  49926. }
  49927. if err != nil {
  49928. return nil, err
  49929. }
  49930. defer googleapi.CloseBody(res)
  49931. if err := googleapi.CheckResponse(res); err != nil {
  49932. return nil, err
  49933. }
  49934. ret := &ExternalVpnGatewayList{
  49935. ServerResponse: googleapi.ServerResponse{
  49936. Header: res.Header,
  49937. HTTPStatusCode: res.StatusCode,
  49938. },
  49939. }
  49940. target := &ret
  49941. if err := gensupport.DecodeResponse(target, res); err != nil {
  49942. return nil, err
  49943. }
  49944. return ret, nil
  49945. // {
  49946. // "description": "Retrieves the list of ExternalVpnGateway available to the specified project.",
  49947. // "httpMethod": "GET",
  49948. // "id": "compute.externalVpnGateways.list",
  49949. // "parameterOrder": [
  49950. // "project"
  49951. // ],
  49952. // "parameters": {
  49953. // "filter": {
  49954. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  49955. // "location": "query",
  49956. // "type": "string"
  49957. // },
  49958. // "maxResults": {
  49959. // "default": "500",
  49960. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  49961. // "format": "uint32",
  49962. // "location": "query",
  49963. // "minimum": "0",
  49964. // "type": "integer"
  49965. // },
  49966. // "orderBy": {
  49967. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  49968. // "location": "query",
  49969. // "type": "string"
  49970. // },
  49971. // "pageToken": {
  49972. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  49973. // "location": "query",
  49974. // "type": "string"
  49975. // },
  49976. // "project": {
  49977. // "description": "Project ID for this request.",
  49978. // "location": "path",
  49979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49980. // "required": true,
  49981. // "type": "string"
  49982. // }
  49983. // },
  49984. // "path": "{project}/global/externalVpnGateways",
  49985. // "response": {
  49986. // "$ref": "ExternalVpnGatewayList"
  49987. // },
  49988. // "scopes": [
  49989. // "https://www.googleapis.com/auth/cloud-platform",
  49990. // "https://www.googleapis.com/auth/compute",
  49991. // "https://www.googleapis.com/auth/compute.readonly"
  49992. // ]
  49993. // }
  49994. }
  49995. // Pages invokes f for each page of results.
  49996. // A non-nil error returned from f will halt the iteration.
  49997. // The provided context supersedes any context provided to the Context method.
  49998. func (c *ExternalVpnGatewaysListCall) Pages(ctx context.Context, f func(*ExternalVpnGatewayList) error) error {
  49999. c.ctx_ = ctx
  50000. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50001. for {
  50002. x, err := c.Do()
  50003. if err != nil {
  50004. return err
  50005. }
  50006. if err := f(x); err != nil {
  50007. return err
  50008. }
  50009. if x.NextPageToken == "" {
  50010. return nil
  50011. }
  50012. c.PageToken(x.NextPageToken)
  50013. }
  50014. }
  50015. // method id "compute.externalVpnGateways.setLabels":
  50016. type ExternalVpnGatewaysSetLabelsCall struct {
  50017. s *Service
  50018. project string
  50019. resource string
  50020. globalsetlabelsrequest *GlobalSetLabelsRequest
  50021. urlParams_ gensupport.URLParams
  50022. ctx_ context.Context
  50023. header_ http.Header
  50024. }
  50025. // SetLabels: Sets the labels on an ExternalVpnGateway. To learn more
  50026. // about labels, read the Labeling Resources documentation.
  50027. func (r *ExternalVpnGatewaysService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ExternalVpnGatewaysSetLabelsCall {
  50028. c := &ExternalVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50029. c.project = project
  50030. c.resource = resource
  50031. c.globalsetlabelsrequest = globalsetlabelsrequest
  50032. return c
  50033. }
  50034. // Fields allows partial responses to be retrieved. See
  50035. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50036. // for more information.
  50037. func (c *ExternalVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysSetLabelsCall {
  50038. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50039. return c
  50040. }
  50041. // Context sets the context to be used in this call's Do method. Any
  50042. // pending HTTP request will be aborted if the provided context is
  50043. // canceled.
  50044. func (c *ExternalVpnGatewaysSetLabelsCall) Context(ctx context.Context) *ExternalVpnGatewaysSetLabelsCall {
  50045. c.ctx_ = ctx
  50046. return c
  50047. }
  50048. // Header returns an http.Header that can be modified by the caller to
  50049. // add HTTP headers to the request.
  50050. func (c *ExternalVpnGatewaysSetLabelsCall) Header() http.Header {
  50051. if c.header_ == nil {
  50052. c.header_ = make(http.Header)
  50053. }
  50054. return c.header_
  50055. }
  50056. func (c *ExternalVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  50057. reqHeaders := make(http.Header)
  50058. for k, v := range c.header_ {
  50059. reqHeaders[k] = v
  50060. }
  50061. reqHeaders.Set("User-Agent", c.s.userAgent())
  50062. var body io.Reader = nil
  50063. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  50064. if err != nil {
  50065. return nil, err
  50066. }
  50067. reqHeaders.Set("Content-Type", "application/json")
  50068. c.urlParams_.Set("alt", alt)
  50069. c.urlParams_.Set("prettyPrint", "false")
  50070. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{resource}/setLabels")
  50071. urls += "?" + c.urlParams_.Encode()
  50072. req, err := http.NewRequest("POST", urls, body)
  50073. if err != nil {
  50074. return nil, err
  50075. }
  50076. req.Header = reqHeaders
  50077. googleapi.Expand(req.URL, map[string]string{
  50078. "project": c.project,
  50079. "resource": c.resource,
  50080. })
  50081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50082. }
  50083. // Do executes the "compute.externalVpnGateways.setLabels" call.
  50084. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50085. // status code is an error. Response headers are in either
  50086. // *Operation.ServerResponse.Header or (if a response was returned at
  50087. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50088. // to check whether the returned error was because
  50089. // http.StatusNotModified was returned.
  50090. func (c *ExternalVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50091. gensupport.SetOptions(c.urlParams_, opts...)
  50092. res, err := c.doRequest("json")
  50093. if res != nil && res.StatusCode == http.StatusNotModified {
  50094. if res.Body != nil {
  50095. res.Body.Close()
  50096. }
  50097. return nil, &googleapi.Error{
  50098. Code: res.StatusCode,
  50099. Header: res.Header,
  50100. }
  50101. }
  50102. if err != nil {
  50103. return nil, err
  50104. }
  50105. defer googleapi.CloseBody(res)
  50106. if err := googleapi.CheckResponse(res); err != nil {
  50107. return nil, err
  50108. }
  50109. ret := &Operation{
  50110. ServerResponse: googleapi.ServerResponse{
  50111. Header: res.Header,
  50112. HTTPStatusCode: res.StatusCode,
  50113. },
  50114. }
  50115. target := &ret
  50116. if err := gensupport.DecodeResponse(target, res); err != nil {
  50117. return nil, err
  50118. }
  50119. return ret, nil
  50120. // {
  50121. // "description": "Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  50122. // "httpMethod": "POST",
  50123. // "id": "compute.externalVpnGateways.setLabels",
  50124. // "parameterOrder": [
  50125. // "project",
  50126. // "resource"
  50127. // ],
  50128. // "parameters": {
  50129. // "project": {
  50130. // "description": "Project ID for this request.",
  50131. // "location": "path",
  50132. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50133. // "required": true,
  50134. // "type": "string"
  50135. // },
  50136. // "resource": {
  50137. // "description": "Name or id of the resource for this request.",
  50138. // "location": "path",
  50139. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50140. // "required": true,
  50141. // "type": "string"
  50142. // }
  50143. // },
  50144. // "path": "{project}/global/externalVpnGateways/{resource}/setLabels",
  50145. // "request": {
  50146. // "$ref": "GlobalSetLabelsRequest"
  50147. // },
  50148. // "response": {
  50149. // "$ref": "Operation"
  50150. // },
  50151. // "scopes": [
  50152. // "https://www.googleapis.com/auth/cloud-platform",
  50153. // "https://www.googleapis.com/auth/compute"
  50154. // ]
  50155. // }
  50156. }
  50157. // method id "compute.externalVpnGateways.testIamPermissions":
  50158. type ExternalVpnGatewaysTestIamPermissionsCall struct {
  50159. s *Service
  50160. project string
  50161. resource string
  50162. testpermissionsrequest *TestPermissionsRequest
  50163. urlParams_ gensupport.URLParams
  50164. ctx_ context.Context
  50165. header_ http.Header
  50166. }
  50167. // TestIamPermissions: Returns permissions that a caller has on the
  50168. // specified resource.
  50169. func (r *ExternalVpnGatewaysService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ExternalVpnGatewaysTestIamPermissionsCall {
  50170. c := &ExternalVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50171. c.project = project
  50172. c.resource = resource
  50173. c.testpermissionsrequest = testpermissionsrequest
  50174. return c
  50175. }
  50176. // Fields allows partial responses to be retrieved. See
  50177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50178. // for more information.
  50179. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *ExternalVpnGatewaysTestIamPermissionsCall {
  50180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50181. return c
  50182. }
  50183. // Context sets the context to be used in this call's Do method. Any
  50184. // pending HTTP request will be aborted if the provided context is
  50185. // canceled.
  50186. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *ExternalVpnGatewaysTestIamPermissionsCall {
  50187. c.ctx_ = ctx
  50188. return c
  50189. }
  50190. // Header returns an http.Header that can be modified by the caller to
  50191. // add HTTP headers to the request.
  50192. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  50193. if c.header_ == nil {
  50194. c.header_ = make(http.Header)
  50195. }
  50196. return c.header_
  50197. }
  50198. func (c *ExternalVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50199. reqHeaders := make(http.Header)
  50200. for k, v := range c.header_ {
  50201. reqHeaders[k] = v
  50202. }
  50203. reqHeaders.Set("User-Agent", c.s.userAgent())
  50204. var body io.Reader = nil
  50205. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50206. if err != nil {
  50207. return nil, err
  50208. }
  50209. reqHeaders.Set("Content-Type", "application/json")
  50210. c.urlParams_.Set("alt", alt)
  50211. c.urlParams_.Set("prettyPrint", "false")
  50212. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/externalVpnGateways/{resource}/testIamPermissions")
  50213. urls += "?" + c.urlParams_.Encode()
  50214. req, err := http.NewRequest("POST", urls, body)
  50215. if err != nil {
  50216. return nil, err
  50217. }
  50218. req.Header = reqHeaders
  50219. googleapi.Expand(req.URL, map[string]string{
  50220. "project": c.project,
  50221. "resource": c.resource,
  50222. })
  50223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50224. }
  50225. // Do executes the "compute.externalVpnGateways.testIamPermissions" call.
  50226. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50227. // non-2xx status code is an error. Response headers are in either
  50228. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50229. // returned at all) in error.(*googleapi.Error).Header. Use
  50230. // googleapi.IsNotModified to check whether the returned error was
  50231. // because http.StatusNotModified was returned.
  50232. func (c *ExternalVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50233. gensupport.SetOptions(c.urlParams_, opts...)
  50234. res, err := c.doRequest("json")
  50235. if res != nil && res.StatusCode == http.StatusNotModified {
  50236. if res.Body != nil {
  50237. res.Body.Close()
  50238. }
  50239. return nil, &googleapi.Error{
  50240. Code: res.StatusCode,
  50241. Header: res.Header,
  50242. }
  50243. }
  50244. if err != nil {
  50245. return nil, err
  50246. }
  50247. defer googleapi.CloseBody(res)
  50248. if err := googleapi.CheckResponse(res); err != nil {
  50249. return nil, err
  50250. }
  50251. ret := &TestPermissionsResponse{
  50252. ServerResponse: googleapi.ServerResponse{
  50253. Header: res.Header,
  50254. HTTPStatusCode: res.StatusCode,
  50255. },
  50256. }
  50257. target := &ret
  50258. if err := gensupport.DecodeResponse(target, res); err != nil {
  50259. return nil, err
  50260. }
  50261. return ret, nil
  50262. // {
  50263. // "description": "Returns permissions that a caller has on the specified resource.",
  50264. // "httpMethod": "POST",
  50265. // "id": "compute.externalVpnGateways.testIamPermissions",
  50266. // "parameterOrder": [
  50267. // "project",
  50268. // "resource"
  50269. // ],
  50270. // "parameters": {
  50271. // "project": {
  50272. // "description": "Project ID for this request.",
  50273. // "location": "path",
  50274. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50275. // "required": true,
  50276. // "type": "string"
  50277. // },
  50278. // "resource": {
  50279. // "description": "Name or id of the resource for this request.",
  50280. // "location": "path",
  50281. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50282. // "required": true,
  50283. // "type": "string"
  50284. // }
  50285. // },
  50286. // "path": "{project}/global/externalVpnGateways/{resource}/testIamPermissions",
  50287. // "request": {
  50288. // "$ref": "TestPermissionsRequest"
  50289. // },
  50290. // "response": {
  50291. // "$ref": "TestPermissionsResponse"
  50292. // },
  50293. // "scopes": [
  50294. // "https://www.googleapis.com/auth/cloud-platform",
  50295. // "https://www.googleapis.com/auth/compute",
  50296. // "https://www.googleapis.com/auth/compute.readonly"
  50297. // ]
  50298. // }
  50299. }
  50300. // method id "compute.firewalls.delete":
  50301. type FirewallsDeleteCall struct {
  50302. s *Service
  50303. project string
  50304. firewall string
  50305. urlParams_ gensupport.URLParams
  50306. ctx_ context.Context
  50307. header_ http.Header
  50308. }
  50309. // Delete: Deletes the specified firewall.
  50310. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  50311. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  50312. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50313. c.project = project
  50314. c.firewall = firewall
  50315. return c
  50316. }
  50317. // RequestId sets the optional parameter "requestId": An optional
  50318. // request ID to identify requests. Specify a unique request ID so that
  50319. // if you must retry your request, the server will know to ignore the
  50320. // request if it has already been completed.
  50321. //
  50322. // For example, consider a situation where you make an initial request
  50323. // and the request times out. If you make the request again with the
  50324. // same request ID, the server can check if original operation with the
  50325. // same request ID was received, and if so, will ignore the second
  50326. // request. This prevents clients from accidentally creating duplicate
  50327. // commitments.
  50328. //
  50329. // The request ID must be a valid UUID with the exception that zero UUID
  50330. // is not supported (00000000-0000-0000-0000-000000000000).
  50331. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  50332. c.urlParams_.Set("requestId", requestId)
  50333. return c
  50334. }
  50335. // Fields allows partial responses to be retrieved. See
  50336. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50337. // for more information.
  50338. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  50339. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50340. return c
  50341. }
  50342. // Context sets the context to be used in this call's Do method. Any
  50343. // pending HTTP request will be aborted if the provided context is
  50344. // canceled.
  50345. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  50346. c.ctx_ = ctx
  50347. return c
  50348. }
  50349. // Header returns an http.Header that can be modified by the caller to
  50350. // add HTTP headers to the request.
  50351. func (c *FirewallsDeleteCall) Header() http.Header {
  50352. if c.header_ == nil {
  50353. c.header_ = make(http.Header)
  50354. }
  50355. return c.header_
  50356. }
  50357. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  50358. reqHeaders := make(http.Header)
  50359. for k, v := range c.header_ {
  50360. reqHeaders[k] = v
  50361. }
  50362. reqHeaders.Set("User-Agent", c.s.userAgent())
  50363. var body io.Reader = nil
  50364. c.urlParams_.Set("alt", alt)
  50365. c.urlParams_.Set("prettyPrint", "false")
  50366. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  50367. urls += "?" + c.urlParams_.Encode()
  50368. req, err := http.NewRequest("DELETE", urls, body)
  50369. if err != nil {
  50370. return nil, err
  50371. }
  50372. req.Header = reqHeaders
  50373. googleapi.Expand(req.URL, map[string]string{
  50374. "project": c.project,
  50375. "firewall": c.firewall,
  50376. })
  50377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50378. }
  50379. // Do executes the "compute.firewalls.delete" call.
  50380. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50381. // status code is an error. Response headers are in either
  50382. // *Operation.ServerResponse.Header or (if a response was returned at
  50383. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50384. // to check whether the returned error was because
  50385. // http.StatusNotModified was returned.
  50386. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50387. gensupport.SetOptions(c.urlParams_, opts...)
  50388. res, err := c.doRequest("json")
  50389. if res != nil && res.StatusCode == http.StatusNotModified {
  50390. if res.Body != nil {
  50391. res.Body.Close()
  50392. }
  50393. return nil, &googleapi.Error{
  50394. Code: res.StatusCode,
  50395. Header: res.Header,
  50396. }
  50397. }
  50398. if err != nil {
  50399. return nil, err
  50400. }
  50401. defer googleapi.CloseBody(res)
  50402. if err := googleapi.CheckResponse(res); err != nil {
  50403. return nil, err
  50404. }
  50405. ret := &Operation{
  50406. ServerResponse: googleapi.ServerResponse{
  50407. Header: res.Header,
  50408. HTTPStatusCode: res.StatusCode,
  50409. },
  50410. }
  50411. target := &ret
  50412. if err := gensupport.DecodeResponse(target, res); err != nil {
  50413. return nil, err
  50414. }
  50415. return ret, nil
  50416. // {
  50417. // "description": "Deletes the specified firewall.",
  50418. // "httpMethod": "DELETE",
  50419. // "id": "compute.firewalls.delete",
  50420. // "parameterOrder": [
  50421. // "project",
  50422. // "firewall"
  50423. // ],
  50424. // "parameters": {
  50425. // "firewall": {
  50426. // "description": "Name of the firewall rule to delete.",
  50427. // "location": "path",
  50428. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50429. // "required": true,
  50430. // "type": "string"
  50431. // },
  50432. // "project": {
  50433. // "description": "Project ID for this request.",
  50434. // "location": "path",
  50435. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50436. // "required": true,
  50437. // "type": "string"
  50438. // },
  50439. // "requestId": {
  50440. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50441. // "location": "query",
  50442. // "type": "string"
  50443. // }
  50444. // },
  50445. // "path": "{project}/global/firewalls/{firewall}",
  50446. // "response": {
  50447. // "$ref": "Operation"
  50448. // },
  50449. // "scopes": [
  50450. // "https://www.googleapis.com/auth/cloud-platform",
  50451. // "https://www.googleapis.com/auth/compute"
  50452. // ]
  50453. // }
  50454. }
  50455. // method id "compute.firewalls.get":
  50456. type FirewallsGetCall struct {
  50457. s *Service
  50458. project string
  50459. firewall string
  50460. urlParams_ gensupport.URLParams
  50461. ifNoneMatch_ string
  50462. ctx_ context.Context
  50463. header_ http.Header
  50464. }
  50465. // Get: Returns the specified firewall.
  50466. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  50467. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  50468. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50469. c.project = project
  50470. c.firewall = firewall
  50471. return c
  50472. }
  50473. // Fields allows partial responses to be retrieved. See
  50474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50475. // for more information.
  50476. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  50477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50478. return c
  50479. }
  50480. // IfNoneMatch sets the optional parameter which makes the operation
  50481. // fail if the object's ETag matches the given value. This is useful for
  50482. // getting updates only after the object has changed since the last
  50483. // request. Use googleapi.IsNotModified to check whether the response
  50484. // error from Do is the result of In-None-Match.
  50485. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  50486. c.ifNoneMatch_ = entityTag
  50487. return c
  50488. }
  50489. // Context sets the context to be used in this call's Do method. Any
  50490. // pending HTTP request will be aborted if the provided context is
  50491. // canceled.
  50492. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  50493. c.ctx_ = ctx
  50494. return c
  50495. }
  50496. // Header returns an http.Header that can be modified by the caller to
  50497. // add HTTP headers to the request.
  50498. func (c *FirewallsGetCall) Header() http.Header {
  50499. if c.header_ == nil {
  50500. c.header_ = make(http.Header)
  50501. }
  50502. return c.header_
  50503. }
  50504. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  50505. reqHeaders := make(http.Header)
  50506. for k, v := range c.header_ {
  50507. reqHeaders[k] = v
  50508. }
  50509. reqHeaders.Set("User-Agent", c.s.userAgent())
  50510. if c.ifNoneMatch_ != "" {
  50511. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50512. }
  50513. var body io.Reader = nil
  50514. c.urlParams_.Set("alt", alt)
  50515. c.urlParams_.Set("prettyPrint", "false")
  50516. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  50517. urls += "?" + c.urlParams_.Encode()
  50518. req, err := http.NewRequest("GET", urls, body)
  50519. if err != nil {
  50520. return nil, err
  50521. }
  50522. req.Header = reqHeaders
  50523. googleapi.Expand(req.URL, map[string]string{
  50524. "project": c.project,
  50525. "firewall": c.firewall,
  50526. })
  50527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50528. }
  50529. // Do executes the "compute.firewalls.get" call.
  50530. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  50531. // code is an error. Response headers are in either
  50532. // *Firewall.ServerResponse.Header or (if a response was returned at
  50533. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50534. // to check whether the returned error was because
  50535. // http.StatusNotModified was returned.
  50536. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  50537. gensupport.SetOptions(c.urlParams_, opts...)
  50538. res, err := c.doRequest("json")
  50539. if res != nil && res.StatusCode == http.StatusNotModified {
  50540. if res.Body != nil {
  50541. res.Body.Close()
  50542. }
  50543. return nil, &googleapi.Error{
  50544. Code: res.StatusCode,
  50545. Header: res.Header,
  50546. }
  50547. }
  50548. if err != nil {
  50549. return nil, err
  50550. }
  50551. defer googleapi.CloseBody(res)
  50552. if err := googleapi.CheckResponse(res); err != nil {
  50553. return nil, err
  50554. }
  50555. ret := &Firewall{
  50556. ServerResponse: googleapi.ServerResponse{
  50557. Header: res.Header,
  50558. HTTPStatusCode: res.StatusCode,
  50559. },
  50560. }
  50561. target := &ret
  50562. if err := gensupport.DecodeResponse(target, res); err != nil {
  50563. return nil, err
  50564. }
  50565. return ret, nil
  50566. // {
  50567. // "description": "Returns the specified firewall.",
  50568. // "httpMethod": "GET",
  50569. // "id": "compute.firewalls.get",
  50570. // "parameterOrder": [
  50571. // "project",
  50572. // "firewall"
  50573. // ],
  50574. // "parameters": {
  50575. // "firewall": {
  50576. // "description": "Name of the firewall rule to return.",
  50577. // "location": "path",
  50578. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50579. // "required": true,
  50580. // "type": "string"
  50581. // },
  50582. // "project": {
  50583. // "description": "Project ID for this request.",
  50584. // "location": "path",
  50585. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50586. // "required": true,
  50587. // "type": "string"
  50588. // }
  50589. // },
  50590. // "path": "{project}/global/firewalls/{firewall}",
  50591. // "response": {
  50592. // "$ref": "Firewall"
  50593. // },
  50594. // "scopes": [
  50595. // "https://www.googleapis.com/auth/cloud-platform",
  50596. // "https://www.googleapis.com/auth/compute",
  50597. // "https://www.googleapis.com/auth/compute.readonly"
  50598. // ]
  50599. // }
  50600. }
  50601. // method id "compute.firewalls.insert":
  50602. type FirewallsInsertCall struct {
  50603. s *Service
  50604. project string
  50605. firewall *Firewall
  50606. urlParams_ gensupport.URLParams
  50607. ctx_ context.Context
  50608. header_ http.Header
  50609. }
  50610. // Insert: Creates a firewall rule in the specified project using the
  50611. // data included in the request.
  50612. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  50613. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  50614. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50615. c.project = project
  50616. c.firewall = firewall
  50617. return c
  50618. }
  50619. // RequestId sets the optional parameter "requestId": An optional
  50620. // request ID to identify requests. Specify a unique request ID so that
  50621. // if you must retry your request, the server will know to ignore the
  50622. // request if it has already been completed.
  50623. //
  50624. // For example, consider a situation where you make an initial request
  50625. // and the request times out. If you make the request again with the
  50626. // same request ID, the server can check if original operation with the
  50627. // same request ID was received, and if so, will ignore the second
  50628. // request. This prevents clients from accidentally creating duplicate
  50629. // commitments.
  50630. //
  50631. // The request ID must be a valid UUID with the exception that zero UUID
  50632. // is not supported (00000000-0000-0000-0000-000000000000).
  50633. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  50634. c.urlParams_.Set("requestId", requestId)
  50635. return c
  50636. }
  50637. // Fields allows partial responses to be retrieved. See
  50638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50639. // for more information.
  50640. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  50641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50642. return c
  50643. }
  50644. // Context sets the context to be used in this call's Do method. Any
  50645. // pending HTTP request will be aborted if the provided context is
  50646. // canceled.
  50647. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  50648. c.ctx_ = ctx
  50649. return c
  50650. }
  50651. // Header returns an http.Header that can be modified by the caller to
  50652. // add HTTP headers to the request.
  50653. func (c *FirewallsInsertCall) Header() http.Header {
  50654. if c.header_ == nil {
  50655. c.header_ = make(http.Header)
  50656. }
  50657. return c.header_
  50658. }
  50659. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  50660. reqHeaders := make(http.Header)
  50661. for k, v := range c.header_ {
  50662. reqHeaders[k] = v
  50663. }
  50664. reqHeaders.Set("User-Agent", c.s.userAgent())
  50665. var body io.Reader = nil
  50666. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  50667. if err != nil {
  50668. return nil, err
  50669. }
  50670. reqHeaders.Set("Content-Type", "application/json")
  50671. c.urlParams_.Set("alt", alt)
  50672. c.urlParams_.Set("prettyPrint", "false")
  50673. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  50674. urls += "?" + c.urlParams_.Encode()
  50675. req, err := http.NewRequest("POST", urls, body)
  50676. if err != nil {
  50677. return nil, err
  50678. }
  50679. req.Header = reqHeaders
  50680. googleapi.Expand(req.URL, map[string]string{
  50681. "project": c.project,
  50682. })
  50683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50684. }
  50685. // Do executes the "compute.firewalls.insert" call.
  50686. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50687. // status code is an error. Response headers are in either
  50688. // *Operation.ServerResponse.Header or (if a response was returned at
  50689. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50690. // to check whether the returned error was because
  50691. // http.StatusNotModified was returned.
  50692. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50693. gensupport.SetOptions(c.urlParams_, opts...)
  50694. res, err := c.doRequest("json")
  50695. if res != nil && res.StatusCode == http.StatusNotModified {
  50696. if res.Body != nil {
  50697. res.Body.Close()
  50698. }
  50699. return nil, &googleapi.Error{
  50700. Code: res.StatusCode,
  50701. Header: res.Header,
  50702. }
  50703. }
  50704. if err != nil {
  50705. return nil, err
  50706. }
  50707. defer googleapi.CloseBody(res)
  50708. if err := googleapi.CheckResponse(res); err != nil {
  50709. return nil, err
  50710. }
  50711. ret := &Operation{
  50712. ServerResponse: googleapi.ServerResponse{
  50713. Header: res.Header,
  50714. HTTPStatusCode: res.StatusCode,
  50715. },
  50716. }
  50717. target := &ret
  50718. if err := gensupport.DecodeResponse(target, res); err != nil {
  50719. return nil, err
  50720. }
  50721. return ret, nil
  50722. // {
  50723. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  50724. // "httpMethod": "POST",
  50725. // "id": "compute.firewalls.insert",
  50726. // "parameterOrder": [
  50727. // "project"
  50728. // ],
  50729. // "parameters": {
  50730. // "project": {
  50731. // "description": "Project ID for this request.",
  50732. // "location": "path",
  50733. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50734. // "required": true,
  50735. // "type": "string"
  50736. // },
  50737. // "requestId": {
  50738. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50739. // "location": "query",
  50740. // "type": "string"
  50741. // }
  50742. // },
  50743. // "path": "{project}/global/firewalls",
  50744. // "request": {
  50745. // "$ref": "Firewall"
  50746. // },
  50747. // "response": {
  50748. // "$ref": "Operation"
  50749. // },
  50750. // "scopes": [
  50751. // "https://www.googleapis.com/auth/cloud-platform",
  50752. // "https://www.googleapis.com/auth/compute"
  50753. // ]
  50754. // }
  50755. }
  50756. // method id "compute.firewalls.list":
  50757. type FirewallsListCall struct {
  50758. s *Service
  50759. project string
  50760. urlParams_ gensupport.URLParams
  50761. ifNoneMatch_ string
  50762. ctx_ context.Context
  50763. header_ http.Header
  50764. }
  50765. // List: Retrieves the list of firewall rules available to the specified
  50766. // project.
  50767. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  50768. func (r *FirewallsService) List(project string) *FirewallsListCall {
  50769. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50770. c.project = project
  50771. return c
  50772. }
  50773. // Filter sets the optional parameter "filter": A filter expression that
  50774. // filters resources listed in the response. The expression must specify
  50775. // the field name, a comparison operator, and the value that you want to
  50776. // use for filtering. The value must be a string, a number, or a
  50777. // boolean. The comparison operator must be either =, !=, >, or <.
  50778. //
  50779. // For example, if you are filtering Compute Engine instances, you can
  50780. // exclude instances named example-instance by specifying name !=
  50781. // example-instance.
  50782. //
  50783. // You can also filter nested fields. For example, you could specify
  50784. // scheduling.automaticRestart = false to include instances only if they
  50785. // are not scheduled for automatic restarts. You can use filtering on
  50786. // nested fields to filter based on resource labels.
  50787. //
  50788. // To filter on multiple expressions, provide each separate expression
  50789. // within parentheses. For example, (scheduling.automaticRestart = true)
  50790. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50791. // AND expression. However, you can include AND and OR expressions
  50792. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50793. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50794. // true).
  50795. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  50796. c.urlParams_.Set("filter", filter)
  50797. return c
  50798. }
  50799. // MaxResults sets the optional parameter "maxResults": The maximum
  50800. // number of results per page that should be returned. If the number of
  50801. // available results is larger than maxResults, Compute Engine returns a
  50802. // nextPageToken that can be used to get the next page of results in
  50803. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50804. // (Default: 500)
  50805. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  50806. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50807. return c
  50808. }
  50809. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50810. // a certain order. By default, results are returned in alphanumerical
  50811. // order based on the resource name.
  50812. //
  50813. // You can also sort results in descending order based on the creation
  50814. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50815. // based on the creationTimestamp field in reverse chronological order
  50816. // (newest result first). Use this to sort resources like operations so
  50817. // that the newest operation is returned first.
  50818. //
  50819. // Currently, only sorting by name or creationTimestamp desc is
  50820. // supported.
  50821. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  50822. c.urlParams_.Set("orderBy", orderBy)
  50823. return c
  50824. }
  50825. // PageToken sets the optional parameter "pageToken": Specifies a page
  50826. // token to use. Set pageToken to the nextPageToken returned by a
  50827. // previous list request to get the next page of results.
  50828. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  50829. c.urlParams_.Set("pageToken", pageToken)
  50830. return c
  50831. }
  50832. // Fields allows partial responses to be retrieved. See
  50833. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50834. // for more information.
  50835. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  50836. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50837. return c
  50838. }
  50839. // IfNoneMatch sets the optional parameter which makes the operation
  50840. // fail if the object's ETag matches the given value. This is useful for
  50841. // getting updates only after the object has changed since the last
  50842. // request. Use googleapi.IsNotModified to check whether the response
  50843. // error from Do is the result of In-None-Match.
  50844. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  50845. c.ifNoneMatch_ = entityTag
  50846. return c
  50847. }
  50848. // Context sets the context to be used in this call's Do method. Any
  50849. // pending HTTP request will be aborted if the provided context is
  50850. // canceled.
  50851. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  50852. c.ctx_ = ctx
  50853. return c
  50854. }
  50855. // Header returns an http.Header that can be modified by the caller to
  50856. // add HTTP headers to the request.
  50857. func (c *FirewallsListCall) Header() http.Header {
  50858. if c.header_ == nil {
  50859. c.header_ = make(http.Header)
  50860. }
  50861. return c.header_
  50862. }
  50863. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  50864. reqHeaders := make(http.Header)
  50865. for k, v := range c.header_ {
  50866. reqHeaders[k] = v
  50867. }
  50868. reqHeaders.Set("User-Agent", c.s.userAgent())
  50869. if c.ifNoneMatch_ != "" {
  50870. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50871. }
  50872. var body io.Reader = nil
  50873. c.urlParams_.Set("alt", alt)
  50874. c.urlParams_.Set("prettyPrint", "false")
  50875. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  50876. urls += "?" + c.urlParams_.Encode()
  50877. req, err := http.NewRequest("GET", urls, body)
  50878. if err != nil {
  50879. return nil, err
  50880. }
  50881. req.Header = reqHeaders
  50882. googleapi.Expand(req.URL, map[string]string{
  50883. "project": c.project,
  50884. })
  50885. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50886. }
  50887. // Do executes the "compute.firewalls.list" call.
  50888. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  50889. // status code is an error. Response headers are in either
  50890. // *FirewallList.ServerResponse.Header or (if a response was returned at
  50891. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50892. // to check whether the returned error was because
  50893. // http.StatusNotModified was returned.
  50894. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  50895. gensupport.SetOptions(c.urlParams_, opts...)
  50896. res, err := c.doRequest("json")
  50897. if res != nil && res.StatusCode == http.StatusNotModified {
  50898. if res.Body != nil {
  50899. res.Body.Close()
  50900. }
  50901. return nil, &googleapi.Error{
  50902. Code: res.StatusCode,
  50903. Header: res.Header,
  50904. }
  50905. }
  50906. if err != nil {
  50907. return nil, err
  50908. }
  50909. defer googleapi.CloseBody(res)
  50910. if err := googleapi.CheckResponse(res); err != nil {
  50911. return nil, err
  50912. }
  50913. ret := &FirewallList{
  50914. ServerResponse: googleapi.ServerResponse{
  50915. Header: res.Header,
  50916. HTTPStatusCode: res.StatusCode,
  50917. },
  50918. }
  50919. target := &ret
  50920. if err := gensupport.DecodeResponse(target, res); err != nil {
  50921. return nil, err
  50922. }
  50923. return ret, nil
  50924. // {
  50925. // "description": "Retrieves the list of firewall rules available to the specified project.",
  50926. // "httpMethod": "GET",
  50927. // "id": "compute.firewalls.list",
  50928. // "parameterOrder": [
  50929. // "project"
  50930. // ],
  50931. // "parameters": {
  50932. // "filter": {
  50933. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  50934. // "location": "query",
  50935. // "type": "string"
  50936. // },
  50937. // "maxResults": {
  50938. // "default": "500",
  50939. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50940. // "format": "uint32",
  50941. // "location": "query",
  50942. // "minimum": "0",
  50943. // "type": "integer"
  50944. // },
  50945. // "orderBy": {
  50946. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50947. // "location": "query",
  50948. // "type": "string"
  50949. // },
  50950. // "pageToken": {
  50951. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50952. // "location": "query",
  50953. // "type": "string"
  50954. // },
  50955. // "project": {
  50956. // "description": "Project ID for this request.",
  50957. // "location": "path",
  50958. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50959. // "required": true,
  50960. // "type": "string"
  50961. // }
  50962. // },
  50963. // "path": "{project}/global/firewalls",
  50964. // "response": {
  50965. // "$ref": "FirewallList"
  50966. // },
  50967. // "scopes": [
  50968. // "https://www.googleapis.com/auth/cloud-platform",
  50969. // "https://www.googleapis.com/auth/compute",
  50970. // "https://www.googleapis.com/auth/compute.readonly"
  50971. // ]
  50972. // }
  50973. }
  50974. // Pages invokes f for each page of results.
  50975. // A non-nil error returned from f will halt the iteration.
  50976. // The provided context supersedes any context provided to the Context method.
  50977. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  50978. c.ctx_ = ctx
  50979. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50980. for {
  50981. x, err := c.Do()
  50982. if err != nil {
  50983. return err
  50984. }
  50985. if err := f(x); err != nil {
  50986. return err
  50987. }
  50988. if x.NextPageToken == "" {
  50989. return nil
  50990. }
  50991. c.PageToken(x.NextPageToken)
  50992. }
  50993. }
  50994. // method id "compute.firewalls.patch":
  50995. type FirewallsPatchCall struct {
  50996. s *Service
  50997. project string
  50998. firewall string
  50999. firewall2 *Firewall
  51000. urlParams_ gensupport.URLParams
  51001. ctx_ context.Context
  51002. header_ http.Header
  51003. }
  51004. // Patch: Updates the specified firewall rule with the data included in
  51005. // the request. This method supports PATCH semantics and uses the JSON
  51006. // merge patch format and processing rules.
  51007. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  51008. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  51009. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51010. c.project = project
  51011. c.firewall = firewall
  51012. c.firewall2 = firewall2
  51013. return c
  51014. }
  51015. // RequestId sets the optional parameter "requestId": An optional
  51016. // request ID to identify requests. Specify a unique request ID so that
  51017. // if you must retry your request, the server will know to ignore the
  51018. // request if it has already been completed.
  51019. //
  51020. // For example, consider a situation where you make an initial request
  51021. // and the request times out. If you make the request again with the
  51022. // same request ID, the server can check if original operation with the
  51023. // same request ID was received, and if so, will ignore the second
  51024. // request. This prevents clients from accidentally creating duplicate
  51025. // commitments.
  51026. //
  51027. // The request ID must be a valid UUID with the exception that zero UUID
  51028. // is not supported (00000000-0000-0000-0000-000000000000).
  51029. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  51030. c.urlParams_.Set("requestId", requestId)
  51031. return c
  51032. }
  51033. // Fields allows partial responses to be retrieved. See
  51034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51035. // for more information.
  51036. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  51037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51038. return c
  51039. }
  51040. // Context sets the context to be used in this call's Do method. Any
  51041. // pending HTTP request will be aborted if the provided context is
  51042. // canceled.
  51043. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  51044. c.ctx_ = ctx
  51045. return c
  51046. }
  51047. // Header returns an http.Header that can be modified by the caller to
  51048. // add HTTP headers to the request.
  51049. func (c *FirewallsPatchCall) Header() http.Header {
  51050. if c.header_ == nil {
  51051. c.header_ = make(http.Header)
  51052. }
  51053. return c.header_
  51054. }
  51055. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  51056. reqHeaders := make(http.Header)
  51057. for k, v := range c.header_ {
  51058. reqHeaders[k] = v
  51059. }
  51060. reqHeaders.Set("User-Agent", c.s.userAgent())
  51061. var body io.Reader = nil
  51062. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  51063. if err != nil {
  51064. return nil, err
  51065. }
  51066. reqHeaders.Set("Content-Type", "application/json")
  51067. c.urlParams_.Set("alt", alt)
  51068. c.urlParams_.Set("prettyPrint", "false")
  51069. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  51070. urls += "?" + c.urlParams_.Encode()
  51071. req, err := http.NewRequest("PATCH", urls, body)
  51072. if err != nil {
  51073. return nil, err
  51074. }
  51075. req.Header = reqHeaders
  51076. googleapi.Expand(req.URL, map[string]string{
  51077. "project": c.project,
  51078. "firewall": c.firewall,
  51079. })
  51080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51081. }
  51082. // Do executes the "compute.firewalls.patch" call.
  51083. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51084. // status code is an error. Response headers are in either
  51085. // *Operation.ServerResponse.Header or (if a response was returned at
  51086. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51087. // to check whether the returned error was because
  51088. // http.StatusNotModified was returned.
  51089. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51090. gensupport.SetOptions(c.urlParams_, opts...)
  51091. res, err := c.doRequest("json")
  51092. if res != nil && res.StatusCode == http.StatusNotModified {
  51093. if res.Body != nil {
  51094. res.Body.Close()
  51095. }
  51096. return nil, &googleapi.Error{
  51097. Code: res.StatusCode,
  51098. Header: res.Header,
  51099. }
  51100. }
  51101. if err != nil {
  51102. return nil, err
  51103. }
  51104. defer googleapi.CloseBody(res)
  51105. if err := googleapi.CheckResponse(res); err != nil {
  51106. return nil, err
  51107. }
  51108. ret := &Operation{
  51109. ServerResponse: googleapi.ServerResponse{
  51110. Header: res.Header,
  51111. HTTPStatusCode: res.StatusCode,
  51112. },
  51113. }
  51114. target := &ret
  51115. if err := gensupport.DecodeResponse(target, res); err != nil {
  51116. return nil, err
  51117. }
  51118. return ret, nil
  51119. // {
  51120. // "description": "Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  51121. // "httpMethod": "PATCH",
  51122. // "id": "compute.firewalls.patch",
  51123. // "parameterOrder": [
  51124. // "project",
  51125. // "firewall"
  51126. // ],
  51127. // "parameters": {
  51128. // "firewall": {
  51129. // "description": "Name of the firewall rule to patch.",
  51130. // "location": "path",
  51131. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51132. // "required": true,
  51133. // "type": "string"
  51134. // },
  51135. // "project": {
  51136. // "description": "Project ID for this request.",
  51137. // "location": "path",
  51138. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51139. // "required": true,
  51140. // "type": "string"
  51141. // },
  51142. // "requestId": {
  51143. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51144. // "location": "query",
  51145. // "type": "string"
  51146. // }
  51147. // },
  51148. // "path": "{project}/global/firewalls/{firewall}",
  51149. // "request": {
  51150. // "$ref": "Firewall"
  51151. // },
  51152. // "response": {
  51153. // "$ref": "Operation"
  51154. // },
  51155. // "scopes": [
  51156. // "https://www.googleapis.com/auth/cloud-platform",
  51157. // "https://www.googleapis.com/auth/compute"
  51158. // ]
  51159. // }
  51160. }
  51161. // method id "compute.firewalls.testIamPermissions":
  51162. type FirewallsTestIamPermissionsCall struct {
  51163. s *Service
  51164. project string
  51165. resource string
  51166. testpermissionsrequest *TestPermissionsRequest
  51167. urlParams_ gensupport.URLParams
  51168. ctx_ context.Context
  51169. header_ http.Header
  51170. }
  51171. // TestIamPermissions: Returns permissions that a caller has on the
  51172. // specified resource.
  51173. func (r *FirewallsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallsTestIamPermissionsCall {
  51174. c := &FirewallsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51175. c.project = project
  51176. c.resource = resource
  51177. c.testpermissionsrequest = testpermissionsrequest
  51178. return c
  51179. }
  51180. // Fields allows partial responses to be retrieved. See
  51181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51182. // for more information.
  51183. func (c *FirewallsTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallsTestIamPermissionsCall {
  51184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51185. return c
  51186. }
  51187. // Context sets the context to be used in this call's Do method. Any
  51188. // pending HTTP request will be aborted if the provided context is
  51189. // canceled.
  51190. func (c *FirewallsTestIamPermissionsCall) Context(ctx context.Context) *FirewallsTestIamPermissionsCall {
  51191. c.ctx_ = ctx
  51192. return c
  51193. }
  51194. // Header returns an http.Header that can be modified by the caller to
  51195. // add HTTP headers to the request.
  51196. func (c *FirewallsTestIamPermissionsCall) Header() http.Header {
  51197. if c.header_ == nil {
  51198. c.header_ = make(http.Header)
  51199. }
  51200. return c.header_
  51201. }
  51202. func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  51203. reqHeaders := make(http.Header)
  51204. for k, v := range c.header_ {
  51205. reqHeaders[k] = v
  51206. }
  51207. reqHeaders.Set("User-Agent", c.s.userAgent())
  51208. var body io.Reader = nil
  51209. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  51210. if err != nil {
  51211. return nil, err
  51212. }
  51213. reqHeaders.Set("Content-Type", "application/json")
  51214. c.urlParams_.Set("alt", alt)
  51215. c.urlParams_.Set("prettyPrint", "false")
  51216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{resource}/testIamPermissions")
  51217. urls += "?" + c.urlParams_.Encode()
  51218. req, err := http.NewRequest("POST", urls, body)
  51219. if err != nil {
  51220. return nil, err
  51221. }
  51222. req.Header = reqHeaders
  51223. googleapi.Expand(req.URL, map[string]string{
  51224. "project": c.project,
  51225. "resource": c.resource,
  51226. })
  51227. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51228. }
  51229. // Do executes the "compute.firewalls.testIamPermissions" call.
  51230. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  51231. // non-2xx status code is an error. Response headers are in either
  51232. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  51233. // returned at all) in error.(*googleapi.Error).Header. Use
  51234. // googleapi.IsNotModified to check whether the returned error was
  51235. // because http.StatusNotModified was returned.
  51236. func (c *FirewallsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  51237. gensupport.SetOptions(c.urlParams_, opts...)
  51238. res, err := c.doRequest("json")
  51239. if res != nil && res.StatusCode == http.StatusNotModified {
  51240. if res.Body != nil {
  51241. res.Body.Close()
  51242. }
  51243. return nil, &googleapi.Error{
  51244. Code: res.StatusCode,
  51245. Header: res.Header,
  51246. }
  51247. }
  51248. if err != nil {
  51249. return nil, err
  51250. }
  51251. defer googleapi.CloseBody(res)
  51252. if err := googleapi.CheckResponse(res); err != nil {
  51253. return nil, err
  51254. }
  51255. ret := &TestPermissionsResponse{
  51256. ServerResponse: googleapi.ServerResponse{
  51257. Header: res.Header,
  51258. HTTPStatusCode: res.StatusCode,
  51259. },
  51260. }
  51261. target := &ret
  51262. if err := gensupport.DecodeResponse(target, res); err != nil {
  51263. return nil, err
  51264. }
  51265. return ret, nil
  51266. // {
  51267. // "description": "Returns permissions that a caller has on the specified resource.",
  51268. // "httpMethod": "POST",
  51269. // "id": "compute.firewalls.testIamPermissions",
  51270. // "parameterOrder": [
  51271. // "project",
  51272. // "resource"
  51273. // ],
  51274. // "parameters": {
  51275. // "project": {
  51276. // "description": "Project ID for this request.",
  51277. // "location": "path",
  51278. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51279. // "required": true,
  51280. // "type": "string"
  51281. // },
  51282. // "resource": {
  51283. // "description": "Name or id of the resource for this request.",
  51284. // "location": "path",
  51285. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51286. // "required": true,
  51287. // "type": "string"
  51288. // }
  51289. // },
  51290. // "path": "{project}/global/firewalls/{resource}/testIamPermissions",
  51291. // "request": {
  51292. // "$ref": "TestPermissionsRequest"
  51293. // },
  51294. // "response": {
  51295. // "$ref": "TestPermissionsResponse"
  51296. // },
  51297. // "scopes": [
  51298. // "https://www.googleapis.com/auth/cloud-platform",
  51299. // "https://www.googleapis.com/auth/compute",
  51300. // "https://www.googleapis.com/auth/compute.readonly"
  51301. // ]
  51302. // }
  51303. }
  51304. // method id "compute.firewalls.update":
  51305. type FirewallsUpdateCall struct {
  51306. s *Service
  51307. project string
  51308. firewall string
  51309. firewall2 *Firewall
  51310. urlParams_ gensupport.URLParams
  51311. ctx_ context.Context
  51312. header_ http.Header
  51313. }
  51314. // Update: Updates the specified firewall rule with the data included in
  51315. // the request. The PUT method can only update the following fields of
  51316. // firewall rule: allowed, description, sourceRanges, sourceTags,
  51317. // targetTags.
  51318. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  51319. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  51320. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51321. c.project = project
  51322. c.firewall = firewall
  51323. c.firewall2 = firewall2
  51324. return c
  51325. }
  51326. // RequestId sets the optional parameter "requestId": An optional
  51327. // request ID to identify requests. Specify a unique request ID so that
  51328. // if you must retry your request, the server will know to ignore the
  51329. // request if it has already been completed.
  51330. //
  51331. // For example, consider a situation where you make an initial request
  51332. // and the request times out. If you make the request again with the
  51333. // same request ID, the server can check if original operation with the
  51334. // same request ID was received, and if so, will ignore the second
  51335. // request. This prevents clients from accidentally creating duplicate
  51336. // commitments.
  51337. //
  51338. // The request ID must be a valid UUID with the exception that zero UUID
  51339. // is not supported (00000000-0000-0000-0000-000000000000).
  51340. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  51341. c.urlParams_.Set("requestId", requestId)
  51342. return c
  51343. }
  51344. // Fields allows partial responses to be retrieved. See
  51345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51346. // for more information.
  51347. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  51348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51349. return c
  51350. }
  51351. // Context sets the context to be used in this call's Do method. Any
  51352. // pending HTTP request will be aborted if the provided context is
  51353. // canceled.
  51354. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  51355. c.ctx_ = ctx
  51356. return c
  51357. }
  51358. // Header returns an http.Header that can be modified by the caller to
  51359. // add HTTP headers to the request.
  51360. func (c *FirewallsUpdateCall) Header() http.Header {
  51361. if c.header_ == nil {
  51362. c.header_ = make(http.Header)
  51363. }
  51364. return c.header_
  51365. }
  51366. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  51367. reqHeaders := make(http.Header)
  51368. for k, v := range c.header_ {
  51369. reqHeaders[k] = v
  51370. }
  51371. reqHeaders.Set("User-Agent", c.s.userAgent())
  51372. var body io.Reader = nil
  51373. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  51374. if err != nil {
  51375. return nil, err
  51376. }
  51377. reqHeaders.Set("Content-Type", "application/json")
  51378. c.urlParams_.Set("alt", alt)
  51379. c.urlParams_.Set("prettyPrint", "false")
  51380. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  51381. urls += "?" + c.urlParams_.Encode()
  51382. req, err := http.NewRequest("PUT", urls, body)
  51383. if err != nil {
  51384. return nil, err
  51385. }
  51386. req.Header = reqHeaders
  51387. googleapi.Expand(req.URL, map[string]string{
  51388. "project": c.project,
  51389. "firewall": c.firewall,
  51390. })
  51391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51392. }
  51393. // Do executes the "compute.firewalls.update" call.
  51394. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51395. // status code is an error. Response headers are in either
  51396. // *Operation.ServerResponse.Header or (if a response was returned at
  51397. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51398. // to check whether the returned error was because
  51399. // http.StatusNotModified was returned.
  51400. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51401. gensupport.SetOptions(c.urlParams_, opts...)
  51402. res, err := c.doRequest("json")
  51403. if res != nil && res.StatusCode == http.StatusNotModified {
  51404. if res.Body != nil {
  51405. res.Body.Close()
  51406. }
  51407. return nil, &googleapi.Error{
  51408. Code: res.StatusCode,
  51409. Header: res.Header,
  51410. }
  51411. }
  51412. if err != nil {
  51413. return nil, err
  51414. }
  51415. defer googleapi.CloseBody(res)
  51416. if err := googleapi.CheckResponse(res); err != nil {
  51417. return nil, err
  51418. }
  51419. ret := &Operation{
  51420. ServerResponse: googleapi.ServerResponse{
  51421. Header: res.Header,
  51422. HTTPStatusCode: res.StatusCode,
  51423. },
  51424. }
  51425. target := &ret
  51426. if err := gensupport.DecodeResponse(target, res); err != nil {
  51427. return nil, err
  51428. }
  51429. return ret, nil
  51430. // {
  51431. // "description": "Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags.",
  51432. // "httpMethod": "PUT",
  51433. // "id": "compute.firewalls.update",
  51434. // "parameterOrder": [
  51435. // "project",
  51436. // "firewall"
  51437. // ],
  51438. // "parameters": {
  51439. // "firewall": {
  51440. // "description": "Name of the firewall rule to update.",
  51441. // "location": "path",
  51442. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51443. // "required": true,
  51444. // "type": "string"
  51445. // },
  51446. // "project": {
  51447. // "description": "Project ID for this request.",
  51448. // "location": "path",
  51449. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51450. // "required": true,
  51451. // "type": "string"
  51452. // },
  51453. // "requestId": {
  51454. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51455. // "location": "query",
  51456. // "type": "string"
  51457. // }
  51458. // },
  51459. // "path": "{project}/global/firewalls/{firewall}",
  51460. // "request": {
  51461. // "$ref": "Firewall"
  51462. // },
  51463. // "response": {
  51464. // "$ref": "Operation"
  51465. // },
  51466. // "scopes": [
  51467. // "https://www.googleapis.com/auth/cloud-platform",
  51468. // "https://www.googleapis.com/auth/compute"
  51469. // ]
  51470. // }
  51471. }
  51472. // method id "compute.forwardingRules.aggregatedList":
  51473. type ForwardingRulesAggregatedListCall struct {
  51474. s *Service
  51475. project string
  51476. urlParams_ gensupport.URLParams
  51477. ifNoneMatch_ string
  51478. ctx_ context.Context
  51479. header_ http.Header
  51480. }
  51481. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  51482. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  51483. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  51484. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51485. c.project = project
  51486. return c
  51487. }
  51488. // Filter sets the optional parameter "filter": A filter expression that
  51489. // filters resources listed in the response. The expression must specify
  51490. // the field name, a comparison operator, and the value that you want to
  51491. // use for filtering. The value must be a string, a number, or a
  51492. // boolean. The comparison operator must be either =, !=, >, or <.
  51493. //
  51494. // For example, if you are filtering Compute Engine instances, you can
  51495. // exclude instances named example-instance by specifying name !=
  51496. // example-instance.
  51497. //
  51498. // You can also filter nested fields. For example, you could specify
  51499. // scheduling.automaticRestart = false to include instances only if they
  51500. // are not scheduled for automatic restarts. You can use filtering on
  51501. // nested fields to filter based on resource labels.
  51502. //
  51503. // To filter on multiple expressions, provide each separate expression
  51504. // within parentheses. For example, (scheduling.automaticRestart = true)
  51505. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51506. // AND expression. However, you can include AND and OR expressions
  51507. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51508. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51509. // true).
  51510. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  51511. c.urlParams_.Set("filter", filter)
  51512. return c
  51513. }
  51514. // MaxResults sets the optional parameter "maxResults": The maximum
  51515. // number of results per page that should be returned. If the number of
  51516. // available results is larger than maxResults, Compute Engine returns a
  51517. // nextPageToken that can be used to get the next page of results in
  51518. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51519. // (Default: 500)
  51520. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  51521. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51522. return c
  51523. }
  51524. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51525. // a certain order. By default, results are returned in alphanumerical
  51526. // order based on the resource name.
  51527. //
  51528. // You can also sort results in descending order based on the creation
  51529. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51530. // based on the creationTimestamp field in reverse chronological order
  51531. // (newest result first). Use this to sort resources like operations so
  51532. // that the newest operation is returned first.
  51533. //
  51534. // Currently, only sorting by name or creationTimestamp desc is
  51535. // supported.
  51536. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  51537. c.urlParams_.Set("orderBy", orderBy)
  51538. return c
  51539. }
  51540. // PageToken sets the optional parameter "pageToken": Specifies a page
  51541. // token to use. Set pageToken to the nextPageToken returned by a
  51542. // previous list request to get the next page of results.
  51543. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  51544. c.urlParams_.Set("pageToken", pageToken)
  51545. return c
  51546. }
  51547. // Fields allows partial responses to be retrieved. See
  51548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51549. // for more information.
  51550. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  51551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51552. return c
  51553. }
  51554. // IfNoneMatch sets the optional parameter which makes the operation
  51555. // fail if the object's ETag matches the given value. This is useful for
  51556. // getting updates only after the object has changed since the last
  51557. // request. Use googleapi.IsNotModified to check whether the response
  51558. // error from Do is the result of In-None-Match.
  51559. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  51560. c.ifNoneMatch_ = entityTag
  51561. return c
  51562. }
  51563. // Context sets the context to be used in this call's Do method. Any
  51564. // pending HTTP request will be aborted if the provided context is
  51565. // canceled.
  51566. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  51567. c.ctx_ = ctx
  51568. return c
  51569. }
  51570. // Header returns an http.Header that can be modified by the caller to
  51571. // add HTTP headers to the request.
  51572. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  51573. if c.header_ == nil {
  51574. c.header_ = make(http.Header)
  51575. }
  51576. return c.header_
  51577. }
  51578. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  51579. reqHeaders := make(http.Header)
  51580. for k, v := range c.header_ {
  51581. reqHeaders[k] = v
  51582. }
  51583. reqHeaders.Set("User-Agent", c.s.userAgent())
  51584. if c.ifNoneMatch_ != "" {
  51585. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51586. }
  51587. var body io.Reader = nil
  51588. c.urlParams_.Set("alt", alt)
  51589. c.urlParams_.Set("prettyPrint", "false")
  51590. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  51591. urls += "?" + c.urlParams_.Encode()
  51592. req, err := http.NewRequest("GET", urls, body)
  51593. if err != nil {
  51594. return nil, err
  51595. }
  51596. req.Header = reqHeaders
  51597. googleapi.Expand(req.URL, map[string]string{
  51598. "project": c.project,
  51599. })
  51600. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51601. }
  51602. // Do executes the "compute.forwardingRules.aggregatedList" call.
  51603. // Exactly one of *ForwardingRuleAggregatedList or error will be
  51604. // non-nil. Any non-2xx status code is an error. Response headers are in
  51605. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  51606. // response was returned at all) in error.(*googleapi.Error).Header. Use
  51607. // googleapi.IsNotModified to check whether the returned error was
  51608. // because http.StatusNotModified was returned.
  51609. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  51610. gensupport.SetOptions(c.urlParams_, opts...)
  51611. res, err := c.doRequest("json")
  51612. if res != nil && res.StatusCode == http.StatusNotModified {
  51613. if res.Body != nil {
  51614. res.Body.Close()
  51615. }
  51616. return nil, &googleapi.Error{
  51617. Code: res.StatusCode,
  51618. Header: res.Header,
  51619. }
  51620. }
  51621. if err != nil {
  51622. return nil, err
  51623. }
  51624. defer googleapi.CloseBody(res)
  51625. if err := googleapi.CheckResponse(res); err != nil {
  51626. return nil, err
  51627. }
  51628. ret := &ForwardingRuleAggregatedList{
  51629. ServerResponse: googleapi.ServerResponse{
  51630. Header: res.Header,
  51631. HTTPStatusCode: res.StatusCode,
  51632. },
  51633. }
  51634. target := &ret
  51635. if err := gensupport.DecodeResponse(target, res); err != nil {
  51636. return nil, err
  51637. }
  51638. return ret, nil
  51639. // {
  51640. // "description": "Retrieves an aggregated list of forwarding rules.",
  51641. // "httpMethod": "GET",
  51642. // "id": "compute.forwardingRules.aggregatedList",
  51643. // "parameterOrder": [
  51644. // "project"
  51645. // ],
  51646. // "parameters": {
  51647. // "filter": {
  51648. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  51649. // "location": "query",
  51650. // "type": "string"
  51651. // },
  51652. // "maxResults": {
  51653. // "default": "500",
  51654. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  51655. // "format": "uint32",
  51656. // "location": "query",
  51657. // "minimum": "0",
  51658. // "type": "integer"
  51659. // },
  51660. // "orderBy": {
  51661. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  51662. // "location": "query",
  51663. // "type": "string"
  51664. // },
  51665. // "pageToken": {
  51666. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  51667. // "location": "query",
  51668. // "type": "string"
  51669. // },
  51670. // "project": {
  51671. // "description": "Project ID for this request.",
  51672. // "location": "path",
  51673. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51674. // "required": true,
  51675. // "type": "string"
  51676. // }
  51677. // },
  51678. // "path": "{project}/aggregated/forwardingRules",
  51679. // "response": {
  51680. // "$ref": "ForwardingRuleAggregatedList"
  51681. // },
  51682. // "scopes": [
  51683. // "https://www.googleapis.com/auth/cloud-platform",
  51684. // "https://www.googleapis.com/auth/compute",
  51685. // "https://www.googleapis.com/auth/compute.readonly"
  51686. // ]
  51687. // }
  51688. }
  51689. // Pages invokes f for each page of results.
  51690. // A non-nil error returned from f will halt the iteration.
  51691. // The provided context supersedes any context provided to the Context method.
  51692. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  51693. c.ctx_ = ctx
  51694. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51695. for {
  51696. x, err := c.Do()
  51697. if err != nil {
  51698. return err
  51699. }
  51700. if err := f(x); err != nil {
  51701. return err
  51702. }
  51703. if x.NextPageToken == "" {
  51704. return nil
  51705. }
  51706. c.PageToken(x.NextPageToken)
  51707. }
  51708. }
  51709. // method id "compute.forwardingRules.delete":
  51710. type ForwardingRulesDeleteCall struct {
  51711. s *Service
  51712. project string
  51713. region string
  51714. forwardingRule string
  51715. urlParams_ gensupport.URLParams
  51716. ctx_ context.Context
  51717. header_ http.Header
  51718. }
  51719. // Delete: Deletes the specified ForwardingRule resource.
  51720. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  51721. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  51722. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51723. c.project = project
  51724. c.region = region
  51725. c.forwardingRule = forwardingRule
  51726. return c
  51727. }
  51728. // RequestId sets the optional parameter "requestId": An optional
  51729. // request ID to identify requests. Specify a unique request ID so that
  51730. // if you must retry your request, the server will know to ignore the
  51731. // request if it has already been completed.
  51732. //
  51733. // For example, consider a situation where you make an initial request
  51734. // and the request times out. If you make the request again with the
  51735. // same request ID, the server can check if original operation with the
  51736. // same request ID was received, and if so, will ignore the second
  51737. // request. This prevents clients from accidentally creating duplicate
  51738. // commitments.
  51739. //
  51740. // The request ID must be a valid UUID with the exception that zero UUID
  51741. // is not supported (00000000-0000-0000-0000-000000000000).
  51742. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  51743. c.urlParams_.Set("requestId", requestId)
  51744. return c
  51745. }
  51746. // Fields allows partial responses to be retrieved. See
  51747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51748. // for more information.
  51749. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  51750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51751. return c
  51752. }
  51753. // Context sets the context to be used in this call's Do method. Any
  51754. // pending HTTP request will be aborted if the provided context is
  51755. // canceled.
  51756. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  51757. c.ctx_ = ctx
  51758. return c
  51759. }
  51760. // Header returns an http.Header that can be modified by the caller to
  51761. // add HTTP headers to the request.
  51762. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  51763. if c.header_ == nil {
  51764. c.header_ = make(http.Header)
  51765. }
  51766. return c.header_
  51767. }
  51768. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  51769. reqHeaders := make(http.Header)
  51770. for k, v := range c.header_ {
  51771. reqHeaders[k] = v
  51772. }
  51773. reqHeaders.Set("User-Agent", c.s.userAgent())
  51774. var body io.Reader = nil
  51775. c.urlParams_.Set("alt", alt)
  51776. c.urlParams_.Set("prettyPrint", "false")
  51777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  51778. urls += "?" + c.urlParams_.Encode()
  51779. req, err := http.NewRequest("DELETE", urls, body)
  51780. if err != nil {
  51781. return nil, err
  51782. }
  51783. req.Header = reqHeaders
  51784. googleapi.Expand(req.URL, map[string]string{
  51785. "project": c.project,
  51786. "region": c.region,
  51787. "forwardingRule": c.forwardingRule,
  51788. })
  51789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51790. }
  51791. // Do executes the "compute.forwardingRules.delete" call.
  51792. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51793. // status code is an error. Response headers are in either
  51794. // *Operation.ServerResponse.Header or (if a response was returned at
  51795. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51796. // to check whether the returned error was because
  51797. // http.StatusNotModified was returned.
  51798. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51799. gensupport.SetOptions(c.urlParams_, opts...)
  51800. res, err := c.doRequest("json")
  51801. if res != nil && res.StatusCode == http.StatusNotModified {
  51802. if res.Body != nil {
  51803. res.Body.Close()
  51804. }
  51805. return nil, &googleapi.Error{
  51806. Code: res.StatusCode,
  51807. Header: res.Header,
  51808. }
  51809. }
  51810. if err != nil {
  51811. return nil, err
  51812. }
  51813. defer googleapi.CloseBody(res)
  51814. if err := googleapi.CheckResponse(res); err != nil {
  51815. return nil, err
  51816. }
  51817. ret := &Operation{
  51818. ServerResponse: googleapi.ServerResponse{
  51819. Header: res.Header,
  51820. HTTPStatusCode: res.StatusCode,
  51821. },
  51822. }
  51823. target := &ret
  51824. if err := gensupport.DecodeResponse(target, res); err != nil {
  51825. return nil, err
  51826. }
  51827. return ret, nil
  51828. // {
  51829. // "description": "Deletes the specified ForwardingRule resource.",
  51830. // "httpMethod": "DELETE",
  51831. // "id": "compute.forwardingRules.delete",
  51832. // "parameterOrder": [
  51833. // "project",
  51834. // "region",
  51835. // "forwardingRule"
  51836. // ],
  51837. // "parameters": {
  51838. // "forwardingRule": {
  51839. // "description": "Name of the ForwardingRule resource to delete.",
  51840. // "location": "path",
  51841. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51842. // "required": true,
  51843. // "type": "string"
  51844. // },
  51845. // "project": {
  51846. // "description": "Project ID for this request.",
  51847. // "location": "path",
  51848. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51849. // "required": true,
  51850. // "type": "string"
  51851. // },
  51852. // "region": {
  51853. // "description": "Name of the region scoping this request.",
  51854. // "location": "path",
  51855. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51856. // "required": true,
  51857. // "type": "string"
  51858. // },
  51859. // "requestId": {
  51860. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51861. // "location": "query",
  51862. // "type": "string"
  51863. // }
  51864. // },
  51865. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  51866. // "response": {
  51867. // "$ref": "Operation"
  51868. // },
  51869. // "scopes": [
  51870. // "https://www.googleapis.com/auth/cloud-platform",
  51871. // "https://www.googleapis.com/auth/compute"
  51872. // ]
  51873. // }
  51874. }
  51875. // method id "compute.forwardingRules.get":
  51876. type ForwardingRulesGetCall struct {
  51877. s *Service
  51878. project string
  51879. region string
  51880. forwardingRule string
  51881. urlParams_ gensupport.URLParams
  51882. ifNoneMatch_ string
  51883. ctx_ context.Context
  51884. header_ http.Header
  51885. }
  51886. // Get: Returns the specified ForwardingRule resource.
  51887. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  51888. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  51889. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51890. c.project = project
  51891. c.region = region
  51892. c.forwardingRule = forwardingRule
  51893. return c
  51894. }
  51895. // Fields allows partial responses to be retrieved. See
  51896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51897. // for more information.
  51898. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  51899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51900. return c
  51901. }
  51902. // IfNoneMatch sets the optional parameter which makes the operation
  51903. // fail if the object's ETag matches the given value. This is useful for
  51904. // getting updates only after the object has changed since the last
  51905. // request. Use googleapi.IsNotModified to check whether the response
  51906. // error from Do is the result of In-None-Match.
  51907. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  51908. c.ifNoneMatch_ = entityTag
  51909. return c
  51910. }
  51911. // Context sets the context to be used in this call's Do method. Any
  51912. // pending HTTP request will be aborted if the provided context is
  51913. // canceled.
  51914. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  51915. c.ctx_ = ctx
  51916. return c
  51917. }
  51918. // Header returns an http.Header that can be modified by the caller to
  51919. // add HTTP headers to the request.
  51920. func (c *ForwardingRulesGetCall) Header() http.Header {
  51921. if c.header_ == nil {
  51922. c.header_ = make(http.Header)
  51923. }
  51924. return c.header_
  51925. }
  51926. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  51927. reqHeaders := make(http.Header)
  51928. for k, v := range c.header_ {
  51929. reqHeaders[k] = v
  51930. }
  51931. reqHeaders.Set("User-Agent", c.s.userAgent())
  51932. if c.ifNoneMatch_ != "" {
  51933. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51934. }
  51935. var body io.Reader = nil
  51936. c.urlParams_.Set("alt", alt)
  51937. c.urlParams_.Set("prettyPrint", "false")
  51938. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  51939. urls += "?" + c.urlParams_.Encode()
  51940. req, err := http.NewRequest("GET", urls, body)
  51941. if err != nil {
  51942. return nil, err
  51943. }
  51944. req.Header = reqHeaders
  51945. googleapi.Expand(req.URL, map[string]string{
  51946. "project": c.project,
  51947. "region": c.region,
  51948. "forwardingRule": c.forwardingRule,
  51949. })
  51950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51951. }
  51952. // Do executes the "compute.forwardingRules.get" call.
  51953. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  51954. // status code is an error. Response headers are in either
  51955. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  51956. // at all) in error.(*googleapi.Error).Header. Use
  51957. // googleapi.IsNotModified to check whether the returned error was
  51958. // because http.StatusNotModified was returned.
  51959. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  51960. gensupport.SetOptions(c.urlParams_, opts...)
  51961. res, err := c.doRequest("json")
  51962. if res != nil && res.StatusCode == http.StatusNotModified {
  51963. if res.Body != nil {
  51964. res.Body.Close()
  51965. }
  51966. return nil, &googleapi.Error{
  51967. Code: res.StatusCode,
  51968. Header: res.Header,
  51969. }
  51970. }
  51971. if err != nil {
  51972. return nil, err
  51973. }
  51974. defer googleapi.CloseBody(res)
  51975. if err := googleapi.CheckResponse(res); err != nil {
  51976. return nil, err
  51977. }
  51978. ret := &ForwardingRule{
  51979. ServerResponse: googleapi.ServerResponse{
  51980. Header: res.Header,
  51981. HTTPStatusCode: res.StatusCode,
  51982. },
  51983. }
  51984. target := &ret
  51985. if err := gensupport.DecodeResponse(target, res); err != nil {
  51986. return nil, err
  51987. }
  51988. return ret, nil
  51989. // {
  51990. // "description": "Returns the specified ForwardingRule resource.",
  51991. // "httpMethod": "GET",
  51992. // "id": "compute.forwardingRules.get",
  51993. // "parameterOrder": [
  51994. // "project",
  51995. // "region",
  51996. // "forwardingRule"
  51997. // ],
  51998. // "parameters": {
  51999. // "forwardingRule": {
  52000. // "description": "Name of the ForwardingRule resource to return.",
  52001. // "location": "path",
  52002. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52003. // "required": true,
  52004. // "type": "string"
  52005. // },
  52006. // "project": {
  52007. // "description": "Project ID for this request.",
  52008. // "location": "path",
  52009. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52010. // "required": true,
  52011. // "type": "string"
  52012. // },
  52013. // "region": {
  52014. // "description": "Name of the region scoping this request.",
  52015. // "location": "path",
  52016. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52017. // "required": true,
  52018. // "type": "string"
  52019. // }
  52020. // },
  52021. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  52022. // "response": {
  52023. // "$ref": "ForwardingRule"
  52024. // },
  52025. // "scopes": [
  52026. // "https://www.googleapis.com/auth/cloud-platform",
  52027. // "https://www.googleapis.com/auth/compute",
  52028. // "https://www.googleapis.com/auth/compute.readonly"
  52029. // ]
  52030. // }
  52031. }
  52032. // method id "compute.forwardingRules.insert":
  52033. type ForwardingRulesInsertCall struct {
  52034. s *Service
  52035. project string
  52036. region string
  52037. forwardingrule *ForwardingRule
  52038. urlParams_ gensupport.URLParams
  52039. ctx_ context.Context
  52040. header_ http.Header
  52041. }
  52042. // Insert: Creates a ForwardingRule resource in the specified project
  52043. // and region using the data included in the request.
  52044. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  52045. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  52046. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52047. c.project = project
  52048. c.region = region
  52049. c.forwardingrule = forwardingrule
  52050. return c
  52051. }
  52052. // RequestId sets the optional parameter "requestId": An optional
  52053. // request ID to identify requests. Specify a unique request ID so that
  52054. // if you must retry your request, the server will know to ignore the
  52055. // request if it has already been completed.
  52056. //
  52057. // For example, consider a situation where you make an initial request
  52058. // and the request times out. If you make the request again with the
  52059. // same request ID, the server can check if original operation with the
  52060. // same request ID was received, and if so, will ignore the second
  52061. // request. This prevents clients from accidentally creating duplicate
  52062. // commitments.
  52063. //
  52064. // The request ID must be a valid UUID with the exception that zero UUID
  52065. // is not supported (00000000-0000-0000-0000-000000000000).
  52066. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  52067. c.urlParams_.Set("requestId", requestId)
  52068. return c
  52069. }
  52070. // Fields allows partial responses to be retrieved. See
  52071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52072. // for more information.
  52073. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  52074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52075. return c
  52076. }
  52077. // Context sets the context to be used in this call's Do method. Any
  52078. // pending HTTP request will be aborted if the provided context is
  52079. // canceled.
  52080. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  52081. c.ctx_ = ctx
  52082. return c
  52083. }
  52084. // Header returns an http.Header that can be modified by the caller to
  52085. // add HTTP headers to the request.
  52086. func (c *ForwardingRulesInsertCall) Header() http.Header {
  52087. if c.header_ == nil {
  52088. c.header_ = make(http.Header)
  52089. }
  52090. return c.header_
  52091. }
  52092. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  52093. reqHeaders := make(http.Header)
  52094. for k, v := range c.header_ {
  52095. reqHeaders[k] = v
  52096. }
  52097. reqHeaders.Set("User-Agent", c.s.userAgent())
  52098. var body io.Reader = nil
  52099. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  52100. if err != nil {
  52101. return nil, err
  52102. }
  52103. reqHeaders.Set("Content-Type", "application/json")
  52104. c.urlParams_.Set("alt", alt)
  52105. c.urlParams_.Set("prettyPrint", "false")
  52106. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  52107. urls += "?" + c.urlParams_.Encode()
  52108. req, err := http.NewRequest("POST", urls, body)
  52109. if err != nil {
  52110. return nil, err
  52111. }
  52112. req.Header = reqHeaders
  52113. googleapi.Expand(req.URL, map[string]string{
  52114. "project": c.project,
  52115. "region": c.region,
  52116. })
  52117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52118. }
  52119. // Do executes the "compute.forwardingRules.insert" call.
  52120. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52121. // status code is an error. Response headers are in either
  52122. // *Operation.ServerResponse.Header or (if a response was returned at
  52123. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52124. // to check whether the returned error was because
  52125. // http.StatusNotModified was returned.
  52126. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52127. gensupport.SetOptions(c.urlParams_, opts...)
  52128. res, err := c.doRequest("json")
  52129. if res != nil && res.StatusCode == http.StatusNotModified {
  52130. if res.Body != nil {
  52131. res.Body.Close()
  52132. }
  52133. return nil, &googleapi.Error{
  52134. Code: res.StatusCode,
  52135. Header: res.Header,
  52136. }
  52137. }
  52138. if err != nil {
  52139. return nil, err
  52140. }
  52141. defer googleapi.CloseBody(res)
  52142. if err := googleapi.CheckResponse(res); err != nil {
  52143. return nil, err
  52144. }
  52145. ret := &Operation{
  52146. ServerResponse: googleapi.ServerResponse{
  52147. Header: res.Header,
  52148. HTTPStatusCode: res.StatusCode,
  52149. },
  52150. }
  52151. target := &ret
  52152. if err := gensupport.DecodeResponse(target, res); err != nil {
  52153. return nil, err
  52154. }
  52155. return ret, nil
  52156. // {
  52157. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  52158. // "httpMethod": "POST",
  52159. // "id": "compute.forwardingRules.insert",
  52160. // "parameterOrder": [
  52161. // "project",
  52162. // "region"
  52163. // ],
  52164. // "parameters": {
  52165. // "project": {
  52166. // "description": "Project ID for this request.",
  52167. // "location": "path",
  52168. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52169. // "required": true,
  52170. // "type": "string"
  52171. // },
  52172. // "region": {
  52173. // "description": "Name of the region scoping this request.",
  52174. // "location": "path",
  52175. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52176. // "required": true,
  52177. // "type": "string"
  52178. // },
  52179. // "requestId": {
  52180. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52181. // "location": "query",
  52182. // "type": "string"
  52183. // }
  52184. // },
  52185. // "path": "{project}/regions/{region}/forwardingRules",
  52186. // "request": {
  52187. // "$ref": "ForwardingRule"
  52188. // },
  52189. // "response": {
  52190. // "$ref": "Operation"
  52191. // },
  52192. // "scopes": [
  52193. // "https://www.googleapis.com/auth/cloud-platform",
  52194. // "https://www.googleapis.com/auth/compute"
  52195. // ]
  52196. // }
  52197. }
  52198. // method id "compute.forwardingRules.list":
  52199. type ForwardingRulesListCall struct {
  52200. s *Service
  52201. project string
  52202. region string
  52203. urlParams_ gensupport.URLParams
  52204. ifNoneMatch_ string
  52205. ctx_ context.Context
  52206. header_ http.Header
  52207. }
  52208. // List: Retrieves a list of ForwardingRule resources available to the
  52209. // specified project and region.
  52210. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  52211. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  52212. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52213. c.project = project
  52214. c.region = region
  52215. return c
  52216. }
  52217. // Filter sets the optional parameter "filter": A filter expression that
  52218. // filters resources listed in the response. The expression must specify
  52219. // the field name, a comparison operator, and the value that you want to
  52220. // use for filtering. The value must be a string, a number, or a
  52221. // boolean. The comparison operator must be either =, !=, >, or <.
  52222. //
  52223. // For example, if you are filtering Compute Engine instances, you can
  52224. // exclude instances named example-instance by specifying name !=
  52225. // example-instance.
  52226. //
  52227. // You can also filter nested fields. For example, you could specify
  52228. // scheduling.automaticRestart = false to include instances only if they
  52229. // are not scheduled for automatic restarts. You can use filtering on
  52230. // nested fields to filter based on resource labels.
  52231. //
  52232. // To filter on multiple expressions, provide each separate expression
  52233. // within parentheses. For example, (scheduling.automaticRestart = true)
  52234. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  52235. // AND expression. However, you can include AND and OR expressions
  52236. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  52237. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  52238. // true).
  52239. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  52240. c.urlParams_.Set("filter", filter)
  52241. return c
  52242. }
  52243. // MaxResults sets the optional parameter "maxResults": The maximum
  52244. // number of results per page that should be returned. If the number of
  52245. // available results is larger than maxResults, Compute Engine returns a
  52246. // nextPageToken that can be used to get the next page of results in
  52247. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52248. // (Default: 500)
  52249. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  52250. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52251. return c
  52252. }
  52253. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  52254. // a certain order. By default, results are returned in alphanumerical
  52255. // order based on the resource name.
  52256. //
  52257. // You can also sort results in descending order based on the creation
  52258. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52259. // based on the creationTimestamp field in reverse chronological order
  52260. // (newest result first). Use this to sort resources like operations so
  52261. // that the newest operation is returned first.
  52262. //
  52263. // Currently, only sorting by name or creationTimestamp desc is
  52264. // supported.
  52265. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  52266. c.urlParams_.Set("orderBy", orderBy)
  52267. return c
  52268. }
  52269. // PageToken sets the optional parameter "pageToken": Specifies a page
  52270. // token to use. Set pageToken to the nextPageToken returned by a
  52271. // previous list request to get the next page of results.
  52272. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  52273. c.urlParams_.Set("pageToken", pageToken)
  52274. return c
  52275. }
  52276. // Fields allows partial responses to be retrieved. See
  52277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52278. // for more information.
  52279. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  52280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52281. return c
  52282. }
  52283. // IfNoneMatch sets the optional parameter which makes the operation
  52284. // fail if the object's ETag matches the given value. This is useful for
  52285. // getting updates only after the object has changed since the last
  52286. // request. Use googleapi.IsNotModified to check whether the response
  52287. // error from Do is the result of In-None-Match.
  52288. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  52289. c.ifNoneMatch_ = entityTag
  52290. return c
  52291. }
  52292. // Context sets the context to be used in this call's Do method. Any
  52293. // pending HTTP request will be aborted if the provided context is
  52294. // canceled.
  52295. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  52296. c.ctx_ = ctx
  52297. return c
  52298. }
  52299. // Header returns an http.Header that can be modified by the caller to
  52300. // add HTTP headers to the request.
  52301. func (c *ForwardingRulesListCall) Header() http.Header {
  52302. if c.header_ == nil {
  52303. c.header_ = make(http.Header)
  52304. }
  52305. return c.header_
  52306. }
  52307. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  52308. reqHeaders := make(http.Header)
  52309. for k, v := range c.header_ {
  52310. reqHeaders[k] = v
  52311. }
  52312. reqHeaders.Set("User-Agent", c.s.userAgent())
  52313. if c.ifNoneMatch_ != "" {
  52314. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52315. }
  52316. var body io.Reader = nil
  52317. c.urlParams_.Set("alt", alt)
  52318. c.urlParams_.Set("prettyPrint", "false")
  52319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  52320. urls += "?" + c.urlParams_.Encode()
  52321. req, err := http.NewRequest("GET", urls, body)
  52322. if err != nil {
  52323. return nil, err
  52324. }
  52325. req.Header = reqHeaders
  52326. googleapi.Expand(req.URL, map[string]string{
  52327. "project": c.project,
  52328. "region": c.region,
  52329. })
  52330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52331. }
  52332. // Do executes the "compute.forwardingRules.list" call.
  52333. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  52334. // non-2xx status code is an error. Response headers are in either
  52335. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  52336. // returned at all) in error.(*googleapi.Error).Header. Use
  52337. // googleapi.IsNotModified to check whether the returned error was
  52338. // because http.StatusNotModified was returned.
  52339. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  52340. gensupport.SetOptions(c.urlParams_, opts...)
  52341. res, err := c.doRequest("json")
  52342. if res != nil && res.StatusCode == http.StatusNotModified {
  52343. if res.Body != nil {
  52344. res.Body.Close()
  52345. }
  52346. return nil, &googleapi.Error{
  52347. Code: res.StatusCode,
  52348. Header: res.Header,
  52349. }
  52350. }
  52351. if err != nil {
  52352. return nil, err
  52353. }
  52354. defer googleapi.CloseBody(res)
  52355. if err := googleapi.CheckResponse(res); err != nil {
  52356. return nil, err
  52357. }
  52358. ret := &ForwardingRuleList{
  52359. ServerResponse: googleapi.ServerResponse{
  52360. Header: res.Header,
  52361. HTTPStatusCode: res.StatusCode,
  52362. },
  52363. }
  52364. target := &ret
  52365. if err := gensupport.DecodeResponse(target, res); err != nil {
  52366. return nil, err
  52367. }
  52368. return ret, nil
  52369. // {
  52370. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  52371. // "httpMethod": "GET",
  52372. // "id": "compute.forwardingRules.list",
  52373. // "parameterOrder": [
  52374. // "project",
  52375. // "region"
  52376. // ],
  52377. // "parameters": {
  52378. // "filter": {
  52379. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  52380. // "location": "query",
  52381. // "type": "string"
  52382. // },
  52383. // "maxResults": {
  52384. // "default": "500",
  52385. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  52386. // "format": "uint32",
  52387. // "location": "query",
  52388. // "minimum": "0",
  52389. // "type": "integer"
  52390. // },
  52391. // "orderBy": {
  52392. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  52393. // "location": "query",
  52394. // "type": "string"
  52395. // },
  52396. // "pageToken": {
  52397. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  52398. // "location": "query",
  52399. // "type": "string"
  52400. // },
  52401. // "project": {
  52402. // "description": "Project ID for this request.",
  52403. // "location": "path",
  52404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52405. // "required": true,
  52406. // "type": "string"
  52407. // },
  52408. // "region": {
  52409. // "description": "Name of the region scoping this request.",
  52410. // "location": "path",
  52411. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52412. // "required": true,
  52413. // "type": "string"
  52414. // }
  52415. // },
  52416. // "path": "{project}/regions/{region}/forwardingRules",
  52417. // "response": {
  52418. // "$ref": "ForwardingRuleList"
  52419. // },
  52420. // "scopes": [
  52421. // "https://www.googleapis.com/auth/cloud-platform",
  52422. // "https://www.googleapis.com/auth/compute",
  52423. // "https://www.googleapis.com/auth/compute.readonly"
  52424. // ]
  52425. // }
  52426. }
  52427. // Pages invokes f for each page of results.
  52428. // A non-nil error returned from f will halt the iteration.
  52429. // The provided context supersedes any context provided to the Context method.
  52430. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  52431. c.ctx_ = ctx
  52432. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52433. for {
  52434. x, err := c.Do()
  52435. if err != nil {
  52436. return err
  52437. }
  52438. if err := f(x); err != nil {
  52439. return err
  52440. }
  52441. if x.NextPageToken == "" {
  52442. return nil
  52443. }
  52444. c.PageToken(x.NextPageToken)
  52445. }
  52446. }
  52447. // method id "compute.forwardingRules.patch":
  52448. type ForwardingRulesPatchCall struct {
  52449. s *Service
  52450. project string
  52451. region string
  52452. forwardingRule string
  52453. forwardingrule *ForwardingRule
  52454. urlParams_ gensupport.URLParams
  52455. ctx_ context.Context
  52456. header_ http.Header
  52457. }
  52458. // Patch: Updates the specified forwarding rule with the data included
  52459. // in the request. This method supports PATCH semantics and uses the
  52460. // JSON merge patch format and processing rules. Currently, you can only
  52461. // patch the network_tier field.
  52462. func (r *ForwardingRulesService) Patch(project string, region string, forwardingRule string, forwardingrule *ForwardingRule) *ForwardingRulesPatchCall {
  52463. c := &ForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52464. c.project = project
  52465. c.region = region
  52466. c.forwardingRule = forwardingRule
  52467. c.forwardingrule = forwardingrule
  52468. return c
  52469. }
  52470. // RequestId sets the optional parameter "requestId": An optional
  52471. // request ID to identify requests. Specify a unique request ID so that
  52472. // if you must retry your request, the server will know to ignore the
  52473. // request if it has already been completed.
  52474. //
  52475. // For example, consider a situation where you make an initial request
  52476. // and the request times out. If you make the request again with the
  52477. // same request ID, the server can check if original operation with the
  52478. // same request ID was received, and if so, will ignore the second
  52479. // request. This prevents clients from accidentally creating duplicate
  52480. // commitments.
  52481. //
  52482. // The request ID must be a valid UUID with the exception that zero UUID
  52483. // is not supported (00000000-0000-0000-0000-000000000000).
  52484. func (c *ForwardingRulesPatchCall) RequestId(requestId string) *ForwardingRulesPatchCall {
  52485. c.urlParams_.Set("requestId", requestId)
  52486. return c
  52487. }
  52488. // Fields allows partial responses to be retrieved. See
  52489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52490. // for more information.
  52491. func (c *ForwardingRulesPatchCall) Fields(s ...googleapi.Field) *ForwardingRulesPatchCall {
  52492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52493. return c
  52494. }
  52495. // Context sets the context to be used in this call's Do method. Any
  52496. // pending HTTP request will be aborted if the provided context is
  52497. // canceled.
  52498. func (c *ForwardingRulesPatchCall) Context(ctx context.Context) *ForwardingRulesPatchCall {
  52499. c.ctx_ = ctx
  52500. return c
  52501. }
  52502. // Header returns an http.Header that can be modified by the caller to
  52503. // add HTTP headers to the request.
  52504. func (c *ForwardingRulesPatchCall) Header() http.Header {
  52505. if c.header_ == nil {
  52506. c.header_ = make(http.Header)
  52507. }
  52508. return c.header_
  52509. }
  52510. func (c *ForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  52511. reqHeaders := make(http.Header)
  52512. for k, v := range c.header_ {
  52513. reqHeaders[k] = v
  52514. }
  52515. reqHeaders.Set("User-Agent", c.s.userAgent())
  52516. var body io.Reader = nil
  52517. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  52518. if err != nil {
  52519. return nil, err
  52520. }
  52521. reqHeaders.Set("Content-Type", "application/json")
  52522. c.urlParams_.Set("alt", alt)
  52523. c.urlParams_.Set("prettyPrint", "false")
  52524. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  52525. urls += "?" + c.urlParams_.Encode()
  52526. req, err := http.NewRequest("PATCH", urls, body)
  52527. if err != nil {
  52528. return nil, err
  52529. }
  52530. req.Header = reqHeaders
  52531. googleapi.Expand(req.URL, map[string]string{
  52532. "project": c.project,
  52533. "region": c.region,
  52534. "forwardingRule": c.forwardingRule,
  52535. })
  52536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52537. }
  52538. // Do executes the "compute.forwardingRules.patch" call.
  52539. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52540. // status code is an error. Response headers are in either
  52541. // *Operation.ServerResponse.Header or (if a response was returned at
  52542. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52543. // to check whether the returned error was because
  52544. // http.StatusNotModified was returned.
  52545. func (c *ForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52546. gensupport.SetOptions(c.urlParams_, opts...)
  52547. res, err := c.doRequest("json")
  52548. if res != nil && res.StatusCode == http.StatusNotModified {
  52549. if res.Body != nil {
  52550. res.Body.Close()
  52551. }
  52552. return nil, &googleapi.Error{
  52553. Code: res.StatusCode,
  52554. Header: res.Header,
  52555. }
  52556. }
  52557. if err != nil {
  52558. return nil, err
  52559. }
  52560. defer googleapi.CloseBody(res)
  52561. if err := googleapi.CheckResponse(res); err != nil {
  52562. return nil, err
  52563. }
  52564. ret := &Operation{
  52565. ServerResponse: googleapi.ServerResponse{
  52566. Header: res.Header,
  52567. HTTPStatusCode: res.StatusCode,
  52568. },
  52569. }
  52570. target := &ret
  52571. if err := gensupport.DecodeResponse(target, res); err != nil {
  52572. return nil, err
  52573. }
  52574. return ret, nil
  52575. // {
  52576. // "description": "Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field.",
  52577. // "httpMethod": "PATCH",
  52578. // "id": "compute.forwardingRules.patch",
  52579. // "parameterOrder": [
  52580. // "project",
  52581. // "region",
  52582. // "forwardingRule"
  52583. // ],
  52584. // "parameters": {
  52585. // "forwardingRule": {
  52586. // "description": "Name of the ForwardingRule resource to patch.",
  52587. // "location": "path",
  52588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52589. // "required": true,
  52590. // "type": "string"
  52591. // },
  52592. // "project": {
  52593. // "description": "Project ID for this request.",
  52594. // "location": "path",
  52595. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52596. // "required": true,
  52597. // "type": "string"
  52598. // },
  52599. // "region": {
  52600. // "description": "Name of the region scoping this request.",
  52601. // "location": "path",
  52602. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52603. // "required": true,
  52604. // "type": "string"
  52605. // },
  52606. // "requestId": {
  52607. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52608. // "location": "query",
  52609. // "type": "string"
  52610. // }
  52611. // },
  52612. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  52613. // "request": {
  52614. // "$ref": "ForwardingRule"
  52615. // },
  52616. // "response": {
  52617. // "$ref": "Operation"
  52618. // },
  52619. // "scopes": [
  52620. // "https://www.googleapis.com/auth/cloud-platform",
  52621. // "https://www.googleapis.com/auth/compute"
  52622. // ]
  52623. // }
  52624. }
  52625. // method id "compute.forwardingRules.setLabels":
  52626. type ForwardingRulesSetLabelsCall struct {
  52627. s *Service
  52628. project string
  52629. region string
  52630. resource string
  52631. regionsetlabelsrequest *RegionSetLabelsRequest
  52632. urlParams_ gensupport.URLParams
  52633. ctx_ context.Context
  52634. header_ http.Header
  52635. }
  52636. // SetLabels: Sets the labels on the specified resource. To learn more
  52637. // about labels, read the Labeling Resources documentation.
  52638. func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
  52639. c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52640. c.project = project
  52641. c.region = region
  52642. c.resource = resource
  52643. c.regionsetlabelsrequest = regionsetlabelsrequest
  52644. return c
  52645. }
  52646. // RequestId sets the optional parameter "requestId": An optional
  52647. // request ID to identify requests. Specify a unique request ID so that
  52648. // if you must retry your request, the server will know to ignore the
  52649. // request if it has already been completed.
  52650. //
  52651. // For example, consider a situation where you make an initial request
  52652. // and the request times out. If you make the request again with the
  52653. // same request ID, the server can check if original operation with the
  52654. // same request ID was received, and if so, will ignore the second
  52655. // request. This prevents clients from accidentally creating duplicate
  52656. // commitments.
  52657. //
  52658. // The request ID must be a valid UUID with the exception that zero UUID
  52659. // is not supported (00000000-0000-0000-0000-000000000000).
  52660. func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
  52661. c.urlParams_.Set("requestId", requestId)
  52662. return c
  52663. }
  52664. // Fields allows partial responses to be retrieved. See
  52665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52666. // for more information.
  52667. func (c *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
  52668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52669. return c
  52670. }
  52671. // Context sets the context to be used in this call's Do method. Any
  52672. // pending HTTP request will be aborted if the provided context is
  52673. // canceled.
  52674. func (c *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
  52675. c.ctx_ = ctx
  52676. return c
  52677. }
  52678. // Header returns an http.Header that can be modified by the caller to
  52679. // add HTTP headers to the request.
  52680. func (c *ForwardingRulesSetLabelsCall) Header() http.Header {
  52681. if c.header_ == nil {
  52682. c.header_ = make(http.Header)
  52683. }
  52684. return c.header_
  52685. }
  52686. func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  52687. reqHeaders := make(http.Header)
  52688. for k, v := range c.header_ {
  52689. reqHeaders[k] = v
  52690. }
  52691. reqHeaders.Set("User-Agent", c.s.userAgent())
  52692. var body io.Reader = nil
  52693. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  52694. if err != nil {
  52695. return nil, err
  52696. }
  52697. reqHeaders.Set("Content-Type", "application/json")
  52698. c.urlParams_.Set("alt", alt)
  52699. c.urlParams_.Set("prettyPrint", "false")
  52700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/setLabels")
  52701. urls += "?" + c.urlParams_.Encode()
  52702. req, err := http.NewRequest("POST", urls, body)
  52703. if err != nil {
  52704. return nil, err
  52705. }
  52706. req.Header = reqHeaders
  52707. googleapi.Expand(req.URL, map[string]string{
  52708. "project": c.project,
  52709. "region": c.region,
  52710. "resource": c.resource,
  52711. })
  52712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52713. }
  52714. // Do executes the "compute.forwardingRules.setLabels" call.
  52715. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52716. // status code is an error. Response headers are in either
  52717. // *Operation.ServerResponse.Header or (if a response was returned at
  52718. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52719. // to check whether the returned error was because
  52720. // http.StatusNotModified was returned.
  52721. func (c *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52722. gensupport.SetOptions(c.urlParams_, opts...)
  52723. res, err := c.doRequest("json")
  52724. if res != nil && res.StatusCode == http.StatusNotModified {
  52725. if res.Body != nil {
  52726. res.Body.Close()
  52727. }
  52728. return nil, &googleapi.Error{
  52729. Code: res.StatusCode,
  52730. Header: res.Header,
  52731. }
  52732. }
  52733. if err != nil {
  52734. return nil, err
  52735. }
  52736. defer googleapi.CloseBody(res)
  52737. if err := googleapi.CheckResponse(res); err != nil {
  52738. return nil, err
  52739. }
  52740. ret := &Operation{
  52741. ServerResponse: googleapi.ServerResponse{
  52742. Header: res.Header,
  52743. HTTPStatusCode: res.StatusCode,
  52744. },
  52745. }
  52746. target := &ret
  52747. if err := gensupport.DecodeResponse(target, res); err != nil {
  52748. return nil, err
  52749. }
  52750. return ret, nil
  52751. // {
  52752. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  52753. // "httpMethod": "POST",
  52754. // "id": "compute.forwardingRules.setLabels",
  52755. // "parameterOrder": [
  52756. // "project",
  52757. // "region",
  52758. // "resource"
  52759. // ],
  52760. // "parameters": {
  52761. // "project": {
  52762. // "description": "Project ID for this request.",
  52763. // "location": "path",
  52764. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52765. // "required": true,
  52766. // "type": "string"
  52767. // },
  52768. // "region": {
  52769. // "description": "The region for this request.",
  52770. // "location": "path",
  52771. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52772. // "required": true,
  52773. // "type": "string"
  52774. // },
  52775. // "requestId": {
  52776. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52777. // "location": "query",
  52778. // "type": "string"
  52779. // },
  52780. // "resource": {
  52781. // "description": "Name or id of the resource for this request.",
  52782. // "location": "path",
  52783. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52784. // "required": true,
  52785. // "type": "string"
  52786. // }
  52787. // },
  52788. // "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels",
  52789. // "request": {
  52790. // "$ref": "RegionSetLabelsRequest"
  52791. // },
  52792. // "response": {
  52793. // "$ref": "Operation"
  52794. // },
  52795. // "scopes": [
  52796. // "https://www.googleapis.com/auth/cloud-platform",
  52797. // "https://www.googleapis.com/auth/compute"
  52798. // ]
  52799. // }
  52800. }
  52801. // method id "compute.forwardingRules.setTarget":
  52802. type ForwardingRulesSetTargetCall struct {
  52803. s *Service
  52804. project string
  52805. region string
  52806. forwardingRule string
  52807. targetreference *TargetReference
  52808. urlParams_ gensupport.URLParams
  52809. ctx_ context.Context
  52810. header_ http.Header
  52811. }
  52812. // SetTarget: Changes target URL for forwarding rule. The new target
  52813. // should be of the same type as the old target.
  52814. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  52815. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  52816. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52817. c.project = project
  52818. c.region = region
  52819. c.forwardingRule = forwardingRule
  52820. c.targetreference = targetreference
  52821. return c
  52822. }
  52823. // RequestId sets the optional parameter "requestId": An optional
  52824. // request ID to identify requests. Specify a unique request ID so that
  52825. // if you must retry your request, the server will know to ignore the
  52826. // request if it has already been completed.
  52827. //
  52828. // For example, consider a situation where you make an initial request
  52829. // and the request times out. If you make the request again with the
  52830. // same request ID, the server can check if original operation with the
  52831. // same request ID was received, and if so, will ignore the second
  52832. // request. This prevents clients from accidentally creating duplicate
  52833. // commitments.
  52834. //
  52835. // The request ID must be a valid UUID with the exception that zero UUID
  52836. // is not supported (00000000-0000-0000-0000-000000000000).
  52837. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  52838. c.urlParams_.Set("requestId", requestId)
  52839. return c
  52840. }
  52841. // Fields allows partial responses to be retrieved. See
  52842. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52843. // for more information.
  52844. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  52845. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52846. return c
  52847. }
  52848. // Context sets the context to be used in this call's Do method. Any
  52849. // pending HTTP request will be aborted if the provided context is
  52850. // canceled.
  52851. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  52852. c.ctx_ = ctx
  52853. return c
  52854. }
  52855. // Header returns an http.Header that can be modified by the caller to
  52856. // add HTTP headers to the request.
  52857. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  52858. if c.header_ == nil {
  52859. c.header_ = make(http.Header)
  52860. }
  52861. return c.header_
  52862. }
  52863. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  52864. reqHeaders := make(http.Header)
  52865. for k, v := range c.header_ {
  52866. reqHeaders[k] = v
  52867. }
  52868. reqHeaders.Set("User-Agent", c.s.userAgent())
  52869. var body io.Reader = nil
  52870. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  52871. if err != nil {
  52872. return nil, err
  52873. }
  52874. reqHeaders.Set("Content-Type", "application/json")
  52875. c.urlParams_.Set("alt", alt)
  52876. c.urlParams_.Set("prettyPrint", "false")
  52877. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  52878. urls += "?" + c.urlParams_.Encode()
  52879. req, err := http.NewRequest("POST", urls, body)
  52880. if err != nil {
  52881. return nil, err
  52882. }
  52883. req.Header = reqHeaders
  52884. googleapi.Expand(req.URL, map[string]string{
  52885. "project": c.project,
  52886. "region": c.region,
  52887. "forwardingRule": c.forwardingRule,
  52888. })
  52889. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52890. }
  52891. // Do executes the "compute.forwardingRules.setTarget" call.
  52892. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52893. // status code is an error. Response headers are in either
  52894. // *Operation.ServerResponse.Header or (if a response was returned at
  52895. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52896. // to check whether the returned error was because
  52897. // http.StatusNotModified was returned.
  52898. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52899. gensupport.SetOptions(c.urlParams_, opts...)
  52900. res, err := c.doRequest("json")
  52901. if res != nil && res.StatusCode == http.StatusNotModified {
  52902. if res.Body != nil {
  52903. res.Body.Close()
  52904. }
  52905. return nil, &googleapi.Error{
  52906. Code: res.StatusCode,
  52907. Header: res.Header,
  52908. }
  52909. }
  52910. if err != nil {
  52911. return nil, err
  52912. }
  52913. defer googleapi.CloseBody(res)
  52914. if err := googleapi.CheckResponse(res); err != nil {
  52915. return nil, err
  52916. }
  52917. ret := &Operation{
  52918. ServerResponse: googleapi.ServerResponse{
  52919. Header: res.Header,
  52920. HTTPStatusCode: res.StatusCode,
  52921. },
  52922. }
  52923. target := &ret
  52924. if err := gensupport.DecodeResponse(target, res); err != nil {
  52925. return nil, err
  52926. }
  52927. return ret, nil
  52928. // {
  52929. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  52930. // "httpMethod": "POST",
  52931. // "id": "compute.forwardingRules.setTarget",
  52932. // "parameterOrder": [
  52933. // "project",
  52934. // "region",
  52935. // "forwardingRule"
  52936. // ],
  52937. // "parameters": {
  52938. // "forwardingRule": {
  52939. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  52940. // "location": "path",
  52941. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52942. // "required": true,
  52943. // "type": "string"
  52944. // },
  52945. // "project": {
  52946. // "description": "Project ID for this request.",
  52947. // "location": "path",
  52948. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52949. // "required": true,
  52950. // "type": "string"
  52951. // },
  52952. // "region": {
  52953. // "description": "Name of the region scoping this request.",
  52954. // "location": "path",
  52955. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52956. // "required": true,
  52957. // "type": "string"
  52958. // },
  52959. // "requestId": {
  52960. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52961. // "location": "query",
  52962. // "type": "string"
  52963. // }
  52964. // },
  52965. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  52966. // "request": {
  52967. // "$ref": "TargetReference"
  52968. // },
  52969. // "response": {
  52970. // "$ref": "Operation"
  52971. // },
  52972. // "scopes": [
  52973. // "https://www.googleapis.com/auth/cloud-platform",
  52974. // "https://www.googleapis.com/auth/compute"
  52975. // ]
  52976. // }
  52977. }
  52978. // method id "compute.forwardingRules.testIamPermissions":
  52979. type ForwardingRulesTestIamPermissionsCall struct {
  52980. s *Service
  52981. project string
  52982. region string
  52983. resource string
  52984. testpermissionsrequest *TestPermissionsRequest
  52985. urlParams_ gensupport.URLParams
  52986. ctx_ context.Context
  52987. header_ http.Header
  52988. }
  52989. // TestIamPermissions: Returns permissions that a caller has on the
  52990. // specified resource.
  52991. func (r *ForwardingRulesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ForwardingRulesTestIamPermissionsCall {
  52992. c := &ForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52993. c.project = project
  52994. c.region = region
  52995. c.resource = resource
  52996. c.testpermissionsrequest = testpermissionsrequest
  52997. return c
  52998. }
  52999. // Fields allows partial responses to be retrieved. See
  53000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53001. // for more information.
  53002. func (c *ForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ForwardingRulesTestIamPermissionsCall {
  53003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53004. return c
  53005. }
  53006. // Context sets the context to be used in this call's Do method. Any
  53007. // pending HTTP request will be aborted if the provided context is
  53008. // canceled.
  53009. func (c *ForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *ForwardingRulesTestIamPermissionsCall {
  53010. c.ctx_ = ctx
  53011. return c
  53012. }
  53013. // Header returns an http.Header that can be modified by the caller to
  53014. // add HTTP headers to the request.
  53015. func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header {
  53016. if c.header_ == nil {
  53017. c.header_ = make(http.Header)
  53018. }
  53019. return c.header_
  53020. }
  53021. func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  53022. reqHeaders := make(http.Header)
  53023. for k, v := range c.header_ {
  53024. reqHeaders[k] = v
  53025. }
  53026. reqHeaders.Set("User-Agent", c.s.userAgent())
  53027. var body io.Reader = nil
  53028. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  53029. if err != nil {
  53030. return nil, err
  53031. }
  53032. reqHeaders.Set("Content-Type", "application/json")
  53033. c.urlParams_.Set("alt", alt)
  53034. c.urlParams_.Set("prettyPrint", "false")
  53035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions")
  53036. urls += "?" + c.urlParams_.Encode()
  53037. req, err := http.NewRequest("POST", urls, body)
  53038. if err != nil {
  53039. return nil, err
  53040. }
  53041. req.Header = reqHeaders
  53042. googleapi.Expand(req.URL, map[string]string{
  53043. "project": c.project,
  53044. "region": c.region,
  53045. "resource": c.resource,
  53046. })
  53047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53048. }
  53049. // Do executes the "compute.forwardingRules.testIamPermissions" call.
  53050. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  53051. // non-2xx status code is an error. Response headers are in either
  53052. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  53053. // returned at all) in error.(*googleapi.Error).Header. Use
  53054. // googleapi.IsNotModified to check whether the returned error was
  53055. // because http.StatusNotModified was returned.
  53056. func (c *ForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  53057. gensupport.SetOptions(c.urlParams_, opts...)
  53058. res, err := c.doRequest("json")
  53059. if res != nil && res.StatusCode == http.StatusNotModified {
  53060. if res.Body != nil {
  53061. res.Body.Close()
  53062. }
  53063. return nil, &googleapi.Error{
  53064. Code: res.StatusCode,
  53065. Header: res.Header,
  53066. }
  53067. }
  53068. if err != nil {
  53069. return nil, err
  53070. }
  53071. defer googleapi.CloseBody(res)
  53072. if err := googleapi.CheckResponse(res); err != nil {
  53073. return nil, err
  53074. }
  53075. ret := &TestPermissionsResponse{
  53076. ServerResponse: googleapi.ServerResponse{
  53077. Header: res.Header,
  53078. HTTPStatusCode: res.StatusCode,
  53079. },
  53080. }
  53081. target := &ret
  53082. if err := gensupport.DecodeResponse(target, res); err != nil {
  53083. return nil, err
  53084. }
  53085. return ret, nil
  53086. // {
  53087. // "description": "Returns permissions that a caller has on the specified resource.",
  53088. // "httpMethod": "POST",
  53089. // "id": "compute.forwardingRules.testIamPermissions",
  53090. // "parameterOrder": [
  53091. // "project",
  53092. // "region",
  53093. // "resource"
  53094. // ],
  53095. // "parameters": {
  53096. // "project": {
  53097. // "description": "Project ID for this request.",
  53098. // "location": "path",
  53099. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53100. // "required": true,
  53101. // "type": "string"
  53102. // },
  53103. // "region": {
  53104. // "description": "The name of the region for this request.",
  53105. // "location": "path",
  53106. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53107. // "required": true,
  53108. // "type": "string"
  53109. // },
  53110. // "resource": {
  53111. // "description": "Name or id of the resource for this request.",
  53112. // "location": "path",
  53113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53114. // "required": true,
  53115. // "type": "string"
  53116. // }
  53117. // },
  53118. // "path": "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions",
  53119. // "request": {
  53120. // "$ref": "TestPermissionsRequest"
  53121. // },
  53122. // "response": {
  53123. // "$ref": "TestPermissionsResponse"
  53124. // },
  53125. // "scopes": [
  53126. // "https://www.googleapis.com/auth/cloud-platform",
  53127. // "https://www.googleapis.com/auth/compute",
  53128. // "https://www.googleapis.com/auth/compute.readonly"
  53129. // ]
  53130. // }
  53131. }
  53132. // method id "compute.globalAddresses.delete":
  53133. type GlobalAddressesDeleteCall struct {
  53134. s *Service
  53135. project string
  53136. address string
  53137. urlParams_ gensupport.URLParams
  53138. ctx_ context.Context
  53139. header_ http.Header
  53140. }
  53141. // Delete: Deletes the specified address resource.
  53142. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  53143. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  53144. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53145. c.project = project
  53146. c.address = address
  53147. return c
  53148. }
  53149. // RequestId sets the optional parameter "requestId": An optional
  53150. // request ID to identify requests. Specify a unique request ID so that
  53151. // if you must retry your request, the server will know to ignore the
  53152. // request if it has already been completed.
  53153. //
  53154. // For example, consider a situation where you make an initial request
  53155. // and the request times out. If you make the request again with the
  53156. // same request ID, the server can check if original operation with the
  53157. // same request ID was received, and if so, will ignore the second
  53158. // request. This prevents clients from accidentally creating duplicate
  53159. // commitments.
  53160. //
  53161. // The request ID must be a valid UUID with the exception that zero UUID
  53162. // is not supported (00000000-0000-0000-0000-000000000000).
  53163. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  53164. c.urlParams_.Set("requestId", requestId)
  53165. return c
  53166. }
  53167. // Fields allows partial responses to be retrieved. See
  53168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53169. // for more information.
  53170. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  53171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53172. return c
  53173. }
  53174. // Context sets the context to be used in this call's Do method. Any
  53175. // pending HTTP request will be aborted if the provided context is
  53176. // canceled.
  53177. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  53178. c.ctx_ = ctx
  53179. return c
  53180. }
  53181. // Header returns an http.Header that can be modified by the caller to
  53182. // add HTTP headers to the request.
  53183. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  53184. if c.header_ == nil {
  53185. c.header_ = make(http.Header)
  53186. }
  53187. return c.header_
  53188. }
  53189. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  53190. reqHeaders := make(http.Header)
  53191. for k, v := range c.header_ {
  53192. reqHeaders[k] = v
  53193. }
  53194. reqHeaders.Set("User-Agent", c.s.userAgent())
  53195. var body io.Reader = nil
  53196. c.urlParams_.Set("alt", alt)
  53197. c.urlParams_.Set("prettyPrint", "false")
  53198. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  53199. urls += "?" + c.urlParams_.Encode()
  53200. req, err := http.NewRequest("DELETE", urls, body)
  53201. if err != nil {
  53202. return nil, err
  53203. }
  53204. req.Header = reqHeaders
  53205. googleapi.Expand(req.URL, map[string]string{
  53206. "project": c.project,
  53207. "address": c.address,
  53208. })
  53209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53210. }
  53211. // Do executes the "compute.globalAddresses.delete" call.
  53212. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53213. // status code is an error. Response headers are in either
  53214. // *Operation.ServerResponse.Header or (if a response was returned at
  53215. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53216. // to check whether the returned error was because
  53217. // http.StatusNotModified was returned.
  53218. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53219. gensupport.SetOptions(c.urlParams_, opts...)
  53220. res, err := c.doRequest("json")
  53221. if res != nil && res.StatusCode == http.StatusNotModified {
  53222. if res.Body != nil {
  53223. res.Body.Close()
  53224. }
  53225. return nil, &googleapi.Error{
  53226. Code: res.StatusCode,
  53227. Header: res.Header,
  53228. }
  53229. }
  53230. if err != nil {
  53231. return nil, err
  53232. }
  53233. defer googleapi.CloseBody(res)
  53234. if err := googleapi.CheckResponse(res); err != nil {
  53235. return nil, err
  53236. }
  53237. ret := &Operation{
  53238. ServerResponse: googleapi.ServerResponse{
  53239. Header: res.Header,
  53240. HTTPStatusCode: res.StatusCode,
  53241. },
  53242. }
  53243. target := &ret
  53244. if err := gensupport.DecodeResponse(target, res); err != nil {
  53245. return nil, err
  53246. }
  53247. return ret, nil
  53248. // {
  53249. // "description": "Deletes the specified address resource.",
  53250. // "httpMethod": "DELETE",
  53251. // "id": "compute.globalAddresses.delete",
  53252. // "parameterOrder": [
  53253. // "project",
  53254. // "address"
  53255. // ],
  53256. // "parameters": {
  53257. // "address": {
  53258. // "description": "Name of the address resource to delete.",
  53259. // "location": "path",
  53260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53261. // "required": true,
  53262. // "type": "string"
  53263. // },
  53264. // "project": {
  53265. // "description": "Project ID for this request.",
  53266. // "location": "path",
  53267. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53268. // "required": true,
  53269. // "type": "string"
  53270. // },
  53271. // "requestId": {
  53272. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53273. // "location": "query",
  53274. // "type": "string"
  53275. // }
  53276. // },
  53277. // "path": "{project}/global/addresses/{address}",
  53278. // "response": {
  53279. // "$ref": "Operation"
  53280. // },
  53281. // "scopes": [
  53282. // "https://www.googleapis.com/auth/cloud-platform",
  53283. // "https://www.googleapis.com/auth/compute"
  53284. // ]
  53285. // }
  53286. }
  53287. // method id "compute.globalAddresses.get":
  53288. type GlobalAddressesGetCall struct {
  53289. s *Service
  53290. project string
  53291. address string
  53292. urlParams_ gensupport.URLParams
  53293. ifNoneMatch_ string
  53294. ctx_ context.Context
  53295. header_ http.Header
  53296. }
  53297. // Get: Returns the specified address resource. Gets a list of available
  53298. // addresses by making a list() request.
  53299. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  53300. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  53301. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53302. c.project = project
  53303. c.address = address
  53304. return c
  53305. }
  53306. // Fields allows partial responses to be retrieved. See
  53307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53308. // for more information.
  53309. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  53310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53311. return c
  53312. }
  53313. // IfNoneMatch sets the optional parameter which makes the operation
  53314. // fail if the object's ETag matches the given value. This is useful for
  53315. // getting updates only after the object has changed since the last
  53316. // request. Use googleapi.IsNotModified to check whether the response
  53317. // error from Do is the result of In-None-Match.
  53318. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  53319. c.ifNoneMatch_ = entityTag
  53320. return c
  53321. }
  53322. // Context sets the context to be used in this call's Do method. Any
  53323. // pending HTTP request will be aborted if the provided context is
  53324. // canceled.
  53325. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  53326. c.ctx_ = ctx
  53327. return c
  53328. }
  53329. // Header returns an http.Header that can be modified by the caller to
  53330. // add HTTP headers to the request.
  53331. func (c *GlobalAddressesGetCall) Header() http.Header {
  53332. if c.header_ == nil {
  53333. c.header_ = make(http.Header)
  53334. }
  53335. return c.header_
  53336. }
  53337. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  53338. reqHeaders := make(http.Header)
  53339. for k, v := range c.header_ {
  53340. reqHeaders[k] = v
  53341. }
  53342. reqHeaders.Set("User-Agent", c.s.userAgent())
  53343. if c.ifNoneMatch_ != "" {
  53344. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53345. }
  53346. var body io.Reader = nil
  53347. c.urlParams_.Set("alt", alt)
  53348. c.urlParams_.Set("prettyPrint", "false")
  53349. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  53350. urls += "?" + c.urlParams_.Encode()
  53351. req, err := http.NewRequest("GET", urls, body)
  53352. if err != nil {
  53353. return nil, err
  53354. }
  53355. req.Header = reqHeaders
  53356. googleapi.Expand(req.URL, map[string]string{
  53357. "project": c.project,
  53358. "address": c.address,
  53359. })
  53360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53361. }
  53362. // Do executes the "compute.globalAddresses.get" call.
  53363. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  53364. // code is an error. Response headers are in either
  53365. // *Address.ServerResponse.Header or (if a response was returned at all)
  53366. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  53367. // check whether the returned error was because http.StatusNotModified
  53368. // was returned.
  53369. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  53370. gensupport.SetOptions(c.urlParams_, opts...)
  53371. res, err := c.doRequest("json")
  53372. if res != nil && res.StatusCode == http.StatusNotModified {
  53373. if res.Body != nil {
  53374. res.Body.Close()
  53375. }
  53376. return nil, &googleapi.Error{
  53377. Code: res.StatusCode,
  53378. Header: res.Header,
  53379. }
  53380. }
  53381. if err != nil {
  53382. return nil, err
  53383. }
  53384. defer googleapi.CloseBody(res)
  53385. if err := googleapi.CheckResponse(res); err != nil {
  53386. return nil, err
  53387. }
  53388. ret := &Address{
  53389. ServerResponse: googleapi.ServerResponse{
  53390. Header: res.Header,
  53391. HTTPStatusCode: res.StatusCode,
  53392. },
  53393. }
  53394. target := &ret
  53395. if err := gensupport.DecodeResponse(target, res); err != nil {
  53396. return nil, err
  53397. }
  53398. return ret, nil
  53399. // {
  53400. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  53401. // "httpMethod": "GET",
  53402. // "id": "compute.globalAddresses.get",
  53403. // "parameterOrder": [
  53404. // "project",
  53405. // "address"
  53406. // ],
  53407. // "parameters": {
  53408. // "address": {
  53409. // "description": "Name of the address resource to return.",
  53410. // "location": "path",
  53411. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53412. // "required": true,
  53413. // "type": "string"
  53414. // },
  53415. // "project": {
  53416. // "description": "Project ID for this request.",
  53417. // "location": "path",
  53418. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53419. // "required": true,
  53420. // "type": "string"
  53421. // }
  53422. // },
  53423. // "path": "{project}/global/addresses/{address}",
  53424. // "response": {
  53425. // "$ref": "Address"
  53426. // },
  53427. // "scopes": [
  53428. // "https://www.googleapis.com/auth/cloud-platform",
  53429. // "https://www.googleapis.com/auth/compute",
  53430. // "https://www.googleapis.com/auth/compute.readonly"
  53431. // ]
  53432. // }
  53433. }
  53434. // method id "compute.globalAddresses.insert":
  53435. type GlobalAddressesInsertCall struct {
  53436. s *Service
  53437. project string
  53438. address *Address
  53439. urlParams_ gensupport.URLParams
  53440. ctx_ context.Context
  53441. header_ http.Header
  53442. }
  53443. // Insert: Creates an address resource in the specified project using
  53444. // the data included in the request.
  53445. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  53446. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  53447. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53448. c.project = project
  53449. c.address = address
  53450. return c
  53451. }
  53452. // RequestId sets the optional parameter "requestId": An optional
  53453. // request ID to identify requests. Specify a unique request ID so that
  53454. // if you must retry your request, the server will know to ignore the
  53455. // request if it has already been completed.
  53456. //
  53457. // For example, consider a situation where you make an initial request
  53458. // and the request times out. If you make the request again with the
  53459. // same request ID, the server can check if original operation with the
  53460. // same request ID was received, and if so, will ignore the second
  53461. // request. This prevents clients from accidentally creating duplicate
  53462. // commitments.
  53463. //
  53464. // The request ID must be a valid UUID with the exception that zero UUID
  53465. // is not supported (00000000-0000-0000-0000-000000000000).
  53466. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  53467. c.urlParams_.Set("requestId", requestId)
  53468. return c
  53469. }
  53470. // Fields allows partial responses to be retrieved. See
  53471. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53472. // for more information.
  53473. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  53474. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53475. return c
  53476. }
  53477. // Context sets the context to be used in this call's Do method. Any
  53478. // pending HTTP request will be aborted if the provided context is
  53479. // canceled.
  53480. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  53481. c.ctx_ = ctx
  53482. return c
  53483. }
  53484. // Header returns an http.Header that can be modified by the caller to
  53485. // add HTTP headers to the request.
  53486. func (c *GlobalAddressesInsertCall) Header() http.Header {
  53487. if c.header_ == nil {
  53488. c.header_ = make(http.Header)
  53489. }
  53490. return c.header_
  53491. }
  53492. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  53493. reqHeaders := make(http.Header)
  53494. for k, v := range c.header_ {
  53495. reqHeaders[k] = v
  53496. }
  53497. reqHeaders.Set("User-Agent", c.s.userAgent())
  53498. var body io.Reader = nil
  53499. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  53500. if err != nil {
  53501. return nil, err
  53502. }
  53503. reqHeaders.Set("Content-Type", "application/json")
  53504. c.urlParams_.Set("alt", alt)
  53505. c.urlParams_.Set("prettyPrint", "false")
  53506. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  53507. urls += "?" + c.urlParams_.Encode()
  53508. req, err := http.NewRequest("POST", urls, body)
  53509. if err != nil {
  53510. return nil, err
  53511. }
  53512. req.Header = reqHeaders
  53513. googleapi.Expand(req.URL, map[string]string{
  53514. "project": c.project,
  53515. })
  53516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53517. }
  53518. // Do executes the "compute.globalAddresses.insert" call.
  53519. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53520. // status code is an error. Response headers are in either
  53521. // *Operation.ServerResponse.Header or (if a response was returned at
  53522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53523. // to check whether the returned error was because
  53524. // http.StatusNotModified was returned.
  53525. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53526. gensupport.SetOptions(c.urlParams_, opts...)
  53527. res, err := c.doRequest("json")
  53528. if res != nil && res.StatusCode == http.StatusNotModified {
  53529. if res.Body != nil {
  53530. res.Body.Close()
  53531. }
  53532. return nil, &googleapi.Error{
  53533. Code: res.StatusCode,
  53534. Header: res.Header,
  53535. }
  53536. }
  53537. if err != nil {
  53538. return nil, err
  53539. }
  53540. defer googleapi.CloseBody(res)
  53541. if err := googleapi.CheckResponse(res); err != nil {
  53542. return nil, err
  53543. }
  53544. ret := &Operation{
  53545. ServerResponse: googleapi.ServerResponse{
  53546. Header: res.Header,
  53547. HTTPStatusCode: res.StatusCode,
  53548. },
  53549. }
  53550. target := &ret
  53551. if err := gensupport.DecodeResponse(target, res); err != nil {
  53552. return nil, err
  53553. }
  53554. return ret, nil
  53555. // {
  53556. // "description": "Creates an address resource in the specified project using the data included in the request.",
  53557. // "httpMethod": "POST",
  53558. // "id": "compute.globalAddresses.insert",
  53559. // "parameterOrder": [
  53560. // "project"
  53561. // ],
  53562. // "parameters": {
  53563. // "project": {
  53564. // "description": "Project ID for this request.",
  53565. // "location": "path",
  53566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53567. // "required": true,
  53568. // "type": "string"
  53569. // },
  53570. // "requestId": {
  53571. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53572. // "location": "query",
  53573. // "type": "string"
  53574. // }
  53575. // },
  53576. // "path": "{project}/global/addresses",
  53577. // "request": {
  53578. // "$ref": "Address"
  53579. // },
  53580. // "response": {
  53581. // "$ref": "Operation"
  53582. // },
  53583. // "scopes": [
  53584. // "https://www.googleapis.com/auth/cloud-platform",
  53585. // "https://www.googleapis.com/auth/compute"
  53586. // ]
  53587. // }
  53588. }
  53589. // method id "compute.globalAddresses.list":
  53590. type GlobalAddressesListCall struct {
  53591. s *Service
  53592. project string
  53593. urlParams_ gensupport.URLParams
  53594. ifNoneMatch_ string
  53595. ctx_ context.Context
  53596. header_ http.Header
  53597. }
  53598. // List: Retrieves a list of global addresses.
  53599. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  53600. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  53601. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53602. c.project = project
  53603. return c
  53604. }
  53605. // Filter sets the optional parameter "filter": A filter expression that
  53606. // filters resources listed in the response. The expression must specify
  53607. // the field name, a comparison operator, and the value that you want to
  53608. // use for filtering. The value must be a string, a number, or a
  53609. // boolean. The comparison operator must be either =, !=, >, or <.
  53610. //
  53611. // For example, if you are filtering Compute Engine instances, you can
  53612. // exclude instances named example-instance by specifying name !=
  53613. // example-instance.
  53614. //
  53615. // You can also filter nested fields. For example, you could specify
  53616. // scheduling.automaticRestart = false to include instances only if they
  53617. // are not scheduled for automatic restarts. You can use filtering on
  53618. // nested fields to filter based on resource labels.
  53619. //
  53620. // To filter on multiple expressions, provide each separate expression
  53621. // within parentheses. For example, (scheduling.automaticRestart = true)
  53622. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  53623. // AND expression. However, you can include AND and OR expressions
  53624. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  53625. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  53626. // true).
  53627. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  53628. c.urlParams_.Set("filter", filter)
  53629. return c
  53630. }
  53631. // MaxResults sets the optional parameter "maxResults": The maximum
  53632. // number of results per page that should be returned. If the number of
  53633. // available results is larger than maxResults, Compute Engine returns a
  53634. // nextPageToken that can be used to get the next page of results in
  53635. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  53636. // (Default: 500)
  53637. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  53638. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53639. return c
  53640. }
  53641. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  53642. // a certain order. By default, results are returned in alphanumerical
  53643. // order based on the resource name.
  53644. //
  53645. // You can also sort results in descending order based on the creation
  53646. // timestamp using orderBy="creationTimestamp desc". This sorts results
  53647. // based on the creationTimestamp field in reverse chronological order
  53648. // (newest result first). Use this to sort resources like operations so
  53649. // that the newest operation is returned first.
  53650. //
  53651. // Currently, only sorting by name or creationTimestamp desc is
  53652. // supported.
  53653. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  53654. c.urlParams_.Set("orderBy", orderBy)
  53655. return c
  53656. }
  53657. // PageToken sets the optional parameter "pageToken": Specifies a page
  53658. // token to use. Set pageToken to the nextPageToken returned by a
  53659. // previous list request to get the next page of results.
  53660. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  53661. c.urlParams_.Set("pageToken", pageToken)
  53662. return c
  53663. }
  53664. // Fields allows partial responses to be retrieved. See
  53665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53666. // for more information.
  53667. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  53668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53669. return c
  53670. }
  53671. // IfNoneMatch sets the optional parameter which makes the operation
  53672. // fail if the object's ETag matches the given value. This is useful for
  53673. // getting updates only after the object has changed since the last
  53674. // request. Use googleapi.IsNotModified to check whether the response
  53675. // error from Do is the result of In-None-Match.
  53676. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  53677. c.ifNoneMatch_ = entityTag
  53678. return c
  53679. }
  53680. // Context sets the context to be used in this call's Do method. Any
  53681. // pending HTTP request will be aborted if the provided context is
  53682. // canceled.
  53683. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  53684. c.ctx_ = ctx
  53685. return c
  53686. }
  53687. // Header returns an http.Header that can be modified by the caller to
  53688. // add HTTP headers to the request.
  53689. func (c *GlobalAddressesListCall) Header() http.Header {
  53690. if c.header_ == nil {
  53691. c.header_ = make(http.Header)
  53692. }
  53693. return c.header_
  53694. }
  53695. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  53696. reqHeaders := make(http.Header)
  53697. for k, v := range c.header_ {
  53698. reqHeaders[k] = v
  53699. }
  53700. reqHeaders.Set("User-Agent", c.s.userAgent())
  53701. if c.ifNoneMatch_ != "" {
  53702. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53703. }
  53704. var body io.Reader = nil
  53705. c.urlParams_.Set("alt", alt)
  53706. c.urlParams_.Set("prettyPrint", "false")
  53707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  53708. urls += "?" + c.urlParams_.Encode()
  53709. req, err := http.NewRequest("GET", urls, body)
  53710. if err != nil {
  53711. return nil, err
  53712. }
  53713. req.Header = reqHeaders
  53714. googleapi.Expand(req.URL, map[string]string{
  53715. "project": c.project,
  53716. })
  53717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53718. }
  53719. // Do executes the "compute.globalAddresses.list" call.
  53720. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  53721. // status code is an error. Response headers are in either
  53722. // *AddressList.ServerResponse.Header or (if a response was returned at
  53723. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53724. // to check whether the returned error was because
  53725. // http.StatusNotModified was returned.
  53726. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  53727. gensupport.SetOptions(c.urlParams_, opts...)
  53728. res, err := c.doRequest("json")
  53729. if res != nil && res.StatusCode == http.StatusNotModified {
  53730. if res.Body != nil {
  53731. res.Body.Close()
  53732. }
  53733. return nil, &googleapi.Error{
  53734. Code: res.StatusCode,
  53735. Header: res.Header,
  53736. }
  53737. }
  53738. if err != nil {
  53739. return nil, err
  53740. }
  53741. defer googleapi.CloseBody(res)
  53742. if err := googleapi.CheckResponse(res); err != nil {
  53743. return nil, err
  53744. }
  53745. ret := &AddressList{
  53746. ServerResponse: googleapi.ServerResponse{
  53747. Header: res.Header,
  53748. HTTPStatusCode: res.StatusCode,
  53749. },
  53750. }
  53751. target := &ret
  53752. if err := gensupport.DecodeResponse(target, res); err != nil {
  53753. return nil, err
  53754. }
  53755. return ret, nil
  53756. // {
  53757. // "description": "Retrieves a list of global addresses.",
  53758. // "httpMethod": "GET",
  53759. // "id": "compute.globalAddresses.list",
  53760. // "parameterOrder": [
  53761. // "project"
  53762. // ],
  53763. // "parameters": {
  53764. // "filter": {
  53765. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  53766. // "location": "query",
  53767. // "type": "string"
  53768. // },
  53769. // "maxResults": {
  53770. // "default": "500",
  53771. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  53772. // "format": "uint32",
  53773. // "location": "query",
  53774. // "minimum": "0",
  53775. // "type": "integer"
  53776. // },
  53777. // "orderBy": {
  53778. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  53779. // "location": "query",
  53780. // "type": "string"
  53781. // },
  53782. // "pageToken": {
  53783. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  53784. // "location": "query",
  53785. // "type": "string"
  53786. // },
  53787. // "project": {
  53788. // "description": "Project ID for this request.",
  53789. // "location": "path",
  53790. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53791. // "required": true,
  53792. // "type": "string"
  53793. // }
  53794. // },
  53795. // "path": "{project}/global/addresses",
  53796. // "response": {
  53797. // "$ref": "AddressList"
  53798. // },
  53799. // "scopes": [
  53800. // "https://www.googleapis.com/auth/cloud-platform",
  53801. // "https://www.googleapis.com/auth/compute",
  53802. // "https://www.googleapis.com/auth/compute.readonly"
  53803. // ]
  53804. // }
  53805. }
  53806. // Pages invokes f for each page of results.
  53807. // A non-nil error returned from f will halt the iteration.
  53808. // The provided context supersedes any context provided to the Context method.
  53809. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  53810. c.ctx_ = ctx
  53811. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53812. for {
  53813. x, err := c.Do()
  53814. if err != nil {
  53815. return err
  53816. }
  53817. if err := f(x); err != nil {
  53818. return err
  53819. }
  53820. if x.NextPageToken == "" {
  53821. return nil
  53822. }
  53823. c.PageToken(x.NextPageToken)
  53824. }
  53825. }
  53826. // method id "compute.globalAddresses.setLabels":
  53827. type GlobalAddressesSetLabelsCall struct {
  53828. s *Service
  53829. project string
  53830. resource string
  53831. globalsetlabelsrequest *GlobalSetLabelsRequest
  53832. urlParams_ gensupport.URLParams
  53833. ctx_ context.Context
  53834. header_ http.Header
  53835. }
  53836. // SetLabels: Sets the labels on a GlobalAddress. To learn more about
  53837. // labels, read the Labeling Resources documentation.
  53838. func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
  53839. c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53840. c.project = project
  53841. c.resource = resource
  53842. c.globalsetlabelsrequest = globalsetlabelsrequest
  53843. return c
  53844. }
  53845. // Fields allows partial responses to be retrieved. See
  53846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53847. // for more information.
  53848. func (c *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
  53849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53850. return c
  53851. }
  53852. // Context sets the context to be used in this call's Do method. Any
  53853. // pending HTTP request will be aborted if the provided context is
  53854. // canceled.
  53855. func (c *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
  53856. c.ctx_ = ctx
  53857. return c
  53858. }
  53859. // Header returns an http.Header that can be modified by the caller to
  53860. // add HTTP headers to the request.
  53861. func (c *GlobalAddressesSetLabelsCall) Header() http.Header {
  53862. if c.header_ == nil {
  53863. c.header_ = make(http.Header)
  53864. }
  53865. return c.header_
  53866. }
  53867. func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  53868. reqHeaders := make(http.Header)
  53869. for k, v := range c.header_ {
  53870. reqHeaders[k] = v
  53871. }
  53872. reqHeaders.Set("User-Agent", c.s.userAgent())
  53873. var body io.Reader = nil
  53874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  53875. if err != nil {
  53876. return nil, err
  53877. }
  53878. reqHeaders.Set("Content-Type", "application/json")
  53879. c.urlParams_.Set("alt", alt)
  53880. c.urlParams_.Set("prettyPrint", "false")
  53881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/setLabels")
  53882. urls += "?" + c.urlParams_.Encode()
  53883. req, err := http.NewRequest("POST", urls, body)
  53884. if err != nil {
  53885. return nil, err
  53886. }
  53887. req.Header = reqHeaders
  53888. googleapi.Expand(req.URL, map[string]string{
  53889. "project": c.project,
  53890. "resource": c.resource,
  53891. })
  53892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53893. }
  53894. // Do executes the "compute.globalAddresses.setLabels" call.
  53895. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53896. // status code is an error. Response headers are in either
  53897. // *Operation.ServerResponse.Header or (if a response was returned at
  53898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53899. // to check whether the returned error was because
  53900. // http.StatusNotModified was returned.
  53901. func (c *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53902. gensupport.SetOptions(c.urlParams_, opts...)
  53903. res, err := c.doRequest("json")
  53904. if res != nil && res.StatusCode == http.StatusNotModified {
  53905. if res.Body != nil {
  53906. res.Body.Close()
  53907. }
  53908. return nil, &googleapi.Error{
  53909. Code: res.StatusCode,
  53910. Header: res.Header,
  53911. }
  53912. }
  53913. if err != nil {
  53914. return nil, err
  53915. }
  53916. defer googleapi.CloseBody(res)
  53917. if err := googleapi.CheckResponse(res); err != nil {
  53918. return nil, err
  53919. }
  53920. ret := &Operation{
  53921. ServerResponse: googleapi.ServerResponse{
  53922. Header: res.Header,
  53923. HTTPStatusCode: res.StatusCode,
  53924. },
  53925. }
  53926. target := &ret
  53927. if err := gensupport.DecodeResponse(target, res); err != nil {
  53928. return nil, err
  53929. }
  53930. return ret, nil
  53931. // {
  53932. // "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.",
  53933. // "httpMethod": "POST",
  53934. // "id": "compute.globalAddresses.setLabels",
  53935. // "parameterOrder": [
  53936. // "project",
  53937. // "resource"
  53938. // ],
  53939. // "parameters": {
  53940. // "project": {
  53941. // "description": "Project ID for this request.",
  53942. // "location": "path",
  53943. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53944. // "required": true,
  53945. // "type": "string"
  53946. // },
  53947. // "resource": {
  53948. // "description": "Name or id of the resource for this request.",
  53949. // "location": "path",
  53950. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53951. // "required": true,
  53952. // "type": "string"
  53953. // }
  53954. // },
  53955. // "path": "{project}/global/addresses/{resource}/setLabels",
  53956. // "request": {
  53957. // "$ref": "GlobalSetLabelsRequest"
  53958. // },
  53959. // "response": {
  53960. // "$ref": "Operation"
  53961. // },
  53962. // "scopes": [
  53963. // "https://www.googleapis.com/auth/cloud-platform",
  53964. // "https://www.googleapis.com/auth/compute"
  53965. // ]
  53966. // }
  53967. }
  53968. // method id "compute.globalAddresses.testIamPermissions":
  53969. type GlobalAddressesTestIamPermissionsCall struct {
  53970. s *Service
  53971. project string
  53972. resource string
  53973. testpermissionsrequest *TestPermissionsRequest
  53974. urlParams_ gensupport.URLParams
  53975. ctx_ context.Context
  53976. header_ http.Header
  53977. }
  53978. // TestIamPermissions: Returns permissions that a caller has on the
  53979. // specified resource.
  53980. func (r *GlobalAddressesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalAddressesTestIamPermissionsCall {
  53981. c := &GlobalAddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53982. c.project = project
  53983. c.resource = resource
  53984. c.testpermissionsrequest = testpermissionsrequest
  53985. return c
  53986. }
  53987. // Fields allows partial responses to be retrieved. See
  53988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53989. // for more information.
  53990. func (c *GlobalAddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalAddressesTestIamPermissionsCall {
  53991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53992. return c
  53993. }
  53994. // Context sets the context to be used in this call's Do method. Any
  53995. // pending HTTP request will be aborted if the provided context is
  53996. // canceled.
  53997. func (c *GlobalAddressesTestIamPermissionsCall) Context(ctx context.Context) *GlobalAddressesTestIamPermissionsCall {
  53998. c.ctx_ = ctx
  53999. return c
  54000. }
  54001. // Header returns an http.Header that can be modified by the caller to
  54002. // add HTTP headers to the request.
  54003. func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header {
  54004. if c.header_ == nil {
  54005. c.header_ = make(http.Header)
  54006. }
  54007. return c.header_
  54008. }
  54009. func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  54010. reqHeaders := make(http.Header)
  54011. for k, v := range c.header_ {
  54012. reqHeaders[k] = v
  54013. }
  54014. reqHeaders.Set("User-Agent", c.s.userAgent())
  54015. var body io.Reader = nil
  54016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  54017. if err != nil {
  54018. return nil, err
  54019. }
  54020. reqHeaders.Set("Content-Type", "application/json")
  54021. c.urlParams_.Set("alt", alt)
  54022. c.urlParams_.Set("prettyPrint", "false")
  54023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/testIamPermissions")
  54024. urls += "?" + c.urlParams_.Encode()
  54025. req, err := http.NewRequest("POST", urls, body)
  54026. if err != nil {
  54027. return nil, err
  54028. }
  54029. req.Header = reqHeaders
  54030. googleapi.Expand(req.URL, map[string]string{
  54031. "project": c.project,
  54032. "resource": c.resource,
  54033. })
  54034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54035. }
  54036. // Do executes the "compute.globalAddresses.testIamPermissions" call.
  54037. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  54038. // non-2xx status code is an error. Response headers are in either
  54039. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  54040. // returned at all) in error.(*googleapi.Error).Header. Use
  54041. // googleapi.IsNotModified to check whether the returned error was
  54042. // because http.StatusNotModified was returned.
  54043. func (c *GlobalAddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  54044. gensupport.SetOptions(c.urlParams_, opts...)
  54045. res, err := c.doRequest("json")
  54046. if res != nil && res.StatusCode == http.StatusNotModified {
  54047. if res.Body != nil {
  54048. res.Body.Close()
  54049. }
  54050. return nil, &googleapi.Error{
  54051. Code: res.StatusCode,
  54052. Header: res.Header,
  54053. }
  54054. }
  54055. if err != nil {
  54056. return nil, err
  54057. }
  54058. defer googleapi.CloseBody(res)
  54059. if err := googleapi.CheckResponse(res); err != nil {
  54060. return nil, err
  54061. }
  54062. ret := &TestPermissionsResponse{
  54063. ServerResponse: googleapi.ServerResponse{
  54064. Header: res.Header,
  54065. HTTPStatusCode: res.StatusCode,
  54066. },
  54067. }
  54068. target := &ret
  54069. if err := gensupport.DecodeResponse(target, res); err != nil {
  54070. return nil, err
  54071. }
  54072. return ret, nil
  54073. // {
  54074. // "description": "Returns permissions that a caller has on the specified resource.",
  54075. // "httpMethod": "POST",
  54076. // "id": "compute.globalAddresses.testIamPermissions",
  54077. // "parameterOrder": [
  54078. // "project",
  54079. // "resource"
  54080. // ],
  54081. // "parameters": {
  54082. // "project": {
  54083. // "description": "Project ID for this request.",
  54084. // "location": "path",
  54085. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54086. // "required": true,
  54087. // "type": "string"
  54088. // },
  54089. // "resource": {
  54090. // "description": "Name or id of the resource for this request.",
  54091. // "location": "path",
  54092. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54093. // "required": true,
  54094. // "type": "string"
  54095. // }
  54096. // },
  54097. // "path": "{project}/global/addresses/{resource}/testIamPermissions",
  54098. // "request": {
  54099. // "$ref": "TestPermissionsRequest"
  54100. // },
  54101. // "response": {
  54102. // "$ref": "TestPermissionsResponse"
  54103. // },
  54104. // "scopes": [
  54105. // "https://www.googleapis.com/auth/cloud-platform",
  54106. // "https://www.googleapis.com/auth/compute",
  54107. // "https://www.googleapis.com/auth/compute.readonly"
  54108. // ]
  54109. // }
  54110. }
  54111. // method id "compute.globalForwardingRules.delete":
  54112. type GlobalForwardingRulesDeleteCall struct {
  54113. s *Service
  54114. project string
  54115. forwardingRule string
  54116. urlParams_ gensupport.URLParams
  54117. ctx_ context.Context
  54118. header_ http.Header
  54119. }
  54120. // Delete: Deletes the specified GlobalForwardingRule resource.
  54121. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  54122. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  54123. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54124. c.project = project
  54125. c.forwardingRule = forwardingRule
  54126. return c
  54127. }
  54128. // RequestId sets the optional parameter "requestId": An optional
  54129. // request ID to identify requests. Specify a unique request ID so that
  54130. // if you must retry your request, the server will know to ignore the
  54131. // request if it has already been completed.
  54132. //
  54133. // For example, consider a situation where you make an initial request
  54134. // and the request times out. If you make the request again with the
  54135. // same request ID, the server can check if original operation with the
  54136. // same request ID was received, and if so, will ignore the second
  54137. // request. This prevents clients from accidentally creating duplicate
  54138. // commitments.
  54139. //
  54140. // The request ID must be a valid UUID with the exception that zero UUID
  54141. // is not supported (00000000-0000-0000-0000-000000000000).
  54142. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  54143. c.urlParams_.Set("requestId", requestId)
  54144. return c
  54145. }
  54146. // Fields allows partial responses to be retrieved. See
  54147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54148. // for more information.
  54149. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  54150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54151. return c
  54152. }
  54153. // Context sets the context to be used in this call's Do method. Any
  54154. // pending HTTP request will be aborted if the provided context is
  54155. // canceled.
  54156. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  54157. c.ctx_ = ctx
  54158. return c
  54159. }
  54160. // Header returns an http.Header that can be modified by the caller to
  54161. // add HTTP headers to the request.
  54162. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  54163. if c.header_ == nil {
  54164. c.header_ = make(http.Header)
  54165. }
  54166. return c.header_
  54167. }
  54168. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  54169. reqHeaders := make(http.Header)
  54170. for k, v := range c.header_ {
  54171. reqHeaders[k] = v
  54172. }
  54173. reqHeaders.Set("User-Agent", c.s.userAgent())
  54174. var body io.Reader = nil
  54175. c.urlParams_.Set("alt", alt)
  54176. c.urlParams_.Set("prettyPrint", "false")
  54177. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  54178. urls += "?" + c.urlParams_.Encode()
  54179. req, err := http.NewRequest("DELETE", urls, body)
  54180. if err != nil {
  54181. return nil, err
  54182. }
  54183. req.Header = reqHeaders
  54184. googleapi.Expand(req.URL, map[string]string{
  54185. "project": c.project,
  54186. "forwardingRule": c.forwardingRule,
  54187. })
  54188. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54189. }
  54190. // Do executes the "compute.globalForwardingRules.delete" call.
  54191. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54192. // status code is an error. Response headers are in either
  54193. // *Operation.ServerResponse.Header or (if a response was returned at
  54194. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54195. // to check whether the returned error was because
  54196. // http.StatusNotModified was returned.
  54197. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54198. gensupport.SetOptions(c.urlParams_, opts...)
  54199. res, err := c.doRequest("json")
  54200. if res != nil && res.StatusCode == http.StatusNotModified {
  54201. if res.Body != nil {
  54202. res.Body.Close()
  54203. }
  54204. return nil, &googleapi.Error{
  54205. Code: res.StatusCode,
  54206. Header: res.Header,
  54207. }
  54208. }
  54209. if err != nil {
  54210. return nil, err
  54211. }
  54212. defer googleapi.CloseBody(res)
  54213. if err := googleapi.CheckResponse(res); err != nil {
  54214. return nil, err
  54215. }
  54216. ret := &Operation{
  54217. ServerResponse: googleapi.ServerResponse{
  54218. Header: res.Header,
  54219. HTTPStatusCode: res.StatusCode,
  54220. },
  54221. }
  54222. target := &ret
  54223. if err := gensupport.DecodeResponse(target, res); err != nil {
  54224. return nil, err
  54225. }
  54226. return ret, nil
  54227. // {
  54228. // "description": "Deletes the specified GlobalForwardingRule resource.",
  54229. // "httpMethod": "DELETE",
  54230. // "id": "compute.globalForwardingRules.delete",
  54231. // "parameterOrder": [
  54232. // "project",
  54233. // "forwardingRule"
  54234. // ],
  54235. // "parameters": {
  54236. // "forwardingRule": {
  54237. // "description": "Name of the ForwardingRule resource to delete.",
  54238. // "location": "path",
  54239. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54240. // "required": true,
  54241. // "type": "string"
  54242. // },
  54243. // "project": {
  54244. // "description": "Project ID for this request.",
  54245. // "location": "path",
  54246. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54247. // "required": true,
  54248. // "type": "string"
  54249. // },
  54250. // "requestId": {
  54251. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54252. // "location": "query",
  54253. // "type": "string"
  54254. // }
  54255. // },
  54256. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  54257. // "response": {
  54258. // "$ref": "Operation"
  54259. // },
  54260. // "scopes": [
  54261. // "https://www.googleapis.com/auth/cloud-platform",
  54262. // "https://www.googleapis.com/auth/compute"
  54263. // ]
  54264. // }
  54265. }
  54266. // method id "compute.globalForwardingRules.get":
  54267. type GlobalForwardingRulesGetCall struct {
  54268. s *Service
  54269. project string
  54270. forwardingRule string
  54271. urlParams_ gensupport.URLParams
  54272. ifNoneMatch_ string
  54273. ctx_ context.Context
  54274. header_ http.Header
  54275. }
  54276. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  54277. // of available forwarding rules by making a list() request.
  54278. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  54279. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  54280. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54281. c.project = project
  54282. c.forwardingRule = forwardingRule
  54283. return c
  54284. }
  54285. // Fields allows partial responses to be retrieved. See
  54286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54287. // for more information.
  54288. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  54289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54290. return c
  54291. }
  54292. // IfNoneMatch sets the optional parameter which makes the operation
  54293. // fail if the object's ETag matches the given value. This is useful for
  54294. // getting updates only after the object has changed since the last
  54295. // request. Use googleapi.IsNotModified to check whether the response
  54296. // error from Do is the result of In-None-Match.
  54297. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  54298. c.ifNoneMatch_ = entityTag
  54299. return c
  54300. }
  54301. // Context sets the context to be used in this call's Do method. Any
  54302. // pending HTTP request will be aborted if the provided context is
  54303. // canceled.
  54304. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  54305. c.ctx_ = ctx
  54306. return c
  54307. }
  54308. // Header returns an http.Header that can be modified by the caller to
  54309. // add HTTP headers to the request.
  54310. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  54311. if c.header_ == nil {
  54312. c.header_ = make(http.Header)
  54313. }
  54314. return c.header_
  54315. }
  54316. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  54317. reqHeaders := make(http.Header)
  54318. for k, v := range c.header_ {
  54319. reqHeaders[k] = v
  54320. }
  54321. reqHeaders.Set("User-Agent", c.s.userAgent())
  54322. if c.ifNoneMatch_ != "" {
  54323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54324. }
  54325. var body io.Reader = nil
  54326. c.urlParams_.Set("alt", alt)
  54327. c.urlParams_.Set("prettyPrint", "false")
  54328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  54329. urls += "?" + c.urlParams_.Encode()
  54330. req, err := http.NewRequest("GET", urls, body)
  54331. if err != nil {
  54332. return nil, err
  54333. }
  54334. req.Header = reqHeaders
  54335. googleapi.Expand(req.URL, map[string]string{
  54336. "project": c.project,
  54337. "forwardingRule": c.forwardingRule,
  54338. })
  54339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54340. }
  54341. // Do executes the "compute.globalForwardingRules.get" call.
  54342. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  54343. // status code is an error. Response headers are in either
  54344. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  54345. // at all) in error.(*googleapi.Error).Header. Use
  54346. // googleapi.IsNotModified to check whether the returned error was
  54347. // because http.StatusNotModified was returned.
  54348. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  54349. gensupport.SetOptions(c.urlParams_, opts...)
  54350. res, err := c.doRequest("json")
  54351. if res != nil && res.StatusCode == http.StatusNotModified {
  54352. if res.Body != nil {
  54353. res.Body.Close()
  54354. }
  54355. return nil, &googleapi.Error{
  54356. Code: res.StatusCode,
  54357. Header: res.Header,
  54358. }
  54359. }
  54360. if err != nil {
  54361. return nil, err
  54362. }
  54363. defer googleapi.CloseBody(res)
  54364. if err := googleapi.CheckResponse(res); err != nil {
  54365. return nil, err
  54366. }
  54367. ret := &ForwardingRule{
  54368. ServerResponse: googleapi.ServerResponse{
  54369. Header: res.Header,
  54370. HTTPStatusCode: res.StatusCode,
  54371. },
  54372. }
  54373. target := &ret
  54374. if err := gensupport.DecodeResponse(target, res); err != nil {
  54375. return nil, err
  54376. }
  54377. return ret, nil
  54378. // {
  54379. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  54380. // "httpMethod": "GET",
  54381. // "id": "compute.globalForwardingRules.get",
  54382. // "parameterOrder": [
  54383. // "project",
  54384. // "forwardingRule"
  54385. // ],
  54386. // "parameters": {
  54387. // "forwardingRule": {
  54388. // "description": "Name of the ForwardingRule resource to return.",
  54389. // "location": "path",
  54390. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54391. // "required": true,
  54392. // "type": "string"
  54393. // },
  54394. // "project": {
  54395. // "description": "Project ID for this request.",
  54396. // "location": "path",
  54397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54398. // "required": true,
  54399. // "type": "string"
  54400. // }
  54401. // },
  54402. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  54403. // "response": {
  54404. // "$ref": "ForwardingRule"
  54405. // },
  54406. // "scopes": [
  54407. // "https://www.googleapis.com/auth/cloud-platform",
  54408. // "https://www.googleapis.com/auth/compute",
  54409. // "https://www.googleapis.com/auth/compute.readonly"
  54410. // ]
  54411. // }
  54412. }
  54413. // method id "compute.globalForwardingRules.insert":
  54414. type GlobalForwardingRulesInsertCall struct {
  54415. s *Service
  54416. project string
  54417. forwardingrule *ForwardingRule
  54418. urlParams_ gensupport.URLParams
  54419. ctx_ context.Context
  54420. header_ http.Header
  54421. }
  54422. // Insert: Creates a GlobalForwardingRule resource in the specified
  54423. // project using the data included in the request.
  54424. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  54425. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  54426. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54427. c.project = project
  54428. c.forwardingrule = forwardingrule
  54429. return c
  54430. }
  54431. // RequestId sets the optional parameter "requestId": An optional
  54432. // request ID to identify requests. Specify a unique request ID so that
  54433. // if you must retry your request, the server will know to ignore the
  54434. // request if it has already been completed.
  54435. //
  54436. // For example, consider a situation where you make an initial request
  54437. // and the request times out. If you make the request again with the
  54438. // same request ID, the server can check if original operation with the
  54439. // same request ID was received, and if so, will ignore the second
  54440. // request. This prevents clients from accidentally creating duplicate
  54441. // commitments.
  54442. //
  54443. // The request ID must be a valid UUID with the exception that zero UUID
  54444. // is not supported (00000000-0000-0000-0000-000000000000).
  54445. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  54446. c.urlParams_.Set("requestId", requestId)
  54447. return c
  54448. }
  54449. // Fields allows partial responses to be retrieved. See
  54450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54451. // for more information.
  54452. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  54453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54454. return c
  54455. }
  54456. // Context sets the context to be used in this call's Do method. Any
  54457. // pending HTTP request will be aborted if the provided context is
  54458. // canceled.
  54459. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  54460. c.ctx_ = ctx
  54461. return c
  54462. }
  54463. // Header returns an http.Header that can be modified by the caller to
  54464. // add HTTP headers to the request.
  54465. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  54466. if c.header_ == nil {
  54467. c.header_ = make(http.Header)
  54468. }
  54469. return c.header_
  54470. }
  54471. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  54472. reqHeaders := make(http.Header)
  54473. for k, v := range c.header_ {
  54474. reqHeaders[k] = v
  54475. }
  54476. reqHeaders.Set("User-Agent", c.s.userAgent())
  54477. var body io.Reader = nil
  54478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  54479. if err != nil {
  54480. return nil, err
  54481. }
  54482. reqHeaders.Set("Content-Type", "application/json")
  54483. c.urlParams_.Set("alt", alt)
  54484. c.urlParams_.Set("prettyPrint", "false")
  54485. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  54486. urls += "?" + c.urlParams_.Encode()
  54487. req, err := http.NewRequest("POST", urls, body)
  54488. if err != nil {
  54489. return nil, err
  54490. }
  54491. req.Header = reqHeaders
  54492. googleapi.Expand(req.URL, map[string]string{
  54493. "project": c.project,
  54494. })
  54495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54496. }
  54497. // Do executes the "compute.globalForwardingRules.insert" call.
  54498. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54499. // status code is an error. Response headers are in either
  54500. // *Operation.ServerResponse.Header or (if a response was returned at
  54501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54502. // to check whether the returned error was because
  54503. // http.StatusNotModified was returned.
  54504. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54505. gensupport.SetOptions(c.urlParams_, opts...)
  54506. res, err := c.doRequest("json")
  54507. if res != nil && res.StatusCode == http.StatusNotModified {
  54508. if res.Body != nil {
  54509. res.Body.Close()
  54510. }
  54511. return nil, &googleapi.Error{
  54512. Code: res.StatusCode,
  54513. Header: res.Header,
  54514. }
  54515. }
  54516. if err != nil {
  54517. return nil, err
  54518. }
  54519. defer googleapi.CloseBody(res)
  54520. if err := googleapi.CheckResponse(res); err != nil {
  54521. return nil, err
  54522. }
  54523. ret := &Operation{
  54524. ServerResponse: googleapi.ServerResponse{
  54525. Header: res.Header,
  54526. HTTPStatusCode: res.StatusCode,
  54527. },
  54528. }
  54529. target := &ret
  54530. if err := gensupport.DecodeResponse(target, res); err != nil {
  54531. return nil, err
  54532. }
  54533. return ret, nil
  54534. // {
  54535. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  54536. // "httpMethod": "POST",
  54537. // "id": "compute.globalForwardingRules.insert",
  54538. // "parameterOrder": [
  54539. // "project"
  54540. // ],
  54541. // "parameters": {
  54542. // "project": {
  54543. // "description": "Project ID for this request.",
  54544. // "location": "path",
  54545. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54546. // "required": true,
  54547. // "type": "string"
  54548. // },
  54549. // "requestId": {
  54550. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54551. // "location": "query",
  54552. // "type": "string"
  54553. // }
  54554. // },
  54555. // "path": "{project}/global/forwardingRules",
  54556. // "request": {
  54557. // "$ref": "ForwardingRule"
  54558. // },
  54559. // "response": {
  54560. // "$ref": "Operation"
  54561. // },
  54562. // "scopes": [
  54563. // "https://www.googleapis.com/auth/cloud-platform",
  54564. // "https://www.googleapis.com/auth/compute"
  54565. // ]
  54566. // }
  54567. }
  54568. // method id "compute.globalForwardingRules.list":
  54569. type GlobalForwardingRulesListCall struct {
  54570. s *Service
  54571. project string
  54572. urlParams_ gensupport.URLParams
  54573. ifNoneMatch_ string
  54574. ctx_ context.Context
  54575. header_ http.Header
  54576. }
  54577. // List: Retrieves a list of GlobalForwardingRule resources available to
  54578. // the specified project.
  54579. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  54580. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  54581. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54582. c.project = project
  54583. return c
  54584. }
  54585. // Filter sets the optional parameter "filter": A filter expression that
  54586. // filters resources listed in the response. The expression must specify
  54587. // the field name, a comparison operator, and the value that you want to
  54588. // use for filtering. The value must be a string, a number, or a
  54589. // boolean. The comparison operator must be either =, !=, >, or <.
  54590. //
  54591. // For example, if you are filtering Compute Engine instances, you can
  54592. // exclude instances named example-instance by specifying name !=
  54593. // example-instance.
  54594. //
  54595. // You can also filter nested fields. For example, you could specify
  54596. // scheduling.automaticRestart = false to include instances only if they
  54597. // are not scheduled for automatic restarts. You can use filtering on
  54598. // nested fields to filter based on resource labels.
  54599. //
  54600. // To filter on multiple expressions, provide each separate expression
  54601. // within parentheses. For example, (scheduling.automaticRestart = true)
  54602. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  54603. // AND expression. However, you can include AND and OR expressions
  54604. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  54605. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  54606. // true).
  54607. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  54608. c.urlParams_.Set("filter", filter)
  54609. return c
  54610. }
  54611. // MaxResults sets the optional parameter "maxResults": The maximum
  54612. // number of results per page that should be returned. If the number of
  54613. // available results is larger than maxResults, Compute Engine returns a
  54614. // nextPageToken that can be used to get the next page of results in
  54615. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  54616. // (Default: 500)
  54617. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  54618. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  54619. return c
  54620. }
  54621. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  54622. // a certain order. By default, results are returned in alphanumerical
  54623. // order based on the resource name.
  54624. //
  54625. // You can also sort results in descending order based on the creation
  54626. // timestamp using orderBy="creationTimestamp desc". This sorts results
  54627. // based on the creationTimestamp field in reverse chronological order
  54628. // (newest result first). Use this to sort resources like operations so
  54629. // that the newest operation is returned first.
  54630. //
  54631. // Currently, only sorting by name or creationTimestamp desc is
  54632. // supported.
  54633. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  54634. c.urlParams_.Set("orderBy", orderBy)
  54635. return c
  54636. }
  54637. // PageToken sets the optional parameter "pageToken": Specifies a page
  54638. // token to use. Set pageToken to the nextPageToken returned by a
  54639. // previous list request to get the next page of results.
  54640. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  54641. c.urlParams_.Set("pageToken", pageToken)
  54642. return c
  54643. }
  54644. // Fields allows partial responses to be retrieved. See
  54645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54646. // for more information.
  54647. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  54648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54649. return c
  54650. }
  54651. // IfNoneMatch sets the optional parameter which makes the operation
  54652. // fail if the object's ETag matches the given value. This is useful for
  54653. // getting updates only after the object has changed since the last
  54654. // request. Use googleapi.IsNotModified to check whether the response
  54655. // error from Do is the result of In-None-Match.
  54656. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  54657. c.ifNoneMatch_ = entityTag
  54658. return c
  54659. }
  54660. // Context sets the context to be used in this call's Do method. Any
  54661. // pending HTTP request will be aborted if the provided context is
  54662. // canceled.
  54663. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  54664. c.ctx_ = ctx
  54665. return c
  54666. }
  54667. // Header returns an http.Header that can be modified by the caller to
  54668. // add HTTP headers to the request.
  54669. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  54670. if c.header_ == nil {
  54671. c.header_ = make(http.Header)
  54672. }
  54673. return c.header_
  54674. }
  54675. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  54676. reqHeaders := make(http.Header)
  54677. for k, v := range c.header_ {
  54678. reqHeaders[k] = v
  54679. }
  54680. reqHeaders.Set("User-Agent", c.s.userAgent())
  54681. if c.ifNoneMatch_ != "" {
  54682. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  54683. }
  54684. var body io.Reader = nil
  54685. c.urlParams_.Set("alt", alt)
  54686. c.urlParams_.Set("prettyPrint", "false")
  54687. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  54688. urls += "?" + c.urlParams_.Encode()
  54689. req, err := http.NewRequest("GET", urls, body)
  54690. if err != nil {
  54691. return nil, err
  54692. }
  54693. req.Header = reqHeaders
  54694. googleapi.Expand(req.URL, map[string]string{
  54695. "project": c.project,
  54696. })
  54697. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54698. }
  54699. // Do executes the "compute.globalForwardingRules.list" call.
  54700. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  54701. // non-2xx status code is an error. Response headers are in either
  54702. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  54703. // returned at all) in error.(*googleapi.Error).Header. Use
  54704. // googleapi.IsNotModified to check whether the returned error was
  54705. // because http.StatusNotModified was returned.
  54706. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  54707. gensupport.SetOptions(c.urlParams_, opts...)
  54708. res, err := c.doRequest("json")
  54709. if res != nil && res.StatusCode == http.StatusNotModified {
  54710. if res.Body != nil {
  54711. res.Body.Close()
  54712. }
  54713. return nil, &googleapi.Error{
  54714. Code: res.StatusCode,
  54715. Header: res.Header,
  54716. }
  54717. }
  54718. if err != nil {
  54719. return nil, err
  54720. }
  54721. defer googleapi.CloseBody(res)
  54722. if err := googleapi.CheckResponse(res); err != nil {
  54723. return nil, err
  54724. }
  54725. ret := &ForwardingRuleList{
  54726. ServerResponse: googleapi.ServerResponse{
  54727. Header: res.Header,
  54728. HTTPStatusCode: res.StatusCode,
  54729. },
  54730. }
  54731. target := &ret
  54732. if err := gensupport.DecodeResponse(target, res); err != nil {
  54733. return nil, err
  54734. }
  54735. return ret, nil
  54736. // {
  54737. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  54738. // "httpMethod": "GET",
  54739. // "id": "compute.globalForwardingRules.list",
  54740. // "parameterOrder": [
  54741. // "project"
  54742. // ],
  54743. // "parameters": {
  54744. // "filter": {
  54745. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  54746. // "location": "query",
  54747. // "type": "string"
  54748. // },
  54749. // "maxResults": {
  54750. // "default": "500",
  54751. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  54752. // "format": "uint32",
  54753. // "location": "query",
  54754. // "minimum": "0",
  54755. // "type": "integer"
  54756. // },
  54757. // "orderBy": {
  54758. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  54759. // "location": "query",
  54760. // "type": "string"
  54761. // },
  54762. // "pageToken": {
  54763. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  54764. // "location": "query",
  54765. // "type": "string"
  54766. // },
  54767. // "project": {
  54768. // "description": "Project ID for this request.",
  54769. // "location": "path",
  54770. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54771. // "required": true,
  54772. // "type": "string"
  54773. // }
  54774. // },
  54775. // "path": "{project}/global/forwardingRules",
  54776. // "response": {
  54777. // "$ref": "ForwardingRuleList"
  54778. // },
  54779. // "scopes": [
  54780. // "https://www.googleapis.com/auth/cloud-platform",
  54781. // "https://www.googleapis.com/auth/compute",
  54782. // "https://www.googleapis.com/auth/compute.readonly"
  54783. // ]
  54784. // }
  54785. }
  54786. // Pages invokes f for each page of results.
  54787. // A non-nil error returned from f will halt the iteration.
  54788. // The provided context supersedes any context provided to the Context method.
  54789. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  54790. c.ctx_ = ctx
  54791. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  54792. for {
  54793. x, err := c.Do()
  54794. if err != nil {
  54795. return err
  54796. }
  54797. if err := f(x); err != nil {
  54798. return err
  54799. }
  54800. if x.NextPageToken == "" {
  54801. return nil
  54802. }
  54803. c.PageToken(x.NextPageToken)
  54804. }
  54805. }
  54806. // method id "compute.globalForwardingRules.patch":
  54807. type GlobalForwardingRulesPatchCall struct {
  54808. s *Service
  54809. project string
  54810. forwardingRule string
  54811. forwardingrule *ForwardingRule
  54812. urlParams_ gensupport.URLParams
  54813. ctx_ context.Context
  54814. header_ http.Header
  54815. }
  54816. // Patch: Updates the specified forwarding rule with the data included
  54817. // in the request. This method supports PATCH semantics and uses the
  54818. // JSON merge patch format and processing rules. Currently, you can only
  54819. // patch the network_tier field.
  54820. func (r *GlobalForwardingRulesService) Patch(project string, forwardingRule string, forwardingrule *ForwardingRule) *GlobalForwardingRulesPatchCall {
  54821. c := &GlobalForwardingRulesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54822. c.project = project
  54823. c.forwardingRule = forwardingRule
  54824. c.forwardingrule = forwardingrule
  54825. return c
  54826. }
  54827. // RequestId sets the optional parameter "requestId": An optional
  54828. // request ID to identify requests. Specify a unique request ID so that
  54829. // if you must retry your request, the server will know to ignore the
  54830. // request if it has already been completed.
  54831. //
  54832. // For example, consider a situation where you make an initial request
  54833. // and the request times out. If you make the request again with the
  54834. // same request ID, the server can check if original operation with the
  54835. // same request ID was received, and if so, will ignore the second
  54836. // request. This prevents clients from accidentally creating duplicate
  54837. // commitments.
  54838. //
  54839. // The request ID must be a valid UUID with the exception that zero UUID
  54840. // is not supported (00000000-0000-0000-0000-000000000000).
  54841. func (c *GlobalForwardingRulesPatchCall) RequestId(requestId string) *GlobalForwardingRulesPatchCall {
  54842. c.urlParams_.Set("requestId", requestId)
  54843. return c
  54844. }
  54845. // Fields allows partial responses to be retrieved. See
  54846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54847. // for more information.
  54848. func (c *GlobalForwardingRulesPatchCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesPatchCall {
  54849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54850. return c
  54851. }
  54852. // Context sets the context to be used in this call's Do method. Any
  54853. // pending HTTP request will be aborted if the provided context is
  54854. // canceled.
  54855. func (c *GlobalForwardingRulesPatchCall) Context(ctx context.Context) *GlobalForwardingRulesPatchCall {
  54856. c.ctx_ = ctx
  54857. return c
  54858. }
  54859. // Header returns an http.Header that can be modified by the caller to
  54860. // add HTTP headers to the request.
  54861. func (c *GlobalForwardingRulesPatchCall) Header() http.Header {
  54862. if c.header_ == nil {
  54863. c.header_ = make(http.Header)
  54864. }
  54865. return c.header_
  54866. }
  54867. func (c *GlobalForwardingRulesPatchCall) doRequest(alt string) (*http.Response, error) {
  54868. reqHeaders := make(http.Header)
  54869. for k, v := range c.header_ {
  54870. reqHeaders[k] = v
  54871. }
  54872. reqHeaders.Set("User-Agent", c.s.userAgent())
  54873. var body io.Reader = nil
  54874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  54875. if err != nil {
  54876. return nil, err
  54877. }
  54878. reqHeaders.Set("Content-Type", "application/json")
  54879. c.urlParams_.Set("alt", alt)
  54880. c.urlParams_.Set("prettyPrint", "false")
  54881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  54882. urls += "?" + c.urlParams_.Encode()
  54883. req, err := http.NewRequest("PATCH", urls, body)
  54884. if err != nil {
  54885. return nil, err
  54886. }
  54887. req.Header = reqHeaders
  54888. googleapi.Expand(req.URL, map[string]string{
  54889. "project": c.project,
  54890. "forwardingRule": c.forwardingRule,
  54891. })
  54892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54893. }
  54894. // Do executes the "compute.globalForwardingRules.patch" call.
  54895. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54896. // status code is an error. Response headers are in either
  54897. // *Operation.ServerResponse.Header or (if a response was returned at
  54898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54899. // to check whether the returned error was because
  54900. // http.StatusNotModified was returned.
  54901. func (c *GlobalForwardingRulesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54902. gensupport.SetOptions(c.urlParams_, opts...)
  54903. res, err := c.doRequest("json")
  54904. if res != nil && res.StatusCode == http.StatusNotModified {
  54905. if res.Body != nil {
  54906. res.Body.Close()
  54907. }
  54908. return nil, &googleapi.Error{
  54909. Code: res.StatusCode,
  54910. Header: res.Header,
  54911. }
  54912. }
  54913. if err != nil {
  54914. return nil, err
  54915. }
  54916. defer googleapi.CloseBody(res)
  54917. if err := googleapi.CheckResponse(res); err != nil {
  54918. return nil, err
  54919. }
  54920. ret := &Operation{
  54921. ServerResponse: googleapi.ServerResponse{
  54922. Header: res.Header,
  54923. HTTPStatusCode: res.StatusCode,
  54924. },
  54925. }
  54926. target := &ret
  54927. if err := gensupport.DecodeResponse(target, res); err != nil {
  54928. return nil, err
  54929. }
  54930. return ret, nil
  54931. // {
  54932. // "description": "Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field.",
  54933. // "httpMethod": "PATCH",
  54934. // "id": "compute.globalForwardingRules.patch",
  54935. // "parameterOrder": [
  54936. // "project",
  54937. // "forwardingRule"
  54938. // ],
  54939. // "parameters": {
  54940. // "forwardingRule": {
  54941. // "description": "Name of the ForwardingRule resource to patch.",
  54942. // "location": "path",
  54943. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54944. // "required": true,
  54945. // "type": "string"
  54946. // },
  54947. // "project": {
  54948. // "description": "Project ID for this request.",
  54949. // "location": "path",
  54950. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54951. // "required": true,
  54952. // "type": "string"
  54953. // },
  54954. // "requestId": {
  54955. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54956. // "location": "query",
  54957. // "type": "string"
  54958. // }
  54959. // },
  54960. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  54961. // "request": {
  54962. // "$ref": "ForwardingRule"
  54963. // },
  54964. // "response": {
  54965. // "$ref": "Operation"
  54966. // },
  54967. // "scopes": [
  54968. // "https://www.googleapis.com/auth/cloud-platform",
  54969. // "https://www.googleapis.com/auth/compute"
  54970. // ]
  54971. // }
  54972. }
  54973. // method id "compute.globalForwardingRules.setLabels":
  54974. type GlobalForwardingRulesSetLabelsCall struct {
  54975. s *Service
  54976. project string
  54977. resource string
  54978. globalsetlabelsrequest *GlobalSetLabelsRequest
  54979. urlParams_ gensupport.URLParams
  54980. ctx_ context.Context
  54981. header_ http.Header
  54982. }
  54983. // SetLabels: Sets the labels on the specified resource. To learn more
  54984. // about labels, read the Labeling Resources documentation.
  54985. func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
  54986. c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54987. c.project = project
  54988. c.resource = resource
  54989. c.globalsetlabelsrequest = globalsetlabelsrequest
  54990. return c
  54991. }
  54992. // Fields allows partial responses to be retrieved. See
  54993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54994. // for more information.
  54995. func (c *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
  54996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54997. return c
  54998. }
  54999. // Context sets the context to be used in this call's Do method. Any
  55000. // pending HTTP request will be aborted if the provided context is
  55001. // canceled.
  55002. func (c *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
  55003. c.ctx_ = ctx
  55004. return c
  55005. }
  55006. // Header returns an http.Header that can be modified by the caller to
  55007. // add HTTP headers to the request.
  55008. func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
  55009. if c.header_ == nil {
  55010. c.header_ = make(http.Header)
  55011. }
  55012. return c.header_
  55013. }
  55014. func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  55015. reqHeaders := make(http.Header)
  55016. for k, v := range c.header_ {
  55017. reqHeaders[k] = v
  55018. }
  55019. reqHeaders.Set("User-Agent", c.s.userAgent())
  55020. var body io.Reader = nil
  55021. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  55022. if err != nil {
  55023. return nil, err
  55024. }
  55025. reqHeaders.Set("Content-Type", "application/json")
  55026. c.urlParams_.Set("alt", alt)
  55027. c.urlParams_.Set("prettyPrint", "false")
  55028. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/setLabels")
  55029. urls += "?" + c.urlParams_.Encode()
  55030. req, err := http.NewRequest("POST", urls, body)
  55031. if err != nil {
  55032. return nil, err
  55033. }
  55034. req.Header = reqHeaders
  55035. googleapi.Expand(req.URL, map[string]string{
  55036. "project": c.project,
  55037. "resource": c.resource,
  55038. })
  55039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55040. }
  55041. // Do executes the "compute.globalForwardingRules.setLabels" call.
  55042. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55043. // status code is an error. Response headers are in either
  55044. // *Operation.ServerResponse.Header or (if a response was returned at
  55045. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55046. // to check whether the returned error was because
  55047. // http.StatusNotModified was returned.
  55048. func (c *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55049. gensupport.SetOptions(c.urlParams_, opts...)
  55050. res, err := c.doRequest("json")
  55051. if res != nil && res.StatusCode == http.StatusNotModified {
  55052. if res.Body != nil {
  55053. res.Body.Close()
  55054. }
  55055. return nil, &googleapi.Error{
  55056. Code: res.StatusCode,
  55057. Header: res.Header,
  55058. }
  55059. }
  55060. if err != nil {
  55061. return nil, err
  55062. }
  55063. defer googleapi.CloseBody(res)
  55064. if err := googleapi.CheckResponse(res); err != nil {
  55065. return nil, err
  55066. }
  55067. ret := &Operation{
  55068. ServerResponse: googleapi.ServerResponse{
  55069. Header: res.Header,
  55070. HTTPStatusCode: res.StatusCode,
  55071. },
  55072. }
  55073. target := &ret
  55074. if err := gensupport.DecodeResponse(target, res); err != nil {
  55075. return nil, err
  55076. }
  55077. return ret, nil
  55078. // {
  55079. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  55080. // "httpMethod": "POST",
  55081. // "id": "compute.globalForwardingRules.setLabels",
  55082. // "parameterOrder": [
  55083. // "project",
  55084. // "resource"
  55085. // ],
  55086. // "parameters": {
  55087. // "project": {
  55088. // "description": "Project ID for this request.",
  55089. // "location": "path",
  55090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55091. // "required": true,
  55092. // "type": "string"
  55093. // },
  55094. // "resource": {
  55095. // "description": "Name or id of the resource for this request.",
  55096. // "location": "path",
  55097. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55098. // "required": true,
  55099. // "type": "string"
  55100. // }
  55101. // },
  55102. // "path": "{project}/global/forwardingRules/{resource}/setLabels",
  55103. // "request": {
  55104. // "$ref": "GlobalSetLabelsRequest"
  55105. // },
  55106. // "response": {
  55107. // "$ref": "Operation"
  55108. // },
  55109. // "scopes": [
  55110. // "https://www.googleapis.com/auth/cloud-platform",
  55111. // "https://www.googleapis.com/auth/compute"
  55112. // ]
  55113. // }
  55114. }
  55115. // method id "compute.globalForwardingRules.setTarget":
  55116. type GlobalForwardingRulesSetTargetCall struct {
  55117. s *Service
  55118. project string
  55119. forwardingRule string
  55120. targetreference *TargetReference
  55121. urlParams_ gensupport.URLParams
  55122. ctx_ context.Context
  55123. header_ http.Header
  55124. }
  55125. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  55126. // The new target should be of the same type as the old target.
  55127. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  55128. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  55129. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55130. c.project = project
  55131. c.forwardingRule = forwardingRule
  55132. c.targetreference = targetreference
  55133. return c
  55134. }
  55135. // RequestId sets the optional parameter "requestId": An optional
  55136. // request ID to identify requests. Specify a unique request ID so that
  55137. // if you must retry your request, the server will know to ignore the
  55138. // request if it has already been completed.
  55139. //
  55140. // For example, consider a situation where you make an initial request
  55141. // and the request times out. If you make the request again with the
  55142. // same request ID, the server can check if original operation with the
  55143. // same request ID was received, and if so, will ignore the second
  55144. // request. This prevents clients from accidentally creating duplicate
  55145. // commitments.
  55146. //
  55147. // The request ID must be a valid UUID with the exception that zero UUID
  55148. // is not supported (00000000-0000-0000-0000-000000000000).
  55149. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  55150. c.urlParams_.Set("requestId", requestId)
  55151. return c
  55152. }
  55153. // Fields allows partial responses to be retrieved. See
  55154. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55155. // for more information.
  55156. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  55157. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55158. return c
  55159. }
  55160. // Context sets the context to be used in this call's Do method. Any
  55161. // pending HTTP request will be aborted if the provided context is
  55162. // canceled.
  55163. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  55164. c.ctx_ = ctx
  55165. return c
  55166. }
  55167. // Header returns an http.Header that can be modified by the caller to
  55168. // add HTTP headers to the request.
  55169. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  55170. if c.header_ == nil {
  55171. c.header_ = make(http.Header)
  55172. }
  55173. return c.header_
  55174. }
  55175. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  55176. reqHeaders := make(http.Header)
  55177. for k, v := range c.header_ {
  55178. reqHeaders[k] = v
  55179. }
  55180. reqHeaders.Set("User-Agent", c.s.userAgent())
  55181. var body io.Reader = nil
  55182. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  55183. if err != nil {
  55184. return nil, err
  55185. }
  55186. reqHeaders.Set("Content-Type", "application/json")
  55187. c.urlParams_.Set("alt", alt)
  55188. c.urlParams_.Set("prettyPrint", "false")
  55189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  55190. urls += "?" + c.urlParams_.Encode()
  55191. req, err := http.NewRequest("POST", urls, body)
  55192. if err != nil {
  55193. return nil, err
  55194. }
  55195. req.Header = reqHeaders
  55196. googleapi.Expand(req.URL, map[string]string{
  55197. "project": c.project,
  55198. "forwardingRule": c.forwardingRule,
  55199. })
  55200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55201. }
  55202. // Do executes the "compute.globalForwardingRules.setTarget" call.
  55203. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55204. // status code is an error. Response headers are in either
  55205. // *Operation.ServerResponse.Header or (if a response was returned at
  55206. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55207. // to check whether the returned error was because
  55208. // http.StatusNotModified was returned.
  55209. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55210. gensupport.SetOptions(c.urlParams_, opts...)
  55211. res, err := c.doRequest("json")
  55212. if res != nil && res.StatusCode == http.StatusNotModified {
  55213. if res.Body != nil {
  55214. res.Body.Close()
  55215. }
  55216. return nil, &googleapi.Error{
  55217. Code: res.StatusCode,
  55218. Header: res.Header,
  55219. }
  55220. }
  55221. if err != nil {
  55222. return nil, err
  55223. }
  55224. defer googleapi.CloseBody(res)
  55225. if err := googleapi.CheckResponse(res); err != nil {
  55226. return nil, err
  55227. }
  55228. ret := &Operation{
  55229. ServerResponse: googleapi.ServerResponse{
  55230. Header: res.Header,
  55231. HTTPStatusCode: res.StatusCode,
  55232. },
  55233. }
  55234. target := &ret
  55235. if err := gensupport.DecodeResponse(target, res); err != nil {
  55236. return nil, err
  55237. }
  55238. return ret, nil
  55239. // {
  55240. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  55241. // "httpMethod": "POST",
  55242. // "id": "compute.globalForwardingRules.setTarget",
  55243. // "parameterOrder": [
  55244. // "project",
  55245. // "forwardingRule"
  55246. // ],
  55247. // "parameters": {
  55248. // "forwardingRule": {
  55249. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  55250. // "location": "path",
  55251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55252. // "required": true,
  55253. // "type": "string"
  55254. // },
  55255. // "project": {
  55256. // "description": "Project ID for this request.",
  55257. // "location": "path",
  55258. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55259. // "required": true,
  55260. // "type": "string"
  55261. // },
  55262. // "requestId": {
  55263. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55264. // "location": "query",
  55265. // "type": "string"
  55266. // }
  55267. // },
  55268. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  55269. // "request": {
  55270. // "$ref": "TargetReference"
  55271. // },
  55272. // "response": {
  55273. // "$ref": "Operation"
  55274. // },
  55275. // "scopes": [
  55276. // "https://www.googleapis.com/auth/cloud-platform",
  55277. // "https://www.googleapis.com/auth/compute"
  55278. // ]
  55279. // }
  55280. }
  55281. // method id "compute.globalForwardingRules.testIamPermissions":
  55282. type GlobalForwardingRulesTestIamPermissionsCall struct {
  55283. s *Service
  55284. project string
  55285. resource string
  55286. testpermissionsrequest *TestPermissionsRequest
  55287. urlParams_ gensupport.URLParams
  55288. ctx_ context.Context
  55289. header_ http.Header
  55290. }
  55291. // TestIamPermissions: Returns permissions that a caller has on the
  55292. // specified resource.
  55293. func (r *GlobalForwardingRulesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalForwardingRulesTestIamPermissionsCall {
  55294. c := &GlobalForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55295. c.project = project
  55296. c.resource = resource
  55297. c.testpermissionsrequest = testpermissionsrequest
  55298. return c
  55299. }
  55300. // Fields allows partial responses to be retrieved. See
  55301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55302. // for more information.
  55303. func (c *GlobalForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesTestIamPermissionsCall {
  55304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55305. return c
  55306. }
  55307. // Context sets the context to be used in this call's Do method. Any
  55308. // pending HTTP request will be aborted if the provided context is
  55309. // canceled.
  55310. func (c *GlobalForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *GlobalForwardingRulesTestIamPermissionsCall {
  55311. c.ctx_ = ctx
  55312. return c
  55313. }
  55314. // Header returns an http.Header that can be modified by the caller to
  55315. // add HTTP headers to the request.
  55316. func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header {
  55317. if c.header_ == nil {
  55318. c.header_ = make(http.Header)
  55319. }
  55320. return c.header_
  55321. }
  55322. func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  55323. reqHeaders := make(http.Header)
  55324. for k, v := range c.header_ {
  55325. reqHeaders[k] = v
  55326. }
  55327. reqHeaders.Set("User-Agent", c.s.userAgent())
  55328. var body io.Reader = nil
  55329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  55330. if err != nil {
  55331. return nil, err
  55332. }
  55333. reqHeaders.Set("Content-Type", "application/json")
  55334. c.urlParams_.Set("alt", alt)
  55335. c.urlParams_.Set("prettyPrint", "false")
  55336. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/testIamPermissions")
  55337. urls += "?" + c.urlParams_.Encode()
  55338. req, err := http.NewRequest("POST", urls, body)
  55339. if err != nil {
  55340. return nil, err
  55341. }
  55342. req.Header = reqHeaders
  55343. googleapi.Expand(req.URL, map[string]string{
  55344. "project": c.project,
  55345. "resource": c.resource,
  55346. })
  55347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55348. }
  55349. // Do executes the "compute.globalForwardingRules.testIamPermissions" call.
  55350. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  55351. // non-2xx status code is an error. Response headers are in either
  55352. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  55353. // returned at all) in error.(*googleapi.Error).Header. Use
  55354. // googleapi.IsNotModified to check whether the returned error was
  55355. // because http.StatusNotModified was returned.
  55356. func (c *GlobalForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  55357. gensupport.SetOptions(c.urlParams_, opts...)
  55358. res, err := c.doRequest("json")
  55359. if res != nil && res.StatusCode == http.StatusNotModified {
  55360. if res.Body != nil {
  55361. res.Body.Close()
  55362. }
  55363. return nil, &googleapi.Error{
  55364. Code: res.StatusCode,
  55365. Header: res.Header,
  55366. }
  55367. }
  55368. if err != nil {
  55369. return nil, err
  55370. }
  55371. defer googleapi.CloseBody(res)
  55372. if err := googleapi.CheckResponse(res); err != nil {
  55373. return nil, err
  55374. }
  55375. ret := &TestPermissionsResponse{
  55376. ServerResponse: googleapi.ServerResponse{
  55377. Header: res.Header,
  55378. HTTPStatusCode: res.StatusCode,
  55379. },
  55380. }
  55381. target := &ret
  55382. if err := gensupport.DecodeResponse(target, res); err != nil {
  55383. return nil, err
  55384. }
  55385. return ret, nil
  55386. // {
  55387. // "description": "Returns permissions that a caller has on the specified resource.",
  55388. // "httpMethod": "POST",
  55389. // "id": "compute.globalForwardingRules.testIamPermissions",
  55390. // "parameterOrder": [
  55391. // "project",
  55392. // "resource"
  55393. // ],
  55394. // "parameters": {
  55395. // "project": {
  55396. // "description": "Project ID for this request.",
  55397. // "location": "path",
  55398. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55399. // "required": true,
  55400. // "type": "string"
  55401. // },
  55402. // "resource": {
  55403. // "description": "Name or id of the resource for this request.",
  55404. // "location": "path",
  55405. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55406. // "required": true,
  55407. // "type": "string"
  55408. // }
  55409. // },
  55410. // "path": "{project}/global/forwardingRules/{resource}/testIamPermissions",
  55411. // "request": {
  55412. // "$ref": "TestPermissionsRequest"
  55413. // },
  55414. // "response": {
  55415. // "$ref": "TestPermissionsResponse"
  55416. // },
  55417. // "scopes": [
  55418. // "https://www.googleapis.com/auth/cloud-platform",
  55419. // "https://www.googleapis.com/auth/compute",
  55420. // "https://www.googleapis.com/auth/compute.readonly"
  55421. // ]
  55422. // }
  55423. }
  55424. // method id "compute.globalOperations.aggregatedList":
  55425. type GlobalOperationsAggregatedListCall struct {
  55426. s *Service
  55427. project string
  55428. urlParams_ gensupport.URLParams
  55429. ifNoneMatch_ string
  55430. ctx_ context.Context
  55431. header_ http.Header
  55432. }
  55433. // AggregatedList: Retrieves an aggregated list of all operations.
  55434. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  55435. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  55436. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55437. c.project = project
  55438. return c
  55439. }
  55440. // Filter sets the optional parameter "filter": A filter expression that
  55441. // filters resources listed in the response. The expression must specify
  55442. // the field name, a comparison operator, and the value that you want to
  55443. // use for filtering. The value must be a string, a number, or a
  55444. // boolean. The comparison operator must be either =, !=, >, or <.
  55445. //
  55446. // For example, if you are filtering Compute Engine instances, you can
  55447. // exclude instances named example-instance by specifying name !=
  55448. // example-instance.
  55449. //
  55450. // You can also filter nested fields. For example, you could specify
  55451. // scheduling.automaticRestart = false to include instances only if they
  55452. // are not scheduled for automatic restarts. You can use filtering on
  55453. // nested fields to filter based on resource labels.
  55454. //
  55455. // To filter on multiple expressions, provide each separate expression
  55456. // within parentheses. For example, (scheduling.automaticRestart = true)
  55457. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55458. // AND expression. However, you can include AND and OR expressions
  55459. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55460. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55461. // true).
  55462. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  55463. c.urlParams_.Set("filter", filter)
  55464. return c
  55465. }
  55466. // MaxResults sets the optional parameter "maxResults": The maximum
  55467. // number of results per page that should be returned. If the number of
  55468. // available results is larger than maxResults, Compute Engine returns a
  55469. // nextPageToken that can be used to get the next page of results in
  55470. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55471. // (Default: 500)
  55472. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  55473. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55474. return c
  55475. }
  55476. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55477. // a certain order. By default, results are returned in alphanumerical
  55478. // order based on the resource name.
  55479. //
  55480. // You can also sort results in descending order based on the creation
  55481. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55482. // based on the creationTimestamp field in reverse chronological order
  55483. // (newest result first). Use this to sort resources like operations so
  55484. // that the newest operation is returned first.
  55485. //
  55486. // Currently, only sorting by name or creationTimestamp desc is
  55487. // supported.
  55488. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  55489. c.urlParams_.Set("orderBy", orderBy)
  55490. return c
  55491. }
  55492. // PageToken sets the optional parameter "pageToken": Specifies a page
  55493. // token to use. Set pageToken to the nextPageToken returned by a
  55494. // previous list request to get the next page of results.
  55495. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  55496. c.urlParams_.Set("pageToken", pageToken)
  55497. return c
  55498. }
  55499. // Fields allows partial responses to be retrieved. See
  55500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55501. // for more information.
  55502. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  55503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55504. return c
  55505. }
  55506. // IfNoneMatch sets the optional parameter which makes the operation
  55507. // fail if the object's ETag matches the given value. This is useful for
  55508. // getting updates only after the object has changed since the last
  55509. // request. Use googleapi.IsNotModified to check whether the response
  55510. // error from Do is the result of In-None-Match.
  55511. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  55512. c.ifNoneMatch_ = entityTag
  55513. return c
  55514. }
  55515. // Context sets the context to be used in this call's Do method. Any
  55516. // pending HTTP request will be aborted if the provided context is
  55517. // canceled.
  55518. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  55519. c.ctx_ = ctx
  55520. return c
  55521. }
  55522. // Header returns an http.Header that can be modified by the caller to
  55523. // add HTTP headers to the request.
  55524. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  55525. if c.header_ == nil {
  55526. c.header_ = make(http.Header)
  55527. }
  55528. return c.header_
  55529. }
  55530. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  55531. reqHeaders := make(http.Header)
  55532. for k, v := range c.header_ {
  55533. reqHeaders[k] = v
  55534. }
  55535. reqHeaders.Set("User-Agent", c.s.userAgent())
  55536. if c.ifNoneMatch_ != "" {
  55537. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55538. }
  55539. var body io.Reader = nil
  55540. c.urlParams_.Set("alt", alt)
  55541. c.urlParams_.Set("prettyPrint", "false")
  55542. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  55543. urls += "?" + c.urlParams_.Encode()
  55544. req, err := http.NewRequest("GET", urls, body)
  55545. if err != nil {
  55546. return nil, err
  55547. }
  55548. req.Header = reqHeaders
  55549. googleapi.Expand(req.URL, map[string]string{
  55550. "project": c.project,
  55551. })
  55552. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55553. }
  55554. // Do executes the "compute.globalOperations.aggregatedList" call.
  55555. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  55556. // non-2xx status code is an error. Response headers are in either
  55557. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  55558. // returned at all) in error.(*googleapi.Error).Header. Use
  55559. // googleapi.IsNotModified to check whether the returned error was
  55560. // because http.StatusNotModified was returned.
  55561. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  55562. gensupport.SetOptions(c.urlParams_, opts...)
  55563. res, err := c.doRequest("json")
  55564. if res != nil && res.StatusCode == http.StatusNotModified {
  55565. if res.Body != nil {
  55566. res.Body.Close()
  55567. }
  55568. return nil, &googleapi.Error{
  55569. Code: res.StatusCode,
  55570. Header: res.Header,
  55571. }
  55572. }
  55573. if err != nil {
  55574. return nil, err
  55575. }
  55576. defer googleapi.CloseBody(res)
  55577. if err := googleapi.CheckResponse(res); err != nil {
  55578. return nil, err
  55579. }
  55580. ret := &OperationAggregatedList{
  55581. ServerResponse: googleapi.ServerResponse{
  55582. Header: res.Header,
  55583. HTTPStatusCode: res.StatusCode,
  55584. },
  55585. }
  55586. target := &ret
  55587. if err := gensupport.DecodeResponse(target, res); err != nil {
  55588. return nil, err
  55589. }
  55590. return ret, nil
  55591. // {
  55592. // "description": "Retrieves an aggregated list of all operations.",
  55593. // "httpMethod": "GET",
  55594. // "id": "compute.globalOperations.aggregatedList",
  55595. // "parameterOrder": [
  55596. // "project"
  55597. // ],
  55598. // "parameters": {
  55599. // "filter": {
  55600. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  55601. // "location": "query",
  55602. // "type": "string"
  55603. // },
  55604. // "maxResults": {
  55605. // "default": "500",
  55606. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  55607. // "format": "uint32",
  55608. // "location": "query",
  55609. // "minimum": "0",
  55610. // "type": "integer"
  55611. // },
  55612. // "orderBy": {
  55613. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  55614. // "location": "query",
  55615. // "type": "string"
  55616. // },
  55617. // "pageToken": {
  55618. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  55619. // "location": "query",
  55620. // "type": "string"
  55621. // },
  55622. // "project": {
  55623. // "description": "Project ID for this request.",
  55624. // "location": "path",
  55625. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55626. // "required": true,
  55627. // "type": "string"
  55628. // }
  55629. // },
  55630. // "path": "{project}/aggregated/operations",
  55631. // "response": {
  55632. // "$ref": "OperationAggregatedList"
  55633. // },
  55634. // "scopes": [
  55635. // "https://www.googleapis.com/auth/cloud-platform",
  55636. // "https://www.googleapis.com/auth/compute",
  55637. // "https://www.googleapis.com/auth/compute.readonly"
  55638. // ]
  55639. // }
  55640. }
  55641. // Pages invokes f for each page of results.
  55642. // A non-nil error returned from f will halt the iteration.
  55643. // The provided context supersedes any context provided to the Context method.
  55644. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  55645. c.ctx_ = ctx
  55646. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  55647. for {
  55648. x, err := c.Do()
  55649. if err != nil {
  55650. return err
  55651. }
  55652. if err := f(x); err != nil {
  55653. return err
  55654. }
  55655. if x.NextPageToken == "" {
  55656. return nil
  55657. }
  55658. c.PageToken(x.NextPageToken)
  55659. }
  55660. }
  55661. // method id "compute.globalOperations.delete":
  55662. type GlobalOperationsDeleteCall struct {
  55663. s *Service
  55664. project string
  55665. operation string
  55666. urlParams_ gensupport.URLParams
  55667. ctx_ context.Context
  55668. header_ http.Header
  55669. }
  55670. // Delete: Deletes the specified Operations resource.
  55671. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  55672. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  55673. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55674. c.project = project
  55675. c.operation = operation
  55676. return c
  55677. }
  55678. // Fields allows partial responses to be retrieved. See
  55679. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55680. // for more information.
  55681. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  55682. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55683. return c
  55684. }
  55685. // Context sets the context to be used in this call's Do method. Any
  55686. // pending HTTP request will be aborted if the provided context is
  55687. // canceled.
  55688. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  55689. c.ctx_ = ctx
  55690. return c
  55691. }
  55692. // Header returns an http.Header that can be modified by the caller to
  55693. // add HTTP headers to the request.
  55694. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  55695. if c.header_ == nil {
  55696. c.header_ = make(http.Header)
  55697. }
  55698. return c.header_
  55699. }
  55700. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  55701. reqHeaders := make(http.Header)
  55702. for k, v := range c.header_ {
  55703. reqHeaders[k] = v
  55704. }
  55705. reqHeaders.Set("User-Agent", c.s.userAgent())
  55706. var body io.Reader = nil
  55707. c.urlParams_.Set("alt", alt)
  55708. c.urlParams_.Set("prettyPrint", "false")
  55709. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  55710. urls += "?" + c.urlParams_.Encode()
  55711. req, err := http.NewRequest("DELETE", urls, body)
  55712. if err != nil {
  55713. return nil, err
  55714. }
  55715. req.Header = reqHeaders
  55716. googleapi.Expand(req.URL, map[string]string{
  55717. "project": c.project,
  55718. "operation": c.operation,
  55719. })
  55720. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55721. }
  55722. // Do executes the "compute.globalOperations.delete" call.
  55723. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  55724. gensupport.SetOptions(c.urlParams_, opts...)
  55725. res, err := c.doRequest("json")
  55726. if err != nil {
  55727. return err
  55728. }
  55729. defer googleapi.CloseBody(res)
  55730. if err := googleapi.CheckResponse(res); err != nil {
  55731. return err
  55732. }
  55733. return nil
  55734. // {
  55735. // "description": "Deletes the specified Operations resource.",
  55736. // "httpMethod": "DELETE",
  55737. // "id": "compute.globalOperations.delete",
  55738. // "parameterOrder": [
  55739. // "project",
  55740. // "operation"
  55741. // ],
  55742. // "parameters": {
  55743. // "operation": {
  55744. // "description": "Name of the Operations resource to delete.",
  55745. // "location": "path",
  55746. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55747. // "required": true,
  55748. // "type": "string"
  55749. // },
  55750. // "project": {
  55751. // "description": "Project ID for this request.",
  55752. // "location": "path",
  55753. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55754. // "required": true,
  55755. // "type": "string"
  55756. // }
  55757. // },
  55758. // "path": "{project}/global/operations/{operation}",
  55759. // "scopes": [
  55760. // "https://www.googleapis.com/auth/cloud-platform",
  55761. // "https://www.googleapis.com/auth/compute"
  55762. // ]
  55763. // }
  55764. }
  55765. // method id "compute.globalOperations.get":
  55766. type GlobalOperationsGetCall struct {
  55767. s *Service
  55768. project string
  55769. operation string
  55770. urlParams_ gensupport.URLParams
  55771. ifNoneMatch_ string
  55772. ctx_ context.Context
  55773. header_ http.Header
  55774. }
  55775. // Get: Retrieves the specified Operations resource. Gets a list of
  55776. // operations by making a list() request.
  55777. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  55778. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  55779. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55780. c.project = project
  55781. c.operation = operation
  55782. return c
  55783. }
  55784. // Fields allows partial responses to be retrieved. See
  55785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55786. // for more information.
  55787. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  55788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55789. return c
  55790. }
  55791. // IfNoneMatch sets the optional parameter which makes the operation
  55792. // fail if the object's ETag matches the given value. This is useful for
  55793. // getting updates only after the object has changed since the last
  55794. // request. Use googleapi.IsNotModified to check whether the response
  55795. // error from Do is the result of In-None-Match.
  55796. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  55797. c.ifNoneMatch_ = entityTag
  55798. return c
  55799. }
  55800. // Context sets the context to be used in this call's Do method. Any
  55801. // pending HTTP request will be aborted if the provided context is
  55802. // canceled.
  55803. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  55804. c.ctx_ = ctx
  55805. return c
  55806. }
  55807. // Header returns an http.Header that can be modified by the caller to
  55808. // add HTTP headers to the request.
  55809. func (c *GlobalOperationsGetCall) Header() http.Header {
  55810. if c.header_ == nil {
  55811. c.header_ = make(http.Header)
  55812. }
  55813. return c.header_
  55814. }
  55815. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  55816. reqHeaders := make(http.Header)
  55817. for k, v := range c.header_ {
  55818. reqHeaders[k] = v
  55819. }
  55820. reqHeaders.Set("User-Agent", c.s.userAgent())
  55821. if c.ifNoneMatch_ != "" {
  55822. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  55823. }
  55824. var body io.Reader = nil
  55825. c.urlParams_.Set("alt", alt)
  55826. c.urlParams_.Set("prettyPrint", "false")
  55827. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  55828. urls += "?" + c.urlParams_.Encode()
  55829. req, err := http.NewRequest("GET", urls, body)
  55830. if err != nil {
  55831. return nil, err
  55832. }
  55833. req.Header = reqHeaders
  55834. googleapi.Expand(req.URL, map[string]string{
  55835. "project": c.project,
  55836. "operation": c.operation,
  55837. })
  55838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55839. }
  55840. // Do executes the "compute.globalOperations.get" call.
  55841. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55842. // status code is an error. Response headers are in either
  55843. // *Operation.ServerResponse.Header or (if a response was returned at
  55844. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55845. // to check whether the returned error was because
  55846. // http.StatusNotModified was returned.
  55847. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55848. gensupport.SetOptions(c.urlParams_, opts...)
  55849. res, err := c.doRequest("json")
  55850. if res != nil && res.StatusCode == http.StatusNotModified {
  55851. if res.Body != nil {
  55852. res.Body.Close()
  55853. }
  55854. return nil, &googleapi.Error{
  55855. Code: res.StatusCode,
  55856. Header: res.Header,
  55857. }
  55858. }
  55859. if err != nil {
  55860. return nil, err
  55861. }
  55862. defer googleapi.CloseBody(res)
  55863. if err := googleapi.CheckResponse(res); err != nil {
  55864. return nil, err
  55865. }
  55866. ret := &Operation{
  55867. ServerResponse: googleapi.ServerResponse{
  55868. Header: res.Header,
  55869. HTTPStatusCode: res.StatusCode,
  55870. },
  55871. }
  55872. target := &ret
  55873. if err := gensupport.DecodeResponse(target, res); err != nil {
  55874. return nil, err
  55875. }
  55876. return ret, nil
  55877. // {
  55878. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  55879. // "httpMethod": "GET",
  55880. // "id": "compute.globalOperations.get",
  55881. // "parameterOrder": [
  55882. // "project",
  55883. // "operation"
  55884. // ],
  55885. // "parameters": {
  55886. // "operation": {
  55887. // "description": "Name of the Operations resource to return.",
  55888. // "location": "path",
  55889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55890. // "required": true,
  55891. // "type": "string"
  55892. // },
  55893. // "project": {
  55894. // "description": "Project ID for this request.",
  55895. // "location": "path",
  55896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55897. // "required": true,
  55898. // "type": "string"
  55899. // }
  55900. // },
  55901. // "path": "{project}/global/operations/{operation}",
  55902. // "response": {
  55903. // "$ref": "Operation"
  55904. // },
  55905. // "scopes": [
  55906. // "https://www.googleapis.com/auth/cloud-platform",
  55907. // "https://www.googleapis.com/auth/compute",
  55908. // "https://www.googleapis.com/auth/compute.readonly"
  55909. // ]
  55910. // }
  55911. }
  55912. // method id "compute.globalOperations.list":
  55913. type GlobalOperationsListCall struct {
  55914. s *Service
  55915. project string
  55916. urlParams_ gensupport.URLParams
  55917. ifNoneMatch_ string
  55918. ctx_ context.Context
  55919. header_ http.Header
  55920. }
  55921. // List: Retrieves a list of Operation resources contained within the
  55922. // specified project.
  55923. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  55924. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  55925. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55926. c.project = project
  55927. return c
  55928. }
  55929. // Filter sets the optional parameter "filter": A filter expression that
  55930. // filters resources listed in the response. The expression must specify
  55931. // the field name, a comparison operator, and the value that you want to
  55932. // use for filtering. The value must be a string, a number, or a
  55933. // boolean. The comparison operator must be either =, !=, >, or <.
  55934. //
  55935. // For example, if you are filtering Compute Engine instances, you can
  55936. // exclude instances named example-instance by specifying name !=
  55937. // example-instance.
  55938. //
  55939. // You can also filter nested fields. For example, you could specify
  55940. // scheduling.automaticRestart = false to include instances only if they
  55941. // are not scheduled for automatic restarts. You can use filtering on
  55942. // nested fields to filter based on resource labels.
  55943. //
  55944. // To filter on multiple expressions, provide each separate expression
  55945. // within parentheses. For example, (scheduling.automaticRestart = true)
  55946. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  55947. // AND expression. However, you can include AND and OR expressions
  55948. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  55949. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  55950. // true).
  55951. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  55952. c.urlParams_.Set("filter", filter)
  55953. return c
  55954. }
  55955. // MaxResults sets the optional parameter "maxResults": The maximum
  55956. // number of results per page that should be returned. If the number of
  55957. // available results is larger than maxResults, Compute Engine returns a
  55958. // nextPageToken that can be used to get the next page of results in
  55959. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  55960. // (Default: 500)
  55961. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  55962. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  55963. return c
  55964. }
  55965. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  55966. // a certain order. By default, results are returned in alphanumerical
  55967. // order based on the resource name.
  55968. //
  55969. // You can also sort results in descending order based on the creation
  55970. // timestamp using orderBy="creationTimestamp desc". This sorts results
  55971. // based on the creationTimestamp field in reverse chronological order
  55972. // (newest result first). Use this to sort resources like operations so
  55973. // that the newest operation is returned first.
  55974. //
  55975. // Currently, only sorting by name or creationTimestamp desc is
  55976. // supported.
  55977. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  55978. c.urlParams_.Set("orderBy", orderBy)
  55979. return c
  55980. }
  55981. // PageToken sets the optional parameter "pageToken": Specifies a page
  55982. // token to use. Set pageToken to the nextPageToken returned by a
  55983. // previous list request to get the next page of results.
  55984. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  55985. c.urlParams_.Set("pageToken", pageToken)
  55986. return c
  55987. }
  55988. // Fields allows partial responses to be retrieved. See
  55989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55990. // for more information.
  55991. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  55992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55993. return c
  55994. }
  55995. // IfNoneMatch sets the optional parameter which makes the operation
  55996. // fail if the object's ETag matches the given value. This is useful for
  55997. // getting updates only after the object has changed since the last
  55998. // request. Use googleapi.IsNotModified to check whether the response
  55999. // error from Do is the result of In-None-Match.
  56000. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  56001. c.ifNoneMatch_ = entityTag
  56002. return c
  56003. }
  56004. // Context sets the context to be used in this call's Do method. Any
  56005. // pending HTTP request will be aborted if the provided context is
  56006. // canceled.
  56007. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  56008. c.ctx_ = ctx
  56009. return c
  56010. }
  56011. // Header returns an http.Header that can be modified by the caller to
  56012. // add HTTP headers to the request.
  56013. func (c *GlobalOperationsListCall) Header() http.Header {
  56014. if c.header_ == nil {
  56015. c.header_ = make(http.Header)
  56016. }
  56017. return c.header_
  56018. }
  56019. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  56020. reqHeaders := make(http.Header)
  56021. for k, v := range c.header_ {
  56022. reqHeaders[k] = v
  56023. }
  56024. reqHeaders.Set("User-Agent", c.s.userAgent())
  56025. if c.ifNoneMatch_ != "" {
  56026. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56027. }
  56028. var body io.Reader = nil
  56029. c.urlParams_.Set("alt", alt)
  56030. c.urlParams_.Set("prettyPrint", "false")
  56031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  56032. urls += "?" + c.urlParams_.Encode()
  56033. req, err := http.NewRequest("GET", urls, body)
  56034. if err != nil {
  56035. return nil, err
  56036. }
  56037. req.Header = reqHeaders
  56038. googleapi.Expand(req.URL, map[string]string{
  56039. "project": c.project,
  56040. })
  56041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56042. }
  56043. // Do executes the "compute.globalOperations.list" call.
  56044. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  56045. // status code is an error. Response headers are in either
  56046. // *OperationList.ServerResponse.Header or (if a response was returned
  56047. // at all) in error.(*googleapi.Error).Header. Use
  56048. // googleapi.IsNotModified to check whether the returned error was
  56049. // because http.StatusNotModified was returned.
  56050. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  56051. gensupport.SetOptions(c.urlParams_, opts...)
  56052. res, err := c.doRequest("json")
  56053. if res != nil && res.StatusCode == http.StatusNotModified {
  56054. if res.Body != nil {
  56055. res.Body.Close()
  56056. }
  56057. return nil, &googleapi.Error{
  56058. Code: res.StatusCode,
  56059. Header: res.Header,
  56060. }
  56061. }
  56062. if err != nil {
  56063. return nil, err
  56064. }
  56065. defer googleapi.CloseBody(res)
  56066. if err := googleapi.CheckResponse(res); err != nil {
  56067. return nil, err
  56068. }
  56069. ret := &OperationList{
  56070. ServerResponse: googleapi.ServerResponse{
  56071. Header: res.Header,
  56072. HTTPStatusCode: res.StatusCode,
  56073. },
  56074. }
  56075. target := &ret
  56076. if err := gensupport.DecodeResponse(target, res); err != nil {
  56077. return nil, err
  56078. }
  56079. return ret, nil
  56080. // {
  56081. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  56082. // "httpMethod": "GET",
  56083. // "id": "compute.globalOperations.list",
  56084. // "parameterOrder": [
  56085. // "project"
  56086. // ],
  56087. // "parameters": {
  56088. // "filter": {
  56089. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  56090. // "location": "query",
  56091. // "type": "string"
  56092. // },
  56093. // "maxResults": {
  56094. // "default": "500",
  56095. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56096. // "format": "uint32",
  56097. // "location": "query",
  56098. // "minimum": "0",
  56099. // "type": "integer"
  56100. // },
  56101. // "orderBy": {
  56102. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56103. // "location": "query",
  56104. // "type": "string"
  56105. // },
  56106. // "pageToken": {
  56107. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56108. // "location": "query",
  56109. // "type": "string"
  56110. // },
  56111. // "project": {
  56112. // "description": "Project ID for this request.",
  56113. // "location": "path",
  56114. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56115. // "required": true,
  56116. // "type": "string"
  56117. // }
  56118. // },
  56119. // "path": "{project}/global/operations",
  56120. // "response": {
  56121. // "$ref": "OperationList"
  56122. // },
  56123. // "scopes": [
  56124. // "https://www.googleapis.com/auth/cloud-platform",
  56125. // "https://www.googleapis.com/auth/compute",
  56126. // "https://www.googleapis.com/auth/compute.readonly"
  56127. // ]
  56128. // }
  56129. }
  56130. // Pages invokes f for each page of results.
  56131. // A non-nil error returned from f will halt the iteration.
  56132. // The provided context supersedes any context provided to the Context method.
  56133. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  56134. c.ctx_ = ctx
  56135. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56136. for {
  56137. x, err := c.Do()
  56138. if err != nil {
  56139. return err
  56140. }
  56141. if err := f(x); err != nil {
  56142. return err
  56143. }
  56144. if x.NextPageToken == "" {
  56145. return nil
  56146. }
  56147. c.PageToken(x.NextPageToken)
  56148. }
  56149. }
  56150. // method id "compute.globalOperations.wait":
  56151. type GlobalOperationsWaitCall struct {
  56152. s *Service
  56153. project string
  56154. operation string
  56155. urlParams_ gensupport.URLParams
  56156. ctx_ context.Context
  56157. header_ http.Header
  56158. }
  56159. // Wait: Waits for the specified Operations resource until it is done or
  56160. // timeout, and retrieves the specified Operations resource. 1.
  56161. // Immediately returns when the operation is already done. 2. Waits for
  56162. // no more than the default deadline (2 minutes, subject to change) and
  56163. // then returns the current state of the operation, which may be DONE or
  56164. // still in progress. 3. Is best-effort: a. The server can wait less
  56165. // than the default deadline or zero seconds, in overload situations. b.
  56166. // There is no guarantee that the operation is actually done when
  56167. // returns. 4. User should be prepared to retry if the operation is not
  56168. // DONE.
  56169. func (r *GlobalOperationsService) Wait(project string, operation string) *GlobalOperationsWaitCall {
  56170. c := &GlobalOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56171. c.project = project
  56172. c.operation = operation
  56173. return c
  56174. }
  56175. // Fields allows partial responses to be retrieved. See
  56176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56177. // for more information.
  56178. func (c *GlobalOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOperationsWaitCall {
  56179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56180. return c
  56181. }
  56182. // Context sets the context to be used in this call's Do method. Any
  56183. // pending HTTP request will be aborted if the provided context is
  56184. // canceled.
  56185. func (c *GlobalOperationsWaitCall) Context(ctx context.Context) *GlobalOperationsWaitCall {
  56186. c.ctx_ = ctx
  56187. return c
  56188. }
  56189. // Header returns an http.Header that can be modified by the caller to
  56190. // add HTTP headers to the request.
  56191. func (c *GlobalOperationsWaitCall) Header() http.Header {
  56192. if c.header_ == nil {
  56193. c.header_ = make(http.Header)
  56194. }
  56195. return c.header_
  56196. }
  56197. func (c *GlobalOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  56198. reqHeaders := make(http.Header)
  56199. for k, v := range c.header_ {
  56200. reqHeaders[k] = v
  56201. }
  56202. reqHeaders.Set("User-Agent", c.s.userAgent())
  56203. var body io.Reader = nil
  56204. c.urlParams_.Set("alt", alt)
  56205. c.urlParams_.Set("prettyPrint", "false")
  56206. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}/wait")
  56207. urls += "?" + c.urlParams_.Encode()
  56208. req, err := http.NewRequest("POST", urls, body)
  56209. if err != nil {
  56210. return nil, err
  56211. }
  56212. req.Header = reqHeaders
  56213. googleapi.Expand(req.URL, map[string]string{
  56214. "project": c.project,
  56215. "operation": c.operation,
  56216. })
  56217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56218. }
  56219. // Do executes the "compute.globalOperations.wait" call.
  56220. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56221. // status code is an error. Response headers are in either
  56222. // *Operation.ServerResponse.Header or (if a response was returned at
  56223. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56224. // to check whether the returned error was because
  56225. // http.StatusNotModified was returned.
  56226. func (c *GlobalOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56227. gensupport.SetOptions(c.urlParams_, opts...)
  56228. res, err := c.doRequest("json")
  56229. if res != nil && res.StatusCode == http.StatusNotModified {
  56230. if res.Body != nil {
  56231. res.Body.Close()
  56232. }
  56233. return nil, &googleapi.Error{
  56234. Code: res.StatusCode,
  56235. Header: res.Header,
  56236. }
  56237. }
  56238. if err != nil {
  56239. return nil, err
  56240. }
  56241. defer googleapi.CloseBody(res)
  56242. if err := googleapi.CheckResponse(res); err != nil {
  56243. return nil, err
  56244. }
  56245. ret := &Operation{
  56246. ServerResponse: googleapi.ServerResponse{
  56247. Header: res.Header,
  56248. HTTPStatusCode: res.StatusCode,
  56249. },
  56250. }
  56251. target := &ret
  56252. if err := gensupport.DecodeResponse(target, res); err != nil {
  56253. return nil, err
  56254. }
  56255. return ret, nil
  56256. // {
  56257. // "description": "Waits for the specified Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  56258. // "httpMethod": "POST",
  56259. // "id": "compute.globalOperations.wait",
  56260. // "parameterOrder": [
  56261. // "project",
  56262. // "operation"
  56263. // ],
  56264. // "parameters": {
  56265. // "operation": {
  56266. // "description": "Name of the Operations resource to return.",
  56267. // "location": "path",
  56268. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56269. // "required": true,
  56270. // "type": "string"
  56271. // },
  56272. // "project": {
  56273. // "description": "Project ID for this request.",
  56274. // "location": "path",
  56275. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56276. // "required": true,
  56277. // "type": "string"
  56278. // }
  56279. // },
  56280. // "path": "{project}/global/operations/{operation}/wait",
  56281. // "response": {
  56282. // "$ref": "Operation"
  56283. // },
  56284. // "scopes": [
  56285. // "https://www.googleapis.com/auth/cloud-platform",
  56286. // "https://www.googleapis.com/auth/compute",
  56287. // "https://www.googleapis.com/auth/compute.readonly"
  56288. // ]
  56289. // }
  56290. }
  56291. // method id "compute.globalOrganizationOperations.delete":
  56292. type GlobalOrganizationOperationsDeleteCall struct {
  56293. s *Service
  56294. operation string
  56295. urlParams_ gensupport.URLParams
  56296. ctx_ context.Context
  56297. header_ http.Header
  56298. }
  56299. // Delete: Deletes the specified Operations resource.
  56300. func (r *GlobalOrganizationOperationsService) Delete(operation string) *GlobalOrganizationOperationsDeleteCall {
  56301. c := &GlobalOrganizationOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56302. c.operation = operation
  56303. return c
  56304. }
  56305. // ParentId sets the optional parameter "parentId": Parent ID for this
  56306. // request.
  56307. func (c *GlobalOrganizationOperationsDeleteCall) ParentId(parentId string) *GlobalOrganizationOperationsDeleteCall {
  56308. c.urlParams_.Set("parentId", parentId)
  56309. return c
  56310. }
  56311. // Fields allows partial responses to be retrieved. See
  56312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56313. // for more information.
  56314. func (c *GlobalOrganizationOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsDeleteCall {
  56315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56316. return c
  56317. }
  56318. // Context sets the context to be used in this call's Do method. Any
  56319. // pending HTTP request will be aborted if the provided context is
  56320. // canceled.
  56321. func (c *GlobalOrganizationOperationsDeleteCall) Context(ctx context.Context) *GlobalOrganizationOperationsDeleteCall {
  56322. c.ctx_ = ctx
  56323. return c
  56324. }
  56325. // Header returns an http.Header that can be modified by the caller to
  56326. // add HTTP headers to the request.
  56327. func (c *GlobalOrganizationOperationsDeleteCall) Header() http.Header {
  56328. if c.header_ == nil {
  56329. c.header_ = make(http.Header)
  56330. }
  56331. return c.header_
  56332. }
  56333. func (c *GlobalOrganizationOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  56334. reqHeaders := make(http.Header)
  56335. for k, v := range c.header_ {
  56336. reqHeaders[k] = v
  56337. }
  56338. reqHeaders.Set("User-Agent", c.s.userAgent())
  56339. var body io.Reader = nil
  56340. c.urlParams_.Set("alt", alt)
  56341. c.urlParams_.Set("prettyPrint", "false")
  56342. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}")
  56343. urls += "?" + c.urlParams_.Encode()
  56344. req, err := http.NewRequest("DELETE", urls, body)
  56345. if err != nil {
  56346. return nil, err
  56347. }
  56348. req.Header = reqHeaders
  56349. googleapi.Expand(req.URL, map[string]string{
  56350. "operation": c.operation,
  56351. })
  56352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56353. }
  56354. // Do executes the "compute.globalOrganizationOperations.delete" call.
  56355. func (c *GlobalOrganizationOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  56356. gensupport.SetOptions(c.urlParams_, opts...)
  56357. res, err := c.doRequest("json")
  56358. if err != nil {
  56359. return err
  56360. }
  56361. defer googleapi.CloseBody(res)
  56362. if err := googleapi.CheckResponse(res); err != nil {
  56363. return err
  56364. }
  56365. return nil
  56366. // {
  56367. // "description": "Deletes the specified Operations resource.",
  56368. // "httpMethod": "DELETE",
  56369. // "id": "compute.globalOrganizationOperations.delete",
  56370. // "parameterOrder": [
  56371. // "operation"
  56372. // ],
  56373. // "parameters": {
  56374. // "operation": {
  56375. // "description": "Name of the Operations resource to delete.",
  56376. // "location": "path",
  56377. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56378. // "required": true,
  56379. // "type": "string"
  56380. // },
  56381. // "parentId": {
  56382. // "description": "Parent ID for this request.",
  56383. // "location": "query",
  56384. // "type": "string"
  56385. // }
  56386. // },
  56387. // "path": "locations/global/operations/{operation}",
  56388. // "scopes": [
  56389. // "https://www.googleapis.com/auth/cloud-platform",
  56390. // "https://www.googleapis.com/auth/compute"
  56391. // ]
  56392. // }
  56393. }
  56394. // method id "compute.globalOrganizationOperations.get":
  56395. type GlobalOrganizationOperationsGetCall struct {
  56396. s *Service
  56397. operation string
  56398. urlParams_ gensupport.URLParams
  56399. ifNoneMatch_ string
  56400. ctx_ context.Context
  56401. header_ http.Header
  56402. }
  56403. // Get: Retrieves the specified Operations resource. Gets a list of
  56404. // operations by making a list() request.
  56405. func (r *GlobalOrganizationOperationsService) Get(operation string) *GlobalOrganizationOperationsGetCall {
  56406. c := &GlobalOrganizationOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56407. c.operation = operation
  56408. return c
  56409. }
  56410. // ParentId sets the optional parameter "parentId": Parent ID for this
  56411. // request.
  56412. func (c *GlobalOrganizationOperationsGetCall) ParentId(parentId string) *GlobalOrganizationOperationsGetCall {
  56413. c.urlParams_.Set("parentId", parentId)
  56414. return c
  56415. }
  56416. // Fields allows partial responses to be retrieved. See
  56417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56418. // for more information.
  56419. func (c *GlobalOrganizationOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsGetCall {
  56420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56421. return c
  56422. }
  56423. // IfNoneMatch sets the optional parameter which makes the operation
  56424. // fail if the object's ETag matches the given value. This is useful for
  56425. // getting updates only after the object has changed since the last
  56426. // request. Use googleapi.IsNotModified to check whether the response
  56427. // error from Do is the result of In-None-Match.
  56428. func (c *GlobalOrganizationOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsGetCall {
  56429. c.ifNoneMatch_ = entityTag
  56430. return c
  56431. }
  56432. // Context sets the context to be used in this call's Do method. Any
  56433. // pending HTTP request will be aborted if the provided context is
  56434. // canceled.
  56435. func (c *GlobalOrganizationOperationsGetCall) Context(ctx context.Context) *GlobalOrganizationOperationsGetCall {
  56436. c.ctx_ = ctx
  56437. return c
  56438. }
  56439. // Header returns an http.Header that can be modified by the caller to
  56440. // add HTTP headers to the request.
  56441. func (c *GlobalOrganizationOperationsGetCall) Header() http.Header {
  56442. if c.header_ == nil {
  56443. c.header_ = make(http.Header)
  56444. }
  56445. return c.header_
  56446. }
  56447. func (c *GlobalOrganizationOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  56448. reqHeaders := make(http.Header)
  56449. for k, v := range c.header_ {
  56450. reqHeaders[k] = v
  56451. }
  56452. reqHeaders.Set("User-Agent", c.s.userAgent())
  56453. if c.ifNoneMatch_ != "" {
  56454. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56455. }
  56456. var body io.Reader = nil
  56457. c.urlParams_.Set("alt", alt)
  56458. c.urlParams_.Set("prettyPrint", "false")
  56459. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}")
  56460. urls += "?" + c.urlParams_.Encode()
  56461. req, err := http.NewRequest("GET", urls, body)
  56462. if err != nil {
  56463. return nil, err
  56464. }
  56465. req.Header = reqHeaders
  56466. googleapi.Expand(req.URL, map[string]string{
  56467. "operation": c.operation,
  56468. })
  56469. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56470. }
  56471. // Do executes the "compute.globalOrganizationOperations.get" call.
  56472. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56473. // status code is an error. Response headers are in either
  56474. // *Operation.ServerResponse.Header or (if a response was returned at
  56475. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56476. // to check whether the returned error was because
  56477. // http.StatusNotModified was returned.
  56478. func (c *GlobalOrganizationOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56479. gensupport.SetOptions(c.urlParams_, opts...)
  56480. res, err := c.doRequest("json")
  56481. if res != nil && res.StatusCode == http.StatusNotModified {
  56482. if res.Body != nil {
  56483. res.Body.Close()
  56484. }
  56485. return nil, &googleapi.Error{
  56486. Code: res.StatusCode,
  56487. Header: res.Header,
  56488. }
  56489. }
  56490. if err != nil {
  56491. return nil, err
  56492. }
  56493. defer googleapi.CloseBody(res)
  56494. if err := googleapi.CheckResponse(res); err != nil {
  56495. return nil, err
  56496. }
  56497. ret := &Operation{
  56498. ServerResponse: googleapi.ServerResponse{
  56499. Header: res.Header,
  56500. HTTPStatusCode: res.StatusCode,
  56501. },
  56502. }
  56503. target := &ret
  56504. if err := gensupport.DecodeResponse(target, res); err != nil {
  56505. return nil, err
  56506. }
  56507. return ret, nil
  56508. // {
  56509. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  56510. // "httpMethod": "GET",
  56511. // "id": "compute.globalOrganizationOperations.get",
  56512. // "parameterOrder": [
  56513. // "operation"
  56514. // ],
  56515. // "parameters": {
  56516. // "operation": {
  56517. // "description": "Name of the Operations resource to return.",
  56518. // "location": "path",
  56519. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56520. // "required": true,
  56521. // "type": "string"
  56522. // },
  56523. // "parentId": {
  56524. // "description": "Parent ID for this request.",
  56525. // "location": "query",
  56526. // "type": "string"
  56527. // }
  56528. // },
  56529. // "path": "locations/global/operations/{operation}",
  56530. // "response": {
  56531. // "$ref": "Operation"
  56532. // },
  56533. // "scopes": [
  56534. // "https://www.googleapis.com/auth/cloud-platform",
  56535. // "https://www.googleapis.com/auth/compute",
  56536. // "https://www.googleapis.com/auth/compute.readonly"
  56537. // ]
  56538. // }
  56539. }
  56540. // method id "compute.globalOrganizationOperations.list":
  56541. type GlobalOrganizationOperationsListCall struct {
  56542. s *Service
  56543. urlParams_ gensupport.URLParams
  56544. ifNoneMatch_ string
  56545. ctx_ context.Context
  56546. header_ http.Header
  56547. }
  56548. // List: Retrieves a list of Operation resources contained within the
  56549. // specified organization.
  56550. func (r *GlobalOrganizationOperationsService) List() *GlobalOrganizationOperationsListCall {
  56551. c := &GlobalOrganizationOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56552. return c
  56553. }
  56554. // Filter sets the optional parameter "filter": A filter expression that
  56555. // filters resources listed in the response. The expression must specify
  56556. // the field name, a comparison operator, and the value that you want to
  56557. // use for filtering. The value must be a string, a number, or a
  56558. // boolean. The comparison operator must be either =, !=, >, or <.
  56559. //
  56560. // For example, if you are filtering Compute Engine instances, you can
  56561. // exclude instances named example-instance by specifying name !=
  56562. // example-instance.
  56563. //
  56564. // You can also filter nested fields. For example, you could specify
  56565. // scheduling.automaticRestart = false to include instances only if they
  56566. // are not scheduled for automatic restarts. You can use filtering on
  56567. // nested fields to filter based on resource labels.
  56568. //
  56569. // To filter on multiple expressions, provide each separate expression
  56570. // within parentheses. For example, (scheduling.automaticRestart = true)
  56571. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56572. // AND expression. However, you can include AND and OR expressions
  56573. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56574. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56575. // true).
  56576. func (c *GlobalOrganizationOperationsListCall) Filter(filter string) *GlobalOrganizationOperationsListCall {
  56577. c.urlParams_.Set("filter", filter)
  56578. return c
  56579. }
  56580. // MaxResults sets the optional parameter "maxResults": The maximum
  56581. // number of results per page that should be returned. If the number of
  56582. // available results is larger than maxResults, Compute Engine returns a
  56583. // nextPageToken that can be used to get the next page of results in
  56584. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56585. // (Default: 500)
  56586. func (c *GlobalOrganizationOperationsListCall) MaxResults(maxResults int64) *GlobalOrganizationOperationsListCall {
  56587. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56588. return c
  56589. }
  56590. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56591. // a certain order. By default, results are returned in alphanumerical
  56592. // order based on the resource name.
  56593. //
  56594. // You can also sort results in descending order based on the creation
  56595. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56596. // based on the creationTimestamp field in reverse chronological order
  56597. // (newest result first). Use this to sort resources like operations so
  56598. // that the newest operation is returned first.
  56599. //
  56600. // Currently, only sorting by name or creationTimestamp desc is
  56601. // supported.
  56602. func (c *GlobalOrganizationOperationsListCall) OrderBy(orderBy string) *GlobalOrganizationOperationsListCall {
  56603. c.urlParams_.Set("orderBy", orderBy)
  56604. return c
  56605. }
  56606. // PageToken sets the optional parameter "pageToken": Specifies a page
  56607. // token to use. Set pageToken to the nextPageToken returned by a
  56608. // previous list request to get the next page of results.
  56609. func (c *GlobalOrganizationOperationsListCall) PageToken(pageToken string) *GlobalOrganizationOperationsListCall {
  56610. c.urlParams_.Set("pageToken", pageToken)
  56611. return c
  56612. }
  56613. // ParentId sets the optional parameter "parentId": Parent ID for this
  56614. // request.
  56615. func (c *GlobalOrganizationOperationsListCall) ParentId(parentId string) *GlobalOrganizationOperationsListCall {
  56616. c.urlParams_.Set("parentId", parentId)
  56617. return c
  56618. }
  56619. // Fields allows partial responses to be retrieved. See
  56620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56621. // for more information.
  56622. func (c *GlobalOrganizationOperationsListCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsListCall {
  56623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56624. return c
  56625. }
  56626. // IfNoneMatch sets the optional parameter which makes the operation
  56627. // fail if the object's ETag matches the given value. This is useful for
  56628. // getting updates only after the object has changed since the last
  56629. // request. Use googleapi.IsNotModified to check whether the response
  56630. // error from Do is the result of In-None-Match.
  56631. func (c *GlobalOrganizationOperationsListCall) IfNoneMatch(entityTag string) *GlobalOrganizationOperationsListCall {
  56632. c.ifNoneMatch_ = entityTag
  56633. return c
  56634. }
  56635. // Context sets the context to be used in this call's Do method. Any
  56636. // pending HTTP request will be aborted if the provided context is
  56637. // canceled.
  56638. func (c *GlobalOrganizationOperationsListCall) Context(ctx context.Context) *GlobalOrganizationOperationsListCall {
  56639. c.ctx_ = ctx
  56640. return c
  56641. }
  56642. // Header returns an http.Header that can be modified by the caller to
  56643. // add HTTP headers to the request.
  56644. func (c *GlobalOrganizationOperationsListCall) Header() http.Header {
  56645. if c.header_ == nil {
  56646. c.header_ = make(http.Header)
  56647. }
  56648. return c.header_
  56649. }
  56650. func (c *GlobalOrganizationOperationsListCall) doRequest(alt string) (*http.Response, error) {
  56651. reqHeaders := make(http.Header)
  56652. for k, v := range c.header_ {
  56653. reqHeaders[k] = v
  56654. }
  56655. reqHeaders.Set("User-Agent", c.s.userAgent())
  56656. if c.ifNoneMatch_ != "" {
  56657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56658. }
  56659. var body io.Reader = nil
  56660. c.urlParams_.Set("alt", alt)
  56661. c.urlParams_.Set("prettyPrint", "false")
  56662. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations")
  56663. urls += "?" + c.urlParams_.Encode()
  56664. req, err := http.NewRequest("GET", urls, body)
  56665. if err != nil {
  56666. return nil, err
  56667. }
  56668. req.Header = reqHeaders
  56669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56670. }
  56671. // Do executes the "compute.globalOrganizationOperations.list" call.
  56672. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  56673. // status code is an error. Response headers are in either
  56674. // *OperationList.ServerResponse.Header or (if a response was returned
  56675. // at all) in error.(*googleapi.Error).Header. Use
  56676. // googleapi.IsNotModified to check whether the returned error was
  56677. // because http.StatusNotModified was returned.
  56678. func (c *GlobalOrganizationOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  56679. gensupport.SetOptions(c.urlParams_, opts...)
  56680. res, err := c.doRequest("json")
  56681. if res != nil && res.StatusCode == http.StatusNotModified {
  56682. if res.Body != nil {
  56683. res.Body.Close()
  56684. }
  56685. return nil, &googleapi.Error{
  56686. Code: res.StatusCode,
  56687. Header: res.Header,
  56688. }
  56689. }
  56690. if err != nil {
  56691. return nil, err
  56692. }
  56693. defer googleapi.CloseBody(res)
  56694. if err := googleapi.CheckResponse(res); err != nil {
  56695. return nil, err
  56696. }
  56697. ret := &OperationList{
  56698. ServerResponse: googleapi.ServerResponse{
  56699. Header: res.Header,
  56700. HTTPStatusCode: res.StatusCode,
  56701. },
  56702. }
  56703. target := &ret
  56704. if err := gensupport.DecodeResponse(target, res); err != nil {
  56705. return nil, err
  56706. }
  56707. return ret, nil
  56708. // {
  56709. // "description": "Retrieves a list of Operation resources contained within the specified organization.",
  56710. // "httpMethod": "GET",
  56711. // "id": "compute.globalOrganizationOperations.list",
  56712. // "parameters": {
  56713. // "filter": {
  56714. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  56715. // "location": "query",
  56716. // "type": "string"
  56717. // },
  56718. // "maxResults": {
  56719. // "default": "500",
  56720. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56721. // "format": "uint32",
  56722. // "location": "query",
  56723. // "minimum": "0",
  56724. // "type": "integer"
  56725. // },
  56726. // "orderBy": {
  56727. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56728. // "location": "query",
  56729. // "type": "string"
  56730. // },
  56731. // "pageToken": {
  56732. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56733. // "location": "query",
  56734. // "type": "string"
  56735. // },
  56736. // "parentId": {
  56737. // "description": "Parent ID for this request.",
  56738. // "location": "query",
  56739. // "type": "string"
  56740. // }
  56741. // },
  56742. // "path": "locations/global/operations",
  56743. // "response": {
  56744. // "$ref": "OperationList"
  56745. // },
  56746. // "scopes": [
  56747. // "https://www.googleapis.com/auth/cloud-platform",
  56748. // "https://www.googleapis.com/auth/compute",
  56749. // "https://www.googleapis.com/auth/compute.readonly"
  56750. // ]
  56751. // }
  56752. }
  56753. // Pages invokes f for each page of results.
  56754. // A non-nil error returned from f will halt the iteration.
  56755. // The provided context supersedes any context provided to the Context method.
  56756. func (c *GlobalOrganizationOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  56757. c.ctx_ = ctx
  56758. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56759. for {
  56760. x, err := c.Do()
  56761. if err != nil {
  56762. return err
  56763. }
  56764. if err := f(x); err != nil {
  56765. return err
  56766. }
  56767. if x.NextPageToken == "" {
  56768. return nil
  56769. }
  56770. c.PageToken(x.NextPageToken)
  56771. }
  56772. }
  56773. // method id "compute.globalOrganizationOperations.wait":
  56774. type GlobalOrganizationOperationsWaitCall struct {
  56775. s *Service
  56776. operation string
  56777. urlParams_ gensupport.URLParams
  56778. ctx_ context.Context
  56779. header_ http.Header
  56780. }
  56781. // Wait: Waits for the specified Operations resource until it is done or
  56782. // timeout, and retrieves the specified Operations resource. 1.
  56783. // Immediately returns when the operation is already done. 2. Waits for
  56784. // no more than the default deadline (2 minutes, subject to change) and
  56785. // then returns the current state of the operation, which may be DONE or
  56786. // still in progress. 3. Is best-effort: a. The server can wait less
  56787. // than the default deadline or zero seconds, in overload situations. b.
  56788. // There is no guarantee that the operation is actually done when
  56789. // returns. 4. User should be prepared to retry if the operation is not
  56790. // DONE.
  56791. func (r *GlobalOrganizationOperationsService) Wait(operation string) *GlobalOrganizationOperationsWaitCall {
  56792. c := &GlobalOrganizationOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56793. c.operation = operation
  56794. return c
  56795. }
  56796. // ParentId sets the optional parameter "parentId": Parent ID for this
  56797. // request.
  56798. func (c *GlobalOrganizationOperationsWaitCall) ParentId(parentId string) *GlobalOrganizationOperationsWaitCall {
  56799. c.urlParams_.Set("parentId", parentId)
  56800. return c
  56801. }
  56802. // Fields allows partial responses to be retrieved. See
  56803. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56804. // for more information.
  56805. func (c *GlobalOrganizationOperationsWaitCall) Fields(s ...googleapi.Field) *GlobalOrganizationOperationsWaitCall {
  56806. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56807. return c
  56808. }
  56809. // Context sets the context to be used in this call's Do method. Any
  56810. // pending HTTP request will be aborted if the provided context is
  56811. // canceled.
  56812. func (c *GlobalOrganizationOperationsWaitCall) Context(ctx context.Context) *GlobalOrganizationOperationsWaitCall {
  56813. c.ctx_ = ctx
  56814. return c
  56815. }
  56816. // Header returns an http.Header that can be modified by the caller to
  56817. // add HTTP headers to the request.
  56818. func (c *GlobalOrganizationOperationsWaitCall) Header() http.Header {
  56819. if c.header_ == nil {
  56820. c.header_ = make(http.Header)
  56821. }
  56822. return c.header_
  56823. }
  56824. func (c *GlobalOrganizationOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  56825. reqHeaders := make(http.Header)
  56826. for k, v := range c.header_ {
  56827. reqHeaders[k] = v
  56828. }
  56829. reqHeaders.Set("User-Agent", c.s.userAgent())
  56830. var body io.Reader = nil
  56831. c.urlParams_.Set("alt", alt)
  56832. c.urlParams_.Set("prettyPrint", "false")
  56833. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/operations/{operation}/wait")
  56834. urls += "?" + c.urlParams_.Encode()
  56835. req, err := http.NewRequest("POST", urls, body)
  56836. if err != nil {
  56837. return nil, err
  56838. }
  56839. req.Header = reqHeaders
  56840. googleapi.Expand(req.URL, map[string]string{
  56841. "operation": c.operation,
  56842. })
  56843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56844. }
  56845. // Do executes the "compute.globalOrganizationOperations.wait" call.
  56846. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56847. // status code is an error. Response headers are in either
  56848. // *Operation.ServerResponse.Header or (if a response was returned at
  56849. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56850. // to check whether the returned error was because
  56851. // http.StatusNotModified was returned.
  56852. func (c *GlobalOrganizationOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56853. gensupport.SetOptions(c.urlParams_, opts...)
  56854. res, err := c.doRequest("json")
  56855. if res != nil && res.StatusCode == http.StatusNotModified {
  56856. if res.Body != nil {
  56857. res.Body.Close()
  56858. }
  56859. return nil, &googleapi.Error{
  56860. Code: res.StatusCode,
  56861. Header: res.Header,
  56862. }
  56863. }
  56864. if err != nil {
  56865. return nil, err
  56866. }
  56867. defer googleapi.CloseBody(res)
  56868. if err := googleapi.CheckResponse(res); err != nil {
  56869. return nil, err
  56870. }
  56871. ret := &Operation{
  56872. ServerResponse: googleapi.ServerResponse{
  56873. Header: res.Header,
  56874. HTTPStatusCode: res.StatusCode,
  56875. },
  56876. }
  56877. target := &ret
  56878. if err := gensupport.DecodeResponse(target, res); err != nil {
  56879. return nil, err
  56880. }
  56881. return ret, nil
  56882. // {
  56883. // "description": "Waits for the specified Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  56884. // "httpMethod": "POST",
  56885. // "id": "compute.globalOrganizationOperations.wait",
  56886. // "parameterOrder": [
  56887. // "operation"
  56888. // ],
  56889. // "parameters": {
  56890. // "operation": {
  56891. // "description": "Name of the Operations resource to return.",
  56892. // "location": "path",
  56893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56894. // "required": true,
  56895. // "type": "string"
  56896. // },
  56897. // "parentId": {
  56898. // "description": "Parent ID for this request.",
  56899. // "location": "query",
  56900. // "type": "string"
  56901. // }
  56902. // },
  56903. // "path": "locations/global/operations/{operation}/wait",
  56904. // "response": {
  56905. // "$ref": "Operation"
  56906. // },
  56907. // "scopes": [
  56908. // "https://www.googleapis.com/auth/cloud-platform",
  56909. // "https://www.googleapis.com/auth/compute",
  56910. // "https://www.googleapis.com/auth/compute.readonly"
  56911. // ]
  56912. // }
  56913. }
  56914. // method id "compute.healthChecks.aggregatedList":
  56915. type HealthChecksAggregatedListCall struct {
  56916. s *Service
  56917. project string
  56918. urlParams_ gensupport.URLParams
  56919. ifNoneMatch_ string
  56920. ctx_ context.Context
  56921. header_ http.Header
  56922. }
  56923. // AggregatedList: Retrieves the list of all HealthCheck resources,
  56924. // regional and global, available to the specified project.
  56925. func (r *HealthChecksService) AggregatedList(project string) *HealthChecksAggregatedListCall {
  56926. c := &HealthChecksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56927. c.project = project
  56928. return c
  56929. }
  56930. // Filter sets the optional parameter "filter": A filter expression that
  56931. // filters resources listed in the response. The expression must specify
  56932. // the field name, a comparison operator, and the value that you want to
  56933. // use for filtering. The value must be a string, a number, or a
  56934. // boolean. The comparison operator must be either =, !=, >, or <.
  56935. //
  56936. // For example, if you are filtering Compute Engine instances, you can
  56937. // exclude instances named example-instance by specifying name !=
  56938. // example-instance.
  56939. //
  56940. // You can also filter nested fields. For example, you could specify
  56941. // scheduling.automaticRestart = false to include instances only if they
  56942. // are not scheduled for automatic restarts. You can use filtering on
  56943. // nested fields to filter based on resource labels.
  56944. //
  56945. // To filter on multiple expressions, provide each separate expression
  56946. // within parentheses. For example, (scheduling.automaticRestart = true)
  56947. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56948. // AND expression. However, you can include AND and OR expressions
  56949. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56950. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56951. // true).
  56952. func (c *HealthChecksAggregatedListCall) Filter(filter string) *HealthChecksAggregatedListCall {
  56953. c.urlParams_.Set("filter", filter)
  56954. return c
  56955. }
  56956. // MaxResults sets the optional parameter "maxResults": The maximum
  56957. // number of results per page that should be returned. If the number of
  56958. // available results is larger than maxResults, Compute Engine returns a
  56959. // nextPageToken that can be used to get the next page of results in
  56960. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56961. // (Default: 500)
  56962. func (c *HealthChecksAggregatedListCall) MaxResults(maxResults int64) *HealthChecksAggregatedListCall {
  56963. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56964. return c
  56965. }
  56966. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56967. // a certain order. By default, results are returned in alphanumerical
  56968. // order based on the resource name.
  56969. //
  56970. // You can also sort results in descending order based on the creation
  56971. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56972. // based on the creationTimestamp field in reverse chronological order
  56973. // (newest result first). Use this to sort resources like operations so
  56974. // that the newest operation is returned first.
  56975. //
  56976. // Currently, only sorting by name or creationTimestamp desc is
  56977. // supported.
  56978. func (c *HealthChecksAggregatedListCall) OrderBy(orderBy string) *HealthChecksAggregatedListCall {
  56979. c.urlParams_.Set("orderBy", orderBy)
  56980. return c
  56981. }
  56982. // PageToken sets the optional parameter "pageToken": Specifies a page
  56983. // token to use. Set pageToken to the nextPageToken returned by a
  56984. // previous list request to get the next page of results.
  56985. func (c *HealthChecksAggregatedListCall) PageToken(pageToken string) *HealthChecksAggregatedListCall {
  56986. c.urlParams_.Set("pageToken", pageToken)
  56987. return c
  56988. }
  56989. // Fields allows partial responses to be retrieved. See
  56990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56991. // for more information.
  56992. func (c *HealthChecksAggregatedListCall) Fields(s ...googleapi.Field) *HealthChecksAggregatedListCall {
  56993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56994. return c
  56995. }
  56996. // IfNoneMatch sets the optional parameter which makes the operation
  56997. // fail if the object's ETag matches the given value. This is useful for
  56998. // getting updates only after the object has changed since the last
  56999. // request. Use googleapi.IsNotModified to check whether the response
  57000. // error from Do is the result of In-None-Match.
  57001. func (c *HealthChecksAggregatedListCall) IfNoneMatch(entityTag string) *HealthChecksAggregatedListCall {
  57002. c.ifNoneMatch_ = entityTag
  57003. return c
  57004. }
  57005. // Context sets the context to be used in this call's Do method. Any
  57006. // pending HTTP request will be aborted if the provided context is
  57007. // canceled.
  57008. func (c *HealthChecksAggregatedListCall) Context(ctx context.Context) *HealthChecksAggregatedListCall {
  57009. c.ctx_ = ctx
  57010. return c
  57011. }
  57012. // Header returns an http.Header that can be modified by the caller to
  57013. // add HTTP headers to the request.
  57014. func (c *HealthChecksAggregatedListCall) Header() http.Header {
  57015. if c.header_ == nil {
  57016. c.header_ = make(http.Header)
  57017. }
  57018. return c.header_
  57019. }
  57020. func (c *HealthChecksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  57021. reqHeaders := make(http.Header)
  57022. for k, v := range c.header_ {
  57023. reqHeaders[k] = v
  57024. }
  57025. reqHeaders.Set("User-Agent", c.s.userAgent())
  57026. if c.ifNoneMatch_ != "" {
  57027. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57028. }
  57029. var body io.Reader = nil
  57030. c.urlParams_.Set("alt", alt)
  57031. c.urlParams_.Set("prettyPrint", "false")
  57032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/healthChecks")
  57033. urls += "?" + c.urlParams_.Encode()
  57034. req, err := http.NewRequest("GET", urls, body)
  57035. if err != nil {
  57036. return nil, err
  57037. }
  57038. req.Header = reqHeaders
  57039. googleapi.Expand(req.URL, map[string]string{
  57040. "project": c.project,
  57041. })
  57042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57043. }
  57044. // Do executes the "compute.healthChecks.aggregatedList" call.
  57045. // Exactly one of *HealthChecksAggregatedList or error will be non-nil.
  57046. // Any non-2xx status code is an error. Response headers are in either
  57047. // *HealthChecksAggregatedList.ServerResponse.Header or (if a response
  57048. // was returned at all) in error.(*googleapi.Error).Header. Use
  57049. // googleapi.IsNotModified to check whether the returned error was
  57050. // because http.StatusNotModified was returned.
  57051. func (c *HealthChecksAggregatedListCall) Do(opts ...googleapi.CallOption) (*HealthChecksAggregatedList, error) {
  57052. gensupport.SetOptions(c.urlParams_, opts...)
  57053. res, err := c.doRequest("json")
  57054. if res != nil && res.StatusCode == http.StatusNotModified {
  57055. if res.Body != nil {
  57056. res.Body.Close()
  57057. }
  57058. return nil, &googleapi.Error{
  57059. Code: res.StatusCode,
  57060. Header: res.Header,
  57061. }
  57062. }
  57063. if err != nil {
  57064. return nil, err
  57065. }
  57066. defer googleapi.CloseBody(res)
  57067. if err := googleapi.CheckResponse(res); err != nil {
  57068. return nil, err
  57069. }
  57070. ret := &HealthChecksAggregatedList{
  57071. ServerResponse: googleapi.ServerResponse{
  57072. Header: res.Header,
  57073. HTTPStatusCode: res.StatusCode,
  57074. },
  57075. }
  57076. target := &ret
  57077. if err := gensupport.DecodeResponse(target, res); err != nil {
  57078. return nil, err
  57079. }
  57080. return ret, nil
  57081. // {
  57082. // "description": "Retrieves the list of all HealthCheck resources, regional and global, available to the specified project.",
  57083. // "httpMethod": "GET",
  57084. // "id": "compute.healthChecks.aggregatedList",
  57085. // "parameterOrder": [
  57086. // "project"
  57087. // ],
  57088. // "parameters": {
  57089. // "filter": {
  57090. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57091. // "location": "query",
  57092. // "type": "string"
  57093. // },
  57094. // "maxResults": {
  57095. // "default": "500",
  57096. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57097. // "format": "uint32",
  57098. // "location": "query",
  57099. // "minimum": "0",
  57100. // "type": "integer"
  57101. // },
  57102. // "orderBy": {
  57103. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57104. // "location": "query",
  57105. // "type": "string"
  57106. // },
  57107. // "pageToken": {
  57108. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57109. // "location": "query",
  57110. // "type": "string"
  57111. // },
  57112. // "project": {
  57113. // "description": "Name of the project scoping this request.",
  57114. // "location": "path",
  57115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57116. // "required": true,
  57117. // "type": "string"
  57118. // }
  57119. // },
  57120. // "path": "{project}/aggregated/healthChecks",
  57121. // "response": {
  57122. // "$ref": "HealthChecksAggregatedList"
  57123. // },
  57124. // "scopes": [
  57125. // "https://www.googleapis.com/auth/cloud-platform",
  57126. // "https://www.googleapis.com/auth/compute",
  57127. // "https://www.googleapis.com/auth/compute.readonly"
  57128. // ]
  57129. // }
  57130. }
  57131. // Pages invokes f for each page of results.
  57132. // A non-nil error returned from f will halt the iteration.
  57133. // The provided context supersedes any context provided to the Context method.
  57134. func (c *HealthChecksAggregatedListCall) Pages(ctx context.Context, f func(*HealthChecksAggregatedList) error) error {
  57135. c.ctx_ = ctx
  57136. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57137. for {
  57138. x, err := c.Do()
  57139. if err != nil {
  57140. return err
  57141. }
  57142. if err := f(x); err != nil {
  57143. return err
  57144. }
  57145. if x.NextPageToken == "" {
  57146. return nil
  57147. }
  57148. c.PageToken(x.NextPageToken)
  57149. }
  57150. }
  57151. // method id "compute.healthChecks.delete":
  57152. type HealthChecksDeleteCall struct {
  57153. s *Service
  57154. project string
  57155. healthCheck string
  57156. urlParams_ gensupport.URLParams
  57157. ctx_ context.Context
  57158. header_ http.Header
  57159. }
  57160. // Delete: Deletes the specified HealthCheck resource.
  57161. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  57162. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57163. c.project = project
  57164. c.healthCheck = healthCheck
  57165. return c
  57166. }
  57167. // RequestId sets the optional parameter "requestId": An optional
  57168. // request ID to identify requests. Specify a unique request ID so that
  57169. // if you must retry your request, the server will know to ignore the
  57170. // request if it has already been completed.
  57171. //
  57172. // For example, consider a situation where you make an initial request
  57173. // and the request times out. If you make the request again with the
  57174. // same request ID, the server can check if original operation with the
  57175. // same request ID was received, and if so, will ignore the second
  57176. // request. This prevents clients from accidentally creating duplicate
  57177. // commitments.
  57178. //
  57179. // The request ID must be a valid UUID with the exception that zero UUID
  57180. // is not supported (00000000-0000-0000-0000-000000000000).
  57181. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  57182. c.urlParams_.Set("requestId", requestId)
  57183. return c
  57184. }
  57185. // Fields allows partial responses to be retrieved. See
  57186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57187. // for more information.
  57188. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  57189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57190. return c
  57191. }
  57192. // Context sets the context to be used in this call's Do method. Any
  57193. // pending HTTP request will be aborted if the provided context is
  57194. // canceled.
  57195. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  57196. c.ctx_ = ctx
  57197. return c
  57198. }
  57199. // Header returns an http.Header that can be modified by the caller to
  57200. // add HTTP headers to the request.
  57201. func (c *HealthChecksDeleteCall) Header() http.Header {
  57202. if c.header_ == nil {
  57203. c.header_ = make(http.Header)
  57204. }
  57205. return c.header_
  57206. }
  57207. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  57208. reqHeaders := make(http.Header)
  57209. for k, v := range c.header_ {
  57210. reqHeaders[k] = v
  57211. }
  57212. reqHeaders.Set("User-Agent", c.s.userAgent())
  57213. var body io.Reader = nil
  57214. c.urlParams_.Set("alt", alt)
  57215. c.urlParams_.Set("prettyPrint", "false")
  57216. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  57217. urls += "?" + c.urlParams_.Encode()
  57218. req, err := http.NewRequest("DELETE", urls, body)
  57219. if err != nil {
  57220. return nil, err
  57221. }
  57222. req.Header = reqHeaders
  57223. googleapi.Expand(req.URL, map[string]string{
  57224. "project": c.project,
  57225. "healthCheck": c.healthCheck,
  57226. })
  57227. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57228. }
  57229. // Do executes the "compute.healthChecks.delete" call.
  57230. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57231. // status code is an error. Response headers are in either
  57232. // *Operation.ServerResponse.Header or (if a response was returned at
  57233. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57234. // to check whether the returned error was because
  57235. // http.StatusNotModified was returned.
  57236. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57237. gensupport.SetOptions(c.urlParams_, opts...)
  57238. res, err := c.doRequest("json")
  57239. if res != nil && res.StatusCode == http.StatusNotModified {
  57240. if res.Body != nil {
  57241. res.Body.Close()
  57242. }
  57243. return nil, &googleapi.Error{
  57244. Code: res.StatusCode,
  57245. Header: res.Header,
  57246. }
  57247. }
  57248. if err != nil {
  57249. return nil, err
  57250. }
  57251. defer googleapi.CloseBody(res)
  57252. if err := googleapi.CheckResponse(res); err != nil {
  57253. return nil, err
  57254. }
  57255. ret := &Operation{
  57256. ServerResponse: googleapi.ServerResponse{
  57257. Header: res.Header,
  57258. HTTPStatusCode: res.StatusCode,
  57259. },
  57260. }
  57261. target := &ret
  57262. if err := gensupport.DecodeResponse(target, res); err != nil {
  57263. return nil, err
  57264. }
  57265. return ret, nil
  57266. // {
  57267. // "description": "Deletes the specified HealthCheck resource.",
  57268. // "httpMethod": "DELETE",
  57269. // "id": "compute.healthChecks.delete",
  57270. // "parameterOrder": [
  57271. // "project",
  57272. // "healthCheck"
  57273. // ],
  57274. // "parameters": {
  57275. // "healthCheck": {
  57276. // "description": "Name of the HealthCheck resource to delete.",
  57277. // "location": "path",
  57278. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57279. // "required": true,
  57280. // "type": "string"
  57281. // },
  57282. // "project": {
  57283. // "description": "Project ID for this request.",
  57284. // "location": "path",
  57285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57286. // "required": true,
  57287. // "type": "string"
  57288. // },
  57289. // "requestId": {
  57290. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57291. // "location": "query",
  57292. // "type": "string"
  57293. // }
  57294. // },
  57295. // "path": "{project}/global/healthChecks/{healthCheck}",
  57296. // "response": {
  57297. // "$ref": "Operation"
  57298. // },
  57299. // "scopes": [
  57300. // "https://www.googleapis.com/auth/cloud-platform",
  57301. // "https://www.googleapis.com/auth/compute"
  57302. // ]
  57303. // }
  57304. }
  57305. // method id "compute.healthChecks.get":
  57306. type HealthChecksGetCall struct {
  57307. s *Service
  57308. project string
  57309. healthCheck string
  57310. urlParams_ gensupport.URLParams
  57311. ifNoneMatch_ string
  57312. ctx_ context.Context
  57313. header_ http.Header
  57314. }
  57315. // Get: Returns the specified HealthCheck resource. Gets a list of
  57316. // available health checks by making a list() request.
  57317. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  57318. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57319. c.project = project
  57320. c.healthCheck = healthCheck
  57321. return c
  57322. }
  57323. // Fields allows partial responses to be retrieved. See
  57324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57325. // for more information.
  57326. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  57327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57328. return c
  57329. }
  57330. // IfNoneMatch sets the optional parameter which makes the operation
  57331. // fail if the object's ETag matches the given value. This is useful for
  57332. // getting updates only after the object has changed since the last
  57333. // request. Use googleapi.IsNotModified to check whether the response
  57334. // error from Do is the result of In-None-Match.
  57335. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  57336. c.ifNoneMatch_ = entityTag
  57337. return c
  57338. }
  57339. // Context sets the context to be used in this call's Do method. Any
  57340. // pending HTTP request will be aborted if the provided context is
  57341. // canceled.
  57342. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  57343. c.ctx_ = ctx
  57344. return c
  57345. }
  57346. // Header returns an http.Header that can be modified by the caller to
  57347. // add HTTP headers to the request.
  57348. func (c *HealthChecksGetCall) Header() http.Header {
  57349. if c.header_ == nil {
  57350. c.header_ = make(http.Header)
  57351. }
  57352. return c.header_
  57353. }
  57354. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  57355. reqHeaders := make(http.Header)
  57356. for k, v := range c.header_ {
  57357. reqHeaders[k] = v
  57358. }
  57359. reqHeaders.Set("User-Agent", c.s.userAgent())
  57360. if c.ifNoneMatch_ != "" {
  57361. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57362. }
  57363. var body io.Reader = nil
  57364. c.urlParams_.Set("alt", alt)
  57365. c.urlParams_.Set("prettyPrint", "false")
  57366. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  57367. urls += "?" + c.urlParams_.Encode()
  57368. req, err := http.NewRequest("GET", urls, body)
  57369. if err != nil {
  57370. return nil, err
  57371. }
  57372. req.Header = reqHeaders
  57373. googleapi.Expand(req.URL, map[string]string{
  57374. "project": c.project,
  57375. "healthCheck": c.healthCheck,
  57376. })
  57377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57378. }
  57379. // Do executes the "compute.healthChecks.get" call.
  57380. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  57381. // status code is an error. Response headers are in either
  57382. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  57383. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57384. // to check whether the returned error was because
  57385. // http.StatusNotModified was returned.
  57386. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  57387. gensupport.SetOptions(c.urlParams_, opts...)
  57388. res, err := c.doRequest("json")
  57389. if res != nil && res.StatusCode == http.StatusNotModified {
  57390. if res.Body != nil {
  57391. res.Body.Close()
  57392. }
  57393. return nil, &googleapi.Error{
  57394. Code: res.StatusCode,
  57395. Header: res.Header,
  57396. }
  57397. }
  57398. if err != nil {
  57399. return nil, err
  57400. }
  57401. defer googleapi.CloseBody(res)
  57402. if err := googleapi.CheckResponse(res); err != nil {
  57403. return nil, err
  57404. }
  57405. ret := &HealthCheck{
  57406. ServerResponse: googleapi.ServerResponse{
  57407. Header: res.Header,
  57408. HTTPStatusCode: res.StatusCode,
  57409. },
  57410. }
  57411. target := &ret
  57412. if err := gensupport.DecodeResponse(target, res); err != nil {
  57413. return nil, err
  57414. }
  57415. return ret, nil
  57416. // {
  57417. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  57418. // "httpMethod": "GET",
  57419. // "id": "compute.healthChecks.get",
  57420. // "parameterOrder": [
  57421. // "project",
  57422. // "healthCheck"
  57423. // ],
  57424. // "parameters": {
  57425. // "healthCheck": {
  57426. // "description": "Name of the HealthCheck resource to return.",
  57427. // "location": "path",
  57428. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57429. // "required": true,
  57430. // "type": "string"
  57431. // },
  57432. // "project": {
  57433. // "description": "Project ID for this request.",
  57434. // "location": "path",
  57435. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57436. // "required": true,
  57437. // "type": "string"
  57438. // }
  57439. // },
  57440. // "path": "{project}/global/healthChecks/{healthCheck}",
  57441. // "response": {
  57442. // "$ref": "HealthCheck"
  57443. // },
  57444. // "scopes": [
  57445. // "https://www.googleapis.com/auth/cloud-platform",
  57446. // "https://www.googleapis.com/auth/compute",
  57447. // "https://www.googleapis.com/auth/compute.readonly"
  57448. // ]
  57449. // }
  57450. }
  57451. // method id "compute.healthChecks.insert":
  57452. type HealthChecksInsertCall struct {
  57453. s *Service
  57454. project string
  57455. healthcheck *HealthCheck
  57456. urlParams_ gensupport.URLParams
  57457. ctx_ context.Context
  57458. header_ http.Header
  57459. }
  57460. // Insert: Creates a HealthCheck resource in the specified project using
  57461. // the data included in the request.
  57462. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  57463. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57464. c.project = project
  57465. c.healthcheck = healthcheck
  57466. return c
  57467. }
  57468. // RequestId sets the optional parameter "requestId": An optional
  57469. // request ID to identify requests. Specify a unique request ID so that
  57470. // if you must retry your request, the server will know to ignore the
  57471. // request if it has already been completed.
  57472. //
  57473. // For example, consider a situation where you make an initial request
  57474. // and the request times out. If you make the request again with the
  57475. // same request ID, the server can check if original operation with the
  57476. // same request ID was received, and if so, will ignore the second
  57477. // request. This prevents clients from accidentally creating duplicate
  57478. // commitments.
  57479. //
  57480. // The request ID must be a valid UUID with the exception that zero UUID
  57481. // is not supported (00000000-0000-0000-0000-000000000000).
  57482. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  57483. c.urlParams_.Set("requestId", requestId)
  57484. return c
  57485. }
  57486. // Fields allows partial responses to be retrieved. See
  57487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57488. // for more information.
  57489. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  57490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57491. return c
  57492. }
  57493. // Context sets the context to be used in this call's Do method. Any
  57494. // pending HTTP request will be aborted if the provided context is
  57495. // canceled.
  57496. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  57497. c.ctx_ = ctx
  57498. return c
  57499. }
  57500. // Header returns an http.Header that can be modified by the caller to
  57501. // add HTTP headers to the request.
  57502. func (c *HealthChecksInsertCall) Header() http.Header {
  57503. if c.header_ == nil {
  57504. c.header_ = make(http.Header)
  57505. }
  57506. return c.header_
  57507. }
  57508. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  57509. reqHeaders := make(http.Header)
  57510. for k, v := range c.header_ {
  57511. reqHeaders[k] = v
  57512. }
  57513. reqHeaders.Set("User-Agent", c.s.userAgent())
  57514. var body io.Reader = nil
  57515. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  57516. if err != nil {
  57517. return nil, err
  57518. }
  57519. reqHeaders.Set("Content-Type", "application/json")
  57520. c.urlParams_.Set("alt", alt)
  57521. c.urlParams_.Set("prettyPrint", "false")
  57522. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  57523. urls += "?" + c.urlParams_.Encode()
  57524. req, err := http.NewRequest("POST", urls, body)
  57525. if err != nil {
  57526. return nil, err
  57527. }
  57528. req.Header = reqHeaders
  57529. googleapi.Expand(req.URL, map[string]string{
  57530. "project": c.project,
  57531. })
  57532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57533. }
  57534. // Do executes the "compute.healthChecks.insert" call.
  57535. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57536. // status code is an error. Response headers are in either
  57537. // *Operation.ServerResponse.Header or (if a response was returned at
  57538. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57539. // to check whether the returned error was because
  57540. // http.StatusNotModified was returned.
  57541. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57542. gensupport.SetOptions(c.urlParams_, opts...)
  57543. res, err := c.doRequest("json")
  57544. if res != nil && res.StatusCode == http.StatusNotModified {
  57545. if res.Body != nil {
  57546. res.Body.Close()
  57547. }
  57548. return nil, &googleapi.Error{
  57549. Code: res.StatusCode,
  57550. Header: res.Header,
  57551. }
  57552. }
  57553. if err != nil {
  57554. return nil, err
  57555. }
  57556. defer googleapi.CloseBody(res)
  57557. if err := googleapi.CheckResponse(res); err != nil {
  57558. return nil, err
  57559. }
  57560. ret := &Operation{
  57561. ServerResponse: googleapi.ServerResponse{
  57562. Header: res.Header,
  57563. HTTPStatusCode: res.StatusCode,
  57564. },
  57565. }
  57566. target := &ret
  57567. if err := gensupport.DecodeResponse(target, res); err != nil {
  57568. return nil, err
  57569. }
  57570. return ret, nil
  57571. // {
  57572. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  57573. // "httpMethod": "POST",
  57574. // "id": "compute.healthChecks.insert",
  57575. // "parameterOrder": [
  57576. // "project"
  57577. // ],
  57578. // "parameters": {
  57579. // "project": {
  57580. // "description": "Project ID for this request.",
  57581. // "location": "path",
  57582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57583. // "required": true,
  57584. // "type": "string"
  57585. // },
  57586. // "requestId": {
  57587. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57588. // "location": "query",
  57589. // "type": "string"
  57590. // }
  57591. // },
  57592. // "path": "{project}/global/healthChecks",
  57593. // "request": {
  57594. // "$ref": "HealthCheck"
  57595. // },
  57596. // "response": {
  57597. // "$ref": "Operation"
  57598. // },
  57599. // "scopes": [
  57600. // "https://www.googleapis.com/auth/cloud-platform",
  57601. // "https://www.googleapis.com/auth/compute"
  57602. // ]
  57603. // }
  57604. }
  57605. // method id "compute.healthChecks.list":
  57606. type HealthChecksListCall struct {
  57607. s *Service
  57608. project string
  57609. urlParams_ gensupport.URLParams
  57610. ifNoneMatch_ string
  57611. ctx_ context.Context
  57612. header_ http.Header
  57613. }
  57614. // List: Retrieves the list of HealthCheck resources available to the
  57615. // specified project.
  57616. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  57617. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57618. c.project = project
  57619. return c
  57620. }
  57621. // Filter sets the optional parameter "filter": A filter expression that
  57622. // filters resources listed in the response. The expression must specify
  57623. // the field name, a comparison operator, and the value that you want to
  57624. // use for filtering. The value must be a string, a number, or a
  57625. // boolean. The comparison operator must be either =, !=, >, or <.
  57626. //
  57627. // For example, if you are filtering Compute Engine instances, you can
  57628. // exclude instances named example-instance by specifying name !=
  57629. // example-instance.
  57630. //
  57631. // You can also filter nested fields. For example, you could specify
  57632. // scheduling.automaticRestart = false to include instances only if they
  57633. // are not scheduled for automatic restarts. You can use filtering on
  57634. // nested fields to filter based on resource labels.
  57635. //
  57636. // To filter on multiple expressions, provide each separate expression
  57637. // within parentheses. For example, (scheduling.automaticRestart = true)
  57638. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57639. // AND expression. However, you can include AND and OR expressions
  57640. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57641. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57642. // true).
  57643. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  57644. c.urlParams_.Set("filter", filter)
  57645. return c
  57646. }
  57647. // MaxResults sets the optional parameter "maxResults": The maximum
  57648. // number of results per page that should be returned. If the number of
  57649. // available results is larger than maxResults, Compute Engine returns a
  57650. // nextPageToken that can be used to get the next page of results in
  57651. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57652. // (Default: 500)
  57653. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  57654. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57655. return c
  57656. }
  57657. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57658. // a certain order. By default, results are returned in alphanumerical
  57659. // order based on the resource name.
  57660. //
  57661. // You can also sort results in descending order based on the creation
  57662. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57663. // based on the creationTimestamp field in reverse chronological order
  57664. // (newest result first). Use this to sort resources like operations so
  57665. // that the newest operation is returned first.
  57666. //
  57667. // Currently, only sorting by name or creationTimestamp desc is
  57668. // supported.
  57669. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  57670. c.urlParams_.Set("orderBy", orderBy)
  57671. return c
  57672. }
  57673. // PageToken sets the optional parameter "pageToken": Specifies a page
  57674. // token to use. Set pageToken to the nextPageToken returned by a
  57675. // previous list request to get the next page of results.
  57676. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  57677. c.urlParams_.Set("pageToken", pageToken)
  57678. return c
  57679. }
  57680. // Fields allows partial responses to be retrieved. See
  57681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57682. // for more information.
  57683. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  57684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57685. return c
  57686. }
  57687. // IfNoneMatch sets the optional parameter which makes the operation
  57688. // fail if the object's ETag matches the given value. This is useful for
  57689. // getting updates only after the object has changed since the last
  57690. // request. Use googleapi.IsNotModified to check whether the response
  57691. // error from Do is the result of In-None-Match.
  57692. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  57693. c.ifNoneMatch_ = entityTag
  57694. return c
  57695. }
  57696. // Context sets the context to be used in this call's Do method. Any
  57697. // pending HTTP request will be aborted if the provided context is
  57698. // canceled.
  57699. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  57700. c.ctx_ = ctx
  57701. return c
  57702. }
  57703. // Header returns an http.Header that can be modified by the caller to
  57704. // add HTTP headers to the request.
  57705. func (c *HealthChecksListCall) Header() http.Header {
  57706. if c.header_ == nil {
  57707. c.header_ = make(http.Header)
  57708. }
  57709. return c.header_
  57710. }
  57711. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  57712. reqHeaders := make(http.Header)
  57713. for k, v := range c.header_ {
  57714. reqHeaders[k] = v
  57715. }
  57716. reqHeaders.Set("User-Agent", c.s.userAgent())
  57717. if c.ifNoneMatch_ != "" {
  57718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57719. }
  57720. var body io.Reader = nil
  57721. c.urlParams_.Set("alt", alt)
  57722. c.urlParams_.Set("prettyPrint", "false")
  57723. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  57724. urls += "?" + c.urlParams_.Encode()
  57725. req, err := http.NewRequest("GET", urls, body)
  57726. if err != nil {
  57727. return nil, err
  57728. }
  57729. req.Header = reqHeaders
  57730. googleapi.Expand(req.URL, map[string]string{
  57731. "project": c.project,
  57732. })
  57733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57734. }
  57735. // Do executes the "compute.healthChecks.list" call.
  57736. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  57737. // status code is an error. Response headers are in either
  57738. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  57739. // at all) in error.(*googleapi.Error).Header. Use
  57740. // googleapi.IsNotModified to check whether the returned error was
  57741. // because http.StatusNotModified was returned.
  57742. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  57743. gensupport.SetOptions(c.urlParams_, opts...)
  57744. res, err := c.doRequest("json")
  57745. if res != nil && res.StatusCode == http.StatusNotModified {
  57746. if res.Body != nil {
  57747. res.Body.Close()
  57748. }
  57749. return nil, &googleapi.Error{
  57750. Code: res.StatusCode,
  57751. Header: res.Header,
  57752. }
  57753. }
  57754. if err != nil {
  57755. return nil, err
  57756. }
  57757. defer googleapi.CloseBody(res)
  57758. if err := googleapi.CheckResponse(res); err != nil {
  57759. return nil, err
  57760. }
  57761. ret := &HealthCheckList{
  57762. ServerResponse: googleapi.ServerResponse{
  57763. Header: res.Header,
  57764. HTTPStatusCode: res.StatusCode,
  57765. },
  57766. }
  57767. target := &ret
  57768. if err := gensupport.DecodeResponse(target, res); err != nil {
  57769. return nil, err
  57770. }
  57771. return ret, nil
  57772. // {
  57773. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  57774. // "httpMethod": "GET",
  57775. // "id": "compute.healthChecks.list",
  57776. // "parameterOrder": [
  57777. // "project"
  57778. // ],
  57779. // "parameters": {
  57780. // "filter": {
  57781. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57782. // "location": "query",
  57783. // "type": "string"
  57784. // },
  57785. // "maxResults": {
  57786. // "default": "500",
  57787. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57788. // "format": "uint32",
  57789. // "location": "query",
  57790. // "minimum": "0",
  57791. // "type": "integer"
  57792. // },
  57793. // "orderBy": {
  57794. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57795. // "location": "query",
  57796. // "type": "string"
  57797. // },
  57798. // "pageToken": {
  57799. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57800. // "location": "query",
  57801. // "type": "string"
  57802. // },
  57803. // "project": {
  57804. // "description": "Project ID for this request.",
  57805. // "location": "path",
  57806. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57807. // "required": true,
  57808. // "type": "string"
  57809. // }
  57810. // },
  57811. // "path": "{project}/global/healthChecks",
  57812. // "response": {
  57813. // "$ref": "HealthCheckList"
  57814. // },
  57815. // "scopes": [
  57816. // "https://www.googleapis.com/auth/cloud-platform",
  57817. // "https://www.googleapis.com/auth/compute",
  57818. // "https://www.googleapis.com/auth/compute.readonly"
  57819. // ]
  57820. // }
  57821. }
  57822. // Pages invokes f for each page of results.
  57823. // A non-nil error returned from f will halt the iteration.
  57824. // The provided context supersedes any context provided to the Context method.
  57825. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  57826. c.ctx_ = ctx
  57827. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57828. for {
  57829. x, err := c.Do()
  57830. if err != nil {
  57831. return err
  57832. }
  57833. if err := f(x); err != nil {
  57834. return err
  57835. }
  57836. if x.NextPageToken == "" {
  57837. return nil
  57838. }
  57839. c.PageToken(x.NextPageToken)
  57840. }
  57841. }
  57842. // method id "compute.healthChecks.patch":
  57843. type HealthChecksPatchCall struct {
  57844. s *Service
  57845. project string
  57846. healthCheck string
  57847. healthcheck *HealthCheck
  57848. urlParams_ gensupport.URLParams
  57849. ctx_ context.Context
  57850. header_ http.Header
  57851. }
  57852. // Patch: Updates a HealthCheck resource in the specified project using
  57853. // the data included in the request. This method supports PATCH
  57854. // semantics and uses the JSON merge patch format and processing rules.
  57855. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  57856. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57857. c.project = project
  57858. c.healthCheck = healthCheck
  57859. c.healthcheck = healthcheck
  57860. return c
  57861. }
  57862. // RequestId sets the optional parameter "requestId": An optional
  57863. // request ID to identify requests. Specify a unique request ID so that
  57864. // if you must retry your request, the server will know to ignore the
  57865. // request if it has already been completed.
  57866. //
  57867. // For example, consider a situation where you make an initial request
  57868. // and the request times out. If you make the request again with the
  57869. // same request ID, the server can check if original operation with the
  57870. // same request ID was received, and if so, will ignore the second
  57871. // request. This prevents clients from accidentally creating duplicate
  57872. // commitments.
  57873. //
  57874. // The request ID must be a valid UUID with the exception that zero UUID
  57875. // is not supported (00000000-0000-0000-0000-000000000000).
  57876. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  57877. c.urlParams_.Set("requestId", requestId)
  57878. return c
  57879. }
  57880. // Fields allows partial responses to be retrieved. See
  57881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57882. // for more information.
  57883. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  57884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57885. return c
  57886. }
  57887. // Context sets the context to be used in this call's Do method. Any
  57888. // pending HTTP request will be aborted if the provided context is
  57889. // canceled.
  57890. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  57891. c.ctx_ = ctx
  57892. return c
  57893. }
  57894. // Header returns an http.Header that can be modified by the caller to
  57895. // add HTTP headers to the request.
  57896. func (c *HealthChecksPatchCall) Header() http.Header {
  57897. if c.header_ == nil {
  57898. c.header_ = make(http.Header)
  57899. }
  57900. return c.header_
  57901. }
  57902. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  57903. reqHeaders := make(http.Header)
  57904. for k, v := range c.header_ {
  57905. reqHeaders[k] = v
  57906. }
  57907. reqHeaders.Set("User-Agent", c.s.userAgent())
  57908. var body io.Reader = nil
  57909. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  57910. if err != nil {
  57911. return nil, err
  57912. }
  57913. reqHeaders.Set("Content-Type", "application/json")
  57914. c.urlParams_.Set("alt", alt)
  57915. c.urlParams_.Set("prettyPrint", "false")
  57916. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  57917. urls += "?" + c.urlParams_.Encode()
  57918. req, err := http.NewRequest("PATCH", urls, body)
  57919. if err != nil {
  57920. return nil, err
  57921. }
  57922. req.Header = reqHeaders
  57923. googleapi.Expand(req.URL, map[string]string{
  57924. "project": c.project,
  57925. "healthCheck": c.healthCheck,
  57926. })
  57927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57928. }
  57929. // Do executes the "compute.healthChecks.patch" call.
  57930. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57931. // status code is an error. Response headers are in either
  57932. // *Operation.ServerResponse.Header or (if a response was returned at
  57933. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57934. // to check whether the returned error was because
  57935. // http.StatusNotModified was returned.
  57936. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57937. gensupport.SetOptions(c.urlParams_, opts...)
  57938. res, err := c.doRequest("json")
  57939. if res != nil && res.StatusCode == http.StatusNotModified {
  57940. if res.Body != nil {
  57941. res.Body.Close()
  57942. }
  57943. return nil, &googleapi.Error{
  57944. Code: res.StatusCode,
  57945. Header: res.Header,
  57946. }
  57947. }
  57948. if err != nil {
  57949. return nil, err
  57950. }
  57951. defer googleapi.CloseBody(res)
  57952. if err := googleapi.CheckResponse(res); err != nil {
  57953. return nil, err
  57954. }
  57955. ret := &Operation{
  57956. ServerResponse: googleapi.ServerResponse{
  57957. Header: res.Header,
  57958. HTTPStatusCode: res.StatusCode,
  57959. },
  57960. }
  57961. target := &ret
  57962. if err := gensupport.DecodeResponse(target, res); err != nil {
  57963. return nil, err
  57964. }
  57965. return ret, nil
  57966. // {
  57967. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  57968. // "httpMethod": "PATCH",
  57969. // "id": "compute.healthChecks.patch",
  57970. // "parameterOrder": [
  57971. // "project",
  57972. // "healthCheck"
  57973. // ],
  57974. // "parameters": {
  57975. // "healthCheck": {
  57976. // "description": "Name of the HealthCheck resource to patch.",
  57977. // "location": "path",
  57978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57979. // "required": true,
  57980. // "type": "string"
  57981. // },
  57982. // "project": {
  57983. // "description": "Project ID for this request.",
  57984. // "location": "path",
  57985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57986. // "required": true,
  57987. // "type": "string"
  57988. // },
  57989. // "requestId": {
  57990. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57991. // "location": "query",
  57992. // "type": "string"
  57993. // }
  57994. // },
  57995. // "path": "{project}/global/healthChecks/{healthCheck}",
  57996. // "request": {
  57997. // "$ref": "HealthCheck"
  57998. // },
  57999. // "response": {
  58000. // "$ref": "Operation"
  58001. // },
  58002. // "scopes": [
  58003. // "https://www.googleapis.com/auth/cloud-platform",
  58004. // "https://www.googleapis.com/auth/compute"
  58005. // ]
  58006. // }
  58007. }
  58008. // method id "compute.healthChecks.testIamPermissions":
  58009. type HealthChecksTestIamPermissionsCall struct {
  58010. s *Service
  58011. project string
  58012. resource string
  58013. testpermissionsrequest *TestPermissionsRequest
  58014. urlParams_ gensupport.URLParams
  58015. ctx_ context.Context
  58016. header_ http.Header
  58017. }
  58018. // TestIamPermissions: Returns permissions that a caller has on the
  58019. // specified resource.
  58020. func (r *HealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HealthChecksTestIamPermissionsCall {
  58021. c := &HealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58022. c.project = project
  58023. c.resource = resource
  58024. c.testpermissionsrequest = testpermissionsrequest
  58025. return c
  58026. }
  58027. // Fields allows partial responses to be retrieved. See
  58028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58029. // for more information.
  58030. func (c *HealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HealthChecksTestIamPermissionsCall {
  58031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58032. return c
  58033. }
  58034. // Context sets the context to be used in this call's Do method. Any
  58035. // pending HTTP request will be aborted if the provided context is
  58036. // canceled.
  58037. func (c *HealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HealthChecksTestIamPermissionsCall {
  58038. c.ctx_ = ctx
  58039. return c
  58040. }
  58041. // Header returns an http.Header that can be modified by the caller to
  58042. // add HTTP headers to the request.
  58043. func (c *HealthChecksTestIamPermissionsCall) Header() http.Header {
  58044. if c.header_ == nil {
  58045. c.header_ = make(http.Header)
  58046. }
  58047. return c.header_
  58048. }
  58049. func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  58050. reqHeaders := make(http.Header)
  58051. for k, v := range c.header_ {
  58052. reqHeaders[k] = v
  58053. }
  58054. reqHeaders.Set("User-Agent", c.s.userAgent())
  58055. var body io.Reader = nil
  58056. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  58057. if err != nil {
  58058. return nil, err
  58059. }
  58060. reqHeaders.Set("Content-Type", "application/json")
  58061. c.urlParams_.Set("alt", alt)
  58062. c.urlParams_.Set("prettyPrint", "false")
  58063. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{resource}/testIamPermissions")
  58064. urls += "?" + c.urlParams_.Encode()
  58065. req, err := http.NewRequest("POST", urls, body)
  58066. if err != nil {
  58067. return nil, err
  58068. }
  58069. req.Header = reqHeaders
  58070. googleapi.Expand(req.URL, map[string]string{
  58071. "project": c.project,
  58072. "resource": c.resource,
  58073. })
  58074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58075. }
  58076. // Do executes the "compute.healthChecks.testIamPermissions" call.
  58077. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  58078. // non-2xx status code is an error. Response headers are in either
  58079. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  58080. // returned at all) in error.(*googleapi.Error).Header. Use
  58081. // googleapi.IsNotModified to check whether the returned error was
  58082. // because http.StatusNotModified was returned.
  58083. func (c *HealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  58084. gensupport.SetOptions(c.urlParams_, opts...)
  58085. res, err := c.doRequest("json")
  58086. if res != nil && res.StatusCode == http.StatusNotModified {
  58087. if res.Body != nil {
  58088. res.Body.Close()
  58089. }
  58090. return nil, &googleapi.Error{
  58091. Code: res.StatusCode,
  58092. Header: res.Header,
  58093. }
  58094. }
  58095. if err != nil {
  58096. return nil, err
  58097. }
  58098. defer googleapi.CloseBody(res)
  58099. if err := googleapi.CheckResponse(res); err != nil {
  58100. return nil, err
  58101. }
  58102. ret := &TestPermissionsResponse{
  58103. ServerResponse: googleapi.ServerResponse{
  58104. Header: res.Header,
  58105. HTTPStatusCode: res.StatusCode,
  58106. },
  58107. }
  58108. target := &ret
  58109. if err := gensupport.DecodeResponse(target, res); err != nil {
  58110. return nil, err
  58111. }
  58112. return ret, nil
  58113. // {
  58114. // "description": "Returns permissions that a caller has on the specified resource.",
  58115. // "httpMethod": "POST",
  58116. // "id": "compute.healthChecks.testIamPermissions",
  58117. // "parameterOrder": [
  58118. // "project",
  58119. // "resource"
  58120. // ],
  58121. // "parameters": {
  58122. // "project": {
  58123. // "description": "Project ID for this request.",
  58124. // "location": "path",
  58125. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58126. // "required": true,
  58127. // "type": "string"
  58128. // },
  58129. // "resource": {
  58130. // "description": "Name or id of the resource for this request.",
  58131. // "location": "path",
  58132. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58133. // "required": true,
  58134. // "type": "string"
  58135. // }
  58136. // },
  58137. // "path": "{project}/global/healthChecks/{resource}/testIamPermissions",
  58138. // "request": {
  58139. // "$ref": "TestPermissionsRequest"
  58140. // },
  58141. // "response": {
  58142. // "$ref": "TestPermissionsResponse"
  58143. // },
  58144. // "scopes": [
  58145. // "https://www.googleapis.com/auth/cloud-platform",
  58146. // "https://www.googleapis.com/auth/compute",
  58147. // "https://www.googleapis.com/auth/compute.readonly"
  58148. // ]
  58149. // }
  58150. }
  58151. // method id "compute.healthChecks.update":
  58152. type HealthChecksUpdateCall struct {
  58153. s *Service
  58154. project string
  58155. healthCheck string
  58156. healthcheck *HealthCheck
  58157. urlParams_ gensupport.URLParams
  58158. ctx_ context.Context
  58159. header_ http.Header
  58160. }
  58161. // Update: Updates a HealthCheck resource in the specified project using
  58162. // the data included in the request.
  58163. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  58164. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58165. c.project = project
  58166. c.healthCheck = healthCheck
  58167. c.healthcheck = healthcheck
  58168. return c
  58169. }
  58170. // RequestId sets the optional parameter "requestId": An optional
  58171. // request ID to identify requests. Specify a unique request ID so that
  58172. // if you must retry your request, the server will know to ignore the
  58173. // request if it has already been completed.
  58174. //
  58175. // For example, consider a situation where you make an initial request
  58176. // and the request times out. If you make the request again with the
  58177. // same request ID, the server can check if original operation with the
  58178. // same request ID was received, and if so, will ignore the second
  58179. // request. This prevents clients from accidentally creating duplicate
  58180. // commitments.
  58181. //
  58182. // The request ID must be a valid UUID with the exception that zero UUID
  58183. // is not supported (00000000-0000-0000-0000-000000000000).
  58184. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  58185. c.urlParams_.Set("requestId", requestId)
  58186. return c
  58187. }
  58188. // Fields allows partial responses to be retrieved. See
  58189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58190. // for more information.
  58191. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  58192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58193. return c
  58194. }
  58195. // Context sets the context to be used in this call's Do method. Any
  58196. // pending HTTP request will be aborted if the provided context is
  58197. // canceled.
  58198. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  58199. c.ctx_ = ctx
  58200. return c
  58201. }
  58202. // Header returns an http.Header that can be modified by the caller to
  58203. // add HTTP headers to the request.
  58204. func (c *HealthChecksUpdateCall) Header() http.Header {
  58205. if c.header_ == nil {
  58206. c.header_ = make(http.Header)
  58207. }
  58208. return c.header_
  58209. }
  58210. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  58211. reqHeaders := make(http.Header)
  58212. for k, v := range c.header_ {
  58213. reqHeaders[k] = v
  58214. }
  58215. reqHeaders.Set("User-Agent", c.s.userAgent())
  58216. var body io.Reader = nil
  58217. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  58218. if err != nil {
  58219. return nil, err
  58220. }
  58221. reqHeaders.Set("Content-Type", "application/json")
  58222. c.urlParams_.Set("alt", alt)
  58223. c.urlParams_.Set("prettyPrint", "false")
  58224. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  58225. urls += "?" + c.urlParams_.Encode()
  58226. req, err := http.NewRequest("PUT", urls, body)
  58227. if err != nil {
  58228. return nil, err
  58229. }
  58230. req.Header = reqHeaders
  58231. googleapi.Expand(req.URL, map[string]string{
  58232. "project": c.project,
  58233. "healthCheck": c.healthCheck,
  58234. })
  58235. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58236. }
  58237. // Do executes the "compute.healthChecks.update" call.
  58238. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58239. // status code is an error. Response headers are in either
  58240. // *Operation.ServerResponse.Header or (if a response was returned at
  58241. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58242. // to check whether the returned error was because
  58243. // http.StatusNotModified was returned.
  58244. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58245. gensupport.SetOptions(c.urlParams_, opts...)
  58246. res, err := c.doRequest("json")
  58247. if res != nil && res.StatusCode == http.StatusNotModified {
  58248. if res.Body != nil {
  58249. res.Body.Close()
  58250. }
  58251. return nil, &googleapi.Error{
  58252. Code: res.StatusCode,
  58253. Header: res.Header,
  58254. }
  58255. }
  58256. if err != nil {
  58257. return nil, err
  58258. }
  58259. defer googleapi.CloseBody(res)
  58260. if err := googleapi.CheckResponse(res); err != nil {
  58261. return nil, err
  58262. }
  58263. ret := &Operation{
  58264. ServerResponse: googleapi.ServerResponse{
  58265. Header: res.Header,
  58266. HTTPStatusCode: res.StatusCode,
  58267. },
  58268. }
  58269. target := &ret
  58270. if err := gensupport.DecodeResponse(target, res); err != nil {
  58271. return nil, err
  58272. }
  58273. return ret, nil
  58274. // {
  58275. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  58276. // "httpMethod": "PUT",
  58277. // "id": "compute.healthChecks.update",
  58278. // "parameterOrder": [
  58279. // "project",
  58280. // "healthCheck"
  58281. // ],
  58282. // "parameters": {
  58283. // "healthCheck": {
  58284. // "description": "Name of the HealthCheck resource to update.",
  58285. // "location": "path",
  58286. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58287. // "required": true,
  58288. // "type": "string"
  58289. // },
  58290. // "project": {
  58291. // "description": "Project ID for this request.",
  58292. // "location": "path",
  58293. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58294. // "required": true,
  58295. // "type": "string"
  58296. // },
  58297. // "requestId": {
  58298. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58299. // "location": "query",
  58300. // "type": "string"
  58301. // }
  58302. // },
  58303. // "path": "{project}/global/healthChecks/{healthCheck}",
  58304. // "request": {
  58305. // "$ref": "HealthCheck"
  58306. // },
  58307. // "response": {
  58308. // "$ref": "Operation"
  58309. // },
  58310. // "scopes": [
  58311. // "https://www.googleapis.com/auth/cloud-platform",
  58312. // "https://www.googleapis.com/auth/compute"
  58313. // ]
  58314. // }
  58315. }
  58316. // method id "compute.httpHealthChecks.delete":
  58317. type HttpHealthChecksDeleteCall struct {
  58318. s *Service
  58319. project string
  58320. httpHealthCheck string
  58321. urlParams_ gensupport.URLParams
  58322. ctx_ context.Context
  58323. header_ http.Header
  58324. }
  58325. // Delete: Deletes the specified HttpHealthCheck resource.
  58326. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  58327. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  58328. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58329. c.project = project
  58330. c.httpHealthCheck = httpHealthCheck
  58331. return c
  58332. }
  58333. // RequestId sets the optional parameter "requestId": An optional
  58334. // request ID to identify requests. Specify a unique request ID so that
  58335. // if you must retry your request, the server will know to ignore the
  58336. // request if it has already been completed.
  58337. //
  58338. // For example, consider a situation where you make an initial request
  58339. // and the request times out. If you make the request again with the
  58340. // same request ID, the server can check if original operation with the
  58341. // same request ID was received, and if so, will ignore the second
  58342. // request. This prevents clients from accidentally creating duplicate
  58343. // commitments.
  58344. //
  58345. // The request ID must be a valid UUID with the exception that zero UUID
  58346. // is not supported (00000000-0000-0000-0000-000000000000).
  58347. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  58348. c.urlParams_.Set("requestId", requestId)
  58349. return c
  58350. }
  58351. // Fields allows partial responses to be retrieved. See
  58352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58353. // for more information.
  58354. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  58355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58356. return c
  58357. }
  58358. // Context sets the context to be used in this call's Do method. Any
  58359. // pending HTTP request will be aborted if the provided context is
  58360. // canceled.
  58361. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  58362. c.ctx_ = ctx
  58363. return c
  58364. }
  58365. // Header returns an http.Header that can be modified by the caller to
  58366. // add HTTP headers to the request.
  58367. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  58368. if c.header_ == nil {
  58369. c.header_ = make(http.Header)
  58370. }
  58371. return c.header_
  58372. }
  58373. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  58374. reqHeaders := make(http.Header)
  58375. for k, v := range c.header_ {
  58376. reqHeaders[k] = v
  58377. }
  58378. reqHeaders.Set("User-Agent", c.s.userAgent())
  58379. var body io.Reader = nil
  58380. c.urlParams_.Set("alt", alt)
  58381. c.urlParams_.Set("prettyPrint", "false")
  58382. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  58383. urls += "?" + c.urlParams_.Encode()
  58384. req, err := http.NewRequest("DELETE", urls, body)
  58385. if err != nil {
  58386. return nil, err
  58387. }
  58388. req.Header = reqHeaders
  58389. googleapi.Expand(req.URL, map[string]string{
  58390. "project": c.project,
  58391. "httpHealthCheck": c.httpHealthCheck,
  58392. })
  58393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58394. }
  58395. // Do executes the "compute.httpHealthChecks.delete" call.
  58396. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58397. // status code is an error. Response headers are in either
  58398. // *Operation.ServerResponse.Header or (if a response was returned at
  58399. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58400. // to check whether the returned error was because
  58401. // http.StatusNotModified was returned.
  58402. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58403. gensupport.SetOptions(c.urlParams_, opts...)
  58404. res, err := c.doRequest("json")
  58405. if res != nil && res.StatusCode == http.StatusNotModified {
  58406. if res.Body != nil {
  58407. res.Body.Close()
  58408. }
  58409. return nil, &googleapi.Error{
  58410. Code: res.StatusCode,
  58411. Header: res.Header,
  58412. }
  58413. }
  58414. if err != nil {
  58415. return nil, err
  58416. }
  58417. defer googleapi.CloseBody(res)
  58418. if err := googleapi.CheckResponse(res); err != nil {
  58419. return nil, err
  58420. }
  58421. ret := &Operation{
  58422. ServerResponse: googleapi.ServerResponse{
  58423. Header: res.Header,
  58424. HTTPStatusCode: res.StatusCode,
  58425. },
  58426. }
  58427. target := &ret
  58428. if err := gensupport.DecodeResponse(target, res); err != nil {
  58429. return nil, err
  58430. }
  58431. return ret, nil
  58432. // {
  58433. // "description": "Deletes the specified HttpHealthCheck resource.",
  58434. // "httpMethod": "DELETE",
  58435. // "id": "compute.httpHealthChecks.delete",
  58436. // "parameterOrder": [
  58437. // "project",
  58438. // "httpHealthCheck"
  58439. // ],
  58440. // "parameters": {
  58441. // "httpHealthCheck": {
  58442. // "description": "Name of the HttpHealthCheck resource to delete.",
  58443. // "location": "path",
  58444. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58445. // "required": true,
  58446. // "type": "string"
  58447. // },
  58448. // "project": {
  58449. // "description": "Project ID for this request.",
  58450. // "location": "path",
  58451. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58452. // "required": true,
  58453. // "type": "string"
  58454. // },
  58455. // "requestId": {
  58456. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58457. // "location": "query",
  58458. // "type": "string"
  58459. // }
  58460. // },
  58461. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  58462. // "response": {
  58463. // "$ref": "Operation"
  58464. // },
  58465. // "scopes": [
  58466. // "https://www.googleapis.com/auth/cloud-platform",
  58467. // "https://www.googleapis.com/auth/compute"
  58468. // ]
  58469. // }
  58470. }
  58471. // method id "compute.httpHealthChecks.get":
  58472. type HttpHealthChecksGetCall struct {
  58473. s *Service
  58474. project string
  58475. httpHealthCheck string
  58476. urlParams_ gensupport.URLParams
  58477. ifNoneMatch_ string
  58478. ctx_ context.Context
  58479. header_ http.Header
  58480. }
  58481. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  58482. // available HTTP health checks by making a list() request.
  58483. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  58484. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  58485. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58486. c.project = project
  58487. c.httpHealthCheck = httpHealthCheck
  58488. return c
  58489. }
  58490. // Fields allows partial responses to be retrieved. See
  58491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58492. // for more information.
  58493. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  58494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58495. return c
  58496. }
  58497. // IfNoneMatch sets the optional parameter which makes the operation
  58498. // fail if the object's ETag matches the given value. This is useful for
  58499. // getting updates only after the object has changed since the last
  58500. // request. Use googleapi.IsNotModified to check whether the response
  58501. // error from Do is the result of In-None-Match.
  58502. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  58503. c.ifNoneMatch_ = entityTag
  58504. return c
  58505. }
  58506. // Context sets the context to be used in this call's Do method. Any
  58507. // pending HTTP request will be aborted if the provided context is
  58508. // canceled.
  58509. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  58510. c.ctx_ = ctx
  58511. return c
  58512. }
  58513. // Header returns an http.Header that can be modified by the caller to
  58514. // add HTTP headers to the request.
  58515. func (c *HttpHealthChecksGetCall) Header() http.Header {
  58516. if c.header_ == nil {
  58517. c.header_ = make(http.Header)
  58518. }
  58519. return c.header_
  58520. }
  58521. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  58522. reqHeaders := make(http.Header)
  58523. for k, v := range c.header_ {
  58524. reqHeaders[k] = v
  58525. }
  58526. reqHeaders.Set("User-Agent", c.s.userAgent())
  58527. if c.ifNoneMatch_ != "" {
  58528. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58529. }
  58530. var body io.Reader = nil
  58531. c.urlParams_.Set("alt", alt)
  58532. c.urlParams_.Set("prettyPrint", "false")
  58533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  58534. urls += "?" + c.urlParams_.Encode()
  58535. req, err := http.NewRequest("GET", urls, body)
  58536. if err != nil {
  58537. return nil, err
  58538. }
  58539. req.Header = reqHeaders
  58540. googleapi.Expand(req.URL, map[string]string{
  58541. "project": c.project,
  58542. "httpHealthCheck": c.httpHealthCheck,
  58543. })
  58544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58545. }
  58546. // Do executes the "compute.httpHealthChecks.get" call.
  58547. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  58548. // status code is an error. Response headers are in either
  58549. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  58550. // at all) in error.(*googleapi.Error).Header. Use
  58551. // googleapi.IsNotModified to check whether the returned error was
  58552. // because http.StatusNotModified was returned.
  58553. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  58554. gensupport.SetOptions(c.urlParams_, opts...)
  58555. res, err := c.doRequest("json")
  58556. if res != nil && res.StatusCode == http.StatusNotModified {
  58557. if res.Body != nil {
  58558. res.Body.Close()
  58559. }
  58560. return nil, &googleapi.Error{
  58561. Code: res.StatusCode,
  58562. Header: res.Header,
  58563. }
  58564. }
  58565. if err != nil {
  58566. return nil, err
  58567. }
  58568. defer googleapi.CloseBody(res)
  58569. if err := googleapi.CheckResponse(res); err != nil {
  58570. return nil, err
  58571. }
  58572. ret := &HttpHealthCheck{
  58573. ServerResponse: googleapi.ServerResponse{
  58574. Header: res.Header,
  58575. HTTPStatusCode: res.StatusCode,
  58576. },
  58577. }
  58578. target := &ret
  58579. if err := gensupport.DecodeResponse(target, res); err != nil {
  58580. return nil, err
  58581. }
  58582. return ret, nil
  58583. // {
  58584. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  58585. // "httpMethod": "GET",
  58586. // "id": "compute.httpHealthChecks.get",
  58587. // "parameterOrder": [
  58588. // "project",
  58589. // "httpHealthCheck"
  58590. // ],
  58591. // "parameters": {
  58592. // "httpHealthCheck": {
  58593. // "description": "Name of the HttpHealthCheck resource to return.",
  58594. // "location": "path",
  58595. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58596. // "required": true,
  58597. // "type": "string"
  58598. // },
  58599. // "project": {
  58600. // "description": "Project ID for this request.",
  58601. // "location": "path",
  58602. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58603. // "required": true,
  58604. // "type": "string"
  58605. // }
  58606. // },
  58607. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  58608. // "response": {
  58609. // "$ref": "HttpHealthCheck"
  58610. // },
  58611. // "scopes": [
  58612. // "https://www.googleapis.com/auth/cloud-platform",
  58613. // "https://www.googleapis.com/auth/compute",
  58614. // "https://www.googleapis.com/auth/compute.readonly"
  58615. // ]
  58616. // }
  58617. }
  58618. // method id "compute.httpHealthChecks.insert":
  58619. type HttpHealthChecksInsertCall struct {
  58620. s *Service
  58621. project string
  58622. httphealthcheck *HttpHealthCheck
  58623. urlParams_ gensupport.URLParams
  58624. ctx_ context.Context
  58625. header_ http.Header
  58626. }
  58627. // Insert: Creates a HttpHealthCheck resource in the specified project
  58628. // using the data included in the request.
  58629. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  58630. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  58631. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58632. c.project = project
  58633. c.httphealthcheck = httphealthcheck
  58634. return c
  58635. }
  58636. // RequestId sets the optional parameter "requestId": An optional
  58637. // request ID to identify requests. Specify a unique request ID so that
  58638. // if you must retry your request, the server will know to ignore the
  58639. // request if it has already been completed.
  58640. //
  58641. // For example, consider a situation where you make an initial request
  58642. // and the request times out. If you make the request again with the
  58643. // same request ID, the server can check if original operation with the
  58644. // same request ID was received, and if so, will ignore the second
  58645. // request. This prevents clients from accidentally creating duplicate
  58646. // commitments.
  58647. //
  58648. // The request ID must be a valid UUID with the exception that zero UUID
  58649. // is not supported (00000000-0000-0000-0000-000000000000).
  58650. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  58651. c.urlParams_.Set("requestId", requestId)
  58652. return c
  58653. }
  58654. // Fields allows partial responses to be retrieved. See
  58655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58656. // for more information.
  58657. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  58658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58659. return c
  58660. }
  58661. // Context sets the context to be used in this call's Do method. Any
  58662. // pending HTTP request will be aborted if the provided context is
  58663. // canceled.
  58664. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  58665. c.ctx_ = ctx
  58666. return c
  58667. }
  58668. // Header returns an http.Header that can be modified by the caller to
  58669. // add HTTP headers to the request.
  58670. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  58671. if c.header_ == nil {
  58672. c.header_ = make(http.Header)
  58673. }
  58674. return c.header_
  58675. }
  58676. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  58677. reqHeaders := make(http.Header)
  58678. for k, v := range c.header_ {
  58679. reqHeaders[k] = v
  58680. }
  58681. reqHeaders.Set("User-Agent", c.s.userAgent())
  58682. var body io.Reader = nil
  58683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  58684. if err != nil {
  58685. return nil, err
  58686. }
  58687. reqHeaders.Set("Content-Type", "application/json")
  58688. c.urlParams_.Set("alt", alt)
  58689. c.urlParams_.Set("prettyPrint", "false")
  58690. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  58691. urls += "?" + c.urlParams_.Encode()
  58692. req, err := http.NewRequest("POST", urls, body)
  58693. if err != nil {
  58694. return nil, err
  58695. }
  58696. req.Header = reqHeaders
  58697. googleapi.Expand(req.URL, map[string]string{
  58698. "project": c.project,
  58699. })
  58700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58701. }
  58702. // Do executes the "compute.httpHealthChecks.insert" call.
  58703. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58704. // status code is an error. Response headers are in either
  58705. // *Operation.ServerResponse.Header or (if a response was returned at
  58706. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58707. // to check whether the returned error was because
  58708. // http.StatusNotModified was returned.
  58709. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58710. gensupport.SetOptions(c.urlParams_, opts...)
  58711. res, err := c.doRequest("json")
  58712. if res != nil && res.StatusCode == http.StatusNotModified {
  58713. if res.Body != nil {
  58714. res.Body.Close()
  58715. }
  58716. return nil, &googleapi.Error{
  58717. Code: res.StatusCode,
  58718. Header: res.Header,
  58719. }
  58720. }
  58721. if err != nil {
  58722. return nil, err
  58723. }
  58724. defer googleapi.CloseBody(res)
  58725. if err := googleapi.CheckResponse(res); err != nil {
  58726. return nil, err
  58727. }
  58728. ret := &Operation{
  58729. ServerResponse: googleapi.ServerResponse{
  58730. Header: res.Header,
  58731. HTTPStatusCode: res.StatusCode,
  58732. },
  58733. }
  58734. target := &ret
  58735. if err := gensupport.DecodeResponse(target, res); err != nil {
  58736. return nil, err
  58737. }
  58738. return ret, nil
  58739. // {
  58740. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  58741. // "httpMethod": "POST",
  58742. // "id": "compute.httpHealthChecks.insert",
  58743. // "parameterOrder": [
  58744. // "project"
  58745. // ],
  58746. // "parameters": {
  58747. // "project": {
  58748. // "description": "Project ID for this request.",
  58749. // "location": "path",
  58750. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58751. // "required": true,
  58752. // "type": "string"
  58753. // },
  58754. // "requestId": {
  58755. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58756. // "location": "query",
  58757. // "type": "string"
  58758. // }
  58759. // },
  58760. // "path": "{project}/global/httpHealthChecks",
  58761. // "request": {
  58762. // "$ref": "HttpHealthCheck"
  58763. // },
  58764. // "response": {
  58765. // "$ref": "Operation"
  58766. // },
  58767. // "scopes": [
  58768. // "https://www.googleapis.com/auth/cloud-platform",
  58769. // "https://www.googleapis.com/auth/compute"
  58770. // ]
  58771. // }
  58772. }
  58773. // method id "compute.httpHealthChecks.list":
  58774. type HttpHealthChecksListCall struct {
  58775. s *Service
  58776. project string
  58777. urlParams_ gensupport.URLParams
  58778. ifNoneMatch_ string
  58779. ctx_ context.Context
  58780. header_ http.Header
  58781. }
  58782. // List: Retrieves the list of HttpHealthCheck resources available to
  58783. // the specified project.
  58784. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  58785. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  58786. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58787. c.project = project
  58788. return c
  58789. }
  58790. // Filter sets the optional parameter "filter": A filter expression that
  58791. // filters resources listed in the response. The expression must specify
  58792. // the field name, a comparison operator, and the value that you want to
  58793. // use for filtering. The value must be a string, a number, or a
  58794. // boolean. The comparison operator must be either =, !=, >, or <.
  58795. //
  58796. // For example, if you are filtering Compute Engine instances, you can
  58797. // exclude instances named example-instance by specifying name !=
  58798. // example-instance.
  58799. //
  58800. // You can also filter nested fields. For example, you could specify
  58801. // scheduling.automaticRestart = false to include instances only if they
  58802. // are not scheduled for automatic restarts. You can use filtering on
  58803. // nested fields to filter based on resource labels.
  58804. //
  58805. // To filter on multiple expressions, provide each separate expression
  58806. // within parentheses. For example, (scheduling.automaticRestart = true)
  58807. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58808. // AND expression. However, you can include AND and OR expressions
  58809. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58810. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58811. // true).
  58812. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  58813. c.urlParams_.Set("filter", filter)
  58814. return c
  58815. }
  58816. // MaxResults sets the optional parameter "maxResults": The maximum
  58817. // number of results per page that should be returned. If the number of
  58818. // available results is larger than maxResults, Compute Engine returns a
  58819. // nextPageToken that can be used to get the next page of results in
  58820. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58821. // (Default: 500)
  58822. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  58823. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58824. return c
  58825. }
  58826. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58827. // a certain order. By default, results are returned in alphanumerical
  58828. // order based on the resource name.
  58829. //
  58830. // You can also sort results in descending order based on the creation
  58831. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58832. // based on the creationTimestamp field in reverse chronological order
  58833. // (newest result first). Use this to sort resources like operations so
  58834. // that the newest operation is returned first.
  58835. //
  58836. // Currently, only sorting by name or creationTimestamp desc is
  58837. // supported.
  58838. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  58839. c.urlParams_.Set("orderBy", orderBy)
  58840. return c
  58841. }
  58842. // PageToken sets the optional parameter "pageToken": Specifies a page
  58843. // token to use. Set pageToken to the nextPageToken returned by a
  58844. // previous list request to get the next page of results.
  58845. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  58846. c.urlParams_.Set("pageToken", pageToken)
  58847. return c
  58848. }
  58849. // Fields allows partial responses to be retrieved. See
  58850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58851. // for more information.
  58852. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  58853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58854. return c
  58855. }
  58856. // IfNoneMatch sets the optional parameter which makes the operation
  58857. // fail if the object's ETag matches the given value. This is useful for
  58858. // getting updates only after the object has changed since the last
  58859. // request. Use googleapi.IsNotModified to check whether the response
  58860. // error from Do is the result of In-None-Match.
  58861. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  58862. c.ifNoneMatch_ = entityTag
  58863. return c
  58864. }
  58865. // Context sets the context to be used in this call's Do method. Any
  58866. // pending HTTP request will be aborted if the provided context is
  58867. // canceled.
  58868. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  58869. c.ctx_ = ctx
  58870. return c
  58871. }
  58872. // Header returns an http.Header that can be modified by the caller to
  58873. // add HTTP headers to the request.
  58874. func (c *HttpHealthChecksListCall) Header() http.Header {
  58875. if c.header_ == nil {
  58876. c.header_ = make(http.Header)
  58877. }
  58878. return c.header_
  58879. }
  58880. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  58881. reqHeaders := make(http.Header)
  58882. for k, v := range c.header_ {
  58883. reqHeaders[k] = v
  58884. }
  58885. reqHeaders.Set("User-Agent", c.s.userAgent())
  58886. if c.ifNoneMatch_ != "" {
  58887. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58888. }
  58889. var body io.Reader = nil
  58890. c.urlParams_.Set("alt", alt)
  58891. c.urlParams_.Set("prettyPrint", "false")
  58892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  58893. urls += "?" + c.urlParams_.Encode()
  58894. req, err := http.NewRequest("GET", urls, body)
  58895. if err != nil {
  58896. return nil, err
  58897. }
  58898. req.Header = reqHeaders
  58899. googleapi.Expand(req.URL, map[string]string{
  58900. "project": c.project,
  58901. })
  58902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58903. }
  58904. // Do executes the "compute.httpHealthChecks.list" call.
  58905. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  58906. // non-2xx status code is an error. Response headers are in either
  58907. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  58908. // returned at all) in error.(*googleapi.Error).Header. Use
  58909. // googleapi.IsNotModified to check whether the returned error was
  58910. // because http.StatusNotModified was returned.
  58911. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  58912. gensupport.SetOptions(c.urlParams_, opts...)
  58913. res, err := c.doRequest("json")
  58914. if res != nil && res.StatusCode == http.StatusNotModified {
  58915. if res.Body != nil {
  58916. res.Body.Close()
  58917. }
  58918. return nil, &googleapi.Error{
  58919. Code: res.StatusCode,
  58920. Header: res.Header,
  58921. }
  58922. }
  58923. if err != nil {
  58924. return nil, err
  58925. }
  58926. defer googleapi.CloseBody(res)
  58927. if err := googleapi.CheckResponse(res); err != nil {
  58928. return nil, err
  58929. }
  58930. ret := &HttpHealthCheckList{
  58931. ServerResponse: googleapi.ServerResponse{
  58932. Header: res.Header,
  58933. HTTPStatusCode: res.StatusCode,
  58934. },
  58935. }
  58936. target := &ret
  58937. if err := gensupport.DecodeResponse(target, res); err != nil {
  58938. return nil, err
  58939. }
  58940. return ret, nil
  58941. // {
  58942. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  58943. // "httpMethod": "GET",
  58944. // "id": "compute.httpHealthChecks.list",
  58945. // "parameterOrder": [
  58946. // "project"
  58947. // ],
  58948. // "parameters": {
  58949. // "filter": {
  58950. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  58951. // "location": "query",
  58952. // "type": "string"
  58953. // },
  58954. // "maxResults": {
  58955. // "default": "500",
  58956. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  58957. // "format": "uint32",
  58958. // "location": "query",
  58959. // "minimum": "0",
  58960. // "type": "integer"
  58961. // },
  58962. // "orderBy": {
  58963. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  58964. // "location": "query",
  58965. // "type": "string"
  58966. // },
  58967. // "pageToken": {
  58968. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  58969. // "location": "query",
  58970. // "type": "string"
  58971. // },
  58972. // "project": {
  58973. // "description": "Project ID for this request.",
  58974. // "location": "path",
  58975. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58976. // "required": true,
  58977. // "type": "string"
  58978. // }
  58979. // },
  58980. // "path": "{project}/global/httpHealthChecks",
  58981. // "response": {
  58982. // "$ref": "HttpHealthCheckList"
  58983. // },
  58984. // "scopes": [
  58985. // "https://www.googleapis.com/auth/cloud-platform",
  58986. // "https://www.googleapis.com/auth/compute",
  58987. // "https://www.googleapis.com/auth/compute.readonly"
  58988. // ]
  58989. // }
  58990. }
  58991. // Pages invokes f for each page of results.
  58992. // A non-nil error returned from f will halt the iteration.
  58993. // The provided context supersedes any context provided to the Context method.
  58994. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  58995. c.ctx_ = ctx
  58996. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58997. for {
  58998. x, err := c.Do()
  58999. if err != nil {
  59000. return err
  59001. }
  59002. if err := f(x); err != nil {
  59003. return err
  59004. }
  59005. if x.NextPageToken == "" {
  59006. return nil
  59007. }
  59008. c.PageToken(x.NextPageToken)
  59009. }
  59010. }
  59011. // method id "compute.httpHealthChecks.patch":
  59012. type HttpHealthChecksPatchCall struct {
  59013. s *Service
  59014. project string
  59015. httpHealthCheck string
  59016. httphealthcheck *HttpHealthCheck
  59017. urlParams_ gensupport.URLParams
  59018. ctx_ context.Context
  59019. header_ http.Header
  59020. }
  59021. // Patch: Updates a HttpHealthCheck resource in the specified project
  59022. // using the data included in the request. This method supports PATCH
  59023. // semantics and uses the JSON merge patch format and processing rules.
  59024. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  59025. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  59026. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59027. c.project = project
  59028. c.httpHealthCheck = httpHealthCheck
  59029. c.httphealthcheck = httphealthcheck
  59030. return c
  59031. }
  59032. // RequestId sets the optional parameter "requestId": An optional
  59033. // request ID to identify requests. Specify a unique request ID so that
  59034. // if you must retry your request, the server will know to ignore the
  59035. // request if it has already been completed.
  59036. //
  59037. // For example, consider a situation where you make an initial request
  59038. // and the request times out. If you make the request again with the
  59039. // same request ID, the server can check if original operation with the
  59040. // same request ID was received, and if so, will ignore the second
  59041. // request. This prevents clients from accidentally creating duplicate
  59042. // commitments.
  59043. //
  59044. // The request ID must be a valid UUID with the exception that zero UUID
  59045. // is not supported (00000000-0000-0000-0000-000000000000).
  59046. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  59047. c.urlParams_.Set("requestId", requestId)
  59048. return c
  59049. }
  59050. // Fields allows partial responses to be retrieved. See
  59051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59052. // for more information.
  59053. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  59054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59055. return c
  59056. }
  59057. // Context sets the context to be used in this call's Do method. Any
  59058. // pending HTTP request will be aborted if the provided context is
  59059. // canceled.
  59060. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  59061. c.ctx_ = ctx
  59062. return c
  59063. }
  59064. // Header returns an http.Header that can be modified by the caller to
  59065. // add HTTP headers to the request.
  59066. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  59067. if c.header_ == nil {
  59068. c.header_ = make(http.Header)
  59069. }
  59070. return c.header_
  59071. }
  59072. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  59073. reqHeaders := make(http.Header)
  59074. for k, v := range c.header_ {
  59075. reqHeaders[k] = v
  59076. }
  59077. reqHeaders.Set("User-Agent", c.s.userAgent())
  59078. var body io.Reader = nil
  59079. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  59080. if err != nil {
  59081. return nil, err
  59082. }
  59083. reqHeaders.Set("Content-Type", "application/json")
  59084. c.urlParams_.Set("alt", alt)
  59085. c.urlParams_.Set("prettyPrint", "false")
  59086. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  59087. urls += "?" + c.urlParams_.Encode()
  59088. req, err := http.NewRequest("PATCH", urls, body)
  59089. if err != nil {
  59090. return nil, err
  59091. }
  59092. req.Header = reqHeaders
  59093. googleapi.Expand(req.URL, map[string]string{
  59094. "project": c.project,
  59095. "httpHealthCheck": c.httpHealthCheck,
  59096. })
  59097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59098. }
  59099. // Do executes the "compute.httpHealthChecks.patch" call.
  59100. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59101. // status code is an error. Response headers are in either
  59102. // *Operation.ServerResponse.Header or (if a response was returned at
  59103. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59104. // to check whether the returned error was because
  59105. // http.StatusNotModified was returned.
  59106. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59107. gensupport.SetOptions(c.urlParams_, opts...)
  59108. res, err := c.doRequest("json")
  59109. if res != nil && res.StatusCode == http.StatusNotModified {
  59110. if res.Body != nil {
  59111. res.Body.Close()
  59112. }
  59113. return nil, &googleapi.Error{
  59114. Code: res.StatusCode,
  59115. Header: res.Header,
  59116. }
  59117. }
  59118. if err != nil {
  59119. return nil, err
  59120. }
  59121. defer googleapi.CloseBody(res)
  59122. if err := googleapi.CheckResponse(res); err != nil {
  59123. return nil, err
  59124. }
  59125. ret := &Operation{
  59126. ServerResponse: googleapi.ServerResponse{
  59127. Header: res.Header,
  59128. HTTPStatusCode: res.StatusCode,
  59129. },
  59130. }
  59131. target := &ret
  59132. if err := gensupport.DecodeResponse(target, res); err != nil {
  59133. return nil, err
  59134. }
  59135. return ret, nil
  59136. // {
  59137. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  59138. // "httpMethod": "PATCH",
  59139. // "id": "compute.httpHealthChecks.patch",
  59140. // "parameterOrder": [
  59141. // "project",
  59142. // "httpHealthCheck"
  59143. // ],
  59144. // "parameters": {
  59145. // "httpHealthCheck": {
  59146. // "description": "Name of the HttpHealthCheck resource to patch.",
  59147. // "location": "path",
  59148. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59149. // "required": true,
  59150. // "type": "string"
  59151. // },
  59152. // "project": {
  59153. // "description": "Project ID for this request.",
  59154. // "location": "path",
  59155. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59156. // "required": true,
  59157. // "type": "string"
  59158. // },
  59159. // "requestId": {
  59160. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59161. // "location": "query",
  59162. // "type": "string"
  59163. // }
  59164. // },
  59165. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  59166. // "request": {
  59167. // "$ref": "HttpHealthCheck"
  59168. // },
  59169. // "response": {
  59170. // "$ref": "Operation"
  59171. // },
  59172. // "scopes": [
  59173. // "https://www.googleapis.com/auth/cloud-platform",
  59174. // "https://www.googleapis.com/auth/compute"
  59175. // ]
  59176. // }
  59177. }
  59178. // method id "compute.httpHealthChecks.testIamPermissions":
  59179. type HttpHealthChecksTestIamPermissionsCall struct {
  59180. s *Service
  59181. project string
  59182. resource string
  59183. testpermissionsrequest *TestPermissionsRequest
  59184. urlParams_ gensupport.URLParams
  59185. ctx_ context.Context
  59186. header_ http.Header
  59187. }
  59188. // TestIamPermissions: Returns permissions that a caller has on the
  59189. // specified resource.
  59190. func (r *HttpHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpHealthChecksTestIamPermissionsCall {
  59191. c := &HttpHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59192. c.project = project
  59193. c.resource = resource
  59194. c.testpermissionsrequest = testpermissionsrequest
  59195. return c
  59196. }
  59197. // Fields allows partial responses to be retrieved. See
  59198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59199. // for more information.
  59200. func (c *HttpHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpHealthChecksTestIamPermissionsCall {
  59201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59202. return c
  59203. }
  59204. // Context sets the context to be used in this call's Do method. Any
  59205. // pending HTTP request will be aborted if the provided context is
  59206. // canceled.
  59207. func (c *HttpHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpHealthChecksTestIamPermissionsCall {
  59208. c.ctx_ = ctx
  59209. return c
  59210. }
  59211. // Header returns an http.Header that can be modified by the caller to
  59212. // add HTTP headers to the request.
  59213. func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header {
  59214. if c.header_ == nil {
  59215. c.header_ = make(http.Header)
  59216. }
  59217. return c.header_
  59218. }
  59219. func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  59220. reqHeaders := make(http.Header)
  59221. for k, v := range c.header_ {
  59222. reqHeaders[k] = v
  59223. }
  59224. reqHeaders.Set("User-Agent", c.s.userAgent())
  59225. var body io.Reader = nil
  59226. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  59227. if err != nil {
  59228. return nil, err
  59229. }
  59230. reqHeaders.Set("Content-Type", "application/json")
  59231. c.urlParams_.Set("alt", alt)
  59232. c.urlParams_.Set("prettyPrint", "false")
  59233. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{resource}/testIamPermissions")
  59234. urls += "?" + c.urlParams_.Encode()
  59235. req, err := http.NewRequest("POST", urls, body)
  59236. if err != nil {
  59237. return nil, err
  59238. }
  59239. req.Header = reqHeaders
  59240. googleapi.Expand(req.URL, map[string]string{
  59241. "project": c.project,
  59242. "resource": c.resource,
  59243. })
  59244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59245. }
  59246. // Do executes the "compute.httpHealthChecks.testIamPermissions" call.
  59247. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  59248. // non-2xx status code is an error. Response headers are in either
  59249. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  59250. // returned at all) in error.(*googleapi.Error).Header. Use
  59251. // googleapi.IsNotModified to check whether the returned error was
  59252. // because http.StatusNotModified was returned.
  59253. func (c *HttpHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  59254. gensupport.SetOptions(c.urlParams_, opts...)
  59255. res, err := c.doRequest("json")
  59256. if res != nil && res.StatusCode == http.StatusNotModified {
  59257. if res.Body != nil {
  59258. res.Body.Close()
  59259. }
  59260. return nil, &googleapi.Error{
  59261. Code: res.StatusCode,
  59262. Header: res.Header,
  59263. }
  59264. }
  59265. if err != nil {
  59266. return nil, err
  59267. }
  59268. defer googleapi.CloseBody(res)
  59269. if err := googleapi.CheckResponse(res); err != nil {
  59270. return nil, err
  59271. }
  59272. ret := &TestPermissionsResponse{
  59273. ServerResponse: googleapi.ServerResponse{
  59274. Header: res.Header,
  59275. HTTPStatusCode: res.StatusCode,
  59276. },
  59277. }
  59278. target := &ret
  59279. if err := gensupport.DecodeResponse(target, res); err != nil {
  59280. return nil, err
  59281. }
  59282. return ret, nil
  59283. // {
  59284. // "description": "Returns permissions that a caller has on the specified resource.",
  59285. // "httpMethod": "POST",
  59286. // "id": "compute.httpHealthChecks.testIamPermissions",
  59287. // "parameterOrder": [
  59288. // "project",
  59289. // "resource"
  59290. // ],
  59291. // "parameters": {
  59292. // "project": {
  59293. // "description": "Project ID for this request.",
  59294. // "location": "path",
  59295. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59296. // "required": true,
  59297. // "type": "string"
  59298. // },
  59299. // "resource": {
  59300. // "description": "Name or id of the resource for this request.",
  59301. // "location": "path",
  59302. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59303. // "required": true,
  59304. // "type": "string"
  59305. // }
  59306. // },
  59307. // "path": "{project}/global/httpHealthChecks/{resource}/testIamPermissions",
  59308. // "request": {
  59309. // "$ref": "TestPermissionsRequest"
  59310. // },
  59311. // "response": {
  59312. // "$ref": "TestPermissionsResponse"
  59313. // },
  59314. // "scopes": [
  59315. // "https://www.googleapis.com/auth/cloud-platform",
  59316. // "https://www.googleapis.com/auth/compute",
  59317. // "https://www.googleapis.com/auth/compute.readonly"
  59318. // ]
  59319. // }
  59320. }
  59321. // method id "compute.httpHealthChecks.update":
  59322. type HttpHealthChecksUpdateCall struct {
  59323. s *Service
  59324. project string
  59325. httpHealthCheck string
  59326. httphealthcheck *HttpHealthCheck
  59327. urlParams_ gensupport.URLParams
  59328. ctx_ context.Context
  59329. header_ http.Header
  59330. }
  59331. // Update: Updates a HttpHealthCheck resource in the specified project
  59332. // using the data included in the request.
  59333. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  59334. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  59335. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59336. c.project = project
  59337. c.httpHealthCheck = httpHealthCheck
  59338. c.httphealthcheck = httphealthcheck
  59339. return c
  59340. }
  59341. // RequestId sets the optional parameter "requestId": An optional
  59342. // request ID to identify requests. Specify a unique request ID so that
  59343. // if you must retry your request, the server will know to ignore the
  59344. // request if it has already been completed.
  59345. //
  59346. // For example, consider a situation where you make an initial request
  59347. // and the request times out. If you make the request again with the
  59348. // same request ID, the server can check if original operation with the
  59349. // same request ID was received, and if so, will ignore the second
  59350. // request. This prevents clients from accidentally creating duplicate
  59351. // commitments.
  59352. //
  59353. // The request ID must be a valid UUID with the exception that zero UUID
  59354. // is not supported (00000000-0000-0000-0000-000000000000).
  59355. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  59356. c.urlParams_.Set("requestId", requestId)
  59357. return c
  59358. }
  59359. // Fields allows partial responses to be retrieved. See
  59360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59361. // for more information.
  59362. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  59363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59364. return c
  59365. }
  59366. // Context sets the context to be used in this call's Do method. Any
  59367. // pending HTTP request will be aborted if the provided context is
  59368. // canceled.
  59369. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  59370. c.ctx_ = ctx
  59371. return c
  59372. }
  59373. // Header returns an http.Header that can be modified by the caller to
  59374. // add HTTP headers to the request.
  59375. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  59376. if c.header_ == nil {
  59377. c.header_ = make(http.Header)
  59378. }
  59379. return c.header_
  59380. }
  59381. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  59382. reqHeaders := make(http.Header)
  59383. for k, v := range c.header_ {
  59384. reqHeaders[k] = v
  59385. }
  59386. reqHeaders.Set("User-Agent", c.s.userAgent())
  59387. var body io.Reader = nil
  59388. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  59389. if err != nil {
  59390. return nil, err
  59391. }
  59392. reqHeaders.Set("Content-Type", "application/json")
  59393. c.urlParams_.Set("alt", alt)
  59394. c.urlParams_.Set("prettyPrint", "false")
  59395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  59396. urls += "?" + c.urlParams_.Encode()
  59397. req, err := http.NewRequest("PUT", urls, body)
  59398. if err != nil {
  59399. return nil, err
  59400. }
  59401. req.Header = reqHeaders
  59402. googleapi.Expand(req.URL, map[string]string{
  59403. "project": c.project,
  59404. "httpHealthCheck": c.httpHealthCheck,
  59405. })
  59406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59407. }
  59408. // Do executes the "compute.httpHealthChecks.update" call.
  59409. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59410. // status code is an error. Response headers are in either
  59411. // *Operation.ServerResponse.Header or (if a response was returned at
  59412. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59413. // to check whether the returned error was because
  59414. // http.StatusNotModified was returned.
  59415. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59416. gensupport.SetOptions(c.urlParams_, opts...)
  59417. res, err := c.doRequest("json")
  59418. if res != nil && res.StatusCode == http.StatusNotModified {
  59419. if res.Body != nil {
  59420. res.Body.Close()
  59421. }
  59422. return nil, &googleapi.Error{
  59423. Code: res.StatusCode,
  59424. Header: res.Header,
  59425. }
  59426. }
  59427. if err != nil {
  59428. return nil, err
  59429. }
  59430. defer googleapi.CloseBody(res)
  59431. if err := googleapi.CheckResponse(res); err != nil {
  59432. return nil, err
  59433. }
  59434. ret := &Operation{
  59435. ServerResponse: googleapi.ServerResponse{
  59436. Header: res.Header,
  59437. HTTPStatusCode: res.StatusCode,
  59438. },
  59439. }
  59440. target := &ret
  59441. if err := gensupport.DecodeResponse(target, res); err != nil {
  59442. return nil, err
  59443. }
  59444. return ret, nil
  59445. // {
  59446. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  59447. // "httpMethod": "PUT",
  59448. // "id": "compute.httpHealthChecks.update",
  59449. // "parameterOrder": [
  59450. // "project",
  59451. // "httpHealthCheck"
  59452. // ],
  59453. // "parameters": {
  59454. // "httpHealthCheck": {
  59455. // "description": "Name of the HttpHealthCheck resource to update.",
  59456. // "location": "path",
  59457. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59458. // "required": true,
  59459. // "type": "string"
  59460. // },
  59461. // "project": {
  59462. // "description": "Project ID for this request.",
  59463. // "location": "path",
  59464. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59465. // "required": true,
  59466. // "type": "string"
  59467. // },
  59468. // "requestId": {
  59469. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59470. // "location": "query",
  59471. // "type": "string"
  59472. // }
  59473. // },
  59474. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  59475. // "request": {
  59476. // "$ref": "HttpHealthCheck"
  59477. // },
  59478. // "response": {
  59479. // "$ref": "Operation"
  59480. // },
  59481. // "scopes": [
  59482. // "https://www.googleapis.com/auth/cloud-platform",
  59483. // "https://www.googleapis.com/auth/compute"
  59484. // ]
  59485. // }
  59486. }
  59487. // method id "compute.httpsHealthChecks.delete":
  59488. type HttpsHealthChecksDeleteCall struct {
  59489. s *Service
  59490. project string
  59491. httpsHealthCheck string
  59492. urlParams_ gensupport.URLParams
  59493. ctx_ context.Context
  59494. header_ http.Header
  59495. }
  59496. // Delete: Deletes the specified HttpsHealthCheck resource.
  59497. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  59498. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59499. c.project = project
  59500. c.httpsHealthCheck = httpsHealthCheck
  59501. return c
  59502. }
  59503. // RequestId sets the optional parameter "requestId": An optional
  59504. // request ID to identify requests. Specify a unique request ID so that
  59505. // if you must retry your request, the server will know to ignore the
  59506. // request if it has already been completed.
  59507. //
  59508. // For example, consider a situation where you make an initial request
  59509. // and the request times out. If you make the request again with the
  59510. // same request ID, the server can check if original operation with the
  59511. // same request ID was received, and if so, will ignore the second
  59512. // request. This prevents clients from accidentally creating duplicate
  59513. // commitments.
  59514. //
  59515. // The request ID must be a valid UUID with the exception that zero UUID
  59516. // is not supported (00000000-0000-0000-0000-000000000000).
  59517. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  59518. c.urlParams_.Set("requestId", requestId)
  59519. return c
  59520. }
  59521. // Fields allows partial responses to be retrieved. See
  59522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59523. // for more information.
  59524. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  59525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59526. return c
  59527. }
  59528. // Context sets the context to be used in this call's Do method. Any
  59529. // pending HTTP request will be aborted if the provided context is
  59530. // canceled.
  59531. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  59532. c.ctx_ = ctx
  59533. return c
  59534. }
  59535. // Header returns an http.Header that can be modified by the caller to
  59536. // add HTTP headers to the request.
  59537. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  59538. if c.header_ == nil {
  59539. c.header_ = make(http.Header)
  59540. }
  59541. return c.header_
  59542. }
  59543. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  59544. reqHeaders := make(http.Header)
  59545. for k, v := range c.header_ {
  59546. reqHeaders[k] = v
  59547. }
  59548. reqHeaders.Set("User-Agent", c.s.userAgent())
  59549. var body io.Reader = nil
  59550. c.urlParams_.Set("alt", alt)
  59551. c.urlParams_.Set("prettyPrint", "false")
  59552. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  59553. urls += "?" + c.urlParams_.Encode()
  59554. req, err := http.NewRequest("DELETE", urls, body)
  59555. if err != nil {
  59556. return nil, err
  59557. }
  59558. req.Header = reqHeaders
  59559. googleapi.Expand(req.URL, map[string]string{
  59560. "project": c.project,
  59561. "httpsHealthCheck": c.httpsHealthCheck,
  59562. })
  59563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59564. }
  59565. // Do executes the "compute.httpsHealthChecks.delete" call.
  59566. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59567. // status code is an error. Response headers are in either
  59568. // *Operation.ServerResponse.Header or (if a response was returned at
  59569. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59570. // to check whether the returned error was because
  59571. // http.StatusNotModified was returned.
  59572. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59573. gensupport.SetOptions(c.urlParams_, opts...)
  59574. res, err := c.doRequest("json")
  59575. if res != nil && res.StatusCode == http.StatusNotModified {
  59576. if res.Body != nil {
  59577. res.Body.Close()
  59578. }
  59579. return nil, &googleapi.Error{
  59580. Code: res.StatusCode,
  59581. Header: res.Header,
  59582. }
  59583. }
  59584. if err != nil {
  59585. return nil, err
  59586. }
  59587. defer googleapi.CloseBody(res)
  59588. if err := googleapi.CheckResponse(res); err != nil {
  59589. return nil, err
  59590. }
  59591. ret := &Operation{
  59592. ServerResponse: googleapi.ServerResponse{
  59593. Header: res.Header,
  59594. HTTPStatusCode: res.StatusCode,
  59595. },
  59596. }
  59597. target := &ret
  59598. if err := gensupport.DecodeResponse(target, res); err != nil {
  59599. return nil, err
  59600. }
  59601. return ret, nil
  59602. // {
  59603. // "description": "Deletes the specified HttpsHealthCheck resource.",
  59604. // "httpMethod": "DELETE",
  59605. // "id": "compute.httpsHealthChecks.delete",
  59606. // "parameterOrder": [
  59607. // "project",
  59608. // "httpsHealthCheck"
  59609. // ],
  59610. // "parameters": {
  59611. // "httpsHealthCheck": {
  59612. // "description": "Name of the HttpsHealthCheck resource to delete.",
  59613. // "location": "path",
  59614. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59615. // "required": true,
  59616. // "type": "string"
  59617. // },
  59618. // "project": {
  59619. // "description": "Project ID for this request.",
  59620. // "location": "path",
  59621. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59622. // "required": true,
  59623. // "type": "string"
  59624. // },
  59625. // "requestId": {
  59626. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59627. // "location": "query",
  59628. // "type": "string"
  59629. // }
  59630. // },
  59631. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  59632. // "response": {
  59633. // "$ref": "Operation"
  59634. // },
  59635. // "scopes": [
  59636. // "https://www.googleapis.com/auth/cloud-platform",
  59637. // "https://www.googleapis.com/auth/compute"
  59638. // ]
  59639. // }
  59640. }
  59641. // method id "compute.httpsHealthChecks.get":
  59642. type HttpsHealthChecksGetCall struct {
  59643. s *Service
  59644. project string
  59645. httpsHealthCheck string
  59646. urlParams_ gensupport.URLParams
  59647. ifNoneMatch_ string
  59648. ctx_ context.Context
  59649. header_ http.Header
  59650. }
  59651. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  59652. // available HTTPS health checks by making a list() request.
  59653. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  59654. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59655. c.project = project
  59656. c.httpsHealthCheck = httpsHealthCheck
  59657. return c
  59658. }
  59659. // Fields allows partial responses to be retrieved. See
  59660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59661. // for more information.
  59662. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  59663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59664. return c
  59665. }
  59666. // IfNoneMatch sets the optional parameter which makes the operation
  59667. // fail if the object's ETag matches the given value. This is useful for
  59668. // getting updates only after the object has changed since the last
  59669. // request. Use googleapi.IsNotModified to check whether the response
  59670. // error from Do is the result of In-None-Match.
  59671. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  59672. c.ifNoneMatch_ = entityTag
  59673. return c
  59674. }
  59675. // Context sets the context to be used in this call's Do method. Any
  59676. // pending HTTP request will be aborted if the provided context is
  59677. // canceled.
  59678. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  59679. c.ctx_ = ctx
  59680. return c
  59681. }
  59682. // Header returns an http.Header that can be modified by the caller to
  59683. // add HTTP headers to the request.
  59684. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  59685. if c.header_ == nil {
  59686. c.header_ = make(http.Header)
  59687. }
  59688. return c.header_
  59689. }
  59690. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  59691. reqHeaders := make(http.Header)
  59692. for k, v := range c.header_ {
  59693. reqHeaders[k] = v
  59694. }
  59695. reqHeaders.Set("User-Agent", c.s.userAgent())
  59696. if c.ifNoneMatch_ != "" {
  59697. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59698. }
  59699. var body io.Reader = nil
  59700. c.urlParams_.Set("alt", alt)
  59701. c.urlParams_.Set("prettyPrint", "false")
  59702. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  59703. urls += "?" + c.urlParams_.Encode()
  59704. req, err := http.NewRequest("GET", urls, body)
  59705. if err != nil {
  59706. return nil, err
  59707. }
  59708. req.Header = reqHeaders
  59709. googleapi.Expand(req.URL, map[string]string{
  59710. "project": c.project,
  59711. "httpsHealthCheck": c.httpsHealthCheck,
  59712. })
  59713. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59714. }
  59715. // Do executes the "compute.httpsHealthChecks.get" call.
  59716. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  59717. // non-2xx status code is an error. Response headers are in either
  59718. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  59719. // returned at all) in error.(*googleapi.Error).Header. Use
  59720. // googleapi.IsNotModified to check whether the returned error was
  59721. // because http.StatusNotModified was returned.
  59722. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  59723. gensupport.SetOptions(c.urlParams_, opts...)
  59724. res, err := c.doRequest("json")
  59725. if res != nil && res.StatusCode == http.StatusNotModified {
  59726. if res.Body != nil {
  59727. res.Body.Close()
  59728. }
  59729. return nil, &googleapi.Error{
  59730. Code: res.StatusCode,
  59731. Header: res.Header,
  59732. }
  59733. }
  59734. if err != nil {
  59735. return nil, err
  59736. }
  59737. defer googleapi.CloseBody(res)
  59738. if err := googleapi.CheckResponse(res); err != nil {
  59739. return nil, err
  59740. }
  59741. ret := &HttpsHealthCheck{
  59742. ServerResponse: googleapi.ServerResponse{
  59743. Header: res.Header,
  59744. HTTPStatusCode: res.StatusCode,
  59745. },
  59746. }
  59747. target := &ret
  59748. if err := gensupport.DecodeResponse(target, res); err != nil {
  59749. return nil, err
  59750. }
  59751. return ret, nil
  59752. // {
  59753. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  59754. // "httpMethod": "GET",
  59755. // "id": "compute.httpsHealthChecks.get",
  59756. // "parameterOrder": [
  59757. // "project",
  59758. // "httpsHealthCheck"
  59759. // ],
  59760. // "parameters": {
  59761. // "httpsHealthCheck": {
  59762. // "description": "Name of the HttpsHealthCheck resource to return.",
  59763. // "location": "path",
  59764. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59765. // "required": true,
  59766. // "type": "string"
  59767. // },
  59768. // "project": {
  59769. // "description": "Project ID for this request.",
  59770. // "location": "path",
  59771. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59772. // "required": true,
  59773. // "type": "string"
  59774. // }
  59775. // },
  59776. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  59777. // "response": {
  59778. // "$ref": "HttpsHealthCheck"
  59779. // },
  59780. // "scopes": [
  59781. // "https://www.googleapis.com/auth/cloud-platform",
  59782. // "https://www.googleapis.com/auth/compute",
  59783. // "https://www.googleapis.com/auth/compute.readonly"
  59784. // ]
  59785. // }
  59786. }
  59787. // method id "compute.httpsHealthChecks.insert":
  59788. type HttpsHealthChecksInsertCall struct {
  59789. s *Service
  59790. project string
  59791. httpshealthcheck *HttpsHealthCheck
  59792. urlParams_ gensupport.URLParams
  59793. ctx_ context.Context
  59794. header_ http.Header
  59795. }
  59796. // Insert: Creates a HttpsHealthCheck resource in the specified project
  59797. // using the data included in the request.
  59798. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  59799. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59800. c.project = project
  59801. c.httpshealthcheck = httpshealthcheck
  59802. return c
  59803. }
  59804. // RequestId sets the optional parameter "requestId": An optional
  59805. // request ID to identify requests. Specify a unique request ID so that
  59806. // if you must retry your request, the server will know to ignore the
  59807. // request if it has already been completed.
  59808. //
  59809. // For example, consider a situation where you make an initial request
  59810. // and the request times out. If you make the request again with the
  59811. // same request ID, the server can check if original operation with the
  59812. // same request ID was received, and if so, will ignore the second
  59813. // request. This prevents clients from accidentally creating duplicate
  59814. // commitments.
  59815. //
  59816. // The request ID must be a valid UUID with the exception that zero UUID
  59817. // is not supported (00000000-0000-0000-0000-000000000000).
  59818. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  59819. c.urlParams_.Set("requestId", requestId)
  59820. return c
  59821. }
  59822. // Fields allows partial responses to be retrieved. See
  59823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59824. // for more information.
  59825. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  59826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59827. return c
  59828. }
  59829. // Context sets the context to be used in this call's Do method. Any
  59830. // pending HTTP request will be aborted if the provided context is
  59831. // canceled.
  59832. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  59833. c.ctx_ = ctx
  59834. return c
  59835. }
  59836. // Header returns an http.Header that can be modified by the caller to
  59837. // add HTTP headers to the request.
  59838. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  59839. if c.header_ == nil {
  59840. c.header_ = make(http.Header)
  59841. }
  59842. return c.header_
  59843. }
  59844. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  59845. reqHeaders := make(http.Header)
  59846. for k, v := range c.header_ {
  59847. reqHeaders[k] = v
  59848. }
  59849. reqHeaders.Set("User-Agent", c.s.userAgent())
  59850. var body io.Reader = nil
  59851. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  59852. if err != nil {
  59853. return nil, err
  59854. }
  59855. reqHeaders.Set("Content-Type", "application/json")
  59856. c.urlParams_.Set("alt", alt)
  59857. c.urlParams_.Set("prettyPrint", "false")
  59858. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  59859. urls += "?" + c.urlParams_.Encode()
  59860. req, err := http.NewRequest("POST", urls, body)
  59861. if err != nil {
  59862. return nil, err
  59863. }
  59864. req.Header = reqHeaders
  59865. googleapi.Expand(req.URL, map[string]string{
  59866. "project": c.project,
  59867. })
  59868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59869. }
  59870. // Do executes the "compute.httpsHealthChecks.insert" call.
  59871. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59872. // status code is an error. Response headers are in either
  59873. // *Operation.ServerResponse.Header or (if a response was returned at
  59874. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59875. // to check whether the returned error was because
  59876. // http.StatusNotModified was returned.
  59877. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59878. gensupport.SetOptions(c.urlParams_, opts...)
  59879. res, err := c.doRequest("json")
  59880. if res != nil && res.StatusCode == http.StatusNotModified {
  59881. if res.Body != nil {
  59882. res.Body.Close()
  59883. }
  59884. return nil, &googleapi.Error{
  59885. Code: res.StatusCode,
  59886. Header: res.Header,
  59887. }
  59888. }
  59889. if err != nil {
  59890. return nil, err
  59891. }
  59892. defer googleapi.CloseBody(res)
  59893. if err := googleapi.CheckResponse(res); err != nil {
  59894. return nil, err
  59895. }
  59896. ret := &Operation{
  59897. ServerResponse: googleapi.ServerResponse{
  59898. Header: res.Header,
  59899. HTTPStatusCode: res.StatusCode,
  59900. },
  59901. }
  59902. target := &ret
  59903. if err := gensupport.DecodeResponse(target, res); err != nil {
  59904. return nil, err
  59905. }
  59906. return ret, nil
  59907. // {
  59908. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  59909. // "httpMethod": "POST",
  59910. // "id": "compute.httpsHealthChecks.insert",
  59911. // "parameterOrder": [
  59912. // "project"
  59913. // ],
  59914. // "parameters": {
  59915. // "project": {
  59916. // "description": "Project ID for this request.",
  59917. // "location": "path",
  59918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59919. // "required": true,
  59920. // "type": "string"
  59921. // },
  59922. // "requestId": {
  59923. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59924. // "location": "query",
  59925. // "type": "string"
  59926. // }
  59927. // },
  59928. // "path": "{project}/global/httpsHealthChecks",
  59929. // "request": {
  59930. // "$ref": "HttpsHealthCheck"
  59931. // },
  59932. // "response": {
  59933. // "$ref": "Operation"
  59934. // },
  59935. // "scopes": [
  59936. // "https://www.googleapis.com/auth/cloud-platform",
  59937. // "https://www.googleapis.com/auth/compute"
  59938. // ]
  59939. // }
  59940. }
  59941. // method id "compute.httpsHealthChecks.list":
  59942. type HttpsHealthChecksListCall struct {
  59943. s *Service
  59944. project string
  59945. urlParams_ gensupport.URLParams
  59946. ifNoneMatch_ string
  59947. ctx_ context.Context
  59948. header_ http.Header
  59949. }
  59950. // List: Retrieves the list of HttpsHealthCheck resources available to
  59951. // the specified project.
  59952. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  59953. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59954. c.project = project
  59955. return c
  59956. }
  59957. // Filter sets the optional parameter "filter": A filter expression that
  59958. // filters resources listed in the response. The expression must specify
  59959. // the field name, a comparison operator, and the value that you want to
  59960. // use for filtering. The value must be a string, a number, or a
  59961. // boolean. The comparison operator must be either =, !=, >, or <.
  59962. //
  59963. // For example, if you are filtering Compute Engine instances, you can
  59964. // exclude instances named example-instance by specifying name !=
  59965. // example-instance.
  59966. //
  59967. // You can also filter nested fields. For example, you could specify
  59968. // scheduling.automaticRestart = false to include instances only if they
  59969. // are not scheduled for automatic restarts. You can use filtering on
  59970. // nested fields to filter based on resource labels.
  59971. //
  59972. // To filter on multiple expressions, provide each separate expression
  59973. // within parentheses. For example, (scheduling.automaticRestart = true)
  59974. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  59975. // AND expression. However, you can include AND and OR expressions
  59976. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  59977. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  59978. // true).
  59979. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  59980. c.urlParams_.Set("filter", filter)
  59981. return c
  59982. }
  59983. // MaxResults sets the optional parameter "maxResults": The maximum
  59984. // number of results per page that should be returned. If the number of
  59985. // available results is larger than maxResults, Compute Engine returns a
  59986. // nextPageToken that can be used to get the next page of results in
  59987. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  59988. // (Default: 500)
  59989. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  59990. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  59991. return c
  59992. }
  59993. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  59994. // a certain order. By default, results are returned in alphanumerical
  59995. // order based on the resource name.
  59996. //
  59997. // You can also sort results in descending order based on the creation
  59998. // timestamp using orderBy="creationTimestamp desc". This sorts results
  59999. // based on the creationTimestamp field in reverse chronological order
  60000. // (newest result first). Use this to sort resources like operations so
  60001. // that the newest operation is returned first.
  60002. //
  60003. // Currently, only sorting by name or creationTimestamp desc is
  60004. // supported.
  60005. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  60006. c.urlParams_.Set("orderBy", orderBy)
  60007. return c
  60008. }
  60009. // PageToken sets the optional parameter "pageToken": Specifies a page
  60010. // token to use. Set pageToken to the nextPageToken returned by a
  60011. // previous list request to get the next page of results.
  60012. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  60013. c.urlParams_.Set("pageToken", pageToken)
  60014. return c
  60015. }
  60016. // Fields allows partial responses to be retrieved. See
  60017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60018. // for more information.
  60019. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  60020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60021. return c
  60022. }
  60023. // IfNoneMatch sets the optional parameter which makes the operation
  60024. // fail if the object's ETag matches the given value. This is useful for
  60025. // getting updates only after the object has changed since the last
  60026. // request. Use googleapi.IsNotModified to check whether the response
  60027. // error from Do is the result of In-None-Match.
  60028. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  60029. c.ifNoneMatch_ = entityTag
  60030. return c
  60031. }
  60032. // Context sets the context to be used in this call's Do method. Any
  60033. // pending HTTP request will be aborted if the provided context is
  60034. // canceled.
  60035. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  60036. c.ctx_ = ctx
  60037. return c
  60038. }
  60039. // Header returns an http.Header that can be modified by the caller to
  60040. // add HTTP headers to the request.
  60041. func (c *HttpsHealthChecksListCall) Header() http.Header {
  60042. if c.header_ == nil {
  60043. c.header_ = make(http.Header)
  60044. }
  60045. return c.header_
  60046. }
  60047. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  60048. reqHeaders := make(http.Header)
  60049. for k, v := range c.header_ {
  60050. reqHeaders[k] = v
  60051. }
  60052. reqHeaders.Set("User-Agent", c.s.userAgent())
  60053. if c.ifNoneMatch_ != "" {
  60054. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60055. }
  60056. var body io.Reader = nil
  60057. c.urlParams_.Set("alt", alt)
  60058. c.urlParams_.Set("prettyPrint", "false")
  60059. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  60060. urls += "?" + c.urlParams_.Encode()
  60061. req, err := http.NewRequest("GET", urls, body)
  60062. if err != nil {
  60063. return nil, err
  60064. }
  60065. req.Header = reqHeaders
  60066. googleapi.Expand(req.URL, map[string]string{
  60067. "project": c.project,
  60068. })
  60069. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60070. }
  60071. // Do executes the "compute.httpsHealthChecks.list" call.
  60072. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  60073. // non-2xx status code is an error. Response headers are in either
  60074. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  60075. // returned at all) in error.(*googleapi.Error).Header. Use
  60076. // googleapi.IsNotModified to check whether the returned error was
  60077. // because http.StatusNotModified was returned.
  60078. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  60079. gensupport.SetOptions(c.urlParams_, opts...)
  60080. res, err := c.doRequest("json")
  60081. if res != nil && res.StatusCode == http.StatusNotModified {
  60082. if res.Body != nil {
  60083. res.Body.Close()
  60084. }
  60085. return nil, &googleapi.Error{
  60086. Code: res.StatusCode,
  60087. Header: res.Header,
  60088. }
  60089. }
  60090. if err != nil {
  60091. return nil, err
  60092. }
  60093. defer googleapi.CloseBody(res)
  60094. if err := googleapi.CheckResponse(res); err != nil {
  60095. return nil, err
  60096. }
  60097. ret := &HttpsHealthCheckList{
  60098. ServerResponse: googleapi.ServerResponse{
  60099. Header: res.Header,
  60100. HTTPStatusCode: res.StatusCode,
  60101. },
  60102. }
  60103. target := &ret
  60104. if err := gensupport.DecodeResponse(target, res); err != nil {
  60105. return nil, err
  60106. }
  60107. return ret, nil
  60108. // {
  60109. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  60110. // "httpMethod": "GET",
  60111. // "id": "compute.httpsHealthChecks.list",
  60112. // "parameterOrder": [
  60113. // "project"
  60114. // ],
  60115. // "parameters": {
  60116. // "filter": {
  60117. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  60118. // "location": "query",
  60119. // "type": "string"
  60120. // },
  60121. // "maxResults": {
  60122. // "default": "500",
  60123. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  60124. // "format": "uint32",
  60125. // "location": "query",
  60126. // "minimum": "0",
  60127. // "type": "integer"
  60128. // },
  60129. // "orderBy": {
  60130. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  60131. // "location": "query",
  60132. // "type": "string"
  60133. // },
  60134. // "pageToken": {
  60135. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  60136. // "location": "query",
  60137. // "type": "string"
  60138. // },
  60139. // "project": {
  60140. // "description": "Project ID for this request.",
  60141. // "location": "path",
  60142. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60143. // "required": true,
  60144. // "type": "string"
  60145. // }
  60146. // },
  60147. // "path": "{project}/global/httpsHealthChecks",
  60148. // "response": {
  60149. // "$ref": "HttpsHealthCheckList"
  60150. // },
  60151. // "scopes": [
  60152. // "https://www.googleapis.com/auth/cloud-platform",
  60153. // "https://www.googleapis.com/auth/compute",
  60154. // "https://www.googleapis.com/auth/compute.readonly"
  60155. // ]
  60156. // }
  60157. }
  60158. // Pages invokes f for each page of results.
  60159. // A non-nil error returned from f will halt the iteration.
  60160. // The provided context supersedes any context provided to the Context method.
  60161. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  60162. c.ctx_ = ctx
  60163. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60164. for {
  60165. x, err := c.Do()
  60166. if err != nil {
  60167. return err
  60168. }
  60169. if err := f(x); err != nil {
  60170. return err
  60171. }
  60172. if x.NextPageToken == "" {
  60173. return nil
  60174. }
  60175. c.PageToken(x.NextPageToken)
  60176. }
  60177. }
  60178. // method id "compute.httpsHealthChecks.patch":
  60179. type HttpsHealthChecksPatchCall struct {
  60180. s *Service
  60181. project string
  60182. httpsHealthCheck string
  60183. httpshealthcheck *HttpsHealthCheck
  60184. urlParams_ gensupport.URLParams
  60185. ctx_ context.Context
  60186. header_ http.Header
  60187. }
  60188. // Patch: Updates a HttpsHealthCheck resource in the specified project
  60189. // using the data included in the request. This method supports PATCH
  60190. // semantics and uses the JSON merge patch format and processing rules.
  60191. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  60192. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60193. c.project = project
  60194. c.httpsHealthCheck = httpsHealthCheck
  60195. c.httpshealthcheck = httpshealthcheck
  60196. return c
  60197. }
  60198. // RequestId sets the optional parameter "requestId": An optional
  60199. // request ID to identify requests. Specify a unique request ID so that
  60200. // if you must retry your request, the server will know to ignore the
  60201. // request if it has already been completed.
  60202. //
  60203. // For example, consider a situation where you make an initial request
  60204. // and the request times out. If you make the request again with the
  60205. // same request ID, the server can check if original operation with the
  60206. // same request ID was received, and if so, will ignore the second
  60207. // request. This prevents clients from accidentally creating duplicate
  60208. // commitments.
  60209. //
  60210. // The request ID must be a valid UUID with the exception that zero UUID
  60211. // is not supported (00000000-0000-0000-0000-000000000000).
  60212. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  60213. c.urlParams_.Set("requestId", requestId)
  60214. return c
  60215. }
  60216. // Fields allows partial responses to be retrieved. See
  60217. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60218. // for more information.
  60219. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  60220. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60221. return c
  60222. }
  60223. // Context sets the context to be used in this call's Do method. Any
  60224. // pending HTTP request will be aborted if the provided context is
  60225. // canceled.
  60226. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  60227. c.ctx_ = ctx
  60228. return c
  60229. }
  60230. // Header returns an http.Header that can be modified by the caller to
  60231. // add HTTP headers to the request.
  60232. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  60233. if c.header_ == nil {
  60234. c.header_ = make(http.Header)
  60235. }
  60236. return c.header_
  60237. }
  60238. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  60239. reqHeaders := make(http.Header)
  60240. for k, v := range c.header_ {
  60241. reqHeaders[k] = v
  60242. }
  60243. reqHeaders.Set("User-Agent", c.s.userAgent())
  60244. var body io.Reader = nil
  60245. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  60246. if err != nil {
  60247. return nil, err
  60248. }
  60249. reqHeaders.Set("Content-Type", "application/json")
  60250. c.urlParams_.Set("alt", alt)
  60251. c.urlParams_.Set("prettyPrint", "false")
  60252. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  60253. urls += "?" + c.urlParams_.Encode()
  60254. req, err := http.NewRequest("PATCH", urls, body)
  60255. if err != nil {
  60256. return nil, err
  60257. }
  60258. req.Header = reqHeaders
  60259. googleapi.Expand(req.URL, map[string]string{
  60260. "project": c.project,
  60261. "httpsHealthCheck": c.httpsHealthCheck,
  60262. })
  60263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60264. }
  60265. // Do executes the "compute.httpsHealthChecks.patch" call.
  60266. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60267. // status code is an error. Response headers are in either
  60268. // *Operation.ServerResponse.Header or (if a response was returned at
  60269. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60270. // to check whether the returned error was because
  60271. // http.StatusNotModified was returned.
  60272. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60273. gensupport.SetOptions(c.urlParams_, opts...)
  60274. res, err := c.doRequest("json")
  60275. if res != nil && res.StatusCode == http.StatusNotModified {
  60276. if res.Body != nil {
  60277. res.Body.Close()
  60278. }
  60279. return nil, &googleapi.Error{
  60280. Code: res.StatusCode,
  60281. Header: res.Header,
  60282. }
  60283. }
  60284. if err != nil {
  60285. return nil, err
  60286. }
  60287. defer googleapi.CloseBody(res)
  60288. if err := googleapi.CheckResponse(res); err != nil {
  60289. return nil, err
  60290. }
  60291. ret := &Operation{
  60292. ServerResponse: googleapi.ServerResponse{
  60293. Header: res.Header,
  60294. HTTPStatusCode: res.StatusCode,
  60295. },
  60296. }
  60297. target := &ret
  60298. if err := gensupport.DecodeResponse(target, res); err != nil {
  60299. return nil, err
  60300. }
  60301. return ret, nil
  60302. // {
  60303. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  60304. // "httpMethod": "PATCH",
  60305. // "id": "compute.httpsHealthChecks.patch",
  60306. // "parameterOrder": [
  60307. // "project",
  60308. // "httpsHealthCheck"
  60309. // ],
  60310. // "parameters": {
  60311. // "httpsHealthCheck": {
  60312. // "description": "Name of the HttpsHealthCheck resource to patch.",
  60313. // "location": "path",
  60314. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60315. // "required": true,
  60316. // "type": "string"
  60317. // },
  60318. // "project": {
  60319. // "description": "Project ID for this request.",
  60320. // "location": "path",
  60321. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60322. // "required": true,
  60323. // "type": "string"
  60324. // },
  60325. // "requestId": {
  60326. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60327. // "location": "query",
  60328. // "type": "string"
  60329. // }
  60330. // },
  60331. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  60332. // "request": {
  60333. // "$ref": "HttpsHealthCheck"
  60334. // },
  60335. // "response": {
  60336. // "$ref": "Operation"
  60337. // },
  60338. // "scopes": [
  60339. // "https://www.googleapis.com/auth/cloud-platform",
  60340. // "https://www.googleapis.com/auth/compute"
  60341. // ]
  60342. // }
  60343. }
  60344. // method id "compute.httpsHealthChecks.testIamPermissions":
  60345. type HttpsHealthChecksTestIamPermissionsCall struct {
  60346. s *Service
  60347. project string
  60348. resource string
  60349. testpermissionsrequest *TestPermissionsRequest
  60350. urlParams_ gensupport.URLParams
  60351. ctx_ context.Context
  60352. header_ http.Header
  60353. }
  60354. // TestIamPermissions: Returns permissions that a caller has on the
  60355. // specified resource.
  60356. func (r *HttpsHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpsHealthChecksTestIamPermissionsCall {
  60357. c := &HttpsHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60358. c.project = project
  60359. c.resource = resource
  60360. c.testpermissionsrequest = testpermissionsrequest
  60361. return c
  60362. }
  60363. // Fields allows partial responses to be retrieved. See
  60364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60365. // for more information.
  60366. func (c *HttpsHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpsHealthChecksTestIamPermissionsCall {
  60367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60368. return c
  60369. }
  60370. // Context sets the context to be used in this call's Do method. Any
  60371. // pending HTTP request will be aborted if the provided context is
  60372. // canceled.
  60373. func (c *HttpsHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpsHealthChecksTestIamPermissionsCall {
  60374. c.ctx_ = ctx
  60375. return c
  60376. }
  60377. // Header returns an http.Header that can be modified by the caller to
  60378. // add HTTP headers to the request.
  60379. func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header {
  60380. if c.header_ == nil {
  60381. c.header_ = make(http.Header)
  60382. }
  60383. return c.header_
  60384. }
  60385. func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  60386. reqHeaders := make(http.Header)
  60387. for k, v := range c.header_ {
  60388. reqHeaders[k] = v
  60389. }
  60390. reqHeaders.Set("User-Agent", c.s.userAgent())
  60391. var body io.Reader = nil
  60392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  60393. if err != nil {
  60394. return nil, err
  60395. }
  60396. reqHeaders.Set("Content-Type", "application/json")
  60397. c.urlParams_.Set("alt", alt)
  60398. c.urlParams_.Set("prettyPrint", "false")
  60399. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{resource}/testIamPermissions")
  60400. urls += "?" + c.urlParams_.Encode()
  60401. req, err := http.NewRequest("POST", urls, body)
  60402. if err != nil {
  60403. return nil, err
  60404. }
  60405. req.Header = reqHeaders
  60406. googleapi.Expand(req.URL, map[string]string{
  60407. "project": c.project,
  60408. "resource": c.resource,
  60409. })
  60410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60411. }
  60412. // Do executes the "compute.httpsHealthChecks.testIamPermissions" call.
  60413. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  60414. // non-2xx status code is an error. Response headers are in either
  60415. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  60416. // returned at all) in error.(*googleapi.Error).Header. Use
  60417. // googleapi.IsNotModified to check whether the returned error was
  60418. // because http.StatusNotModified was returned.
  60419. func (c *HttpsHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  60420. gensupport.SetOptions(c.urlParams_, opts...)
  60421. res, err := c.doRequest("json")
  60422. if res != nil && res.StatusCode == http.StatusNotModified {
  60423. if res.Body != nil {
  60424. res.Body.Close()
  60425. }
  60426. return nil, &googleapi.Error{
  60427. Code: res.StatusCode,
  60428. Header: res.Header,
  60429. }
  60430. }
  60431. if err != nil {
  60432. return nil, err
  60433. }
  60434. defer googleapi.CloseBody(res)
  60435. if err := googleapi.CheckResponse(res); err != nil {
  60436. return nil, err
  60437. }
  60438. ret := &TestPermissionsResponse{
  60439. ServerResponse: googleapi.ServerResponse{
  60440. Header: res.Header,
  60441. HTTPStatusCode: res.StatusCode,
  60442. },
  60443. }
  60444. target := &ret
  60445. if err := gensupport.DecodeResponse(target, res); err != nil {
  60446. return nil, err
  60447. }
  60448. return ret, nil
  60449. // {
  60450. // "description": "Returns permissions that a caller has on the specified resource.",
  60451. // "httpMethod": "POST",
  60452. // "id": "compute.httpsHealthChecks.testIamPermissions",
  60453. // "parameterOrder": [
  60454. // "project",
  60455. // "resource"
  60456. // ],
  60457. // "parameters": {
  60458. // "project": {
  60459. // "description": "Project ID for this request.",
  60460. // "location": "path",
  60461. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60462. // "required": true,
  60463. // "type": "string"
  60464. // },
  60465. // "resource": {
  60466. // "description": "Name or id of the resource for this request.",
  60467. // "location": "path",
  60468. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60469. // "required": true,
  60470. // "type": "string"
  60471. // }
  60472. // },
  60473. // "path": "{project}/global/httpsHealthChecks/{resource}/testIamPermissions",
  60474. // "request": {
  60475. // "$ref": "TestPermissionsRequest"
  60476. // },
  60477. // "response": {
  60478. // "$ref": "TestPermissionsResponse"
  60479. // },
  60480. // "scopes": [
  60481. // "https://www.googleapis.com/auth/cloud-platform",
  60482. // "https://www.googleapis.com/auth/compute",
  60483. // "https://www.googleapis.com/auth/compute.readonly"
  60484. // ]
  60485. // }
  60486. }
  60487. // method id "compute.httpsHealthChecks.update":
  60488. type HttpsHealthChecksUpdateCall struct {
  60489. s *Service
  60490. project string
  60491. httpsHealthCheck string
  60492. httpshealthcheck *HttpsHealthCheck
  60493. urlParams_ gensupport.URLParams
  60494. ctx_ context.Context
  60495. header_ http.Header
  60496. }
  60497. // Update: Updates a HttpsHealthCheck resource in the specified project
  60498. // using the data included in the request.
  60499. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  60500. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60501. c.project = project
  60502. c.httpsHealthCheck = httpsHealthCheck
  60503. c.httpshealthcheck = httpshealthcheck
  60504. return c
  60505. }
  60506. // RequestId sets the optional parameter "requestId": An optional
  60507. // request ID to identify requests. Specify a unique request ID so that
  60508. // if you must retry your request, the server will know to ignore the
  60509. // request if it has already been completed.
  60510. //
  60511. // For example, consider a situation where you make an initial request
  60512. // and the request times out. If you make the request again with the
  60513. // same request ID, the server can check if original operation with the
  60514. // same request ID was received, and if so, will ignore the second
  60515. // request. This prevents clients from accidentally creating duplicate
  60516. // commitments.
  60517. //
  60518. // The request ID must be a valid UUID with the exception that zero UUID
  60519. // is not supported (00000000-0000-0000-0000-000000000000).
  60520. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  60521. c.urlParams_.Set("requestId", requestId)
  60522. return c
  60523. }
  60524. // Fields allows partial responses to be retrieved. See
  60525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60526. // for more information.
  60527. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  60528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60529. return c
  60530. }
  60531. // Context sets the context to be used in this call's Do method. Any
  60532. // pending HTTP request will be aborted if the provided context is
  60533. // canceled.
  60534. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  60535. c.ctx_ = ctx
  60536. return c
  60537. }
  60538. // Header returns an http.Header that can be modified by the caller to
  60539. // add HTTP headers to the request.
  60540. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  60541. if c.header_ == nil {
  60542. c.header_ = make(http.Header)
  60543. }
  60544. return c.header_
  60545. }
  60546. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  60547. reqHeaders := make(http.Header)
  60548. for k, v := range c.header_ {
  60549. reqHeaders[k] = v
  60550. }
  60551. reqHeaders.Set("User-Agent", c.s.userAgent())
  60552. var body io.Reader = nil
  60553. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  60554. if err != nil {
  60555. return nil, err
  60556. }
  60557. reqHeaders.Set("Content-Type", "application/json")
  60558. c.urlParams_.Set("alt", alt)
  60559. c.urlParams_.Set("prettyPrint", "false")
  60560. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  60561. urls += "?" + c.urlParams_.Encode()
  60562. req, err := http.NewRequest("PUT", urls, body)
  60563. if err != nil {
  60564. return nil, err
  60565. }
  60566. req.Header = reqHeaders
  60567. googleapi.Expand(req.URL, map[string]string{
  60568. "project": c.project,
  60569. "httpsHealthCheck": c.httpsHealthCheck,
  60570. })
  60571. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60572. }
  60573. // Do executes the "compute.httpsHealthChecks.update" call.
  60574. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60575. // status code is an error. Response headers are in either
  60576. // *Operation.ServerResponse.Header or (if a response was returned at
  60577. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60578. // to check whether the returned error was because
  60579. // http.StatusNotModified was returned.
  60580. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60581. gensupport.SetOptions(c.urlParams_, opts...)
  60582. res, err := c.doRequest("json")
  60583. if res != nil && res.StatusCode == http.StatusNotModified {
  60584. if res.Body != nil {
  60585. res.Body.Close()
  60586. }
  60587. return nil, &googleapi.Error{
  60588. Code: res.StatusCode,
  60589. Header: res.Header,
  60590. }
  60591. }
  60592. if err != nil {
  60593. return nil, err
  60594. }
  60595. defer googleapi.CloseBody(res)
  60596. if err := googleapi.CheckResponse(res); err != nil {
  60597. return nil, err
  60598. }
  60599. ret := &Operation{
  60600. ServerResponse: googleapi.ServerResponse{
  60601. Header: res.Header,
  60602. HTTPStatusCode: res.StatusCode,
  60603. },
  60604. }
  60605. target := &ret
  60606. if err := gensupport.DecodeResponse(target, res); err != nil {
  60607. return nil, err
  60608. }
  60609. return ret, nil
  60610. // {
  60611. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  60612. // "httpMethod": "PUT",
  60613. // "id": "compute.httpsHealthChecks.update",
  60614. // "parameterOrder": [
  60615. // "project",
  60616. // "httpsHealthCheck"
  60617. // ],
  60618. // "parameters": {
  60619. // "httpsHealthCheck": {
  60620. // "description": "Name of the HttpsHealthCheck resource to update.",
  60621. // "location": "path",
  60622. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60623. // "required": true,
  60624. // "type": "string"
  60625. // },
  60626. // "project": {
  60627. // "description": "Project ID for this request.",
  60628. // "location": "path",
  60629. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60630. // "required": true,
  60631. // "type": "string"
  60632. // },
  60633. // "requestId": {
  60634. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60635. // "location": "query",
  60636. // "type": "string"
  60637. // }
  60638. // },
  60639. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  60640. // "request": {
  60641. // "$ref": "HttpsHealthCheck"
  60642. // },
  60643. // "response": {
  60644. // "$ref": "Operation"
  60645. // },
  60646. // "scopes": [
  60647. // "https://www.googleapis.com/auth/cloud-platform",
  60648. // "https://www.googleapis.com/auth/compute"
  60649. // ]
  60650. // }
  60651. }
  60652. // method id "compute.images.delete":
  60653. type ImagesDeleteCall struct {
  60654. s *Service
  60655. project string
  60656. image string
  60657. urlParams_ gensupport.URLParams
  60658. ctx_ context.Context
  60659. header_ http.Header
  60660. }
  60661. // Delete: Deletes the specified image.
  60662. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  60663. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  60664. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60665. c.project = project
  60666. c.image = image
  60667. return c
  60668. }
  60669. // RequestId sets the optional parameter "requestId": An optional
  60670. // request ID to identify requests. Specify a unique request ID so that
  60671. // if you must retry your request, the server will know to ignore the
  60672. // request if it has already been completed.
  60673. //
  60674. // For example, consider a situation where you make an initial request
  60675. // and the request times out. If you make the request again with the
  60676. // same request ID, the server can check if original operation with the
  60677. // same request ID was received, and if so, will ignore the second
  60678. // request. This prevents clients from accidentally creating duplicate
  60679. // commitments.
  60680. //
  60681. // The request ID must be a valid UUID with the exception that zero UUID
  60682. // is not supported (00000000-0000-0000-0000-000000000000).
  60683. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  60684. c.urlParams_.Set("requestId", requestId)
  60685. return c
  60686. }
  60687. // Fields allows partial responses to be retrieved. See
  60688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60689. // for more information.
  60690. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  60691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60692. return c
  60693. }
  60694. // Context sets the context to be used in this call's Do method. Any
  60695. // pending HTTP request will be aborted if the provided context is
  60696. // canceled.
  60697. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  60698. c.ctx_ = ctx
  60699. return c
  60700. }
  60701. // Header returns an http.Header that can be modified by the caller to
  60702. // add HTTP headers to the request.
  60703. func (c *ImagesDeleteCall) Header() http.Header {
  60704. if c.header_ == nil {
  60705. c.header_ = make(http.Header)
  60706. }
  60707. return c.header_
  60708. }
  60709. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  60710. reqHeaders := make(http.Header)
  60711. for k, v := range c.header_ {
  60712. reqHeaders[k] = v
  60713. }
  60714. reqHeaders.Set("User-Agent", c.s.userAgent())
  60715. var body io.Reader = nil
  60716. c.urlParams_.Set("alt", alt)
  60717. c.urlParams_.Set("prettyPrint", "false")
  60718. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  60719. urls += "?" + c.urlParams_.Encode()
  60720. req, err := http.NewRequest("DELETE", urls, body)
  60721. if err != nil {
  60722. return nil, err
  60723. }
  60724. req.Header = reqHeaders
  60725. googleapi.Expand(req.URL, map[string]string{
  60726. "project": c.project,
  60727. "image": c.image,
  60728. })
  60729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60730. }
  60731. // Do executes the "compute.images.delete" call.
  60732. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60733. // status code is an error. Response headers are in either
  60734. // *Operation.ServerResponse.Header or (if a response was returned at
  60735. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60736. // to check whether the returned error was because
  60737. // http.StatusNotModified was returned.
  60738. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60739. gensupport.SetOptions(c.urlParams_, opts...)
  60740. res, err := c.doRequest("json")
  60741. if res != nil && res.StatusCode == http.StatusNotModified {
  60742. if res.Body != nil {
  60743. res.Body.Close()
  60744. }
  60745. return nil, &googleapi.Error{
  60746. Code: res.StatusCode,
  60747. Header: res.Header,
  60748. }
  60749. }
  60750. if err != nil {
  60751. return nil, err
  60752. }
  60753. defer googleapi.CloseBody(res)
  60754. if err := googleapi.CheckResponse(res); err != nil {
  60755. return nil, err
  60756. }
  60757. ret := &Operation{
  60758. ServerResponse: googleapi.ServerResponse{
  60759. Header: res.Header,
  60760. HTTPStatusCode: res.StatusCode,
  60761. },
  60762. }
  60763. target := &ret
  60764. if err := gensupport.DecodeResponse(target, res); err != nil {
  60765. return nil, err
  60766. }
  60767. return ret, nil
  60768. // {
  60769. // "description": "Deletes the specified image.",
  60770. // "httpMethod": "DELETE",
  60771. // "id": "compute.images.delete",
  60772. // "parameterOrder": [
  60773. // "project",
  60774. // "image"
  60775. // ],
  60776. // "parameters": {
  60777. // "image": {
  60778. // "description": "Name of the image resource to delete.",
  60779. // "location": "path",
  60780. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60781. // "required": true,
  60782. // "type": "string"
  60783. // },
  60784. // "project": {
  60785. // "description": "Project ID for this request.",
  60786. // "location": "path",
  60787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60788. // "required": true,
  60789. // "type": "string"
  60790. // },
  60791. // "requestId": {
  60792. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60793. // "location": "query",
  60794. // "type": "string"
  60795. // }
  60796. // },
  60797. // "path": "{project}/global/images/{image}",
  60798. // "response": {
  60799. // "$ref": "Operation"
  60800. // },
  60801. // "scopes": [
  60802. // "https://www.googleapis.com/auth/cloud-platform",
  60803. // "https://www.googleapis.com/auth/compute"
  60804. // ]
  60805. // }
  60806. }
  60807. // method id "compute.images.deprecate":
  60808. type ImagesDeprecateCall struct {
  60809. s *Service
  60810. project string
  60811. image string
  60812. deprecationstatus *DeprecationStatus
  60813. urlParams_ gensupport.URLParams
  60814. ctx_ context.Context
  60815. header_ http.Header
  60816. }
  60817. // Deprecate: Sets the deprecation status of an image.
  60818. //
  60819. // If an empty request body is given, clears the deprecation status
  60820. // instead.
  60821. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  60822. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  60823. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60824. c.project = project
  60825. c.image = image
  60826. c.deprecationstatus = deprecationstatus
  60827. return c
  60828. }
  60829. // RequestId sets the optional parameter "requestId": An optional
  60830. // request ID to identify requests. Specify a unique request ID so that
  60831. // if you must retry your request, the server will know to ignore the
  60832. // request if it has already been completed.
  60833. //
  60834. // For example, consider a situation where you make an initial request
  60835. // and the request times out. If you make the request again with the
  60836. // same request ID, the server can check if original operation with the
  60837. // same request ID was received, and if so, will ignore the second
  60838. // request. This prevents clients from accidentally creating duplicate
  60839. // commitments.
  60840. //
  60841. // The request ID must be a valid UUID with the exception that zero UUID
  60842. // is not supported (00000000-0000-0000-0000-000000000000).
  60843. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  60844. c.urlParams_.Set("requestId", requestId)
  60845. return c
  60846. }
  60847. // Fields allows partial responses to be retrieved. See
  60848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60849. // for more information.
  60850. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  60851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60852. return c
  60853. }
  60854. // Context sets the context to be used in this call's Do method. Any
  60855. // pending HTTP request will be aborted if the provided context is
  60856. // canceled.
  60857. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  60858. c.ctx_ = ctx
  60859. return c
  60860. }
  60861. // Header returns an http.Header that can be modified by the caller to
  60862. // add HTTP headers to the request.
  60863. func (c *ImagesDeprecateCall) Header() http.Header {
  60864. if c.header_ == nil {
  60865. c.header_ = make(http.Header)
  60866. }
  60867. return c.header_
  60868. }
  60869. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  60870. reqHeaders := make(http.Header)
  60871. for k, v := range c.header_ {
  60872. reqHeaders[k] = v
  60873. }
  60874. reqHeaders.Set("User-Agent", c.s.userAgent())
  60875. var body io.Reader = nil
  60876. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  60877. if err != nil {
  60878. return nil, err
  60879. }
  60880. reqHeaders.Set("Content-Type", "application/json")
  60881. c.urlParams_.Set("alt", alt)
  60882. c.urlParams_.Set("prettyPrint", "false")
  60883. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  60884. urls += "?" + c.urlParams_.Encode()
  60885. req, err := http.NewRequest("POST", urls, body)
  60886. if err != nil {
  60887. return nil, err
  60888. }
  60889. req.Header = reqHeaders
  60890. googleapi.Expand(req.URL, map[string]string{
  60891. "project": c.project,
  60892. "image": c.image,
  60893. })
  60894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60895. }
  60896. // Do executes the "compute.images.deprecate" call.
  60897. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60898. // status code is an error. Response headers are in either
  60899. // *Operation.ServerResponse.Header or (if a response was returned at
  60900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60901. // to check whether the returned error was because
  60902. // http.StatusNotModified was returned.
  60903. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60904. gensupport.SetOptions(c.urlParams_, opts...)
  60905. res, err := c.doRequest("json")
  60906. if res != nil && res.StatusCode == http.StatusNotModified {
  60907. if res.Body != nil {
  60908. res.Body.Close()
  60909. }
  60910. return nil, &googleapi.Error{
  60911. Code: res.StatusCode,
  60912. Header: res.Header,
  60913. }
  60914. }
  60915. if err != nil {
  60916. return nil, err
  60917. }
  60918. defer googleapi.CloseBody(res)
  60919. if err := googleapi.CheckResponse(res); err != nil {
  60920. return nil, err
  60921. }
  60922. ret := &Operation{
  60923. ServerResponse: googleapi.ServerResponse{
  60924. Header: res.Header,
  60925. HTTPStatusCode: res.StatusCode,
  60926. },
  60927. }
  60928. target := &ret
  60929. if err := gensupport.DecodeResponse(target, res); err != nil {
  60930. return nil, err
  60931. }
  60932. return ret, nil
  60933. // {
  60934. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  60935. // "httpMethod": "POST",
  60936. // "id": "compute.images.deprecate",
  60937. // "parameterOrder": [
  60938. // "project",
  60939. // "image"
  60940. // ],
  60941. // "parameters": {
  60942. // "image": {
  60943. // "description": "Image name.",
  60944. // "location": "path",
  60945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60946. // "required": true,
  60947. // "type": "string"
  60948. // },
  60949. // "project": {
  60950. // "description": "Project ID for this request.",
  60951. // "location": "path",
  60952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60953. // "required": true,
  60954. // "type": "string"
  60955. // },
  60956. // "requestId": {
  60957. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60958. // "location": "query",
  60959. // "type": "string"
  60960. // }
  60961. // },
  60962. // "path": "{project}/global/images/{image}/deprecate",
  60963. // "request": {
  60964. // "$ref": "DeprecationStatus"
  60965. // },
  60966. // "response": {
  60967. // "$ref": "Operation"
  60968. // },
  60969. // "scopes": [
  60970. // "https://www.googleapis.com/auth/cloud-platform",
  60971. // "https://www.googleapis.com/auth/compute"
  60972. // ]
  60973. // }
  60974. }
  60975. // method id "compute.images.get":
  60976. type ImagesGetCall struct {
  60977. s *Service
  60978. project string
  60979. image string
  60980. urlParams_ gensupport.URLParams
  60981. ifNoneMatch_ string
  60982. ctx_ context.Context
  60983. header_ http.Header
  60984. }
  60985. // Get: Returns the specified image. Gets a list of available images by
  60986. // making a list() request.
  60987. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  60988. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  60989. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60990. c.project = project
  60991. c.image = image
  60992. return c
  60993. }
  60994. // Fields allows partial responses to be retrieved. See
  60995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60996. // for more information.
  60997. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  60998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60999. return c
  61000. }
  61001. // IfNoneMatch sets the optional parameter which makes the operation
  61002. // fail if the object's ETag matches the given value. This is useful for
  61003. // getting updates only after the object has changed since the last
  61004. // request. Use googleapi.IsNotModified to check whether the response
  61005. // error from Do is the result of In-None-Match.
  61006. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  61007. c.ifNoneMatch_ = entityTag
  61008. return c
  61009. }
  61010. // Context sets the context to be used in this call's Do method. Any
  61011. // pending HTTP request will be aborted if the provided context is
  61012. // canceled.
  61013. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  61014. c.ctx_ = ctx
  61015. return c
  61016. }
  61017. // Header returns an http.Header that can be modified by the caller to
  61018. // add HTTP headers to the request.
  61019. func (c *ImagesGetCall) Header() http.Header {
  61020. if c.header_ == nil {
  61021. c.header_ = make(http.Header)
  61022. }
  61023. return c.header_
  61024. }
  61025. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  61026. reqHeaders := make(http.Header)
  61027. for k, v := range c.header_ {
  61028. reqHeaders[k] = v
  61029. }
  61030. reqHeaders.Set("User-Agent", c.s.userAgent())
  61031. if c.ifNoneMatch_ != "" {
  61032. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61033. }
  61034. var body io.Reader = nil
  61035. c.urlParams_.Set("alt", alt)
  61036. c.urlParams_.Set("prettyPrint", "false")
  61037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  61038. urls += "?" + c.urlParams_.Encode()
  61039. req, err := http.NewRequest("GET", urls, body)
  61040. if err != nil {
  61041. return nil, err
  61042. }
  61043. req.Header = reqHeaders
  61044. googleapi.Expand(req.URL, map[string]string{
  61045. "project": c.project,
  61046. "image": c.image,
  61047. })
  61048. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61049. }
  61050. // Do executes the "compute.images.get" call.
  61051. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  61052. // code is an error. Response headers are in either
  61053. // *Image.ServerResponse.Header or (if a response was returned at all)
  61054. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61055. // check whether the returned error was because http.StatusNotModified
  61056. // was returned.
  61057. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  61058. gensupport.SetOptions(c.urlParams_, opts...)
  61059. res, err := c.doRequest("json")
  61060. if res != nil && res.StatusCode == http.StatusNotModified {
  61061. if res.Body != nil {
  61062. res.Body.Close()
  61063. }
  61064. return nil, &googleapi.Error{
  61065. Code: res.StatusCode,
  61066. Header: res.Header,
  61067. }
  61068. }
  61069. if err != nil {
  61070. return nil, err
  61071. }
  61072. defer googleapi.CloseBody(res)
  61073. if err := googleapi.CheckResponse(res); err != nil {
  61074. return nil, err
  61075. }
  61076. ret := &Image{
  61077. ServerResponse: googleapi.ServerResponse{
  61078. Header: res.Header,
  61079. HTTPStatusCode: res.StatusCode,
  61080. },
  61081. }
  61082. target := &ret
  61083. if err := gensupport.DecodeResponse(target, res); err != nil {
  61084. return nil, err
  61085. }
  61086. return ret, nil
  61087. // {
  61088. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  61089. // "httpMethod": "GET",
  61090. // "id": "compute.images.get",
  61091. // "parameterOrder": [
  61092. // "project",
  61093. // "image"
  61094. // ],
  61095. // "parameters": {
  61096. // "image": {
  61097. // "description": "Name of the image resource to return.",
  61098. // "location": "path",
  61099. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61100. // "required": true,
  61101. // "type": "string"
  61102. // },
  61103. // "project": {
  61104. // "description": "Project ID for this request.",
  61105. // "location": "path",
  61106. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61107. // "required": true,
  61108. // "type": "string"
  61109. // }
  61110. // },
  61111. // "path": "{project}/global/images/{image}",
  61112. // "response": {
  61113. // "$ref": "Image"
  61114. // },
  61115. // "scopes": [
  61116. // "https://www.googleapis.com/auth/cloud-platform",
  61117. // "https://www.googleapis.com/auth/compute",
  61118. // "https://www.googleapis.com/auth/compute.readonly"
  61119. // ]
  61120. // }
  61121. }
  61122. // method id "compute.images.getFromFamily":
  61123. type ImagesGetFromFamilyCall struct {
  61124. s *Service
  61125. project string
  61126. family string
  61127. urlParams_ gensupport.URLParams
  61128. ifNoneMatch_ string
  61129. ctx_ context.Context
  61130. header_ http.Header
  61131. }
  61132. // GetFromFamily: Returns the latest image that is part of an image
  61133. // family and is not deprecated.
  61134. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  61135. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61136. c.project = project
  61137. c.family = family
  61138. return c
  61139. }
  61140. // Fields allows partial responses to be retrieved. See
  61141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61142. // for more information.
  61143. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  61144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61145. return c
  61146. }
  61147. // IfNoneMatch sets the optional parameter which makes the operation
  61148. // fail if the object's ETag matches the given value. This is useful for
  61149. // getting updates only after the object has changed since the last
  61150. // request. Use googleapi.IsNotModified to check whether the response
  61151. // error from Do is the result of In-None-Match.
  61152. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  61153. c.ifNoneMatch_ = entityTag
  61154. return c
  61155. }
  61156. // Context sets the context to be used in this call's Do method. Any
  61157. // pending HTTP request will be aborted if the provided context is
  61158. // canceled.
  61159. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  61160. c.ctx_ = ctx
  61161. return c
  61162. }
  61163. // Header returns an http.Header that can be modified by the caller to
  61164. // add HTTP headers to the request.
  61165. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  61166. if c.header_ == nil {
  61167. c.header_ = make(http.Header)
  61168. }
  61169. return c.header_
  61170. }
  61171. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  61172. reqHeaders := make(http.Header)
  61173. for k, v := range c.header_ {
  61174. reqHeaders[k] = v
  61175. }
  61176. reqHeaders.Set("User-Agent", c.s.userAgent())
  61177. if c.ifNoneMatch_ != "" {
  61178. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61179. }
  61180. var body io.Reader = nil
  61181. c.urlParams_.Set("alt", alt)
  61182. c.urlParams_.Set("prettyPrint", "false")
  61183. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  61184. urls += "?" + c.urlParams_.Encode()
  61185. req, err := http.NewRequest("GET", urls, body)
  61186. if err != nil {
  61187. return nil, err
  61188. }
  61189. req.Header = reqHeaders
  61190. googleapi.Expand(req.URL, map[string]string{
  61191. "project": c.project,
  61192. "family": c.family,
  61193. })
  61194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61195. }
  61196. // Do executes the "compute.images.getFromFamily" call.
  61197. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  61198. // code is an error. Response headers are in either
  61199. // *Image.ServerResponse.Header or (if a response was returned at all)
  61200. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61201. // check whether the returned error was because http.StatusNotModified
  61202. // was returned.
  61203. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  61204. gensupport.SetOptions(c.urlParams_, opts...)
  61205. res, err := c.doRequest("json")
  61206. if res != nil && res.StatusCode == http.StatusNotModified {
  61207. if res.Body != nil {
  61208. res.Body.Close()
  61209. }
  61210. return nil, &googleapi.Error{
  61211. Code: res.StatusCode,
  61212. Header: res.Header,
  61213. }
  61214. }
  61215. if err != nil {
  61216. return nil, err
  61217. }
  61218. defer googleapi.CloseBody(res)
  61219. if err := googleapi.CheckResponse(res); err != nil {
  61220. return nil, err
  61221. }
  61222. ret := &Image{
  61223. ServerResponse: googleapi.ServerResponse{
  61224. Header: res.Header,
  61225. HTTPStatusCode: res.StatusCode,
  61226. },
  61227. }
  61228. target := &ret
  61229. if err := gensupport.DecodeResponse(target, res); err != nil {
  61230. return nil, err
  61231. }
  61232. return ret, nil
  61233. // {
  61234. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  61235. // "httpMethod": "GET",
  61236. // "id": "compute.images.getFromFamily",
  61237. // "parameterOrder": [
  61238. // "project",
  61239. // "family"
  61240. // ],
  61241. // "parameters": {
  61242. // "family": {
  61243. // "description": "Name of the image family to search for.",
  61244. // "location": "path",
  61245. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61246. // "required": true,
  61247. // "type": "string"
  61248. // },
  61249. // "project": {
  61250. // "description": "Project ID for this request.",
  61251. // "location": "path",
  61252. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61253. // "required": true,
  61254. // "type": "string"
  61255. // }
  61256. // },
  61257. // "path": "{project}/global/images/family/{family}",
  61258. // "response": {
  61259. // "$ref": "Image"
  61260. // },
  61261. // "scopes": [
  61262. // "https://www.googleapis.com/auth/cloud-platform",
  61263. // "https://www.googleapis.com/auth/compute",
  61264. // "https://www.googleapis.com/auth/compute.readonly"
  61265. // ]
  61266. // }
  61267. }
  61268. // method id "compute.images.getIamPolicy":
  61269. type ImagesGetIamPolicyCall struct {
  61270. s *Service
  61271. project string
  61272. resource string
  61273. urlParams_ gensupport.URLParams
  61274. ifNoneMatch_ string
  61275. ctx_ context.Context
  61276. header_ http.Header
  61277. }
  61278. // GetIamPolicy: Gets the access control policy for a resource. May be
  61279. // empty if no such policy or resource exists.
  61280. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  61281. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61282. c.project = project
  61283. c.resource = resource
  61284. return c
  61285. }
  61286. // Fields allows partial responses to be retrieved. See
  61287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61288. // for more information.
  61289. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  61290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61291. return c
  61292. }
  61293. // IfNoneMatch sets the optional parameter which makes the operation
  61294. // fail if the object's ETag matches the given value. This is useful for
  61295. // getting updates only after the object has changed since the last
  61296. // request. Use googleapi.IsNotModified to check whether the response
  61297. // error from Do is the result of In-None-Match.
  61298. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  61299. c.ifNoneMatch_ = entityTag
  61300. return c
  61301. }
  61302. // Context sets the context to be used in this call's Do method. Any
  61303. // pending HTTP request will be aborted if the provided context is
  61304. // canceled.
  61305. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  61306. c.ctx_ = ctx
  61307. return c
  61308. }
  61309. // Header returns an http.Header that can be modified by the caller to
  61310. // add HTTP headers to the request.
  61311. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  61312. if c.header_ == nil {
  61313. c.header_ = make(http.Header)
  61314. }
  61315. return c.header_
  61316. }
  61317. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  61318. reqHeaders := make(http.Header)
  61319. for k, v := range c.header_ {
  61320. reqHeaders[k] = v
  61321. }
  61322. reqHeaders.Set("User-Agent", c.s.userAgent())
  61323. if c.ifNoneMatch_ != "" {
  61324. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61325. }
  61326. var body io.Reader = nil
  61327. c.urlParams_.Set("alt", alt)
  61328. c.urlParams_.Set("prettyPrint", "false")
  61329. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  61330. urls += "?" + c.urlParams_.Encode()
  61331. req, err := http.NewRequest("GET", urls, body)
  61332. if err != nil {
  61333. return nil, err
  61334. }
  61335. req.Header = reqHeaders
  61336. googleapi.Expand(req.URL, map[string]string{
  61337. "project": c.project,
  61338. "resource": c.resource,
  61339. })
  61340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61341. }
  61342. // Do executes the "compute.images.getIamPolicy" call.
  61343. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  61344. // code is an error. Response headers are in either
  61345. // *Policy.ServerResponse.Header or (if a response was returned at all)
  61346. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61347. // check whether the returned error was because http.StatusNotModified
  61348. // was returned.
  61349. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  61350. gensupport.SetOptions(c.urlParams_, opts...)
  61351. res, err := c.doRequest("json")
  61352. if res != nil && res.StatusCode == http.StatusNotModified {
  61353. if res.Body != nil {
  61354. res.Body.Close()
  61355. }
  61356. return nil, &googleapi.Error{
  61357. Code: res.StatusCode,
  61358. Header: res.Header,
  61359. }
  61360. }
  61361. if err != nil {
  61362. return nil, err
  61363. }
  61364. defer googleapi.CloseBody(res)
  61365. if err := googleapi.CheckResponse(res); err != nil {
  61366. return nil, err
  61367. }
  61368. ret := &Policy{
  61369. ServerResponse: googleapi.ServerResponse{
  61370. Header: res.Header,
  61371. HTTPStatusCode: res.StatusCode,
  61372. },
  61373. }
  61374. target := &ret
  61375. if err := gensupport.DecodeResponse(target, res); err != nil {
  61376. return nil, err
  61377. }
  61378. return ret, nil
  61379. // {
  61380. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  61381. // "httpMethod": "GET",
  61382. // "id": "compute.images.getIamPolicy",
  61383. // "parameterOrder": [
  61384. // "project",
  61385. // "resource"
  61386. // ],
  61387. // "parameters": {
  61388. // "project": {
  61389. // "description": "Project ID for this request.",
  61390. // "location": "path",
  61391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61392. // "required": true,
  61393. // "type": "string"
  61394. // },
  61395. // "resource": {
  61396. // "description": "Name or id of the resource for this request.",
  61397. // "location": "path",
  61398. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61399. // "required": true,
  61400. // "type": "string"
  61401. // }
  61402. // },
  61403. // "path": "{project}/global/images/{resource}/getIamPolicy",
  61404. // "response": {
  61405. // "$ref": "Policy"
  61406. // },
  61407. // "scopes": [
  61408. // "https://www.googleapis.com/auth/cloud-platform",
  61409. // "https://www.googleapis.com/auth/compute",
  61410. // "https://www.googleapis.com/auth/compute.readonly"
  61411. // ]
  61412. // }
  61413. }
  61414. // method id "compute.images.insert":
  61415. type ImagesInsertCall struct {
  61416. s *Service
  61417. project string
  61418. image *Image
  61419. urlParams_ gensupport.URLParams
  61420. ctx_ context.Context
  61421. header_ http.Header
  61422. }
  61423. // Insert: Creates an image in the specified project using the data
  61424. // included in the request.
  61425. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  61426. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  61427. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61428. c.project = project
  61429. c.image = image
  61430. return c
  61431. }
  61432. // ForceCreate sets the optional parameter "forceCreate": Force image
  61433. // creation if true.
  61434. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  61435. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  61436. return c
  61437. }
  61438. // RequestId sets the optional parameter "requestId": An optional
  61439. // request ID to identify requests. Specify a unique request ID so that
  61440. // if you must retry your request, the server will know to ignore the
  61441. // request if it has already been completed.
  61442. //
  61443. // For example, consider a situation where you make an initial request
  61444. // and the request times out. If you make the request again with the
  61445. // same request ID, the server can check if original operation with the
  61446. // same request ID was received, and if so, will ignore the second
  61447. // request. This prevents clients from accidentally creating duplicate
  61448. // commitments.
  61449. //
  61450. // The request ID must be a valid UUID with the exception that zero UUID
  61451. // is not supported (00000000-0000-0000-0000-000000000000).
  61452. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  61453. c.urlParams_.Set("requestId", requestId)
  61454. return c
  61455. }
  61456. // Fields allows partial responses to be retrieved. See
  61457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61458. // for more information.
  61459. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  61460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61461. return c
  61462. }
  61463. // Context sets the context to be used in this call's Do method. Any
  61464. // pending HTTP request will be aborted if the provided context is
  61465. // canceled.
  61466. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  61467. c.ctx_ = ctx
  61468. return c
  61469. }
  61470. // Header returns an http.Header that can be modified by the caller to
  61471. // add HTTP headers to the request.
  61472. func (c *ImagesInsertCall) Header() http.Header {
  61473. if c.header_ == nil {
  61474. c.header_ = make(http.Header)
  61475. }
  61476. return c.header_
  61477. }
  61478. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  61479. reqHeaders := make(http.Header)
  61480. for k, v := range c.header_ {
  61481. reqHeaders[k] = v
  61482. }
  61483. reqHeaders.Set("User-Agent", c.s.userAgent())
  61484. var body io.Reader = nil
  61485. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  61486. if err != nil {
  61487. return nil, err
  61488. }
  61489. reqHeaders.Set("Content-Type", "application/json")
  61490. c.urlParams_.Set("alt", alt)
  61491. c.urlParams_.Set("prettyPrint", "false")
  61492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  61493. urls += "?" + c.urlParams_.Encode()
  61494. req, err := http.NewRequest("POST", urls, body)
  61495. if err != nil {
  61496. return nil, err
  61497. }
  61498. req.Header = reqHeaders
  61499. googleapi.Expand(req.URL, map[string]string{
  61500. "project": c.project,
  61501. })
  61502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61503. }
  61504. // Do executes the "compute.images.insert" call.
  61505. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61506. // status code is an error. Response headers are in either
  61507. // *Operation.ServerResponse.Header or (if a response was returned at
  61508. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61509. // to check whether the returned error was because
  61510. // http.StatusNotModified was returned.
  61511. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61512. gensupport.SetOptions(c.urlParams_, opts...)
  61513. res, err := c.doRequest("json")
  61514. if res != nil && res.StatusCode == http.StatusNotModified {
  61515. if res.Body != nil {
  61516. res.Body.Close()
  61517. }
  61518. return nil, &googleapi.Error{
  61519. Code: res.StatusCode,
  61520. Header: res.Header,
  61521. }
  61522. }
  61523. if err != nil {
  61524. return nil, err
  61525. }
  61526. defer googleapi.CloseBody(res)
  61527. if err := googleapi.CheckResponse(res); err != nil {
  61528. return nil, err
  61529. }
  61530. ret := &Operation{
  61531. ServerResponse: googleapi.ServerResponse{
  61532. Header: res.Header,
  61533. HTTPStatusCode: res.StatusCode,
  61534. },
  61535. }
  61536. target := &ret
  61537. if err := gensupport.DecodeResponse(target, res); err != nil {
  61538. return nil, err
  61539. }
  61540. return ret, nil
  61541. // {
  61542. // "description": "Creates an image in the specified project using the data included in the request.",
  61543. // "httpMethod": "POST",
  61544. // "id": "compute.images.insert",
  61545. // "parameterOrder": [
  61546. // "project"
  61547. // ],
  61548. // "parameters": {
  61549. // "forceCreate": {
  61550. // "description": "Force image creation if true.",
  61551. // "location": "query",
  61552. // "type": "boolean"
  61553. // },
  61554. // "project": {
  61555. // "description": "Project ID for this request.",
  61556. // "location": "path",
  61557. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61558. // "required": true,
  61559. // "type": "string"
  61560. // },
  61561. // "requestId": {
  61562. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61563. // "location": "query",
  61564. // "type": "string"
  61565. // }
  61566. // },
  61567. // "path": "{project}/global/images",
  61568. // "request": {
  61569. // "$ref": "Image"
  61570. // },
  61571. // "response": {
  61572. // "$ref": "Operation"
  61573. // },
  61574. // "scopes": [
  61575. // "https://www.googleapis.com/auth/cloud-platform",
  61576. // "https://www.googleapis.com/auth/compute",
  61577. // "https://www.googleapis.com/auth/devstorage.full_control",
  61578. // "https://www.googleapis.com/auth/devstorage.read_only",
  61579. // "https://www.googleapis.com/auth/devstorage.read_write"
  61580. // ]
  61581. // }
  61582. }
  61583. // method id "compute.images.list":
  61584. type ImagesListCall struct {
  61585. s *Service
  61586. project string
  61587. urlParams_ gensupport.URLParams
  61588. ifNoneMatch_ string
  61589. ctx_ context.Context
  61590. header_ http.Header
  61591. }
  61592. // List: Retrieves the list of custom images available to the specified
  61593. // project. Custom images are images you create that belong to your
  61594. // project. This method does not get any images that belong to other
  61595. // projects, including publicly-available images, like Debian 8. If you
  61596. // want to get a list of publicly-available images, use this method to
  61597. // make a request to the respective image project, such as debian-cloud
  61598. // or windows-cloud.
  61599. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  61600. func (r *ImagesService) List(project string) *ImagesListCall {
  61601. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61602. c.project = project
  61603. return c
  61604. }
  61605. // Filter sets the optional parameter "filter": A filter expression that
  61606. // filters resources listed in the response. The expression must specify
  61607. // the field name, a comparison operator, and the value that you want to
  61608. // use for filtering. The value must be a string, a number, or a
  61609. // boolean. The comparison operator must be either =, !=, >, or <.
  61610. //
  61611. // For example, if you are filtering Compute Engine instances, you can
  61612. // exclude instances named example-instance by specifying name !=
  61613. // example-instance.
  61614. //
  61615. // You can also filter nested fields. For example, you could specify
  61616. // scheduling.automaticRestart = false to include instances only if they
  61617. // are not scheduled for automatic restarts. You can use filtering on
  61618. // nested fields to filter based on resource labels.
  61619. //
  61620. // To filter on multiple expressions, provide each separate expression
  61621. // within parentheses. For example, (scheduling.automaticRestart = true)
  61622. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  61623. // AND expression. However, you can include AND and OR expressions
  61624. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  61625. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  61626. // true).
  61627. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  61628. c.urlParams_.Set("filter", filter)
  61629. return c
  61630. }
  61631. // MaxResults sets the optional parameter "maxResults": The maximum
  61632. // number of results per page that should be returned. If the number of
  61633. // available results is larger than maxResults, Compute Engine returns a
  61634. // nextPageToken that can be used to get the next page of results in
  61635. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  61636. // (Default: 500)
  61637. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  61638. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  61639. return c
  61640. }
  61641. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  61642. // a certain order. By default, results are returned in alphanumerical
  61643. // order based on the resource name.
  61644. //
  61645. // You can also sort results in descending order based on the creation
  61646. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61647. // based on the creationTimestamp field in reverse chronological order
  61648. // (newest result first). Use this to sort resources like operations so
  61649. // that the newest operation is returned first.
  61650. //
  61651. // Currently, only sorting by name or creationTimestamp desc is
  61652. // supported.
  61653. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  61654. c.urlParams_.Set("orderBy", orderBy)
  61655. return c
  61656. }
  61657. // PageToken sets the optional parameter "pageToken": Specifies a page
  61658. // token to use. Set pageToken to the nextPageToken returned by a
  61659. // previous list request to get the next page of results.
  61660. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  61661. c.urlParams_.Set("pageToken", pageToken)
  61662. return c
  61663. }
  61664. // Fields allows partial responses to be retrieved. See
  61665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61666. // for more information.
  61667. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  61668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61669. return c
  61670. }
  61671. // IfNoneMatch sets the optional parameter which makes the operation
  61672. // fail if the object's ETag matches the given value. This is useful for
  61673. // getting updates only after the object has changed since the last
  61674. // request. Use googleapi.IsNotModified to check whether the response
  61675. // error from Do is the result of In-None-Match.
  61676. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  61677. c.ifNoneMatch_ = entityTag
  61678. return c
  61679. }
  61680. // Context sets the context to be used in this call's Do method. Any
  61681. // pending HTTP request will be aborted if the provided context is
  61682. // canceled.
  61683. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  61684. c.ctx_ = ctx
  61685. return c
  61686. }
  61687. // Header returns an http.Header that can be modified by the caller to
  61688. // add HTTP headers to the request.
  61689. func (c *ImagesListCall) Header() http.Header {
  61690. if c.header_ == nil {
  61691. c.header_ = make(http.Header)
  61692. }
  61693. return c.header_
  61694. }
  61695. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  61696. reqHeaders := make(http.Header)
  61697. for k, v := range c.header_ {
  61698. reqHeaders[k] = v
  61699. }
  61700. reqHeaders.Set("User-Agent", c.s.userAgent())
  61701. if c.ifNoneMatch_ != "" {
  61702. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61703. }
  61704. var body io.Reader = nil
  61705. c.urlParams_.Set("alt", alt)
  61706. c.urlParams_.Set("prettyPrint", "false")
  61707. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  61708. urls += "?" + c.urlParams_.Encode()
  61709. req, err := http.NewRequest("GET", urls, body)
  61710. if err != nil {
  61711. return nil, err
  61712. }
  61713. req.Header = reqHeaders
  61714. googleapi.Expand(req.URL, map[string]string{
  61715. "project": c.project,
  61716. })
  61717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61718. }
  61719. // Do executes the "compute.images.list" call.
  61720. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  61721. // status code is an error. Response headers are in either
  61722. // *ImageList.ServerResponse.Header or (if a response was returned at
  61723. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61724. // to check whether the returned error was because
  61725. // http.StatusNotModified was returned.
  61726. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  61727. gensupport.SetOptions(c.urlParams_, opts...)
  61728. res, err := c.doRequest("json")
  61729. if res != nil && res.StatusCode == http.StatusNotModified {
  61730. if res.Body != nil {
  61731. res.Body.Close()
  61732. }
  61733. return nil, &googleapi.Error{
  61734. Code: res.StatusCode,
  61735. Header: res.Header,
  61736. }
  61737. }
  61738. if err != nil {
  61739. return nil, err
  61740. }
  61741. defer googleapi.CloseBody(res)
  61742. if err := googleapi.CheckResponse(res); err != nil {
  61743. return nil, err
  61744. }
  61745. ret := &ImageList{
  61746. ServerResponse: googleapi.ServerResponse{
  61747. Header: res.Header,
  61748. HTTPStatusCode: res.StatusCode,
  61749. },
  61750. }
  61751. target := &ret
  61752. if err := gensupport.DecodeResponse(target, res); err != nil {
  61753. return nil, err
  61754. }
  61755. return ret, nil
  61756. // {
  61757. // "description": "Retrieves the list of custom images available to the specified project. Custom 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 8. 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.",
  61758. // "httpMethod": "GET",
  61759. // "id": "compute.images.list",
  61760. // "parameterOrder": [
  61761. // "project"
  61762. // ],
  61763. // "parameters": {
  61764. // "filter": {
  61765. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  61766. // "location": "query",
  61767. // "type": "string"
  61768. // },
  61769. // "maxResults": {
  61770. // "default": "500",
  61771. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  61772. // "format": "uint32",
  61773. // "location": "query",
  61774. // "minimum": "0",
  61775. // "type": "integer"
  61776. // },
  61777. // "orderBy": {
  61778. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  61779. // "location": "query",
  61780. // "type": "string"
  61781. // },
  61782. // "pageToken": {
  61783. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  61784. // "location": "query",
  61785. // "type": "string"
  61786. // },
  61787. // "project": {
  61788. // "description": "Project ID for this request.",
  61789. // "location": "path",
  61790. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61791. // "required": true,
  61792. // "type": "string"
  61793. // }
  61794. // },
  61795. // "path": "{project}/global/images",
  61796. // "response": {
  61797. // "$ref": "ImageList"
  61798. // },
  61799. // "scopes": [
  61800. // "https://www.googleapis.com/auth/cloud-platform",
  61801. // "https://www.googleapis.com/auth/compute",
  61802. // "https://www.googleapis.com/auth/compute.readonly"
  61803. // ]
  61804. // }
  61805. }
  61806. // Pages invokes f for each page of results.
  61807. // A non-nil error returned from f will halt the iteration.
  61808. // The provided context supersedes any context provided to the Context method.
  61809. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  61810. c.ctx_ = ctx
  61811. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61812. for {
  61813. x, err := c.Do()
  61814. if err != nil {
  61815. return err
  61816. }
  61817. if err := f(x); err != nil {
  61818. return err
  61819. }
  61820. if x.NextPageToken == "" {
  61821. return nil
  61822. }
  61823. c.PageToken(x.NextPageToken)
  61824. }
  61825. }
  61826. // method id "compute.images.setIamPolicy":
  61827. type ImagesSetIamPolicyCall struct {
  61828. s *Service
  61829. project string
  61830. resource string
  61831. globalsetpolicyrequest *GlobalSetPolicyRequest
  61832. urlParams_ gensupport.URLParams
  61833. ctx_ context.Context
  61834. header_ http.Header
  61835. }
  61836. // SetIamPolicy: Sets the access control policy on the specified
  61837. // resource. Replaces any existing policy.
  61838. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  61839. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61840. c.project = project
  61841. c.resource = resource
  61842. c.globalsetpolicyrequest = globalsetpolicyrequest
  61843. return c
  61844. }
  61845. // Fields allows partial responses to be retrieved. See
  61846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61847. // for more information.
  61848. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  61849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61850. return c
  61851. }
  61852. // Context sets the context to be used in this call's Do method. Any
  61853. // pending HTTP request will be aborted if the provided context is
  61854. // canceled.
  61855. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  61856. c.ctx_ = ctx
  61857. return c
  61858. }
  61859. // Header returns an http.Header that can be modified by the caller to
  61860. // add HTTP headers to the request.
  61861. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  61862. if c.header_ == nil {
  61863. c.header_ = make(http.Header)
  61864. }
  61865. return c.header_
  61866. }
  61867. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  61868. reqHeaders := make(http.Header)
  61869. for k, v := range c.header_ {
  61870. reqHeaders[k] = v
  61871. }
  61872. reqHeaders.Set("User-Agent", c.s.userAgent())
  61873. var body io.Reader = nil
  61874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  61875. if err != nil {
  61876. return nil, err
  61877. }
  61878. reqHeaders.Set("Content-Type", "application/json")
  61879. c.urlParams_.Set("alt", alt)
  61880. c.urlParams_.Set("prettyPrint", "false")
  61881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  61882. urls += "?" + c.urlParams_.Encode()
  61883. req, err := http.NewRequest("POST", urls, body)
  61884. if err != nil {
  61885. return nil, err
  61886. }
  61887. req.Header = reqHeaders
  61888. googleapi.Expand(req.URL, map[string]string{
  61889. "project": c.project,
  61890. "resource": c.resource,
  61891. })
  61892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61893. }
  61894. // Do executes the "compute.images.setIamPolicy" call.
  61895. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  61896. // code is an error. Response headers are in either
  61897. // *Policy.ServerResponse.Header or (if a response was returned at all)
  61898. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  61899. // check whether the returned error was because http.StatusNotModified
  61900. // was returned.
  61901. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  61902. gensupport.SetOptions(c.urlParams_, opts...)
  61903. res, err := c.doRequest("json")
  61904. if res != nil && res.StatusCode == http.StatusNotModified {
  61905. if res.Body != nil {
  61906. res.Body.Close()
  61907. }
  61908. return nil, &googleapi.Error{
  61909. Code: res.StatusCode,
  61910. Header: res.Header,
  61911. }
  61912. }
  61913. if err != nil {
  61914. return nil, err
  61915. }
  61916. defer googleapi.CloseBody(res)
  61917. if err := googleapi.CheckResponse(res); err != nil {
  61918. return nil, err
  61919. }
  61920. ret := &Policy{
  61921. ServerResponse: googleapi.ServerResponse{
  61922. Header: res.Header,
  61923. HTTPStatusCode: res.StatusCode,
  61924. },
  61925. }
  61926. target := &ret
  61927. if err := gensupport.DecodeResponse(target, res); err != nil {
  61928. return nil, err
  61929. }
  61930. return ret, nil
  61931. // {
  61932. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  61933. // "httpMethod": "POST",
  61934. // "id": "compute.images.setIamPolicy",
  61935. // "parameterOrder": [
  61936. // "project",
  61937. // "resource"
  61938. // ],
  61939. // "parameters": {
  61940. // "project": {
  61941. // "description": "Project ID for this request.",
  61942. // "location": "path",
  61943. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61944. // "required": true,
  61945. // "type": "string"
  61946. // },
  61947. // "resource": {
  61948. // "description": "Name or id of the resource for this request.",
  61949. // "location": "path",
  61950. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  61951. // "required": true,
  61952. // "type": "string"
  61953. // }
  61954. // },
  61955. // "path": "{project}/global/images/{resource}/setIamPolicy",
  61956. // "request": {
  61957. // "$ref": "GlobalSetPolicyRequest"
  61958. // },
  61959. // "response": {
  61960. // "$ref": "Policy"
  61961. // },
  61962. // "scopes": [
  61963. // "https://www.googleapis.com/auth/cloud-platform",
  61964. // "https://www.googleapis.com/auth/compute"
  61965. // ]
  61966. // }
  61967. }
  61968. // method id "compute.images.setLabels":
  61969. type ImagesSetLabelsCall struct {
  61970. s *Service
  61971. project string
  61972. resource string
  61973. globalsetlabelsrequest *GlobalSetLabelsRequest
  61974. urlParams_ gensupport.URLParams
  61975. ctx_ context.Context
  61976. header_ http.Header
  61977. }
  61978. // SetLabels: Sets the labels on an image. To learn more about labels,
  61979. // read the Labeling Resources documentation.
  61980. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  61981. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61982. c.project = project
  61983. c.resource = resource
  61984. c.globalsetlabelsrequest = globalsetlabelsrequest
  61985. return c
  61986. }
  61987. // Fields allows partial responses to be retrieved. See
  61988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61989. // for more information.
  61990. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  61991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61992. return c
  61993. }
  61994. // Context sets the context to be used in this call's Do method. Any
  61995. // pending HTTP request will be aborted if the provided context is
  61996. // canceled.
  61997. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  61998. c.ctx_ = ctx
  61999. return c
  62000. }
  62001. // Header returns an http.Header that can be modified by the caller to
  62002. // add HTTP headers to the request.
  62003. func (c *ImagesSetLabelsCall) Header() http.Header {
  62004. if c.header_ == nil {
  62005. c.header_ = make(http.Header)
  62006. }
  62007. return c.header_
  62008. }
  62009. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  62010. reqHeaders := make(http.Header)
  62011. for k, v := range c.header_ {
  62012. reqHeaders[k] = v
  62013. }
  62014. reqHeaders.Set("User-Agent", c.s.userAgent())
  62015. var body io.Reader = nil
  62016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  62017. if err != nil {
  62018. return nil, err
  62019. }
  62020. reqHeaders.Set("Content-Type", "application/json")
  62021. c.urlParams_.Set("alt", alt)
  62022. c.urlParams_.Set("prettyPrint", "false")
  62023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  62024. urls += "?" + c.urlParams_.Encode()
  62025. req, err := http.NewRequest("POST", urls, body)
  62026. if err != nil {
  62027. return nil, err
  62028. }
  62029. req.Header = reqHeaders
  62030. googleapi.Expand(req.URL, map[string]string{
  62031. "project": c.project,
  62032. "resource": c.resource,
  62033. })
  62034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62035. }
  62036. // Do executes the "compute.images.setLabels" call.
  62037. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62038. // status code is an error. Response headers are in either
  62039. // *Operation.ServerResponse.Header or (if a response was returned at
  62040. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62041. // to check whether the returned error was because
  62042. // http.StatusNotModified was returned.
  62043. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62044. gensupport.SetOptions(c.urlParams_, opts...)
  62045. res, err := c.doRequest("json")
  62046. if res != nil && res.StatusCode == http.StatusNotModified {
  62047. if res.Body != nil {
  62048. res.Body.Close()
  62049. }
  62050. return nil, &googleapi.Error{
  62051. Code: res.StatusCode,
  62052. Header: res.Header,
  62053. }
  62054. }
  62055. if err != nil {
  62056. return nil, err
  62057. }
  62058. defer googleapi.CloseBody(res)
  62059. if err := googleapi.CheckResponse(res); err != nil {
  62060. return nil, err
  62061. }
  62062. ret := &Operation{
  62063. ServerResponse: googleapi.ServerResponse{
  62064. Header: res.Header,
  62065. HTTPStatusCode: res.StatusCode,
  62066. },
  62067. }
  62068. target := &ret
  62069. if err := gensupport.DecodeResponse(target, res); err != nil {
  62070. return nil, err
  62071. }
  62072. return ret, nil
  62073. // {
  62074. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  62075. // "httpMethod": "POST",
  62076. // "id": "compute.images.setLabels",
  62077. // "parameterOrder": [
  62078. // "project",
  62079. // "resource"
  62080. // ],
  62081. // "parameters": {
  62082. // "project": {
  62083. // "description": "Project ID for this request.",
  62084. // "location": "path",
  62085. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62086. // "required": true,
  62087. // "type": "string"
  62088. // },
  62089. // "resource": {
  62090. // "description": "Name or id of the resource for this request.",
  62091. // "location": "path",
  62092. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62093. // "required": true,
  62094. // "type": "string"
  62095. // }
  62096. // },
  62097. // "path": "{project}/global/images/{resource}/setLabels",
  62098. // "request": {
  62099. // "$ref": "GlobalSetLabelsRequest"
  62100. // },
  62101. // "response": {
  62102. // "$ref": "Operation"
  62103. // },
  62104. // "scopes": [
  62105. // "https://www.googleapis.com/auth/cloud-platform",
  62106. // "https://www.googleapis.com/auth/compute"
  62107. // ]
  62108. // }
  62109. }
  62110. // method id "compute.images.testIamPermissions":
  62111. type ImagesTestIamPermissionsCall struct {
  62112. s *Service
  62113. project string
  62114. resource string
  62115. testpermissionsrequest *TestPermissionsRequest
  62116. urlParams_ gensupport.URLParams
  62117. ctx_ context.Context
  62118. header_ http.Header
  62119. }
  62120. // TestIamPermissions: Returns permissions that a caller has on the
  62121. // specified resource.
  62122. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  62123. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62124. c.project = project
  62125. c.resource = resource
  62126. c.testpermissionsrequest = testpermissionsrequest
  62127. return c
  62128. }
  62129. // Fields allows partial responses to be retrieved. See
  62130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62131. // for more information.
  62132. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  62133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62134. return c
  62135. }
  62136. // Context sets the context to be used in this call's Do method. Any
  62137. // pending HTTP request will be aborted if the provided context is
  62138. // canceled.
  62139. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  62140. c.ctx_ = ctx
  62141. return c
  62142. }
  62143. // Header returns an http.Header that can be modified by the caller to
  62144. // add HTTP headers to the request.
  62145. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  62146. if c.header_ == nil {
  62147. c.header_ = make(http.Header)
  62148. }
  62149. return c.header_
  62150. }
  62151. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  62152. reqHeaders := make(http.Header)
  62153. for k, v := range c.header_ {
  62154. reqHeaders[k] = v
  62155. }
  62156. reqHeaders.Set("User-Agent", c.s.userAgent())
  62157. var body io.Reader = nil
  62158. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  62159. if err != nil {
  62160. return nil, err
  62161. }
  62162. reqHeaders.Set("Content-Type", "application/json")
  62163. c.urlParams_.Set("alt", alt)
  62164. c.urlParams_.Set("prettyPrint", "false")
  62165. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  62166. urls += "?" + c.urlParams_.Encode()
  62167. req, err := http.NewRequest("POST", urls, body)
  62168. if err != nil {
  62169. return nil, err
  62170. }
  62171. req.Header = reqHeaders
  62172. googleapi.Expand(req.URL, map[string]string{
  62173. "project": c.project,
  62174. "resource": c.resource,
  62175. })
  62176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62177. }
  62178. // Do executes the "compute.images.testIamPermissions" call.
  62179. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  62180. // non-2xx status code is an error. Response headers are in either
  62181. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  62182. // returned at all) in error.(*googleapi.Error).Header. Use
  62183. // googleapi.IsNotModified to check whether the returned error was
  62184. // because http.StatusNotModified was returned.
  62185. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  62186. gensupport.SetOptions(c.urlParams_, opts...)
  62187. res, err := c.doRequest("json")
  62188. if res != nil && res.StatusCode == http.StatusNotModified {
  62189. if res.Body != nil {
  62190. res.Body.Close()
  62191. }
  62192. return nil, &googleapi.Error{
  62193. Code: res.StatusCode,
  62194. Header: res.Header,
  62195. }
  62196. }
  62197. if err != nil {
  62198. return nil, err
  62199. }
  62200. defer googleapi.CloseBody(res)
  62201. if err := googleapi.CheckResponse(res); err != nil {
  62202. return nil, err
  62203. }
  62204. ret := &TestPermissionsResponse{
  62205. ServerResponse: googleapi.ServerResponse{
  62206. Header: res.Header,
  62207. HTTPStatusCode: res.StatusCode,
  62208. },
  62209. }
  62210. target := &ret
  62211. if err := gensupport.DecodeResponse(target, res); err != nil {
  62212. return nil, err
  62213. }
  62214. return ret, nil
  62215. // {
  62216. // "description": "Returns permissions that a caller has on the specified resource.",
  62217. // "httpMethod": "POST",
  62218. // "id": "compute.images.testIamPermissions",
  62219. // "parameterOrder": [
  62220. // "project",
  62221. // "resource"
  62222. // ],
  62223. // "parameters": {
  62224. // "project": {
  62225. // "description": "Project ID for this request.",
  62226. // "location": "path",
  62227. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62228. // "required": true,
  62229. // "type": "string"
  62230. // },
  62231. // "resource": {
  62232. // "description": "Name or id of the resource for this request.",
  62233. // "location": "path",
  62234. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62235. // "required": true,
  62236. // "type": "string"
  62237. // }
  62238. // },
  62239. // "path": "{project}/global/images/{resource}/testIamPermissions",
  62240. // "request": {
  62241. // "$ref": "TestPermissionsRequest"
  62242. // },
  62243. // "response": {
  62244. // "$ref": "TestPermissionsResponse"
  62245. // },
  62246. // "scopes": [
  62247. // "https://www.googleapis.com/auth/cloud-platform",
  62248. // "https://www.googleapis.com/auth/compute",
  62249. // "https://www.googleapis.com/auth/compute.readonly"
  62250. // ]
  62251. // }
  62252. }
  62253. // method id "compute.instanceGroupManagers.abandonInstances":
  62254. type InstanceGroupManagersAbandonInstancesCall struct {
  62255. s *Service
  62256. project string
  62257. zone string
  62258. instanceGroupManager string
  62259. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  62260. urlParams_ gensupport.URLParams
  62261. ctx_ context.Context
  62262. header_ http.Header
  62263. }
  62264. // AbandonInstances: Flags the specified instances to be removed from
  62265. // the managed instance group. Abandoning an instance does not delete
  62266. // the instance, but it does remove the instance from any target pools
  62267. // that are applied by the managed instance group. This method reduces
  62268. // the targetSize of the managed instance group by the number of
  62269. // instances that you abandon. This operation is marked as DONE when the
  62270. // action is scheduled even if the instances have not yet been removed
  62271. // from the group. You must separately verify the status of the
  62272. // abandoning action with the listmanagedinstances method.
  62273. //
  62274. // If the group is part of a backend service that has enabled connection
  62275. // draining, it can take up to 60 seconds after the connection draining
  62276. // duration has elapsed before the VM instance is removed or
  62277. // deleted.
  62278. //
  62279. // You can specify a maximum of 1000 instances with this method per
  62280. // request.
  62281. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  62282. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62283. c.project = project
  62284. c.zone = zone
  62285. c.instanceGroupManager = instanceGroupManager
  62286. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  62287. return c
  62288. }
  62289. // RequestId sets the optional parameter "requestId": An optional
  62290. // request ID to identify requests. Specify a unique request ID so that
  62291. // if you must retry your request, the server will know to ignore the
  62292. // request if it has already been completed.
  62293. //
  62294. // For example, consider a situation where you make an initial request
  62295. // and the request times out. If you make the request again with the
  62296. // same request ID, the server can check if original operation with the
  62297. // same request ID was received, and if so, will ignore the second
  62298. // request. This prevents clients from accidentally creating duplicate
  62299. // commitments.
  62300. //
  62301. // The request ID must be a valid UUID with the exception that zero UUID
  62302. // is not supported (00000000-0000-0000-0000-000000000000).
  62303. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  62304. c.urlParams_.Set("requestId", requestId)
  62305. return c
  62306. }
  62307. // Fields allows partial responses to be retrieved. See
  62308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62309. // for more information.
  62310. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  62311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62312. return c
  62313. }
  62314. // Context sets the context to be used in this call's Do method. Any
  62315. // pending HTTP request will be aborted if the provided context is
  62316. // canceled.
  62317. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  62318. c.ctx_ = ctx
  62319. return c
  62320. }
  62321. // Header returns an http.Header that can be modified by the caller to
  62322. // add HTTP headers to the request.
  62323. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  62324. if c.header_ == nil {
  62325. c.header_ = make(http.Header)
  62326. }
  62327. return c.header_
  62328. }
  62329. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  62330. reqHeaders := make(http.Header)
  62331. for k, v := range c.header_ {
  62332. reqHeaders[k] = v
  62333. }
  62334. reqHeaders.Set("User-Agent", c.s.userAgent())
  62335. var body io.Reader = nil
  62336. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  62337. if err != nil {
  62338. return nil, err
  62339. }
  62340. reqHeaders.Set("Content-Type", "application/json")
  62341. c.urlParams_.Set("alt", alt)
  62342. c.urlParams_.Set("prettyPrint", "false")
  62343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  62344. urls += "?" + c.urlParams_.Encode()
  62345. req, err := http.NewRequest("POST", urls, body)
  62346. if err != nil {
  62347. return nil, err
  62348. }
  62349. req.Header = reqHeaders
  62350. googleapi.Expand(req.URL, map[string]string{
  62351. "project": c.project,
  62352. "zone": c.zone,
  62353. "instanceGroupManager": c.instanceGroupManager,
  62354. })
  62355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62356. }
  62357. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  62358. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62359. // status code is an error. Response headers are in either
  62360. // *Operation.ServerResponse.Header or (if a response was returned at
  62361. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62362. // to check whether the returned error was because
  62363. // http.StatusNotModified was returned.
  62364. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62365. gensupport.SetOptions(c.urlParams_, opts...)
  62366. res, err := c.doRequest("json")
  62367. if res != nil && res.StatusCode == http.StatusNotModified {
  62368. if res.Body != nil {
  62369. res.Body.Close()
  62370. }
  62371. return nil, &googleapi.Error{
  62372. Code: res.StatusCode,
  62373. Header: res.Header,
  62374. }
  62375. }
  62376. if err != nil {
  62377. return nil, err
  62378. }
  62379. defer googleapi.CloseBody(res)
  62380. if err := googleapi.CheckResponse(res); err != nil {
  62381. return nil, err
  62382. }
  62383. ret := &Operation{
  62384. ServerResponse: googleapi.ServerResponse{
  62385. Header: res.Header,
  62386. HTTPStatusCode: res.StatusCode,
  62387. },
  62388. }
  62389. target := &ret
  62390. if err := gensupport.DecodeResponse(target, res); err != nil {
  62391. return nil, err
  62392. }
  62393. return ret, nil
  62394. // {
  62395. // "description": "Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  62396. // "httpMethod": "POST",
  62397. // "id": "compute.instanceGroupManagers.abandonInstances",
  62398. // "parameterOrder": [
  62399. // "project",
  62400. // "zone",
  62401. // "instanceGroupManager"
  62402. // ],
  62403. // "parameters": {
  62404. // "instanceGroupManager": {
  62405. // "description": "The name of the managed instance group.",
  62406. // "location": "path",
  62407. // "required": true,
  62408. // "type": "string"
  62409. // },
  62410. // "project": {
  62411. // "description": "Project ID for this request.",
  62412. // "location": "path",
  62413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62414. // "required": true,
  62415. // "type": "string"
  62416. // },
  62417. // "requestId": {
  62418. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62419. // "location": "query",
  62420. // "type": "string"
  62421. // },
  62422. // "zone": {
  62423. // "description": "The name of the zone where the managed instance group is located.",
  62424. // "location": "path",
  62425. // "required": true,
  62426. // "type": "string"
  62427. // }
  62428. // },
  62429. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  62430. // "request": {
  62431. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  62432. // },
  62433. // "response": {
  62434. // "$ref": "Operation"
  62435. // },
  62436. // "scopes": [
  62437. // "https://www.googleapis.com/auth/cloud-platform",
  62438. // "https://www.googleapis.com/auth/compute"
  62439. // ]
  62440. // }
  62441. }
  62442. // method id "compute.instanceGroupManagers.aggregatedList":
  62443. type InstanceGroupManagersAggregatedListCall struct {
  62444. s *Service
  62445. project string
  62446. urlParams_ gensupport.URLParams
  62447. ifNoneMatch_ string
  62448. ctx_ context.Context
  62449. header_ http.Header
  62450. }
  62451. // AggregatedList: Retrieves the list of managed instance groups and
  62452. // groups them by zone.
  62453. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  62454. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62455. c.project = project
  62456. return c
  62457. }
  62458. // Filter sets the optional parameter "filter": A filter expression that
  62459. // filters resources listed in the response. The expression must specify
  62460. // the field name, a comparison operator, and the value that you want to
  62461. // use for filtering. The value must be a string, a number, or a
  62462. // boolean. The comparison operator must be either =, !=, >, or <.
  62463. //
  62464. // For example, if you are filtering Compute Engine instances, you can
  62465. // exclude instances named example-instance by specifying name !=
  62466. // example-instance.
  62467. //
  62468. // You can also filter nested fields. For example, you could specify
  62469. // scheduling.automaticRestart = false to include instances only if they
  62470. // are not scheduled for automatic restarts. You can use filtering on
  62471. // nested fields to filter based on resource labels.
  62472. //
  62473. // To filter on multiple expressions, provide each separate expression
  62474. // within parentheses. For example, (scheduling.automaticRestart = true)
  62475. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62476. // AND expression. However, you can include AND and OR expressions
  62477. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62478. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62479. // true).
  62480. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  62481. c.urlParams_.Set("filter", filter)
  62482. return c
  62483. }
  62484. // MaxResults sets the optional parameter "maxResults": The maximum
  62485. // number of results per page that should be returned. If the number of
  62486. // available results is larger than maxResults, Compute Engine returns a
  62487. // nextPageToken that can be used to get the next page of results in
  62488. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62489. // (Default: 500)
  62490. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  62491. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62492. return c
  62493. }
  62494. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62495. // a certain order. By default, results are returned in alphanumerical
  62496. // order based on the resource name.
  62497. //
  62498. // You can also sort results in descending order based on the creation
  62499. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62500. // based on the creationTimestamp field in reverse chronological order
  62501. // (newest result first). Use this to sort resources like operations so
  62502. // that the newest operation is returned first.
  62503. //
  62504. // Currently, only sorting by name or creationTimestamp desc is
  62505. // supported.
  62506. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  62507. c.urlParams_.Set("orderBy", orderBy)
  62508. return c
  62509. }
  62510. // PageToken sets the optional parameter "pageToken": Specifies a page
  62511. // token to use. Set pageToken to the nextPageToken returned by a
  62512. // previous list request to get the next page of results.
  62513. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  62514. c.urlParams_.Set("pageToken", pageToken)
  62515. return c
  62516. }
  62517. // Fields allows partial responses to be retrieved. See
  62518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62519. // for more information.
  62520. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  62521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62522. return c
  62523. }
  62524. // IfNoneMatch sets the optional parameter which makes the operation
  62525. // fail if the object's ETag matches the given value. This is useful for
  62526. // getting updates only after the object has changed since the last
  62527. // request. Use googleapi.IsNotModified to check whether the response
  62528. // error from Do is the result of In-None-Match.
  62529. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  62530. c.ifNoneMatch_ = entityTag
  62531. return c
  62532. }
  62533. // Context sets the context to be used in this call's Do method. Any
  62534. // pending HTTP request will be aborted if the provided context is
  62535. // canceled.
  62536. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  62537. c.ctx_ = ctx
  62538. return c
  62539. }
  62540. // Header returns an http.Header that can be modified by the caller to
  62541. // add HTTP headers to the request.
  62542. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  62543. if c.header_ == nil {
  62544. c.header_ = make(http.Header)
  62545. }
  62546. return c.header_
  62547. }
  62548. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  62549. reqHeaders := make(http.Header)
  62550. for k, v := range c.header_ {
  62551. reqHeaders[k] = v
  62552. }
  62553. reqHeaders.Set("User-Agent", c.s.userAgent())
  62554. if c.ifNoneMatch_ != "" {
  62555. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62556. }
  62557. var body io.Reader = nil
  62558. c.urlParams_.Set("alt", alt)
  62559. c.urlParams_.Set("prettyPrint", "false")
  62560. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  62561. urls += "?" + c.urlParams_.Encode()
  62562. req, err := http.NewRequest("GET", urls, body)
  62563. if err != nil {
  62564. return nil, err
  62565. }
  62566. req.Header = reqHeaders
  62567. googleapi.Expand(req.URL, map[string]string{
  62568. "project": c.project,
  62569. })
  62570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62571. }
  62572. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  62573. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  62574. // non-nil. Any non-2xx status code is an error. Response headers are in
  62575. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  62576. // (if a response was returned at all) in
  62577. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  62578. // whether the returned error was because http.StatusNotModified was
  62579. // returned.
  62580. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  62581. gensupport.SetOptions(c.urlParams_, opts...)
  62582. res, err := c.doRequest("json")
  62583. if res != nil && res.StatusCode == http.StatusNotModified {
  62584. if res.Body != nil {
  62585. res.Body.Close()
  62586. }
  62587. return nil, &googleapi.Error{
  62588. Code: res.StatusCode,
  62589. Header: res.Header,
  62590. }
  62591. }
  62592. if err != nil {
  62593. return nil, err
  62594. }
  62595. defer googleapi.CloseBody(res)
  62596. if err := googleapi.CheckResponse(res); err != nil {
  62597. return nil, err
  62598. }
  62599. ret := &InstanceGroupManagerAggregatedList{
  62600. ServerResponse: googleapi.ServerResponse{
  62601. Header: res.Header,
  62602. HTTPStatusCode: res.StatusCode,
  62603. },
  62604. }
  62605. target := &ret
  62606. if err := gensupport.DecodeResponse(target, res); err != nil {
  62607. return nil, err
  62608. }
  62609. return ret, nil
  62610. // {
  62611. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  62612. // "httpMethod": "GET",
  62613. // "id": "compute.instanceGroupManagers.aggregatedList",
  62614. // "parameterOrder": [
  62615. // "project"
  62616. // ],
  62617. // "parameters": {
  62618. // "filter": {
  62619. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62620. // "location": "query",
  62621. // "type": "string"
  62622. // },
  62623. // "maxResults": {
  62624. // "default": "500",
  62625. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62626. // "format": "uint32",
  62627. // "location": "query",
  62628. // "minimum": "0",
  62629. // "type": "integer"
  62630. // },
  62631. // "orderBy": {
  62632. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62633. // "location": "query",
  62634. // "type": "string"
  62635. // },
  62636. // "pageToken": {
  62637. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62638. // "location": "query",
  62639. // "type": "string"
  62640. // },
  62641. // "project": {
  62642. // "description": "Project ID for this request.",
  62643. // "location": "path",
  62644. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62645. // "required": true,
  62646. // "type": "string"
  62647. // }
  62648. // },
  62649. // "path": "{project}/aggregated/instanceGroupManagers",
  62650. // "response": {
  62651. // "$ref": "InstanceGroupManagerAggregatedList"
  62652. // },
  62653. // "scopes": [
  62654. // "https://www.googleapis.com/auth/cloud-platform",
  62655. // "https://www.googleapis.com/auth/compute",
  62656. // "https://www.googleapis.com/auth/compute.readonly"
  62657. // ]
  62658. // }
  62659. }
  62660. // Pages invokes f for each page of results.
  62661. // A non-nil error returned from f will halt the iteration.
  62662. // The provided context supersedes any context provided to the Context method.
  62663. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  62664. c.ctx_ = ctx
  62665. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62666. for {
  62667. x, err := c.Do()
  62668. if err != nil {
  62669. return err
  62670. }
  62671. if err := f(x); err != nil {
  62672. return err
  62673. }
  62674. if x.NextPageToken == "" {
  62675. return nil
  62676. }
  62677. c.PageToken(x.NextPageToken)
  62678. }
  62679. }
  62680. // method id "compute.instanceGroupManagers.applyUpdatesToInstances":
  62681. type InstanceGroupManagersApplyUpdatesToInstancesCall struct {
  62682. s *Service
  62683. project string
  62684. zone string
  62685. instanceGroupManager string
  62686. instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest
  62687. urlParams_ gensupport.URLParams
  62688. ctx_ context.Context
  62689. header_ http.Header
  62690. }
  62691. // ApplyUpdatesToInstances: Apply changes to selected instances on the
  62692. // managed instance group. This method can be used to apply new
  62693. // overrides and/or new versions.
  62694. func (r *InstanceGroupManagersService) ApplyUpdatesToInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersapplyupdatesrequest *InstanceGroupManagersApplyUpdatesRequest) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  62695. c := &InstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62696. c.project = project
  62697. c.zone = zone
  62698. c.instanceGroupManager = instanceGroupManager
  62699. c.instancegroupmanagersapplyupdatesrequest = instancegroupmanagersapplyupdatesrequest
  62700. return c
  62701. }
  62702. // Fields allows partial responses to be retrieved. See
  62703. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62704. // for more information.
  62705. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  62706. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62707. return c
  62708. }
  62709. // Context sets the context to be used in this call's Do method. Any
  62710. // pending HTTP request will be aborted if the provided context is
  62711. // canceled.
  62712. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *InstanceGroupManagersApplyUpdatesToInstancesCall {
  62713. c.ctx_ = ctx
  62714. return c
  62715. }
  62716. // Header returns an http.Header that can be modified by the caller to
  62717. // add HTTP headers to the request.
  62718. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
  62719. if c.header_ == nil {
  62720. c.header_ = make(http.Header)
  62721. }
  62722. return c.header_
  62723. }
  62724. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
  62725. reqHeaders := make(http.Header)
  62726. for k, v := range c.header_ {
  62727. reqHeaders[k] = v
  62728. }
  62729. reqHeaders.Set("User-Agent", c.s.userAgent())
  62730. var body io.Reader = nil
  62731. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersapplyupdatesrequest)
  62732. if err != nil {
  62733. return nil, err
  62734. }
  62735. reqHeaders.Set("Content-Type", "application/json")
  62736. c.urlParams_.Set("alt", alt)
  62737. c.urlParams_.Set("prettyPrint", "false")
  62738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
  62739. urls += "?" + c.urlParams_.Encode()
  62740. req, err := http.NewRequest("POST", urls, body)
  62741. if err != nil {
  62742. return nil, err
  62743. }
  62744. req.Header = reqHeaders
  62745. googleapi.Expand(req.URL, map[string]string{
  62746. "project": c.project,
  62747. "zone": c.zone,
  62748. "instanceGroupManager": c.instanceGroupManager,
  62749. })
  62750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62751. }
  62752. // Do executes the "compute.instanceGroupManagers.applyUpdatesToInstances" call.
  62753. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62754. // status code is an error. Response headers are in either
  62755. // *Operation.ServerResponse.Header or (if a response was returned at
  62756. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62757. // to check whether the returned error was because
  62758. // http.StatusNotModified was returned.
  62759. func (c *InstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62760. gensupport.SetOptions(c.urlParams_, opts...)
  62761. res, err := c.doRequest("json")
  62762. if res != nil && res.StatusCode == http.StatusNotModified {
  62763. if res.Body != nil {
  62764. res.Body.Close()
  62765. }
  62766. return nil, &googleapi.Error{
  62767. Code: res.StatusCode,
  62768. Header: res.Header,
  62769. }
  62770. }
  62771. if err != nil {
  62772. return nil, err
  62773. }
  62774. defer googleapi.CloseBody(res)
  62775. if err := googleapi.CheckResponse(res); err != nil {
  62776. return nil, err
  62777. }
  62778. ret := &Operation{
  62779. ServerResponse: googleapi.ServerResponse{
  62780. Header: res.Header,
  62781. HTTPStatusCode: res.StatusCode,
  62782. },
  62783. }
  62784. target := &ret
  62785. if err := gensupport.DecodeResponse(target, res); err != nil {
  62786. return nil, err
  62787. }
  62788. return ret, nil
  62789. // {
  62790. // "description": "Apply changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.",
  62791. // "httpMethod": "POST",
  62792. // "id": "compute.instanceGroupManagers.applyUpdatesToInstances",
  62793. // "parameterOrder": [
  62794. // "project",
  62795. // "zone",
  62796. // "instanceGroupManager"
  62797. // ],
  62798. // "parameters": {
  62799. // "instanceGroupManager": {
  62800. // "description": "The name of the managed instance group, should conform to RFC1035.",
  62801. // "location": "path",
  62802. // "required": true,
  62803. // "type": "string"
  62804. // },
  62805. // "project": {
  62806. // "description": "Project ID for this request.",
  62807. // "location": "path",
  62808. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62809. // "required": true,
  62810. // "type": "string"
  62811. // },
  62812. // "zone": {
  62813. // "description": "The name of the zone where the managed instance group is located. Should conform to RFC1035.",
  62814. // "location": "path",
  62815. // "required": true,
  62816. // "type": "string"
  62817. // }
  62818. // },
  62819. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
  62820. // "request": {
  62821. // "$ref": "InstanceGroupManagersApplyUpdatesRequest"
  62822. // },
  62823. // "response": {
  62824. // "$ref": "Operation"
  62825. // },
  62826. // "scopes": [
  62827. // "https://www.googleapis.com/auth/cloud-platform",
  62828. // "https://www.googleapis.com/auth/compute"
  62829. // ]
  62830. // }
  62831. }
  62832. // method id "compute.instanceGroupManagers.createInstances":
  62833. type InstanceGroupManagersCreateInstancesCall struct {
  62834. s *Service
  62835. project string
  62836. zone string
  62837. instanceGroupManager string
  62838. instancegroupmanagerscreateinstancesrequest *InstanceGroupManagersCreateInstancesRequest
  62839. urlParams_ gensupport.URLParams
  62840. ctx_ context.Context
  62841. header_ http.Header
  62842. }
  62843. // CreateInstances: Creates instances with per-instance configs in this
  62844. // managed instance group. Instances are created using the current
  62845. // instance template. The create instances operation is marked DONE if
  62846. // the createInstances request is successful. The underlying actions
  62847. // take additional time. You must separately verify the status of the
  62848. // creating or actions with the listmanagedinstances method.
  62849. func (r *InstanceGroupManagersService) CreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagerscreateinstancesrequest *InstanceGroupManagersCreateInstancesRequest) *InstanceGroupManagersCreateInstancesCall {
  62850. c := &InstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62851. c.project = project
  62852. c.zone = zone
  62853. c.instanceGroupManager = instanceGroupManager
  62854. c.instancegroupmanagerscreateinstancesrequest = instancegroupmanagerscreateinstancesrequest
  62855. return c
  62856. }
  62857. // RequestId sets the optional parameter "requestId": An optional
  62858. // request ID to identify requests. Specify a unique request ID so that
  62859. // if you must retry your request, the server will know to ignore the
  62860. // request if it has already been completed.
  62861. //
  62862. // For example, consider a situation where you make an initial request
  62863. // and the request times out. If you make the request again with the
  62864. // same request ID, the server can check if original operation with the
  62865. // same request ID was received, and if so, will ignore the second
  62866. // request.
  62867. //
  62868. // The request ID must be a valid UUID with the exception that zero UUID
  62869. // is not supported (00000000-0000-0000-0000-000000000000).
  62870. func (c *InstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersCreateInstancesCall {
  62871. c.urlParams_.Set("requestId", requestId)
  62872. return c
  62873. }
  62874. // Fields allows partial responses to be retrieved. See
  62875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62876. // for more information.
  62877. func (c *InstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersCreateInstancesCall {
  62878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62879. return c
  62880. }
  62881. // Context sets the context to be used in this call's Do method. Any
  62882. // pending HTTP request will be aborted if the provided context is
  62883. // canceled.
  62884. func (c *InstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersCreateInstancesCall {
  62885. c.ctx_ = ctx
  62886. return c
  62887. }
  62888. // Header returns an http.Header that can be modified by the caller to
  62889. // add HTTP headers to the request.
  62890. func (c *InstanceGroupManagersCreateInstancesCall) Header() http.Header {
  62891. if c.header_ == nil {
  62892. c.header_ = make(http.Header)
  62893. }
  62894. return c.header_
  62895. }
  62896. func (c *InstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  62897. reqHeaders := make(http.Header)
  62898. for k, v := range c.header_ {
  62899. reqHeaders[k] = v
  62900. }
  62901. reqHeaders.Set("User-Agent", c.s.userAgent())
  62902. var body io.Reader = nil
  62903. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerscreateinstancesrequest)
  62904. if err != nil {
  62905. return nil, err
  62906. }
  62907. reqHeaders.Set("Content-Type", "application/json")
  62908. c.urlParams_.Set("alt", alt)
  62909. c.urlParams_.Set("prettyPrint", "false")
  62910. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances")
  62911. urls += "?" + c.urlParams_.Encode()
  62912. req, err := http.NewRequest("POST", urls, body)
  62913. if err != nil {
  62914. return nil, err
  62915. }
  62916. req.Header = reqHeaders
  62917. googleapi.Expand(req.URL, map[string]string{
  62918. "project": c.project,
  62919. "zone": c.zone,
  62920. "instanceGroupManager": c.instanceGroupManager,
  62921. })
  62922. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62923. }
  62924. // Do executes the "compute.instanceGroupManagers.createInstances" call.
  62925. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62926. // status code is an error. Response headers are in either
  62927. // *Operation.ServerResponse.Header or (if a response was returned at
  62928. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62929. // to check whether the returned error was because
  62930. // http.StatusNotModified was returned.
  62931. func (c *InstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62932. gensupport.SetOptions(c.urlParams_, opts...)
  62933. res, err := c.doRequest("json")
  62934. if res != nil && res.StatusCode == http.StatusNotModified {
  62935. if res.Body != nil {
  62936. res.Body.Close()
  62937. }
  62938. return nil, &googleapi.Error{
  62939. Code: res.StatusCode,
  62940. Header: res.Header,
  62941. }
  62942. }
  62943. if err != nil {
  62944. return nil, err
  62945. }
  62946. defer googleapi.CloseBody(res)
  62947. if err := googleapi.CheckResponse(res); err != nil {
  62948. return nil, err
  62949. }
  62950. ret := &Operation{
  62951. ServerResponse: googleapi.ServerResponse{
  62952. Header: res.Header,
  62953. HTTPStatusCode: res.StatusCode,
  62954. },
  62955. }
  62956. target := &ret
  62957. if err := gensupport.DecodeResponse(target, res); err != nil {
  62958. return nil, err
  62959. }
  62960. return ret, nil
  62961. // {
  62962. // "description": "Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.",
  62963. // "httpMethod": "POST",
  62964. // "id": "compute.instanceGroupManagers.createInstances",
  62965. // "parameterOrder": [
  62966. // "project",
  62967. // "zone",
  62968. // "instanceGroupManager"
  62969. // ],
  62970. // "parameters": {
  62971. // "instanceGroupManager": {
  62972. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  62973. // "location": "path",
  62974. // "required": true,
  62975. // "type": "string"
  62976. // },
  62977. // "project": {
  62978. // "description": "Project ID for this request.",
  62979. // "location": "path",
  62980. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62981. // "required": true,
  62982. // "type": "string"
  62983. // },
  62984. // "requestId": {
  62985. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62986. // "location": "query",
  62987. // "type": "string"
  62988. // },
  62989. // "zone": {
  62990. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  62991. // "location": "path",
  62992. // "required": true,
  62993. // "type": "string"
  62994. // }
  62995. // },
  62996. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/createInstances",
  62997. // "request": {
  62998. // "$ref": "InstanceGroupManagersCreateInstancesRequest"
  62999. // },
  63000. // "response": {
  63001. // "$ref": "Operation"
  63002. // },
  63003. // "scopes": [
  63004. // "https://www.googleapis.com/auth/cloud-platform",
  63005. // "https://www.googleapis.com/auth/compute"
  63006. // ]
  63007. // }
  63008. }
  63009. // method id "compute.instanceGroupManagers.delete":
  63010. type InstanceGroupManagersDeleteCall struct {
  63011. s *Service
  63012. project string
  63013. zone string
  63014. instanceGroupManager string
  63015. urlParams_ gensupport.URLParams
  63016. ctx_ context.Context
  63017. header_ http.Header
  63018. }
  63019. // Delete: Deletes the specified managed instance group and all of the
  63020. // instances in that group. Note that the instance group must not belong
  63021. // to a backend service. Read Deleting an instance group for more
  63022. // information.
  63023. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  63024. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63025. c.project = project
  63026. c.zone = zone
  63027. c.instanceGroupManager = instanceGroupManager
  63028. return c
  63029. }
  63030. // RequestId sets the optional parameter "requestId": An optional
  63031. // request ID to identify requests. Specify a unique request ID so that
  63032. // if you must retry your request, the server will know to ignore the
  63033. // request if it has already been completed.
  63034. //
  63035. // For example, consider a situation where you make an initial request
  63036. // and the request times out. If you make the request again with the
  63037. // same request ID, the server can check if original operation with the
  63038. // same request ID was received, and if so, will ignore the second
  63039. // request. This prevents clients from accidentally creating duplicate
  63040. // commitments.
  63041. //
  63042. // The request ID must be a valid UUID with the exception that zero UUID
  63043. // is not supported (00000000-0000-0000-0000-000000000000).
  63044. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  63045. c.urlParams_.Set("requestId", requestId)
  63046. return c
  63047. }
  63048. // Fields allows partial responses to be retrieved. See
  63049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63050. // for more information.
  63051. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  63052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63053. return c
  63054. }
  63055. // Context sets the context to be used in this call's Do method. Any
  63056. // pending HTTP request will be aborted if the provided context is
  63057. // canceled.
  63058. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  63059. c.ctx_ = ctx
  63060. return c
  63061. }
  63062. // Header returns an http.Header that can be modified by the caller to
  63063. // add HTTP headers to the request.
  63064. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  63065. if c.header_ == nil {
  63066. c.header_ = make(http.Header)
  63067. }
  63068. return c.header_
  63069. }
  63070. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  63071. reqHeaders := make(http.Header)
  63072. for k, v := range c.header_ {
  63073. reqHeaders[k] = v
  63074. }
  63075. reqHeaders.Set("User-Agent", c.s.userAgent())
  63076. var body io.Reader = nil
  63077. c.urlParams_.Set("alt", alt)
  63078. c.urlParams_.Set("prettyPrint", "false")
  63079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  63080. urls += "?" + c.urlParams_.Encode()
  63081. req, err := http.NewRequest("DELETE", urls, body)
  63082. if err != nil {
  63083. return nil, err
  63084. }
  63085. req.Header = reqHeaders
  63086. googleapi.Expand(req.URL, map[string]string{
  63087. "project": c.project,
  63088. "zone": c.zone,
  63089. "instanceGroupManager": c.instanceGroupManager,
  63090. })
  63091. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63092. }
  63093. // Do executes the "compute.instanceGroupManagers.delete" call.
  63094. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63095. // status code is an error. Response headers are in either
  63096. // *Operation.ServerResponse.Header or (if a response was returned at
  63097. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63098. // to check whether the returned error was because
  63099. // http.StatusNotModified was returned.
  63100. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63101. gensupport.SetOptions(c.urlParams_, opts...)
  63102. res, err := c.doRequest("json")
  63103. if res != nil && res.StatusCode == http.StatusNotModified {
  63104. if res.Body != nil {
  63105. res.Body.Close()
  63106. }
  63107. return nil, &googleapi.Error{
  63108. Code: res.StatusCode,
  63109. Header: res.Header,
  63110. }
  63111. }
  63112. if err != nil {
  63113. return nil, err
  63114. }
  63115. defer googleapi.CloseBody(res)
  63116. if err := googleapi.CheckResponse(res); err != nil {
  63117. return nil, err
  63118. }
  63119. ret := &Operation{
  63120. ServerResponse: googleapi.ServerResponse{
  63121. Header: res.Header,
  63122. HTTPStatusCode: res.StatusCode,
  63123. },
  63124. }
  63125. target := &ret
  63126. if err := gensupport.DecodeResponse(target, res); err != nil {
  63127. return nil, err
  63128. }
  63129. return ret, nil
  63130. // {
  63131. // "description": "Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.",
  63132. // "httpMethod": "DELETE",
  63133. // "id": "compute.instanceGroupManagers.delete",
  63134. // "parameterOrder": [
  63135. // "project",
  63136. // "zone",
  63137. // "instanceGroupManager"
  63138. // ],
  63139. // "parameters": {
  63140. // "instanceGroupManager": {
  63141. // "description": "The name of the managed instance group to delete.",
  63142. // "location": "path",
  63143. // "required": true,
  63144. // "type": "string"
  63145. // },
  63146. // "project": {
  63147. // "description": "Project ID for this request.",
  63148. // "location": "path",
  63149. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63150. // "required": true,
  63151. // "type": "string"
  63152. // },
  63153. // "requestId": {
  63154. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63155. // "location": "query",
  63156. // "type": "string"
  63157. // },
  63158. // "zone": {
  63159. // "description": "The name of the zone where the managed instance group is located.",
  63160. // "location": "path",
  63161. // "required": true,
  63162. // "type": "string"
  63163. // }
  63164. // },
  63165. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  63166. // "response": {
  63167. // "$ref": "Operation"
  63168. // },
  63169. // "scopes": [
  63170. // "https://www.googleapis.com/auth/cloud-platform",
  63171. // "https://www.googleapis.com/auth/compute"
  63172. // ]
  63173. // }
  63174. }
  63175. // method id "compute.instanceGroupManagers.deleteInstances":
  63176. type InstanceGroupManagersDeleteInstancesCall struct {
  63177. s *Service
  63178. project string
  63179. zone string
  63180. instanceGroupManager string
  63181. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  63182. urlParams_ gensupport.URLParams
  63183. ctx_ context.Context
  63184. header_ http.Header
  63185. }
  63186. // DeleteInstances: Flags the specified instances in the managed
  63187. // instance group for immediate deletion. The instances are also removed
  63188. // from any target pools of which they were a member. This method
  63189. // reduces the targetSize of the managed instance group by the number of
  63190. // instances that you delete. This operation is marked as DONE when the
  63191. // action is scheduled even if the instances are still being deleted.
  63192. // You must separately verify the status of the deleting action with the
  63193. // listmanagedinstances method.
  63194. //
  63195. // If the group is part of a backend service that has enabled connection
  63196. // draining, it can take up to 60 seconds after the connection draining
  63197. // duration has elapsed before the VM instance is removed or
  63198. // deleted.
  63199. //
  63200. // You can specify a maximum of 1000 instances with this method per
  63201. // request.
  63202. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  63203. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63204. c.project = project
  63205. c.zone = zone
  63206. c.instanceGroupManager = instanceGroupManager
  63207. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  63208. return c
  63209. }
  63210. // RequestId sets the optional parameter "requestId": An optional
  63211. // request ID to identify requests. Specify a unique request ID so that
  63212. // if you must retry your request, the server will know to ignore the
  63213. // request if it has already been completed.
  63214. //
  63215. // For example, consider a situation where you make an initial request
  63216. // and the request times out. If you make the request again with the
  63217. // same request ID, the server can check if original operation with the
  63218. // same request ID was received, and if so, will ignore the second
  63219. // request. This prevents clients from accidentally creating duplicate
  63220. // commitments.
  63221. //
  63222. // The request ID must be a valid UUID with the exception that zero UUID
  63223. // is not supported (00000000-0000-0000-0000-000000000000).
  63224. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  63225. c.urlParams_.Set("requestId", requestId)
  63226. return c
  63227. }
  63228. // Fields allows partial responses to be retrieved. See
  63229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63230. // for more information.
  63231. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  63232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63233. return c
  63234. }
  63235. // Context sets the context to be used in this call's Do method. Any
  63236. // pending HTTP request will be aborted if the provided context is
  63237. // canceled.
  63238. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  63239. c.ctx_ = ctx
  63240. return c
  63241. }
  63242. // Header returns an http.Header that can be modified by the caller to
  63243. // add HTTP headers to the request.
  63244. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  63245. if c.header_ == nil {
  63246. c.header_ = make(http.Header)
  63247. }
  63248. return c.header_
  63249. }
  63250. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  63251. reqHeaders := make(http.Header)
  63252. for k, v := range c.header_ {
  63253. reqHeaders[k] = v
  63254. }
  63255. reqHeaders.Set("User-Agent", c.s.userAgent())
  63256. var body io.Reader = nil
  63257. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  63258. if err != nil {
  63259. return nil, err
  63260. }
  63261. reqHeaders.Set("Content-Type", "application/json")
  63262. c.urlParams_.Set("alt", alt)
  63263. c.urlParams_.Set("prettyPrint", "false")
  63264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  63265. urls += "?" + c.urlParams_.Encode()
  63266. req, err := http.NewRequest("POST", urls, body)
  63267. if err != nil {
  63268. return nil, err
  63269. }
  63270. req.Header = reqHeaders
  63271. googleapi.Expand(req.URL, map[string]string{
  63272. "project": c.project,
  63273. "zone": c.zone,
  63274. "instanceGroupManager": c.instanceGroupManager,
  63275. })
  63276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63277. }
  63278. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  63279. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63280. // status code is an error. Response headers are in either
  63281. // *Operation.ServerResponse.Header or (if a response was returned at
  63282. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63283. // to check whether the returned error was because
  63284. // http.StatusNotModified was returned.
  63285. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63286. gensupport.SetOptions(c.urlParams_, opts...)
  63287. res, err := c.doRequest("json")
  63288. if res != nil && res.StatusCode == http.StatusNotModified {
  63289. if res.Body != nil {
  63290. res.Body.Close()
  63291. }
  63292. return nil, &googleapi.Error{
  63293. Code: res.StatusCode,
  63294. Header: res.Header,
  63295. }
  63296. }
  63297. if err != nil {
  63298. return nil, err
  63299. }
  63300. defer googleapi.CloseBody(res)
  63301. if err := googleapi.CheckResponse(res); err != nil {
  63302. return nil, err
  63303. }
  63304. ret := &Operation{
  63305. ServerResponse: googleapi.ServerResponse{
  63306. Header: res.Header,
  63307. HTTPStatusCode: res.StatusCode,
  63308. },
  63309. }
  63310. target := &ret
  63311. if err := gensupport.DecodeResponse(target, res); err != nil {
  63312. return nil, err
  63313. }
  63314. return ret, nil
  63315. // {
  63316. // "description": "Flags the specified instances in the managed instance group for immediate deletion. 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.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  63317. // "httpMethod": "POST",
  63318. // "id": "compute.instanceGroupManagers.deleteInstances",
  63319. // "parameterOrder": [
  63320. // "project",
  63321. // "zone",
  63322. // "instanceGroupManager"
  63323. // ],
  63324. // "parameters": {
  63325. // "instanceGroupManager": {
  63326. // "description": "The name of the managed instance group.",
  63327. // "location": "path",
  63328. // "required": true,
  63329. // "type": "string"
  63330. // },
  63331. // "project": {
  63332. // "description": "Project ID for this request.",
  63333. // "location": "path",
  63334. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63335. // "required": true,
  63336. // "type": "string"
  63337. // },
  63338. // "requestId": {
  63339. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63340. // "location": "query",
  63341. // "type": "string"
  63342. // },
  63343. // "zone": {
  63344. // "description": "The name of the zone where the managed instance group is located.",
  63345. // "location": "path",
  63346. // "required": true,
  63347. // "type": "string"
  63348. // }
  63349. // },
  63350. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  63351. // "request": {
  63352. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  63353. // },
  63354. // "response": {
  63355. // "$ref": "Operation"
  63356. // },
  63357. // "scopes": [
  63358. // "https://www.googleapis.com/auth/cloud-platform",
  63359. // "https://www.googleapis.com/auth/compute"
  63360. // ]
  63361. // }
  63362. }
  63363. // method id "compute.instanceGroupManagers.deletePerInstanceConfigs":
  63364. type InstanceGroupManagersDeletePerInstanceConfigsCall struct {
  63365. s *Service
  63366. project string
  63367. zone string
  63368. instanceGroupManager string
  63369. instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq
  63370. urlParams_ gensupport.URLParams
  63371. ctx_ context.Context
  63372. header_ http.Header
  63373. }
  63374. // DeletePerInstanceConfigs: Deletes selected per-instance configs for
  63375. // the managed instance group.
  63376. func (r *InstanceGroupManagersService) DeletePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteperinstanceconfigsreq *InstanceGroupManagersDeletePerInstanceConfigsReq) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  63377. c := &InstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63378. c.project = project
  63379. c.zone = zone
  63380. c.instanceGroupManager = instanceGroupManager
  63381. c.instancegroupmanagersdeleteperinstanceconfigsreq = instancegroupmanagersdeleteperinstanceconfigsreq
  63382. return c
  63383. }
  63384. // Fields allows partial responses to be retrieved. See
  63385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63386. // for more information.
  63387. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  63388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63389. return c
  63390. }
  63391. // Context sets the context to be used in this call's Do method. Any
  63392. // pending HTTP request will be aborted if the provided context is
  63393. // canceled.
  63394. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersDeletePerInstanceConfigsCall {
  63395. c.ctx_ = ctx
  63396. return c
  63397. }
  63398. // Header returns an http.Header that can be modified by the caller to
  63399. // add HTTP headers to the request.
  63400. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
  63401. if c.header_ == nil {
  63402. c.header_ = make(http.Header)
  63403. }
  63404. return c.header_
  63405. }
  63406. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  63407. reqHeaders := make(http.Header)
  63408. for k, v := range c.header_ {
  63409. reqHeaders[k] = v
  63410. }
  63411. reqHeaders.Set("User-Agent", c.s.userAgent())
  63412. var body io.Reader = nil
  63413. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteperinstanceconfigsreq)
  63414. if err != nil {
  63415. return nil, err
  63416. }
  63417. reqHeaders.Set("Content-Type", "application/json")
  63418. c.urlParams_.Set("alt", alt)
  63419. c.urlParams_.Set("prettyPrint", "false")
  63420. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
  63421. urls += "?" + c.urlParams_.Encode()
  63422. req, err := http.NewRequest("POST", urls, body)
  63423. if err != nil {
  63424. return nil, err
  63425. }
  63426. req.Header = reqHeaders
  63427. googleapi.Expand(req.URL, map[string]string{
  63428. "project": c.project,
  63429. "zone": c.zone,
  63430. "instanceGroupManager": c.instanceGroupManager,
  63431. })
  63432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63433. }
  63434. // Do executes the "compute.instanceGroupManagers.deletePerInstanceConfigs" call.
  63435. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63436. // status code is an error. Response headers are in either
  63437. // *Operation.ServerResponse.Header or (if a response was returned at
  63438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63439. // to check whether the returned error was because
  63440. // http.StatusNotModified was returned.
  63441. func (c *InstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63442. gensupport.SetOptions(c.urlParams_, opts...)
  63443. res, err := c.doRequest("json")
  63444. if res != nil && res.StatusCode == http.StatusNotModified {
  63445. if res.Body != nil {
  63446. res.Body.Close()
  63447. }
  63448. return nil, &googleapi.Error{
  63449. Code: res.StatusCode,
  63450. Header: res.Header,
  63451. }
  63452. }
  63453. if err != nil {
  63454. return nil, err
  63455. }
  63456. defer googleapi.CloseBody(res)
  63457. if err := googleapi.CheckResponse(res); err != nil {
  63458. return nil, err
  63459. }
  63460. ret := &Operation{
  63461. ServerResponse: googleapi.ServerResponse{
  63462. Header: res.Header,
  63463. HTTPStatusCode: res.StatusCode,
  63464. },
  63465. }
  63466. target := &ret
  63467. if err := gensupport.DecodeResponse(target, res); err != nil {
  63468. return nil, err
  63469. }
  63470. return ret, nil
  63471. // {
  63472. // "description": "Deletes selected per-instance configs for the managed instance group.",
  63473. // "httpMethod": "POST",
  63474. // "id": "compute.instanceGroupManagers.deletePerInstanceConfigs",
  63475. // "parameterOrder": [
  63476. // "project",
  63477. // "zone",
  63478. // "instanceGroupManager"
  63479. // ],
  63480. // "parameters": {
  63481. // "instanceGroupManager": {
  63482. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  63483. // "location": "path",
  63484. // "required": true,
  63485. // "type": "string"
  63486. // },
  63487. // "project": {
  63488. // "description": "Project ID for this request.",
  63489. // "location": "path",
  63490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63491. // "required": true,
  63492. // "type": "string"
  63493. // },
  63494. // "zone": {
  63495. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  63496. // "location": "path",
  63497. // "required": true,
  63498. // "type": "string"
  63499. // }
  63500. // },
  63501. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
  63502. // "request": {
  63503. // "$ref": "InstanceGroupManagersDeletePerInstanceConfigsReq"
  63504. // },
  63505. // "response": {
  63506. // "$ref": "Operation"
  63507. // },
  63508. // "scopes": [
  63509. // "https://www.googleapis.com/auth/cloud-platform",
  63510. // "https://www.googleapis.com/auth/compute"
  63511. // ]
  63512. // }
  63513. }
  63514. // method id "compute.instanceGroupManagers.get":
  63515. type InstanceGroupManagersGetCall struct {
  63516. s *Service
  63517. project string
  63518. zone string
  63519. instanceGroupManager string
  63520. urlParams_ gensupport.URLParams
  63521. ifNoneMatch_ string
  63522. ctx_ context.Context
  63523. header_ http.Header
  63524. }
  63525. // Get: Returns all of the details about the specified managed instance
  63526. // group. Gets a list of available managed instance groups by making a
  63527. // list() request.
  63528. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  63529. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63530. c.project = project
  63531. c.zone = zone
  63532. c.instanceGroupManager = instanceGroupManager
  63533. return c
  63534. }
  63535. // Fields allows partial responses to be retrieved. See
  63536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63537. // for more information.
  63538. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  63539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63540. return c
  63541. }
  63542. // IfNoneMatch sets the optional parameter which makes the operation
  63543. // fail if the object's ETag matches the given value. This is useful for
  63544. // getting updates only after the object has changed since the last
  63545. // request. Use googleapi.IsNotModified to check whether the response
  63546. // error from Do is the result of In-None-Match.
  63547. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  63548. c.ifNoneMatch_ = entityTag
  63549. return c
  63550. }
  63551. // Context sets the context to be used in this call's Do method. Any
  63552. // pending HTTP request will be aborted if the provided context is
  63553. // canceled.
  63554. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  63555. c.ctx_ = ctx
  63556. return c
  63557. }
  63558. // Header returns an http.Header that can be modified by the caller to
  63559. // add HTTP headers to the request.
  63560. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  63561. if c.header_ == nil {
  63562. c.header_ = make(http.Header)
  63563. }
  63564. return c.header_
  63565. }
  63566. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  63567. reqHeaders := make(http.Header)
  63568. for k, v := range c.header_ {
  63569. reqHeaders[k] = v
  63570. }
  63571. reqHeaders.Set("User-Agent", c.s.userAgent())
  63572. if c.ifNoneMatch_ != "" {
  63573. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63574. }
  63575. var body io.Reader = nil
  63576. c.urlParams_.Set("alt", alt)
  63577. c.urlParams_.Set("prettyPrint", "false")
  63578. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  63579. urls += "?" + c.urlParams_.Encode()
  63580. req, err := http.NewRequest("GET", urls, body)
  63581. if err != nil {
  63582. return nil, err
  63583. }
  63584. req.Header = reqHeaders
  63585. googleapi.Expand(req.URL, map[string]string{
  63586. "project": c.project,
  63587. "zone": c.zone,
  63588. "instanceGroupManager": c.instanceGroupManager,
  63589. })
  63590. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63591. }
  63592. // Do executes the "compute.instanceGroupManagers.get" call.
  63593. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  63594. // non-2xx status code is an error. Response headers are in either
  63595. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  63596. // returned at all) in error.(*googleapi.Error).Header. Use
  63597. // googleapi.IsNotModified to check whether the returned error was
  63598. // because http.StatusNotModified was returned.
  63599. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  63600. gensupport.SetOptions(c.urlParams_, opts...)
  63601. res, err := c.doRequest("json")
  63602. if res != nil && res.StatusCode == http.StatusNotModified {
  63603. if res.Body != nil {
  63604. res.Body.Close()
  63605. }
  63606. return nil, &googleapi.Error{
  63607. Code: res.StatusCode,
  63608. Header: res.Header,
  63609. }
  63610. }
  63611. if err != nil {
  63612. return nil, err
  63613. }
  63614. defer googleapi.CloseBody(res)
  63615. if err := googleapi.CheckResponse(res); err != nil {
  63616. return nil, err
  63617. }
  63618. ret := &InstanceGroupManager{
  63619. ServerResponse: googleapi.ServerResponse{
  63620. Header: res.Header,
  63621. HTTPStatusCode: res.StatusCode,
  63622. },
  63623. }
  63624. target := &ret
  63625. if err := gensupport.DecodeResponse(target, res); err != nil {
  63626. return nil, err
  63627. }
  63628. return ret, nil
  63629. // {
  63630. // "description": "Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request.",
  63631. // "httpMethod": "GET",
  63632. // "id": "compute.instanceGroupManagers.get",
  63633. // "parameterOrder": [
  63634. // "project",
  63635. // "zone",
  63636. // "instanceGroupManager"
  63637. // ],
  63638. // "parameters": {
  63639. // "instanceGroupManager": {
  63640. // "description": "The name of the managed instance group.",
  63641. // "location": "path",
  63642. // "required": true,
  63643. // "type": "string"
  63644. // },
  63645. // "project": {
  63646. // "description": "Project ID for this request.",
  63647. // "location": "path",
  63648. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63649. // "required": true,
  63650. // "type": "string"
  63651. // },
  63652. // "zone": {
  63653. // "description": "The name of the zone where the managed instance group is located.",
  63654. // "location": "path",
  63655. // "required": true,
  63656. // "type": "string"
  63657. // }
  63658. // },
  63659. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  63660. // "response": {
  63661. // "$ref": "InstanceGroupManager"
  63662. // },
  63663. // "scopes": [
  63664. // "https://www.googleapis.com/auth/cloud-platform",
  63665. // "https://www.googleapis.com/auth/compute",
  63666. // "https://www.googleapis.com/auth/compute.readonly"
  63667. // ]
  63668. // }
  63669. }
  63670. // method id "compute.instanceGroupManagers.insert":
  63671. type InstanceGroupManagersInsertCall struct {
  63672. s *Service
  63673. project string
  63674. zone string
  63675. instancegroupmanager *InstanceGroupManager
  63676. urlParams_ gensupport.URLParams
  63677. ctx_ context.Context
  63678. header_ http.Header
  63679. }
  63680. // Insert: Creates a managed instance group using the information that
  63681. // you specify in the request. After the group is created, instances in
  63682. // the group are created using the specified instance template. This
  63683. // operation is marked as DONE when the group is created even if the
  63684. // instances in the group have not yet been created. You must separately
  63685. // verify the status of the individual instances with the
  63686. // listmanagedinstances method.
  63687. //
  63688. // A managed instance group can have up to 1000 VM instances per group.
  63689. // Please contact Cloud Support if you need an increase in this limit.
  63690. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  63691. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63692. c.project = project
  63693. c.zone = zone
  63694. c.instancegroupmanager = instancegroupmanager
  63695. return c
  63696. }
  63697. // RequestId sets the optional parameter "requestId": An optional
  63698. // request ID to identify requests. Specify a unique request ID so that
  63699. // if you must retry your request, the server will know to ignore the
  63700. // request if it has already been completed.
  63701. //
  63702. // For example, consider a situation where you make an initial request
  63703. // and the request times out. If you make the request again with the
  63704. // same request ID, the server can check if original operation with the
  63705. // same request ID was received, and if so, will ignore the second
  63706. // request. This prevents clients from accidentally creating duplicate
  63707. // commitments.
  63708. //
  63709. // The request ID must be a valid UUID with the exception that zero UUID
  63710. // is not supported (00000000-0000-0000-0000-000000000000).
  63711. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  63712. c.urlParams_.Set("requestId", requestId)
  63713. return c
  63714. }
  63715. // Fields allows partial responses to be retrieved. See
  63716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63717. // for more information.
  63718. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  63719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63720. return c
  63721. }
  63722. // Context sets the context to be used in this call's Do method. Any
  63723. // pending HTTP request will be aborted if the provided context is
  63724. // canceled.
  63725. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  63726. c.ctx_ = ctx
  63727. return c
  63728. }
  63729. // Header returns an http.Header that can be modified by the caller to
  63730. // add HTTP headers to the request.
  63731. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  63732. if c.header_ == nil {
  63733. c.header_ = make(http.Header)
  63734. }
  63735. return c.header_
  63736. }
  63737. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  63738. reqHeaders := make(http.Header)
  63739. for k, v := range c.header_ {
  63740. reqHeaders[k] = v
  63741. }
  63742. reqHeaders.Set("User-Agent", c.s.userAgent())
  63743. var body io.Reader = nil
  63744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  63745. if err != nil {
  63746. return nil, err
  63747. }
  63748. reqHeaders.Set("Content-Type", "application/json")
  63749. c.urlParams_.Set("alt", alt)
  63750. c.urlParams_.Set("prettyPrint", "false")
  63751. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  63752. urls += "?" + c.urlParams_.Encode()
  63753. req, err := http.NewRequest("POST", urls, body)
  63754. if err != nil {
  63755. return nil, err
  63756. }
  63757. req.Header = reqHeaders
  63758. googleapi.Expand(req.URL, map[string]string{
  63759. "project": c.project,
  63760. "zone": c.zone,
  63761. })
  63762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63763. }
  63764. // Do executes the "compute.instanceGroupManagers.insert" call.
  63765. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63766. // status code is an error. Response headers are in either
  63767. // *Operation.ServerResponse.Header or (if a response was returned at
  63768. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63769. // to check whether the returned error was because
  63770. // http.StatusNotModified was returned.
  63771. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63772. gensupport.SetOptions(c.urlParams_, opts...)
  63773. res, err := c.doRequest("json")
  63774. if res != nil && res.StatusCode == http.StatusNotModified {
  63775. if res.Body != nil {
  63776. res.Body.Close()
  63777. }
  63778. return nil, &googleapi.Error{
  63779. Code: res.StatusCode,
  63780. Header: res.Header,
  63781. }
  63782. }
  63783. if err != nil {
  63784. return nil, err
  63785. }
  63786. defer googleapi.CloseBody(res)
  63787. if err := googleapi.CheckResponse(res); err != nil {
  63788. return nil, err
  63789. }
  63790. ret := &Operation{
  63791. ServerResponse: googleapi.ServerResponse{
  63792. Header: res.Header,
  63793. HTTPStatusCode: res.StatusCode,
  63794. },
  63795. }
  63796. target := &ret
  63797. if err := gensupport.DecodeResponse(target, res); err != nil {
  63798. return nil, err
  63799. }
  63800. return ret, nil
  63801. // {
  63802. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.",
  63803. // "httpMethod": "POST",
  63804. // "id": "compute.instanceGroupManagers.insert",
  63805. // "parameterOrder": [
  63806. // "project",
  63807. // "zone"
  63808. // ],
  63809. // "parameters": {
  63810. // "project": {
  63811. // "description": "Project ID for this request.",
  63812. // "location": "path",
  63813. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63814. // "required": true,
  63815. // "type": "string"
  63816. // },
  63817. // "requestId": {
  63818. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63819. // "location": "query",
  63820. // "type": "string"
  63821. // },
  63822. // "zone": {
  63823. // "description": "The name of the zone where you want to create the managed instance group.",
  63824. // "location": "path",
  63825. // "required": true,
  63826. // "type": "string"
  63827. // }
  63828. // },
  63829. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  63830. // "request": {
  63831. // "$ref": "InstanceGroupManager"
  63832. // },
  63833. // "response": {
  63834. // "$ref": "Operation"
  63835. // },
  63836. // "scopes": [
  63837. // "https://www.googleapis.com/auth/cloud-platform",
  63838. // "https://www.googleapis.com/auth/compute"
  63839. // ]
  63840. // }
  63841. }
  63842. // method id "compute.instanceGroupManagers.list":
  63843. type InstanceGroupManagersListCall struct {
  63844. s *Service
  63845. project string
  63846. zone string
  63847. urlParams_ gensupport.URLParams
  63848. ifNoneMatch_ string
  63849. ctx_ context.Context
  63850. header_ http.Header
  63851. }
  63852. // List: Retrieves a list of managed instance groups that are contained
  63853. // within the specified project and zone.
  63854. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  63855. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63856. c.project = project
  63857. c.zone = zone
  63858. return c
  63859. }
  63860. // Filter sets the optional parameter "filter": A filter expression that
  63861. // filters resources listed in the response. The expression must specify
  63862. // the field name, a comparison operator, and the value that you want to
  63863. // use for filtering. The value must be a string, a number, or a
  63864. // boolean. The comparison operator must be either =, !=, >, or <.
  63865. //
  63866. // For example, if you are filtering Compute Engine instances, you can
  63867. // exclude instances named example-instance by specifying name !=
  63868. // example-instance.
  63869. //
  63870. // You can also filter nested fields. For example, you could specify
  63871. // scheduling.automaticRestart = false to include instances only if they
  63872. // are not scheduled for automatic restarts. You can use filtering on
  63873. // nested fields to filter based on resource labels.
  63874. //
  63875. // To filter on multiple expressions, provide each separate expression
  63876. // within parentheses. For example, (scheduling.automaticRestart = true)
  63877. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  63878. // AND expression. However, you can include AND and OR expressions
  63879. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  63880. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  63881. // true).
  63882. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  63883. c.urlParams_.Set("filter", filter)
  63884. return c
  63885. }
  63886. // MaxResults sets the optional parameter "maxResults": The maximum
  63887. // number of results per page that should be returned. If the number of
  63888. // available results is larger than maxResults, Compute Engine returns a
  63889. // nextPageToken that can be used to get the next page of results in
  63890. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  63891. // (Default: 500)
  63892. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  63893. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  63894. return c
  63895. }
  63896. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  63897. // a certain order. By default, results are returned in alphanumerical
  63898. // order based on the resource name.
  63899. //
  63900. // You can also sort results in descending order based on the creation
  63901. // timestamp using orderBy="creationTimestamp desc". This sorts results
  63902. // based on the creationTimestamp field in reverse chronological order
  63903. // (newest result first). Use this to sort resources like operations so
  63904. // that the newest operation is returned first.
  63905. //
  63906. // Currently, only sorting by name or creationTimestamp desc is
  63907. // supported.
  63908. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  63909. c.urlParams_.Set("orderBy", orderBy)
  63910. return c
  63911. }
  63912. // PageToken sets the optional parameter "pageToken": Specifies a page
  63913. // token to use. Set pageToken to the nextPageToken returned by a
  63914. // previous list request to get the next page of results.
  63915. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  63916. c.urlParams_.Set("pageToken", pageToken)
  63917. return c
  63918. }
  63919. // Fields allows partial responses to be retrieved. See
  63920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63921. // for more information.
  63922. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  63923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63924. return c
  63925. }
  63926. // IfNoneMatch sets the optional parameter which makes the operation
  63927. // fail if the object's ETag matches the given value. This is useful for
  63928. // getting updates only after the object has changed since the last
  63929. // request. Use googleapi.IsNotModified to check whether the response
  63930. // error from Do is the result of In-None-Match.
  63931. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  63932. c.ifNoneMatch_ = entityTag
  63933. return c
  63934. }
  63935. // Context sets the context to be used in this call's Do method. Any
  63936. // pending HTTP request will be aborted if the provided context is
  63937. // canceled.
  63938. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  63939. c.ctx_ = ctx
  63940. return c
  63941. }
  63942. // Header returns an http.Header that can be modified by the caller to
  63943. // add HTTP headers to the request.
  63944. func (c *InstanceGroupManagersListCall) Header() http.Header {
  63945. if c.header_ == nil {
  63946. c.header_ = make(http.Header)
  63947. }
  63948. return c.header_
  63949. }
  63950. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  63951. reqHeaders := make(http.Header)
  63952. for k, v := range c.header_ {
  63953. reqHeaders[k] = v
  63954. }
  63955. reqHeaders.Set("User-Agent", c.s.userAgent())
  63956. if c.ifNoneMatch_ != "" {
  63957. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63958. }
  63959. var body io.Reader = nil
  63960. c.urlParams_.Set("alt", alt)
  63961. c.urlParams_.Set("prettyPrint", "false")
  63962. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  63963. urls += "?" + c.urlParams_.Encode()
  63964. req, err := http.NewRequest("GET", urls, body)
  63965. if err != nil {
  63966. return nil, err
  63967. }
  63968. req.Header = reqHeaders
  63969. googleapi.Expand(req.URL, map[string]string{
  63970. "project": c.project,
  63971. "zone": c.zone,
  63972. })
  63973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63974. }
  63975. // Do executes the "compute.instanceGroupManagers.list" call.
  63976. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  63977. // Any non-2xx status code is an error. Response headers are in either
  63978. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  63979. // returned at all) in error.(*googleapi.Error).Header. Use
  63980. // googleapi.IsNotModified to check whether the returned error was
  63981. // because http.StatusNotModified was returned.
  63982. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  63983. gensupport.SetOptions(c.urlParams_, opts...)
  63984. res, err := c.doRequest("json")
  63985. if res != nil && res.StatusCode == http.StatusNotModified {
  63986. if res.Body != nil {
  63987. res.Body.Close()
  63988. }
  63989. return nil, &googleapi.Error{
  63990. Code: res.StatusCode,
  63991. Header: res.Header,
  63992. }
  63993. }
  63994. if err != nil {
  63995. return nil, err
  63996. }
  63997. defer googleapi.CloseBody(res)
  63998. if err := googleapi.CheckResponse(res); err != nil {
  63999. return nil, err
  64000. }
  64001. ret := &InstanceGroupManagerList{
  64002. ServerResponse: googleapi.ServerResponse{
  64003. Header: res.Header,
  64004. HTTPStatusCode: res.StatusCode,
  64005. },
  64006. }
  64007. target := &ret
  64008. if err := gensupport.DecodeResponse(target, res); err != nil {
  64009. return nil, err
  64010. }
  64011. return ret, nil
  64012. // {
  64013. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  64014. // "httpMethod": "GET",
  64015. // "id": "compute.instanceGroupManagers.list",
  64016. // "parameterOrder": [
  64017. // "project",
  64018. // "zone"
  64019. // ],
  64020. // "parameters": {
  64021. // "filter": {
  64022. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64023. // "location": "query",
  64024. // "type": "string"
  64025. // },
  64026. // "maxResults": {
  64027. // "default": "500",
  64028. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64029. // "format": "uint32",
  64030. // "location": "query",
  64031. // "minimum": "0",
  64032. // "type": "integer"
  64033. // },
  64034. // "orderBy": {
  64035. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64036. // "location": "query",
  64037. // "type": "string"
  64038. // },
  64039. // "pageToken": {
  64040. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64041. // "location": "query",
  64042. // "type": "string"
  64043. // },
  64044. // "project": {
  64045. // "description": "Project ID for this request.",
  64046. // "location": "path",
  64047. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64048. // "required": true,
  64049. // "type": "string"
  64050. // },
  64051. // "zone": {
  64052. // "description": "The name of the zone where the managed instance group is located.",
  64053. // "location": "path",
  64054. // "required": true,
  64055. // "type": "string"
  64056. // }
  64057. // },
  64058. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  64059. // "response": {
  64060. // "$ref": "InstanceGroupManagerList"
  64061. // },
  64062. // "scopes": [
  64063. // "https://www.googleapis.com/auth/cloud-platform",
  64064. // "https://www.googleapis.com/auth/compute",
  64065. // "https://www.googleapis.com/auth/compute.readonly"
  64066. // ]
  64067. // }
  64068. }
  64069. // Pages invokes f for each page of results.
  64070. // A non-nil error returned from f will halt the iteration.
  64071. // The provided context supersedes any context provided to the Context method.
  64072. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  64073. c.ctx_ = ctx
  64074. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64075. for {
  64076. x, err := c.Do()
  64077. if err != nil {
  64078. return err
  64079. }
  64080. if err := f(x); err != nil {
  64081. return err
  64082. }
  64083. if x.NextPageToken == "" {
  64084. return nil
  64085. }
  64086. c.PageToken(x.NextPageToken)
  64087. }
  64088. }
  64089. // method id "compute.instanceGroupManagers.listManagedInstances":
  64090. type InstanceGroupManagersListManagedInstancesCall struct {
  64091. s *Service
  64092. project string
  64093. zone string
  64094. instanceGroupManager string
  64095. urlParams_ gensupport.URLParams
  64096. ctx_ context.Context
  64097. header_ http.Header
  64098. }
  64099. // ListManagedInstances: Lists all of the instances in the managed
  64100. // instance group. Each instance in the list has a currentAction, which
  64101. // indicates the action that the managed instance group is performing on
  64102. // the instance. For example, if the group is still creating an
  64103. // instance, the currentAction is CREATING. If a previous action failed,
  64104. // the list displays the errors for that failed action.
  64105. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  64106. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64107. c.project = project
  64108. c.zone = zone
  64109. c.instanceGroupManager = instanceGroupManager
  64110. return c
  64111. }
  64112. // Filter sets the optional parameter "filter": A filter expression that
  64113. // filters resources listed in the response. The expression must specify
  64114. // the field name, a comparison operator, and the value that you want to
  64115. // use for filtering. The value must be a string, a number, or a
  64116. // boolean. The comparison operator must be either =, !=, >, or <.
  64117. //
  64118. // For example, if you are filtering Compute Engine instances, you can
  64119. // exclude instances named example-instance by specifying name !=
  64120. // example-instance.
  64121. //
  64122. // You can also filter nested fields. For example, you could specify
  64123. // scheduling.automaticRestart = false to include instances only if they
  64124. // are not scheduled for automatic restarts. You can use filtering on
  64125. // nested fields to filter based on resource labels.
  64126. //
  64127. // To filter on multiple expressions, provide each separate expression
  64128. // within parentheses. For example, (scheduling.automaticRestart = true)
  64129. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64130. // AND expression. However, you can include AND and OR expressions
  64131. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64132. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64133. // true).
  64134. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  64135. c.urlParams_.Set("filter", filter)
  64136. return c
  64137. }
  64138. // MaxResults sets the optional parameter "maxResults": The maximum
  64139. // number of results per page that should be returned. If the number of
  64140. // available results is larger than maxResults, Compute Engine returns a
  64141. // nextPageToken that can be used to get the next page of results in
  64142. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64143. // (Default: 500)
  64144. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  64145. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64146. return c
  64147. }
  64148. // OrderBy sets the optional parameter "order_by": Sorts list results by
  64149. // a certain order. By default, results are returned in alphanumerical
  64150. // order based on the resource name.
  64151. //
  64152. // You can also sort results in descending order based on the creation
  64153. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64154. // based on the creationTimestamp field in reverse chronological order
  64155. // (newest result first). Use this to sort resources like operations so
  64156. // that the newest operation is returned first.
  64157. //
  64158. // Currently, only sorting by name or creationTimestamp desc is
  64159. // supported.
  64160. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  64161. c.urlParams_.Set("order_by", orderBy)
  64162. return c
  64163. }
  64164. // PageToken sets the optional parameter "pageToken": Specifies a page
  64165. // token to use. Set pageToken to the nextPageToken returned by a
  64166. // previous list request to get the next page of results.
  64167. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  64168. c.urlParams_.Set("pageToken", pageToken)
  64169. return c
  64170. }
  64171. // Fields allows partial responses to be retrieved. See
  64172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64173. // for more information.
  64174. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  64175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64176. return c
  64177. }
  64178. // Context sets the context to be used in this call's Do method. Any
  64179. // pending HTTP request will be aborted if the provided context is
  64180. // canceled.
  64181. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  64182. c.ctx_ = ctx
  64183. return c
  64184. }
  64185. // Header returns an http.Header that can be modified by the caller to
  64186. // add HTTP headers to the request.
  64187. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  64188. if c.header_ == nil {
  64189. c.header_ = make(http.Header)
  64190. }
  64191. return c.header_
  64192. }
  64193. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  64194. reqHeaders := make(http.Header)
  64195. for k, v := range c.header_ {
  64196. reqHeaders[k] = v
  64197. }
  64198. reqHeaders.Set("User-Agent", c.s.userAgent())
  64199. var body io.Reader = nil
  64200. c.urlParams_.Set("alt", alt)
  64201. c.urlParams_.Set("prettyPrint", "false")
  64202. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  64203. urls += "?" + c.urlParams_.Encode()
  64204. req, err := http.NewRequest("POST", urls, body)
  64205. if err != nil {
  64206. return nil, err
  64207. }
  64208. req.Header = reqHeaders
  64209. googleapi.Expand(req.URL, map[string]string{
  64210. "project": c.project,
  64211. "zone": c.zone,
  64212. "instanceGroupManager": c.instanceGroupManager,
  64213. })
  64214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64215. }
  64216. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  64217. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  64218. // error will be non-nil. Any non-2xx status code is an error. Response
  64219. // headers are in either
  64220. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  64221. // er or (if a response was returned at all) in
  64222. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  64223. // whether the returned error was because http.StatusNotModified was
  64224. // returned.
  64225. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  64226. gensupport.SetOptions(c.urlParams_, opts...)
  64227. res, err := c.doRequest("json")
  64228. if res != nil && res.StatusCode == http.StatusNotModified {
  64229. if res.Body != nil {
  64230. res.Body.Close()
  64231. }
  64232. return nil, &googleapi.Error{
  64233. Code: res.StatusCode,
  64234. Header: res.Header,
  64235. }
  64236. }
  64237. if err != nil {
  64238. return nil, err
  64239. }
  64240. defer googleapi.CloseBody(res)
  64241. if err := googleapi.CheckResponse(res); err != nil {
  64242. return nil, err
  64243. }
  64244. ret := &InstanceGroupManagersListManagedInstancesResponse{
  64245. ServerResponse: googleapi.ServerResponse{
  64246. Header: res.Header,
  64247. HTTPStatusCode: res.StatusCode,
  64248. },
  64249. }
  64250. target := &ret
  64251. if err := gensupport.DecodeResponse(target, res); err != nil {
  64252. return nil, err
  64253. }
  64254. return ret, nil
  64255. // {
  64256. // "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.",
  64257. // "httpMethod": "POST",
  64258. // "id": "compute.instanceGroupManagers.listManagedInstances",
  64259. // "parameterOrder": [
  64260. // "project",
  64261. // "zone",
  64262. // "instanceGroupManager"
  64263. // ],
  64264. // "parameters": {
  64265. // "filter": {
  64266. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64267. // "location": "query",
  64268. // "type": "string"
  64269. // },
  64270. // "instanceGroupManager": {
  64271. // "description": "The name of the managed instance group.",
  64272. // "location": "path",
  64273. // "required": true,
  64274. // "type": "string"
  64275. // },
  64276. // "maxResults": {
  64277. // "default": "500",
  64278. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64279. // "format": "uint32",
  64280. // "location": "query",
  64281. // "minimum": "0",
  64282. // "type": "integer"
  64283. // },
  64284. // "order_by": {
  64285. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64286. // "location": "query",
  64287. // "type": "string"
  64288. // },
  64289. // "pageToken": {
  64290. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64291. // "location": "query",
  64292. // "type": "string"
  64293. // },
  64294. // "project": {
  64295. // "description": "Project ID for this request.",
  64296. // "location": "path",
  64297. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64298. // "required": true,
  64299. // "type": "string"
  64300. // },
  64301. // "zone": {
  64302. // "description": "The name of the zone where the managed instance group is located.",
  64303. // "location": "path",
  64304. // "required": true,
  64305. // "type": "string"
  64306. // }
  64307. // },
  64308. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  64309. // "response": {
  64310. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  64311. // },
  64312. // "scopes": [
  64313. // "https://www.googleapis.com/auth/cloud-platform",
  64314. // "https://www.googleapis.com/auth/compute",
  64315. // "https://www.googleapis.com/auth/compute.readonly"
  64316. // ]
  64317. // }
  64318. }
  64319. // Pages invokes f for each page of results.
  64320. // A non-nil error returned from f will halt the iteration.
  64321. // The provided context supersedes any context provided to the Context method.
  64322. func (c *InstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListManagedInstancesResponse) error) error {
  64323. c.ctx_ = ctx
  64324. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64325. for {
  64326. x, err := c.Do()
  64327. if err != nil {
  64328. return err
  64329. }
  64330. if err := f(x); err != nil {
  64331. return err
  64332. }
  64333. if x.NextPageToken == "" {
  64334. return nil
  64335. }
  64336. c.PageToken(x.NextPageToken)
  64337. }
  64338. }
  64339. // method id "compute.instanceGroupManagers.listPerInstanceConfigs":
  64340. type InstanceGroupManagersListPerInstanceConfigsCall struct {
  64341. s *Service
  64342. project string
  64343. zone string
  64344. instanceGroupManager string
  64345. urlParams_ gensupport.URLParams
  64346. ctx_ context.Context
  64347. header_ http.Header
  64348. }
  64349. // ListPerInstanceConfigs: Lists all of the per-instance configs defined
  64350. // for the managed instance group.
  64351. func (r *InstanceGroupManagersService) ListPerInstanceConfigs(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListPerInstanceConfigsCall {
  64352. c := &InstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64353. c.project = project
  64354. c.zone = zone
  64355. c.instanceGroupManager = instanceGroupManager
  64356. return c
  64357. }
  64358. // Filter sets the optional parameter "filter": A filter expression that
  64359. // filters resources listed in the response. The expression must specify
  64360. // the field name, a comparison operator, and the value that you want to
  64361. // use for filtering. The value must be a string, a number, or a
  64362. // boolean. The comparison operator must be either =, !=, >, or <.
  64363. //
  64364. // For example, if you are filtering Compute Engine instances, you can
  64365. // exclude instances named example-instance by specifying name !=
  64366. // example-instance.
  64367. //
  64368. // You can also filter nested fields. For example, you could specify
  64369. // scheduling.automaticRestart = false to include instances only if they
  64370. // are not scheduled for automatic restarts. You can use filtering on
  64371. // nested fields to filter based on resource labels.
  64372. //
  64373. // To filter on multiple expressions, provide each separate expression
  64374. // within parentheses. For example, (scheduling.automaticRestart = true)
  64375. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64376. // AND expression. However, you can include AND and OR expressions
  64377. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64378. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64379. // true).
  64380. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *InstanceGroupManagersListPerInstanceConfigsCall {
  64381. c.urlParams_.Set("filter", filter)
  64382. return c
  64383. }
  64384. // MaxResults sets the optional parameter "maxResults": The maximum
  64385. // number of results per page that should be returned. If the number of
  64386. // available results is larger than maxResults, Compute Engine returns a
  64387. // nextPageToken that can be used to get the next page of results in
  64388. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64389. // (Default: 500)
  64390. func (c *InstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *InstanceGroupManagersListPerInstanceConfigsCall {
  64391. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64392. return c
  64393. }
  64394. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64395. // a certain order. By default, results are returned in alphanumerical
  64396. // order based on the resource name.
  64397. //
  64398. // You can also sort results in descending order based on the creation
  64399. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64400. // based on the creationTimestamp field in reverse chronological order
  64401. // (newest result first). Use this to sort resources like operations so
  64402. // that the newest operation is returned first.
  64403. //
  64404. // Currently, only sorting by name or creationTimestamp desc is
  64405. // supported.
  64406. func (c *InstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *InstanceGroupManagersListPerInstanceConfigsCall {
  64407. c.urlParams_.Set("orderBy", orderBy)
  64408. return c
  64409. }
  64410. // PageToken sets the optional parameter "pageToken": Specifies a page
  64411. // token to use. Set pageToken to the nextPageToken returned by a
  64412. // previous list request to get the next page of results.
  64413. func (c *InstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *InstanceGroupManagersListPerInstanceConfigsCall {
  64414. c.urlParams_.Set("pageToken", pageToken)
  64415. return c
  64416. }
  64417. // Fields allows partial responses to be retrieved. See
  64418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64419. // for more information.
  64420. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListPerInstanceConfigsCall {
  64421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64422. return c
  64423. }
  64424. // Context sets the context to be used in this call's Do method. Any
  64425. // pending HTTP request will be aborted if the provided context is
  64426. // canceled.
  64427. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersListPerInstanceConfigsCall {
  64428. c.ctx_ = ctx
  64429. return c
  64430. }
  64431. // Header returns an http.Header that can be modified by the caller to
  64432. // add HTTP headers to the request.
  64433. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
  64434. if c.header_ == nil {
  64435. c.header_ = make(http.Header)
  64436. }
  64437. return c.header_
  64438. }
  64439. func (c *InstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  64440. reqHeaders := make(http.Header)
  64441. for k, v := range c.header_ {
  64442. reqHeaders[k] = v
  64443. }
  64444. reqHeaders.Set("User-Agent", c.s.userAgent())
  64445. var body io.Reader = nil
  64446. c.urlParams_.Set("alt", alt)
  64447. c.urlParams_.Set("prettyPrint", "false")
  64448. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
  64449. urls += "?" + c.urlParams_.Encode()
  64450. req, err := http.NewRequest("POST", urls, body)
  64451. if err != nil {
  64452. return nil, err
  64453. }
  64454. req.Header = reqHeaders
  64455. googleapi.Expand(req.URL, map[string]string{
  64456. "project": c.project,
  64457. "zone": c.zone,
  64458. "instanceGroupManager": c.instanceGroupManager,
  64459. })
  64460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64461. }
  64462. // Do executes the "compute.instanceGroupManagers.listPerInstanceConfigs" call.
  64463. // Exactly one of *InstanceGroupManagersListPerInstanceConfigsResp or
  64464. // error will be non-nil. Any non-2xx status code is an error. Response
  64465. // headers are in either
  64466. // *InstanceGroupManagersListPerInstanceConfigsResp.ServerResponse.Header
  64467. // or (if a response was returned at all) in
  64468. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  64469. // whether the returned error was because http.StatusNotModified was
  64470. // returned.
  64471. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListPerInstanceConfigsResp, error) {
  64472. gensupport.SetOptions(c.urlParams_, opts...)
  64473. res, err := c.doRequest("json")
  64474. if res != nil && res.StatusCode == http.StatusNotModified {
  64475. if res.Body != nil {
  64476. res.Body.Close()
  64477. }
  64478. return nil, &googleapi.Error{
  64479. Code: res.StatusCode,
  64480. Header: res.Header,
  64481. }
  64482. }
  64483. if err != nil {
  64484. return nil, err
  64485. }
  64486. defer googleapi.CloseBody(res)
  64487. if err := googleapi.CheckResponse(res); err != nil {
  64488. return nil, err
  64489. }
  64490. ret := &InstanceGroupManagersListPerInstanceConfigsResp{
  64491. ServerResponse: googleapi.ServerResponse{
  64492. Header: res.Header,
  64493. HTTPStatusCode: res.StatusCode,
  64494. },
  64495. }
  64496. target := &ret
  64497. if err := gensupport.DecodeResponse(target, res); err != nil {
  64498. return nil, err
  64499. }
  64500. return ret, nil
  64501. // {
  64502. // "description": "Lists all of the per-instance configs defined for the managed instance group.",
  64503. // "httpMethod": "POST",
  64504. // "id": "compute.instanceGroupManagers.listPerInstanceConfigs",
  64505. // "parameterOrder": [
  64506. // "project",
  64507. // "zone",
  64508. // "instanceGroupManager"
  64509. // ],
  64510. // "parameters": {
  64511. // "filter": {
  64512. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64513. // "location": "query",
  64514. // "type": "string"
  64515. // },
  64516. // "instanceGroupManager": {
  64517. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  64518. // "location": "path",
  64519. // "required": true,
  64520. // "type": "string"
  64521. // },
  64522. // "maxResults": {
  64523. // "default": "500",
  64524. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64525. // "format": "uint32",
  64526. // "location": "query",
  64527. // "minimum": "0",
  64528. // "type": "integer"
  64529. // },
  64530. // "orderBy": {
  64531. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64532. // "location": "query",
  64533. // "type": "string"
  64534. // },
  64535. // "pageToken": {
  64536. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64537. // "location": "query",
  64538. // "type": "string"
  64539. // },
  64540. // "project": {
  64541. // "description": "Project ID for this request.",
  64542. // "location": "path",
  64543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64544. // "required": true,
  64545. // "type": "string"
  64546. // },
  64547. // "zone": {
  64548. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  64549. // "location": "path",
  64550. // "required": true,
  64551. // "type": "string"
  64552. // }
  64553. // },
  64554. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
  64555. // "response": {
  64556. // "$ref": "InstanceGroupManagersListPerInstanceConfigsResp"
  64557. // },
  64558. // "scopes": [
  64559. // "https://www.googleapis.com/auth/cloud-platform",
  64560. // "https://www.googleapis.com/auth/compute",
  64561. // "https://www.googleapis.com/auth/compute.readonly"
  64562. // ]
  64563. // }
  64564. }
  64565. // Pages invokes f for each page of results.
  64566. // A non-nil error returned from f will halt the iteration.
  64567. // The provided context supersedes any context provided to the Context method.
  64568. func (c *InstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListPerInstanceConfigsResp) error) error {
  64569. c.ctx_ = ctx
  64570. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64571. for {
  64572. x, err := c.Do()
  64573. if err != nil {
  64574. return err
  64575. }
  64576. if err := f(x); err != nil {
  64577. return err
  64578. }
  64579. if x.NextPageToken == "" {
  64580. return nil
  64581. }
  64582. c.PageToken(x.NextPageToken)
  64583. }
  64584. }
  64585. // method id "compute.instanceGroupManagers.patch":
  64586. type InstanceGroupManagersPatchCall struct {
  64587. s *Service
  64588. project string
  64589. zone string
  64590. instanceGroupManager string
  64591. instancegroupmanager *InstanceGroupManager
  64592. urlParams_ gensupport.URLParams
  64593. ctx_ context.Context
  64594. header_ http.Header
  64595. }
  64596. // Patch: Updates a managed instance group using the information that
  64597. // you specify in the request. This operation is marked as DONE when the
  64598. // group is patched even if the instances in the group are still in the
  64599. // process of being patched. You must separately verify the status of
  64600. // the individual instances with the listManagedInstances method. This
  64601. // method supports PATCH semantics and uses the JSON merge patch format
  64602. // and processing rules.
  64603. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  64604. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64605. c.project = project
  64606. c.zone = zone
  64607. c.instanceGroupManager = instanceGroupManager
  64608. c.instancegroupmanager = instancegroupmanager
  64609. return c
  64610. }
  64611. // RequestId sets the optional parameter "requestId": An optional
  64612. // request ID to identify requests. Specify a unique request ID so that
  64613. // if you must retry your request, the server will know to ignore the
  64614. // request if it has already been completed.
  64615. //
  64616. // For example, consider a situation where you make an initial request
  64617. // and the request times out. If you make the request again with the
  64618. // same request ID, the server can check if original operation with the
  64619. // same request ID was received, and if so, will ignore the second
  64620. // request. This prevents clients from accidentally creating duplicate
  64621. // commitments.
  64622. //
  64623. // The request ID must be a valid UUID with the exception that zero UUID
  64624. // is not supported (00000000-0000-0000-0000-000000000000).
  64625. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  64626. c.urlParams_.Set("requestId", requestId)
  64627. return c
  64628. }
  64629. // Fields allows partial responses to be retrieved. See
  64630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64631. // for more information.
  64632. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  64633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64634. return c
  64635. }
  64636. // Context sets the context to be used in this call's Do method. Any
  64637. // pending HTTP request will be aborted if the provided context is
  64638. // canceled.
  64639. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  64640. c.ctx_ = ctx
  64641. return c
  64642. }
  64643. // Header returns an http.Header that can be modified by the caller to
  64644. // add HTTP headers to the request.
  64645. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  64646. if c.header_ == nil {
  64647. c.header_ = make(http.Header)
  64648. }
  64649. return c.header_
  64650. }
  64651. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  64652. reqHeaders := make(http.Header)
  64653. for k, v := range c.header_ {
  64654. reqHeaders[k] = v
  64655. }
  64656. reqHeaders.Set("User-Agent", c.s.userAgent())
  64657. var body io.Reader = nil
  64658. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  64659. if err != nil {
  64660. return nil, err
  64661. }
  64662. reqHeaders.Set("Content-Type", "application/json")
  64663. c.urlParams_.Set("alt", alt)
  64664. c.urlParams_.Set("prettyPrint", "false")
  64665. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  64666. urls += "?" + c.urlParams_.Encode()
  64667. req, err := http.NewRequest("PATCH", urls, body)
  64668. if err != nil {
  64669. return nil, err
  64670. }
  64671. req.Header = reqHeaders
  64672. googleapi.Expand(req.URL, map[string]string{
  64673. "project": c.project,
  64674. "zone": c.zone,
  64675. "instanceGroupManager": c.instanceGroupManager,
  64676. })
  64677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64678. }
  64679. // Do executes the "compute.instanceGroupManagers.patch" call.
  64680. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64681. // status code is an error. Response headers are in either
  64682. // *Operation.ServerResponse.Header or (if a response was returned at
  64683. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64684. // to check whether the returned error was because
  64685. // http.StatusNotModified was returned.
  64686. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64687. gensupport.SetOptions(c.urlParams_, opts...)
  64688. res, err := c.doRequest("json")
  64689. if res != nil && res.StatusCode == http.StatusNotModified {
  64690. if res.Body != nil {
  64691. res.Body.Close()
  64692. }
  64693. return nil, &googleapi.Error{
  64694. Code: res.StatusCode,
  64695. Header: res.Header,
  64696. }
  64697. }
  64698. if err != nil {
  64699. return nil, err
  64700. }
  64701. defer googleapi.CloseBody(res)
  64702. if err := googleapi.CheckResponse(res); err != nil {
  64703. return nil, err
  64704. }
  64705. ret := &Operation{
  64706. ServerResponse: googleapi.ServerResponse{
  64707. Header: res.Header,
  64708. HTTPStatusCode: res.StatusCode,
  64709. },
  64710. }
  64711. target := &ret
  64712. if err := gensupport.DecodeResponse(target, res); err != nil {
  64713. return nil, err
  64714. }
  64715. return ret, nil
  64716. // {
  64717. // "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  64718. // "httpMethod": "PATCH",
  64719. // "id": "compute.instanceGroupManagers.patch",
  64720. // "parameterOrder": [
  64721. // "project",
  64722. // "zone",
  64723. // "instanceGroupManager"
  64724. // ],
  64725. // "parameters": {
  64726. // "instanceGroupManager": {
  64727. // "description": "The name of the instance group manager.",
  64728. // "location": "path",
  64729. // "required": true,
  64730. // "type": "string"
  64731. // },
  64732. // "project": {
  64733. // "description": "Project ID for this request.",
  64734. // "location": "path",
  64735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64736. // "required": true,
  64737. // "type": "string"
  64738. // },
  64739. // "requestId": {
  64740. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64741. // "location": "query",
  64742. // "type": "string"
  64743. // },
  64744. // "zone": {
  64745. // "description": "The name of the zone where you want to create the managed instance group.",
  64746. // "location": "path",
  64747. // "required": true,
  64748. // "type": "string"
  64749. // }
  64750. // },
  64751. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  64752. // "request": {
  64753. // "$ref": "InstanceGroupManager"
  64754. // },
  64755. // "response": {
  64756. // "$ref": "Operation"
  64757. // },
  64758. // "scopes": [
  64759. // "https://www.googleapis.com/auth/cloud-platform",
  64760. // "https://www.googleapis.com/auth/compute"
  64761. // ]
  64762. // }
  64763. }
  64764. // method id "compute.instanceGroupManagers.recreateInstances":
  64765. type InstanceGroupManagersRecreateInstancesCall struct {
  64766. s *Service
  64767. project string
  64768. zone string
  64769. instanceGroupManager string
  64770. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  64771. urlParams_ gensupport.URLParams
  64772. ctx_ context.Context
  64773. header_ http.Header
  64774. }
  64775. // RecreateInstances: Flags the specified instances in the managed
  64776. // instance group to be immediately recreated. The instances are deleted
  64777. // and recreated using the current instance template for the managed
  64778. // instance group. This operation is marked as DONE when the flag is set
  64779. // even if the instances have not yet been recreated. You must
  64780. // separately verify the status of the recreating action with the
  64781. // listmanagedinstances method.
  64782. //
  64783. // If the group is part of a backend service that has enabled connection
  64784. // draining, it can take up to 60 seconds after the connection draining
  64785. // duration has elapsed before the VM instance is removed or
  64786. // deleted.
  64787. //
  64788. // You can specify a maximum of 1000 instances with this method per
  64789. // request.
  64790. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  64791. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64792. c.project = project
  64793. c.zone = zone
  64794. c.instanceGroupManager = instanceGroupManager
  64795. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  64796. return c
  64797. }
  64798. // RequestId sets the optional parameter "requestId": An optional
  64799. // request ID to identify requests. Specify a unique request ID so that
  64800. // if you must retry your request, the server will know to ignore the
  64801. // request if it has already been completed.
  64802. //
  64803. // For example, consider a situation where you make an initial request
  64804. // and the request times out. If you make the request again with the
  64805. // same request ID, the server can check if original operation with the
  64806. // same request ID was received, and if so, will ignore the second
  64807. // request. This prevents clients from accidentally creating duplicate
  64808. // commitments.
  64809. //
  64810. // The request ID must be a valid UUID with the exception that zero UUID
  64811. // is not supported (00000000-0000-0000-0000-000000000000).
  64812. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  64813. c.urlParams_.Set("requestId", requestId)
  64814. return c
  64815. }
  64816. // Fields allows partial responses to be retrieved. See
  64817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64818. // for more information.
  64819. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  64820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64821. return c
  64822. }
  64823. // Context sets the context to be used in this call's Do method. Any
  64824. // pending HTTP request will be aborted if the provided context is
  64825. // canceled.
  64826. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  64827. c.ctx_ = ctx
  64828. return c
  64829. }
  64830. // Header returns an http.Header that can be modified by the caller to
  64831. // add HTTP headers to the request.
  64832. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  64833. if c.header_ == nil {
  64834. c.header_ = make(http.Header)
  64835. }
  64836. return c.header_
  64837. }
  64838. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  64839. reqHeaders := make(http.Header)
  64840. for k, v := range c.header_ {
  64841. reqHeaders[k] = v
  64842. }
  64843. reqHeaders.Set("User-Agent", c.s.userAgent())
  64844. var body io.Reader = nil
  64845. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  64846. if err != nil {
  64847. return nil, err
  64848. }
  64849. reqHeaders.Set("Content-Type", "application/json")
  64850. c.urlParams_.Set("alt", alt)
  64851. c.urlParams_.Set("prettyPrint", "false")
  64852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  64853. urls += "?" + c.urlParams_.Encode()
  64854. req, err := http.NewRequest("POST", urls, body)
  64855. if err != nil {
  64856. return nil, err
  64857. }
  64858. req.Header = reqHeaders
  64859. googleapi.Expand(req.URL, map[string]string{
  64860. "project": c.project,
  64861. "zone": c.zone,
  64862. "instanceGroupManager": c.instanceGroupManager,
  64863. })
  64864. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64865. }
  64866. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  64867. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64868. // status code is an error. Response headers are in either
  64869. // *Operation.ServerResponse.Header or (if a response was returned at
  64870. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64871. // to check whether the returned error was because
  64872. // http.StatusNotModified was returned.
  64873. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64874. gensupport.SetOptions(c.urlParams_, opts...)
  64875. res, err := c.doRequest("json")
  64876. if res != nil && res.StatusCode == http.StatusNotModified {
  64877. if res.Body != nil {
  64878. res.Body.Close()
  64879. }
  64880. return nil, &googleapi.Error{
  64881. Code: res.StatusCode,
  64882. Header: res.Header,
  64883. }
  64884. }
  64885. if err != nil {
  64886. return nil, err
  64887. }
  64888. defer googleapi.CloseBody(res)
  64889. if err := googleapi.CheckResponse(res); err != nil {
  64890. return nil, err
  64891. }
  64892. ret := &Operation{
  64893. ServerResponse: googleapi.ServerResponse{
  64894. Header: res.Header,
  64895. HTTPStatusCode: res.StatusCode,
  64896. },
  64897. }
  64898. target := &ret
  64899. if err := gensupport.DecodeResponse(target, res); err != nil {
  64900. return nil, err
  64901. }
  64902. return ret, nil
  64903. // {
  64904. // "description": "Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  64905. // "httpMethod": "POST",
  64906. // "id": "compute.instanceGroupManagers.recreateInstances",
  64907. // "parameterOrder": [
  64908. // "project",
  64909. // "zone",
  64910. // "instanceGroupManager"
  64911. // ],
  64912. // "parameters": {
  64913. // "instanceGroupManager": {
  64914. // "description": "The name of the managed instance group.",
  64915. // "location": "path",
  64916. // "required": true,
  64917. // "type": "string"
  64918. // },
  64919. // "project": {
  64920. // "description": "Project ID for this request.",
  64921. // "location": "path",
  64922. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64923. // "required": true,
  64924. // "type": "string"
  64925. // },
  64926. // "requestId": {
  64927. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64928. // "location": "query",
  64929. // "type": "string"
  64930. // },
  64931. // "zone": {
  64932. // "description": "The name of the zone where the managed instance group is located.",
  64933. // "location": "path",
  64934. // "required": true,
  64935. // "type": "string"
  64936. // }
  64937. // },
  64938. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  64939. // "request": {
  64940. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  64941. // },
  64942. // "response": {
  64943. // "$ref": "Operation"
  64944. // },
  64945. // "scopes": [
  64946. // "https://www.googleapis.com/auth/cloud-platform",
  64947. // "https://www.googleapis.com/auth/compute"
  64948. // ]
  64949. // }
  64950. }
  64951. // method id "compute.instanceGroupManagers.resize":
  64952. type InstanceGroupManagersResizeCall struct {
  64953. s *Service
  64954. project string
  64955. zone string
  64956. instanceGroupManager string
  64957. urlParams_ gensupport.URLParams
  64958. ctx_ context.Context
  64959. header_ http.Header
  64960. }
  64961. // Resize: Resizes the managed instance group. If you increase the size,
  64962. // the group creates new instances using the current instance template.
  64963. // If you decrease the size, the group deletes instances. The resize
  64964. // operation is marked DONE when the resize actions are scheduled even
  64965. // if the group has not yet added or deleted any instances. You must
  64966. // separately verify the status of the creating or deleting actions with
  64967. // the listmanagedinstances method.
  64968. //
  64969. // When resizing down, the instance group arbitrarily chooses the order
  64970. // in which VMs are deleted. The group takes into account some VM
  64971. // attributes when making the selection including:
  64972. //
  64973. // + The status of the VM instance. + The health of the VM instance. +
  64974. // The instance template version the VM is based on. + For regional
  64975. // managed instance groups, the location of the VM instance.
  64976. //
  64977. // This list is subject to change.
  64978. //
  64979. // If the group is part of a backend service that has enabled connection
  64980. // draining, it can take up to 60 seconds after the connection draining
  64981. // duration has elapsed before the VM instance is removed or deleted.
  64982. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  64983. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64984. c.project = project
  64985. c.zone = zone
  64986. c.instanceGroupManager = instanceGroupManager
  64987. c.urlParams_.Set("size", fmt.Sprint(size))
  64988. return c
  64989. }
  64990. // RequestId sets the optional parameter "requestId": An optional
  64991. // request ID to identify requests. Specify a unique request ID so that
  64992. // if you must retry your request, the server will know to ignore the
  64993. // request if it has already been completed.
  64994. //
  64995. // For example, consider a situation where you make an initial request
  64996. // and the request times out. If you make the request again with the
  64997. // same request ID, the server can check if original operation with the
  64998. // same request ID was received, and if so, will ignore the second
  64999. // request. This prevents clients from accidentally creating duplicate
  65000. // commitments.
  65001. //
  65002. // The request ID must be a valid UUID with the exception that zero UUID
  65003. // is not supported (00000000-0000-0000-0000-000000000000).
  65004. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  65005. c.urlParams_.Set("requestId", requestId)
  65006. return c
  65007. }
  65008. // Fields allows partial responses to be retrieved. See
  65009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65010. // for more information.
  65011. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  65012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65013. return c
  65014. }
  65015. // Context sets the context to be used in this call's Do method. Any
  65016. // pending HTTP request will be aborted if the provided context is
  65017. // canceled.
  65018. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  65019. c.ctx_ = ctx
  65020. return c
  65021. }
  65022. // Header returns an http.Header that can be modified by the caller to
  65023. // add HTTP headers to the request.
  65024. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  65025. if c.header_ == nil {
  65026. c.header_ = make(http.Header)
  65027. }
  65028. return c.header_
  65029. }
  65030. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  65031. reqHeaders := make(http.Header)
  65032. for k, v := range c.header_ {
  65033. reqHeaders[k] = v
  65034. }
  65035. reqHeaders.Set("User-Agent", c.s.userAgent())
  65036. var body io.Reader = nil
  65037. c.urlParams_.Set("alt", alt)
  65038. c.urlParams_.Set("prettyPrint", "false")
  65039. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  65040. urls += "?" + c.urlParams_.Encode()
  65041. req, err := http.NewRequest("POST", urls, body)
  65042. if err != nil {
  65043. return nil, err
  65044. }
  65045. req.Header = reqHeaders
  65046. googleapi.Expand(req.URL, map[string]string{
  65047. "project": c.project,
  65048. "zone": c.zone,
  65049. "instanceGroupManager": c.instanceGroupManager,
  65050. })
  65051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65052. }
  65053. // Do executes the "compute.instanceGroupManagers.resize" call.
  65054. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65055. // status code is an error. Response headers are in either
  65056. // *Operation.ServerResponse.Header or (if a response was returned at
  65057. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65058. // to check whether the returned error was because
  65059. // http.StatusNotModified was returned.
  65060. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65061. gensupport.SetOptions(c.urlParams_, opts...)
  65062. res, err := c.doRequest("json")
  65063. if res != nil && res.StatusCode == http.StatusNotModified {
  65064. if res.Body != nil {
  65065. res.Body.Close()
  65066. }
  65067. return nil, &googleapi.Error{
  65068. Code: res.StatusCode,
  65069. Header: res.Header,
  65070. }
  65071. }
  65072. if err != nil {
  65073. return nil, err
  65074. }
  65075. defer googleapi.CloseBody(res)
  65076. if err := googleapi.CheckResponse(res); err != nil {
  65077. return nil, err
  65078. }
  65079. ret := &Operation{
  65080. ServerResponse: googleapi.ServerResponse{
  65081. Header: res.Header,
  65082. HTTPStatusCode: res.StatusCode,
  65083. },
  65084. }
  65085. target := &ret
  65086. if err := gensupport.DecodeResponse(target, res); err != nil {
  65087. return nil, err
  65088. }
  65089. return ret, nil
  65090. // {
  65091. // "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.\n\nWhen resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including:\n\n+ The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance.\n\nThis list is subject to change.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  65092. // "httpMethod": "POST",
  65093. // "id": "compute.instanceGroupManagers.resize",
  65094. // "parameterOrder": [
  65095. // "project",
  65096. // "zone",
  65097. // "instanceGroupManager",
  65098. // "size"
  65099. // ],
  65100. // "parameters": {
  65101. // "instanceGroupManager": {
  65102. // "description": "The name of the managed instance group.",
  65103. // "location": "path",
  65104. // "required": true,
  65105. // "type": "string"
  65106. // },
  65107. // "project": {
  65108. // "description": "Project ID for this request.",
  65109. // "location": "path",
  65110. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65111. // "required": true,
  65112. // "type": "string"
  65113. // },
  65114. // "requestId": {
  65115. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65116. // "location": "query",
  65117. // "type": "string"
  65118. // },
  65119. // "size": {
  65120. // "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.",
  65121. // "format": "int32",
  65122. // "location": "query",
  65123. // "required": true,
  65124. // "type": "integer"
  65125. // },
  65126. // "zone": {
  65127. // "description": "The name of the zone where the managed instance group is located.",
  65128. // "location": "path",
  65129. // "required": true,
  65130. // "type": "string"
  65131. // }
  65132. // },
  65133. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  65134. // "response": {
  65135. // "$ref": "Operation"
  65136. // },
  65137. // "scopes": [
  65138. // "https://www.googleapis.com/auth/cloud-platform",
  65139. // "https://www.googleapis.com/auth/compute"
  65140. // ]
  65141. // }
  65142. }
  65143. // method id "compute.instanceGroupManagers.resizeAdvanced":
  65144. type InstanceGroupManagersResizeAdvancedCall struct {
  65145. s *Service
  65146. project string
  65147. zone string
  65148. instanceGroupManager string
  65149. instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest
  65150. urlParams_ gensupport.URLParams
  65151. ctx_ context.Context
  65152. header_ http.Header
  65153. }
  65154. // ResizeAdvanced: Resizes the managed instance group with advanced
  65155. // configuration options like disabling creation retries. This is an
  65156. // extended version of the resize method.
  65157. //
  65158. // If you increase the size of the instance group, the group creates new
  65159. // instances using the current instance template. If you decrease the
  65160. // size, the group deletes instances. The resize operation is marked
  65161. // DONE when the resize actions are scheduled even if the group has not
  65162. // yet added or deleted any instances. You must separately verify the
  65163. // status of the creating, creatingWithoutRetries, or deleting actions
  65164. // with the get or listmanagedinstances method.
  65165. //
  65166. // If the group is part of a backend service that has enabled connection
  65167. // draining, it can take up to 60 seconds after the connection draining
  65168. // duration has elapsed before the VM instance is removed or deleted.
  65169. func (r *InstanceGroupManagersService) ResizeAdvanced(project string, zone string, instanceGroupManager string, instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest) *InstanceGroupManagersResizeAdvancedCall {
  65170. c := &InstanceGroupManagersResizeAdvancedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65171. c.project = project
  65172. c.zone = zone
  65173. c.instanceGroupManager = instanceGroupManager
  65174. c.instancegroupmanagersresizeadvancedrequest = instancegroupmanagersresizeadvancedrequest
  65175. return c
  65176. }
  65177. // RequestId sets the optional parameter "requestId": An optional
  65178. // request ID to identify requests. Specify a unique request ID so that
  65179. // if you must retry your request, the server will know to ignore the
  65180. // request if it has already been completed.
  65181. //
  65182. // For example, consider a situation where you make an initial request
  65183. // and the request times out. If you make the request again with the
  65184. // same request ID, the server can check if original operation with the
  65185. // same request ID was received, and if so, will ignore the second
  65186. // request. This prevents clients from accidentally creating duplicate
  65187. // commitments.
  65188. //
  65189. // The request ID must be a valid UUID with the exception that zero UUID
  65190. // is not supported (00000000-0000-0000-0000-000000000000).
  65191. func (c *InstanceGroupManagersResizeAdvancedCall) RequestId(requestId string) *InstanceGroupManagersResizeAdvancedCall {
  65192. c.urlParams_.Set("requestId", requestId)
  65193. return c
  65194. }
  65195. // Fields allows partial responses to be retrieved. See
  65196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65197. // for more information.
  65198. func (c *InstanceGroupManagersResizeAdvancedCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeAdvancedCall {
  65199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65200. return c
  65201. }
  65202. // Context sets the context to be used in this call's Do method. Any
  65203. // pending HTTP request will be aborted if the provided context is
  65204. // canceled.
  65205. func (c *InstanceGroupManagersResizeAdvancedCall) Context(ctx context.Context) *InstanceGroupManagersResizeAdvancedCall {
  65206. c.ctx_ = ctx
  65207. return c
  65208. }
  65209. // Header returns an http.Header that can be modified by the caller to
  65210. // add HTTP headers to the request.
  65211. func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header {
  65212. if c.header_ == nil {
  65213. c.header_ = make(http.Header)
  65214. }
  65215. return c.header_
  65216. }
  65217. func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) {
  65218. reqHeaders := make(http.Header)
  65219. for k, v := range c.header_ {
  65220. reqHeaders[k] = v
  65221. }
  65222. reqHeaders.Set("User-Agent", c.s.userAgent())
  65223. var body io.Reader = nil
  65224. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest)
  65225. if err != nil {
  65226. return nil, err
  65227. }
  65228. reqHeaders.Set("Content-Type", "application/json")
  65229. c.urlParams_.Set("alt", alt)
  65230. c.urlParams_.Set("prettyPrint", "false")
  65231. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced")
  65232. urls += "?" + c.urlParams_.Encode()
  65233. req, err := http.NewRequest("POST", urls, body)
  65234. if err != nil {
  65235. return nil, err
  65236. }
  65237. req.Header = reqHeaders
  65238. googleapi.Expand(req.URL, map[string]string{
  65239. "project": c.project,
  65240. "zone": c.zone,
  65241. "instanceGroupManager": c.instanceGroupManager,
  65242. })
  65243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65244. }
  65245. // Do executes the "compute.instanceGroupManagers.resizeAdvanced" call.
  65246. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65247. // status code is an error. Response headers are in either
  65248. // *Operation.ServerResponse.Header or (if a response was returned at
  65249. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65250. // to check whether the returned error was because
  65251. // http.StatusNotModified was returned.
  65252. func (c *InstanceGroupManagersResizeAdvancedCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65253. gensupport.SetOptions(c.urlParams_, opts...)
  65254. res, err := c.doRequest("json")
  65255. if res != nil && res.StatusCode == http.StatusNotModified {
  65256. if res.Body != nil {
  65257. res.Body.Close()
  65258. }
  65259. return nil, &googleapi.Error{
  65260. Code: res.StatusCode,
  65261. Header: res.Header,
  65262. }
  65263. }
  65264. if err != nil {
  65265. return nil, err
  65266. }
  65267. defer googleapi.CloseBody(res)
  65268. if err := googleapi.CheckResponse(res); err != nil {
  65269. return nil, err
  65270. }
  65271. ret := &Operation{
  65272. ServerResponse: googleapi.ServerResponse{
  65273. Header: res.Header,
  65274. HTTPStatusCode: res.StatusCode,
  65275. },
  65276. }
  65277. target := &ret
  65278. if err := gensupport.DecodeResponse(target, res); err != nil {
  65279. return nil, err
  65280. }
  65281. return ret, nil
  65282. // {
  65283. // "description": "Resizes the managed instance group with advanced configuration options like disabling creation retries. This is an extended version of the resize method.\n\nIf you increase the size of the instance group, 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, creatingWithoutRetries, or deleting actions with the get or listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  65284. // "httpMethod": "POST",
  65285. // "id": "compute.instanceGroupManagers.resizeAdvanced",
  65286. // "parameterOrder": [
  65287. // "project",
  65288. // "zone",
  65289. // "instanceGroupManager"
  65290. // ],
  65291. // "parameters": {
  65292. // "instanceGroupManager": {
  65293. // "description": "The name of the managed instance group.",
  65294. // "location": "path",
  65295. // "required": true,
  65296. // "type": "string"
  65297. // },
  65298. // "project": {
  65299. // "description": "Project ID for this request.",
  65300. // "location": "path",
  65301. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65302. // "required": true,
  65303. // "type": "string"
  65304. // },
  65305. // "requestId": {
  65306. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65307. // "location": "query",
  65308. // "type": "string"
  65309. // },
  65310. // "zone": {
  65311. // "description": "The name of the zone where the managed instance group is located.",
  65312. // "location": "path",
  65313. // "required": true,
  65314. // "type": "string"
  65315. // }
  65316. // },
  65317. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced",
  65318. // "request": {
  65319. // "$ref": "InstanceGroupManagersResizeAdvancedRequest"
  65320. // },
  65321. // "response": {
  65322. // "$ref": "Operation"
  65323. // },
  65324. // "scopes": [
  65325. // "https://www.googleapis.com/auth/cloud-platform",
  65326. // "https://www.googleapis.com/auth/compute"
  65327. // ]
  65328. // }
  65329. }
  65330. // method id "compute.instanceGroupManagers.setAutoHealingPolicies":
  65331. type InstanceGroupManagersSetAutoHealingPoliciesCall struct {
  65332. s *Service
  65333. project string
  65334. zone string
  65335. instanceGroupManager string
  65336. instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest
  65337. urlParams_ gensupport.URLParams
  65338. ctx_ context.Context
  65339. header_ http.Header
  65340. }
  65341. // SetAutoHealingPolicies: Modifies the autohealing policies.
  65342. // [Deprecated] This method is deprecated. Please use Patch instead.
  65343. func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  65344. c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65345. c.project = project
  65346. c.zone = zone
  65347. c.instanceGroupManager = instanceGroupManager
  65348. c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest
  65349. return c
  65350. }
  65351. // RequestId sets the optional parameter "requestId": An optional
  65352. // request ID to identify requests. Specify a unique request ID so that
  65353. // if you must retry your request, the server will know to ignore the
  65354. // request if it has already been completed.
  65355. //
  65356. // For example, consider a situation where you make an initial request
  65357. // and the request times out. If you make the request again with the
  65358. // same request ID, the server can check if original operation with the
  65359. // same request ID was received, and if so, will ignore the second
  65360. // request. This prevents clients from accidentally creating duplicate
  65361. // commitments.
  65362. //
  65363. // The request ID must be a valid UUID with the exception that zero UUID
  65364. // is not supported (00000000-0000-0000-0000-000000000000).
  65365. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  65366. c.urlParams_.Set("requestId", requestId)
  65367. return c
  65368. }
  65369. // Fields allows partial responses to be retrieved. See
  65370. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65371. // for more information.
  65372. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  65373. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65374. return c
  65375. }
  65376. // Context sets the context to be used in this call's Do method. Any
  65377. // pending HTTP request will be aborted if the provided context is
  65378. // canceled.
  65379. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  65380. c.ctx_ = ctx
  65381. return c
  65382. }
  65383. // Header returns an http.Header that can be modified by the caller to
  65384. // add HTTP headers to the request.
  65385. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  65386. if c.header_ == nil {
  65387. c.header_ = make(http.Header)
  65388. }
  65389. return c.header_
  65390. }
  65391. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  65392. reqHeaders := make(http.Header)
  65393. for k, v := range c.header_ {
  65394. reqHeaders[k] = v
  65395. }
  65396. reqHeaders.Set("User-Agent", c.s.userAgent())
  65397. var body io.Reader = nil
  65398. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest)
  65399. if err != nil {
  65400. return nil, err
  65401. }
  65402. reqHeaders.Set("Content-Type", "application/json")
  65403. c.urlParams_.Set("alt", alt)
  65404. c.urlParams_.Set("prettyPrint", "false")
  65405. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  65406. urls += "?" + c.urlParams_.Encode()
  65407. req, err := http.NewRequest("POST", urls, body)
  65408. if err != nil {
  65409. return nil, err
  65410. }
  65411. req.Header = reqHeaders
  65412. googleapi.Expand(req.URL, map[string]string{
  65413. "project": c.project,
  65414. "zone": c.zone,
  65415. "instanceGroupManager": c.instanceGroupManager,
  65416. })
  65417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65418. }
  65419. // Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call.
  65420. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65421. // status code is an error. Response headers are in either
  65422. // *Operation.ServerResponse.Header or (if a response was returned at
  65423. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65424. // to check whether the returned error was because
  65425. // http.StatusNotModified was returned.
  65426. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65427. gensupport.SetOptions(c.urlParams_, opts...)
  65428. res, err := c.doRequest("json")
  65429. if res != nil && res.StatusCode == http.StatusNotModified {
  65430. if res.Body != nil {
  65431. res.Body.Close()
  65432. }
  65433. return nil, &googleapi.Error{
  65434. Code: res.StatusCode,
  65435. Header: res.Header,
  65436. }
  65437. }
  65438. if err != nil {
  65439. return nil, err
  65440. }
  65441. defer googleapi.CloseBody(res)
  65442. if err := googleapi.CheckResponse(res); err != nil {
  65443. return nil, err
  65444. }
  65445. ret := &Operation{
  65446. ServerResponse: googleapi.ServerResponse{
  65447. Header: res.Header,
  65448. HTTPStatusCode: res.StatusCode,
  65449. },
  65450. }
  65451. target := &ret
  65452. if err := gensupport.DecodeResponse(target, res); err != nil {
  65453. return nil, err
  65454. }
  65455. return ret, nil
  65456. // {
  65457. // "description": "Modifies the autohealing policies. [Deprecated] This method is deprecated. Please use Patch instead.",
  65458. // "httpMethod": "POST",
  65459. // "id": "compute.instanceGroupManagers.setAutoHealingPolicies",
  65460. // "parameterOrder": [
  65461. // "project",
  65462. // "zone",
  65463. // "instanceGroupManager"
  65464. // ],
  65465. // "parameters": {
  65466. // "instanceGroupManager": {
  65467. // "description": "The name of the instance group manager.",
  65468. // "location": "path",
  65469. // "required": true,
  65470. // "type": "string"
  65471. // },
  65472. // "project": {
  65473. // "description": "Project ID for this request.",
  65474. // "location": "path",
  65475. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65476. // "required": true,
  65477. // "type": "string"
  65478. // },
  65479. // "requestId": {
  65480. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65481. // "location": "query",
  65482. // "type": "string"
  65483. // },
  65484. // "zone": {
  65485. // "description": "The name of the zone where the managed instance group is located.",
  65486. // "location": "path",
  65487. // "required": true,
  65488. // "type": "string"
  65489. // }
  65490. // },
  65491. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  65492. // "request": {
  65493. // "$ref": "InstanceGroupManagersSetAutoHealingRequest"
  65494. // },
  65495. // "response": {
  65496. // "$ref": "Operation"
  65497. // },
  65498. // "scopes": [
  65499. // "https://www.googleapis.com/auth/cloud-platform",
  65500. // "https://www.googleapis.com/auth/compute"
  65501. // ]
  65502. // }
  65503. }
  65504. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  65505. type InstanceGroupManagersSetInstanceTemplateCall struct {
  65506. s *Service
  65507. project string
  65508. zone string
  65509. instanceGroupManager string
  65510. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  65511. urlParams_ gensupport.URLParams
  65512. ctx_ context.Context
  65513. header_ http.Header
  65514. }
  65515. // SetInstanceTemplate: Specifies the instance template to use when
  65516. // creating new instances in this group. The templates for existing
  65517. // instances in the group do not change unless you recreate them.
  65518. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  65519. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65520. c.project = project
  65521. c.zone = zone
  65522. c.instanceGroupManager = instanceGroupManager
  65523. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  65524. return c
  65525. }
  65526. // RequestId sets the optional parameter "requestId": An optional
  65527. // request ID to identify requests. Specify a unique request ID so that
  65528. // if you must retry your request, the server will know to ignore the
  65529. // request if it has already been completed.
  65530. //
  65531. // For example, consider a situation where you make an initial request
  65532. // and the request times out. If you make the request again with the
  65533. // same request ID, the server can check if original operation with the
  65534. // same request ID was received, and if so, will ignore the second
  65535. // request. This prevents clients from accidentally creating duplicate
  65536. // commitments.
  65537. //
  65538. // The request ID must be a valid UUID with the exception that zero UUID
  65539. // is not supported (00000000-0000-0000-0000-000000000000).
  65540. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  65541. c.urlParams_.Set("requestId", requestId)
  65542. return c
  65543. }
  65544. // Fields allows partial responses to be retrieved. See
  65545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65546. // for more information.
  65547. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  65548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65549. return c
  65550. }
  65551. // Context sets the context to be used in this call's Do method. Any
  65552. // pending HTTP request will be aborted if the provided context is
  65553. // canceled.
  65554. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  65555. c.ctx_ = ctx
  65556. return c
  65557. }
  65558. // Header returns an http.Header that can be modified by the caller to
  65559. // add HTTP headers to the request.
  65560. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  65561. if c.header_ == nil {
  65562. c.header_ = make(http.Header)
  65563. }
  65564. return c.header_
  65565. }
  65566. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  65567. reqHeaders := make(http.Header)
  65568. for k, v := range c.header_ {
  65569. reqHeaders[k] = v
  65570. }
  65571. reqHeaders.Set("User-Agent", c.s.userAgent())
  65572. var body io.Reader = nil
  65573. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  65574. if err != nil {
  65575. return nil, err
  65576. }
  65577. reqHeaders.Set("Content-Type", "application/json")
  65578. c.urlParams_.Set("alt", alt)
  65579. c.urlParams_.Set("prettyPrint", "false")
  65580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  65581. urls += "?" + c.urlParams_.Encode()
  65582. req, err := http.NewRequest("POST", urls, body)
  65583. if err != nil {
  65584. return nil, err
  65585. }
  65586. req.Header = reqHeaders
  65587. googleapi.Expand(req.URL, map[string]string{
  65588. "project": c.project,
  65589. "zone": c.zone,
  65590. "instanceGroupManager": c.instanceGroupManager,
  65591. })
  65592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65593. }
  65594. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  65595. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65596. // status code is an error. Response headers are in either
  65597. // *Operation.ServerResponse.Header or (if a response was returned at
  65598. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65599. // to check whether the returned error was because
  65600. // http.StatusNotModified was returned.
  65601. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65602. gensupport.SetOptions(c.urlParams_, opts...)
  65603. res, err := c.doRequest("json")
  65604. if res != nil && res.StatusCode == http.StatusNotModified {
  65605. if res.Body != nil {
  65606. res.Body.Close()
  65607. }
  65608. return nil, &googleapi.Error{
  65609. Code: res.StatusCode,
  65610. Header: res.Header,
  65611. }
  65612. }
  65613. if err != nil {
  65614. return nil, err
  65615. }
  65616. defer googleapi.CloseBody(res)
  65617. if err := googleapi.CheckResponse(res); err != nil {
  65618. return nil, err
  65619. }
  65620. ret := &Operation{
  65621. ServerResponse: googleapi.ServerResponse{
  65622. Header: res.Header,
  65623. HTTPStatusCode: res.StatusCode,
  65624. },
  65625. }
  65626. target := &ret
  65627. if err := gensupport.DecodeResponse(target, res); err != nil {
  65628. return nil, err
  65629. }
  65630. return ret, nil
  65631. // {
  65632. // "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.",
  65633. // "httpMethod": "POST",
  65634. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  65635. // "parameterOrder": [
  65636. // "project",
  65637. // "zone",
  65638. // "instanceGroupManager"
  65639. // ],
  65640. // "parameters": {
  65641. // "instanceGroupManager": {
  65642. // "description": "The name of the managed instance group.",
  65643. // "location": "path",
  65644. // "required": true,
  65645. // "type": "string"
  65646. // },
  65647. // "project": {
  65648. // "description": "Project ID for this request.",
  65649. // "location": "path",
  65650. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65651. // "required": true,
  65652. // "type": "string"
  65653. // },
  65654. // "requestId": {
  65655. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65656. // "location": "query",
  65657. // "type": "string"
  65658. // },
  65659. // "zone": {
  65660. // "description": "The name of the zone where the managed instance group is located.",
  65661. // "location": "path",
  65662. // "required": true,
  65663. // "type": "string"
  65664. // }
  65665. // },
  65666. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  65667. // "request": {
  65668. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  65669. // },
  65670. // "response": {
  65671. // "$ref": "Operation"
  65672. // },
  65673. // "scopes": [
  65674. // "https://www.googleapis.com/auth/cloud-platform",
  65675. // "https://www.googleapis.com/auth/compute"
  65676. // ]
  65677. // }
  65678. }
  65679. // method id "compute.instanceGroupManagers.setTargetPools":
  65680. type InstanceGroupManagersSetTargetPoolsCall struct {
  65681. s *Service
  65682. project string
  65683. zone string
  65684. instanceGroupManager string
  65685. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  65686. urlParams_ gensupport.URLParams
  65687. ctx_ context.Context
  65688. header_ http.Header
  65689. }
  65690. // SetTargetPools: Modifies the target pools to which all instances in
  65691. // this managed instance group are assigned. The target pools
  65692. // automatically apply to all of the instances in the managed instance
  65693. // group. This operation is marked DONE when you make the request even
  65694. // if the instances have not yet been added to their target pools. The
  65695. // change might take some time to apply to all of the instances in the
  65696. // group depending on the size of the group.
  65697. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  65698. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65699. c.project = project
  65700. c.zone = zone
  65701. c.instanceGroupManager = instanceGroupManager
  65702. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  65703. return c
  65704. }
  65705. // RequestId sets the optional parameter "requestId": An optional
  65706. // request ID to identify requests. Specify a unique request ID so that
  65707. // if you must retry your request, the server will know to ignore the
  65708. // request if it has already been completed.
  65709. //
  65710. // For example, consider a situation where you make an initial request
  65711. // and the request times out. If you make the request again with the
  65712. // same request ID, the server can check if original operation with the
  65713. // same request ID was received, and if so, will ignore the second
  65714. // request. This prevents clients from accidentally creating duplicate
  65715. // commitments.
  65716. //
  65717. // The request ID must be a valid UUID with the exception that zero UUID
  65718. // is not supported (00000000-0000-0000-0000-000000000000).
  65719. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  65720. c.urlParams_.Set("requestId", requestId)
  65721. return c
  65722. }
  65723. // Fields allows partial responses to be retrieved. See
  65724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65725. // for more information.
  65726. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  65727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65728. return c
  65729. }
  65730. // Context sets the context to be used in this call's Do method. Any
  65731. // pending HTTP request will be aborted if the provided context is
  65732. // canceled.
  65733. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  65734. c.ctx_ = ctx
  65735. return c
  65736. }
  65737. // Header returns an http.Header that can be modified by the caller to
  65738. // add HTTP headers to the request.
  65739. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  65740. if c.header_ == nil {
  65741. c.header_ = make(http.Header)
  65742. }
  65743. return c.header_
  65744. }
  65745. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  65746. reqHeaders := make(http.Header)
  65747. for k, v := range c.header_ {
  65748. reqHeaders[k] = v
  65749. }
  65750. reqHeaders.Set("User-Agent", c.s.userAgent())
  65751. var body io.Reader = nil
  65752. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  65753. if err != nil {
  65754. return nil, err
  65755. }
  65756. reqHeaders.Set("Content-Type", "application/json")
  65757. c.urlParams_.Set("alt", alt)
  65758. c.urlParams_.Set("prettyPrint", "false")
  65759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  65760. urls += "?" + c.urlParams_.Encode()
  65761. req, err := http.NewRequest("POST", urls, body)
  65762. if err != nil {
  65763. return nil, err
  65764. }
  65765. req.Header = reqHeaders
  65766. googleapi.Expand(req.URL, map[string]string{
  65767. "project": c.project,
  65768. "zone": c.zone,
  65769. "instanceGroupManager": c.instanceGroupManager,
  65770. })
  65771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65772. }
  65773. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  65774. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65775. // status code is an error. Response headers are in either
  65776. // *Operation.ServerResponse.Header or (if a response was returned at
  65777. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65778. // to check whether the returned error was because
  65779. // http.StatusNotModified was returned.
  65780. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65781. gensupport.SetOptions(c.urlParams_, opts...)
  65782. res, err := c.doRequest("json")
  65783. if res != nil && res.StatusCode == http.StatusNotModified {
  65784. if res.Body != nil {
  65785. res.Body.Close()
  65786. }
  65787. return nil, &googleapi.Error{
  65788. Code: res.StatusCode,
  65789. Header: res.Header,
  65790. }
  65791. }
  65792. if err != nil {
  65793. return nil, err
  65794. }
  65795. defer googleapi.CloseBody(res)
  65796. if err := googleapi.CheckResponse(res); err != nil {
  65797. return nil, err
  65798. }
  65799. ret := &Operation{
  65800. ServerResponse: googleapi.ServerResponse{
  65801. Header: res.Header,
  65802. HTTPStatusCode: res.StatusCode,
  65803. },
  65804. }
  65805. target := &ret
  65806. if err := gensupport.DecodeResponse(target, res); err != nil {
  65807. return nil, err
  65808. }
  65809. return ret, nil
  65810. // {
  65811. // "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.",
  65812. // "httpMethod": "POST",
  65813. // "id": "compute.instanceGroupManagers.setTargetPools",
  65814. // "parameterOrder": [
  65815. // "project",
  65816. // "zone",
  65817. // "instanceGroupManager"
  65818. // ],
  65819. // "parameters": {
  65820. // "instanceGroupManager": {
  65821. // "description": "The name of the managed instance group.",
  65822. // "location": "path",
  65823. // "required": true,
  65824. // "type": "string"
  65825. // },
  65826. // "project": {
  65827. // "description": "Project ID for this request.",
  65828. // "location": "path",
  65829. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65830. // "required": true,
  65831. // "type": "string"
  65832. // },
  65833. // "requestId": {
  65834. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65835. // "location": "query",
  65836. // "type": "string"
  65837. // },
  65838. // "zone": {
  65839. // "description": "The name of the zone where the managed instance group is located.",
  65840. // "location": "path",
  65841. // "required": true,
  65842. // "type": "string"
  65843. // }
  65844. // },
  65845. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  65846. // "request": {
  65847. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  65848. // },
  65849. // "response": {
  65850. // "$ref": "Operation"
  65851. // },
  65852. // "scopes": [
  65853. // "https://www.googleapis.com/auth/cloud-platform",
  65854. // "https://www.googleapis.com/auth/compute"
  65855. // ]
  65856. // }
  65857. }
  65858. // method id "compute.instanceGroupManagers.testIamPermissions":
  65859. type InstanceGroupManagersTestIamPermissionsCall struct {
  65860. s *Service
  65861. project string
  65862. zone string
  65863. resource string
  65864. testpermissionsrequest *TestPermissionsRequest
  65865. urlParams_ gensupport.URLParams
  65866. ctx_ context.Context
  65867. header_ http.Header
  65868. }
  65869. // TestIamPermissions: Returns permissions that a caller has on the
  65870. // specified resource.
  65871. func (r *InstanceGroupManagersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupManagersTestIamPermissionsCall {
  65872. c := &InstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65873. c.project = project
  65874. c.zone = zone
  65875. c.resource = resource
  65876. c.testpermissionsrequest = testpermissionsrequest
  65877. return c
  65878. }
  65879. // Fields allows partial responses to be retrieved. See
  65880. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65881. // for more information.
  65882. func (c *InstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersTestIamPermissionsCall {
  65883. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65884. return c
  65885. }
  65886. // Context sets the context to be used in this call's Do method. Any
  65887. // pending HTTP request will be aborted if the provided context is
  65888. // canceled.
  65889. func (c *InstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupManagersTestIamPermissionsCall {
  65890. c.ctx_ = ctx
  65891. return c
  65892. }
  65893. // Header returns an http.Header that can be modified by the caller to
  65894. // add HTTP headers to the request.
  65895. func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  65896. if c.header_ == nil {
  65897. c.header_ = make(http.Header)
  65898. }
  65899. return c.header_
  65900. }
  65901. func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  65902. reqHeaders := make(http.Header)
  65903. for k, v := range c.header_ {
  65904. reqHeaders[k] = v
  65905. }
  65906. reqHeaders.Set("User-Agent", c.s.userAgent())
  65907. var body io.Reader = nil
  65908. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  65909. if err != nil {
  65910. return nil, err
  65911. }
  65912. reqHeaders.Set("Content-Type", "application/json")
  65913. c.urlParams_.Set("alt", alt)
  65914. c.urlParams_.Set("prettyPrint", "false")
  65915. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions")
  65916. urls += "?" + c.urlParams_.Encode()
  65917. req, err := http.NewRequest("POST", urls, body)
  65918. if err != nil {
  65919. return nil, err
  65920. }
  65921. req.Header = reqHeaders
  65922. googleapi.Expand(req.URL, map[string]string{
  65923. "project": c.project,
  65924. "zone": c.zone,
  65925. "resource": c.resource,
  65926. })
  65927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65928. }
  65929. // Do executes the "compute.instanceGroupManagers.testIamPermissions" call.
  65930. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  65931. // non-2xx status code is an error. Response headers are in either
  65932. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  65933. // returned at all) in error.(*googleapi.Error).Header. Use
  65934. // googleapi.IsNotModified to check whether the returned error was
  65935. // because http.StatusNotModified was returned.
  65936. func (c *InstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  65937. gensupport.SetOptions(c.urlParams_, opts...)
  65938. res, err := c.doRequest("json")
  65939. if res != nil && res.StatusCode == http.StatusNotModified {
  65940. if res.Body != nil {
  65941. res.Body.Close()
  65942. }
  65943. return nil, &googleapi.Error{
  65944. Code: res.StatusCode,
  65945. Header: res.Header,
  65946. }
  65947. }
  65948. if err != nil {
  65949. return nil, err
  65950. }
  65951. defer googleapi.CloseBody(res)
  65952. if err := googleapi.CheckResponse(res); err != nil {
  65953. return nil, err
  65954. }
  65955. ret := &TestPermissionsResponse{
  65956. ServerResponse: googleapi.ServerResponse{
  65957. Header: res.Header,
  65958. HTTPStatusCode: res.StatusCode,
  65959. },
  65960. }
  65961. target := &ret
  65962. if err := gensupport.DecodeResponse(target, res); err != nil {
  65963. return nil, err
  65964. }
  65965. return ret, nil
  65966. // {
  65967. // "description": "Returns permissions that a caller has on the specified resource.",
  65968. // "httpMethod": "POST",
  65969. // "id": "compute.instanceGroupManagers.testIamPermissions",
  65970. // "parameterOrder": [
  65971. // "project",
  65972. // "zone",
  65973. // "resource"
  65974. // ],
  65975. // "parameters": {
  65976. // "project": {
  65977. // "description": "Project ID for this request.",
  65978. // "location": "path",
  65979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65980. // "required": true,
  65981. // "type": "string"
  65982. // },
  65983. // "resource": {
  65984. // "description": "Name or id of the resource for this request.",
  65985. // "location": "path",
  65986. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65987. // "required": true,
  65988. // "type": "string"
  65989. // },
  65990. // "zone": {
  65991. // "description": "The name of the zone for this request.",
  65992. // "location": "path",
  65993. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65994. // "required": true,
  65995. // "type": "string"
  65996. // }
  65997. // },
  65998. // "path": "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions",
  65999. // "request": {
  66000. // "$ref": "TestPermissionsRequest"
  66001. // },
  66002. // "response": {
  66003. // "$ref": "TestPermissionsResponse"
  66004. // },
  66005. // "scopes": [
  66006. // "https://www.googleapis.com/auth/cloud-platform",
  66007. // "https://www.googleapis.com/auth/compute",
  66008. // "https://www.googleapis.com/auth/compute.readonly"
  66009. // ]
  66010. // }
  66011. }
  66012. // method id "compute.instanceGroupManagers.update":
  66013. type InstanceGroupManagersUpdateCall struct {
  66014. s *Service
  66015. project string
  66016. zone string
  66017. instanceGroupManager string
  66018. instancegroupmanager *InstanceGroupManager
  66019. urlParams_ gensupport.URLParams
  66020. ctx_ context.Context
  66021. header_ http.Header
  66022. }
  66023. // Update: Updates a managed instance group using the information that
  66024. // you specify in the request. This operation is marked as DONE when the
  66025. // group is updated even if the instances in the group have not yet been
  66026. // updated. You must separately verify the status of the individual
  66027. // instances with the listManagedInstances method.
  66028. func (r *InstanceGroupManagersService) Update(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersUpdateCall {
  66029. c := &InstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66030. c.project = project
  66031. c.zone = zone
  66032. c.instanceGroupManager = instanceGroupManager
  66033. c.instancegroupmanager = instancegroupmanager
  66034. return c
  66035. }
  66036. // RequestId sets the optional parameter "requestId": An optional
  66037. // request ID to identify requests. Specify a unique request ID so that
  66038. // if you must retry your request, the server will know to ignore the
  66039. // request if it has already been completed.
  66040. //
  66041. // For example, consider a situation where you make an initial request
  66042. // and the request times out. If you make the request again with the
  66043. // same request ID, the server can check if original operation with the
  66044. // same request ID was received, and if so, will ignore the second
  66045. // request. This prevents clients from accidentally creating duplicate
  66046. // commitments.
  66047. //
  66048. // The request ID must be a valid UUID with the exception that zero UUID
  66049. // is not supported (00000000-0000-0000-0000-000000000000).
  66050. func (c *InstanceGroupManagersUpdateCall) RequestId(requestId string) *InstanceGroupManagersUpdateCall {
  66051. c.urlParams_.Set("requestId", requestId)
  66052. return c
  66053. }
  66054. // Fields allows partial responses to be retrieved. See
  66055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66056. // for more information.
  66057. func (c *InstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdateCall {
  66058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66059. return c
  66060. }
  66061. // Context sets the context to be used in this call's Do method. Any
  66062. // pending HTTP request will be aborted if the provided context is
  66063. // canceled.
  66064. func (c *InstanceGroupManagersUpdateCall) Context(ctx context.Context) *InstanceGroupManagersUpdateCall {
  66065. c.ctx_ = ctx
  66066. return c
  66067. }
  66068. // Header returns an http.Header that can be modified by the caller to
  66069. // add HTTP headers to the request.
  66070. func (c *InstanceGroupManagersUpdateCall) Header() http.Header {
  66071. if c.header_ == nil {
  66072. c.header_ = make(http.Header)
  66073. }
  66074. return c.header_
  66075. }
  66076. func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  66077. reqHeaders := make(http.Header)
  66078. for k, v := range c.header_ {
  66079. reqHeaders[k] = v
  66080. }
  66081. reqHeaders.Set("User-Agent", c.s.userAgent())
  66082. var body io.Reader = nil
  66083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  66084. if err != nil {
  66085. return nil, err
  66086. }
  66087. reqHeaders.Set("Content-Type", "application/json")
  66088. c.urlParams_.Set("alt", alt)
  66089. c.urlParams_.Set("prettyPrint", "false")
  66090. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  66091. urls += "?" + c.urlParams_.Encode()
  66092. req, err := http.NewRequest("PUT", urls, body)
  66093. if err != nil {
  66094. return nil, err
  66095. }
  66096. req.Header = reqHeaders
  66097. googleapi.Expand(req.URL, map[string]string{
  66098. "project": c.project,
  66099. "zone": c.zone,
  66100. "instanceGroupManager": c.instanceGroupManager,
  66101. })
  66102. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66103. }
  66104. // Do executes the "compute.instanceGroupManagers.update" call.
  66105. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66106. // status code is an error. Response headers are in either
  66107. // *Operation.ServerResponse.Header or (if a response was returned at
  66108. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66109. // to check whether the returned error was because
  66110. // http.StatusNotModified was returned.
  66111. func (c *InstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66112. gensupport.SetOptions(c.urlParams_, opts...)
  66113. res, err := c.doRequest("json")
  66114. if res != nil && res.StatusCode == http.StatusNotModified {
  66115. if res.Body != nil {
  66116. res.Body.Close()
  66117. }
  66118. return nil, &googleapi.Error{
  66119. Code: res.StatusCode,
  66120. Header: res.Header,
  66121. }
  66122. }
  66123. if err != nil {
  66124. return nil, err
  66125. }
  66126. defer googleapi.CloseBody(res)
  66127. if err := googleapi.CheckResponse(res); err != nil {
  66128. return nil, err
  66129. }
  66130. ret := &Operation{
  66131. ServerResponse: googleapi.ServerResponse{
  66132. Header: res.Header,
  66133. HTTPStatusCode: res.StatusCode,
  66134. },
  66135. }
  66136. target := &ret
  66137. if err := gensupport.DecodeResponse(target, res); err != nil {
  66138. return nil, err
  66139. }
  66140. return ret, nil
  66141. // {
  66142. // "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listManagedInstances method.",
  66143. // "httpMethod": "PUT",
  66144. // "id": "compute.instanceGroupManagers.update",
  66145. // "parameterOrder": [
  66146. // "project",
  66147. // "zone",
  66148. // "instanceGroupManager"
  66149. // ],
  66150. // "parameters": {
  66151. // "instanceGroupManager": {
  66152. // "description": "The name of the instance group manager.",
  66153. // "location": "path",
  66154. // "required": true,
  66155. // "type": "string"
  66156. // },
  66157. // "project": {
  66158. // "description": "Project ID for this request.",
  66159. // "location": "path",
  66160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66161. // "required": true,
  66162. // "type": "string"
  66163. // },
  66164. // "requestId": {
  66165. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66166. // "location": "query",
  66167. // "type": "string"
  66168. // },
  66169. // "zone": {
  66170. // "description": "The name of the zone where you want to create the managed instance group.",
  66171. // "location": "path",
  66172. // "required": true,
  66173. // "type": "string"
  66174. // }
  66175. // },
  66176. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  66177. // "request": {
  66178. // "$ref": "InstanceGroupManager"
  66179. // },
  66180. // "response": {
  66181. // "$ref": "Operation"
  66182. // },
  66183. // "scopes": [
  66184. // "https://www.googleapis.com/auth/cloud-platform",
  66185. // "https://www.googleapis.com/auth/compute"
  66186. // ]
  66187. // }
  66188. }
  66189. // method id "compute.instanceGroupManagers.updatePerInstanceConfigs":
  66190. type InstanceGroupManagersUpdatePerInstanceConfigsCall struct {
  66191. s *Service
  66192. project string
  66193. zone string
  66194. instanceGroupManager string
  66195. instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq
  66196. urlParams_ gensupport.URLParams
  66197. ctx_ context.Context
  66198. header_ http.Header
  66199. }
  66200. // UpdatePerInstanceConfigs: Insert or update (for the ones that already
  66201. // exist) per-instance configs for the managed instance group.
  66202. // perInstanceConfig.instance serves as a key used to distinguish
  66203. // whether to perform insert or patch.
  66204. func (r *InstanceGroupManagersService) UpdatePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  66205. c := &InstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66206. c.project = project
  66207. c.zone = zone
  66208. c.instanceGroupManager = instanceGroupManager
  66209. c.instancegroupmanagersupdateperinstanceconfigsreq = instancegroupmanagersupdateperinstanceconfigsreq
  66210. return c
  66211. }
  66212. // RequestId sets the optional parameter "requestId": An optional
  66213. // request ID to identify requests. Specify a unique request ID so that
  66214. // if you must retry your request, the server will know to ignore the
  66215. // request if it has already been completed.
  66216. //
  66217. // For example, consider a situation where you make an initial request
  66218. // and the request times out. If you make the request again with the
  66219. // same request ID, the server can check if original operation with the
  66220. // same request ID was received, and if so, will ignore the second
  66221. // request. This prevents clients from accidentally creating duplicate
  66222. // commitments.
  66223. //
  66224. // The request ID must be a valid UUID with the exception that zero UUID
  66225. // is not supported (00000000-0000-0000-0000-000000000000).
  66226. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  66227. c.urlParams_.Set("requestId", requestId)
  66228. return c
  66229. }
  66230. // Fields allows partial responses to be retrieved. See
  66231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66232. // for more information.
  66233. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  66234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66235. return c
  66236. }
  66237. // Context sets the context to be used in this call's Do method. Any
  66238. // pending HTTP request will be aborted if the provided context is
  66239. // canceled.
  66240. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersUpdatePerInstanceConfigsCall {
  66241. c.ctx_ = ctx
  66242. return c
  66243. }
  66244. // Header returns an http.Header that can be modified by the caller to
  66245. // add HTTP headers to the request.
  66246. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
  66247. if c.header_ == nil {
  66248. c.header_ = make(http.Header)
  66249. }
  66250. return c.header_
  66251. }
  66252. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  66253. reqHeaders := make(http.Header)
  66254. for k, v := range c.header_ {
  66255. reqHeaders[k] = v
  66256. }
  66257. reqHeaders.Set("User-Agent", c.s.userAgent())
  66258. var body io.Reader = nil
  66259. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq)
  66260. if err != nil {
  66261. return nil, err
  66262. }
  66263. reqHeaders.Set("Content-Type", "application/json")
  66264. c.urlParams_.Set("alt", alt)
  66265. c.urlParams_.Set("prettyPrint", "false")
  66266. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
  66267. urls += "?" + c.urlParams_.Encode()
  66268. req, err := http.NewRequest("POST", urls, body)
  66269. if err != nil {
  66270. return nil, err
  66271. }
  66272. req.Header = reqHeaders
  66273. googleapi.Expand(req.URL, map[string]string{
  66274. "project": c.project,
  66275. "zone": c.zone,
  66276. "instanceGroupManager": c.instanceGroupManager,
  66277. })
  66278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66279. }
  66280. // Do executes the "compute.instanceGroupManagers.updatePerInstanceConfigs" call.
  66281. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66282. // status code is an error. Response headers are in either
  66283. // *Operation.ServerResponse.Header or (if a response was returned at
  66284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66285. // to check whether the returned error was because
  66286. // http.StatusNotModified was returned.
  66287. func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66288. gensupport.SetOptions(c.urlParams_, opts...)
  66289. res, err := c.doRequest("json")
  66290. if res != nil && res.StatusCode == http.StatusNotModified {
  66291. if res.Body != nil {
  66292. res.Body.Close()
  66293. }
  66294. return nil, &googleapi.Error{
  66295. Code: res.StatusCode,
  66296. Header: res.Header,
  66297. }
  66298. }
  66299. if err != nil {
  66300. return nil, err
  66301. }
  66302. defer googleapi.CloseBody(res)
  66303. if err := googleapi.CheckResponse(res); err != nil {
  66304. return nil, err
  66305. }
  66306. ret := &Operation{
  66307. ServerResponse: googleapi.ServerResponse{
  66308. Header: res.Header,
  66309. HTTPStatusCode: res.StatusCode,
  66310. },
  66311. }
  66312. target := &ret
  66313. if err := gensupport.DecodeResponse(target, res); err != nil {
  66314. return nil, err
  66315. }
  66316. return ret, nil
  66317. // {
  66318. // "description": "Insert or update (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.",
  66319. // "httpMethod": "POST",
  66320. // "id": "compute.instanceGroupManagers.updatePerInstanceConfigs",
  66321. // "parameterOrder": [
  66322. // "project",
  66323. // "zone",
  66324. // "instanceGroupManager"
  66325. // ],
  66326. // "parameters": {
  66327. // "instanceGroupManager": {
  66328. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  66329. // "location": "path",
  66330. // "required": true,
  66331. // "type": "string"
  66332. // },
  66333. // "project": {
  66334. // "description": "Project ID for this request.",
  66335. // "location": "path",
  66336. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66337. // "required": true,
  66338. // "type": "string"
  66339. // },
  66340. // "requestId": {
  66341. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66342. // "location": "query",
  66343. // "type": "string"
  66344. // },
  66345. // "zone": {
  66346. // "description": "The name of the zone where the managed instance group is located. It should conform to RFC1035.",
  66347. // "location": "path",
  66348. // "required": true,
  66349. // "type": "string"
  66350. // }
  66351. // },
  66352. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
  66353. // "request": {
  66354. // "$ref": "InstanceGroupManagersUpdatePerInstanceConfigsReq"
  66355. // },
  66356. // "response": {
  66357. // "$ref": "Operation"
  66358. // },
  66359. // "scopes": [
  66360. // "https://www.googleapis.com/auth/cloud-platform",
  66361. // "https://www.googleapis.com/auth/compute"
  66362. // ]
  66363. // }
  66364. }
  66365. // method id "compute.instanceGroups.addInstances":
  66366. type InstanceGroupsAddInstancesCall struct {
  66367. s *Service
  66368. project string
  66369. zone string
  66370. instanceGroup string
  66371. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  66372. urlParams_ gensupport.URLParams
  66373. ctx_ context.Context
  66374. header_ http.Header
  66375. }
  66376. // AddInstances: Adds a list of instances to the specified instance
  66377. // group. All of the instances in the instance group must be in the same
  66378. // network/subnetwork. Read Adding instances for more information.
  66379. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  66380. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66381. c.project = project
  66382. c.zone = zone
  66383. c.instanceGroup = instanceGroup
  66384. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  66385. return c
  66386. }
  66387. // RequestId sets the optional parameter "requestId": An optional
  66388. // request ID to identify requests. Specify a unique request ID so that
  66389. // if you must retry your request, the server will know to ignore the
  66390. // request if it has already been completed.
  66391. //
  66392. // For example, consider a situation where you make an initial request
  66393. // and the request times out. If you make the request again with the
  66394. // same request ID, the server can check if original operation with the
  66395. // same request ID was received, and if so, will ignore the second
  66396. // request. This prevents clients from accidentally creating duplicate
  66397. // commitments.
  66398. //
  66399. // The request ID must be a valid UUID with the exception that zero UUID
  66400. // is not supported (00000000-0000-0000-0000-000000000000).
  66401. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  66402. c.urlParams_.Set("requestId", requestId)
  66403. return c
  66404. }
  66405. // Fields allows partial responses to be retrieved. See
  66406. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66407. // for more information.
  66408. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  66409. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66410. return c
  66411. }
  66412. // Context sets the context to be used in this call's Do method. Any
  66413. // pending HTTP request will be aborted if the provided context is
  66414. // canceled.
  66415. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  66416. c.ctx_ = ctx
  66417. return c
  66418. }
  66419. // Header returns an http.Header that can be modified by the caller to
  66420. // add HTTP headers to the request.
  66421. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  66422. if c.header_ == nil {
  66423. c.header_ = make(http.Header)
  66424. }
  66425. return c.header_
  66426. }
  66427. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  66428. reqHeaders := make(http.Header)
  66429. for k, v := range c.header_ {
  66430. reqHeaders[k] = v
  66431. }
  66432. reqHeaders.Set("User-Agent", c.s.userAgent())
  66433. var body io.Reader = nil
  66434. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  66435. if err != nil {
  66436. return nil, err
  66437. }
  66438. reqHeaders.Set("Content-Type", "application/json")
  66439. c.urlParams_.Set("alt", alt)
  66440. c.urlParams_.Set("prettyPrint", "false")
  66441. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  66442. urls += "?" + c.urlParams_.Encode()
  66443. req, err := http.NewRequest("POST", urls, body)
  66444. if err != nil {
  66445. return nil, err
  66446. }
  66447. req.Header = reqHeaders
  66448. googleapi.Expand(req.URL, map[string]string{
  66449. "project": c.project,
  66450. "zone": c.zone,
  66451. "instanceGroup": c.instanceGroup,
  66452. })
  66453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66454. }
  66455. // Do executes the "compute.instanceGroups.addInstances" call.
  66456. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66457. // status code is an error. Response headers are in either
  66458. // *Operation.ServerResponse.Header or (if a response was returned at
  66459. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66460. // to check whether the returned error was because
  66461. // http.StatusNotModified was returned.
  66462. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66463. gensupport.SetOptions(c.urlParams_, opts...)
  66464. res, err := c.doRequest("json")
  66465. if res != nil && res.StatusCode == http.StatusNotModified {
  66466. if res.Body != nil {
  66467. res.Body.Close()
  66468. }
  66469. return nil, &googleapi.Error{
  66470. Code: res.StatusCode,
  66471. Header: res.Header,
  66472. }
  66473. }
  66474. if err != nil {
  66475. return nil, err
  66476. }
  66477. defer googleapi.CloseBody(res)
  66478. if err := googleapi.CheckResponse(res); err != nil {
  66479. return nil, err
  66480. }
  66481. ret := &Operation{
  66482. ServerResponse: googleapi.ServerResponse{
  66483. Header: res.Header,
  66484. HTTPStatusCode: res.StatusCode,
  66485. },
  66486. }
  66487. target := &ret
  66488. if err := gensupport.DecodeResponse(target, res); err != nil {
  66489. return nil, err
  66490. }
  66491. return ret, nil
  66492. // {
  66493. // "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. Read Adding instances for more information.",
  66494. // "httpMethod": "POST",
  66495. // "id": "compute.instanceGroups.addInstances",
  66496. // "parameterOrder": [
  66497. // "project",
  66498. // "zone",
  66499. // "instanceGroup"
  66500. // ],
  66501. // "parameters": {
  66502. // "instanceGroup": {
  66503. // "description": "The name of the instance group where you are adding instances.",
  66504. // "location": "path",
  66505. // "required": true,
  66506. // "type": "string"
  66507. // },
  66508. // "project": {
  66509. // "description": "Project ID for this request.",
  66510. // "location": "path",
  66511. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66512. // "required": true,
  66513. // "type": "string"
  66514. // },
  66515. // "requestId": {
  66516. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66517. // "location": "query",
  66518. // "type": "string"
  66519. // },
  66520. // "zone": {
  66521. // "description": "The name of the zone where the instance group is located.",
  66522. // "location": "path",
  66523. // "required": true,
  66524. // "type": "string"
  66525. // }
  66526. // },
  66527. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  66528. // "request": {
  66529. // "$ref": "InstanceGroupsAddInstancesRequest"
  66530. // },
  66531. // "response": {
  66532. // "$ref": "Operation"
  66533. // },
  66534. // "scopes": [
  66535. // "https://www.googleapis.com/auth/cloud-platform",
  66536. // "https://www.googleapis.com/auth/compute"
  66537. // ]
  66538. // }
  66539. }
  66540. // method id "compute.instanceGroups.aggregatedList":
  66541. type InstanceGroupsAggregatedListCall struct {
  66542. s *Service
  66543. project string
  66544. urlParams_ gensupport.URLParams
  66545. ifNoneMatch_ string
  66546. ctx_ context.Context
  66547. header_ http.Header
  66548. }
  66549. // AggregatedList: Retrieves the list of instance groups and sorts them
  66550. // by zone.
  66551. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  66552. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66553. c.project = project
  66554. return c
  66555. }
  66556. // Filter sets the optional parameter "filter": A filter expression that
  66557. // filters resources listed in the response. The expression must specify
  66558. // the field name, a comparison operator, and the value that you want to
  66559. // use for filtering. The value must be a string, a number, or a
  66560. // boolean. The comparison operator must be either =, !=, >, or <.
  66561. //
  66562. // For example, if you are filtering Compute Engine instances, you can
  66563. // exclude instances named example-instance by specifying name !=
  66564. // example-instance.
  66565. //
  66566. // You can also filter nested fields. For example, you could specify
  66567. // scheduling.automaticRestart = false to include instances only if they
  66568. // are not scheduled for automatic restarts. You can use filtering on
  66569. // nested fields to filter based on resource labels.
  66570. //
  66571. // To filter on multiple expressions, provide each separate expression
  66572. // within parentheses. For example, (scheduling.automaticRestart = true)
  66573. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  66574. // AND expression. However, you can include AND and OR expressions
  66575. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  66576. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  66577. // true).
  66578. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  66579. c.urlParams_.Set("filter", filter)
  66580. return c
  66581. }
  66582. // MaxResults sets the optional parameter "maxResults": The maximum
  66583. // number of results per page that should be returned. If the number of
  66584. // available results is larger than maxResults, Compute Engine returns a
  66585. // nextPageToken that can be used to get the next page of results in
  66586. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  66587. // (Default: 500)
  66588. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  66589. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  66590. return c
  66591. }
  66592. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  66593. // a certain order. By default, results are returned in alphanumerical
  66594. // order based on the resource name.
  66595. //
  66596. // You can also sort results in descending order based on the creation
  66597. // timestamp using orderBy="creationTimestamp desc". This sorts results
  66598. // based on the creationTimestamp field in reverse chronological order
  66599. // (newest result first). Use this to sort resources like operations so
  66600. // that the newest operation is returned first.
  66601. //
  66602. // Currently, only sorting by name or creationTimestamp desc is
  66603. // supported.
  66604. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  66605. c.urlParams_.Set("orderBy", orderBy)
  66606. return c
  66607. }
  66608. // PageToken sets the optional parameter "pageToken": Specifies a page
  66609. // token to use. Set pageToken to the nextPageToken returned by a
  66610. // previous list request to get the next page of results.
  66611. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  66612. c.urlParams_.Set("pageToken", pageToken)
  66613. return c
  66614. }
  66615. // Fields allows partial responses to be retrieved. See
  66616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66617. // for more information.
  66618. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  66619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66620. return c
  66621. }
  66622. // IfNoneMatch sets the optional parameter which makes the operation
  66623. // fail if the object's ETag matches the given value. This is useful for
  66624. // getting updates only after the object has changed since the last
  66625. // request. Use googleapi.IsNotModified to check whether the response
  66626. // error from Do is the result of In-None-Match.
  66627. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  66628. c.ifNoneMatch_ = entityTag
  66629. return c
  66630. }
  66631. // Context sets the context to be used in this call's Do method. Any
  66632. // pending HTTP request will be aborted if the provided context is
  66633. // canceled.
  66634. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  66635. c.ctx_ = ctx
  66636. return c
  66637. }
  66638. // Header returns an http.Header that can be modified by the caller to
  66639. // add HTTP headers to the request.
  66640. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  66641. if c.header_ == nil {
  66642. c.header_ = make(http.Header)
  66643. }
  66644. return c.header_
  66645. }
  66646. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  66647. reqHeaders := make(http.Header)
  66648. for k, v := range c.header_ {
  66649. reqHeaders[k] = v
  66650. }
  66651. reqHeaders.Set("User-Agent", c.s.userAgent())
  66652. if c.ifNoneMatch_ != "" {
  66653. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66654. }
  66655. var body io.Reader = nil
  66656. c.urlParams_.Set("alt", alt)
  66657. c.urlParams_.Set("prettyPrint", "false")
  66658. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  66659. urls += "?" + c.urlParams_.Encode()
  66660. req, err := http.NewRequest("GET", urls, body)
  66661. if err != nil {
  66662. return nil, err
  66663. }
  66664. req.Header = reqHeaders
  66665. googleapi.Expand(req.URL, map[string]string{
  66666. "project": c.project,
  66667. })
  66668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66669. }
  66670. // Do executes the "compute.instanceGroups.aggregatedList" call.
  66671. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  66672. // Any non-2xx status code is an error. Response headers are in either
  66673. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  66674. // was returned at all) in error.(*googleapi.Error).Header. Use
  66675. // googleapi.IsNotModified to check whether the returned error was
  66676. // because http.StatusNotModified was returned.
  66677. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  66678. gensupport.SetOptions(c.urlParams_, opts...)
  66679. res, err := c.doRequest("json")
  66680. if res != nil && res.StatusCode == http.StatusNotModified {
  66681. if res.Body != nil {
  66682. res.Body.Close()
  66683. }
  66684. return nil, &googleapi.Error{
  66685. Code: res.StatusCode,
  66686. Header: res.Header,
  66687. }
  66688. }
  66689. if err != nil {
  66690. return nil, err
  66691. }
  66692. defer googleapi.CloseBody(res)
  66693. if err := googleapi.CheckResponse(res); err != nil {
  66694. return nil, err
  66695. }
  66696. ret := &InstanceGroupAggregatedList{
  66697. ServerResponse: googleapi.ServerResponse{
  66698. Header: res.Header,
  66699. HTTPStatusCode: res.StatusCode,
  66700. },
  66701. }
  66702. target := &ret
  66703. if err := gensupport.DecodeResponse(target, res); err != nil {
  66704. return nil, err
  66705. }
  66706. return ret, nil
  66707. // {
  66708. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  66709. // "httpMethod": "GET",
  66710. // "id": "compute.instanceGroups.aggregatedList",
  66711. // "parameterOrder": [
  66712. // "project"
  66713. // ],
  66714. // "parameters": {
  66715. // "filter": {
  66716. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  66717. // "location": "query",
  66718. // "type": "string"
  66719. // },
  66720. // "maxResults": {
  66721. // "default": "500",
  66722. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  66723. // "format": "uint32",
  66724. // "location": "query",
  66725. // "minimum": "0",
  66726. // "type": "integer"
  66727. // },
  66728. // "orderBy": {
  66729. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  66730. // "location": "query",
  66731. // "type": "string"
  66732. // },
  66733. // "pageToken": {
  66734. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  66735. // "location": "query",
  66736. // "type": "string"
  66737. // },
  66738. // "project": {
  66739. // "description": "Project ID for this request.",
  66740. // "location": "path",
  66741. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66742. // "required": true,
  66743. // "type": "string"
  66744. // }
  66745. // },
  66746. // "path": "{project}/aggregated/instanceGroups",
  66747. // "response": {
  66748. // "$ref": "InstanceGroupAggregatedList"
  66749. // },
  66750. // "scopes": [
  66751. // "https://www.googleapis.com/auth/cloud-platform",
  66752. // "https://www.googleapis.com/auth/compute",
  66753. // "https://www.googleapis.com/auth/compute.readonly"
  66754. // ]
  66755. // }
  66756. }
  66757. // Pages invokes f for each page of results.
  66758. // A non-nil error returned from f will halt the iteration.
  66759. // The provided context supersedes any context provided to the Context method.
  66760. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  66761. c.ctx_ = ctx
  66762. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  66763. for {
  66764. x, err := c.Do()
  66765. if err != nil {
  66766. return err
  66767. }
  66768. if err := f(x); err != nil {
  66769. return err
  66770. }
  66771. if x.NextPageToken == "" {
  66772. return nil
  66773. }
  66774. c.PageToken(x.NextPageToken)
  66775. }
  66776. }
  66777. // method id "compute.instanceGroups.delete":
  66778. type InstanceGroupsDeleteCall struct {
  66779. s *Service
  66780. project string
  66781. zone string
  66782. instanceGroup string
  66783. urlParams_ gensupport.URLParams
  66784. ctx_ context.Context
  66785. header_ http.Header
  66786. }
  66787. // Delete: Deletes the specified instance group. The instances in the
  66788. // group are not deleted. Note that instance group must not belong to a
  66789. // backend service. Read Deleting an instance group for more
  66790. // information.
  66791. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  66792. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66793. c.project = project
  66794. c.zone = zone
  66795. c.instanceGroup = instanceGroup
  66796. return c
  66797. }
  66798. // RequestId sets the optional parameter "requestId": An optional
  66799. // request ID to identify requests. Specify a unique request ID so that
  66800. // if you must retry your request, the server will know to ignore the
  66801. // request if it has already been completed.
  66802. //
  66803. // For example, consider a situation where you make an initial request
  66804. // and the request times out. If you make the request again with the
  66805. // same request ID, the server can check if original operation with the
  66806. // same request ID was received, and if so, will ignore the second
  66807. // request. This prevents clients from accidentally creating duplicate
  66808. // commitments.
  66809. //
  66810. // The request ID must be a valid UUID with the exception that zero UUID
  66811. // is not supported (00000000-0000-0000-0000-000000000000).
  66812. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  66813. c.urlParams_.Set("requestId", requestId)
  66814. return c
  66815. }
  66816. // Fields allows partial responses to be retrieved. See
  66817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66818. // for more information.
  66819. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  66820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66821. return c
  66822. }
  66823. // Context sets the context to be used in this call's Do method. Any
  66824. // pending HTTP request will be aborted if the provided context is
  66825. // canceled.
  66826. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  66827. c.ctx_ = ctx
  66828. return c
  66829. }
  66830. // Header returns an http.Header that can be modified by the caller to
  66831. // add HTTP headers to the request.
  66832. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  66833. if c.header_ == nil {
  66834. c.header_ = make(http.Header)
  66835. }
  66836. return c.header_
  66837. }
  66838. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  66839. reqHeaders := make(http.Header)
  66840. for k, v := range c.header_ {
  66841. reqHeaders[k] = v
  66842. }
  66843. reqHeaders.Set("User-Agent", c.s.userAgent())
  66844. var body io.Reader = nil
  66845. c.urlParams_.Set("alt", alt)
  66846. c.urlParams_.Set("prettyPrint", "false")
  66847. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  66848. urls += "?" + c.urlParams_.Encode()
  66849. req, err := http.NewRequest("DELETE", urls, body)
  66850. if err != nil {
  66851. return nil, err
  66852. }
  66853. req.Header = reqHeaders
  66854. googleapi.Expand(req.URL, map[string]string{
  66855. "project": c.project,
  66856. "zone": c.zone,
  66857. "instanceGroup": c.instanceGroup,
  66858. })
  66859. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66860. }
  66861. // Do executes the "compute.instanceGroups.delete" call.
  66862. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66863. // status code is an error. Response headers are in either
  66864. // *Operation.ServerResponse.Header or (if a response was returned at
  66865. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66866. // to check whether the returned error was because
  66867. // http.StatusNotModified was returned.
  66868. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66869. gensupport.SetOptions(c.urlParams_, opts...)
  66870. res, err := c.doRequest("json")
  66871. if res != nil && res.StatusCode == http.StatusNotModified {
  66872. if res.Body != nil {
  66873. res.Body.Close()
  66874. }
  66875. return nil, &googleapi.Error{
  66876. Code: res.StatusCode,
  66877. Header: res.Header,
  66878. }
  66879. }
  66880. if err != nil {
  66881. return nil, err
  66882. }
  66883. defer googleapi.CloseBody(res)
  66884. if err := googleapi.CheckResponse(res); err != nil {
  66885. return nil, err
  66886. }
  66887. ret := &Operation{
  66888. ServerResponse: googleapi.ServerResponse{
  66889. Header: res.Header,
  66890. HTTPStatusCode: res.StatusCode,
  66891. },
  66892. }
  66893. target := &ret
  66894. if err := gensupport.DecodeResponse(target, res); err != nil {
  66895. return nil, err
  66896. }
  66897. return ret, nil
  66898. // {
  66899. // "description": "Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.",
  66900. // "httpMethod": "DELETE",
  66901. // "id": "compute.instanceGroups.delete",
  66902. // "parameterOrder": [
  66903. // "project",
  66904. // "zone",
  66905. // "instanceGroup"
  66906. // ],
  66907. // "parameters": {
  66908. // "instanceGroup": {
  66909. // "description": "The name of the instance group to delete.",
  66910. // "location": "path",
  66911. // "required": true,
  66912. // "type": "string"
  66913. // },
  66914. // "project": {
  66915. // "description": "Project ID for this request.",
  66916. // "location": "path",
  66917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66918. // "required": true,
  66919. // "type": "string"
  66920. // },
  66921. // "requestId": {
  66922. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66923. // "location": "query",
  66924. // "type": "string"
  66925. // },
  66926. // "zone": {
  66927. // "description": "The name of the zone where the instance group is located.",
  66928. // "location": "path",
  66929. // "required": true,
  66930. // "type": "string"
  66931. // }
  66932. // },
  66933. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  66934. // "response": {
  66935. // "$ref": "Operation"
  66936. // },
  66937. // "scopes": [
  66938. // "https://www.googleapis.com/auth/cloud-platform",
  66939. // "https://www.googleapis.com/auth/compute"
  66940. // ]
  66941. // }
  66942. }
  66943. // method id "compute.instanceGroups.get":
  66944. type InstanceGroupsGetCall struct {
  66945. s *Service
  66946. project string
  66947. zone string
  66948. instanceGroup string
  66949. urlParams_ gensupport.URLParams
  66950. ifNoneMatch_ string
  66951. ctx_ context.Context
  66952. header_ http.Header
  66953. }
  66954. // Get: Returns the specified instance group. Gets a list of available
  66955. // instance groups by making a list() request.
  66956. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  66957. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66958. c.project = project
  66959. c.zone = zone
  66960. c.instanceGroup = instanceGroup
  66961. return c
  66962. }
  66963. // Fields allows partial responses to be retrieved. See
  66964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66965. // for more information.
  66966. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  66967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66968. return c
  66969. }
  66970. // IfNoneMatch sets the optional parameter which makes the operation
  66971. // fail if the object's ETag matches the given value. This is useful for
  66972. // getting updates only after the object has changed since the last
  66973. // request. Use googleapi.IsNotModified to check whether the response
  66974. // error from Do is the result of In-None-Match.
  66975. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  66976. c.ifNoneMatch_ = entityTag
  66977. return c
  66978. }
  66979. // Context sets the context to be used in this call's Do method. Any
  66980. // pending HTTP request will be aborted if the provided context is
  66981. // canceled.
  66982. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  66983. c.ctx_ = ctx
  66984. return c
  66985. }
  66986. // Header returns an http.Header that can be modified by the caller to
  66987. // add HTTP headers to the request.
  66988. func (c *InstanceGroupsGetCall) Header() http.Header {
  66989. if c.header_ == nil {
  66990. c.header_ = make(http.Header)
  66991. }
  66992. return c.header_
  66993. }
  66994. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  66995. reqHeaders := make(http.Header)
  66996. for k, v := range c.header_ {
  66997. reqHeaders[k] = v
  66998. }
  66999. reqHeaders.Set("User-Agent", c.s.userAgent())
  67000. if c.ifNoneMatch_ != "" {
  67001. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67002. }
  67003. var body io.Reader = nil
  67004. c.urlParams_.Set("alt", alt)
  67005. c.urlParams_.Set("prettyPrint", "false")
  67006. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  67007. urls += "?" + c.urlParams_.Encode()
  67008. req, err := http.NewRequest("GET", urls, body)
  67009. if err != nil {
  67010. return nil, err
  67011. }
  67012. req.Header = reqHeaders
  67013. googleapi.Expand(req.URL, map[string]string{
  67014. "project": c.project,
  67015. "zone": c.zone,
  67016. "instanceGroup": c.instanceGroup,
  67017. })
  67018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67019. }
  67020. // Do executes the "compute.instanceGroups.get" call.
  67021. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  67022. // status code is an error. Response headers are in either
  67023. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  67024. // at all) in error.(*googleapi.Error).Header. Use
  67025. // googleapi.IsNotModified to check whether the returned error was
  67026. // because http.StatusNotModified was returned.
  67027. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  67028. gensupport.SetOptions(c.urlParams_, opts...)
  67029. res, err := c.doRequest("json")
  67030. if res != nil && res.StatusCode == http.StatusNotModified {
  67031. if res.Body != nil {
  67032. res.Body.Close()
  67033. }
  67034. return nil, &googleapi.Error{
  67035. Code: res.StatusCode,
  67036. Header: res.Header,
  67037. }
  67038. }
  67039. if err != nil {
  67040. return nil, err
  67041. }
  67042. defer googleapi.CloseBody(res)
  67043. if err := googleapi.CheckResponse(res); err != nil {
  67044. return nil, err
  67045. }
  67046. ret := &InstanceGroup{
  67047. ServerResponse: googleapi.ServerResponse{
  67048. Header: res.Header,
  67049. HTTPStatusCode: res.StatusCode,
  67050. },
  67051. }
  67052. target := &ret
  67053. if err := gensupport.DecodeResponse(target, res); err != nil {
  67054. return nil, err
  67055. }
  67056. return ret, nil
  67057. // {
  67058. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  67059. // "httpMethod": "GET",
  67060. // "id": "compute.instanceGroups.get",
  67061. // "parameterOrder": [
  67062. // "project",
  67063. // "zone",
  67064. // "instanceGroup"
  67065. // ],
  67066. // "parameters": {
  67067. // "instanceGroup": {
  67068. // "description": "The name of the instance group.",
  67069. // "location": "path",
  67070. // "required": true,
  67071. // "type": "string"
  67072. // },
  67073. // "project": {
  67074. // "description": "Project ID for this request.",
  67075. // "location": "path",
  67076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67077. // "required": true,
  67078. // "type": "string"
  67079. // },
  67080. // "zone": {
  67081. // "description": "The name of the zone where the instance group is located.",
  67082. // "location": "path",
  67083. // "required": true,
  67084. // "type": "string"
  67085. // }
  67086. // },
  67087. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  67088. // "response": {
  67089. // "$ref": "InstanceGroup"
  67090. // },
  67091. // "scopes": [
  67092. // "https://www.googleapis.com/auth/cloud-platform",
  67093. // "https://www.googleapis.com/auth/compute",
  67094. // "https://www.googleapis.com/auth/compute.readonly"
  67095. // ]
  67096. // }
  67097. }
  67098. // method id "compute.instanceGroups.insert":
  67099. type InstanceGroupsInsertCall struct {
  67100. s *Service
  67101. project string
  67102. zone string
  67103. instancegroup *InstanceGroup
  67104. urlParams_ gensupport.URLParams
  67105. ctx_ context.Context
  67106. header_ http.Header
  67107. }
  67108. // Insert: Creates an instance group in the specified project using the
  67109. // parameters that are included in the request.
  67110. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  67111. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67112. c.project = project
  67113. c.zone = zone
  67114. c.instancegroup = instancegroup
  67115. return c
  67116. }
  67117. // RequestId sets the optional parameter "requestId": An optional
  67118. // request ID to identify requests. Specify a unique request ID so that
  67119. // if you must retry your request, the server will know to ignore the
  67120. // request if it has already been completed.
  67121. //
  67122. // For example, consider a situation where you make an initial request
  67123. // and the request times out. If you make the request again with the
  67124. // same request ID, the server can check if original operation with the
  67125. // same request ID was received, and if so, will ignore the second
  67126. // request. This prevents clients from accidentally creating duplicate
  67127. // commitments.
  67128. //
  67129. // The request ID must be a valid UUID with the exception that zero UUID
  67130. // is not supported (00000000-0000-0000-0000-000000000000).
  67131. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  67132. c.urlParams_.Set("requestId", requestId)
  67133. return c
  67134. }
  67135. // Fields allows partial responses to be retrieved. See
  67136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67137. // for more information.
  67138. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  67139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67140. return c
  67141. }
  67142. // Context sets the context to be used in this call's Do method. Any
  67143. // pending HTTP request will be aborted if the provided context is
  67144. // canceled.
  67145. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  67146. c.ctx_ = ctx
  67147. return c
  67148. }
  67149. // Header returns an http.Header that can be modified by the caller to
  67150. // add HTTP headers to the request.
  67151. func (c *InstanceGroupsInsertCall) Header() http.Header {
  67152. if c.header_ == nil {
  67153. c.header_ = make(http.Header)
  67154. }
  67155. return c.header_
  67156. }
  67157. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  67158. reqHeaders := make(http.Header)
  67159. for k, v := range c.header_ {
  67160. reqHeaders[k] = v
  67161. }
  67162. reqHeaders.Set("User-Agent", c.s.userAgent())
  67163. var body io.Reader = nil
  67164. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  67165. if err != nil {
  67166. return nil, err
  67167. }
  67168. reqHeaders.Set("Content-Type", "application/json")
  67169. c.urlParams_.Set("alt", alt)
  67170. c.urlParams_.Set("prettyPrint", "false")
  67171. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  67172. urls += "?" + c.urlParams_.Encode()
  67173. req, err := http.NewRequest("POST", urls, body)
  67174. if err != nil {
  67175. return nil, err
  67176. }
  67177. req.Header = reqHeaders
  67178. googleapi.Expand(req.URL, map[string]string{
  67179. "project": c.project,
  67180. "zone": c.zone,
  67181. })
  67182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67183. }
  67184. // Do executes the "compute.instanceGroups.insert" call.
  67185. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67186. // status code is an error. Response headers are in either
  67187. // *Operation.ServerResponse.Header or (if a response was returned at
  67188. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67189. // to check whether the returned error was because
  67190. // http.StatusNotModified was returned.
  67191. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67192. gensupport.SetOptions(c.urlParams_, opts...)
  67193. res, err := c.doRequest("json")
  67194. if res != nil && res.StatusCode == http.StatusNotModified {
  67195. if res.Body != nil {
  67196. res.Body.Close()
  67197. }
  67198. return nil, &googleapi.Error{
  67199. Code: res.StatusCode,
  67200. Header: res.Header,
  67201. }
  67202. }
  67203. if err != nil {
  67204. return nil, err
  67205. }
  67206. defer googleapi.CloseBody(res)
  67207. if err := googleapi.CheckResponse(res); err != nil {
  67208. return nil, err
  67209. }
  67210. ret := &Operation{
  67211. ServerResponse: googleapi.ServerResponse{
  67212. Header: res.Header,
  67213. HTTPStatusCode: res.StatusCode,
  67214. },
  67215. }
  67216. target := &ret
  67217. if err := gensupport.DecodeResponse(target, res); err != nil {
  67218. return nil, err
  67219. }
  67220. return ret, nil
  67221. // {
  67222. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  67223. // "httpMethod": "POST",
  67224. // "id": "compute.instanceGroups.insert",
  67225. // "parameterOrder": [
  67226. // "project",
  67227. // "zone"
  67228. // ],
  67229. // "parameters": {
  67230. // "project": {
  67231. // "description": "Project ID for this request.",
  67232. // "location": "path",
  67233. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67234. // "required": true,
  67235. // "type": "string"
  67236. // },
  67237. // "requestId": {
  67238. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67239. // "location": "query",
  67240. // "type": "string"
  67241. // },
  67242. // "zone": {
  67243. // "description": "The name of the zone where you want to create the instance group.",
  67244. // "location": "path",
  67245. // "required": true,
  67246. // "type": "string"
  67247. // }
  67248. // },
  67249. // "path": "{project}/zones/{zone}/instanceGroups",
  67250. // "request": {
  67251. // "$ref": "InstanceGroup"
  67252. // },
  67253. // "response": {
  67254. // "$ref": "Operation"
  67255. // },
  67256. // "scopes": [
  67257. // "https://www.googleapis.com/auth/cloud-platform",
  67258. // "https://www.googleapis.com/auth/compute"
  67259. // ]
  67260. // }
  67261. }
  67262. // method id "compute.instanceGroups.list":
  67263. type InstanceGroupsListCall struct {
  67264. s *Service
  67265. project string
  67266. zone string
  67267. urlParams_ gensupport.URLParams
  67268. ifNoneMatch_ string
  67269. ctx_ context.Context
  67270. header_ http.Header
  67271. }
  67272. // List: Retrieves the list of instance groups that are located in the
  67273. // specified project and zone.
  67274. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  67275. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67276. c.project = project
  67277. c.zone = zone
  67278. return c
  67279. }
  67280. // Filter sets the optional parameter "filter": A filter expression that
  67281. // filters resources listed in the response. The expression must specify
  67282. // the field name, a comparison operator, and the value that you want to
  67283. // use for filtering. The value must be a string, a number, or a
  67284. // boolean. The comparison operator must be either =, !=, >, or <.
  67285. //
  67286. // For example, if you are filtering Compute Engine instances, you can
  67287. // exclude instances named example-instance by specifying name !=
  67288. // example-instance.
  67289. //
  67290. // You can also filter nested fields. For example, you could specify
  67291. // scheduling.automaticRestart = false to include instances only if they
  67292. // are not scheduled for automatic restarts. You can use filtering on
  67293. // nested fields to filter based on resource labels.
  67294. //
  67295. // To filter on multiple expressions, provide each separate expression
  67296. // within parentheses. For example, (scheduling.automaticRestart = true)
  67297. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67298. // AND expression. However, you can include AND and OR expressions
  67299. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67300. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67301. // true).
  67302. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  67303. c.urlParams_.Set("filter", filter)
  67304. return c
  67305. }
  67306. // MaxResults sets the optional parameter "maxResults": The maximum
  67307. // number of results per page that should be returned. If the number of
  67308. // available results is larger than maxResults, Compute Engine returns a
  67309. // nextPageToken that can be used to get the next page of results in
  67310. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67311. // (Default: 500)
  67312. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  67313. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67314. return c
  67315. }
  67316. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67317. // a certain order. By default, results are returned in alphanumerical
  67318. // order based on the resource name.
  67319. //
  67320. // You can also sort results in descending order based on the creation
  67321. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67322. // based on the creationTimestamp field in reverse chronological order
  67323. // (newest result first). Use this to sort resources like operations so
  67324. // that the newest operation is returned first.
  67325. //
  67326. // Currently, only sorting by name or creationTimestamp desc is
  67327. // supported.
  67328. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  67329. c.urlParams_.Set("orderBy", orderBy)
  67330. return c
  67331. }
  67332. // PageToken sets the optional parameter "pageToken": Specifies a page
  67333. // token to use. Set pageToken to the nextPageToken returned by a
  67334. // previous list request to get the next page of results.
  67335. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  67336. c.urlParams_.Set("pageToken", pageToken)
  67337. return c
  67338. }
  67339. // Fields allows partial responses to be retrieved. See
  67340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67341. // for more information.
  67342. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  67343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67344. return c
  67345. }
  67346. // IfNoneMatch sets the optional parameter which makes the operation
  67347. // fail if the object's ETag matches the given value. This is useful for
  67348. // getting updates only after the object has changed since the last
  67349. // request. Use googleapi.IsNotModified to check whether the response
  67350. // error from Do is the result of In-None-Match.
  67351. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  67352. c.ifNoneMatch_ = entityTag
  67353. return c
  67354. }
  67355. // Context sets the context to be used in this call's Do method. Any
  67356. // pending HTTP request will be aborted if the provided context is
  67357. // canceled.
  67358. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  67359. c.ctx_ = ctx
  67360. return c
  67361. }
  67362. // Header returns an http.Header that can be modified by the caller to
  67363. // add HTTP headers to the request.
  67364. func (c *InstanceGroupsListCall) Header() http.Header {
  67365. if c.header_ == nil {
  67366. c.header_ = make(http.Header)
  67367. }
  67368. return c.header_
  67369. }
  67370. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  67371. reqHeaders := make(http.Header)
  67372. for k, v := range c.header_ {
  67373. reqHeaders[k] = v
  67374. }
  67375. reqHeaders.Set("User-Agent", c.s.userAgent())
  67376. if c.ifNoneMatch_ != "" {
  67377. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67378. }
  67379. var body io.Reader = nil
  67380. c.urlParams_.Set("alt", alt)
  67381. c.urlParams_.Set("prettyPrint", "false")
  67382. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  67383. urls += "?" + c.urlParams_.Encode()
  67384. req, err := http.NewRequest("GET", urls, body)
  67385. if err != nil {
  67386. return nil, err
  67387. }
  67388. req.Header = reqHeaders
  67389. googleapi.Expand(req.URL, map[string]string{
  67390. "project": c.project,
  67391. "zone": c.zone,
  67392. })
  67393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67394. }
  67395. // Do executes the "compute.instanceGroups.list" call.
  67396. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  67397. // non-2xx status code is an error. Response headers are in either
  67398. // *InstanceGroupList.ServerResponse.Header or (if a response was
  67399. // returned at all) in error.(*googleapi.Error).Header. Use
  67400. // googleapi.IsNotModified to check whether the returned error was
  67401. // because http.StatusNotModified was returned.
  67402. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  67403. gensupport.SetOptions(c.urlParams_, opts...)
  67404. res, err := c.doRequest("json")
  67405. if res != nil && res.StatusCode == http.StatusNotModified {
  67406. if res.Body != nil {
  67407. res.Body.Close()
  67408. }
  67409. return nil, &googleapi.Error{
  67410. Code: res.StatusCode,
  67411. Header: res.Header,
  67412. }
  67413. }
  67414. if err != nil {
  67415. return nil, err
  67416. }
  67417. defer googleapi.CloseBody(res)
  67418. if err := googleapi.CheckResponse(res); err != nil {
  67419. return nil, err
  67420. }
  67421. ret := &InstanceGroupList{
  67422. ServerResponse: googleapi.ServerResponse{
  67423. Header: res.Header,
  67424. HTTPStatusCode: res.StatusCode,
  67425. },
  67426. }
  67427. target := &ret
  67428. if err := gensupport.DecodeResponse(target, res); err != nil {
  67429. return nil, err
  67430. }
  67431. return ret, nil
  67432. // {
  67433. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  67434. // "httpMethod": "GET",
  67435. // "id": "compute.instanceGroups.list",
  67436. // "parameterOrder": [
  67437. // "project",
  67438. // "zone"
  67439. // ],
  67440. // "parameters": {
  67441. // "filter": {
  67442. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67443. // "location": "query",
  67444. // "type": "string"
  67445. // },
  67446. // "maxResults": {
  67447. // "default": "500",
  67448. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67449. // "format": "uint32",
  67450. // "location": "query",
  67451. // "minimum": "0",
  67452. // "type": "integer"
  67453. // },
  67454. // "orderBy": {
  67455. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67456. // "location": "query",
  67457. // "type": "string"
  67458. // },
  67459. // "pageToken": {
  67460. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67461. // "location": "query",
  67462. // "type": "string"
  67463. // },
  67464. // "project": {
  67465. // "description": "Project ID for this request.",
  67466. // "location": "path",
  67467. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67468. // "required": true,
  67469. // "type": "string"
  67470. // },
  67471. // "zone": {
  67472. // "description": "The name of the zone where the instance group is located.",
  67473. // "location": "path",
  67474. // "required": true,
  67475. // "type": "string"
  67476. // }
  67477. // },
  67478. // "path": "{project}/zones/{zone}/instanceGroups",
  67479. // "response": {
  67480. // "$ref": "InstanceGroupList"
  67481. // },
  67482. // "scopes": [
  67483. // "https://www.googleapis.com/auth/cloud-platform",
  67484. // "https://www.googleapis.com/auth/compute",
  67485. // "https://www.googleapis.com/auth/compute.readonly"
  67486. // ]
  67487. // }
  67488. }
  67489. // Pages invokes f for each page of results.
  67490. // A non-nil error returned from f will halt the iteration.
  67491. // The provided context supersedes any context provided to the Context method.
  67492. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  67493. c.ctx_ = ctx
  67494. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67495. for {
  67496. x, err := c.Do()
  67497. if err != nil {
  67498. return err
  67499. }
  67500. if err := f(x); err != nil {
  67501. return err
  67502. }
  67503. if x.NextPageToken == "" {
  67504. return nil
  67505. }
  67506. c.PageToken(x.NextPageToken)
  67507. }
  67508. }
  67509. // method id "compute.instanceGroups.listInstances":
  67510. type InstanceGroupsListInstancesCall struct {
  67511. s *Service
  67512. project string
  67513. zone string
  67514. instanceGroup string
  67515. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  67516. urlParams_ gensupport.URLParams
  67517. ctx_ context.Context
  67518. header_ http.Header
  67519. }
  67520. // ListInstances: Lists the instances in the specified instance group.
  67521. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  67522. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67523. c.project = project
  67524. c.zone = zone
  67525. c.instanceGroup = instanceGroup
  67526. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  67527. return c
  67528. }
  67529. // Filter sets the optional parameter "filter": A filter expression that
  67530. // filters resources listed in the response. The expression must specify
  67531. // the field name, a comparison operator, and the value that you want to
  67532. // use for filtering. The value must be a string, a number, or a
  67533. // boolean. The comparison operator must be either =, !=, >, or <.
  67534. //
  67535. // For example, if you are filtering Compute Engine instances, you can
  67536. // exclude instances named example-instance by specifying name !=
  67537. // example-instance.
  67538. //
  67539. // You can also filter nested fields. For example, you could specify
  67540. // scheduling.automaticRestart = false to include instances only if they
  67541. // are not scheduled for automatic restarts. You can use filtering on
  67542. // nested fields to filter based on resource labels.
  67543. //
  67544. // To filter on multiple expressions, provide each separate expression
  67545. // within parentheses. For example, (scheduling.automaticRestart = true)
  67546. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67547. // AND expression. However, you can include AND and OR expressions
  67548. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67549. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67550. // true).
  67551. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  67552. c.urlParams_.Set("filter", filter)
  67553. return c
  67554. }
  67555. // MaxResults sets the optional parameter "maxResults": The maximum
  67556. // number of results per page that should be returned. If the number of
  67557. // available results is larger than maxResults, Compute Engine returns a
  67558. // nextPageToken that can be used to get the next page of results in
  67559. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67560. // (Default: 500)
  67561. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  67562. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67563. return c
  67564. }
  67565. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67566. // a certain order. By default, results are returned in alphanumerical
  67567. // order based on the resource name.
  67568. //
  67569. // You can also sort results in descending order based on the creation
  67570. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67571. // based on the creationTimestamp field in reverse chronological order
  67572. // (newest result first). Use this to sort resources like operations so
  67573. // that the newest operation is returned first.
  67574. //
  67575. // Currently, only sorting by name or creationTimestamp desc is
  67576. // supported.
  67577. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  67578. c.urlParams_.Set("orderBy", orderBy)
  67579. return c
  67580. }
  67581. // PageToken sets the optional parameter "pageToken": Specifies a page
  67582. // token to use. Set pageToken to the nextPageToken returned by a
  67583. // previous list request to get the next page of results.
  67584. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  67585. c.urlParams_.Set("pageToken", pageToken)
  67586. return c
  67587. }
  67588. // Fields allows partial responses to be retrieved. See
  67589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67590. // for more information.
  67591. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  67592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67593. return c
  67594. }
  67595. // Context sets the context to be used in this call's Do method. Any
  67596. // pending HTTP request will be aborted if the provided context is
  67597. // canceled.
  67598. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  67599. c.ctx_ = ctx
  67600. return c
  67601. }
  67602. // Header returns an http.Header that can be modified by the caller to
  67603. // add HTTP headers to the request.
  67604. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  67605. if c.header_ == nil {
  67606. c.header_ = make(http.Header)
  67607. }
  67608. return c.header_
  67609. }
  67610. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  67611. reqHeaders := make(http.Header)
  67612. for k, v := range c.header_ {
  67613. reqHeaders[k] = v
  67614. }
  67615. reqHeaders.Set("User-Agent", c.s.userAgent())
  67616. var body io.Reader = nil
  67617. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  67618. if err != nil {
  67619. return nil, err
  67620. }
  67621. reqHeaders.Set("Content-Type", "application/json")
  67622. c.urlParams_.Set("alt", alt)
  67623. c.urlParams_.Set("prettyPrint", "false")
  67624. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  67625. urls += "?" + c.urlParams_.Encode()
  67626. req, err := http.NewRequest("POST", urls, body)
  67627. if err != nil {
  67628. return nil, err
  67629. }
  67630. req.Header = reqHeaders
  67631. googleapi.Expand(req.URL, map[string]string{
  67632. "project": c.project,
  67633. "zone": c.zone,
  67634. "instanceGroup": c.instanceGroup,
  67635. })
  67636. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67637. }
  67638. // Do executes the "compute.instanceGroups.listInstances" call.
  67639. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  67640. // Any non-2xx status code is an error. Response headers are in either
  67641. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  67642. // was returned at all) in error.(*googleapi.Error).Header. Use
  67643. // googleapi.IsNotModified to check whether the returned error was
  67644. // because http.StatusNotModified was returned.
  67645. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  67646. gensupport.SetOptions(c.urlParams_, opts...)
  67647. res, err := c.doRequest("json")
  67648. if res != nil && res.StatusCode == http.StatusNotModified {
  67649. if res.Body != nil {
  67650. res.Body.Close()
  67651. }
  67652. return nil, &googleapi.Error{
  67653. Code: res.StatusCode,
  67654. Header: res.Header,
  67655. }
  67656. }
  67657. if err != nil {
  67658. return nil, err
  67659. }
  67660. defer googleapi.CloseBody(res)
  67661. if err := googleapi.CheckResponse(res); err != nil {
  67662. return nil, err
  67663. }
  67664. ret := &InstanceGroupsListInstances{
  67665. ServerResponse: googleapi.ServerResponse{
  67666. Header: res.Header,
  67667. HTTPStatusCode: res.StatusCode,
  67668. },
  67669. }
  67670. target := &ret
  67671. if err := gensupport.DecodeResponse(target, res); err != nil {
  67672. return nil, err
  67673. }
  67674. return ret, nil
  67675. // {
  67676. // "description": "Lists the instances in the specified instance group.",
  67677. // "httpMethod": "POST",
  67678. // "id": "compute.instanceGroups.listInstances",
  67679. // "parameterOrder": [
  67680. // "project",
  67681. // "zone",
  67682. // "instanceGroup"
  67683. // ],
  67684. // "parameters": {
  67685. // "filter": {
  67686. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67687. // "location": "query",
  67688. // "type": "string"
  67689. // },
  67690. // "instanceGroup": {
  67691. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  67692. // "location": "path",
  67693. // "required": true,
  67694. // "type": "string"
  67695. // },
  67696. // "maxResults": {
  67697. // "default": "500",
  67698. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67699. // "format": "uint32",
  67700. // "location": "query",
  67701. // "minimum": "0",
  67702. // "type": "integer"
  67703. // },
  67704. // "orderBy": {
  67705. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67706. // "location": "query",
  67707. // "type": "string"
  67708. // },
  67709. // "pageToken": {
  67710. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67711. // "location": "query",
  67712. // "type": "string"
  67713. // },
  67714. // "project": {
  67715. // "description": "Project ID for this request.",
  67716. // "location": "path",
  67717. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67718. // "required": true,
  67719. // "type": "string"
  67720. // },
  67721. // "zone": {
  67722. // "description": "The name of the zone where the instance group is located.",
  67723. // "location": "path",
  67724. // "required": true,
  67725. // "type": "string"
  67726. // }
  67727. // },
  67728. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  67729. // "request": {
  67730. // "$ref": "InstanceGroupsListInstancesRequest"
  67731. // },
  67732. // "response": {
  67733. // "$ref": "InstanceGroupsListInstances"
  67734. // },
  67735. // "scopes": [
  67736. // "https://www.googleapis.com/auth/cloud-platform",
  67737. // "https://www.googleapis.com/auth/compute",
  67738. // "https://www.googleapis.com/auth/compute.readonly"
  67739. // ]
  67740. // }
  67741. }
  67742. // Pages invokes f for each page of results.
  67743. // A non-nil error returned from f will halt the iteration.
  67744. // The provided context supersedes any context provided to the Context method.
  67745. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  67746. c.ctx_ = ctx
  67747. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67748. for {
  67749. x, err := c.Do()
  67750. if err != nil {
  67751. return err
  67752. }
  67753. if err := f(x); err != nil {
  67754. return err
  67755. }
  67756. if x.NextPageToken == "" {
  67757. return nil
  67758. }
  67759. c.PageToken(x.NextPageToken)
  67760. }
  67761. }
  67762. // method id "compute.instanceGroups.removeInstances":
  67763. type InstanceGroupsRemoveInstancesCall struct {
  67764. s *Service
  67765. project string
  67766. zone string
  67767. instanceGroup string
  67768. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  67769. urlParams_ gensupport.URLParams
  67770. ctx_ context.Context
  67771. header_ http.Header
  67772. }
  67773. // RemoveInstances: Removes one or more instances from the specified
  67774. // instance group, but does not delete those instances.
  67775. //
  67776. // If the group is part of a backend service that has enabled connection
  67777. // draining, it can take up to 60 seconds after the connection draining
  67778. // duration before the VM instance is removed or deleted.
  67779. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  67780. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67781. c.project = project
  67782. c.zone = zone
  67783. c.instanceGroup = instanceGroup
  67784. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  67785. return c
  67786. }
  67787. // RequestId sets the optional parameter "requestId": An optional
  67788. // request ID to identify requests. Specify a unique request ID so that
  67789. // if you must retry your request, the server will know to ignore the
  67790. // request if it has already been completed.
  67791. //
  67792. // For example, consider a situation where you make an initial request
  67793. // and the request times out. If you make the request again with the
  67794. // same request ID, the server can check if original operation with the
  67795. // same request ID was received, and if so, will ignore the second
  67796. // request. This prevents clients from accidentally creating duplicate
  67797. // commitments.
  67798. //
  67799. // The request ID must be a valid UUID with the exception that zero UUID
  67800. // is not supported (00000000-0000-0000-0000-000000000000).
  67801. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  67802. c.urlParams_.Set("requestId", requestId)
  67803. return c
  67804. }
  67805. // Fields allows partial responses to be retrieved. See
  67806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67807. // for more information.
  67808. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  67809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67810. return c
  67811. }
  67812. // Context sets the context to be used in this call's Do method. Any
  67813. // pending HTTP request will be aborted if the provided context is
  67814. // canceled.
  67815. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  67816. c.ctx_ = ctx
  67817. return c
  67818. }
  67819. // Header returns an http.Header that can be modified by the caller to
  67820. // add HTTP headers to the request.
  67821. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  67822. if c.header_ == nil {
  67823. c.header_ = make(http.Header)
  67824. }
  67825. return c.header_
  67826. }
  67827. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  67828. reqHeaders := make(http.Header)
  67829. for k, v := range c.header_ {
  67830. reqHeaders[k] = v
  67831. }
  67832. reqHeaders.Set("User-Agent", c.s.userAgent())
  67833. var body io.Reader = nil
  67834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  67835. if err != nil {
  67836. return nil, err
  67837. }
  67838. reqHeaders.Set("Content-Type", "application/json")
  67839. c.urlParams_.Set("alt", alt)
  67840. c.urlParams_.Set("prettyPrint", "false")
  67841. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  67842. urls += "?" + c.urlParams_.Encode()
  67843. req, err := http.NewRequest("POST", urls, body)
  67844. if err != nil {
  67845. return nil, err
  67846. }
  67847. req.Header = reqHeaders
  67848. googleapi.Expand(req.URL, map[string]string{
  67849. "project": c.project,
  67850. "zone": c.zone,
  67851. "instanceGroup": c.instanceGroup,
  67852. })
  67853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67854. }
  67855. // Do executes the "compute.instanceGroups.removeInstances" call.
  67856. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67857. // status code is an error. Response headers are in either
  67858. // *Operation.ServerResponse.Header or (if a response was returned at
  67859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67860. // to check whether the returned error was because
  67861. // http.StatusNotModified was returned.
  67862. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67863. gensupport.SetOptions(c.urlParams_, opts...)
  67864. res, err := c.doRequest("json")
  67865. if res != nil && res.StatusCode == http.StatusNotModified {
  67866. if res.Body != nil {
  67867. res.Body.Close()
  67868. }
  67869. return nil, &googleapi.Error{
  67870. Code: res.StatusCode,
  67871. Header: res.Header,
  67872. }
  67873. }
  67874. if err != nil {
  67875. return nil, err
  67876. }
  67877. defer googleapi.CloseBody(res)
  67878. if err := googleapi.CheckResponse(res); err != nil {
  67879. return nil, err
  67880. }
  67881. ret := &Operation{
  67882. ServerResponse: googleapi.ServerResponse{
  67883. Header: res.Header,
  67884. HTTPStatusCode: res.StatusCode,
  67885. },
  67886. }
  67887. target := &ret
  67888. if err := gensupport.DecodeResponse(target, res); err != nil {
  67889. return nil, err
  67890. }
  67891. return ret, nil
  67892. // {
  67893. // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.",
  67894. // "httpMethod": "POST",
  67895. // "id": "compute.instanceGroups.removeInstances",
  67896. // "parameterOrder": [
  67897. // "project",
  67898. // "zone",
  67899. // "instanceGroup"
  67900. // ],
  67901. // "parameters": {
  67902. // "instanceGroup": {
  67903. // "description": "The name of the instance group where the specified instances will be removed.",
  67904. // "location": "path",
  67905. // "required": true,
  67906. // "type": "string"
  67907. // },
  67908. // "project": {
  67909. // "description": "Project ID for this request.",
  67910. // "location": "path",
  67911. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67912. // "required": true,
  67913. // "type": "string"
  67914. // },
  67915. // "requestId": {
  67916. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  67917. // "location": "query",
  67918. // "type": "string"
  67919. // },
  67920. // "zone": {
  67921. // "description": "The name of the zone where the instance group is located.",
  67922. // "location": "path",
  67923. // "required": true,
  67924. // "type": "string"
  67925. // }
  67926. // },
  67927. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  67928. // "request": {
  67929. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  67930. // },
  67931. // "response": {
  67932. // "$ref": "Operation"
  67933. // },
  67934. // "scopes": [
  67935. // "https://www.googleapis.com/auth/cloud-platform",
  67936. // "https://www.googleapis.com/auth/compute"
  67937. // ]
  67938. // }
  67939. }
  67940. // method id "compute.instanceGroups.setNamedPorts":
  67941. type InstanceGroupsSetNamedPortsCall struct {
  67942. s *Service
  67943. project string
  67944. zone string
  67945. instanceGroup string
  67946. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  67947. urlParams_ gensupport.URLParams
  67948. ctx_ context.Context
  67949. header_ http.Header
  67950. }
  67951. // SetNamedPorts: Sets the named ports for the specified instance group.
  67952. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  67953. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67954. c.project = project
  67955. c.zone = zone
  67956. c.instanceGroup = instanceGroup
  67957. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  67958. return c
  67959. }
  67960. // RequestId sets the optional parameter "requestId": An optional
  67961. // request ID to identify requests. Specify a unique request ID so that
  67962. // if you must retry your request, the server will know to ignore the
  67963. // request if it has already been completed.
  67964. //
  67965. // For example, consider a situation where you make an initial request
  67966. // and the request times out. If you make the request again with the
  67967. // same request ID, the server can check if original operation with the
  67968. // same request ID was received, and if so, will ignore the second
  67969. // request. This prevents clients from accidentally creating duplicate
  67970. // commitments.
  67971. //
  67972. // The request ID must be a valid UUID with the exception that zero UUID
  67973. // is not supported (00000000-0000-0000-0000-000000000000).
  67974. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  67975. c.urlParams_.Set("requestId", requestId)
  67976. return c
  67977. }
  67978. // Fields allows partial responses to be retrieved. See
  67979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67980. // for more information.
  67981. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  67982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67983. return c
  67984. }
  67985. // Context sets the context to be used in this call's Do method. Any
  67986. // pending HTTP request will be aborted if the provided context is
  67987. // canceled.
  67988. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  67989. c.ctx_ = ctx
  67990. return c
  67991. }
  67992. // Header returns an http.Header that can be modified by the caller to
  67993. // add HTTP headers to the request.
  67994. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  67995. if c.header_ == nil {
  67996. c.header_ = make(http.Header)
  67997. }
  67998. return c.header_
  67999. }
  68000. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  68001. reqHeaders := make(http.Header)
  68002. for k, v := range c.header_ {
  68003. reqHeaders[k] = v
  68004. }
  68005. reqHeaders.Set("User-Agent", c.s.userAgent())
  68006. var body io.Reader = nil
  68007. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  68008. if err != nil {
  68009. return nil, err
  68010. }
  68011. reqHeaders.Set("Content-Type", "application/json")
  68012. c.urlParams_.Set("alt", alt)
  68013. c.urlParams_.Set("prettyPrint", "false")
  68014. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  68015. urls += "?" + c.urlParams_.Encode()
  68016. req, err := http.NewRequest("POST", urls, body)
  68017. if err != nil {
  68018. return nil, err
  68019. }
  68020. req.Header = reqHeaders
  68021. googleapi.Expand(req.URL, map[string]string{
  68022. "project": c.project,
  68023. "zone": c.zone,
  68024. "instanceGroup": c.instanceGroup,
  68025. })
  68026. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68027. }
  68028. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  68029. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68030. // status code is an error. Response headers are in either
  68031. // *Operation.ServerResponse.Header or (if a response was returned at
  68032. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68033. // to check whether the returned error was because
  68034. // http.StatusNotModified was returned.
  68035. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68036. gensupport.SetOptions(c.urlParams_, opts...)
  68037. res, err := c.doRequest("json")
  68038. if res != nil && res.StatusCode == http.StatusNotModified {
  68039. if res.Body != nil {
  68040. res.Body.Close()
  68041. }
  68042. return nil, &googleapi.Error{
  68043. Code: res.StatusCode,
  68044. Header: res.Header,
  68045. }
  68046. }
  68047. if err != nil {
  68048. return nil, err
  68049. }
  68050. defer googleapi.CloseBody(res)
  68051. if err := googleapi.CheckResponse(res); err != nil {
  68052. return nil, err
  68053. }
  68054. ret := &Operation{
  68055. ServerResponse: googleapi.ServerResponse{
  68056. Header: res.Header,
  68057. HTTPStatusCode: res.StatusCode,
  68058. },
  68059. }
  68060. target := &ret
  68061. if err := gensupport.DecodeResponse(target, res); err != nil {
  68062. return nil, err
  68063. }
  68064. return ret, nil
  68065. // {
  68066. // "description": "Sets the named ports for the specified instance group.",
  68067. // "httpMethod": "POST",
  68068. // "id": "compute.instanceGroups.setNamedPorts",
  68069. // "parameterOrder": [
  68070. // "project",
  68071. // "zone",
  68072. // "instanceGroup"
  68073. // ],
  68074. // "parameters": {
  68075. // "instanceGroup": {
  68076. // "description": "The name of the instance group where the named ports are updated.",
  68077. // "location": "path",
  68078. // "required": true,
  68079. // "type": "string"
  68080. // },
  68081. // "project": {
  68082. // "description": "Project ID for this request.",
  68083. // "location": "path",
  68084. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68085. // "required": true,
  68086. // "type": "string"
  68087. // },
  68088. // "requestId": {
  68089. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68090. // "location": "query",
  68091. // "type": "string"
  68092. // },
  68093. // "zone": {
  68094. // "description": "The name of the zone where the instance group is located.",
  68095. // "location": "path",
  68096. // "required": true,
  68097. // "type": "string"
  68098. // }
  68099. // },
  68100. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  68101. // "request": {
  68102. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  68103. // },
  68104. // "response": {
  68105. // "$ref": "Operation"
  68106. // },
  68107. // "scopes": [
  68108. // "https://www.googleapis.com/auth/cloud-platform",
  68109. // "https://www.googleapis.com/auth/compute"
  68110. // ]
  68111. // }
  68112. }
  68113. // method id "compute.instanceGroups.testIamPermissions":
  68114. type InstanceGroupsTestIamPermissionsCall struct {
  68115. s *Service
  68116. project string
  68117. zone string
  68118. resource string
  68119. testpermissionsrequest *TestPermissionsRequest
  68120. urlParams_ gensupport.URLParams
  68121. ctx_ context.Context
  68122. header_ http.Header
  68123. }
  68124. // TestIamPermissions: Returns permissions that a caller has on the
  68125. // specified resource.
  68126. func (r *InstanceGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupsTestIamPermissionsCall {
  68127. c := &InstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68128. c.project = project
  68129. c.zone = zone
  68130. c.resource = resource
  68131. c.testpermissionsrequest = testpermissionsrequest
  68132. return c
  68133. }
  68134. // Fields allows partial responses to be retrieved. See
  68135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68136. // for more information.
  68137. func (c *InstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupsTestIamPermissionsCall {
  68138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68139. return c
  68140. }
  68141. // Context sets the context to be used in this call's Do method. Any
  68142. // pending HTTP request will be aborted if the provided context is
  68143. // canceled.
  68144. func (c *InstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupsTestIamPermissionsCall {
  68145. c.ctx_ = ctx
  68146. return c
  68147. }
  68148. // Header returns an http.Header that can be modified by the caller to
  68149. // add HTTP headers to the request.
  68150. func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header {
  68151. if c.header_ == nil {
  68152. c.header_ = make(http.Header)
  68153. }
  68154. return c.header_
  68155. }
  68156. func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  68157. reqHeaders := make(http.Header)
  68158. for k, v := range c.header_ {
  68159. reqHeaders[k] = v
  68160. }
  68161. reqHeaders.Set("User-Agent", c.s.userAgent())
  68162. var body io.Reader = nil
  68163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  68164. if err != nil {
  68165. return nil, err
  68166. }
  68167. reqHeaders.Set("Content-Type", "application/json")
  68168. c.urlParams_.Set("alt", alt)
  68169. c.urlParams_.Set("prettyPrint", "false")
  68170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions")
  68171. urls += "?" + c.urlParams_.Encode()
  68172. req, err := http.NewRequest("POST", urls, body)
  68173. if err != nil {
  68174. return nil, err
  68175. }
  68176. req.Header = reqHeaders
  68177. googleapi.Expand(req.URL, map[string]string{
  68178. "project": c.project,
  68179. "zone": c.zone,
  68180. "resource": c.resource,
  68181. })
  68182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68183. }
  68184. // Do executes the "compute.instanceGroups.testIamPermissions" call.
  68185. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  68186. // non-2xx status code is an error. Response headers are in either
  68187. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  68188. // returned at all) in error.(*googleapi.Error).Header. Use
  68189. // googleapi.IsNotModified to check whether the returned error was
  68190. // because http.StatusNotModified was returned.
  68191. func (c *InstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  68192. gensupport.SetOptions(c.urlParams_, opts...)
  68193. res, err := c.doRequest("json")
  68194. if res != nil && res.StatusCode == http.StatusNotModified {
  68195. if res.Body != nil {
  68196. res.Body.Close()
  68197. }
  68198. return nil, &googleapi.Error{
  68199. Code: res.StatusCode,
  68200. Header: res.Header,
  68201. }
  68202. }
  68203. if err != nil {
  68204. return nil, err
  68205. }
  68206. defer googleapi.CloseBody(res)
  68207. if err := googleapi.CheckResponse(res); err != nil {
  68208. return nil, err
  68209. }
  68210. ret := &TestPermissionsResponse{
  68211. ServerResponse: googleapi.ServerResponse{
  68212. Header: res.Header,
  68213. HTTPStatusCode: res.StatusCode,
  68214. },
  68215. }
  68216. target := &ret
  68217. if err := gensupport.DecodeResponse(target, res); err != nil {
  68218. return nil, err
  68219. }
  68220. return ret, nil
  68221. // {
  68222. // "description": "Returns permissions that a caller has on the specified resource.",
  68223. // "httpMethod": "POST",
  68224. // "id": "compute.instanceGroups.testIamPermissions",
  68225. // "parameterOrder": [
  68226. // "project",
  68227. // "zone",
  68228. // "resource"
  68229. // ],
  68230. // "parameters": {
  68231. // "project": {
  68232. // "description": "Project ID for this request.",
  68233. // "location": "path",
  68234. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68235. // "required": true,
  68236. // "type": "string"
  68237. // },
  68238. // "resource": {
  68239. // "description": "Name or id of the resource for this request.",
  68240. // "location": "path",
  68241. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68242. // "required": true,
  68243. // "type": "string"
  68244. // },
  68245. // "zone": {
  68246. // "description": "The name of the zone for this request.",
  68247. // "location": "path",
  68248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68249. // "required": true,
  68250. // "type": "string"
  68251. // }
  68252. // },
  68253. // "path": "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions",
  68254. // "request": {
  68255. // "$ref": "TestPermissionsRequest"
  68256. // },
  68257. // "response": {
  68258. // "$ref": "TestPermissionsResponse"
  68259. // },
  68260. // "scopes": [
  68261. // "https://www.googleapis.com/auth/cloud-platform",
  68262. // "https://www.googleapis.com/auth/compute",
  68263. // "https://www.googleapis.com/auth/compute.readonly"
  68264. // ]
  68265. // }
  68266. }
  68267. // method id "compute.instanceTemplates.delete":
  68268. type InstanceTemplatesDeleteCall struct {
  68269. s *Service
  68270. project string
  68271. instanceTemplate string
  68272. urlParams_ gensupport.URLParams
  68273. ctx_ context.Context
  68274. header_ http.Header
  68275. }
  68276. // Delete: Deletes the specified instance template. Deleting an instance
  68277. // template is permanent and cannot be undone. It is not possible to
  68278. // delete templates that are already in use by a managed instance group.
  68279. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  68280. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  68281. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68282. c.project = project
  68283. c.instanceTemplate = instanceTemplate
  68284. return c
  68285. }
  68286. // RequestId sets the optional parameter "requestId": An optional
  68287. // request ID to identify requests. Specify a unique request ID so that
  68288. // if you must retry your request, the server will know to ignore the
  68289. // request if it has already been completed.
  68290. //
  68291. // For example, consider a situation where you make an initial request
  68292. // and the request times out. If you make the request again with the
  68293. // same request ID, the server can check if original operation with the
  68294. // same request ID was received, and if so, will ignore the second
  68295. // request. This prevents clients from accidentally creating duplicate
  68296. // commitments.
  68297. //
  68298. // The request ID must be a valid UUID with the exception that zero UUID
  68299. // is not supported (00000000-0000-0000-0000-000000000000).
  68300. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  68301. c.urlParams_.Set("requestId", requestId)
  68302. return c
  68303. }
  68304. // Fields allows partial responses to be retrieved. See
  68305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68306. // for more information.
  68307. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  68308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68309. return c
  68310. }
  68311. // Context sets the context to be used in this call's Do method. Any
  68312. // pending HTTP request will be aborted if the provided context is
  68313. // canceled.
  68314. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  68315. c.ctx_ = ctx
  68316. return c
  68317. }
  68318. // Header returns an http.Header that can be modified by the caller to
  68319. // add HTTP headers to the request.
  68320. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  68321. if c.header_ == nil {
  68322. c.header_ = make(http.Header)
  68323. }
  68324. return c.header_
  68325. }
  68326. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  68327. reqHeaders := make(http.Header)
  68328. for k, v := range c.header_ {
  68329. reqHeaders[k] = v
  68330. }
  68331. reqHeaders.Set("User-Agent", c.s.userAgent())
  68332. var body io.Reader = nil
  68333. c.urlParams_.Set("alt", alt)
  68334. c.urlParams_.Set("prettyPrint", "false")
  68335. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  68336. urls += "?" + c.urlParams_.Encode()
  68337. req, err := http.NewRequest("DELETE", urls, body)
  68338. if err != nil {
  68339. return nil, err
  68340. }
  68341. req.Header = reqHeaders
  68342. googleapi.Expand(req.URL, map[string]string{
  68343. "project": c.project,
  68344. "instanceTemplate": c.instanceTemplate,
  68345. })
  68346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68347. }
  68348. // Do executes the "compute.instanceTemplates.delete" call.
  68349. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68350. // status code is an error. Response headers are in either
  68351. // *Operation.ServerResponse.Header or (if a response was returned at
  68352. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68353. // to check whether the returned error was because
  68354. // http.StatusNotModified was returned.
  68355. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68356. gensupport.SetOptions(c.urlParams_, opts...)
  68357. res, err := c.doRequest("json")
  68358. if res != nil && res.StatusCode == http.StatusNotModified {
  68359. if res.Body != nil {
  68360. res.Body.Close()
  68361. }
  68362. return nil, &googleapi.Error{
  68363. Code: res.StatusCode,
  68364. Header: res.Header,
  68365. }
  68366. }
  68367. if err != nil {
  68368. return nil, err
  68369. }
  68370. defer googleapi.CloseBody(res)
  68371. if err := googleapi.CheckResponse(res); err != nil {
  68372. return nil, err
  68373. }
  68374. ret := &Operation{
  68375. ServerResponse: googleapi.ServerResponse{
  68376. Header: res.Header,
  68377. HTTPStatusCode: res.StatusCode,
  68378. },
  68379. }
  68380. target := &ret
  68381. if err := gensupport.DecodeResponse(target, res); err != nil {
  68382. return nil, err
  68383. }
  68384. return ret, nil
  68385. // {
  68386. // "description": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.",
  68387. // "httpMethod": "DELETE",
  68388. // "id": "compute.instanceTemplates.delete",
  68389. // "parameterOrder": [
  68390. // "project",
  68391. // "instanceTemplate"
  68392. // ],
  68393. // "parameters": {
  68394. // "instanceTemplate": {
  68395. // "description": "The name of the instance template to delete.",
  68396. // "location": "path",
  68397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68398. // "required": true,
  68399. // "type": "string"
  68400. // },
  68401. // "project": {
  68402. // "description": "Project ID for this request.",
  68403. // "location": "path",
  68404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68405. // "required": true,
  68406. // "type": "string"
  68407. // },
  68408. // "requestId": {
  68409. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68410. // "location": "query",
  68411. // "type": "string"
  68412. // }
  68413. // },
  68414. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  68415. // "response": {
  68416. // "$ref": "Operation"
  68417. // },
  68418. // "scopes": [
  68419. // "https://www.googleapis.com/auth/cloud-platform",
  68420. // "https://www.googleapis.com/auth/compute"
  68421. // ]
  68422. // }
  68423. }
  68424. // method id "compute.instanceTemplates.get":
  68425. type InstanceTemplatesGetCall struct {
  68426. s *Service
  68427. project string
  68428. instanceTemplate string
  68429. urlParams_ gensupport.URLParams
  68430. ifNoneMatch_ string
  68431. ctx_ context.Context
  68432. header_ http.Header
  68433. }
  68434. // Get: Returns the specified instance template. Gets a list of
  68435. // available instance templates by making a list() request.
  68436. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  68437. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  68438. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68439. c.project = project
  68440. c.instanceTemplate = instanceTemplate
  68441. return c
  68442. }
  68443. // Fields allows partial responses to be retrieved. See
  68444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68445. // for more information.
  68446. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  68447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68448. return c
  68449. }
  68450. // IfNoneMatch sets the optional parameter which makes the operation
  68451. // fail if the object's ETag matches the given value. This is useful for
  68452. // getting updates only after the object has changed since the last
  68453. // request. Use googleapi.IsNotModified to check whether the response
  68454. // error from Do is the result of In-None-Match.
  68455. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  68456. c.ifNoneMatch_ = entityTag
  68457. return c
  68458. }
  68459. // Context sets the context to be used in this call's Do method. Any
  68460. // pending HTTP request will be aborted if the provided context is
  68461. // canceled.
  68462. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  68463. c.ctx_ = ctx
  68464. return c
  68465. }
  68466. // Header returns an http.Header that can be modified by the caller to
  68467. // add HTTP headers to the request.
  68468. func (c *InstanceTemplatesGetCall) Header() http.Header {
  68469. if c.header_ == nil {
  68470. c.header_ = make(http.Header)
  68471. }
  68472. return c.header_
  68473. }
  68474. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  68475. reqHeaders := make(http.Header)
  68476. for k, v := range c.header_ {
  68477. reqHeaders[k] = v
  68478. }
  68479. reqHeaders.Set("User-Agent", c.s.userAgent())
  68480. if c.ifNoneMatch_ != "" {
  68481. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68482. }
  68483. var body io.Reader = nil
  68484. c.urlParams_.Set("alt", alt)
  68485. c.urlParams_.Set("prettyPrint", "false")
  68486. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  68487. urls += "?" + c.urlParams_.Encode()
  68488. req, err := http.NewRequest("GET", urls, body)
  68489. if err != nil {
  68490. return nil, err
  68491. }
  68492. req.Header = reqHeaders
  68493. googleapi.Expand(req.URL, map[string]string{
  68494. "project": c.project,
  68495. "instanceTemplate": c.instanceTemplate,
  68496. })
  68497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68498. }
  68499. // Do executes the "compute.instanceTemplates.get" call.
  68500. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  68501. // non-2xx status code is an error. Response headers are in either
  68502. // *InstanceTemplate.ServerResponse.Header or (if a response was
  68503. // returned at all) in error.(*googleapi.Error).Header. Use
  68504. // googleapi.IsNotModified to check whether the returned error was
  68505. // because http.StatusNotModified was returned.
  68506. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  68507. gensupport.SetOptions(c.urlParams_, opts...)
  68508. res, err := c.doRequest("json")
  68509. if res != nil && res.StatusCode == http.StatusNotModified {
  68510. if res.Body != nil {
  68511. res.Body.Close()
  68512. }
  68513. return nil, &googleapi.Error{
  68514. Code: res.StatusCode,
  68515. Header: res.Header,
  68516. }
  68517. }
  68518. if err != nil {
  68519. return nil, err
  68520. }
  68521. defer googleapi.CloseBody(res)
  68522. if err := googleapi.CheckResponse(res); err != nil {
  68523. return nil, err
  68524. }
  68525. ret := &InstanceTemplate{
  68526. ServerResponse: googleapi.ServerResponse{
  68527. Header: res.Header,
  68528. HTTPStatusCode: res.StatusCode,
  68529. },
  68530. }
  68531. target := &ret
  68532. if err := gensupport.DecodeResponse(target, res); err != nil {
  68533. return nil, err
  68534. }
  68535. return ret, nil
  68536. // {
  68537. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  68538. // "httpMethod": "GET",
  68539. // "id": "compute.instanceTemplates.get",
  68540. // "parameterOrder": [
  68541. // "project",
  68542. // "instanceTemplate"
  68543. // ],
  68544. // "parameters": {
  68545. // "instanceTemplate": {
  68546. // "description": "The name of the instance template.",
  68547. // "location": "path",
  68548. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68549. // "required": true,
  68550. // "type": "string"
  68551. // },
  68552. // "project": {
  68553. // "description": "Project ID for this request.",
  68554. // "location": "path",
  68555. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68556. // "required": true,
  68557. // "type": "string"
  68558. // }
  68559. // },
  68560. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  68561. // "response": {
  68562. // "$ref": "InstanceTemplate"
  68563. // },
  68564. // "scopes": [
  68565. // "https://www.googleapis.com/auth/cloud-platform",
  68566. // "https://www.googleapis.com/auth/compute",
  68567. // "https://www.googleapis.com/auth/compute.readonly"
  68568. // ]
  68569. // }
  68570. }
  68571. // method id "compute.instanceTemplates.getIamPolicy":
  68572. type InstanceTemplatesGetIamPolicyCall struct {
  68573. s *Service
  68574. project string
  68575. resource string
  68576. urlParams_ gensupport.URLParams
  68577. ifNoneMatch_ string
  68578. ctx_ context.Context
  68579. header_ http.Header
  68580. }
  68581. // GetIamPolicy: Gets the access control policy for a resource. May be
  68582. // empty if no such policy or resource exists.
  68583. func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
  68584. c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68585. c.project = project
  68586. c.resource = resource
  68587. return c
  68588. }
  68589. // Fields allows partial responses to be retrieved. See
  68590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68591. // for more information.
  68592. func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
  68593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68594. return c
  68595. }
  68596. // IfNoneMatch sets the optional parameter which makes the operation
  68597. // fail if the object's ETag matches the given value. This is useful for
  68598. // getting updates only after the object has changed since the last
  68599. // request. Use googleapi.IsNotModified to check whether the response
  68600. // error from Do is the result of In-None-Match.
  68601. func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
  68602. c.ifNoneMatch_ = entityTag
  68603. return c
  68604. }
  68605. // Context sets the context to be used in this call's Do method. Any
  68606. // pending HTTP request will be aborted if the provided context is
  68607. // canceled.
  68608. func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
  68609. c.ctx_ = ctx
  68610. return c
  68611. }
  68612. // Header returns an http.Header that can be modified by the caller to
  68613. // add HTTP headers to the request.
  68614. func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
  68615. if c.header_ == nil {
  68616. c.header_ = make(http.Header)
  68617. }
  68618. return c.header_
  68619. }
  68620. func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  68621. reqHeaders := make(http.Header)
  68622. for k, v := range c.header_ {
  68623. reqHeaders[k] = v
  68624. }
  68625. reqHeaders.Set("User-Agent", c.s.userAgent())
  68626. if c.ifNoneMatch_ != "" {
  68627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68628. }
  68629. var body io.Reader = nil
  68630. c.urlParams_.Set("alt", alt)
  68631. c.urlParams_.Set("prettyPrint", "false")
  68632. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/getIamPolicy")
  68633. urls += "?" + c.urlParams_.Encode()
  68634. req, err := http.NewRequest("GET", urls, body)
  68635. if err != nil {
  68636. return nil, err
  68637. }
  68638. req.Header = reqHeaders
  68639. googleapi.Expand(req.URL, map[string]string{
  68640. "project": c.project,
  68641. "resource": c.resource,
  68642. })
  68643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68644. }
  68645. // Do executes the "compute.instanceTemplates.getIamPolicy" call.
  68646. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  68647. // code is an error. Response headers are in either
  68648. // *Policy.ServerResponse.Header or (if a response was returned at all)
  68649. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  68650. // check whether the returned error was because http.StatusNotModified
  68651. // was returned.
  68652. func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  68653. gensupport.SetOptions(c.urlParams_, opts...)
  68654. res, err := c.doRequest("json")
  68655. if res != nil && res.StatusCode == http.StatusNotModified {
  68656. if res.Body != nil {
  68657. res.Body.Close()
  68658. }
  68659. return nil, &googleapi.Error{
  68660. Code: res.StatusCode,
  68661. Header: res.Header,
  68662. }
  68663. }
  68664. if err != nil {
  68665. return nil, err
  68666. }
  68667. defer googleapi.CloseBody(res)
  68668. if err := googleapi.CheckResponse(res); err != nil {
  68669. return nil, err
  68670. }
  68671. ret := &Policy{
  68672. ServerResponse: googleapi.ServerResponse{
  68673. Header: res.Header,
  68674. HTTPStatusCode: res.StatusCode,
  68675. },
  68676. }
  68677. target := &ret
  68678. if err := gensupport.DecodeResponse(target, res); err != nil {
  68679. return nil, err
  68680. }
  68681. return ret, nil
  68682. // {
  68683. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  68684. // "httpMethod": "GET",
  68685. // "id": "compute.instanceTemplates.getIamPolicy",
  68686. // "parameterOrder": [
  68687. // "project",
  68688. // "resource"
  68689. // ],
  68690. // "parameters": {
  68691. // "project": {
  68692. // "description": "Project ID for this request.",
  68693. // "location": "path",
  68694. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68695. // "required": true,
  68696. // "type": "string"
  68697. // },
  68698. // "resource": {
  68699. // "description": "Name or id of the resource for this request.",
  68700. // "location": "path",
  68701. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68702. // "required": true,
  68703. // "type": "string"
  68704. // }
  68705. // },
  68706. // "path": "{project}/global/instanceTemplates/{resource}/getIamPolicy",
  68707. // "response": {
  68708. // "$ref": "Policy"
  68709. // },
  68710. // "scopes": [
  68711. // "https://www.googleapis.com/auth/cloud-platform",
  68712. // "https://www.googleapis.com/auth/compute",
  68713. // "https://www.googleapis.com/auth/compute.readonly"
  68714. // ]
  68715. // }
  68716. }
  68717. // method id "compute.instanceTemplates.insert":
  68718. type InstanceTemplatesInsertCall struct {
  68719. s *Service
  68720. project string
  68721. instancetemplate *InstanceTemplate
  68722. urlParams_ gensupport.URLParams
  68723. ctx_ context.Context
  68724. header_ http.Header
  68725. }
  68726. // Insert: Creates an instance template in the specified project using
  68727. // the data that is included in the request. If you are creating a new
  68728. // template to update an existing instance group, your new instance
  68729. // template must use the same network or, if applicable, the same
  68730. // subnetwork as the original template.
  68731. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  68732. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  68733. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68734. c.project = project
  68735. c.instancetemplate = instancetemplate
  68736. return c
  68737. }
  68738. // RequestId sets the optional parameter "requestId": An optional
  68739. // request ID to identify requests. Specify a unique request ID so that
  68740. // if you must retry your request, the server will know to ignore the
  68741. // request if it has already been completed.
  68742. //
  68743. // For example, consider a situation where you make an initial request
  68744. // and the request times out. If you make the request again with the
  68745. // same request ID, the server can check if original operation with the
  68746. // same request ID was received, and if so, will ignore the second
  68747. // request. This prevents clients from accidentally creating duplicate
  68748. // commitments.
  68749. //
  68750. // The request ID must be a valid UUID with the exception that zero UUID
  68751. // is not supported (00000000-0000-0000-0000-000000000000).
  68752. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  68753. c.urlParams_.Set("requestId", requestId)
  68754. return c
  68755. }
  68756. // Fields allows partial responses to be retrieved. See
  68757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68758. // for more information.
  68759. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  68760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68761. return c
  68762. }
  68763. // Context sets the context to be used in this call's Do method. Any
  68764. // pending HTTP request will be aborted if the provided context is
  68765. // canceled.
  68766. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  68767. c.ctx_ = ctx
  68768. return c
  68769. }
  68770. // Header returns an http.Header that can be modified by the caller to
  68771. // add HTTP headers to the request.
  68772. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  68773. if c.header_ == nil {
  68774. c.header_ = make(http.Header)
  68775. }
  68776. return c.header_
  68777. }
  68778. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  68779. reqHeaders := make(http.Header)
  68780. for k, v := range c.header_ {
  68781. reqHeaders[k] = v
  68782. }
  68783. reqHeaders.Set("User-Agent", c.s.userAgent())
  68784. var body io.Reader = nil
  68785. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  68786. if err != nil {
  68787. return nil, err
  68788. }
  68789. reqHeaders.Set("Content-Type", "application/json")
  68790. c.urlParams_.Set("alt", alt)
  68791. c.urlParams_.Set("prettyPrint", "false")
  68792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  68793. urls += "?" + c.urlParams_.Encode()
  68794. req, err := http.NewRequest("POST", urls, body)
  68795. if err != nil {
  68796. return nil, err
  68797. }
  68798. req.Header = reqHeaders
  68799. googleapi.Expand(req.URL, map[string]string{
  68800. "project": c.project,
  68801. })
  68802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68803. }
  68804. // Do executes the "compute.instanceTemplates.insert" call.
  68805. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68806. // status code is an error. Response headers are in either
  68807. // *Operation.ServerResponse.Header or (if a response was returned at
  68808. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68809. // to check whether the returned error was because
  68810. // http.StatusNotModified was returned.
  68811. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68812. gensupport.SetOptions(c.urlParams_, opts...)
  68813. res, err := c.doRequest("json")
  68814. if res != nil && res.StatusCode == http.StatusNotModified {
  68815. if res.Body != nil {
  68816. res.Body.Close()
  68817. }
  68818. return nil, &googleapi.Error{
  68819. Code: res.StatusCode,
  68820. Header: res.Header,
  68821. }
  68822. }
  68823. if err != nil {
  68824. return nil, err
  68825. }
  68826. defer googleapi.CloseBody(res)
  68827. if err := googleapi.CheckResponse(res); err != nil {
  68828. return nil, err
  68829. }
  68830. ret := &Operation{
  68831. ServerResponse: googleapi.ServerResponse{
  68832. Header: res.Header,
  68833. HTTPStatusCode: res.StatusCode,
  68834. },
  68835. }
  68836. target := &ret
  68837. if err := gensupport.DecodeResponse(target, res); err != nil {
  68838. return nil, err
  68839. }
  68840. return ret, nil
  68841. // {
  68842. // "description": "Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.",
  68843. // "httpMethod": "POST",
  68844. // "id": "compute.instanceTemplates.insert",
  68845. // "parameterOrder": [
  68846. // "project"
  68847. // ],
  68848. // "parameters": {
  68849. // "project": {
  68850. // "description": "Project ID for this request.",
  68851. // "location": "path",
  68852. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68853. // "required": true,
  68854. // "type": "string"
  68855. // },
  68856. // "requestId": {
  68857. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68858. // "location": "query",
  68859. // "type": "string"
  68860. // }
  68861. // },
  68862. // "path": "{project}/global/instanceTemplates",
  68863. // "request": {
  68864. // "$ref": "InstanceTemplate"
  68865. // },
  68866. // "response": {
  68867. // "$ref": "Operation"
  68868. // },
  68869. // "scopes": [
  68870. // "https://www.googleapis.com/auth/cloud-platform",
  68871. // "https://www.googleapis.com/auth/compute"
  68872. // ]
  68873. // }
  68874. }
  68875. // method id "compute.instanceTemplates.list":
  68876. type InstanceTemplatesListCall struct {
  68877. s *Service
  68878. project string
  68879. urlParams_ gensupport.URLParams
  68880. ifNoneMatch_ string
  68881. ctx_ context.Context
  68882. header_ http.Header
  68883. }
  68884. // List: Retrieves a list of instance templates that are contained
  68885. // within the specified project.
  68886. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  68887. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  68888. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68889. c.project = project
  68890. return c
  68891. }
  68892. // Filter sets the optional parameter "filter": A filter expression that
  68893. // filters resources listed in the response. The expression must specify
  68894. // the field name, a comparison operator, and the value that you want to
  68895. // use for filtering. The value must be a string, a number, or a
  68896. // boolean. The comparison operator must be either =, !=, >, or <.
  68897. //
  68898. // For example, if you are filtering Compute Engine instances, you can
  68899. // exclude instances named example-instance by specifying name !=
  68900. // example-instance.
  68901. //
  68902. // You can also filter nested fields. For example, you could specify
  68903. // scheduling.automaticRestart = false to include instances only if they
  68904. // are not scheduled for automatic restarts. You can use filtering on
  68905. // nested fields to filter based on resource labels.
  68906. //
  68907. // To filter on multiple expressions, provide each separate expression
  68908. // within parentheses. For example, (scheduling.automaticRestart = true)
  68909. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68910. // AND expression. However, you can include AND and OR expressions
  68911. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68912. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68913. // true).
  68914. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  68915. c.urlParams_.Set("filter", filter)
  68916. return c
  68917. }
  68918. // MaxResults sets the optional parameter "maxResults": The maximum
  68919. // number of results per page that should be returned. If the number of
  68920. // available results is larger than maxResults, Compute Engine returns a
  68921. // nextPageToken that can be used to get the next page of results in
  68922. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68923. // (Default: 500)
  68924. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  68925. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68926. return c
  68927. }
  68928. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68929. // a certain order. By default, results are returned in alphanumerical
  68930. // order based on the resource name.
  68931. //
  68932. // You can also sort results in descending order based on the creation
  68933. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68934. // based on the creationTimestamp field in reverse chronological order
  68935. // (newest result first). Use this to sort resources like operations so
  68936. // that the newest operation is returned first.
  68937. //
  68938. // Currently, only sorting by name or creationTimestamp desc is
  68939. // supported.
  68940. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  68941. c.urlParams_.Set("orderBy", orderBy)
  68942. return c
  68943. }
  68944. // PageToken sets the optional parameter "pageToken": Specifies a page
  68945. // token to use. Set pageToken to the nextPageToken returned by a
  68946. // previous list request to get the next page of results.
  68947. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  68948. c.urlParams_.Set("pageToken", pageToken)
  68949. return c
  68950. }
  68951. // Fields allows partial responses to be retrieved. See
  68952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68953. // for more information.
  68954. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  68955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68956. return c
  68957. }
  68958. // IfNoneMatch sets the optional parameter which makes the operation
  68959. // fail if the object's ETag matches the given value. This is useful for
  68960. // getting updates only after the object has changed since the last
  68961. // request. Use googleapi.IsNotModified to check whether the response
  68962. // error from Do is the result of In-None-Match.
  68963. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  68964. c.ifNoneMatch_ = entityTag
  68965. return c
  68966. }
  68967. // Context sets the context to be used in this call's Do method. Any
  68968. // pending HTTP request will be aborted if the provided context is
  68969. // canceled.
  68970. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  68971. c.ctx_ = ctx
  68972. return c
  68973. }
  68974. // Header returns an http.Header that can be modified by the caller to
  68975. // add HTTP headers to the request.
  68976. func (c *InstanceTemplatesListCall) Header() http.Header {
  68977. if c.header_ == nil {
  68978. c.header_ = make(http.Header)
  68979. }
  68980. return c.header_
  68981. }
  68982. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  68983. reqHeaders := make(http.Header)
  68984. for k, v := range c.header_ {
  68985. reqHeaders[k] = v
  68986. }
  68987. reqHeaders.Set("User-Agent", c.s.userAgent())
  68988. if c.ifNoneMatch_ != "" {
  68989. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68990. }
  68991. var body io.Reader = nil
  68992. c.urlParams_.Set("alt", alt)
  68993. c.urlParams_.Set("prettyPrint", "false")
  68994. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  68995. urls += "?" + c.urlParams_.Encode()
  68996. req, err := http.NewRequest("GET", urls, body)
  68997. if err != nil {
  68998. return nil, err
  68999. }
  69000. req.Header = reqHeaders
  69001. googleapi.Expand(req.URL, map[string]string{
  69002. "project": c.project,
  69003. })
  69004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69005. }
  69006. // Do executes the "compute.instanceTemplates.list" call.
  69007. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  69008. // non-2xx status code is an error. Response headers are in either
  69009. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  69010. // returned at all) in error.(*googleapi.Error).Header. Use
  69011. // googleapi.IsNotModified to check whether the returned error was
  69012. // because http.StatusNotModified was returned.
  69013. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  69014. gensupport.SetOptions(c.urlParams_, opts...)
  69015. res, err := c.doRequest("json")
  69016. if res != nil && res.StatusCode == http.StatusNotModified {
  69017. if res.Body != nil {
  69018. res.Body.Close()
  69019. }
  69020. return nil, &googleapi.Error{
  69021. Code: res.StatusCode,
  69022. Header: res.Header,
  69023. }
  69024. }
  69025. if err != nil {
  69026. return nil, err
  69027. }
  69028. defer googleapi.CloseBody(res)
  69029. if err := googleapi.CheckResponse(res); err != nil {
  69030. return nil, err
  69031. }
  69032. ret := &InstanceTemplateList{
  69033. ServerResponse: googleapi.ServerResponse{
  69034. Header: res.Header,
  69035. HTTPStatusCode: res.StatusCode,
  69036. },
  69037. }
  69038. target := &ret
  69039. if err := gensupport.DecodeResponse(target, res); err != nil {
  69040. return nil, err
  69041. }
  69042. return ret, nil
  69043. // {
  69044. // "description": "Retrieves a list of instance templates that are contained within the specified project.",
  69045. // "httpMethod": "GET",
  69046. // "id": "compute.instanceTemplates.list",
  69047. // "parameterOrder": [
  69048. // "project"
  69049. // ],
  69050. // "parameters": {
  69051. // "filter": {
  69052. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  69053. // "location": "query",
  69054. // "type": "string"
  69055. // },
  69056. // "maxResults": {
  69057. // "default": "500",
  69058. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  69059. // "format": "uint32",
  69060. // "location": "query",
  69061. // "minimum": "0",
  69062. // "type": "integer"
  69063. // },
  69064. // "orderBy": {
  69065. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  69066. // "location": "query",
  69067. // "type": "string"
  69068. // },
  69069. // "pageToken": {
  69070. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  69071. // "location": "query",
  69072. // "type": "string"
  69073. // },
  69074. // "project": {
  69075. // "description": "Project ID for this request.",
  69076. // "location": "path",
  69077. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69078. // "required": true,
  69079. // "type": "string"
  69080. // }
  69081. // },
  69082. // "path": "{project}/global/instanceTemplates",
  69083. // "response": {
  69084. // "$ref": "InstanceTemplateList"
  69085. // },
  69086. // "scopes": [
  69087. // "https://www.googleapis.com/auth/cloud-platform",
  69088. // "https://www.googleapis.com/auth/compute",
  69089. // "https://www.googleapis.com/auth/compute.readonly"
  69090. // ]
  69091. // }
  69092. }
  69093. // Pages invokes f for each page of results.
  69094. // A non-nil error returned from f will halt the iteration.
  69095. // The provided context supersedes any context provided to the Context method.
  69096. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  69097. c.ctx_ = ctx
  69098. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69099. for {
  69100. x, err := c.Do()
  69101. if err != nil {
  69102. return err
  69103. }
  69104. if err := f(x); err != nil {
  69105. return err
  69106. }
  69107. if x.NextPageToken == "" {
  69108. return nil
  69109. }
  69110. c.PageToken(x.NextPageToken)
  69111. }
  69112. }
  69113. // method id "compute.instanceTemplates.setIamPolicy":
  69114. type InstanceTemplatesSetIamPolicyCall struct {
  69115. s *Service
  69116. project string
  69117. resource string
  69118. globalsetpolicyrequest *GlobalSetPolicyRequest
  69119. urlParams_ gensupport.URLParams
  69120. ctx_ context.Context
  69121. header_ http.Header
  69122. }
  69123. // SetIamPolicy: Sets the access control policy on the specified
  69124. // resource. Replaces any existing policy.
  69125. func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
  69126. c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69127. c.project = project
  69128. c.resource = resource
  69129. c.globalsetpolicyrequest = globalsetpolicyrequest
  69130. return c
  69131. }
  69132. // Fields allows partial responses to be retrieved. See
  69133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69134. // for more information.
  69135. func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
  69136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69137. return c
  69138. }
  69139. // Context sets the context to be used in this call's Do method. Any
  69140. // pending HTTP request will be aborted if the provided context is
  69141. // canceled.
  69142. func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
  69143. c.ctx_ = ctx
  69144. return c
  69145. }
  69146. // Header returns an http.Header that can be modified by the caller to
  69147. // add HTTP headers to the request.
  69148. func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
  69149. if c.header_ == nil {
  69150. c.header_ = make(http.Header)
  69151. }
  69152. return c.header_
  69153. }
  69154. func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  69155. reqHeaders := make(http.Header)
  69156. for k, v := range c.header_ {
  69157. reqHeaders[k] = v
  69158. }
  69159. reqHeaders.Set("User-Agent", c.s.userAgent())
  69160. var body io.Reader = nil
  69161. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  69162. if err != nil {
  69163. return nil, err
  69164. }
  69165. reqHeaders.Set("Content-Type", "application/json")
  69166. c.urlParams_.Set("alt", alt)
  69167. c.urlParams_.Set("prettyPrint", "false")
  69168. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/setIamPolicy")
  69169. urls += "?" + c.urlParams_.Encode()
  69170. req, err := http.NewRequest("POST", urls, body)
  69171. if err != nil {
  69172. return nil, err
  69173. }
  69174. req.Header = reqHeaders
  69175. googleapi.Expand(req.URL, map[string]string{
  69176. "project": c.project,
  69177. "resource": c.resource,
  69178. })
  69179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69180. }
  69181. // Do executes the "compute.instanceTemplates.setIamPolicy" call.
  69182. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  69183. // code is an error. Response headers are in either
  69184. // *Policy.ServerResponse.Header or (if a response was returned at all)
  69185. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  69186. // check whether the returned error was because http.StatusNotModified
  69187. // was returned.
  69188. func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  69189. gensupport.SetOptions(c.urlParams_, opts...)
  69190. res, err := c.doRequest("json")
  69191. if res != nil && res.StatusCode == http.StatusNotModified {
  69192. if res.Body != nil {
  69193. res.Body.Close()
  69194. }
  69195. return nil, &googleapi.Error{
  69196. Code: res.StatusCode,
  69197. Header: res.Header,
  69198. }
  69199. }
  69200. if err != nil {
  69201. return nil, err
  69202. }
  69203. defer googleapi.CloseBody(res)
  69204. if err := googleapi.CheckResponse(res); err != nil {
  69205. return nil, err
  69206. }
  69207. ret := &Policy{
  69208. ServerResponse: googleapi.ServerResponse{
  69209. Header: res.Header,
  69210. HTTPStatusCode: res.StatusCode,
  69211. },
  69212. }
  69213. target := &ret
  69214. if err := gensupport.DecodeResponse(target, res); err != nil {
  69215. return nil, err
  69216. }
  69217. return ret, nil
  69218. // {
  69219. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  69220. // "httpMethod": "POST",
  69221. // "id": "compute.instanceTemplates.setIamPolicy",
  69222. // "parameterOrder": [
  69223. // "project",
  69224. // "resource"
  69225. // ],
  69226. // "parameters": {
  69227. // "project": {
  69228. // "description": "Project ID for this request.",
  69229. // "location": "path",
  69230. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69231. // "required": true,
  69232. // "type": "string"
  69233. // },
  69234. // "resource": {
  69235. // "description": "Name or id of the resource for this request.",
  69236. // "location": "path",
  69237. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69238. // "required": true,
  69239. // "type": "string"
  69240. // }
  69241. // },
  69242. // "path": "{project}/global/instanceTemplates/{resource}/setIamPolicy",
  69243. // "request": {
  69244. // "$ref": "GlobalSetPolicyRequest"
  69245. // },
  69246. // "response": {
  69247. // "$ref": "Policy"
  69248. // },
  69249. // "scopes": [
  69250. // "https://www.googleapis.com/auth/cloud-platform",
  69251. // "https://www.googleapis.com/auth/compute"
  69252. // ]
  69253. // }
  69254. }
  69255. // method id "compute.instanceTemplates.testIamPermissions":
  69256. type InstanceTemplatesTestIamPermissionsCall struct {
  69257. s *Service
  69258. project string
  69259. resource string
  69260. testpermissionsrequest *TestPermissionsRequest
  69261. urlParams_ gensupport.URLParams
  69262. ctx_ context.Context
  69263. header_ http.Header
  69264. }
  69265. // TestIamPermissions: Returns permissions that a caller has on the
  69266. // specified resource.
  69267. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  69268. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69269. c.project = project
  69270. c.resource = resource
  69271. c.testpermissionsrequest = testpermissionsrequest
  69272. return c
  69273. }
  69274. // Fields allows partial responses to be retrieved. See
  69275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69276. // for more information.
  69277. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  69278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69279. return c
  69280. }
  69281. // Context sets the context to be used in this call's Do method. Any
  69282. // pending HTTP request will be aborted if the provided context is
  69283. // canceled.
  69284. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  69285. c.ctx_ = ctx
  69286. return c
  69287. }
  69288. // Header returns an http.Header that can be modified by the caller to
  69289. // add HTTP headers to the request.
  69290. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  69291. if c.header_ == nil {
  69292. c.header_ = make(http.Header)
  69293. }
  69294. return c.header_
  69295. }
  69296. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  69297. reqHeaders := make(http.Header)
  69298. for k, v := range c.header_ {
  69299. reqHeaders[k] = v
  69300. }
  69301. reqHeaders.Set("User-Agent", c.s.userAgent())
  69302. var body io.Reader = nil
  69303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  69304. if err != nil {
  69305. return nil, err
  69306. }
  69307. reqHeaders.Set("Content-Type", "application/json")
  69308. c.urlParams_.Set("alt", alt)
  69309. c.urlParams_.Set("prettyPrint", "false")
  69310. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  69311. urls += "?" + c.urlParams_.Encode()
  69312. req, err := http.NewRequest("POST", urls, body)
  69313. if err != nil {
  69314. return nil, err
  69315. }
  69316. req.Header = reqHeaders
  69317. googleapi.Expand(req.URL, map[string]string{
  69318. "project": c.project,
  69319. "resource": c.resource,
  69320. })
  69321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69322. }
  69323. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  69324. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  69325. // non-2xx status code is an error. Response headers are in either
  69326. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  69327. // returned at all) in error.(*googleapi.Error).Header. Use
  69328. // googleapi.IsNotModified to check whether the returned error was
  69329. // because http.StatusNotModified was returned.
  69330. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  69331. gensupport.SetOptions(c.urlParams_, opts...)
  69332. res, err := c.doRequest("json")
  69333. if res != nil && res.StatusCode == http.StatusNotModified {
  69334. if res.Body != nil {
  69335. res.Body.Close()
  69336. }
  69337. return nil, &googleapi.Error{
  69338. Code: res.StatusCode,
  69339. Header: res.Header,
  69340. }
  69341. }
  69342. if err != nil {
  69343. return nil, err
  69344. }
  69345. defer googleapi.CloseBody(res)
  69346. if err := googleapi.CheckResponse(res); err != nil {
  69347. return nil, err
  69348. }
  69349. ret := &TestPermissionsResponse{
  69350. ServerResponse: googleapi.ServerResponse{
  69351. Header: res.Header,
  69352. HTTPStatusCode: res.StatusCode,
  69353. },
  69354. }
  69355. target := &ret
  69356. if err := gensupport.DecodeResponse(target, res); err != nil {
  69357. return nil, err
  69358. }
  69359. return ret, nil
  69360. // {
  69361. // "description": "Returns permissions that a caller has on the specified resource.",
  69362. // "httpMethod": "POST",
  69363. // "id": "compute.instanceTemplates.testIamPermissions",
  69364. // "parameterOrder": [
  69365. // "project",
  69366. // "resource"
  69367. // ],
  69368. // "parameters": {
  69369. // "project": {
  69370. // "description": "Project ID for this request.",
  69371. // "location": "path",
  69372. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69373. // "required": true,
  69374. // "type": "string"
  69375. // },
  69376. // "resource": {
  69377. // "description": "Name or id of the resource for this request.",
  69378. // "location": "path",
  69379. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69380. // "required": true,
  69381. // "type": "string"
  69382. // }
  69383. // },
  69384. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  69385. // "request": {
  69386. // "$ref": "TestPermissionsRequest"
  69387. // },
  69388. // "response": {
  69389. // "$ref": "TestPermissionsResponse"
  69390. // },
  69391. // "scopes": [
  69392. // "https://www.googleapis.com/auth/cloud-platform",
  69393. // "https://www.googleapis.com/auth/compute",
  69394. // "https://www.googleapis.com/auth/compute.readonly"
  69395. // ]
  69396. // }
  69397. }
  69398. // method id "compute.instances.addAccessConfig":
  69399. type InstancesAddAccessConfigCall struct {
  69400. s *Service
  69401. project string
  69402. zone string
  69403. instance string
  69404. accessconfig *AccessConfig
  69405. urlParams_ gensupport.URLParams
  69406. ctx_ context.Context
  69407. header_ http.Header
  69408. }
  69409. // AddAccessConfig: Adds an access config to an instance's network
  69410. // interface.
  69411. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  69412. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  69413. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69414. c.project = project
  69415. c.zone = zone
  69416. c.instance = instance
  69417. c.urlParams_.Set("networkInterface", networkInterface)
  69418. c.accessconfig = accessconfig
  69419. return c
  69420. }
  69421. // RequestId sets the optional parameter "requestId": An optional
  69422. // request ID to identify requests. Specify a unique request ID so that
  69423. // if you must retry your request, the server will know to ignore the
  69424. // request if it has already been completed.
  69425. //
  69426. // For example, consider a situation where you make an initial request
  69427. // and the request times out. If you make the request again with the
  69428. // same request ID, the server can check if original operation with the
  69429. // same request ID was received, and if so, will ignore the second
  69430. // request. This prevents clients from accidentally creating duplicate
  69431. // commitments.
  69432. //
  69433. // The request ID must be a valid UUID with the exception that zero UUID
  69434. // is not supported (00000000-0000-0000-0000-000000000000).
  69435. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  69436. c.urlParams_.Set("requestId", requestId)
  69437. return c
  69438. }
  69439. // Fields allows partial responses to be retrieved. See
  69440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69441. // for more information.
  69442. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  69443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69444. return c
  69445. }
  69446. // Context sets the context to be used in this call's Do method. Any
  69447. // pending HTTP request will be aborted if the provided context is
  69448. // canceled.
  69449. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  69450. c.ctx_ = ctx
  69451. return c
  69452. }
  69453. // Header returns an http.Header that can be modified by the caller to
  69454. // add HTTP headers to the request.
  69455. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  69456. if c.header_ == nil {
  69457. c.header_ = make(http.Header)
  69458. }
  69459. return c.header_
  69460. }
  69461. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  69462. reqHeaders := make(http.Header)
  69463. for k, v := range c.header_ {
  69464. reqHeaders[k] = v
  69465. }
  69466. reqHeaders.Set("User-Agent", c.s.userAgent())
  69467. var body io.Reader = nil
  69468. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  69469. if err != nil {
  69470. return nil, err
  69471. }
  69472. reqHeaders.Set("Content-Type", "application/json")
  69473. c.urlParams_.Set("alt", alt)
  69474. c.urlParams_.Set("prettyPrint", "false")
  69475. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  69476. urls += "?" + c.urlParams_.Encode()
  69477. req, err := http.NewRequest("POST", urls, body)
  69478. if err != nil {
  69479. return nil, err
  69480. }
  69481. req.Header = reqHeaders
  69482. googleapi.Expand(req.URL, map[string]string{
  69483. "project": c.project,
  69484. "zone": c.zone,
  69485. "instance": c.instance,
  69486. })
  69487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69488. }
  69489. // Do executes the "compute.instances.addAccessConfig" call.
  69490. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69491. // status code is an error. Response headers are in either
  69492. // *Operation.ServerResponse.Header or (if a response was returned at
  69493. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69494. // to check whether the returned error was because
  69495. // http.StatusNotModified was returned.
  69496. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69497. gensupport.SetOptions(c.urlParams_, opts...)
  69498. res, err := c.doRequest("json")
  69499. if res != nil && res.StatusCode == http.StatusNotModified {
  69500. if res.Body != nil {
  69501. res.Body.Close()
  69502. }
  69503. return nil, &googleapi.Error{
  69504. Code: res.StatusCode,
  69505. Header: res.Header,
  69506. }
  69507. }
  69508. if err != nil {
  69509. return nil, err
  69510. }
  69511. defer googleapi.CloseBody(res)
  69512. if err := googleapi.CheckResponse(res); err != nil {
  69513. return nil, err
  69514. }
  69515. ret := &Operation{
  69516. ServerResponse: googleapi.ServerResponse{
  69517. Header: res.Header,
  69518. HTTPStatusCode: res.StatusCode,
  69519. },
  69520. }
  69521. target := &ret
  69522. if err := gensupport.DecodeResponse(target, res); err != nil {
  69523. return nil, err
  69524. }
  69525. return ret, nil
  69526. // {
  69527. // "description": "Adds an access config to an instance's network interface.",
  69528. // "httpMethod": "POST",
  69529. // "id": "compute.instances.addAccessConfig",
  69530. // "parameterOrder": [
  69531. // "project",
  69532. // "zone",
  69533. // "instance",
  69534. // "networkInterface"
  69535. // ],
  69536. // "parameters": {
  69537. // "instance": {
  69538. // "description": "The instance name for this request.",
  69539. // "location": "path",
  69540. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69541. // "required": true,
  69542. // "type": "string"
  69543. // },
  69544. // "networkInterface": {
  69545. // "description": "The name of the network interface to add to this instance.",
  69546. // "location": "query",
  69547. // "required": true,
  69548. // "type": "string"
  69549. // },
  69550. // "project": {
  69551. // "description": "Project ID for this request.",
  69552. // "location": "path",
  69553. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69554. // "required": true,
  69555. // "type": "string"
  69556. // },
  69557. // "requestId": {
  69558. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69559. // "location": "query",
  69560. // "type": "string"
  69561. // },
  69562. // "zone": {
  69563. // "description": "The name of the zone for this request.",
  69564. // "location": "path",
  69565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69566. // "required": true,
  69567. // "type": "string"
  69568. // }
  69569. // },
  69570. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  69571. // "request": {
  69572. // "$ref": "AccessConfig"
  69573. // },
  69574. // "response": {
  69575. // "$ref": "Operation"
  69576. // },
  69577. // "scopes": [
  69578. // "https://www.googleapis.com/auth/cloud-platform",
  69579. // "https://www.googleapis.com/auth/compute"
  69580. // ]
  69581. // }
  69582. }
  69583. // method id "compute.instances.addResourcePolicies":
  69584. type InstancesAddResourcePoliciesCall struct {
  69585. s *Service
  69586. project string
  69587. zone string
  69588. instance string
  69589. instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest
  69590. urlParams_ gensupport.URLParams
  69591. ctx_ context.Context
  69592. header_ http.Header
  69593. }
  69594. // AddResourcePolicies: Adds existing resource policies to an instance.
  69595. // You can only add one policy right now which will be applied to this
  69596. // instance for scheduling live migrations.
  69597. func (r *InstancesService) AddResourcePolicies(project string, zone string, instance string, instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest) *InstancesAddResourcePoliciesCall {
  69598. c := &InstancesAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69599. c.project = project
  69600. c.zone = zone
  69601. c.instance = instance
  69602. c.instancesaddresourcepoliciesrequest = instancesaddresourcepoliciesrequest
  69603. return c
  69604. }
  69605. // RequestId sets the optional parameter "requestId": An optional
  69606. // request ID to identify requests. Specify a unique request ID so that
  69607. // if you must retry your request, the server will know to ignore the
  69608. // request if it has already been completed.
  69609. //
  69610. // For example, consider a situation where you make an initial request
  69611. // and the request times out. If you make the request again with the
  69612. // same request ID, the server can check if original operation with the
  69613. // same request ID was received, and if so, will ignore the second
  69614. // request. This prevents clients from accidentally creating duplicate
  69615. // commitments.
  69616. //
  69617. // The request ID must be a valid UUID with the exception that zero UUID
  69618. // is not supported (00000000-0000-0000-0000-000000000000).
  69619. func (c *InstancesAddResourcePoliciesCall) RequestId(requestId string) *InstancesAddResourcePoliciesCall {
  69620. c.urlParams_.Set("requestId", requestId)
  69621. return c
  69622. }
  69623. // Fields allows partial responses to be retrieved. See
  69624. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69625. // for more information.
  69626. func (c *InstancesAddResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesAddResourcePoliciesCall {
  69627. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69628. return c
  69629. }
  69630. // Context sets the context to be used in this call's Do method. Any
  69631. // pending HTTP request will be aborted if the provided context is
  69632. // canceled.
  69633. func (c *InstancesAddResourcePoliciesCall) Context(ctx context.Context) *InstancesAddResourcePoliciesCall {
  69634. c.ctx_ = ctx
  69635. return c
  69636. }
  69637. // Header returns an http.Header that can be modified by the caller to
  69638. // add HTTP headers to the request.
  69639. func (c *InstancesAddResourcePoliciesCall) Header() http.Header {
  69640. if c.header_ == nil {
  69641. c.header_ = make(http.Header)
  69642. }
  69643. return c.header_
  69644. }
  69645. func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  69646. reqHeaders := make(http.Header)
  69647. for k, v := range c.header_ {
  69648. reqHeaders[k] = v
  69649. }
  69650. reqHeaders.Set("User-Agent", c.s.userAgent())
  69651. var body io.Reader = nil
  69652. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest)
  69653. if err != nil {
  69654. return nil, err
  69655. }
  69656. reqHeaders.Set("Content-Type", "application/json")
  69657. c.urlParams_.Set("alt", alt)
  69658. c.urlParams_.Set("prettyPrint", "false")
  69659. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addResourcePolicies")
  69660. urls += "?" + c.urlParams_.Encode()
  69661. req, err := http.NewRequest("POST", urls, body)
  69662. if err != nil {
  69663. return nil, err
  69664. }
  69665. req.Header = reqHeaders
  69666. googleapi.Expand(req.URL, map[string]string{
  69667. "project": c.project,
  69668. "zone": c.zone,
  69669. "instance": c.instance,
  69670. })
  69671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69672. }
  69673. // Do executes the "compute.instances.addResourcePolicies" call.
  69674. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69675. // status code is an error. Response headers are in either
  69676. // *Operation.ServerResponse.Header or (if a response was returned at
  69677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69678. // to check whether the returned error was because
  69679. // http.StatusNotModified was returned.
  69680. func (c *InstancesAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69681. gensupport.SetOptions(c.urlParams_, opts...)
  69682. res, err := c.doRequest("json")
  69683. if res != nil && res.StatusCode == http.StatusNotModified {
  69684. if res.Body != nil {
  69685. res.Body.Close()
  69686. }
  69687. return nil, &googleapi.Error{
  69688. Code: res.StatusCode,
  69689. Header: res.Header,
  69690. }
  69691. }
  69692. if err != nil {
  69693. return nil, err
  69694. }
  69695. defer googleapi.CloseBody(res)
  69696. if err := googleapi.CheckResponse(res); err != nil {
  69697. return nil, err
  69698. }
  69699. ret := &Operation{
  69700. ServerResponse: googleapi.ServerResponse{
  69701. Header: res.Header,
  69702. HTTPStatusCode: res.StatusCode,
  69703. },
  69704. }
  69705. target := &ret
  69706. if err := gensupport.DecodeResponse(target, res); err != nil {
  69707. return nil, err
  69708. }
  69709. return ret, nil
  69710. // {
  69711. // "description": "Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.",
  69712. // "httpMethod": "POST",
  69713. // "id": "compute.instances.addResourcePolicies",
  69714. // "parameterOrder": [
  69715. // "project",
  69716. // "zone",
  69717. // "instance"
  69718. // ],
  69719. // "parameters": {
  69720. // "instance": {
  69721. // "description": "The instance name for this request.",
  69722. // "location": "path",
  69723. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  69724. // "required": true,
  69725. // "type": "string"
  69726. // },
  69727. // "project": {
  69728. // "description": "Project ID for this request.",
  69729. // "location": "path",
  69730. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69731. // "required": true,
  69732. // "type": "string"
  69733. // },
  69734. // "requestId": {
  69735. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69736. // "location": "query",
  69737. // "type": "string"
  69738. // },
  69739. // "zone": {
  69740. // "description": "The name of the zone for this request.",
  69741. // "location": "path",
  69742. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  69743. // "required": true,
  69744. // "type": "string"
  69745. // }
  69746. // },
  69747. // "path": "{project}/zones/{zone}/instances/{instance}/addResourcePolicies",
  69748. // "request": {
  69749. // "$ref": "InstancesAddResourcePoliciesRequest"
  69750. // },
  69751. // "response": {
  69752. // "$ref": "Operation"
  69753. // },
  69754. // "scopes": [
  69755. // "https://www.googleapis.com/auth/cloud-platform",
  69756. // "https://www.googleapis.com/auth/compute"
  69757. // ]
  69758. // }
  69759. }
  69760. // method id "compute.instances.aggregatedList":
  69761. type InstancesAggregatedListCall struct {
  69762. s *Service
  69763. project string
  69764. urlParams_ gensupport.URLParams
  69765. ifNoneMatch_ string
  69766. ctx_ context.Context
  69767. header_ http.Header
  69768. }
  69769. // AggregatedList: Retrieves aggregated list of all of the instances in
  69770. // your project across all regions and zones.
  69771. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  69772. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  69773. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69774. c.project = project
  69775. return c
  69776. }
  69777. // Filter sets the optional parameter "filter": A filter expression that
  69778. // filters resources listed in the response. The expression must specify
  69779. // the field name, a comparison operator, and the value that you want to
  69780. // use for filtering. The value must be a string, a number, or a
  69781. // boolean. The comparison operator must be either =, !=, >, or <.
  69782. //
  69783. // For example, if you are filtering Compute Engine instances, you can
  69784. // exclude instances named example-instance by specifying name !=
  69785. // example-instance.
  69786. //
  69787. // You can also filter nested fields. For example, you could specify
  69788. // scheduling.automaticRestart = false to include instances only if they
  69789. // are not scheduled for automatic restarts. You can use filtering on
  69790. // nested fields to filter based on resource labels.
  69791. //
  69792. // To filter on multiple expressions, provide each separate expression
  69793. // within parentheses. For example, (scheduling.automaticRestart = true)
  69794. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69795. // AND expression. However, you can include AND and OR expressions
  69796. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69797. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69798. // true).
  69799. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  69800. c.urlParams_.Set("filter", filter)
  69801. return c
  69802. }
  69803. // MaxResults sets the optional parameter "maxResults": The maximum
  69804. // number of results per page that should be returned. If the number of
  69805. // available results is larger than maxResults, Compute Engine returns a
  69806. // nextPageToken that can be used to get the next page of results in
  69807. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69808. // (Default: 500)
  69809. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  69810. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69811. return c
  69812. }
  69813. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  69814. // a certain order. By default, results are returned in alphanumerical
  69815. // order based on the resource name.
  69816. //
  69817. // You can also sort results in descending order based on the creation
  69818. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69819. // based on the creationTimestamp field in reverse chronological order
  69820. // (newest result first). Use this to sort resources like operations so
  69821. // that the newest operation is returned first.
  69822. //
  69823. // Currently, only sorting by name or creationTimestamp desc is
  69824. // supported.
  69825. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  69826. c.urlParams_.Set("orderBy", orderBy)
  69827. return c
  69828. }
  69829. // PageToken sets the optional parameter "pageToken": Specifies a page
  69830. // token to use. Set pageToken to the nextPageToken returned by a
  69831. // previous list request to get the next page of results.
  69832. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  69833. c.urlParams_.Set("pageToken", pageToken)
  69834. return c
  69835. }
  69836. // Fields allows partial responses to be retrieved. See
  69837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69838. // for more information.
  69839. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  69840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69841. return c
  69842. }
  69843. // IfNoneMatch sets the optional parameter which makes the operation
  69844. // fail if the object's ETag matches the given value. This is useful for
  69845. // getting updates only after the object has changed since the last
  69846. // request. Use googleapi.IsNotModified to check whether the response
  69847. // error from Do is the result of In-None-Match.
  69848. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  69849. c.ifNoneMatch_ = entityTag
  69850. return c
  69851. }
  69852. // Context sets the context to be used in this call's Do method. Any
  69853. // pending HTTP request will be aborted if the provided context is
  69854. // canceled.
  69855. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  69856. c.ctx_ = ctx
  69857. return c
  69858. }
  69859. // Header returns an http.Header that can be modified by the caller to
  69860. // add HTTP headers to the request.
  69861. func (c *InstancesAggregatedListCall) Header() http.Header {
  69862. if c.header_ == nil {
  69863. c.header_ = make(http.Header)
  69864. }
  69865. return c.header_
  69866. }
  69867. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  69868. reqHeaders := make(http.Header)
  69869. for k, v := range c.header_ {
  69870. reqHeaders[k] = v
  69871. }
  69872. reqHeaders.Set("User-Agent", c.s.userAgent())
  69873. if c.ifNoneMatch_ != "" {
  69874. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69875. }
  69876. var body io.Reader = nil
  69877. c.urlParams_.Set("alt", alt)
  69878. c.urlParams_.Set("prettyPrint", "false")
  69879. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  69880. urls += "?" + c.urlParams_.Encode()
  69881. req, err := http.NewRequest("GET", urls, body)
  69882. if err != nil {
  69883. return nil, err
  69884. }
  69885. req.Header = reqHeaders
  69886. googleapi.Expand(req.URL, map[string]string{
  69887. "project": c.project,
  69888. })
  69889. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69890. }
  69891. // Do executes the "compute.instances.aggregatedList" call.
  69892. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  69893. // non-2xx status code is an error. Response headers are in either
  69894. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  69895. // returned at all) in error.(*googleapi.Error).Header. Use
  69896. // googleapi.IsNotModified to check whether the returned error was
  69897. // because http.StatusNotModified was returned.
  69898. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  69899. gensupport.SetOptions(c.urlParams_, opts...)
  69900. res, err := c.doRequest("json")
  69901. if res != nil && res.StatusCode == http.StatusNotModified {
  69902. if res.Body != nil {
  69903. res.Body.Close()
  69904. }
  69905. return nil, &googleapi.Error{
  69906. Code: res.StatusCode,
  69907. Header: res.Header,
  69908. }
  69909. }
  69910. if err != nil {
  69911. return nil, err
  69912. }
  69913. defer googleapi.CloseBody(res)
  69914. if err := googleapi.CheckResponse(res); err != nil {
  69915. return nil, err
  69916. }
  69917. ret := &InstanceAggregatedList{
  69918. ServerResponse: googleapi.ServerResponse{
  69919. Header: res.Header,
  69920. HTTPStatusCode: res.StatusCode,
  69921. },
  69922. }
  69923. target := &ret
  69924. if err := gensupport.DecodeResponse(target, res); err != nil {
  69925. return nil, err
  69926. }
  69927. return ret, nil
  69928. // {
  69929. // "description": "Retrieves aggregated list of all of the instances in your project across all regions and zones.",
  69930. // "httpMethod": "GET",
  69931. // "id": "compute.instances.aggregatedList",
  69932. // "parameterOrder": [
  69933. // "project"
  69934. // ],
  69935. // "parameters": {
  69936. // "filter": {
  69937. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  69938. // "location": "query",
  69939. // "type": "string"
  69940. // },
  69941. // "maxResults": {
  69942. // "default": "500",
  69943. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  69944. // "format": "uint32",
  69945. // "location": "query",
  69946. // "minimum": "0",
  69947. // "type": "integer"
  69948. // },
  69949. // "orderBy": {
  69950. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  69951. // "location": "query",
  69952. // "type": "string"
  69953. // },
  69954. // "pageToken": {
  69955. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  69956. // "location": "query",
  69957. // "type": "string"
  69958. // },
  69959. // "project": {
  69960. // "description": "Project ID for this request.",
  69961. // "location": "path",
  69962. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69963. // "required": true,
  69964. // "type": "string"
  69965. // }
  69966. // },
  69967. // "path": "{project}/aggregated/instances",
  69968. // "response": {
  69969. // "$ref": "InstanceAggregatedList"
  69970. // },
  69971. // "scopes": [
  69972. // "https://www.googleapis.com/auth/cloud-platform",
  69973. // "https://www.googleapis.com/auth/compute",
  69974. // "https://www.googleapis.com/auth/compute.readonly"
  69975. // ]
  69976. // }
  69977. }
  69978. // Pages invokes f for each page of results.
  69979. // A non-nil error returned from f will halt the iteration.
  69980. // The provided context supersedes any context provided to the Context method.
  69981. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  69982. c.ctx_ = ctx
  69983. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69984. for {
  69985. x, err := c.Do()
  69986. if err != nil {
  69987. return err
  69988. }
  69989. if err := f(x); err != nil {
  69990. return err
  69991. }
  69992. if x.NextPageToken == "" {
  69993. return nil
  69994. }
  69995. c.PageToken(x.NextPageToken)
  69996. }
  69997. }
  69998. // method id "compute.instances.attachDisk":
  69999. type InstancesAttachDiskCall struct {
  70000. s *Service
  70001. project string
  70002. zone string
  70003. instance string
  70004. attacheddisk *AttachedDisk
  70005. urlParams_ gensupport.URLParams
  70006. ctx_ context.Context
  70007. header_ http.Header
  70008. }
  70009. // AttachDisk: Attaches an existing Disk resource to an instance. You
  70010. // must first create the disk before you can attach it. It is not
  70011. // possible to create and attach a disk at the same time. For more
  70012. // information, read Adding a persistent disk to your instance.
  70013. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  70014. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  70015. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70016. c.project = project
  70017. c.zone = zone
  70018. c.instance = instance
  70019. c.attacheddisk = attacheddisk
  70020. return c
  70021. }
  70022. // ForceAttach sets the optional parameter "forceAttach": Whether to
  70023. // force attach the disk even if it's currently attached to another
  70024. // instance.
  70025. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  70026. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  70027. return c
  70028. }
  70029. // RequestId sets the optional parameter "requestId": An optional
  70030. // request ID to identify requests. Specify a unique request ID so that
  70031. // if you must retry your request, the server will know to ignore the
  70032. // request if it has already been completed.
  70033. //
  70034. // For example, consider a situation where you make an initial request
  70035. // and the request times out. If you make the request again with the
  70036. // same request ID, the server can check if original operation with the
  70037. // same request ID was received, and if so, will ignore the second
  70038. // request. This prevents clients from accidentally creating duplicate
  70039. // commitments.
  70040. //
  70041. // The request ID must be a valid UUID with the exception that zero UUID
  70042. // is not supported (00000000-0000-0000-0000-000000000000).
  70043. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  70044. c.urlParams_.Set("requestId", requestId)
  70045. return c
  70046. }
  70047. // Fields allows partial responses to be retrieved. See
  70048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70049. // for more information.
  70050. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  70051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70052. return c
  70053. }
  70054. // Context sets the context to be used in this call's Do method. Any
  70055. // pending HTTP request will be aborted if the provided context is
  70056. // canceled.
  70057. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  70058. c.ctx_ = ctx
  70059. return c
  70060. }
  70061. // Header returns an http.Header that can be modified by the caller to
  70062. // add HTTP headers to the request.
  70063. func (c *InstancesAttachDiskCall) Header() http.Header {
  70064. if c.header_ == nil {
  70065. c.header_ = make(http.Header)
  70066. }
  70067. return c.header_
  70068. }
  70069. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  70070. reqHeaders := make(http.Header)
  70071. for k, v := range c.header_ {
  70072. reqHeaders[k] = v
  70073. }
  70074. reqHeaders.Set("User-Agent", c.s.userAgent())
  70075. var body io.Reader = nil
  70076. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  70077. if err != nil {
  70078. return nil, err
  70079. }
  70080. reqHeaders.Set("Content-Type", "application/json")
  70081. c.urlParams_.Set("alt", alt)
  70082. c.urlParams_.Set("prettyPrint", "false")
  70083. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  70084. urls += "?" + c.urlParams_.Encode()
  70085. req, err := http.NewRequest("POST", urls, body)
  70086. if err != nil {
  70087. return nil, err
  70088. }
  70089. req.Header = reqHeaders
  70090. googleapi.Expand(req.URL, map[string]string{
  70091. "project": c.project,
  70092. "zone": c.zone,
  70093. "instance": c.instance,
  70094. })
  70095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70096. }
  70097. // Do executes the "compute.instances.attachDisk" call.
  70098. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70099. // status code is an error. Response headers are in either
  70100. // *Operation.ServerResponse.Header or (if a response was returned at
  70101. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70102. // to check whether the returned error was because
  70103. // http.StatusNotModified was returned.
  70104. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70105. gensupport.SetOptions(c.urlParams_, opts...)
  70106. res, err := c.doRequest("json")
  70107. if res != nil && res.StatusCode == http.StatusNotModified {
  70108. if res.Body != nil {
  70109. res.Body.Close()
  70110. }
  70111. return nil, &googleapi.Error{
  70112. Code: res.StatusCode,
  70113. Header: res.Header,
  70114. }
  70115. }
  70116. if err != nil {
  70117. return nil, err
  70118. }
  70119. defer googleapi.CloseBody(res)
  70120. if err := googleapi.CheckResponse(res); err != nil {
  70121. return nil, err
  70122. }
  70123. ret := &Operation{
  70124. ServerResponse: googleapi.ServerResponse{
  70125. Header: res.Header,
  70126. HTTPStatusCode: res.StatusCode,
  70127. },
  70128. }
  70129. target := &ret
  70130. if err := gensupport.DecodeResponse(target, res); err != nil {
  70131. return nil, err
  70132. }
  70133. return ret, nil
  70134. // {
  70135. // "description": "Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.",
  70136. // "httpMethod": "POST",
  70137. // "id": "compute.instances.attachDisk",
  70138. // "parameterOrder": [
  70139. // "project",
  70140. // "zone",
  70141. // "instance"
  70142. // ],
  70143. // "parameters": {
  70144. // "forceAttach": {
  70145. // "description": "Whether to force attach the disk even if it's currently attached to another instance.",
  70146. // "location": "query",
  70147. // "type": "boolean"
  70148. // },
  70149. // "instance": {
  70150. // "description": "The instance name for this request.",
  70151. // "location": "path",
  70152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70153. // "required": true,
  70154. // "type": "string"
  70155. // },
  70156. // "project": {
  70157. // "description": "Project ID for this request.",
  70158. // "location": "path",
  70159. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70160. // "required": true,
  70161. // "type": "string"
  70162. // },
  70163. // "requestId": {
  70164. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70165. // "location": "query",
  70166. // "type": "string"
  70167. // },
  70168. // "zone": {
  70169. // "description": "The name of the zone for this request.",
  70170. // "location": "path",
  70171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70172. // "required": true,
  70173. // "type": "string"
  70174. // }
  70175. // },
  70176. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  70177. // "request": {
  70178. // "$ref": "AttachedDisk"
  70179. // },
  70180. // "response": {
  70181. // "$ref": "Operation"
  70182. // },
  70183. // "scopes": [
  70184. // "https://www.googleapis.com/auth/cloud-platform",
  70185. // "https://www.googleapis.com/auth/compute"
  70186. // ]
  70187. // }
  70188. }
  70189. // method id "compute.instances.delete":
  70190. type InstancesDeleteCall struct {
  70191. s *Service
  70192. project string
  70193. zone string
  70194. instance string
  70195. urlParams_ gensupport.URLParams
  70196. ctx_ context.Context
  70197. header_ http.Header
  70198. }
  70199. // Delete: Deletes the specified Instance resource. For more
  70200. // information, see Stopping or Deleting an Instance.
  70201. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  70202. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  70203. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70204. c.project = project
  70205. c.zone = zone
  70206. c.instance = instance
  70207. return c
  70208. }
  70209. // RequestId sets the optional parameter "requestId": An optional
  70210. // request ID to identify requests. Specify a unique request ID so that
  70211. // if you must retry your request, the server will know to ignore the
  70212. // request if it has already been completed.
  70213. //
  70214. // For example, consider a situation where you make an initial request
  70215. // and the request times out. If you make the request again with the
  70216. // same request ID, the server can check if original operation with the
  70217. // same request ID was received, and if so, will ignore the second
  70218. // request. This prevents clients from accidentally creating duplicate
  70219. // commitments.
  70220. //
  70221. // The request ID must be a valid UUID with the exception that zero UUID
  70222. // is not supported (00000000-0000-0000-0000-000000000000).
  70223. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  70224. c.urlParams_.Set("requestId", requestId)
  70225. return c
  70226. }
  70227. // Fields allows partial responses to be retrieved. See
  70228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70229. // for more information.
  70230. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  70231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70232. return c
  70233. }
  70234. // Context sets the context to be used in this call's Do method. Any
  70235. // pending HTTP request will be aborted if the provided context is
  70236. // canceled.
  70237. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  70238. c.ctx_ = ctx
  70239. return c
  70240. }
  70241. // Header returns an http.Header that can be modified by the caller to
  70242. // add HTTP headers to the request.
  70243. func (c *InstancesDeleteCall) Header() http.Header {
  70244. if c.header_ == nil {
  70245. c.header_ = make(http.Header)
  70246. }
  70247. return c.header_
  70248. }
  70249. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  70250. reqHeaders := make(http.Header)
  70251. for k, v := range c.header_ {
  70252. reqHeaders[k] = v
  70253. }
  70254. reqHeaders.Set("User-Agent", c.s.userAgent())
  70255. var body io.Reader = nil
  70256. c.urlParams_.Set("alt", alt)
  70257. c.urlParams_.Set("prettyPrint", "false")
  70258. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  70259. urls += "?" + c.urlParams_.Encode()
  70260. req, err := http.NewRequest("DELETE", urls, body)
  70261. if err != nil {
  70262. return nil, err
  70263. }
  70264. req.Header = reqHeaders
  70265. googleapi.Expand(req.URL, map[string]string{
  70266. "project": c.project,
  70267. "zone": c.zone,
  70268. "instance": c.instance,
  70269. })
  70270. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70271. }
  70272. // Do executes the "compute.instances.delete" call.
  70273. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70274. // status code is an error. Response headers are in either
  70275. // *Operation.ServerResponse.Header or (if a response was returned at
  70276. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70277. // to check whether the returned error was because
  70278. // http.StatusNotModified was returned.
  70279. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70280. gensupport.SetOptions(c.urlParams_, opts...)
  70281. res, err := c.doRequest("json")
  70282. if res != nil && res.StatusCode == http.StatusNotModified {
  70283. if res.Body != nil {
  70284. res.Body.Close()
  70285. }
  70286. return nil, &googleapi.Error{
  70287. Code: res.StatusCode,
  70288. Header: res.Header,
  70289. }
  70290. }
  70291. if err != nil {
  70292. return nil, err
  70293. }
  70294. defer googleapi.CloseBody(res)
  70295. if err := googleapi.CheckResponse(res); err != nil {
  70296. return nil, err
  70297. }
  70298. ret := &Operation{
  70299. ServerResponse: googleapi.ServerResponse{
  70300. Header: res.Header,
  70301. HTTPStatusCode: res.StatusCode,
  70302. },
  70303. }
  70304. target := &ret
  70305. if err := gensupport.DecodeResponse(target, res); err != nil {
  70306. return nil, err
  70307. }
  70308. return ret, nil
  70309. // {
  70310. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  70311. // "httpMethod": "DELETE",
  70312. // "id": "compute.instances.delete",
  70313. // "parameterOrder": [
  70314. // "project",
  70315. // "zone",
  70316. // "instance"
  70317. // ],
  70318. // "parameters": {
  70319. // "instance": {
  70320. // "description": "Name of the instance resource to delete.",
  70321. // "location": "path",
  70322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70323. // "required": true,
  70324. // "type": "string"
  70325. // },
  70326. // "project": {
  70327. // "description": "Project ID for this request.",
  70328. // "location": "path",
  70329. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70330. // "required": true,
  70331. // "type": "string"
  70332. // },
  70333. // "requestId": {
  70334. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70335. // "location": "query",
  70336. // "type": "string"
  70337. // },
  70338. // "zone": {
  70339. // "description": "The name of the zone for this request.",
  70340. // "location": "path",
  70341. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70342. // "required": true,
  70343. // "type": "string"
  70344. // }
  70345. // },
  70346. // "path": "{project}/zones/{zone}/instances/{instance}",
  70347. // "response": {
  70348. // "$ref": "Operation"
  70349. // },
  70350. // "scopes": [
  70351. // "https://www.googleapis.com/auth/cloud-platform",
  70352. // "https://www.googleapis.com/auth/compute"
  70353. // ]
  70354. // }
  70355. }
  70356. // method id "compute.instances.deleteAccessConfig":
  70357. type InstancesDeleteAccessConfigCall struct {
  70358. s *Service
  70359. project string
  70360. zone string
  70361. instance string
  70362. urlParams_ gensupport.URLParams
  70363. ctx_ context.Context
  70364. header_ http.Header
  70365. }
  70366. // DeleteAccessConfig: Deletes an access config from an instance's
  70367. // network interface.
  70368. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  70369. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  70370. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70371. c.project = project
  70372. c.zone = zone
  70373. c.instance = instance
  70374. c.urlParams_.Set("accessConfig", accessConfig)
  70375. c.urlParams_.Set("networkInterface", networkInterface)
  70376. return c
  70377. }
  70378. // RequestId sets the optional parameter "requestId": An optional
  70379. // request ID to identify requests. Specify a unique request ID so that
  70380. // if you must retry your request, the server will know to ignore the
  70381. // request if it has already been completed.
  70382. //
  70383. // For example, consider a situation where you make an initial request
  70384. // and the request times out. If you make the request again with the
  70385. // same request ID, the server can check if original operation with the
  70386. // same request ID was received, and if so, will ignore the second
  70387. // request. This prevents clients from accidentally creating duplicate
  70388. // commitments.
  70389. //
  70390. // The request ID must be a valid UUID with the exception that zero UUID
  70391. // is not supported (00000000-0000-0000-0000-000000000000).
  70392. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  70393. c.urlParams_.Set("requestId", requestId)
  70394. return c
  70395. }
  70396. // Fields allows partial responses to be retrieved. See
  70397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70398. // for more information.
  70399. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  70400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70401. return c
  70402. }
  70403. // Context sets the context to be used in this call's Do method. Any
  70404. // pending HTTP request will be aborted if the provided context is
  70405. // canceled.
  70406. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  70407. c.ctx_ = ctx
  70408. return c
  70409. }
  70410. // Header returns an http.Header that can be modified by the caller to
  70411. // add HTTP headers to the request.
  70412. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  70413. if c.header_ == nil {
  70414. c.header_ = make(http.Header)
  70415. }
  70416. return c.header_
  70417. }
  70418. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  70419. reqHeaders := make(http.Header)
  70420. for k, v := range c.header_ {
  70421. reqHeaders[k] = v
  70422. }
  70423. reqHeaders.Set("User-Agent", c.s.userAgent())
  70424. var body io.Reader = nil
  70425. c.urlParams_.Set("alt", alt)
  70426. c.urlParams_.Set("prettyPrint", "false")
  70427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  70428. urls += "?" + c.urlParams_.Encode()
  70429. req, err := http.NewRequest("POST", urls, body)
  70430. if err != nil {
  70431. return nil, err
  70432. }
  70433. req.Header = reqHeaders
  70434. googleapi.Expand(req.URL, map[string]string{
  70435. "project": c.project,
  70436. "zone": c.zone,
  70437. "instance": c.instance,
  70438. })
  70439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70440. }
  70441. // Do executes the "compute.instances.deleteAccessConfig" call.
  70442. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70443. // status code is an error. Response headers are in either
  70444. // *Operation.ServerResponse.Header or (if a response was returned at
  70445. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70446. // to check whether the returned error was because
  70447. // http.StatusNotModified was returned.
  70448. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70449. gensupport.SetOptions(c.urlParams_, opts...)
  70450. res, err := c.doRequest("json")
  70451. if res != nil && res.StatusCode == http.StatusNotModified {
  70452. if res.Body != nil {
  70453. res.Body.Close()
  70454. }
  70455. return nil, &googleapi.Error{
  70456. Code: res.StatusCode,
  70457. Header: res.Header,
  70458. }
  70459. }
  70460. if err != nil {
  70461. return nil, err
  70462. }
  70463. defer googleapi.CloseBody(res)
  70464. if err := googleapi.CheckResponse(res); err != nil {
  70465. return nil, err
  70466. }
  70467. ret := &Operation{
  70468. ServerResponse: googleapi.ServerResponse{
  70469. Header: res.Header,
  70470. HTTPStatusCode: res.StatusCode,
  70471. },
  70472. }
  70473. target := &ret
  70474. if err := gensupport.DecodeResponse(target, res); err != nil {
  70475. return nil, err
  70476. }
  70477. return ret, nil
  70478. // {
  70479. // "description": "Deletes an access config from an instance's network interface.",
  70480. // "httpMethod": "POST",
  70481. // "id": "compute.instances.deleteAccessConfig",
  70482. // "parameterOrder": [
  70483. // "project",
  70484. // "zone",
  70485. // "instance",
  70486. // "accessConfig",
  70487. // "networkInterface"
  70488. // ],
  70489. // "parameters": {
  70490. // "accessConfig": {
  70491. // "description": "The name of the access config to delete.",
  70492. // "location": "query",
  70493. // "required": true,
  70494. // "type": "string"
  70495. // },
  70496. // "instance": {
  70497. // "description": "The instance name for this request.",
  70498. // "location": "path",
  70499. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70500. // "required": true,
  70501. // "type": "string"
  70502. // },
  70503. // "networkInterface": {
  70504. // "description": "The name of the network interface.",
  70505. // "location": "query",
  70506. // "required": true,
  70507. // "type": "string"
  70508. // },
  70509. // "project": {
  70510. // "description": "Project ID for this request.",
  70511. // "location": "path",
  70512. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70513. // "required": true,
  70514. // "type": "string"
  70515. // },
  70516. // "requestId": {
  70517. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70518. // "location": "query",
  70519. // "type": "string"
  70520. // },
  70521. // "zone": {
  70522. // "description": "The name of the zone for this request.",
  70523. // "location": "path",
  70524. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70525. // "required": true,
  70526. // "type": "string"
  70527. // }
  70528. // },
  70529. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  70530. // "response": {
  70531. // "$ref": "Operation"
  70532. // },
  70533. // "scopes": [
  70534. // "https://www.googleapis.com/auth/cloud-platform",
  70535. // "https://www.googleapis.com/auth/compute"
  70536. // ]
  70537. // }
  70538. }
  70539. // method id "compute.instances.detachDisk":
  70540. type InstancesDetachDiskCall struct {
  70541. s *Service
  70542. project string
  70543. zone string
  70544. instance string
  70545. urlParams_ gensupport.URLParams
  70546. ctx_ context.Context
  70547. header_ http.Header
  70548. }
  70549. // DetachDisk: Detaches a disk from an instance.
  70550. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  70551. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  70552. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70553. c.project = project
  70554. c.zone = zone
  70555. c.instance = instance
  70556. c.urlParams_.Set("deviceName", deviceName)
  70557. return c
  70558. }
  70559. // RequestId sets the optional parameter "requestId": An optional
  70560. // request ID to identify requests. Specify a unique request ID so that
  70561. // if you must retry your request, the server will know to ignore the
  70562. // request if it has already been completed.
  70563. //
  70564. // For example, consider a situation where you make an initial request
  70565. // and the request times out. If you make the request again with the
  70566. // same request ID, the server can check if original operation with the
  70567. // same request ID was received, and if so, will ignore the second
  70568. // request. This prevents clients from accidentally creating duplicate
  70569. // commitments.
  70570. //
  70571. // The request ID must be a valid UUID with the exception that zero UUID
  70572. // is not supported (00000000-0000-0000-0000-000000000000).
  70573. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  70574. c.urlParams_.Set("requestId", requestId)
  70575. return c
  70576. }
  70577. // Fields allows partial responses to be retrieved. See
  70578. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70579. // for more information.
  70580. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  70581. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70582. return c
  70583. }
  70584. // Context sets the context to be used in this call's Do method. Any
  70585. // pending HTTP request will be aborted if the provided context is
  70586. // canceled.
  70587. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  70588. c.ctx_ = ctx
  70589. return c
  70590. }
  70591. // Header returns an http.Header that can be modified by the caller to
  70592. // add HTTP headers to the request.
  70593. func (c *InstancesDetachDiskCall) Header() http.Header {
  70594. if c.header_ == nil {
  70595. c.header_ = make(http.Header)
  70596. }
  70597. return c.header_
  70598. }
  70599. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  70600. reqHeaders := make(http.Header)
  70601. for k, v := range c.header_ {
  70602. reqHeaders[k] = v
  70603. }
  70604. reqHeaders.Set("User-Agent", c.s.userAgent())
  70605. var body io.Reader = nil
  70606. c.urlParams_.Set("alt", alt)
  70607. c.urlParams_.Set("prettyPrint", "false")
  70608. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  70609. urls += "?" + c.urlParams_.Encode()
  70610. req, err := http.NewRequest("POST", urls, body)
  70611. if err != nil {
  70612. return nil, err
  70613. }
  70614. req.Header = reqHeaders
  70615. googleapi.Expand(req.URL, map[string]string{
  70616. "project": c.project,
  70617. "zone": c.zone,
  70618. "instance": c.instance,
  70619. })
  70620. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70621. }
  70622. // Do executes the "compute.instances.detachDisk" call.
  70623. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70624. // status code is an error. Response headers are in either
  70625. // *Operation.ServerResponse.Header or (if a response was returned at
  70626. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70627. // to check whether the returned error was because
  70628. // http.StatusNotModified was returned.
  70629. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70630. gensupport.SetOptions(c.urlParams_, opts...)
  70631. res, err := c.doRequest("json")
  70632. if res != nil && res.StatusCode == http.StatusNotModified {
  70633. if res.Body != nil {
  70634. res.Body.Close()
  70635. }
  70636. return nil, &googleapi.Error{
  70637. Code: res.StatusCode,
  70638. Header: res.Header,
  70639. }
  70640. }
  70641. if err != nil {
  70642. return nil, err
  70643. }
  70644. defer googleapi.CloseBody(res)
  70645. if err := googleapi.CheckResponse(res); err != nil {
  70646. return nil, err
  70647. }
  70648. ret := &Operation{
  70649. ServerResponse: googleapi.ServerResponse{
  70650. Header: res.Header,
  70651. HTTPStatusCode: res.StatusCode,
  70652. },
  70653. }
  70654. target := &ret
  70655. if err := gensupport.DecodeResponse(target, res); err != nil {
  70656. return nil, err
  70657. }
  70658. return ret, nil
  70659. // {
  70660. // "description": "Detaches a disk from an instance.",
  70661. // "httpMethod": "POST",
  70662. // "id": "compute.instances.detachDisk",
  70663. // "parameterOrder": [
  70664. // "project",
  70665. // "zone",
  70666. // "instance",
  70667. // "deviceName"
  70668. // ],
  70669. // "parameters": {
  70670. // "deviceName": {
  70671. // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
  70672. // "location": "query",
  70673. // "required": true,
  70674. // "type": "string"
  70675. // },
  70676. // "instance": {
  70677. // "description": "Instance name for this request.",
  70678. // "location": "path",
  70679. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70680. // "required": true,
  70681. // "type": "string"
  70682. // },
  70683. // "project": {
  70684. // "description": "Project ID for this request.",
  70685. // "location": "path",
  70686. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70687. // "required": true,
  70688. // "type": "string"
  70689. // },
  70690. // "requestId": {
  70691. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70692. // "location": "query",
  70693. // "type": "string"
  70694. // },
  70695. // "zone": {
  70696. // "description": "The name of the zone for this request.",
  70697. // "location": "path",
  70698. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70699. // "required": true,
  70700. // "type": "string"
  70701. // }
  70702. // },
  70703. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  70704. // "response": {
  70705. // "$ref": "Operation"
  70706. // },
  70707. // "scopes": [
  70708. // "https://www.googleapis.com/auth/cloud-platform",
  70709. // "https://www.googleapis.com/auth/compute"
  70710. // ]
  70711. // }
  70712. }
  70713. // method id "compute.instances.get":
  70714. type InstancesGetCall struct {
  70715. s *Service
  70716. project string
  70717. zone string
  70718. instance string
  70719. urlParams_ gensupport.URLParams
  70720. ifNoneMatch_ string
  70721. ctx_ context.Context
  70722. header_ http.Header
  70723. }
  70724. // Get: Returns the specified Instance resource. Gets a list of
  70725. // available instances by making a list() request.
  70726. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  70727. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  70728. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70729. c.project = project
  70730. c.zone = zone
  70731. c.instance = instance
  70732. return c
  70733. }
  70734. // Fields allows partial responses to be retrieved. See
  70735. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70736. // for more information.
  70737. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  70738. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70739. return c
  70740. }
  70741. // IfNoneMatch sets the optional parameter which makes the operation
  70742. // fail if the object's ETag matches the given value. This is useful for
  70743. // getting updates only after the object has changed since the last
  70744. // request. Use googleapi.IsNotModified to check whether the response
  70745. // error from Do is the result of In-None-Match.
  70746. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  70747. c.ifNoneMatch_ = entityTag
  70748. return c
  70749. }
  70750. // Context sets the context to be used in this call's Do method. Any
  70751. // pending HTTP request will be aborted if the provided context is
  70752. // canceled.
  70753. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  70754. c.ctx_ = ctx
  70755. return c
  70756. }
  70757. // Header returns an http.Header that can be modified by the caller to
  70758. // add HTTP headers to the request.
  70759. func (c *InstancesGetCall) Header() http.Header {
  70760. if c.header_ == nil {
  70761. c.header_ = make(http.Header)
  70762. }
  70763. return c.header_
  70764. }
  70765. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  70766. reqHeaders := make(http.Header)
  70767. for k, v := range c.header_ {
  70768. reqHeaders[k] = v
  70769. }
  70770. reqHeaders.Set("User-Agent", c.s.userAgent())
  70771. if c.ifNoneMatch_ != "" {
  70772. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70773. }
  70774. var body io.Reader = nil
  70775. c.urlParams_.Set("alt", alt)
  70776. c.urlParams_.Set("prettyPrint", "false")
  70777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  70778. urls += "?" + c.urlParams_.Encode()
  70779. req, err := http.NewRequest("GET", urls, body)
  70780. if err != nil {
  70781. return nil, err
  70782. }
  70783. req.Header = reqHeaders
  70784. googleapi.Expand(req.URL, map[string]string{
  70785. "project": c.project,
  70786. "zone": c.zone,
  70787. "instance": c.instance,
  70788. })
  70789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70790. }
  70791. // Do executes the "compute.instances.get" call.
  70792. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  70793. // code is an error. Response headers are in either
  70794. // *Instance.ServerResponse.Header or (if a response was returned at
  70795. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70796. // to check whether the returned error was because
  70797. // http.StatusNotModified was returned.
  70798. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  70799. gensupport.SetOptions(c.urlParams_, opts...)
  70800. res, err := c.doRequest("json")
  70801. if res != nil && res.StatusCode == http.StatusNotModified {
  70802. if res.Body != nil {
  70803. res.Body.Close()
  70804. }
  70805. return nil, &googleapi.Error{
  70806. Code: res.StatusCode,
  70807. Header: res.Header,
  70808. }
  70809. }
  70810. if err != nil {
  70811. return nil, err
  70812. }
  70813. defer googleapi.CloseBody(res)
  70814. if err := googleapi.CheckResponse(res); err != nil {
  70815. return nil, err
  70816. }
  70817. ret := &Instance{
  70818. ServerResponse: googleapi.ServerResponse{
  70819. Header: res.Header,
  70820. HTTPStatusCode: res.StatusCode,
  70821. },
  70822. }
  70823. target := &ret
  70824. if err := gensupport.DecodeResponse(target, res); err != nil {
  70825. return nil, err
  70826. }
  70827. return ret, nil
  70828. // {
  70829. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  70830. // "httpMethod": "GET",
  70831. // "id": "compute.instances.get",
  70832. // "parameterOrder": [
  70833. // "project",
  70834. // "zone",
  70835. // "instance"
  70836. // ],
  70837. // "parameters": {
  70838. // "instance": {
  70839. // "description": "Name of the instance resource to return.",
  70840. // "location": "path",
  70841. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70842. // "required": true,
  70843. // "type": "string"
  70844. // },
  70845. // "project": {
  70846. // "description": "Project ID for this request.",
  70847. // "location": "path",
  70848. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70849. // "required": true,
  70850. // "type": "string"
  70851. // },
  70852. // "zone": {
  70853. // "description": "The name of the zone for this request.",
  70854. // "location": "path",
  70855. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70856. // "required": true,
  70857. // "type": "string"
  70858. // }
  70859. // },
  70860. // "path": "{project}/zones/{zone}/instances/{instance}",
  70861. // "response": {
  70862. // "$ref": "Instance"
  70863. // },
  70864. // "scopes": [
  70865. // "https://www.googleapis.com/auth/cloud-platform",
  70866. // "https://www.googleapis.com/auth/compute",
  70867. // "https://www.googleapis.com/auth/compute.readonly"
  70868. // ]
  70869. // }
  70870. }
  70871. // method id "compute.instances.getGuestAttributes":
  70872. type InstancesGetGuestAttributesCall struct {
  70873. s *Service
  70874. project string
  70875. zone string
  70876. instance string
  70877. urlParams_ gensupport.URLParams
  70878. ifNoneMatch_ string
  70879. ctx_ context.Context
  70880. header_ http.Header
  70881. }
  70882. // GetGuestAttributes: Returns the specified guest attributes entry.
  70883. func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall {
  70884. c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70885. c.project = project
  70886. c.zone = zone
  70887. c.instance = instance
  70888. return c
  70889. }
  70890. // QueryPath sets the optional parameter "queryPath": Specifies the
  70891. // guest attributes path to be queried.
  70892. func (c *InstancesGetGuestAttributesCall) QueryPath(queryPath string) *InstancesGetGuestAttributesCall {
  70893. c.urlParams_.Set("queryPath", queryPath)
  70894. return c
  70895. }
  70896. // VariableKey sets the optional parameter "variableKey": Specifies the
  70897. // key for the guest attributes entry.
  70898. func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall {
  70899. c.urlParams_.Set("variableKey", variableKey)
  70900. return c
  70901. }
  70902. // Fields allows partial responses to be retrieved. See
  70903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70904. // for more information.
  70905. func (c *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall {
  70906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70907. return c
  70908. }
  70909. // IfNoneMatch sets the optional parameter which makes the operation
  70910. // fail if the object's ETag matches the given value. This is useful for
  70911. // getting updates only after the object has changed since the last
  70912. // request. Use googleapi.IsNotModified to check whether the response
  70913. // error from Do is the result of In-None-Match.
  70914. func (c *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall {
  70915. c.ifNoneMatch_ = entityTag
  70916. return c
  70917. }
  70918. // Context sets the context to be used in this call's Do method. Any
  70919. // pending HTTP request will be aborted if the provided context is
  70920. // canceled.
  70921. func (c *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall {
  70922. c.ctx_ = ctx
  70923. return c
  70924. }
  70925. // Header returns an http.Header that can be modified by the caller to
  70926. // add HTTP headers to the request.
  70927. func (c *InstancesGetGuestAttributesCall) Header() http.Header {
  70928. if c.header_ == nil {
  70929. c.header_ = make(http.Header)
  70930. }
  70931. return c.header_
  70932. }
  70933. func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) {
  70934. reqHeaders := make(http.Header)
  70935. for k, v := range c.header_ {
  70936. reqHeaders[k] = v
  70937. }
  70938. reqHeaders.Set("User-Agent", c.s.userAgent())
  70939. if c.ifNoneMatch_ != "" {
  70940. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70941. }
  70942. var body io.Reader = nil
  70943. c.urlParams_.Set("alt", alt)
  70944. c.urlParams_.Set("prettyPrint", "false")
  70945. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getGuestAttributes")
  70946. urls += "?" + c.urlParams_.Encode()
  70947. req, err := http.NewRequest("GET", urls, body)
  70948. if err != nil {
  70949. return nil, err
  70950. }
  70951. req.Header = reqHeaders
  70952. googleapi.Expand(req.URL, map[string]string{
  70953. "project": c.project,
  70954. "zone": c.zone,
  70955. "instance": c.instance,
  70956. })
  70957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70958. }
  70959. // Do executes the "compute.instances.getGuestAttributes" call.
  70960. // Exactly one of *GuestAttributes or error will be non-nil. Any non-2xx
  70961. // status code is an error. Response headers are in either
  70962. // *GuestAttributes.ServerResponse.Header or (if a response was returned
  70963. // at all) in error.(*googleapi.Error).Header. Use
  70964. // googleapi.IsNotModified to check whether the returned error was
  70965. // because http.StatusNotModified was returned.
  70966. func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, error) {
  70967. gensupport.SetOptions(c.urlParams_, opts...)
  70968. res, err := c.doRequest("json")
  70969. if res != nil && res.StatusCode == http.StatusNotModified {
  70970. if res.Body != nil {
  70971. res.Body.Close()
  70972. }
  70973. return nil, &googleapi.Error{
  70974. Code: res.StatusCode,
  70975. Header: res.Header,
  70976. }
  70977. }
  70978. if err != nil {
  70979. return nil, err
  70980. }
  70981. defer googleapi.CloseBody(res)
  70982. if err := googleapi.CheckResponse(res); err != nil {
  70983. return nil, err
  70984. }
  70985. ret := &GuestAttributes{
  70986. ServerResponse: googleapi.ServerResponse{
  70987. Header: res.Header,
  70988. HTTPStatusCode: res.StatusCode,
  70989. },
  70990. }
  70991. target := &ret
  70992. if err := gensupport.DecodeResponse(target, res); err != nil {
  70993. return nil, err
  70994. }
  70995. return ret, nil
  70996. // {
  70997. // "description": "Returns the specified guest attributes entry.",
  70998. // "httpMethod": "GET",
  70999. // "id": "compute.instances.getGuestAttributes",
  71000. // "parameterOrder": [
  71001. // "project",
  71002. // "zone",
  71003. // "instance"
  71004. // ],
  71005. // "parameters": {
  71006. // "instance": {
  71007. // "description": "Name of the instance scoping this request.",
  71008. // "location": "path",
  71009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71010. // "required": true,
  71011. // "type": "string"
  71012. // },
  71013. // "project": {
  71014. // "description": "Project ID for this request.",
  71015. // "location": "path",
  71016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71017. // "required": true,
  71018. // "type": "string"
  71019. // },
  71020. // "queryPath": {
  71021. // "description": "Specifies the guest attributes path to be queried.",
  71022. // "location": "query",
  71023. // "type": "string"
  71024. // },
  71025. // "variableKey": {
  71026. // "description": "Specifies the key for the guest attributes entry.",
  71027. // "location": "query",
  71028. // "type": "string"
  71029. // },
  71030. // "zone": {
  71031. // "description": "The name of the zone for this request.",
  71032. // "location": "path",
  71033. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71034. // "required": true,
  71035. // "type": "string"
  71036. // }
  71037. // },
  71038. // "path": "{project}/zones/{zone}/instances/{instance}/getGuestAttributes",
  71039. // "response": {
  71040. // "$ref": "GuestAttributes"
  71041. // },
  71042. // "scopes": [
  71043. // "https://www.googleapis.com/auth/cloud-platform",
  71044. // "https://www.googleapis.com/auth/compute",
  71045. // "https://www.googleapis.com/auth/compute.readonly"
  71046. // ]
  71047. // }
  71048. }
  71049. // method id "compute.instances.getIamPolicy":
  71050. type InstancesGetIamPolicyCall struct {
  71051. s *Service
  71052. project string
  71053. zone string
  71054. resource string
  71055. urlParams_ gensupport.URLParams
  71056. ifNoneMatch_ string
  71057. ctx_ context.Context
  71058. header_ http.Header
  71059. }
  71060. // GetIamPolicy: Gets the access control policy for a resource. May be
  71061. // empty if no such policy or resource exists.
  71062. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  71063. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71064. c.project = project
  71065. c.zone = zone
  71066. c.resource = resource
  71067. return c
  71068. }
  71069. // Fields allows partial responses to be retrieved. See
  71070. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71071. // for more information.
  71072. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  71073. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71074. return c
  71075. }
  71076. // IfNoneMatch sets the optional parameter which makes the operation
  71077. // fail if the object's ETag matches the given value. This is useful for
  71078. // getting updates only after the object has changed since the last
  71079. // request. Use googleapi.IsNotModified to check whether the response
  71080. // error from Do is the result of In-None-Match.
  71081. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  71082. c.ifNoneMatch_ = entityTag
  71083. return c
  71084. }
  71085. // Context sets the context to be used in this call's Do method. Any
  71086. // pending HTTP request will be aborted if the provided context is
  71087. // canceled.
  71088. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  71089. c.ctx_ = ctx
  71090. return c
  71091. }
  71092. // Header returns an http.Header that can be modified by the caller to
  71093. // add HTTP headers to the request.
  71094. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  71095. if c.header_ == nil {
  71096. c.header_ = make(http.Header)
  71097. }
  71098. return c.header_
  71099. }
  71100. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  71101. reqHeaders := make(http.Header)
  71102. for k, v := range c.header_ {
  71103. reqHeaders[k] = v
  71104. }
  71105. reqHeaders.Set("User-Agent", c.s.userAgent())
  71106. if c.ifNoneMatch_ != "" {
  71107. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71108. }
  71109. var body io.Reader = nil
  71110. c.urlParams_.Set("alt", alt)
  71111. c.urlParams_.Set("prettyPrint", "false")
  71112. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  71113. urls += "?" + c.urlParams_.Encode()
  71114. req, err := http.NewRequest("GET", urls, body)
  71115. if err != nil {
  71116. return nil, err
  71117. }
  71118. req.Header = reqHeaders
  71119. googleapi.Expand(req.URL, map[string]string{
  71120. "project": c.project,
  71121. "zone": c.zone,
  71122. "resource": c.resource,
  71123. })
  71124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71125. }
  71126. // Do executes the "compute.instances.getIamPolicy" call.
  71127. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  71128. // code is an error. Response headers are in either
  71129. // *Policy.ServerResponse.Header or (if a response was returned at all)
  71130. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  71131. // check whether the returned error was because http.StatusNotModified
  71132. // was returned.
  71133. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  71134. gensupport.SetOptions(c.urlParams_, opts...)
  71135. res, err := c.doRequest("json")
  71136. if res != nil && res.StatusCode == http.StatusNotModified {
  71137. if res.Body != nil {
  71138. res.Body.Close()
  71139. }
  71140. return nil, &googleapi.Error{
  71141. Code: res.StatusCode,
  71142. Header: res.Header,
  71143. }
  71144. }
  71145. if err != nil {
  71146. return nil, err
  71147. }
  71148. defer googleapi.CloseBody(res)
  71149. if err := googleapi.CheckResponse(res); err != nil {
  71150. return nil, err
  71151. }
  71152. ret := &Policy{
  71153. ServerResponse: googleapi.ServerResponse{
  71154. Header: res.Header,
  71155. HTTPStatusCode: res.StatusCode,
  71156. },
  71157. }
  71158. target := &ret
  71159. if err := gensupport.DecodeResponse(target, res); err != nil {
  71160. return nil, err
  71161. }
  71162. return ret, nil
  71163. // {
  71164. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  71165. // "httpMethod": "GET",
  71166. // "id": "compute.instances.getIamPolicy",
  71167. // "parameterOrder": [
  71168. // "project",
  71169. // "zone",
  71170. // "resource"
  71171. // ],
  71172. // "parameters": {
  71173. // "project": {
  71174. // "description": "Project ID for this request.",
  71175. // "location": "path",
  71176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71177. // "required": true,
  71178. // "type": "string"
  71179. // },
  71180. // "resource": {
  71181. // "description": "Name or id of the resource for this request.",
  71182. // "location": "path",
  71183. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71184. // "required": true,
  71185. // "type": "string"
  71186. // },
  71187. // "zone": {
  71188. // "description": "The name of the zone for this request.",
  71189. // "location": "path",
  71190. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71191. // "required": true,
  71192. // "type": "string"
  71193. // }
  71194. // },
  71195. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  71196. // "response": {
  71197. // "$ref": "Policy"
  71198. // },
  71199. // "scopes": [
  71200. // "https://www.googleapis.com/auth/cloud-platform",
  71201. // "https://www.googleapis.com/auth/compute",
  71202. // "https://www.googleapis.com/auth/compute.readonly"
  71203. // ]
  71204. // }
  71205. }
  71206. // method id "compute.instances.getSerialPortOutput":
  71207. type InstancesGetSerialPortOutputCall struct {
  71208. s *Service
  71209. project string
  71210. zone string
  71211. instance string
  71212. urlParams_ gensupport.URLParams
  71213. ifNoneMatch_ string
  71214. ctx_ context.Context
  71215. header_ http.Header
  71216. }
  71217. // GetSerialPortOutput: Returns the last 1 MB of serial port output from
  71218. // the specified instance.
  71219. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  71220. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  71221. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71222. c.project = project
  71223. c.zone = zone
  71224. c.instance = instance
  71225. return c
  71226. }
  71227. // Port sets the optional parameter "port": Specifies which COM or
  71228. // serial port to retrieve data from.
  71229. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  71230. c.urlParams_.Set("port", fmt.Sprint(port))
  71231. return c
  71232. }
  71233. // Start sets the optional parameter "start": Returns output starting
  71234. // from a specific byte position. Use this to page through output when
  71235. // the output is too large to return in a single request. For the
  71236. // initial request, leave this field unspecified. For subsequent calls,
  71237. // this field should be set to the next value returned in the previous
  71238. // call.
  71239. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  71240. c.urlParams_.Set("start", fmt.Sprint(start))
  71241. return c
  71242. }
  71243. // Fields allows partial responses to be retrieved. See
  71244. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71245. // for more information.
  71246. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  71247. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71248. return c
  71249. }
  71250. // IfNoneMatch sets the optional parameter which makes the operation
  71251. // fail if the object's ETag matches the given value. This is useful for
  71252. // getting updates only after the object has changed since the last
  71253. // request. Use googleapi.IsNotModified to check whether the response
  71254. // error from Do is the result of In-None-Match.
  71255. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  71256. c.ifNoneMatch_ = entityTag
  71257. return c
  71258. }
  71259. // Context sets the context to be used in this call's Do method. Any
  71260. // pending HTTP request will be aborted if the provided context is
  71261. // canceled.
  71262. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  71263. c.ctx_ = ctx
  71264. return c
  71265. }
  71266. // Header returns an http.Header that can be modified by the caller to
  71267. // add HTTP headers to the request.
  71268. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  71269. if c.header_ == nil {
  71270. c.header_ = make(http.Header)
  71271. }
  71272. return c.header_
  71273. }
  71274. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  71275. reqHeaders := make(http.Header)
  71276. for k, v := range c.header_ {
  71277. reqHeaders[k] = v
  71278. }
  71279. reqHeaders.Set("User-Agent", c.s.userAgent())
  71280. if c.ifNoneMatch_ != "" {
  71281. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71282. }
  71283. var body io.Reader = nil
  71284. c.urlParams_.Set("alt", alt)
  71285. c.urlParams_.Set("prettyPrint", "false")
  71286. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  71287. urls += "?" + c.urlParams_.Encode()
  71288. req, err := http.NewRequest("GET", urls, body)
  71289. if err != nil {
  71290. return nil, err
  71291. }
  71292. req.Header = reqHeaders
  71293. googleapi.Expand(req.URL, map[string]string{
  71294. "project": c.project,
  71295. "zone": c.zone,
  71296. "instance": c.instance,
  71297. })
  71298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71299. }
  71300. // Do executes the "compute.instances.getSerialPortOutput" call.
  71301. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  71302. // non-2xx status code is an error. Response headers are in either
  71303. // *SerialPortOutput.ServerResponse.Header or (if a response was
  71304. // returned at all) in error.(*googleapi.Error).Header. Use
  71305. // googleapi.IsNotModified to check whether the returned error was
  71306. // because http.StatusNotModified was returned.
  71307. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  71308. gensupport.SetOptions(c.urlParams_, opts...)
  71309. res, err := c.doRequest("json")
  71310. if res != nil && res.StatusCode == http.StatusNotModified {
  71311. if res.Body != nil {
  71312. res.Body.Close()
  71313. }
  71314. return nil, &googleapi.Error{
  71315. Code: res.StatusCode,
  71316. Header: res.Header,
  71317. }
  71318. }
  71319. if err != nil {
  71320. return nil, err
  71321. }
  71322. defer googleapi.CloseBody(res)
  71323. if err := googleapi.CheckResponse(res); err != nil {
  71324. return nil, err
  71325. }
  71326. ret := &SerialPortOutput{
  71327. ServerResponse: googleapi.ServerResponse{
  71328. Header: res.Header,
  71329. HTTPStatusCode: res.StatusCode,
  71330. },
  71331. }
  71332. target := &ret
  71333. if err := gensupport.DecodeResponse(target, res); err != nil {
  71334. return nil, err
  71335. }
  71336. return ret, nil
  71337. // {
  71338. // "description": "Returns the last 1 MB of serial port output from the specified instance.",
  71339. // "httpMethod": "GET",
  71340. // "id": "compute.instances.getSerialPortOutput",
  71341. // "parameterOrder": [
  71342. // "project",
  71343. // "zone",
  71344. // "instance"
  71345. // ],
  71346. // "parameters": {
  71347. // "instance": {
  71348. // "description": "Name of the instance scoping this request.",
  71349. // "location": "path",
  71350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71351. // "required": true,
  71352. // "type": "string"
  71353. // },
  71354. // "port": {
  71355. // "default": "1",
  71356. // "description": "Specifies which COM or serial port to retrieve data from.",
  71357. // "format": "int32",
  71358. // "location": "query",
  71359. // "maximum": "4",
  71360. // "minimum": "1",
  71361. // "type": "integer"
  71362. // },
  71363. // "project": {
  71364. // "description": "Project ID for this request.",
  71365. // "location": "path",
  71366. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71367. // "required": true,
  71368. // "type": "string"
  71369. // },
  71370. // "start": {
  71371. // "description": "Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call.",
  71372. // "format": "int64",
  71373. // "location": "query",
  71374. // "type": "string"
  71375. // },
  71376. // "zone": {
  71377. // "description": "The name of the zone for this request.",
  71378. // "location": "path",
  71379. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71380. // "required": true,
  71381. // "type": "string"
  71382. // }
  71383. // },
  71384. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  71385. // "response": {
  71386. // "$ref": "SerialPortOutput"
  71387. // },
  71388. // "scopes": [
  71389. // "https://www.googleapis.com/auth/cloud-platform",
  71390. // "https://www.googleapis.com/auth/compute",
  71391. // "https://www.googleapis.com/auth/compute.readonly"
  71392. // ]
  71393. // }
  71394. }
  71395. // method id "compute.instances.getShieldedInstanceIdentity":
  71396. type InstancesGetShieldedInstanceIdentityCall struct {
  71397. s *Service
  71398. project string
  71399. zone string
  71400. instance string
  71401. urlParams_ gensupport.URLParams
  71402. ifNoneMatch_ string
  71403. ctx_ context.Context
  71404. header_ http.Header
  71405. }
  71406. // GetShieldedInstanceIdentity: Returns the Shielded Instance Identity
  71407. // of an instance
  71408. func (r *InstancesService) GetShieldedInstanceIdentity(project string, zone string, instance string) *InstancesGetShieldedInstanceIdentityCall {
  71409. c := &InstancesGetShieldedInstanceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71410. c.project = project
  71411. c.zone = zone
  71412. c.instance = instance
  71413. return c
  71414. }
  71415. // Fields allows partial responses to be retrieved. See
  71416. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71417. // for more information.
  71418. func (c *InstancesGetShieldedInstanceIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedInstanceIdentityCall {
  71419. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71420. return c
  71421. }
  71422. // IfNoneMatch sets the optional parameter which makes the operation
  71423. // fail if the object's ETag matches the given value. This is useful for
  71424. // getting updates only after the object has changed since the last
  71425. // request. Use googleapi.IsNotModified to check whether the response
  71426. // error from Do is the result of In-None-Match.
  71427. func (c *InstancesGetShieldedInstanceIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedInstanceIdentityCall {
  71428. c.ifNoneMatch_ = entityTag
  71429. return c
  71430. }
  71431. // Context sets the context to be used in this call's Do method. Any
  71432. // pending HTTP request will be aborted if the provided context is
  71433. // canceled.
  71434. func (c *InstancesGetShieldedInstanceIdentityCall) Context(ctx context.Context) *InstancesGetShieldedInstanceIdentityCall {
  71435. c.ctx_ = ctx
  71436. return c
  71437. }
  71438. // Header returns an http.Header that can be modified by the caller to
  71439. // add HTTP headers to the request.
  71440. func (c *InstancesGetShieldedInstanceIdentityCall) Header() http.Header {
  71441. if c.header_ == nil {
  71442. c.header_ = make(http.Header)
  71443. }
  71444. return c.header_
  71445. }
  71446. func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http.Response, error) {
  71447. reqHeaders := make(http.Header)
  71448. for k, v := range c.header_ {
  71449. reqHeaders[k] = v
  71450. }
  71451. reqHeaders.Set("User-Agent", c.s.userAgent())
  71452. if c.ifNoneMatch_ != "" {
  71453. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71454. }
  71455. var body io.Reader = nil
  71456. c.urlParams_.Set("alt", alt)
  71457. c.urlParams_.Set("prettyPrint", "false")
  71458. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity")
  71459. urls += "?" + c.urlParams_.Encode()
  71460. req, err := http.NewRequest("GET", urls, body)
  71461. if err != nil {
  71462. return nil, err
  71463. }
  71464. req.Header = reqHeaders
  71465. googleapi.Expand(req.URL, map[string]string{
  71466. "project": c.project,
  71467. "zone": c.zone,
  71468. "instance": c.instance,
  71469. })
  71470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71471. }
  71472. // Do executes the "compute.instances.getShieldedInstanceIdentity" call.
  71473. // Exactly one of *ShieldedInstanceIdentity or error will be non-nil.
  71474. // Any non-2xx status code is an error. Response headers are in either
  71475. // *ShieldedInstanceIdentity.ServerResponse.Header or (if a response was
  71476. // returned at all) in error.(*googleapi.Error).Header. Use
  71477. // googleapi.IsNotModified to check whether the returned error was
  71478. // because http.StatusNotModified was returned.
  71479. func (c *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedInstanceIdentity, error) {
  71480. gensupport.SetOptions(c.urlParams_, opts...)
  71481. res, err := c.doRequest("json")
  71482. if res != nil && res.StatusCode == http.StatusNotModified {
  71483. if res.Body != nil {
  71484. res.Body.Close()
  71485. }
  71486. return nil, &googleapi.Error{
  71487. Code: res.StatusCode,
  71488. Header: res.Header,
  71489. }
  71490. }
  71491. if err != nil {
  71492. return nil, err
  71493. }
  71494. defer googleapi.CloseBody(res)
  71495. if err := googleapi.CheckResponse(res); err != nil {
  71496. return nil, err
  71497. }
  71498. ret := &ShieldedInstanceIdentity{
  71499. ServerResponse: googleapi.ServerResponse{
  71500. Header: res.Header,
  71501. HTTPStatusCode: res.StatusCode,
  71502. },
  71503. }
  71504. target := &ret
  71505. if err := gensupport.DecodeResponse(target, res); err != nil {
  71506. return nil, err
  71507. }
  71508. return ret, nil
  71509. // {
  71510. // "description": "Returns the Shielded Instance Identity of an instance",
  71511. // "httpMethod": "GET",
  71512. // "id": "compute.instances.getShieldedInstanceIdentity",
  71513. // "parameterOrder": [
  71514. // "project",
  71515. // "zone",
  71516. // "instance"
  71517. // ],
  71518. // "parameters": {
  71519. // "instance": {
  71520. // "description": "Name or id of the instance scoping this request.",
  71521. // "location": "path",
  71522. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71523. // "required": true,
  71524. // "type": "string"
  71525. // },
  71526. // "project": {
  71527. // "description": "Project ID for this request.",
  71528. // "location": "path",
  71529. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71530. // "required": true,
  71531. // "type": "string"
  71532. // },
  71533. // "zone": {
  71534. // "description": "The name of the zone for this request.",
  71535. // "location": "path",
  71536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71537. // "required": true,
  71538. // "type": "string"
  71539. // }
  71540. // },
  71541. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity",
  71542. // "response": {
  71543. // "$ref": "ShieldedInstanceIdentity"
  71544. // },
  71545. // "scopes": [
  71546. // "https://www.googleapis.com/auth/cloud-platform",
  71547. // "https://www.googleapis.com/auth/compute",
  71548. // "https://www.googleapis.com/auth/compute.readonly"
  71549. // ]
  71550. // }
  71551. }
  71552. // method id "compute.instances.getShieldedVmIdentity":
  71553. type InstancesGetShieldedVmIdentityCall struct {
  71554. s *Service
  71555. project string
  71556. zone string
  71557. instance string
  71558. urlParams_ gensupport.URLParams
  71559. ifNoneMatch_ string
  71560. ctx_ context.Context
  71561. header_ http.Header
  71562. }
  71563. // GetShieldedVmIdentity: Returns the Shielded VM Identity of an
  71564. // instance
  71565. func (r *InstancesService) GetShieldedVmIdentity(project string, zone string, instance string) *InstancesGetShieldedVmIdentityCall {
  71566. c := &InstancesGetShieldedVmIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71567. c.project = project
  71568. c.zone = zone
  71569. c.instance = instance
  71570. return c
  71571. }
  71572. // Fields allows partial responses to be retrieved. See
  71573. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71574. // for more information.
  71575. func (c *InstancesGetShieldedVmIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedVmIdentityCall {
  71576. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71577. return c
  71578. }
  71579. // IfNoneMatch sets the optional parameter which makes the operation
  71580. // fail if the object's ETag matches the given value. This is useful for
  71581. // getting updates only after the object has changed since the last
  71582. // request. Use googleapi.IsNotModified to check whether the response
  71583. // error from Do is the result of In-None-Match.
  71584. func (c *InstancesGetShieldedVmIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedVmIdentityCall {
  71585. c.ifNoneMatch_ = entityTag
  71586. return c
  71587. }
  71588. // Context sets the context to be used in this call's Do method. Any
  71589. // pending HTTP request will be aborted if the provided context is
  71590. // canceled.
  71591. func (c *InstancesGetShieldedVmIdentityCall) Context(ctx context.Context) *InstancesGetShieldedVmIdentityCall {
  71592. c.ctx_ = ctx
  71593. return c
  71594. }
  71595. // Header returns an http.Header that can be modified by the caller to
  71596. // add HTTP headers to the request.
  71597. func (c *InstancesGetShieldedVmIdentityCall) Header() http.Header {
  71598. if c.header_ == nil {
  71599. c.header_ = make(http.Header)
  71600. }
  71601. return c.header_
  71602. }
  71603. func (c *InstancesGetShieldedVmIdentityCall) doRequest(alt string) (*http.Response, error) {
  71604. reqHeaders := make(http.Header)
  71605. for k, v := range c.header_ {
  71606. reqHeaders[k] = v
  71607. }
  71608. reqHeaders.Set("User-Agent", c.s.userAgent())
  71609. if c.ifNoneMatch_ != "" {
  71610. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71611. }
  71612. var body io.Reader = nil
  71613. c.urlParams_.Set("alt", alt)
  71614. c.urlParams_.Set("prettyPrint", "false")
  71615. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity")
  71616. urls += "?" + c.urlParams_.Encode()
  71617. req, err := http.NewRequest("GET", urls, body)
  71618. if err != nil {
  71619. return nil, err
  71620. }
  71621. req.Header = reqHeaders
  71622. googleapi.Expand(req.URL, map[string]string{
  71623. "project": c.project,
  71624. "zone": c.zone,
  71625. "instance": c.instance,
  71626. })
  71627. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71628. }
  71629. // Do executes the "compute.instances.getShieldedVmIdentity" call.
  71630. // Exactly one of *ShieldedVmIdentity or error will be non-nil. Any
  71631. // non-2xx status code is an error. Response headers are in either
  71632. // *ShieldedVmIdentity.ServerResponse.Header or (if a response was
  71633. // returned at all) in error.(*googleapi.Error).Header. Use
  71634. // googleapi.IsNotModified to check whether the returned error was
  71635. // because http.StatusNotModified was returned.
  71636. func (c *InstancesGetShieldedVmIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedVmIdentity, error) {
  71637. gensupport.SetOptions(c.urlParams_, opts...)
  71638. res, err := c.doRequest("json")
  71639. if res != nil && res.StatusCode == http.StatusNotModified {
  71640. if res.Body != nil {
  71641. res.Body.Close()
  71642. }
  71643. return nil, &googleapi.Error{
  71644. Code: res.StatusCode,
  71645. Header: res.Header,
  71646. }
  71647. }
  71648. if err != nil {
  71649. return nil, err
  71650. }
  71651. defer googleapi.CloseBody(res)
  71652. if err := googleapi.CheckResponse(res); err != nil {
  71653. return nil, err
  71654. }
  71655. ret := &ShieldedVmIdentity{
  71656. ServerResponse: googleapi.ServerResponse{
  71657. Header: res.Header,
  71658. HTTPStatusCode: res.StatusCode,
  71659. },
  71660. }
  71661. target := &ret
  71662. if err := gensupport.DecodeResponse(target, res); err != nil {
  71663. return nil, err
  71664. }
  71665. return ret, nil
  71666. // {
  71667. // "description": "Returns the Shielded VM Identity of an instance",
  71668. // "httpMethod": "GET",
  71669. // "id": "compute.instances.getShieldedVmIdentity",
  71670. // "parameterOrder": [
  71671. // "project",
  71672. // "zone",
  71673. // "instance"
  71674. // ],
  71675. // "parameters": {
  71676. // "instance": {
  71677. // "description": "Name of the instance scoping this request.",
  71678. // "location": "path",
  71679. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71680. // "required": true,
  71681. // "type": "string"
  71682. // },
  71683. // "project": {
  71684. // "description": "Project ID for this request.",
  71685. // "location": "path",
  71686. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71687. // "required": true,
  71688. // "type": "string"
  71689. // },
  71690. // "zone": {
  71691. // "description": "The name of the zone for this request.",
  71692. // "location": "path",
  71693. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71694. // "required": true,
  71695. // "type": "string"
  71696. // }
  71697. // },
  71698. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedVmIdentity",
  71699. // "response": {
  71700. // "$ref": "ShieldedVmIdentity"
  71701. // },
  71702. // "scopes": [
  71703. // "https://www.googleapis.com/auth/cloud-platform",
  71704. // "https://www.googleapis.com/auth/compute",
  71705. // "https://www.googleapis.com/auth/compute.readonly"
  71706. // ]
  71707. // }
  71708. }
  71709. // method id "compute.instances.insert":
  71710. type InstancesInsertCall struct {
  71711. s *Service
  71712. project string
  71713. zone string
  71714. instance *Instance
  71715. urlParams_ gensupport.URLParams
  71716. ctx_ context.Context
  71717. header_ http.Header
  71718. }
  71719. // Insert: Creates an instance resource in the specified project using
  71720. // the data included in the request.
  71721. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  71722. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  71723. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71724. c.project = project
  71725. c.zone = zone
  71726. c.instance = instance
  71727. return c
  71728. }
  71729. // RequestId sets the optional parameter "requestId": An optional
  71730. // request ID to identify requests. Specify a unique request ID so that
  71731. // if you must retry your request, the server will know to ignore the
  71732. // request if it has already been completed.
  71733. //
  71734. // For example, consider a situation where you make an initial request
  71735. // and the request times out. If you make the request again with the
  71736. // same request ID, the server can check if original operation with the
  71737. // same request ID was received, and if so, will ignore the second
  71738. // request. This prevents clients from accidentally creating duplicate
  71739. // commitments.
  71740. //
  71741. // The request ID must be a valid UUID with the exception that zero UUID
  71742. // is not supported (00000000-0000-0000-0000-000000000000).
  71743. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  71744. c.urlParams_.Set("requestId", requestId)
  71745. return c
  71746. }
  71747. // SourceInstanceTemplate sets the optional parameter
  71748. // "sourceInstanceTemplate": Specifies instance template to create the
  71749. // instance.
  71750. //
  71751. // This field is optional. It can be a full or partial URL. For example,
  71752. // the following are all valid URLs to an instance template:
  71753. // -
  71754. // https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  71755. // - projects/project/global/instanceTemplates/instanceTemplate
  71756. // - global/instanceTemplates/instanceTemplate
  71757. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  71758. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  71759. return c
  71760. }
  71761. // SourceMachineImage sets the optional parameter "sourceMachineImage":
  71762. // Specifies instance machine to create the instance.
  71763. //
  71764. // This field is optional. It can be a full or partial URL. For example,
  71765. // the following are all valid URLs to an instance template:
  71766. // -
  71767. // https://www.googleapis.com/compute/v1/projects/project/global/global/machineImages/machineImage
  71768. // - projects/project/global/global/machineImages/machineImage
  71769. // - global/machineImages/machineImage
  71770. func (c *InstancesInsertCall) SourceMachineImage(sourceMachineImage string) *InstancesInsertCall {
  71771. c.urlParams_.Set("sourceMachineImage", sourceMachineImage)
  71772. return c
  71773. }
  71774. // Fields allows partial responses to be retrieved. See
  71775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71776. // for more information.
  71777. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  71778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71779. return c
  71780. }
  71781. // Context sets the context to be used in this call's Do method. Any
  71782. // pending HTTP request will be aborted if the provided context is
  71783. // canceled.
  71784. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  71785. c.ctx_ = ctx
  71786. return c
  71787. }
  71788. // Header returns an http.Header that can be modified by the caller to
  71789. // add HTTP headers to the request.
  71790. func (c *InstancesInsertCall) Header() http.Header {
  71791. if c.header_ == nil {
  71792. c.header_ = make(http.Header)
  71793. }
  71794. return c.header_
  71795. }
  71796. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  71797. reqHeaders := make(http.Header)
  71798. for k, v := range c.header_ {
  71799. reqHeaders[k] = v
  71800. }
  71801. reqHeaders.Set("User-Agent", c.s.userAgent())
  71802. var body io.Reader = nil
  71803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  71804. if err != nil {
  71805. return nil, err
  71806. }
  71807. reqHeaders.Set("Content-Type", "application/json")
  71808. c.urlParams_.Set("alt", alt)
  71809. c.urlParams_.Set("prettyPrint", "false")
  71810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  71811. urls += "?" + c.urlParams_.Encode()
  71812. req, err := http.NewRequest("POST", urls, body)
  71813. if err != nil {
  71814. return nil, err
  71815. }
  71816. req.Header = reqHeaders
  71817. googleapi.Expand(req.URL, map[string]string{
  71818. "project": c.project,
  71819. "zone": c.zone,
  71820. })
  71821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71822. }
  71823. // Do executes the "compute.instances.insert" call.
  71824. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71825. // status code is an error. Response headers are in either
  71826. // *Operation.ServerResponse.Header or (if a response was returned at
  71827. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71828. // to check whether the returned error was because
  71829. // http.StatusNotModified was returned.
  71830. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71831. gensupport.SetOptions(c.urlParams_, opts...)
  71832. res, err := c.doRequest("json")
  71833. if res != nil && res.StatusCode == http.StatusNotModified {
  71834. if res.Body != nil {
  71835. res.Body.Close()
  71836. }
  71837. return nil, &googleapi.Error{
  71838. Code: res.StatusCode,
  71839. Header: res.Header,
  71840. }
  71841. }
  71842. if err != nil {
  71843. return nil, err
  71844. }
  71845. defer googleapi.CloseBody(res)
  71846. if err := googleapi.CheckResponse(res); err != nil {
  71847. return nil, err
  71848. }
  71849. ret := &Operation{
  71850. ServerResponse: googleapi.ServerResponse{
  71851. Header: res.Header,
  71852. HTTPStatusCode: res.StatusCode,
  71853. },
  71854. }
  71855. target := &ret
  71856. if err := gensupport.DecodeResponse(target, res); err != nil {
  71857. return nil, err
  71858. }
  71859. return ret, nil
  71860. // {
  71861. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  71862. // "httpMethod": "POST",
  71863. // "id": "compute.instances.insert",
  71864. // "parameterOrder": [
  71865. // "project",
  71866. // "zone"
  71867. // ],
  71868. // "parameters": {
  71869. // "project": {
  71870. // "description": "Project ID for this request.",
  71871. // "location": "path",
  71872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71873. // "required": true,
  71874. // "type": "string"
  71875. // },
  71876. // "requestId": {
  71877. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71878. // "location": "query",
  71879. // "type": "string"
  71880. // },
  71881. // "sourceInstanceTemplate": {
  71882. // "description": "Specifies instance template to create the instance.\n\nThis field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: \n- https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate \n- projects/project/global/instanceTemplates/instanceTemplate \n- global/instanceTemplates/instanceTemplate",
  71883. // "location": "query",
  71884. // "type": "string"
  71885. // },
  71886. // "sourceMachineImage": {
  71887. // "description": "Specifies instance machine to create the instance.\n\nThis field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: \n- https://www.googleapis.com/compute/v1/projects/project/global/global/machineImages/machineImage \n- projects/project/global/global/machineImages/machineImage \n- global/machineImages/machineImage",
  71888. // "location": "query",
  71889. // "type": "string"
  71890. // },
  71891. // "zone": {
  71892. // "description": "The name of the zone for this request.",
  71893. // "location": "path",
  71894. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71895. // "required": true,
  71896. // "type": "string"
  71897. // }
  71898. // },
  71899. // "path": "{project}/zones/{zone}/instances",
  71900. // "request": {
  71901. // "$ref": "Instance"
  71902. // },
  71903. // "response": {
  71904. // "$ref": "Operation"
  71905. // },
  71906. // "scopes": [
  71907. // "https://www.googleapis.com/auth/cloud-platform",
  71908. // "https://www.googleapis.com/auth/compute"
  71909. // ]
  71910. // }
  71911. }
  71912. // method id "compute.instances.list":
  71913. type InstancesListCall struct {
  71914. s *Service
  71915. project string
  71916. zone string
  71917. urlParams_ gensupport.URLParams
  71918. ifNoneMatch_ string
  71919. ctx_ context.Context
  71920. header_ http.Header
  71921. }
  71922. // List: Retrieves the list of instances contained within the specified
  71923. // zone.
  71924. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  71925. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  71926. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71927. c.project = project
  71928. c.zone = zone
  71929. return c
  71930. }
  71931. // Filter sets the optional parameter "filter": A filter expression that
  71932. // filters resources listed in the response. The expression must specify
  71933. // the field name, a comparison operator, and the value that you want to
  71934. // use for filtering. The value must be a string, a number, or a
  71935. // boolean. The comparison operator must be either =, !=, >, or <.
  71936. //
  71937. // For example, if you are filtering Compute Engine instances, you can
  71938. // exclude instances named example-instance by specifying name !=
  71939. // example-instance.
  71940. //
  71941. // You can also filter nested fields. For example, you could specify
  71942. // scheduling.automaticRestart = false to include instances only if they
  71943. // are not scheduled for automatic restarts. You can use filtering on
  71944. // nested fields to filter based on resource labels.
  71945. //
  71946. // To filter on multiple expressions, provide each separate expression
  71947. // within parentheses. For example, (scheduling.automaticRestart = true)
  71948. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71949. // AND expression. However, you can include AND and OR expressions
  71950. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71951. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71952. // true).
  71953. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  71954. c.urlParams_.Set("filter", filter)
  71955. return c
  71956. }
  71957. // MaxResults sets the optional parameter "maxResults": The maximum
  71958. // number of results per page that should be returned. If the number of
  71959. // available results is larger than maxResults, Compute Engine returns a
  71960. // nextPageToken that can be used to get the next page of results in
  71961. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71962. // (Default: 500)
  71963. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  71964. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71965. return c
  71966. }
  71967. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71968. // a certain order. By default, results are returned in alphanumerical
  71969. // order based on the resource name.
  71970. //
  71971. // You can also sort results in descending order based on the creation
  71972. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71973. // based on the creationTimestamp field in reverse chronological order
  71974. // (newest result first). Use this to sort resources like operations so
  71975. // that the newest operation is returned first.
  71976. //
  71977. // Currently, only sorting by name or creationTimestamp desc is
  71978. // supported.
  71979. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  71980. c.urlParams_.Set("orderBy", orderBy)
  71981. return c
  71982. }
  71983. // PageToken sets the optional parameter "pageToken": Specifies a page
  71984. // token to use. Set pageToken to the nextPageToken returned by a
  71985. // previous list request to get the next page of results.
  71986. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  71987. c.urlParams_.Set("pageToken", pageToken)
  71988. return c
  71989. }
  71990. // Fields allows partial responses to be retrieved. See
  71991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71992. // for more information.
  71993. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  71994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71995. return c
  71996. }
  71997. // IfNoneMatch sets the optional parameter which makes the operation
  71998. // fail if the object's ETag matches the given value. This is useful for
  71999. // getting updates only after the object has changed since the last
  72000. // request. Use googleapi.IsNotModified to check whether the response
  72001. // error from Do is the result of In-None-Match.
  72002. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  72003. c.ifNoneMatch_ = entityTag
  72004. return c
  72005. }
  72006. // Context sets the context to be used in this call's Do method. Any
  72007. // pending HTTP request will be aborted if the provided context is
  72008. // canceled.
  72009. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  72010. c.ctx_ = ctx
  72011. return c
  72012. }
  72013. // Header returns an http.Header that can be modified by the caller to
  72014. // add HTTP headers to the request.
  72015. func (c *InstancesListCall) Header() http.Header {
  72016. if c.header_ == nil {
  72017. c.header_ = make(http.Header)
  72018. }
  72019. return c.header_
  72020. }
  72021. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  72022. reqHeaders := make(http.Header)
  72023. for k, v := range c.header_ {
  72024. reqHeaders[k] = v
  72025. }
  72026. reqHeaders.Set("User-Agent", c.s.userAgent())
  72027. if c.ifNoneMatch_ != "" {
  72028. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72029. }
  72030. var body io.Reader = nil
  72031. c.urlParams_.Set("alt", alt)
  72032. c.urlParams_.Set("prettyPrint", "false")
  72033. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  72034. urls += "?" + c.urlParams_.Encode()
  72035. req, err := http.NewRequest("GET", urls, body)
  72036. if err != nil {
  72037. return nil, err
  72038. }
  72039. req.Header = reqHeaders
  72040. googleapi.Expand(req.URL, map[string]string{
  72041. "project": c.project,
  72042. "zone": c.zone,
  72043. })
  72044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72045. }
  72046. // Do executes the "compute.instances.list" call.
  72047. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  72048. // status code is an error. Response headers are in either
  72049. // *InstanceList.ServerResponse.Header or (if a response was returned at
  72050. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72051. // to check whether the returned error was because
  72052. // http.StatusNotModified was returned.
  72053. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  72054. gensupport.SetOptions(c.urlParams_, opts...)
  72055. res, err := c.doRequest("json")
  72056. if res != nil && res.StatusCode == http.StatusNotModified {
  72057. if res.Body != nil {
  72058. res.Body.Close()
  72059. }
  72060. return nil, &googleapi.Error{
  72061. Code: res.StatusCode,
  72062. Header: res.Header,
  72063. }
  72064. }
  72065. if err != nil {
  72066. return nil, err
  72067. }
  72068. defer googleapi.CloseBody(res)
  72069. if err := googleapi.CheckResponse(res); err != nil {
  72070. return nil, err
  72071. }
  72072. ret := &InstanceList{
  72073. ServerResponse: googleapi.ServerResponse{
  72074. Header: res.Header,
  72075. HTTPStatusCode: res.StatusCode,
  72076. },
  72077. }
  72078. target := &ret
  72079. if err := gensupport.DecodeResponse(target, res); err != nil {
  72080. return nil, err
  72081. }
  72082. return ret, nil
  72083. // {
  72084. // "description": "Retrieves the list of instances contained within the specified zone.",
  72085. // "httpMethod": "GET",
  72086. // "id": "compute.instances.list",
  72087. // "parameterOrder": [
  72088. // "project",
  72089. // "zone"
  72090. // ],
  72091. // "parameters": {
  72092. // "filter": {
  72093. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  72094. // "location": "query",
  72095. // "type": "string"
  72096. // },
  72097. // "maxResults": {
  72098. // "default": "500",
  72099. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  72100. // "format": "uint32",
  72101. // "location": "query",
  72102. // "minimum": "0",
  72103. // "type": "integer"
  72104. // },
  72105. // "orderBy": {
  72106. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  72107. // "location": "query",
  72108. // "type": "string"
  72109. // },
  72110. // "pageToken": {
  72111. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  72112. // "location": "query",
  72113. // "type": "string"
  72114. // },
  72115. // "project": {
  72116. // "description": "Project ID for this request.",
  72117. // "location": "path",
  72118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72119. // "required": true,
  72120. // "type": "string"
  72121. // },
  72122. // "zone": {
  72123. // "description": "The name of the zone for this request.",
  72124. // "location": "path",
  72125. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72126. // "required": true,
  72127. // "type": "string"
  72128. // }
  72129. // },
  72130. // "path": "{project}/zones/{zone}/instances",
  72131. // "response": {
  72132. // "$ref": "InstanceList"
  72133. // },
  72134. // "scopes": [
  72135. // "https://www.googleapis.com/auth/cloud-platform",
  72136. // "https://www.googleapis.com/auth/compute",
  72137. // "https://www.googleapis.com/auth/compute.readonly"
  72138. // ]
  72139. // }
  72140. }
  72141. // Pages invokes f for each page of results.
  72142. // A non-nil error returned from f will halt the iteration.
  72143. // The provided context supersedes any context provided to the Context method.
  72144. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  72145. c.ctx_ = ctx
  72146. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72147. for {
  72148. x, err := c.Do()
  72149. if err != nil {
  72150. return err
  72151. }
  72152. if err := f(x); err != nil {
  72153. return err
  72154. }
  72155. if x.NextPageToken == "" {
  72156. return nil
  72157. }
  72158. c.PageToken(x.NextPageToken)
  72159. }
  72160. }
  72161. // method id "compute.instances.listReferrers":
  72162. type InstancesListReferrersCall struct {
  72163. s *Service
  72164. project string
  72165. zone string
  72166. instance string
  72167. urlParams_ gensupport.URLParams
  72168. ifNoneMatch_ string
  72169. ctx_ context.Context
  72170. header_ http.Header
  72171. }
  72172. // ListReferrers: Retrieves the list of referrers to instances contained
  72173. // within the specified zone. For more information, read Viewing
  72174. // Referrers to VM Instances.
  72175. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  72176. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72177. c.project = project
  72178. c.zone = zone
  72179. c.instance = instance
  72180. return c
  72181. }
  72182. // Filter sets the optional parameter "filter": A filter expression that
  72183. // filters resources listed in the response. The expression must specify
  72184. // the field name, a comparison operator, and the value that you want to
  72185. // use for filtering. The value must be a string, a number, or a
  72186. // boolean. The comparison operator must be either =, !=, >, or <.
  72187. //
  72188. // For example, if you are filtering Compute Engine instances, you can
  72189. // exclude instances named example-instance by specifying name !=
  72190. // example-instance.
  72191. //
  72192. // You can also filter nested fields. For example, you could specify
  72193. // scheduling.automaticRestart = false to include instances only if they
  72194. // are not scheduled for automatic restarts. You can use filtering on
  72195. // nested fields to filter based on resource labels.
  72196. //
  72197. // To filter on multiple expressions, provide each separate expression
  72198. // within parentheses. For example, (scheduling.automaticRestart = true)
  72199. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72200. // AND expression. However, you can include AND and OR expressions
  72201. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72202. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72203. // true).
  72204. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  72205. c.urlParams_.Set("filter", filter)
  72206. return c
  72207. }
  72208. // MaxResults sets the optional parameter "maxResults": The maximum
  72209. // number of results per page that should be returned. If the number of
  72210. // available results is larger than maxResults, Compute Engine returns a
  72211. // nextPageToken that can be used to get the next page of results in
  72212. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72213. // (Default: 500)
  72214. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  72215. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72216. return c
  72217. }
  72218. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72219. // a certain order. By default, results are returned in alphanumerical
  72220. // order based on the resource name.
  72221. //
  72222. // You can also sort results in descending order based on the creation
  72223. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72224. // based on the creationTimestamp field in reverse chronological order
  72225. // (newest result first). Use this to sort resources like operations so
  72226. // that the newest operation is returned first.
  72227. //
  72228. // Currently, only sorting by name or creationTimestamp desc is
  72229. // supported.
  72230. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  72231. c.urlParams_.Set("orderBy", orderBy)
  72232. return c
  72233. }
  72234. // PageToken sets the optional parameter "pageToken": Specifies a page
  72235. // token to use. Set pageToken to the nextPageToken returned by a
  72236. // previous list request to get the next page of results.
  72237. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  72238. c.urlParams_.Set("pageToken", pageToken)
  72239. return c
  72240. }
  72241. // Fields allows partial responses to be retrieved. See
  72242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72243. // for more information.
  72244. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  72245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72246. return c
  72247. }
  72248. // IfNoneMatch sets the optional parameter which makes the operation
  72249. // fail if the object's ETag matches the given value. This is useful for
  72250. // getting updates only after the object has changed since the last
  72251. // request. Use googleapi.IsNotModified to check whether the response
  72252. // error from Do is the result of In-None-Match.
  72253. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  72254. c.ifNoneMatch_ = entityTag
  72255. return c
  72256. }
  72257. // Context sets the context to be used in this call's Do method. Any
  72258. // pending HTTP request will be aborted if the provided context is
  72259. // canceled.
  72260. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  72261. c.ctx_ = ctx
  72262. return c
  72263. }
  72264. // Header returns an http.Header that can be modified by the caller to
  72265. // add HTTP headers to the request.
  72266. func (c *InstancesListReferrersCall) Header() http.Header {
  72267. if c.header_ == nil {
  72268. c.header_ = make(http.Header)
  72269. }
  72270. return c.header_
  72271. }
  72272. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  72273. reqHeaders := make(http.Header)
  72274. for k, v := range c.header_ {
  72275. reqHeaders[k] = v
  72276. }
  72277. reqHeaders.Set("User-Agent", c.s.userAgent())
  72278. if c.ifNoneMatch_ != "" {
  72279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72280. }
  72281. var body io.Reader = nil
  72282. c.urlParams_.Set("alt", alt)
  72283. c.urlParams_.Set("prettyPrint", "false")
  72284. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  72285. urls += "?" + c.urlParams_.Encode()
  72286. req, err := http.NewRequest("GET", urls, body)
  72287. if err != nil {
  72288. return nil, err
  72289. }
  72290. req.Header = reqHeaders
  72291. googleapi.Expand(req.URL, map[string]string{
  72292. "project": c.project,
  72293. "zone": c.zone,
  72294. "instance": c.instance,
  72295. })
  72296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72297. }
  72298. // Do executes the "compute.instances.listReferrers" call.
  72299. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  72300. // non-2xx status code is an error. Response headers are in either
  72301. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  72302. // returned at all) in error.(*googleapi.Error).Header. Use
  72303. // googleapi.IsNotModified to check whether the returned error was
  72304. // because http.StatusNotModified was returned.
  72305. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  72306. gensupport.SetOptions(c.urlParams_, opts...)
  72307. res, err := c.doRequest("json")
  72308. if res != nil && res.StatusCode == http.StatusNotModified {
  72309. if res.Body != nil {
  72310. res.Body.Close()
  72311. }
  72312. return nil, &googleapi.Error{
  72313. Code: res.StatusCode,
  72314. Header: res.Header,
  72315. }
  72316. }
  72317. if err != nil {
  72318. return nil, err
  72319. }
  72320. defer googleapi.CloseBody(res)
  72321. if err := googleapi.CheckResponse(res); err != nil {
  72322. return nil, err
  72323. }
  72324. ret := &InstanceListReferrers{
  72325. ServerResponse: googleapi.ServerResponse{
  72326. Header: res.Header,
  72327. HTTPStatusCode: res.StatusCode,
  72328. },
  72329. }
  72330. target := &ret
  72331. if err := gensupport.DecodeResponse(target, res); err != nil {
  72332. return nil, err
  72333. }
  72334. return ret, nil
  72335. // {
  72336. // "description": "Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.",
  72337. // "httpMethod": "GET",
  72338. // "id": "compute.instances.listReferrers",
  72339. // "parameterOrder": [
  72340. // "project",
  72341. // "zone",
  72342. // "instance"
  72343. // ],
  72344. // "parameters": {
  72345. // "filter": {
  72346. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  72347. // "location": "query",
  72348. // "type": "string"
  72349. // },
  72350. // "instance": {
  72351. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  72352. // "location": "path",
  72353. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72354. // "required": true,
  72355. // "type": "string"
  72356. // },
  72357. // "maxResults": {
  72358. // "default": "500",
  72359. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  72360. // "format": "uint32",
  72361. // "location": "query",
  72362. // "minimum": "0",
  72363. // "type": "integer"
  72364. // },
  72365. // "orderBy": {
  72366. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  72367. // "location": "query",
  72368. // "type": "string"
  72369. // },
  72370. // "pageToken": {
  72371. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  72372. // "location": "query",
  72373. // "type": "string"
  72374. // },
  72375. // "project": {
  72376. // "description": "Project ID for this request.",
  72377. // "location": "path",
  72378. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72379. // "required": true,
  72380. // "type": "string"
  72381. // },
  72382. // "zone": {
  72383. // "description": "The name of the zone for this request.",
  72384. // "location": "path",
  72385. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72386. // "required": true,
  72387. // "type": "string"
  72388. // }
  72389. // },
  72390. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  72391. // "response": {
  72392. // "$ref": "InstanceListReferrers"
  72393. // },
  72394. // "scopes": [
  72395. // "https://www.googleapis.com/auth/cloud-platform",
  72396. // "https://www.googleapis.com/auth/compute",
  72397. // "https://www.googleapis.com/auth/compute.readonly"
  72398. // ]
  72399. // }
  72400. }
  72401. // Pages invokes f for each page of results.
  72402. // A non-nil error returned from f will halt the iteration.
  72403. // The provided context supersedes any context provided to the Context method.
  72404. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  72405. c.ctx_ = ctx
  72406. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72407. for {
  72408. x, err := c.Do()
  72409. if err != nil {
  72410. return err
  72411. }
  72412. if err := f(x); err != nil {
  72413. return err
  72414. }
  72415. if x.NextPageToken == "" {
  72416. return nil
  72417. }
  72418. c.PageToken(x.NextPageToken)
  72419. }
  72420. }
  72421. // method id "compute.instances.removeResourcePolicies":
  72422. type InstancesRemoveResourcePoliciesCall struct {
  72423. s *Service
  72424. project string
  72425. zone string
  72426. instance string
  72427. instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest
  72428. urlParams_ gensupport.URLParams
  72429. ctx_ context.Context
  72430. header_ http.Header
  72431. }
  72432. // RemoveResourcePolicies: Removes resource policies from an instance.
  72433. func (r *InstancesService) RemoveResourcePolicies(project string, zone string, instance string, instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest) *InstancesRemoveResourcePoliciesCall {
  72434. c := &InstancesRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72435. c.project = project
  72436. c.zone = zone
  72437. c.instance = instance
  72438. c.instancesremoveresourcepoliciesrequest = instancesremoveresourcepoliciesrequest
  72439. return c
  72440. }
  72441. // RequestId sets the optional parameter "requestId": An optional
  72442. // request ID to identify requests. Specify a unique request ID so that
  72443. // if you must retry your request, the server will know to ignore the
  72444. // request if it has already been completed.
  72445. //
  72446. // For example, consider a situation where you make an initial request
  72447. // and the request times out. If you make the request again with the
  72448. // same request ID, the server can check if original operation with the
  72449. // same request ID was received, and if so, will ignore the second
  72450. // request. This prevents clients from accidentally creating duplicate
  72451. // commitments.
  72452. //
  72453. // The request ID must be a valid UUID with the exception that zero UUID
  72454. // is not supported (00000000-0000-0000-0000-000000000000).
  72455. func (c *InstancesRemoveResourcePoliciesCall) RequestId(requestId string) *InstancesRemoveResourcePoliciesCall {
  72456. c.urlParams_.Set("requestId", requestId)
  72457. return c
  72458. }
  72459. // Fields allows partial responses to be retrieved. See
  72460. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72461. // for more information.
  72462. func (c *InstancesRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesRemoveResourcePoliciesCall {
  72463. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72464. return c
  72465. }
  72466. // Context sets the context to be used in this call's Do method. Any
  72467. // pending HTTP request will be aborted if the provided context is
  72468. // canceled.
  72469. func (c *InstancesRemoveResourcePoliciesCall) Context(ctx context.Context) *InstancesRemoveResourcePoliciesCall {
  72470. c.ctx_ = ctx
  72471. return c
  72472. }
  72473. // Header returns an http.Header that can be modified by the caller to
  72474. // add HTTP headers to the request.
  72475. func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header {
  72476. if c.header_ == nil {
  72477. c.header_ = make(http.Header)
  72478. }
  72479. return c.header_
  72480. }
  72481. func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  72482. reqHeaders := make(http.Header)
  72483. for k, v := range c.header_ {
  72484. reqHeaders[k] = v
  72485. }
  72486. reqHeaders.Set("User-Agent", c.s.userAgent())
  72487. var body io.Reader = nil
  72488. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest)
  72489. if err != nil {
  72490. return nil, err
  72491. }
  72492. reqHeaders.Set("Content-Type", "application/json")
  72493. c.urlParams_.Set("alt", alt)
  72494. c.urlParams_.Set("prettyPrint", "false")
  72495. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies")
  72496. urls += "?" + c.urlParams_.Encode()
  72497. req, err := http.NewRequest("POST", urls, body)
  72498. if err != nil {
  72499. return nil, err
  72500. }
  72501. req.Header = reqHeaders
  72502. googleapi.Expand(req.URL, map[string]string{
  72503. "project": c.project,
  72504. "zone": c.zone,
  72505. "instance": c.instance,
  72506. })
  72507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72508. }
  72509. // Do executes the "compute.instances.removeResourcePolicies" call.
  72510. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72511. // status code is an error. Response headers are in either
  72512. // *Operation.ServerResponse.Header or (if a response was returned at
  72513. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72514. // to check whether the returned error was because
  72515. // http.StatusNotModified was returned.
  72516. func (c *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72517. gensupport.SetOptions(c.urlParams_, opts...)
  72518. res, err := c.doRequest("json")
  72519. if res != nil && res.StatusCode == http.StatusNotModified {
  72520. if res.Body != nil {
  72521. res.Body.Close()
  72522. }
  72523. return nil, &googleapi.Error{
  72524. Code: res.StatusCode,
  72525. Header: res.Header,
  72526. }
  72527. }
  72528. if err != nil {
  72529. return nil, err
  72530. }
  72531. defer googleapi.CloseBody(res)
  72532. if err := googleapi.CheckResponse(res); err != nil {
  72533. return nil, err
  72534. }
  72535. ret := &Operation{
  72536. ServerResponse: googleapi.ServerResponse{
  72537. Header: res.Header,
  72538. HTTPStatusCode: res.StatusCode,
  72539. },
  72540. }
  72541. target := &ret
  72542. if err := gensupport.DecodeResponse(target, res); err != nil {
  72543. return nil, err
  72544. }
  72545. return ret, nil
  72546. // {
  72547. // "description": "Removes resource policies from an instance.",
  72548. // "httpMethod": "POST",
  72549. // "id": "compute.instances.removeResourcePolicies",
  72550. // "parameterOrder": [
  72551. // "project",
  72552. // "zone",
  72553. // "instance"
  72554. // ],
  72555. // "parameters": {
  72556. // "instance": {
  72557. // "description": "The instance name for this request.",
  72558. // "location": "path",
  72559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72560. // "required": true,
  72561. // "type": "string"
  72562. // },
  72563. // "project": {
  72564. // "description": "Project ID for this request.",
  72565. // "location": "path",
  72566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72567. // "required": true,
  72568. // "type": "string"
  72569. // },
  72570. // "requestId": {
  72571. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72572. // "location": "query",
  72573. // "type": "string"
  72574. // },
  72575. // "zone": {
  72576. // "description": "The name of the zone for this request.",
  72577. // "location": "path",
  72578. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72579. // "required": true,
  72580. // "type": "string"
  72581. // }
  72582. // },
  72583. // "path": "{project}/zones/{zone}/instances/{instance}/removeResourcePolicies",
  72584. // "request": {
  72585. // "$ref": "InstancesRemoveResourcePoliciesRequest"
  72586. // },
  72587. // "response": {
  72588. // "$ref": "Operation"
  72589. // },
  72590. // "scopes": [
  72591. // "https://www.googleapis.com/auth/cloud-platform",
  72592. // "https://www.googleapis.com/auth/compute"
  72593. // ]
  72594. // }
  72595. }
  72596. // method id "compute.instances.reset":
  72597. type InstancesResetCall struct {
  72598. s *Service
  72599. project string
  72600. zone string
  72601. instance string
  72602. urlParams_ gensupport.URLParams
  72603. ctx_ context.Context
  72604. header_ http.Header
  72605. }
  72606. // Reset: Performs a reset on the instance. This is a hard reset the VM
  72607. // does not do a graceful shutdown. For more information, see Resetting
  72608. // an instance.
  72609. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  72610. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  72611. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72612. c.project = project
  72613. c.zone = zone
  72614. c.instance = instance
  72615. return c
  72616. }
  72617. // RequestId sets the optional parameter "requestId": An optional
  72618. // request ID to identify requests. Specify a unique request ID so that
  72619. // if you must retry your request, the server will know to ignore the
  72620. // request if it has already been completed.
  72621. //
  72622. // For example, consider a situation where you make an initial request
  72623. // and the request times out. If you make the request again with the
  72624. // same request ID, the server can check if original operation with the
  72625. // same request ID was received, and if so, will ignore the second
  72626. // request. This prevents clients from accidentally creating duplicate
  72627. // commitments.
  72628. //
  72629. // The request ID must be a valid UUID with the exception that zero UUID
  72630. // is not supported (00000000-0000-0000-0000-000000000000).
  72631. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  72632. c.urlParams_.Set("requestId", requestId)
  72633. return c
  72634. }
  72635. // Fields allows partial responses to be retrieved. See
  72636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72637. // for more information.
  72638. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  72639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72640. return c
  72641. }
  72642. // Context sets the context to be used in this call's Do method. Any
  72643. // pending HTTP request will be aborted if the provided context is
  72644. // canceled.
  72645. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  72646. c.ctx_ = ctx
  72647. return c
  72648. }
  72649. // Header returns an http.Header that can be modified by the caller to
  72650. // add HTTP headers to the request.
  72651. func (c *InstancesResetCall) Header() http.Header {
  72652. if c.header_ == nil {
  72653. c.header_ = make(http.Header)
  72654. }
  72655. return c.header_
  72656. }
  72657. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  72658. reqHeaders := make(http.Header)
  72659. for k, v := range c.header_ {
  72660. reqHeaders[k] = v
  72661. }
  72662. reqHeaders.Set("User-Agent", c.s.userAgent())
  72663. var body io.Reader = nil
  72664. c.urlParams_.Set("alt", alt)
  72665. c.urlParams_.Set("prettyPrint", "false")
  72666. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  72667. urls += "?" + c.urlParams_.Encode()
  72668. req, err := http.NewRequest("POST", urls, body)
  72669. if err != nil {
  72670. return nil, err
  72671. }
  72672. req.Header = reqHeaders
  72673. googleapi.Expand(req.URL, map[string]string{
  72674. "project": c.project,
  72675. "zone": c.zone,
  72676. "instance": c.instance,
  72677. })
  72678. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72679. }
  72680. // Do executes the "compute.instances.reset" call.
  72681. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72682. // status code is an error. Response headers are in either
  72683. // *Operation.ServerResponse.Header or (if a response was returned at
  72684. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72685. // to check whether the returned error was because
  72686. // http.StatusNotModified was returned.
  72687. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72688. gensupport.SetOptions(c.urlParams_, opts...)
  72689. res, err := c.doRequest("json")
  72690. if res != nil && res.StatusCode == http.StatusNotModified {
  72691. if res.Body != nil {
  72692. res.Body.Close()
  72693. }
  72694. return nil, &googleapi.Error{
  72695. Code: res.StatusCode,
  72696. Header: res.Header,
  72697. }
  72698. }
  72699. if err != nil {
  72700. return nil, err
  72701. }
  72702. defer googleapi.CloseBody(res)
  72703. if err := googleapi.CheckResponse(res); err != nil {
  72704. return nil, err
  72705. }
  72706. ret := &Operation{
  72707. ServerResponse: googleapi.ServerResponse{
  72708. Header: res.Header,
  72709. HTTPStatusCode: res.StatusCode,
  72710. },
  72711. }
  72712. target := &ret
  72713. if err := gensupport.DecodeResponse(target, res); err != nil {
  72714. return nil, err
  72715. }
  72716. return ret, nil
  72717. // {
  72718. // "description": "Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance.",
  72719. // "httpMethod": "POST",
  72720. // "id": "compute.instances.reset",
  72721. // "parameterOrder": [
  72722. // "project",
  72723. // "zone",
  72724. // "instance"
  72725. // ],
  72726. // "parameters": {
  72727. // "instance": {
  72728. // "description": "Name of the instance scoping this request.",
  72729. // "location": "path",
  72730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72731. // "required": true,
  72732. // "type": "string"
  72733. // },
  72734. // "project": {
  72735. // "description": "Project ID for this request.",
  72736. // "location": "path",
  72737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72738. // "required": true,
  72739. // "type": "string"
  72740. // },
  72741. // "requestId": {
  72742. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72743. // "location": "query",
  72744. // "type": "string"
  72745. // },
  72746. // "zone": {
  72747. // "description": "The name of the zone for this request.",
  72748. // "location": "path",
  72749. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72750. // "required": true,
  72751. // "type": "string"
  72752. // }
  72753. // },
  72754. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  72755. // "response": {
  72756. // "$ref": "Operation"
  72757. // },
  72758. // "scopes": [
  72759. // "https://www.googleapis.com/auth/cloud-platform",
  72760. // "https://www.googleapis.com/auth/compute"
  72761. // ]
  72762. // }
  72763. }
  72764. // method id "compute.instances.resume":
  72765. type InstancesResumeCall struct {
  72766. s *Service
  72767. project string
  72768. zone string
  72769. instance string
  72770. instancesresumerequest *InstancesResumeRequest
  72771. urlParams_ gensupport.URLParams
  72772. ctx_ context.Context
  72773. header_ http.Header
  72774. }
  72775. // Resume: Resumes an instance that was suspended using the
  72776. // instances().suspend method.
  72777. func (r *InstancesService) Resume(project string, zone string, instance string, instancesresumerequest *InstancesResumeRequest) *InstancesResumeCall {
  72778. c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72779. c.project = project
  72780. c.zone = zone
  72781. c.instance = instance
  72782. c.instancesresumerequest = instancesresumerequest
  72783. return c
  72784. }
  72785. // RequestId sets the optional parameter "requestId": An optional
  72786. // request ID to identify requests. Specify a unique request ID so that
  72787. // if you must retry your request, the server will know to ignore the
  72788. // request if it has already been completed.
  72789. //
  72790. // For example, consider a situation where you make an initial request
  72791. // and the request times out. If you make the request again with the
  72792. // same request ID, the server can check if original operation with the
  72793. // same request ID was received, and if so, will ignore the second
  72794. // request. This prevents clients from accidentally creating duplicate
  72795. // commitments.
  72796. //
  72797. // The request ID must be a valid UUID with the exception that zero UUID
  72798. // is not supported (00000000-0000-0000-0000-000000000000).
  72799. func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall {
  72800. c.urlParams_.Set("requestId", requestId)
  72801. return c
  72802. }
  72803. // Fields allows partial responses to be retrieved. See
  72804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72805. // for more information.
  72806. func (c *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall {
  72807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72808. return c
  72809. }
  72810. // Context sets the context to be used in this call's Do method. Any
  72811. // pending HTTP request will be aborted if the provided context is
  72812. // canceled.
  72813. func (c *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall {
  72814. c.ctx_ = ctx
  72815. return c
  72816. }
  72817. // Header returns an http.Header that can be modified by the caller to
  72818. // add HTTP headers to the request.
  72819. func (c *InstancesResumeCall) Header() http.Header {
  72820. if c.header_ == nil {
  72821. c.header_ = make(http.Header)
  72822. }
  72823. return c.header_
  72824. }
  72825. func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) {
  72826. reqHeaders := make(http.Header)
  72827. for k, v := range c.header_ {
  72828. reqHeaders[k] = v
  72829. }
  72830. reqHeaders.Set("User-Agent", c.s.userAgent())
  72831. var body io.Reader = nil
  72832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesresumerequest)
  72833. if err != nil {
  72834. return nil, err
  72835. }
  72836. reqHeaders.Set("Content-Type", "application/json")
  72837. c.urlParams_.Set("alt", alt)
  72838. c.urlParams_.Set("prettyPrint", "false")
  72839. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/resume")
  72840. urls += "?" + c.urlParams_.Encode()
  72841. req, err := http.NewRequest("POST", urls, body)
  72842. if err != nil {
  72843. return nil, err
  72844. }
  72845. req.Header = reqHeaders
  72846. googleapi.Expand(req.URL, map[string]string{
  72847. "project": c.project,
  72848. "zone": c.zone,
  72849. "instance": c.instance,
  72850. })
  72851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72852. }
  72853. // Do executes the "compute.instances.resume" call.
  72854. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72855. // status code is an error. Response headers are in either
  72856. // *Operation.ServerResponse.Header or (if a response was returned at
  72857. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72858. // to check whether the returned error was because
  72859. // http.StatusNotModified was returned.
  72860. func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72861. gensupport.SetOptions(c.urlParams_, opts...)
  72862. res, err := c.doRequest("json")
  72863. if res != nil && res.StatusCode == http.StatusNotModified {
  72864. if res.Body != nil {
  72865. res.Body.Close()
  72866. }
  72867. return nil, &googleapi.Error{
  72868. Code: res.StatusCode,
  72869. Header: res.Header,
  72870. }
  72871. }
  72872. if err != nil {
  72873. return nil, err
  72874. }
  72875. defer googleapi.CloseBody(res)
  72876. if err := googleapi.CheckResponse(res); err != nil {
  72877. return nil, err
  72878. }
  72879. ret := &Operation{
  72880. ServerResponse: googleapi.ServerResponse{
  72881. Header: res.Header,
  72882. HTTPStatusCode: res.StatusCode,
  72883. },
  72884. }
  72885. target := &ret
  72886. if err := gensupport.DecodeResponse(target, res); err != nil {
  72887. return nil, err
  72888. }
  72889. return ret, nil
  72890. // {
  72891. // "description": "Resumes an instance that was suspended using the instances().suspend method.",
  72892. // "httpMethod": "POST",
  72893. // "id": "compute.instances.resume",
  72894. // "parameterOrder": [
  72895. // "project",
  72896. // "zone",
  72897. // "instance"
  72898. // ],
  72899. // "parameters": {
  72900. // "instance": {
  72901. // "description": "Name of the instance resource to resume.",
  72902. // "location": "path",
  72903. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72904. // "required": true,
  72905. // "type": "string"
  72906. // },
  72907. // "project": {
  72908. // "description": "Project ID for this request.",
  72909. // "location": "path",
  72910. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72911. // "required": true,
  72912. // "type": "string"
  72913. // },
  72914. // "requestId": {
  72915. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72916. // "location": "query",
  72917. // "type": "string"
  72918. // },
  72919. // "zone": {
  72920. // "description": "The name of the zone for this request.",
  72921. // "location": "path",
  72922. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72923. // "required": true,
  72924. // "type": "string"
  72925. // }
  72926. // },
  72927. // "path": "{project}/zones/{zone}/instances/{instance}/resume",
  72928. // "request": {
  72929. // "$ref": "InstancesResumeRequest"
  72930. // },
  72931. // "response": {
  72932. // "$ref": "Operation"
  72933. // },
  72934. // "scopes": [
  72935. // "https://www.googleapis.com/auth/cloud-platform",
  72936. // "https://www.googleapis.com/auth/compute"
  72937. // ]
  72938. // }
  72939. }
  72940. // method id "compute.instances.setDeletionProtection":
  72941. type InstancesSetDeletionProtectionCall struct {
  72942. s *Service
  72943. project string
  72944. zone string
  72945. resource string
  72946. urlParams_ gensupport.URLParams
  72947. ctx_ context.Context
  72948. header_ http.Header
  72949. }
  72950. // SetDeletionProtection: Sets deletion protection on the instance.
  72951. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  72952. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72953. c.project = project
  72954. c.zone = zone
  72955. c.resource = resource
  72956. return c
  72957. }
  72958. // DeletionProtection sets the optional parameter "deletionProtection":
  72959. // Whether the resource should be protected against deletion.
  72960. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  72961. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  72962. return c
  72963. }
  72964. // RequestId sets the optional parameter "requestId": An optional
  72965. // request ID to identify requests. Specify a unique request ID so that
  72966. // if you must retry your request, the server will know to ignore the
  72967. // request if it has already been completed.
  72968. //
  72969. // For example, consider a situation where you make an initial request
  72970. // and the request times out. If you make the request again with the
  72971. // same request ID, the server can check if original operation with the
  72972. // same request ID was received, and if so, will ignore the second
  72973. // request. This prevents clients from accidentally creating duplicate
  72974. // commitments.
  72975. //
  72976. // The request ID must be a valid UUID with the exception that zero UUID
  72977. // is not supported (00000000-0000-0000-0000-000000000000).
  72978. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  72979. c.urlParams_.Set("requestId", requestId)
  72980. return c
  72981. }
  72982. // Fields allows partial responses to be retrieved. See
  72983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72984. // for more information.
  72985. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  72986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72987. return c
  72988. }
  72989. // Context sets the context to be used in this call's Do method. Any
  72990. // pending HTTP request will be aborted if the provided context is
  72991. // canceled.
  72992. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  72993. c.ctx_ = ctx
  72994. return c
  72995. }
  72996. // Header returns an http.Header that can be modified by the caller to
  72997. // add HTTP headers to the request.
  72998. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  72999. if c.header_ == nil {
  73000. c.header_ = make(http.Header)
  73001. }
  73002. return c.header_
  73003. }
  73004. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  73005. reqHeaders := make(http.Header)
  73006. for k, v := range c.header_ {
  73007. reqHeaders[k] = v
  73008. }
  73009. reqHeaders.Set("User-Agent", c.s.userAgent())
  73010. var body io.Reader = nil
  73011. c.urlParams_.Set("alt", alt)
  73012. c.urlParams_.Set("prettyPrint", "false")
  73013. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  73014. urls += "?" + c.urlParams_.Encode()
  73015. req, err := http.NewRequest("POST", urls, body)
  73016. if err != nil {
  73017. return nil, err
  73018. }
  73019. req.Header = reqHeaders
  73020. googleapi.Expand(req.URL, map[string]string{
  73021. "project": c.project,
  73022. "zone": c.zone,
  73023. "resource": c.resource,
  73024. })
  73025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73026. }
  73027. // Do executes the "compute.instances.setDeletionProtection" call.
  73028. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73029. // status code is an error. Response headers are in either
  73030. // *Operation.ServerResponse.Header or (if a response was returned at
  73031. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73032. // to check whether the returned error was because
  73033. // http.StatusNotModified was returned.
  73034. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73035. gensupport.SetOptions(c.urlParams_, opts...)
  73036. res, err := c.doRequest("json")
  73037. if res != nil && res.StatusCode == http.StatusNotModified {
  73038. if res.Body != nil {
  73039. res.Body.Close()
  73040. }
  73041. return nil, &googleapi.Error{
  73042. Code: res.StatusCode,
  73043. Header: res.Header,
  73044. }
  73045. }
  73046. if err != nil {
  73047. return nil, err
  73048. }
  73049. defer googleapi.CloseBody(res)
  73050. if err := googleapi.CheckResponse(res); err != nil {
  73051. return nil, err
  73052. }
  73053. ret := &Operation{
  73054. ServerResponse: googleapi.ServerResponse{
  73055. Header: res.Header,
  73056. HTTPStatusCode: res.StatusCode,
  73057. },
  73058. }
  73059. target := &ret
  73060. if err := gensupport.DecodeResponse(target, res); err != nil {
  73061. return nil, err
  73062. }
  73063. return ret, nil
  73064. // {
  73065. // "description": "Sets deletion protection on the instance.",
  73066. // "httpMethod": "POST",
  73067. // "id": "compute.instances.setDeletionProtection",
  73068. // "parameterOrder": [
  73069. // "project",
  73070. // "zone",
  73071. // "resource"
  73072. // ],
  73073. // "parameters": {
  73074. // "deletionProtection": {
  73075. // "default": "true",
  73076. // "description": "Whether the resource should be protected against deletion.",
  73077. // "location": "query",
  73078. // "type": "boolean"
  73079. // },
  73080. // "project": {
  73081. // "description": "Project ID for this request.",
  73082. // "location": "path",
  73083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73084. // "required": true,
  73085. // "type": "string"
  73086. // },
  73087. // "requestId": {
  73088. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73089. // "location": "query",
  73090. // "type": "string"
  73091. // },
  73092. // "resource": {
  73093. // "description": "Name or id of the resource for this request.",
  73094. // "location": "path",
  73095. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73096. // "required": true,
  73097. // "type": "string"
  73098. // },
  73099. // "zone": {
  73100. // "description": "The name of the zone for this request.",
  73101. // "location": "path",
  73102. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73103. // "required": true,
  73104. // "type": "string"
  73105. // }
  73106. // },
  73107. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  73108. // "response": {
  73109. // "$ref": "Operation"
  73110. // },
  73111. // "scopes": [
  73112. // "https://www.googleapis.com/auth/cloud-platform",
  73113. // "https://www.googleapis.com/auth/compute"
  73114. // ]
  73115. // }
  73116. }
  73117. // method id "compute.instances.setDiskAutoDelete":
  73118. type InstancesSetDiskAutoDeleteCall struct {
  73119. s *Service
  73120. project string
  73121. zone string
  73122. instance string
  73123. urlParams_ gensupport.URLParams
  73124. ctx_ context.Context
  73125. header_ http.Header
  73126. }
  73127. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  73128. // an instance.
  73129. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  73130. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  73131. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73132. c.project = project
  73133. c.zone = zone
  73134. c.instance = instance
  73135. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  73136. c.urlParams_.Set("deviceName", deviceName)
  73137. return c
  73138. }
  73139. // RequestId sets the optional parameter "requestId": An optional
  73140. // request ID to identify requests. Specify a unique request ID so that
  73141. // if you must retry your request, the server will know to ignore the
  73142. // request if it has already been completed.
  73143. //
  73144. // For example, consider a situation where you make an initial request
  73145. // and the request times out. If you make the request again with the
  73146. // same request ID, the server can check if original operation with the
  73147. // same request ID was received, and if so, will ignore the second
  73148. // request. This prevents clients from accidentally creating duplicate
  73149. // commitments.
  73150. //
  73151. // The request ID must be a valid UUID with the exception that zero UUID
  73152. // is not supported (00000000-0000-0000-0000-000000000000).
  73153. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  73154. c.urlParams_.Set("requestId", requestId)
  73155. return c
  73156. }
  73157. // Fields allows partial responses to be retrieved. See
  73158. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73159. // for more information.
  73160. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  73161. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73162. return c
  73163. }
  73164. // Context sets the context to be used in this call's Do method. Any
  73165. // pending HTTP request will be aborted if the provided context is
  73166. // canceled.
  73167. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  73168. c.ctx_ = ctx
  73169. return c
  73170. }
  73171. // Header returns an http.Header that can be modified by the caller to
  73172. // add HTTP headers to the request.
  73173. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  73174. if c.header_ == nil {
  73175. c.header_ = make(http.Header)
  73176. }
  73177. return c.header_
  73178. }
  73179. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  73180. reqHeaders := make(http.Header)
  73181. for k, v := range c.header_ {
  73182. reqHeaders[k] = v
  73183. }
  73184. reqHeaders.Set("User-Agent", c.s.userAgent())
  73185. var body io.Reader = nil
  73186. c.urlParams_.Set("alt", alt)
  73187. c.urlParams_.Set("prettyPrint", "false")
  73188. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  73189. urls += "?" + c.urlParams_.Encode()
  73190. req, err := http.NewRequest("POST", urls, body)
  73191. if err != nil {
  73192. return nil, err
  73193. }
  73194. req.Header = reqHeaders
  73195. googleapi.Expand(req.URL, map[string]string{
  73196. "project": c.project,
  73197. "zone": c.zone,
  73198. "instance": c.instance,
  73199. })
  73200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73201. }
  73202. // Do executes the "compute.instances.setDiskAutoDelete" call.
  73203. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73204. // status code is an error. Response headers are in either
  73205. // *Operation.ServerResponse.Header or (if a response was returned at
  73206. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73207. // to check whether the returned error was because
  73208. // http.StatusNotModified was returned.
  73209. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73210. gensupport.SetOptions(c.urlParams_, opts...)
  73211. res, err := c.doRequest("json")
  73212. if res != nil && res.StatusCode == http.StatusNotModified {
  73213. if res.Body != nil {
  73214. res.Body.Close()
  73215. }
  73216. return nil, &googleapi.Error{
  73217. Code: res.StatusCode,
  73218. Header: res.Header,
  73219. }
  73220. }
  73221. if err != nil {
  73222. return nil, err
  73223. }
  73224. defer googleapi.CloseBody(res)
  73225. if err := googleapi.CheckResponse(res); err != nil {
  73226. return nil, err
  73227. }
  73228. ret := &Operation{
  73229. ServerResponse: googleapi.ServerResponse{
  73230. Header: res.Header,
  73231. HTTPStatusCode: res.StatusCode,
  73232. },
  73233. }
  73234. target := &ret
  73235. if err := gensupport.DecodeResponse(target, res); err != nil {
  73236. return nil, err
  73237. }
  73238. return ret, nil
  73239. // {
  73240. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  73241. // "httpMethod": "POST",
  73242. // "id": "compute.instances.setDiskAutoDelete",
  73243. // "parameterOrder": [
  73244. // "project",
  73245. // "zone",
  73246. // "instance",
  73247. // "autoDelete",
  73248. // "deviceName"
  73249. // ],
  73250. // "parameters": {
  73251. // "autoDelete": {
  73252. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  73253. // "location": "query",
  73254. // "required": true,
  73255. // "type": "boolean"
  73256. // },
  73257. // "deviceName": {
  73258. // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
  73259. // "location": "query",
  73260. // "pattern": "\\w[\\w.-]{0,254}",
  73261. // "required": true,
  73262. // "type": "string"
  73263. // },
  73264. // "instance": {
  73265. // "description": "The instance name for this request.",
  73266. // "location": "path",
  73267. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73268. // "required": true,
  73269. // "type": "string"
  73270. // },
  73271. // "project": {
  73272. // "description": "Project ID for this request.",
  73273. // "location": "path",
  73274. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73275. // "required": true,
  73276. // "type": "string"
  73277. // },
  73278. // "requestId": {
  73279. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73280. // "location": "query",
  73281. // "type": "string"
  73282. // },
  73283. // "zone": {
  73284. // "description": "The name of the zone for this request.",
  73285. // "location": "path",
  73286. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73287. // "required": true,
  73288. // "type": "string"
  73289. // }
  73290. // },
  73291. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  73292. // "response": {
  73293. // "$ref": "Operation"
  73294. // },
  73295. // "scopes": [
  73296. // "https://www.googleapis.com/auth/cloud-platform",
  73297. // "https://www.googleapis.com/auth/compute"
  73298. // ]
  73299. // }
  73300. }
  73301. // method id "compute.instances.setIamPolicy":
  73302. type InstancesSetIamPolicyCall struct {
  73303. s *Service
  73304. project string
  73305. zone string
  73306. resource string
  73307. zonesetpolicyrequest *ZoneSetPolicyRequest
  73308. urlParams_ gensupport.URLParams
  73309. ctx_ context.Context
  73310. header_ http.Header
  73311. }
  73312. // SetIamPolicy: Sets the access control policy on the specified
  73313. // resource. Replaces any existing policy.
  73314. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  73315. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73316. c.project = project
  73317. c.zone = zone
  73318. c.resource = resource
  73319. c.zonesetpolicyrequest = zonesetpolicyrequest
  73320. return c
  73321. }
  73322. // Fields allows partial responses to be retrieved. See
  73323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73324. // for more information.
  73325. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  73326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73327. return c
  73328. }
  73329. // Context sets the context to be used in this call's Do method. Any
  73330. // pending HTTP request will be aborted if the provided context is
  73331. // canceled.
  73332. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  73333. c.ctx_ = ctx
  73334. return c
  73335. }
  73336. // Header returns an http.Header that can be modified by the caller to
  73337. // add HTTP headers to the request.
  73338. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  73339. if c.header_ == nil {
  73340. c.header_ = make(http.Header)
  73341. }
  73342. return c.header_
  73343. }
  73344. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  73345. reqHeaders := make(http.Header)
  73346. for k, v := range c.header_ {
  73347. reqHeaders[k] = v
  73348. }
  73349. reqHeaders.Set("User-Agent", c.s.userAgent())
  73350. var body io.Reader = nil
  73351. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  73352. if err != nil {
  73353. return nil, err
  73354. }
  73355. reqHeaders.Set("Content-Type", "application/json")
  73356. c.urlParams_.Set("alt", alt)
  73357. c.urlParams_.Set("prettyPrint", "false")
  73358. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  73359. urls += "?" + c.urlParams_.Encode()
  73360. req, err := http.NewRequest("POST", urls, body)
  73361. if err != nil {
  73362. return nil, err
  73363. }
  73364. req.Header = reqHeaders
  73365. googleapi.Expand(req.URL, map[string]string{
  73366. "project": c.project,
  73367. "zone": c.zone,
  73368. "resource": c.resource,
  73369. })
  73370. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73371. }
  73372. // Do executes the "compute.instances.setIamPolicy" call.
  73373. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  73374. // code is an error. Response headers are in either
  73375. // *Policy.ServerResponse.Header or (if a response was returned at all)
  73376. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  73377. // check whether the returned error was because http.StatusNotModified
  73378. // was returned.
  73379. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  73380. gensupport.SetOptions(c.urlParams_, opts...)
  73381. res, err := c.doRequest("json")
  73382. if res != nil && res.StatusCode == http.StatusNotModified {
  73383. if res.Body != nil {
  73384. res.Body.Close()
  73385. }
  73386. return nil, &googleapi.Error{
  73387. Code: res.StatusCode,
  73388. Header: res.Header,
  73389. }
  73390. }
  73391. if err != nil {
  73392. return nil, err
  73393. }
  73394. defer googleapi.CloseBody(res)
  73395. if err := googleapi.CheckResponse(res); err != nil {
  73396. return nil, err
  73397. }
  73398. ret := &Policy{
  73399. ServerResponse: googleapi.ServerResponse{
  73400. Header: res.Header,
  73401. HTTPStatusCode: res.StatusCode,
  73402. },
  73403. }
  73404. target := &ret
  73405. if err := gensupport.DecodeResponse(target, res); err != nil {
  73406. return nil, err
  73407. }
  73408. return ret, nil
  73409. // {
  73410. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  73411. // "httpMethod": "POST",
  73412. // "id": "compute.instances.setIamPolicy",
  73413. // "parameterOrder": [
  73414. // "project",
  73415. // "zone",
  73416. // "resource"
  73417. // ],
  73418. // "parameters": {
  73419. // "project": {
  73420. // "description": "Project ID for this request.",
  73421. // "location": "path",
  73422. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73423. // "required": true,
  73424. // "type": "string"
  73425. // },
  73426. // "resource": {
  73427. // "description": "Name or id of the resource for this request.",
  73428. // "location": "path",
  73429. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73430. // "required": true,
  73431. // "type": "string"
  73432. // },
  73433. // "zone": {
  73434. // "description": "The name of the zone for this request.",
  73435. // "location": "path",
  73436. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73437. // "required": true,
  73438. // "type": "string"
  73439. // }
  73440. // },
  73441. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  73442. // "request": {
  73443. // "$ref": "ZoneSetPolicyRequest"
  73444. // },
  73445. // "response": {
  73446. // "$ref": "Policy"
  73447. // },
  73448. // "scopes": [
  73449. // "https://www.googleapis.com/auth/cloud-platform",
  73450. // "https://www.googleapis.com/auth/compute"
  73451. // ]
  73452. // }
  73453. }
  73454. // method id "compute.instances.setLabels":
  73455. type InstancesSetLabelsCall struct {
  73456. s *Service
  73457. project string
  73458. zone string
  73459. instance string
  73460. instancessetlabelsrequest *InstancesSetLabelsRequest
  73461. urlParams_ gensupport.URLParams
  73462. ctx_ context.Context
  73463. header_ http.Header
  73464. }
  73465. // SetLabels: Sets labels on an instance. To learn more about labels,
  73466. // read the Labeling Resources documentation.
  73467. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  73468. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73469. c.project = project
  73470. c.zone = zone
  73471. c.instance = instance
  73472. c.instancessetlabelsrequest = instancessetlabelsrequest
  73473. return c
  73474. }
  73475. // RequestId sets the optional parameter "requestId": An optional
  73476. // request ID to identify requests. Specify a unique request ID so that
  73477. // if you must retry your request, the server will know to ignore the
  73478. // request if it has already been completed.
  73479. //
  73480. // For example, consider a situation where you make an initial request
  73481. // and the request times out. If you make the request again with the
  73482. // same request ID, the server can check if original operation with the
  73483. // same request ID was received, and if so, will ignore the second
  73484. // request. This prevents clients from accidentally creating duplicate
  73485. // commitments.
  73486. //
  73487. // The request ID must be a valid UUID with the exception that zero UUID
  73488. // is not supported (00000000-0000-0000-0000-000000000000).
  73489. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  73490. c.urlParams_.Set("requestId", requestId)
  73491. return c
  73492. }
  73493. // Fields allows partial responses to be retrieved. See
  73494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73495. // for more information.
  73496. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  73497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73498. return c
  73499. }
  73500. // Context sets the context to be used in this call's Do method. Any
  73501. // pending HTTP request will be aborted if the provided context is
  73502. // canceled.
  73503. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  73504. c.ctx_ = ctx
  73505. return c
  73506. }
  73507. // Header returns an http.Header that can be modified by the caller to
  73508. // add HTTP headers to the request.
  73509. func (c *InstancesSetLabelsCall) Header() http.Header {
  73510. if c.header_ == nil {
  73511. c.header_ = make(http.Header)
  73512. }
  73513. return c.header_
  73514. }
  73515. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  73516. reqHeaders := make(http.Header)
  73517. for k, v := range c.header_ {
  73518. reqHeaders[k] = v
  73519. }
  73520. reqHeaders.Set("User-Agent", c.s.userAgent())
  73521. var body io.Reader = nil
  73522. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  73523. if err != nil {
  73524. return nil, err
  73525. }
  73526. reqHeaders.Set("Content-Type", "application/json")
  73527. c.urlParams_.Set("alt", alt)
  73528. c.urlParams_.Set("prettyPrint", "false")
  73529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  73530. urls += "?" + c.urlParams_.Encode()
  73531. req, err := http.NewRequest("POST", urls, body)
  73532. if err != nil {
  73533. return nil, err
  73534. }
  73535. req.Header = reqHeaders
  73536. googleapi.Expand(req.URL, map[string]string{
  73537. "project": c.project,
  73538. "zone": c.zone,
  73539. "instance": c.instance,
  73540. })
  73541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73542. }
  73543. // Do executes the "compute.instances.setLabels" call.
  73544. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73545. // status code is an error. Response headers are in either
  73546. // *Operation.ServerResponse.Header or (if a response was returned at
  73547. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73548. // to check whether the returned error was because
  73549. // http.StatusNotModified was returned.
  73550. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73551. gensupport.SetOptions(c.urlParams_, opts...)
  73552. res, err := c.doRequest("json")
  73553. if res != nil && res.StatusCode == http.StatusNotModified {
  73554. if res.Body != nil {
  73555. res.Body.Close()
  73556. }
  73557. return nil, &googleapi.Error{
  73558. Code: res.StatusCode,
  73559. Header: res.Header,
  73560. }
  73561. }
  73562. if err != nil {
  73563. return nil, err
  73564. }
  73565. defer googleapi.CloseBody(res)
  73566. if err := googleapi.CheckResponse(res); err != nil {
  73567. return nil, err
  73568. }
  73569. ret := &Operation{
  73570. ServerResponse: googleapi.ServerResponse{
  73571. Header: res.Header,
  73572. HTTPStatusCode: res.StatusCode,
  73573. },
  73574. }
  73575. target := &ret
  73576. if err := gensupport.DecodeResponse(target, res); err != nil {
  73577. return nil, err
  73578. }
  73579. return ret, nil
  73580. // {
  73581. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  73582. // "httpMethod": "POST",
  73583. // "id": "compute.instances.setLabels",
  73584. // "parameterOrder": [
  73585. // "project",
  73586. // "zone",
  73587. // "instance"
  73588. // ],
  73589. // "parameters": {
  73590. // "instance": {
  73591. // "description": "Name of the instance scoping this request.",
  73592. // "location": "path",
  73593. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73594. // "required": true,
  73595. // "type": "string"
  73596. // },
  73597. // "project": {
  73598. // "description": "Project ID for this request.",
  73599. // "location": "path",
  73600. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73601. // "required": true,
  73602. // "type": "string"
  73603. // },
  73604. // "requestId": {
  73605. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73606. // "location": "query",
  73607. // "type": "string"
  73608. // },
  73609. // "zone": {
  73610. // "description": "The name of the zone for this request.",
  73611. // "location": "path",
  73612. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73613. // "required": true,
  73614. // "type": "string"
  73615. // }
  73616. // },
  73617. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  73618. // "request": {
  73619. // "$ref": "InstancesSetLabelsRequest"
  73620. // },
  73621. // "response": {
  73622. // "$ref": "Operation"
  73623. // },
  73624. // "scopes": [
  73625. // "https://www.googleapis.com/auth/cloud-platform",
  73626. // "https://www.googleapis.com/auth/compute"
  73627. // ]
  73628. // }
  73629. }
  73630. // method id "compute.instances.setMachineResources":
  73631. type InstancesSetMachineResourcesCall struct {
  73632. s *Service
  73633. project string
  73634. zone string
  73635. instance string
  73636. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  73637. urlParams_ gensupport.URLParams
  73638. ctx_ context.Context
  73639. header_ http.Header
  73640. }
  73641. // SetMachineResources: Changes the number and/or type of accelerator
  73642. // for a stopped instance to the values specified in the request.
  73643. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  73644. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73645. c.project = project
  73646. c.zone = zone
  73647. c.instance = instance
  73648. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  73649. return c
  73650. }
  73651. // RequestId sets the optional parameter "requestId": An optional
  73652. // request ID to identify requests. Specify a unique request ID so that
  73653. // if you must retry your request, the server will know to ignore the
  73654. // request if it has already been completed.
  73655. //
  73656. // For example, consider a situation where you make an initial request
  73657. // and the request times out. If you make the request again with the
  73658. // same request ID, the server can check if original operation with the
  73659. // same request ID was received, and if so, will ignore the second
  73660. // request. This prevents clients from accidentally creating duplicate
  73661. // commitments.
  73662. //
  73663. // The request ID must be a valid UUID with the exception that zero UUID
  73664. // is not supported (00000000-0000-0000-0000-000000000000).
  73665. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  73666. c.urlParams_.Set("requestId", requestId)
  73667. return c
  73668. }
  73669. // Fields allows partial responses to be retrieved. See
  73670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73671. // for more information.
  73672. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  73673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73674. return c
  73675. }
  73676. // Context sets the context to be used in this call's Do method. Any
  73677. // pending HTTP request will be aborted if the provided context is
  73678. // canceled.
  73679. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  73680. c.ctx_ = ctx
  73681. return c
  73682. }
  73683. // Header returns an http.Header that can be modified by the caller to
  73684. // add HTTP headers to the request.
  73685. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  73686. if c.header_ == nil {
  73687. c.header_ = make(http.Header)
  73688. }
  73689. return c.header_
  73690. }
  73691. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  73692. reqHeaders := make(http.Header)
  73693. for k, v := range c.header_ {
  73694. reqHeaders[k] = v
  73695. }
  73696. reqHeaders.Set("User-Agent", c.s.userAgent())
  73697. var body io.Reader = nil
  73698. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  73699. if err != nil {
  73700. return nil, err
  73701. }
  73702. reqHeaders.Set("Content-Type", "application/json")
  73703. c.urlParams_.Set("alt", alt)
  73704. c.urlParams_.Set("prettyPrint", "false")
  73705. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  73706. urls += "?" + c.urlParams_.Encode()
  73707. req, err := http.NewRequest("POST", urls, body)
  73708. if err != nil {
  73709. return nil, err
  73710. }
  73711. req.Header = reqHeaders
  73712. googleapi.Expand(req.URL, map[string]string{
  73713. "project": c.project,
  73714. "zone": c.zone,
  73715. "instance": c.instance,
  73716. })
  73717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73718. }
  73719. // Do executes the "compute.instances.setMachineResources" call.
  73720. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73721. // status code is an error. Response headers are in either
  73722. // *Operation.ServerResponse.Header or (if a response was returned at
  73723. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73724. // to check whether the returned error was because
  73725. // http.StatusNotModified was returned.
  73726. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73727. gensupport.SetOptions(c.urlParams_, opts...)
  73728. res, err := c.doRequest("json")
  73729. if res != nil && res.StatusCode == http.StatusNotModified {
  73730. if res.Body != nil {
  73731. res.Body.Close()
  73732. }
  73733. return nil, &googleapi.Error{
  73734. Code: res.StatusCode,
  73735. Header: res.Header,
  73736. }
  73737. }
  73738. if err != nil {
  73739. return nil, err
  73740. }
  73741. defer googleapi.CloseBody(res)
  73742. if err := googleapi.CheckResponse(res); err != nil {
  73743. return nil, err
  73744. }
  73745. ret := &Operation{
  73746. ServerResponse: googleapi.ServerResponse{
  73747. Header: res.Header,
  73748. HTTPStatusCode: res.StatusCode,
  73749. },
  73750. }
  73751. target := &ret
  73752. if err := gensupport.DecodeResponse(target, res); err != nil {
  73753. return nil, err
  73754. }
  73755. return ret, nil
  73756. // {
  73757. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  73758. // "httpMethod": "POST",
  73759. // "id": "compute.instances.setMachineResources",
  73760. // "parameterOrder": [
  73761. // "project",
  73762. // "zone",
  73763. // "instance"
  73764. // ],
  73765. // "parameters": {
  73766. // "instance": {
  73767. // "description": "Name of the instance scoping this request.",
  73768. // "location": "path",
  73769. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73770. // "required": true,
  73771. // "type": "string"
  73772. // },
  73773. // "project": {
  73774. // "description": "Project ID for this request.",
  73775. // "location": "path",
  73776. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73777. // "required": true,
  73778. // "type": "string"
  73779. // },
  73780. // "requestId": {
  73781. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73782. // "location": "query",
  73783. // "type": "string"
  73784. // },
  73785. // "zone": {
  73786. // "description": "The name of the zone for this request.",
  73787. // "location": "path",
  73788. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73789. // "required": true,
  73790. // "type": "string"
  73791. // }
  73792. // },
  73793. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  73794. // "request": {
  73795. // "$ref": "InstancesSetMachineResourcesRequest"
  73796. // },
  73797. // "response": {
  73798. // "$ref": "Operation"
  73799. // },
  73800. // "scopes": [
  73801. // "https://www.googleapis.com/auth/cloud-platform",
  73802. // "https://www.googleapis.com/auth/compute"
  73803. // ]
  73804. // }
  73805. }
  73806. // method id "compute.instances.setMachineType":
  73807. type InstancesSetMachineTypeCall struct {
  73808. s *Service
  73809. project string
  73810. zone string
  73811. instance string
  73812. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  73813. urlParams_ gensupport.URLParams
  73814. ctx_ context.Context
  73815. header_ http.Header
  73816. }
  73817. // SetMachineType: Changes the machine type for a stopped instance to
  73818. // the machine type specified in the request.
  73819. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  73820. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73821. c.project = project
  73822. c.zone = zone
  73823. c.instance = instance
  73824. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  73825. return c
  73826. }
  73827. // RequestId sets the optional parameter "requestId": An optional
  73828. // request ID to identify requests. Specify a unique request ID so that
  73829. // if you must retry your request, the server will know to ignore the
  73830. // request if it has already been completed.
  73831. //
  73832. // For example, consider a situation where you make an initial request
  73833. // and the request times out. If you make the request again with the
  73834. // same request ID, the server can check if original operation with the
  73835. // same request ID was received, and if so, will ignore the second
  73836. // request. This prevents clients from accidentally creating duplicate
  73837. // commitments.
  73838. //
  73839. // The request ID must be a valid UUID with the exception that zero UUID
  73840. // is not supported (00000000-0000-0000-0000-000000000000).
  73841. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  73842. c.urlParams_.Set("requestId", requestId)
  73843. return c
  73844. }
  73845. // Fields allows partial responses to be retrieved. See
  73846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73847. // for more information.
  73848. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  73849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73850. return c
  73851. }
  73852. // Context sets the context to be used in this call's Do method. Any
  73853. // pending HTTP request will be aborted if the provided context is
  73854. // canceled.
  73855. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  73856. c.ctx_ = ctx
  73857. return c
  73858. }
  73859. // Header returns an http.Header that can be modified by the caller to
  73860. // add HTTP headers to the request.
  73861. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  73862. if c.header_ == nil {
  73863. c.header_ = make(http.Header)
  73864. }
  73865. return c.header_
  73866. }
  73867. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  73868. reqHeaders := make(http.Header)
  73869. for k, v := range c.header_ {
  73870. reqHeaders[k] = v
  73871. }
  73872. reqHeaders.Set("User-Agent", c.s.userAgent())
  73873. var body io.Reader = nil
  73874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  73875. if err != nil {
  73876. return nil, err
  73877. }
  73878. reqHeaders.Set("Content-Type", "application/json")
  73879. c.urlParams_.Set("alt", alt)
  73880. c.urlParams_.Set("prettyPrint", "false")
  73881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  73882. urls += "?" + c.urlParams_.Encode()
  73883. req, err := http.NewRequest("POST", urls, body)
  73884. if err != nil {
  73885. return nil, err
  73886. }
  73887. req.Header = reqHeaders
  73888. googleapi.Expand(req.URL, map[string]string{
  73889. "project": c.project,
  73890. "zone": c.zone,
  73891. "instance": c.instance,
  73892. })
  73893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73894. }
  73895. // Do executes the "compute.instances.setMachineType" call.
  73896. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73897. // status code is an error. Response headers are in either
  73898. // *Operation.ServerResponse.Header or (if a response was returned at
  73899. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73900. // to check whether the returned error was because
  73901. // http.StatusNotModified was returned.
  73902. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73903. gensupport.SetOptions(c.urlParams_, opts...)
  73904. res, err := c.doRequest("json")
  73905. if res != nil && res.StatusCode == http.StatusNotModified {
  73906. if res.Body != nil {
  73907. res.Body.Close()
  73908. }
  73909. return nil, &googleapi.Error{
  73910. Code: res.StatusCode,
  73911. Header: res.Header,
  73912. }
  73913. }
  73914. if err != nil {
  73915. return nil, err
  73916. }
  73917. defer googleapi.CloseBody(res)
  73918. if err := googleapi.CheckResponse(res); err != nil {
  73919. return nil, err
  73920. }
  73921. ret := &Operation{
  73922. ServerResponse: googleapi.ServerResponse{
  73923. Header: res.Header,
  73924. HTTPStatusCode: res.StatusCode,
  73925. },
  73926. }
  73927. target := &ret
  73928. if err := gensupport.DecodeResponse(target, res); err != nil {
  73929. return nil, err
  73930. }
  73931. return ret, nil
  73932. // {
  73933. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  73934. // "httpMethod": "POST",
  73935. // "id": "compute.instances.setMachineType",
  73936. // "parameterOrder": [
  73937. // "project",
  73938. // "zone",
  73939. // "instance"
  73940. // ],
  73941. // "parameters": {
  73942. // "instance": {
  73943. // "description": "Name of the instance scoping this request.",
  73944. // "location": "path",
  73945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73946. // "required": true,
  73947. // "type": "string"
  73948. // },
  73949. // "project": {
  73950. // "description": "Project ID for this request.",
  73951. // "location": "path",
  73952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73953. // "required": true,
  73954. // "type": "string"
  73955. // },
  73956. // "requestId": {
  73957. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73958. // "location": "query",
  73959. // "type": "string"
  73960. // },
  73961. // "zone": {
  73962. // "description": "The name of the zone for this request.",
  73963. // "location": "path",
  73964. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73965. // "required": true,
  73966. // "type": "string"
  73967. // }
  73968. // },
  73969. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  73970. // "request": {
  73971. // "$ref": "InstancesSetMachineTypeRequest"
  73972. // },
  73973. // "response": {
  73974. // "$ref": "Operation"
  73975. // },
  73976. // "scopes": [
  73977. // "https://www.googleapis.com/auth/cloud-platform",
  73978. // "https://www.googleapis.com/auth/compute"
  73979. // ]
  73980. // }
  73981. }
  73982. // method id "compute.instances.setMetadata":
  73983. type InstancesSetMetadataCall struct {
  73984. s *Service
  73985. project string
  73986. zone string
  73987. instance string
  73988. metadata *Metadata
  73989. urlParams_ gensupport.URLParams
  73990. ctx_ context.Context
  73991. header_ http.Header
  73992. }
  73993. // SetMetadata: Sets metadata for the specified instance to the data
  73994. // included in the request.
  73995. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  73996. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  73997. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73998. c.project = project
  73999. c.zone = zone
  74000. c.instance = instance
  74001. c.metadata = metadata
  74002. return c
  74003. }
  74004. // RequestId sets the optional parameter "requestId": An optional
  74005. // request ID to identify requests. Specify a unique request ID so that
  74006. // if you must retry your request, the server will know to ignore the
  74007. // request if it has already been completed.
  74008. //
  74009. // For example, consider a situation where you make an initial request
  74010. // and the request times out. If you make the request again with the
  74011. // same request ID, the server can check if original operation with the
  74012. // same request ID was received, and if so, will ignore the second
  74013. // request. This prevents clients from accidentally creating duplicate
  74014. // commitments.
  74015. //
  74016. // The request ID must be a valid UUID with the exception that zero UUID
  74017. // is not supported (00000000-0000-0000-0000-000000000000).
  74018. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  74019. c.urlParams_.Set("requestId", requestId)
  74020. return c
  74021. }
  74022. // Fields allows partial responses to be retrieved. See
  74023. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74024. // for more information.
  74025. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  74026. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74027. return c
  74028. }
  74029. // Context sets the context to be used in this call's Do method. Any
  74030. // pending HTTP request will be aborted if the provided context is
  74031. // canceled.
  74032. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  74033. c.ctx_ = ctx
  74034. return c
  74035. }
  74036. // Header returns an http.Header that can be modified by the caller to
  74037. // add HTTP headers to the request.
  74038. func (c *InstancesSetMetadataCall) Header() http.Header {
  74039. if c.header_ == nil {
  74040. c.header_ = make(http.Header)
  74041. }
  74042. return c.header_
  74043. }
  74044. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  74045. reqHeaders := make(http.Header)
  74046. for k, v := range c.header_ {
  74047. reqHeaders[k] = v
  74048. }
  74049. reqHeaders.Set("User-Agent", c.s.userAgent())
  74050. var body io.Reader = nil
  74051. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  74052. if err != nil {
  74053. return nil, err
  74054. }
  74055. reqHeaders.Set("Content-Type", "application/json")
  74056. c.urlParams_.Set("alt", alt)
  74057. c.urlParams_.Set("prettyPrint", "false")
  74058. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  74059. urls += "?" + c.urlParams_.Encode()
  74060. req, err := http.NewRequest("POST", urls, body)
  74061. if err != nil {
  74062. return nil, err
  74063. }
  74064. req.Header = reqHeaders
  74065. googleapi.Expand(req.URL, map[string]string{
  74066. "project": c.project,
  74067. "zone": c.zone,
  74068. "instance": c.instance,
  74069. })
  74070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74071. }
  74072. // Do executes the "compute.instances.setMetadata" call.
  74073. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74074. // status code is an error. Response headers are in either
  74075. // *Operation.ServerResponse.Header or (if a response was returned at
  74076. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74077. // to check whether the returned error was because
  74078. // http.StatusNotModified was returned.
  74079. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74080. gensupport.SetOptions(c.urlParams_, opts...)
  74081. res, err := c.doRequest("json")
  74082. if res != nil && res.StatusCode == http.StatusNotModified {
  74083. if res.Body != nil {
  74084. res.Body.Close()
  74085. }
  74086. return nil, &googleapi.Error{
  74087. Code: res.StatusCode,
  74088. Header: res.Header,
  74089. }
  74090. }
  74091. if err != nil {
  74092. return nil, err
  74093. }
  74094. defer googleapi.CloseBody(res)
  74095. if err := googleapi.CheckResponse(res); err != nil {
  74096. return nil, err
  74097. }
  74098. ret := &Operation{
  74099. ServerResponse: googleapi.ServerResponse{
  74100. Header: res.Header,
  74101. HTTPStatusCode: res.StatusCode,
  74102. },
  74103. }
  74104. target := &ret
  74105. if err := gensupport.DecodeResponse(target, res); err != nil {
  74106. return nil, err
  74107. }
  74108. return ret, nil
  74109. // {
  74110. // "description": "Sets metadata for the specified instance to the data included in the request.",
  74111. // "httpMethod": "POST",
  74112. // "id": "compute.instances.setMetadata",
  74113. // "parameterOrder": [
  74114. // "project",
  74115. // "zone",
  74116. // "instance"
  74117. // ],
  74118. // "parameters": {
  74119. // "instance": {
  74120. // "description": "Name of the instance scoping this request.",
  74121. // "location": "path",
  74122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74123. // "required": true,
  74124. // "type": "string"
  74125. // },
  74126. // "project": {
  74127. // "description": "Project ID for this request.",
  74128. // "location": "path",
  74129. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74130. // "required": true,
  74131. // "type": "string"
  74132. // },
  74133. // "requestId": {
  74134. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74135. // "location": "query",
  74136. // "type": "string"
  74137. // },
  74138. // "zone": {
  74139. // "description": "The name of the zone for this request.",
  74140. // "location": "path",
  74141. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74142. // "required": true,
  74143. // "type": "string"
  74144. // }
  74145. // },
  74146. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  74147. // "request": {
  74148. // "$ref": "Metadata"
  74149. // },
  74150. // "response": {
  74151. // "$ref": "Operation"
  74152. // },
  74153. // "scopes": [
  74154. // "https://www.googleapis.com/auth/cloud-platform",
  74155. // "https://www.googleapis.com/auth/compute"
  74156. // ]
  74157. // }
  74158. }
  74159. // method id "compute.instances.setMinCpuPlatform":
  74160. type InstancesSetMinCpuPlatformCall struct {
  74161. s *Service
  74162. project string
  74163. zone string
  74164. instance string
  74165. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  74166. urlParams_ gensupport.URLParams
  74167. ctx_ context.Context
  74168. header_ http.Header
  74169. }
  74170. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  74171. // instance should use. This method can only be called on a stopped
  74172. // instance. For more information, read Specifying a Minimum CPU
  74173. // Platform.
  74174. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  74175. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74176. c.project = project
  74177. c.zone = zone
  74178. c.instance = instance
  74179. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  74180. return c
  74181. }
  74182. // RequestId sets the optional parameter "requestId": An optional
  74183. // request ID to identify requests. Specify a unique request ID so that
  74184. // if you must retry your request, the server will know to ignore the
  74185. // request if it has already been completed.
  74186. //
  74187. // For example, consider a situation where you make an initial request
  74188. // and the request times out. If you make the request again with the
  74189. // same request ID, the server can check if original operation with the
  74190. // same request ID was received, and if so, will ignore the second
  74191. // request. This prevents clients from accidentally creating duplicate
  74192. // commitments.
  74193. //
  74194. // The request ID must be a valid UUID with the exception that zero UUID
  74195. // is not supported (00000000-0000-0000-0000-000000000000).
  74196. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  74197. c.urlParams_.Set("requestId", requestId)
  74198. return c
  74199. }
  74200. // Fields allows partial responses to be retrieved. See
  74201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74202. // for more information.
  74203. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  74204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74205. return c
  74206. }
  74207. // Context sets the context to be used in this call's Do method. Any
  74208. // pending HTTP request will be aborted if the provided context is
  74209. // canceled.
  74210. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  74211. c.ctx_ = ctx
  74212. return c
  74213. }
  74214. // Header returns an http.Header that can be modified by the caller to
  74215. // add HTTP headers to the request.
  74216. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  74217. if c.header_ == nil {
  74218. c.header_ = make(http.Header)
  74219. }
  74220. return c.header_
  74221. }
  74222. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  74223. reqHeaders := make(http.Header)
  74224. for k, v := range c.header_ {
  74225. reqHeaders[k] = v
  74226. }
  74227. reqHeaders.Set("User-Agent", c.s.userAgent())
  74228. var body io.Reader = nil
  74229. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  74230. if err != nil {
  74231. return nil, err
  74232. }
  74233. reqHeaders.Set("Content-Type", "application/json")
  74234. c.urlParams_.Set("alt", alt)
  74235. c.urlParams_.Set("prettyPrint", "false")
  74236. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  74237. urls += "?" + c.urlParams_.Encode()
  74238. req, err := http.NewRequest("POST", urls, body)
  74239. if err != nil {
  74240. return nil, err
  74241. }
  74242. req.Header = reqHeaders
  74243. googleapi.Expand(req.URL, map[string]string{
  74244. "project": c.project,
  74245. "zone": c.zone,
  74246. "instance": c.instance,
  74247. })
  74248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74249. }
  74250. // Do executes the "compute.instances.setMinCpuPlatform" call.
  74251. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74252. // status code is an error. Response headers are in either
  74253. // *Operation.ServerResponse.Header or (if a response was returned at
  74254. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74255. // to check whether the returned error was because
  74256. // http.StatusNotModified was returned.
  74257. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74258. gensupport.SetOptions(c.urlParams_, opts...)
  74259. res, err := c.doRequest("json")
  74260. if res != nil && res.StatusCode == http.StatusNotModified {
  74261. if res.Body != nil {
  74262. res.Body.Close()
  74263. }
  74264. return nil, &googleapi.Error{
  74265. Code: res.StatusCode,
  74266. Header: res.Header,
  74267. }
  74268. }
  74269. if err != nil {
  74270. return nil, err
  74271. }
  74272. defer googleapi.CloseBody(res)
  74273. if err := googleapi.CheckResponse(res); err != nil {
  74274. return nil, err
  74275. }
  74276. ret := &Operation{
  74277. ServerResponse: googleapi.ServerResponse{
  74278. Header: res.Header,
  74279. HTTPStatusCode: res.StatusCode,
  74280. },
  74281. }
  74282. target := &ret
  74283. if err := gensupport.DecodeResponse(target, res); err != nil {
  74284. return nil, err
  74285. }
  74286. return ret, nil
  74287. // {
  74288. // "description": "Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.",
  74289. // "httpMethod": "POST",
  74290. // "id": "compute.instances.setMinCpuPlatform",
  74291. // "parameterOrder": [
  74292. // "project",
  74293. // "zone",
  74294. // "instance"
  74295. // ],
  74296. // "parameters": {
  74297. // "instance": {
  74298. // "description": "Name of the instance scoping this request.",
  74299. // "location": "path",
  74300. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74301. // "required": true,
  74302. // "type": "string"
  74303. // },
  74304. // "project": {
  74305. // "description": "Project ID for this request.",
  74306. // "location": "path",
  74307. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74308. // "required": true,
  74309. // "type": "string"
  74310. // },
  74311. // "requestId": {
  74312. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74313. // "location": "query",
  74314. // "type": "string"
  74315. // },
  74316. // "zone": {
  74317. // "description": "The name of the zone for this request.",
  74318. // "location": "path",
  74319. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74320. // "required": true,
  74321. // "type": "string"
  74322. // }
  74323. // },
  74324. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  74325. // "request": {
  74326. // "$ref": "InstancesSetMinCpuPlatformRequest"
  74327. // },
  74328. // "response": {
  74329. // "$ref": "Operation"
  74330. // },
  74331. // "scopes": [
  74332. // "https://www.googleapis.com/auth/cloud-platform",
  74333. // "https://www.googleapis.com/auth/compute"
  74334. // ]
  74335. // }
  74336. }
  74337. // method id "compute.instances.setScheduling":
  74338. type InstancesSetSchedulingCall struct {
  74339. s *Service
  74340. project string
  74341. zone string
  74342. instance string
  74343. scheduling *Scheduling
  74344. urlParams_ gensupport.URLParams
  74345. ctx_ context.Context
  74346. header_ http.Header
  74347. }
  74348. // SetScheduling: Sets an instance's scheduling options.
  74349. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  74350. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  74351. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74352. c.project = project
  74353. c.zone = zone
  74354. c.instance = instance
  74355. c.scheduling = scheduling
  74356. return c
  74357. }
  74358. // RequestId sets the optional parameter "requestId": An optional
  74359. // request ID to identify requests. Specify a unique request ID so that
  74360. // if you must retry your request, the server will know to ignore the
  74361. // request if it has already been completed.
  74362. //
  74363. // For example, consider a situation where you make an initial request
  74364. // and the request times out. If you make the request again with the
  74365. // same request ID, the server can check if original operation with the
  74366. // same request ID was received, and if so, will ignore the second
  74367. // request. This prevents clients from accidentally creating duplicate
  74368. // commitments.
  74369. //
  74370. // The request ID must be a valid UUID with the exception that zero UUID
  74371. // is not supported (00000000-0000-0000-0000-000000000000).
  74372. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  74373. c.urlParams_.Set("requestId", requestId)
  74374. return c
  74375. }
  74376. // Fields allows partial responses to be retrieved. See
  74377. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74378. // for more information.
  74379. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  74380. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74381. return c
  74382. }
  74383. // Context sets the context to be used in this call's Do method. Any
  74384. // pending HTTP request will be aborted if the provided context is
  74385. // canceled.
  74386. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  74387. c.ctx_ = ctx
  74388. return c
  74389. }
  74390. // Header returns an http.Header that can be modified by the caller to
  74391. // add HTTP headers to the request.
  74392. func (c *InstancesSetSchedulingCall) Header() http.Header {
  74393. if c.header_ == nil {
  74394. c.header_ = make(http.Header)
  74395. }
  74396. return c.header_
  74397. }
  74398. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  74399. reqHeaders := make(http.Header)
  74400. for k, v := range c.header_ {
  74401. reqHeaders[k] = v
  74402. }
  74403. reqHeaders.Set("User-Agent", c.s.userAgent())
  74404. var body io.Reader = nil
  74405. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  74406. if err != nil {
  74407. return nil, err
  74408. }
  74409. reqHeaders.Set("Content-Type", "application/json")
  74410. c.urlParams_.Set("alt", alt)
  74411. c.urlParams_.Set("prettyPrint", "false")
  74412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  74413. urls += "?" + c.urlParams_.Encode()
  74414. req, err := http.NewRequest("POST", urls, body)
  74415. if err != nil {
  74416. return nil, err
  74417. }
  74418. req.Header = reqHeaders
  74419. googleapi.Expand(req.URL, map[string]string{
  74420. "project": c.project,
  74421. "zone": c.zone,
  74422. "instance": c.instance,
  74423. })
  74424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74425. }
  74426. // Do executes the "compute.instances.setScheduling" call.
  74427. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74428. // status code is an error. Response headers are in either
  74429. // *Operation.ServerResponse.Header or (if a response was returned at
  74430. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74431. // to check whether the returned error was because
  74432. // http.StatusNotModified was returned.
  74433. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74434. gensupport.SetOptions(c.urlParams_, opts...)
  74435. res, err := c.doRequest("json")
  74436. if res != nil && res.StatusCode == http.StatusNotModified {
  74437. if res.Body != nil {
  74438. res.Body.Close()
  74439. }
  74440. return nil, &googleapi.Error{
  74441. Code: res.StatusCode,
  74442. Header: res.Header,
  74443. }
  74444. }
  74445. if err != nil {
  74446. return nil, err
  74447. }
  74448. defer googleapi.CloseBody(res)
  74449. if err := googleapi.CheckResponse(res); err != nil {
  74450. return nil, err
  74451. }
  74452. ret := &Operation{
  74453. ServerResponse: googleapi.ServerResponse{
  74454. Header: res.Header,
  74455. HTTPStatusCode: res.StatusCode,
  74456. },
  74457. }
  74458. target := &ret
  74459. if err := gensupport.DecodeResponse(target, res); err != nil {
  74460. return nil, err
  74461. }
  74462. return ret, nil
  74463. // {
  74464. // "description": "Sets an instance's scheduling options.",
  74465. // "httpMethod": "POST",
  74466. // "id": "compute.instances.setScheduling",
  74467. // "parameterOrder": [
  74468. // "project",
  74469. // "zone",
  74470. // "instance"
  74471. // ],
  74472. // "parameters": {
  74473. // "instance": {
  74474. // "description": "Instance name for this request.",
  74475. // "location": "path",
  74476. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74477. // "required": true,
  74478. // "type": "string"
  74479. // },
  74480. // "project": {
  74481. // "description": "Project ID for this request.",
  74482. // "location": "path",
  74483. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74484. // "required": true,
  74485. // "type": "string"
  74486. // },
  74487. // "requestId": {
  74488. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74489. // "location": "query",
  74490. // "type": "string"
  74491. // },
  74492. // "zone": {
  74493. // "description": "The name of the zone for this request.",
  74494. // "location": "path",
  74495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74496. // "required": true,
  74497. // "type": "string"
  74498. // }
  74499. // },
  74500. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  74501. // "request": {
  74502. // "$ref": "Scheduling"
  74503. // },
  74504. // "response": {
  74505. // "$ref": "Operation"
  74506. // },
  74507. // "scopes": [
  74508. // "https://www.googleapis.com/auth/cloud-platform",
  74509. // "https://www.googleapis.com/auth/compute"
  74510. // ]
  74511. // }
  74512. }
  74513. // method id "compute.instances.setServiceAccount":
  74514. type InstancesSetServiceAccountCall struct {
  74515. s *Service
  74516. project string
  74517. zone string
  74518. instance string
  74519. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  74520. urlParams_ gensupport.URLParams
  74521. ctx_ context.Context
  74522. header_ http.Header
  74523. }
  74524. // SetServiceAccount: Sets the service account on the instance. For more
  74525. // information, read Changing the service account and access scopes for
  74526. // an instance.
  74527. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  74528. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74529. c.project = project
  74530. c.zone = zone
  74531. c.instance = instance
  74532. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  74533. return c
  74534. }
  74535. // RequestId sets the optional parameter "requestId": An optional
  74536. // request ID to identify requests. Specify a unique request ID so that
  74537. // if you must retry your request, the server will know to ignore the
  74538. // request if it has already been completed.
  74539. //
  74540. // For example, consider a situation where you make an initial request
  74541. // and the request times out. If you make the request again with the
  74542. // same request ID, the server can check if original operation with the
  74543. // same request ID was received, and if so, will ignore the second
  74544. // request. This prevents clients from accidentally creating duplicate
  74545. // commitments.
  74546. //
  74547. // The request ID must be a valid UUID with the exception that zero UUID
  74548. // is not supported (00000000-0000-0000-0000-000000000000).
  74549. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  74550. c.urlParams_.Set("requestId", requestId)
  74551. return c
  74552. }
  74553. // Fields allows partial responses to be retrieved. See
  74554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74555. // for more information.
  74556. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  74557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74558. return c
  74559. }
  74560. // Context sets the context to be used in this call's Do method. Any
  74561. // pending HTTP request will be aborted if the provided context is
  74562. // canceled.
  74563. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  74564. c.ctx_ = ctx
  74565. return c
  74566. }
  74567. // Header returns an http.Header that can be modified by the caller to
  74568. // add HTTP headers to the request.
  74569. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  74570. if c.header_ == nil {
  74571. c.header_ = make(http.Header)
  74572. }
  74573. return c.header_
  74574. }
  74575. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  74576. reqHeaders := make(http.Header)
  74577. for k, v := range c.header_ {
  74578. reqHeaders[k] = v
  74579. }
  74580. reqHeaders.Set("User-Agent", c.s.userAgent())
  74581. var body io.Reader = nil
  74582. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  74583. if err != nil {
  74584. return nil, err
  74585. }
  74586. reqHeaders.Set("Content-Type", "application/json")
  74587. c.urlParams_.Set("alt", alt)
  74588. c.urlParams_.Set("prettyPrint", "false")
  74589. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  74590. urls += "?" + c.urlParams_.Encode()
  74591. req, err := http.NewRequest("POST", urls, body)
  74592. if err != nil {
  74593. return nil, err
  74594. }
  74595. req.Header = reqHeaders
  74596. googleapi.Expand(req.URL, map[string]string{
  74597. "project": c.project,
  74598. "zone": c.zone,
  74599. "instance": c.instance,
  74600. })
  74601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74602. }
  74603. // Do executes the "compute.instances.setServiceAccount" call.
  74604. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74605. // status code is an error. Response headers are in either
  74606. // *Operation.ServerResponse.Header or (if a response was returned at
  74607. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74608. // to check whether the returned error was because
  74609. // http.StatusNotModified was returned.
  74610. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74611. gensupport.SetOptions(c.urlParams_, opts...)
  74612. res, err := c.doRequest("json")
  74613. if res != nil && res.StatusCode == http.StatusNotModified {
  74614. if res.Body != nil {
  74615. res.Body.Close()
  74616. }
  74617. return nil, &googleapi.Error{
  74618. Code: res.StatusCode,
  74619. Header: res.Header,
  74620. }
  74621. }
  74622. if err != nil {
  74623. return nil, err
  74624. }
  74625. defer googleapi.CloseBody(res)
  74626. if err := googleapi.CheckResponse(res); err != nil {
  74627. return nil, err
  74628. }
  74629. ret := &Operation{
  74630. ServerResponse: googleapi.ServerResponse{
  74631. Header: res.Header,
  74632. HTTPStatusCode: res.StatusCode,
  74633. },
  74634. }
  74635. target := &ret
  74636. if err := gensupport.DecodeResponse(target, res); err != nil {
  74637. return nil, err
  74638. }
  74639. return ret, nil
  74640. // {
  74641. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  74642. // "httpMethod": "POST",
  74643. // "id": "compute.instances.setServiceAccount",
  74644. // "parameterOrder": [
  74645. // "project",
  74646. // "zone",
  74647. // "instance"
  74648. // ],
  74649. // "parameters": {
  74650. // "instance": {
  74651. // "description": "Name of the instance resource to start.",
  74652. // "location": "path",
  74653. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74654. // "required": true,
  74655. // "type": "string"
  74656. // },
  74657. // "project": {
  74658. // "description": "Project ID for this request.",
  74659. // "location": "path",
  74660. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74661. // "required": true,
  74662. // "type": "string"
  74663. // },
  74664. // "requestId": {
  74665. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74666. // "location": "query",
  74667. // "type": "string"
  74668. // },
  74669. // "zone": {
  74670. // "description": "The name of the zone for this request.",
  74671. // "location": "path",
  74672. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74673. // "required": true,
  74674. // "type": "string"
  74675. // }
  74676. // },
  74677. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  74678. // "request": {
  74679. // "$ref": "InstancesSetServiceAccountRequest"
  74680. // },
  74681. // "response": {
  74682. // "$ref": "Operation"
  74683. // },
  74684. // "scopes": [
  74685. // "https://www.googleapis.com/auth/cloud-platform",
  74686. // "https://www.googleapis.com/auth/compute"
  74687. // ]
  74688. // }
  74689. }
  74690. // method id "compute.instances.setShieldedInstanceIntegrityPolicy":
  74691. type InstancesSetShieldedInstanceIntegrityPolicyCall struct {
  74692. s *Service
  74693. project string
  74694. zone string
  74695. instance string
  74696. shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy
  74697. urlParams_ gensupport.URLParams
  74698. ctx_ context.Context
  74699. header_ http.Header
  74700. }
  74701. // SetShieldedInstanceIntegrityPolicy: Sets the Shielded Instance
  74702. // integrity policy for an instance. You can only use this method on a
  74703. // running instance. This method supports PATCH semantics and uses the
  74704. // JSON merge patch format and processing rules.
  74705. func (r *InstancesService) SetShieldedInstanceIntegrityPolicy(project string, zone string, instance string, shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  74706. c := &InstancesSetShieldedInstanceIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74707. c.project = project
  74708. c.zone = zone
  74709. c.instance = instance
  74710. c.shieldedinstanceintegritypolicy = shieldedinstanceintegritypolicy
  74711. return c
  74712. }
  74713. // RequestId sets the optional parameter "requestId": An optional
  74714. // request ID to identify requests. Specify a unique request ID so that
  74715. // if you must retry your request, the server will know to ignore the
  74716. // request if it has already been completed.
  74717. //
  74718. // For example, consider a situation where you make an initial request
  74719. // and the request times out. If you make the request again with the
  74720. // same request ID, the server can check if original operation with the
  74721. // same request ID was received, and if so, will ignore the second
  74722. // request. This prevents clients from accidentally creating duplicate
  74723. // commitments.
  74724. //
  74725. // The request ID must be a valid UUID with the exception that zero UUID
  74726. // is not supported (00000000-0000-0000-0000-000000000000).
  74727. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  74728. c.urlParams_.Set("requestId", requestId)
  74729. return c
  74730. }
  74731. // Fields allows partial responses to be retrieved. See
  74732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74733. // for more information.
  74734. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  74735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74736. return c
  74737. }
  74738. // Context sets the context to be used in this call's Do method. Any
  74739. // pending HTTP request will be aborted if the provided context is
  74740. // canceled.
  74741. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  74742. c.ctx_ = ctx
  74743. return c
  74744. }
  74745. // Header returns an http.Header that can be modified by the caller to
  74746. // add HTTP headers to the request.
  74747. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header {
  74748. if c.header_ == nil {
  74749. c.header_ = make(http.Header)
  74750. }
  74751. return c.header_
  74752. }
  74753. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  74754. reqHeaders := make(http.Header)
  74755. for k, v := range c.header_ {
  74756. reqHeaders[k] = v
  74757. }
  74758. reqHeaders.Set("User-Agent", c.s.userAgent())
  74759. var body io.Reader = nil
  74760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy)
  74761. if err != nil {
  74762. return nil, err
  74763. }
  74764. reqHeaders.Set("Content-Type", "application/json")
  74765. c.urlParams_.Set("alt", alt)
  74766. c.urlParams_.Set("prettyPrint", "false")
  74767. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy")
  74768. urls += "?" + c.urlParams_.Encode()
  74769. req, err := http.NewRequest("PATCH", urls, body)
  74770. if err != nil {
  74771. return nil, err
  74772. }
  74773. req.Header = reqHeaders
  74774. googleapi.Expand(req.URL, map[string]string{
  74775. "project": c.project,
  74776. "zone": c.zone,
  74777. "instance": c.instance,
  74778. })
  74779. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74780. }
  74781. // Do executes the "compute.instances.setShieldedInstanceIntegrityPolicy" call.
  74782. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74783. // status code is an error. Response headers are in either
  74784. // *Operation.ServerResponse.Header or (if a response was returned at
  74785. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74786. // to check whether the returned error was because
  74787. // http.StatusNotModified was returned.
  74788. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74789. gensupport.SetOptions(c.urlParams_, opts...)
  74790. res, err := c.doRequest("json")
  74791. if res != nil && res.StatusCode == http.StatusNotModified {
  74792. if res.Body != nil {
  74793. res.Body.Close()
  74794. }
  74795. return nil, &googleapi.Error{
  74796. Code: res.StatusCode,
  74797. Header: res.Header,
  74798. }
  74799. }
  74800. if err != nil {
  74801. return nil, err
  74802. }
  74803. defer googleapi.CloseBody(res)
  74804. if err := googleapi.CheckResponse(res); err != nil {
  74805. return nil, err
  74806. }
  74807. ret := &Operation{
  74808. ServerResponse: googleapi.ServerResponse{
  74809. Header: res.Header,
  74810. HTTPStatusCode: res.StatusCode,
  74811. },
  74812. }
  74813. target := &ret
  74814. if err := gensupport.DecodeResponse(target, res); err != nil {
  74815. return nil, err
  74816. }
  74817. return ret, nil
  74818. // {
  74819. // "description": "Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  74820. // "httpMethod": "PATCH",
  74821. // "id": "compute.instances.setShieldedInstanceIntegrityPolicy",
  74822. // "parameterOrder": [
  74823. // "project",
  74824. // "zone",
  74825. // "instance"
  74826. // ],
  74827. // "parameters": {
  74828. // "instance": {
  74829. // "description": "Name or id of the instance scoping this request.",
  74830. // "location": "path",
  74831. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74832. // "required": true,
  74833. // "type": "string"
  74834. // },
  74835. // "project": {
  74836. // "description": "Project ID for this request.",
  74837. // "location": "path",
  74838. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74839. // "required": true,
  74840. // "type": "string"
  74841. // },
  74842. // "requestId": {
  74843. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74844. // "location": "query",
  74845. // "type": "string"
  74846. // },
  74847. // "zone": {
  74848. // "description": "The name of the zone for this request.",
  74849. // "location": "path",
  74850. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74851. // "required": true,
  74852. // "type": "string"
  74853. // }
  74854. // },
  74855. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy",
  74856. // "request": {
  74857. // "$ref": "ShieldedInstanceIntegrityPolicy"
  74858. // },
  74859. // "response": {
  74860. // "$ref": "Operation"
  74861. // },
  74862. // "scopes": [
  74863. // "https://www.googleapis.com/auth/cloud-platform",
  74864. // "https://www.googleapis.com/auth/compute"
  74865. // ]
  74866. // }
  74867. }
  74868. // method id "compute.instances.setShieldedVmIntegrityPolicy":
  74869. type InstancesSetShieldedVmIntegrityPolicyCall struct {
  74870. s *Service
  74871. project string
  74872. zone string
  74873. instance string
  74874. shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy
  74875. urlParams_ gensupport.URLParams
  74876. ctx_ context.Context
  74877. header_ http.Header
  74878. }
  74879. // SetShieldedVmIntegrityPolicy: Sets the Shielded VM integrity policy
  74880. // for a VM instance. You can only use this method on a running VM
  74881. // instance. This method supports PATCH semantics and uses the JSON
  74882. // merge patch format and processing rules.
  74883. func (r *InstancesService) SetShieldedVmIntegrityPolicy(project string, zone string, instance string, shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy) *InstancesSetShieldedVmIntegrityPolicyCall {
  74884. c := &InstancesSetShieldedVmIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74885. c.project = project
  74886. c.zone = zone
  74887. c.instance = instance
  74888. c.shieldedvmintegritypolicy = shieldedvmintegritypolicy
  74889. return c
  74890. }
  74891. // RequestId sets the optional parameter "requestId": An optional
  74892. // request ID to identify requests. Specify a unique request ID so that
  74893. // if you must retry your request, the server will know to ignore the
  74894. // request if it has already been completed.
  74895. //
  74896. // For example, consider a situation where you make an initial request
  74897. // and the request times out. If you make the request again with the
  74898. // same request ID, the server can check if original operation with the
  74899. // same request ID was received, and if so, will ignore the second
  74900. // request. This prevents clients from accidentally creating duplicate
  74901. // commitments.
  74902. //
  74903. // The request ID must be a valid UUID with the exception that zero UUID
  74904. // is not supported (00000000-0000-0000-0000-000000000000).
  74905. func (c *InstancesSetShieldedVmIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedVmIntegrityPolicyCall {
  74906. c.urlParams_.Set("requestId", requestId)
  74907. return c
  74908. }
  74909. // Fields allows partial responses to be retrieved. See
  74910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74911. // for more information.
  74912. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedVmIntegrityPolicyCall {
  74913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74914. return c
  74915. }
  74916. // Context sets the context to be used in this call's Do method. Any
  74917. // pending HTTP request will be aborted if the provided context is
  74918. // canceled.
  74919. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedVmIntegrityPolicyCall {
  74920. c.ctx_ = ctx
  74921. return c
  74922. }
  74923. // Header returns an http.Header that can be modified by the caller to
  74924. // add HTTP headers to the request.
  74925. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header {
  74926. if c.header_ == nil {
  74927. c.header_ = make(http.Header)
  74928. }
  74929. return c.header_
  74930. }
  74931. func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  74932. reqHeaders := make(http.Header)
  74933. for k, v := range c.header_ {
  74934. reqHeaders[k] = v
  74935. }
  74936. reqHeaders.Set("User-Agent", c.s.userAgent())
  74937. var body io.Reader = nil
  74938. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy)
  74939. if err != nil {
  74940. return nil, err
  74941. }
  74942. reqHeaders.Set("Content-Type", "application/json")
  74943. c.urlParams_.Set("alt", alt)
  74944. c.urlParams_.Set("prettyPrint", "false")
  74945. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy")
  74946. urls += "?" + c.urlParams_.Encode()
  74947. req, err := http.NewRequest("PATCH", urls, body)
  74948. if err != nil {
  74949. return nil, err
  74950. }
  74951. req.Header = reqHeaders
  74952. googleapi.Expand(req.URL, map[string]string{
  74953. "project": c.project,
  74954. "zone": c.zone,
  74955. "instance": c.instance,
  74956. })
  74957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74958. }
  74959. // Do executes the "compute.instances.setShieldedVmIntegrityPolicy" call.
  74960. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74961. // status code is an error. Response headers are in either
  74962. // *Operation.ServerResponse.Header or (if a response was returned at
  74963. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74964. // to check whether the returned error was because
  74965. // http.StatusNotModified was returned.
  74966. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74967. gensupport.SetOptions(c.urlParams_, opts...)
  74968. res, err := c.doRequest("json")
  74969. if res != nil && res.StatusCode == http.StatusNotModified {
  74970. if res.Body != nil {
  74971. res.Body.Close()
  74972. }
  74973. return nil, &googleapi.Error{
  74974. Code: res.StatusCode,
  74975. Header: res.Header,
  74976. }
  74977. }
  74978. if err != nil {
  74979. return nil, err
  74980. }
  74981. defer googleapi.CloseBody(res)
  74982. if err := googleapi.CheckResponse(res); err != nil {
  74983. return nil, err
  74984. }
  74985. ret := &Operation{
  74986. ServerResponse: googleapi.ServerResponse{
  74987. Header: res.Header,
  74988. HTTPStatusCode: res.StatusCode,
  74989. },
  74990. }
  74991. target := &ret
  74992. if err := gensupport.DecodeResponse(target, res); err != nil {
  74993. return nil, err
  74994. }
  74995. return ret, nil
  74996. // {
  74997. // "description": "Sets the Shielded VM integrity policy for a VM instance. You can only use this method on a running VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  74998. // "httpMethod": "PATCH",
  74999. // "id": "compute.instances.setShieldedVmIntegrityPolicy",
  75000. // "parameterOrder": [
  75001. // "project",
  75002. // "zone",
  75003. // "instance"
  75004. // ],
  75005. // "parameters": {
  75006. // "instance": {
  75007. // "description": "Name of the instance scoping this request.",
  75008. // "location": "path",
  75009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75010. // "required": true,
  75011. // "type": "string"
  75012. // },
  75013. // "project": {
  75014. // "description": "Project ID for this request.",
  75015. // "location": "path",
  75016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75017. // "required": true,
  75018. // "type": "string"
  75019. // },
  75020. // "requestId": {
  75021. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75022. // "location": "query",
  75023. // "type": "string"
  75024. // },
  75025. // "zone": {
  75026. // "description": "The name of the zone for this request.",
  75027. // "location": "path",
  75028. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75029. // "required": true,
  75030. // "type": "string"
  75031. // }
  75032. // },
  75033. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy",
  75034. // "request": {
  75035. // "$ref": "ShieldedVmIntegrityPolicy"
  75036. // },
  75037. // "response": {
  75038. // "$ref": "Operation"
  75039. // },
  75040. // "scopes": [
  75041. // "https://www.googleapis.com/auth/cloud-platform",
  75042. // "https://www.googleapis.com/auth/compute"
  75043. // ]
  75044. // }
  75045. }
  75046. // method id "compute.instances.setTags":
  75047. type InstancesSetTagsCall struct {
  75048. s *Service
  75049. project string
  75050. zone string
  75051. instance string
  75052. tags *Tags
  75053. urlParams_ gensupport.URLParams
  75054. ctx_ context.Context
  75055. header_ http.Header
  75056. }
  75057. // SetTags: Sets network tags for the specified instance to the data
  75058. // included in the request.
  75059. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  75060. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  75061. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75062. c.project = project
  75063. c.zone = zone
  75064. c.instance = instance
  75065. c.tags = tags
  75066. return c
  75067. }
  75068. // RequestId sets the optional parameter "requestId": An optional
  75069. // request ID to identify requests. Specify a unique request ID so that
  75070. // if you must retry your request, the server will know to ignore the
  75071. // request if it has already been completed.
  75072. //
  75073. // For example, consider a situation where you make an initial request
  75074. // and the request times out. If you make the request again with the
  75075. // same request ID, the server can check if original operation with the
  75076. // same request ID was received, and if so, will ignore the second
  75077. // request. This prevents clients from accidentally creating duplicate
  75078. // commitments.
  75079. //
  75080. // The request ID must be a valid UUID with the exception that zero UUID
  75081. // is not supported (00000000-0000-0000-0000-000000000000).
  75082. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  75083. c.urlParams_.Set("requestId", requestId)
  75084. return c
  75085. }
  75086. // Fields allows partial responses to be retrieved. See
  75087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75088. // for more information.
  75089. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  75090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75091. return c
  75092. }
  75093. // Context sets the context to be used in this call's Do method. Any
  75094. // pending HTTP request will be aborted if the provided context is
  75095. // canceled.
  75096. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  75097. c.ctx_ = ctx
  75098. return c
  75099. }
  75100. // Header returns an http.Header that can be modified by the caller to
  75101. // add HTTP headers to the request.
  75102. func (c *InstancesSetTagsCall) Header() http.Header {
  75103. if c.header_ == nil {
  75104. c.header_ = make(http.Header)
  75105. }
  75106. return c.header_
  75107. }
  75108. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  75109. reqHeaders := make(http.Header)
  75110. for k, v := range c.header_ {
  75111. reqHeaders[k] = v
  75112. }
  75113. reqHeaders.Set("User-Agent", c.s.userAgent())
  75114. var body io.Reader = nil
  75115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  75116. if err != nil {
  75117. return nil, err
  75118. }
  75119. reqHeaders.Set("Content-Type", "application/json")
  75120. c.urlParams_.Set("alt", alt)
  75121. c.urlParams_.Set("prettyPrint", "false")
  75122. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  75123. urls += "?" + c.urlParams_.Encode()
  75124. req, err := http.NewRequest("POST", urls, body)
  75125. if err != nil {
  75126. return nil, err
  75127. }
  75128. req.Header = reqHeaders
  75129. googleapi.Expand(req.URL, map[string]string{
  75130. "project": c.project,
  75131. "zone": c.zone,
  75132. "instance": c.instance,
  75133. })
  75134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75135. }
  75136. // Do executes the "compute.instances.setTags" call.
  75137. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75138. // status code is an error. Response headers are in either
  75139. // *Operation.ServerResponse.Header or (if a response was returned at
  75140. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75141. // to check whether the returned error was because
  75142. // http.StatusNotModified was returned.
  75143. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75144. gensupport.SetOptions(c.urlParams_, opts...)
  75145. res, err := c.doRequest("json")
  75146. if res != nil && res.StatusCode == http.StatusNotModified {
  75147. if res.Body != nil {
  75148. res.Body.Close()
  75149. }
  75150. return nil, &googleapi.Error{
  75151. Code: res.StatusCode,
  75152. Header: res.Header,
  75153. }
  75154. }
  75155. if err != nil {
  75156. return nil, err
  75157. }
  75158. defer googleapi.CloseBody(res)
  75159. if err := googleapi.CheckResponse(res); err != nil {
  75160. return nil, err
  75161. }
  75162. ret := &Operation{
  75163. ServerResponse: googleapi.ServerResponse{
  75164. Header: res.Header,
  75165. HTTPStatusCode: res.StatusCode,
  75166. },
  75167. }
  75168. target := &ret
  75169. if err := gensupport.DecodeResponse(target, res); err != nil {
  75170. return nil, err
  75171. }
  75172. return ret, nil
  75173. // {
  75174. // "description": "Sets network tags for the specified instance to the data included in the request.",
  75175. // "httpMethod": "POST",
  75176. // "id": "compute.instances.setTags",
  75177. // "parameterOrder": [
  75178. // "project",
  75179. // "zone",
  75180. // "instance"
  75181. // ],
  75182. // "parameters": {
  75183. // "instance": {
  75184. // "description": "Name of the instance scoping this request.",
  75185. // "location": "path",
  75186. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75187. // "required": true,
  75188. // "type": "string"
  75189. // },
  75190. // "project": {
  75191. // "description": "Project ID for this request.",
  75192. // "location": "path",
  75193. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75194. // "required": true,
  75195. // "type": "string"
  75196. // },
  75197. // "requestId": {
  75198. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75199. // "location": "query",
  75200. // "type": "string"
  75201. // },
  75202. // "zone": {
  75203. // "description": "The name of the zone for this request.",
  75204. // "location": "path",
  75205. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75206. // "required": true,
  75207. // "type": "string"
  75208. // }
  75209. // },
  75210. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  75211. // "request": {
  75212. // "$ref": "Tags"
  75213. // },
  75214. // "response": {
  75215. // "$ref": "Operation"
  75216. // },
  75217. // "scopes": [
  75218. // "https://www.googleapis.com/auth/cloud-platform",
  75219. // "https://www.googleapis.com/auth/compute"
  75220. // ]
  75221. // }
  75222. }
  75223. // method id "compute.instances.simulateMaintenanceEvent":
  75224. type InstancesSimulateMaintenanceEventCall struct {
  75225. s *Service
  75226. project string
  75227. zone string
  75228. instance string
  75229. urlParams_ gensupport.URLParams
  75230. ctx_ context.Context
  75231. header_ http.Header
  75232. }
  75233. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  75234. // instance.
  75235. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  75236. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75237. c.project = project
  75238. c.zone = zone
  75239. c.instance = instance
  75240. return c
  75241. }
  75242. // Fields allows partial responses to be retrieved. See
  75243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75244. // for more information.
  75245. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  75246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75247. return c
  75248. }
  75249. // Context sets the context to be used in this call's Do method. Any
  75250. // pending HTTP request will be aborted if the provided context is
  75251. // canceled.
  75252. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  75253. c.ctx_ = ctx
  75254. return c
  75255. }
  75256. // Header returns an http.Header that can be modified by the caller to
  75257. // add HTTP headers to the request.
  75258. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  75259. if c.header_ == nil {
  75260. c.header_ = make(http.Header)
  75261. }
  75262. return c.header_
  75263. }
  75264. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  75265. reqHeaders := make(http.Header)
  75266. for k, v := range c.header_ {
  75267. reqHeaders[k] = v
  75268. }
  75269. reqHeaders.Set("User-Agent", c.s.userAgent())
  75270. var body io.Reader = nil
  75271. c.urlParams_.Set("alt", alt)
  75272. c.urlParams_.Set("prettyPrint", "false")
  75273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  75274. urls += "?" + c.urlParams_.Encode()
  75275. req, err := http.NewRequest("POST", urls, body)
  75276. if err != nil {
  75277. return nil, err
  75278. }
  75279. req.Header = reqHeaders
  75280. googleapi.Expand(req.URL, map[string]string{
  75281. "project": c.project,
  75282. "zone": c.zone,
  75283. "instance": c.instance,
  75284. })
  75285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75286. }
  75287. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  75288. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75289. // status code is an error. Response headers are in either
  75290. // *Operation.ServerResponse.Header or (if a response was returned at
  75291. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75292. // to check whether the returned error was because
  75293. // http.StatusNotModified was returned.
  75294. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75295. gensupport.SetOptions(c.urlParams_, opts...)
  75296. res, err := c.doRequest("json")
  75297. if res != nil && res.StatusCode == http.StatusNotModified {
  75298. if res.Body != nil {
  75299. res.Body.Close()
  75300. }
  75301. return nil, &googleapi.Error{
  75302. Code: res.StatusCode,
  75303. Header: res.Header,
  75304. }
  75305. }
  75306. if err != nil {
  75307. return nil, err
  75308. }
  75309. defer googleapi.CloseBody(res)
  75310. if err := googleapi.CheckResponse(res); err != nil {
  75311. return nil, err
  75312. }
  75313. ret := &Operation{
  75314. ServerResponse: googleapi.ServerResponse{
  75315. Header: res.Header,
  75316. HTTPStatusCode: res.StatusCode,
  75317. },
  75318. }
  75319. target := &ret
  75320. if err := gensupport.DecodeResponse(target, res); err != nil {
  75321. return nil, err
  75322. }
  75323. return ret, nil
  75324. // {
  75325. // "description": "Simulates a maintenance event on the instance.",
  75326. // "httpMethod": "POST",
  75327. // "id": "compute.instances.simulateMaintenanceEvent",
  75328. // "parameterOrder": [
  75329. // "project",
  75330. // "zone",
  75331. // "instance"
  75332. // ],
  75333. // "parameters": {
  75334. // "instance": {
  75335. // "description": "Name of the instance scoping this request.",
  75336. // "location": "path",
  75337. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75338. // "required": true,
  75339. // "type": "string"
  75340. // },
  75341. // "project": {
  75342. // "description": "Project ID for this request.",
  75343. // "location": "path",
  75344. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75345. // "required": true,
  75346. // "type": "string"
  75347. // },
  75348. // "zone": {
  75349. // "description": "The name of the zone for this request.",
  75350. // "location": "path",
  75351. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75352. // "required": true,
  75353. // "type": "string"
  75354. // }
  75355. // },
  75356. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  75357. // "response": {
  75358. // "$ref": "Operation"
  75359. // },
  75360. // "scopes": [
  75361. // "https://www.googleapis.com/auth/cloud-platform",
  75362. // "https://www.googleapis.com/auth/compute"
  75363. // ]
  75364. // }
  75365. }
  75366. // method id "compute.instances.start":
  75367. type InstancesStartCall struct {
  75368. s *Service
  75369. project string
  75370. zone string
  75371. instance string
  75372. urlParams_ gensupport.URLParams
  75373. ctx_ context.Context
  75374. header_ http.Header
  75375. }
  75376. // Start: Starts an instance that was stopped using the instances().stop
  75377. // method. For more information, see Restart an instance.
  75378. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  75379. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  75380. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75381. c.project = project
  75382. c.zone = zone
  75383. c.instance = instance
  75384. return c
  75385. }
  75386. // RequestId sets the optional parameter "requestId": An optional
  75387. // request ID to identify requests. Specify a unique request ID so that
  75388. // if you must retry your request, the server will know to ignore the
  75389. // request if it has already been completed.
  75390. //
  75391. // For example, consider a situation where you make an initial request
  75392. // and the request times out. If you make the request again with the
  75393. // same request ID, the server can check if original operation with the
  75394. // same request ID was received, and if so, will ignore the second
  75395. // request. This prevents clients from accidentally creating duplicate
  75396. // commitments.
  75397. //
  75398. // The request ID must be a valid UUID with the exception that zero UUID
  75399. // is not supported (00000000-0000-0000-0000-000000000000).
  75400. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  75401. c.urlParams_.Set("requestId", requestId)
  75402. return c
  75403. }
  75404. // Fields allows partial responses to be retrieved. See
  75405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75406. // for more information.
  75407. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  75408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75409. return c
  75410. }
  75411. // Context sets the context to be used in this call's Do method. Any
  75412. // pending HTTP request will be aborted if the provided context is
  75413. // canceled.
  75414. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  75415. c.ctx_ = ctx
  75416. return c
  75417. }
  75418. // Header returns an http.Header that can be modified by the caller to
  75419. // add HTTP headers to the request.
  75420. func (c *InstancesStartCall) Header() http.Header {
  75421. if c.header_ == nil {
  75422. c.header_ = make(http.Header)
  75423. }
  75424. return c.header_
  75425. }
  75426. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  75427. reqHeaders := make(http.Header)
  75428. for k, v := range c.header_ {
  75429. reqHeaders[k] = v
  75430. }
  75431. reqHeaders.Set("User-Agent", c.s.userAgent())
  75432. var body io.Reader = nil
  75433. c.urlParams_.Set("alt", alt)
  75434. c.urlParams_.Set("prettyPrint", "false")
  75435. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  75436. urls += "?" + c.urlParams_.Encode()
  75437. req, err := http.NewRequest("POST", urls, body)
  75438. if err != nil {
  75439. return nil, err
  75440. }
  75441. req.Header = reqHeaders
  75442. googleapi.Expand(req.URL, map[string]string{
  75443. "project": c.project,
  75444. "zone": c.zone,
  75445. "instance": c.instance,
  75446. })
  75447. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75448. }
  75449. // Do executes the "compute.instances.start" call.
  75450. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75451. // status code is an error. Response headers are in either
  75452. // *Operation.ServerResponse.Header or (if a response was returned at
  75453. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75454. // to check whether the returned error was because
  75455. // http.StatusNotModified was returned.
  75456. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75457. gensupport.SetOptions(c.urlParams_, opts...)
  75458. res, err := c.doRequest("json")
  75459. if res != nil && res.StatusCode == http.StatusNotModified {
  75460. if res.Body != nil {
  75461. res.Body.Close()
  75462. }
  75463. return nil, &googleapi.Error{
  75464. Code: res.StatusCode,
  75465. Header: res.Header,
  75466. }
  75467. }
  75468. if err != nil {
  75469. return nil, err
  75470. }
  75471. defer googleapi.CloseBody(res)
  75472. if err := googleapi.CheckResponse(res); err != nil {
  75473. return nil, err
  75474. }
  75475. ret := &Operation{
  75476. ServerResponse: googleapi.ServerResponse{
  75477. Header: res.Header,
  75478. HTTPStatusCode: res.StatusCode,
  75479. },
  75480. }
  75481. target := &ret
  75482. if err := gensupport.DecodeResponse(target, res); err != nil {
  75483. return nil, err
  75484. }
  75485. return ret, nil
  75486. // {
  75487. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  75488. // "httpMethod": "POST",
  75489. // "id": "compute.instances.start",
  75490. // "parameterOrder": [
  75491. // "project",
  75492. // "zone",
  75493. // "instance"
  75494. // ],
  75495. // "parameters": {
  75496. // "instance": {
  75497. // "description": "Name of the instance resource to start.",
  75498. // "location": "path",
  75499. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75500. // "required": true,
  75501. // "type": "string"
  75502. // },
  75503. // "project": {
  75504. // "description": "Project ID for this request.",
  75505. // "location": "path",
  75506. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75507. // "required": true,
  75508. // "type": "string"
  75509. // },
  75510. // "requestId": {
  75511. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75512. // "location": "query",
  75513. // "type": "string"
  75514. // },
  75515. // "zone": {
  75516. // "description": "The name of the zone for this request.",
  75517. // "location": "path",
  75518. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75519. // "required": true,
  75520. // "type": "string"
  75521. // }
  75522. // },
  75523. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  75524. // "response": {
  75525. // "$ref": "Operation"
  75526. // },
  75527. // "scopes": [
  75528. // "https://www.googleapis.com/auth/cloud-platform",
  75529. // "https://www.googleapis.com/auth/compute"
  75530. // ]
  75531. // }
  75532. }
  75533. // method id "compute.instances.startWithEncryptionKey":
  75534. type InstancesStartWithEncryptionKeyCall struct {
  75535. s *Service
  75536. project string
  75537. zone string
  75538. instance string
  75539. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  75540. urlParams_ gensupport.URLParams
  75541. ctx_ context.Context
  75542. header_ http.Header
  75543. }
  75544. // StartWithEncryptionKey: Starts an instance that was stopped using the
  75545. // instances().stop method. For more information, see Restart an
  75546. // instance.
  75547. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  75548. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75549. c.project = project
  75550. c.zone = zone
  75551. c.instance = instance
  75552. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  75553. return c
  75554. }
  75555. // RequestId sets the optional parameter "requestId": An optional
  75556. // request ID to identify requests. Specify a unique request ID so that
  75557. // if you must retry your request, the server will know to ignore the
  75558. // request if it has already been completed.
  75559. //
  75560. // For example, consider a situation where you make an initial request
  75561. // and the request times out. If you make the request again with the
  75562. // same request ID, the server can check if original operation with the
  75563. // same request ID was received, and if so, will ignore the second
  75564. // request. This prevents clients from accidentally creating duplicate
  75565. // commitments.
  75566. //
  75567. // The request ID must be a valid UUID with the exception that zero UUID
  75568. // is not supported (00000000-0000-0000-0000-000000000000).
  75569. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  75570. c.urlParams_.Set("requestId", requestId)
  75571. return c
  75572. }
  75573. // Fields allows partial responses to be retrieved. See
  75574. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75575. // for more information.
  75576. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  75577. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75578. return c
  75579. }
  75580. // Context sets the context to be used in this call's Do method. Any
  75581. // pending HTTP request will be aborted if the provided context is
  75582. // canceled.
  75583. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  75584. c.ctx_ = ctx
  75585. return c
  75586. }
  75587. // Header returns an http.Header that can be modified by the caller to
  75588. // add HTTP headers to the request.
  75589. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  75590. if c.header_ == nil {
  75591. c.header_ = make(http.Header)
  75592. }
  75593. return c.header_
  75594. }
  75595. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  75596. reqHeaders := make(http.Header)
  75597. for k, v := range c.header_ {
  75598. reqHeaders[k] = v
  75599. }
  75600. reqHeaders.Set("User-Agent", c.s.userAgent())
  75601. var body io.Reader = nil
  75602. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  75603. if err != nil {
  75604. return nil, err
  75605. }
  75606. reqHeaders.Set("Content-Type", "application/json")
  75607. c.urlParams_.Set("alt", alt)
  75608. c.urlParams_.Set("prettyPrint", "false")
  75609. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  75610. urls += "?" + c.urlParams_.Encode()
  75611. req, err := http.NewRequest("POST", urls, body)
  75612. if err != nil {
  75613. return nil, err
  75614. }
  75615. req.Header = reqHeaders
  75616. googleapi.Expand(req.URL, map[string]string{
  75617. "project": c.project,
  75618. "zone": c.zone,
  75619. "instance": c.instance,
  75620. })
  75621. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75622. }
  75623. // Do executes the "compute.instances.startWithEncryptionKey" call.
  75624. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75625. // status code is an error. Response headers are in either
  75626. // *Operation.ServerResponse.Header or (if a response was returned at
  75627. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75628. // to check whether the returned error was because
  75629. // http.StatusNotModified was returned.
  75630. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75631. gensupport.SetOptions(c.urlParams_, opts...)
  75632. res, err := c.doRequest("json")
  75633. if res != nil && res.StatusCode == http.StatusNotModified {
  75634. if res.Body != nil {
  75635. res.Body.Close()
  75636. }
  75637. return nil, &googleapi.Error{
  75638. Code: res.StatusCode,
  75639. Header: res.Header,
  75640. }
  75641. }
  75642. if err != nil {
  75643. return nil, err
  75644. }
  75645. defer googleapi.CloseBody(res)
  75646. if err := googleapi.CheckResponse(res); err != nil {
  75647. return nil, err
  75648. }
  75649. ret := &Operation{
  75650. ServerResponse: googleapi.ServerResponse{
  75651. Header: res.Header,
  75652. HTTPStatusCode: res.StatusCode,
  75653. },
  75654. }
  75655. target := &ret
  75656. if err := gensupport.DecodeResponse(target, res); err != nil {
  75657. return nil, err
  75658. }
  75659. return ret, nil
  75660. // {
  75661. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  75662. // "httpMethod": "POST",
  75663. // "id": "compute.instances.startWithEncryptionKey",
  75664. // "parameterOrder": [
  75665. // "project",
  75666. // "zone",
  75667. // "instance"
  75668. // ],
  75669. // "parameters": {
  75670. // "instance": {
  75671. // "description": "Name of the instance resource to start.",
  75672. // "location": "path",
  75673. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75674. // "required": true,
  75675. // "type": "string"
  75676. // },
  75677. // "project": {
  75678. // "description": "Project ID for this request.",
  75679. // "location": "path",
  75680. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75681. // "required": true,
  75682. // "type": "string"
  75683. // },
  75684. // "requestId": {
  75685. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75686. // "location": "query",
  75687. // "type": "string"
  75688. // },
  75689. // "zone": {
  75690. // "description": "The name of the zone for this request.",
  75691. // "location": "path",
  75692. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75693. // "required": true,
  75694. // "type": "string"
  75695. // }
  75696. // },
  75697. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  75698. // "request": {
  75699. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  75700. // },
  75701. // "response": {
  75702. // "$ref": "Operation"
  75703. // },
  75704. // "scopes": [
  75705. // "https://www.googleapis.com/auth/cloud-platform",
  75706. // "https://www.googleapis.com/auth/compute"
  75707. // ]
  75708. // }
  75709. }
  75710. // method id "compute.instances.stop":
  75711. type InstancesStopCall struct {
  75712. s *Service
  75713. project string
  75714. zone string
  75715. instance string
  75716. urlParams_ gensupport.URLParams
  75717. ctx_ context.Context
  75718. header_ http.Header
  75719. }
  75720. // Stop: Stops a running instance, shutting it down cleanly, and allows
  75721. // you to restart the instance at a later time. Stopped instances do not
  75722. // incur VM usage charges while they are stopped. However, resources
  75723. // that the VM is using, such as persistent disks and static IP
  75724. // addresses, will continue to be charged until they are deleted. For
  75725. // more information, see Stopping an instance.
  75726. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  75727. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  75728. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75729. c.project = project
  75730. c.zone = zone
  75731. c.instance = instance
  75732. return c
  75733. }
  75734. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  75735. // true, discard the contents of any attached localSSD partitions.
  75736. // Default value is false (== preserve localSSD data).
  75737. func (c *InstancesStopCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesStopCall {
  75738. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  75739. return c
  75740. }
  75741. // RequestId sets the optional parameter "requestId": An optional
  75742. // request ID to identify requests. Specify a unique request ID so that
  75743. // if you must retry your request, the server will know to ignore the
  75744. // request if it has already been completed.
  75745. //
  75746. // For example, consider a situation where you make an initial request
  75747. // and the request times out. If you make the request again with the
  75748. // same request ID, the server can check if original operation with the
  75749. // same request ID was received, and if so, will ignore the second
  75750. // request. This prevents clients from accidentally creating duplicate
  75751. // commitments.
  75752. //
  75753. // The request ID must be a valid UUID with the exception that zero UUID
  75754. // is not supported (00000000-0000-0000-0000-000000000000).
  75755. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  75756. c.urlParams_.Set("requestId", requestId)
  75757. return c
  75758. }
  75759. // Fields allows partial responses to be retrieved. See
  75760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75761. // for more information.
  75762. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  75763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75764. return c
  75765. }
  75766. // Context sets the context to be used in this call's Do method. Any
  75767. // pending HTTP request will be aborted if the provided context is
  75768. // canceled.
  75769. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  75770. c.ctx_ = ctx
  75771. return c
  75772. }
  75773. // Header returns an http.Header that can be modified by the caller to
  75774. // add HTTP headers to the request.
  75775. func (c *InstancesStopCall) Header() http.Header {
  75776. if c.header_ == nil {
  75777. c.header_ = make(http.Header)
  75778. }
  75779. return c.header_
  75780. }
  75781. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  75782. reqHeaders := make(http.Header)
  75783. for k, v := range c.header_ {
  75784. reqHeaders[k] = v
  75785. }
  75786. reqHeaders.Set("User-Agent", c.s.userAgent())
  75787. var body io.Reader = nil
  75788. c.urlParams_.Set("alt", alt)
  75789. c.urlParams_.Set("prettyPrint", "false")
  75790. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  75791. urls += "?" + c.urlParams_.Encode()
  75792. req, err := http.NewRequest("POST", urls, body)
  75793. if err != nil {
  75794. return nil, err
  75795. }
  75796. req.Header = reqHeaders
  75797. googleapi.Expand(req.URL, map[string]string{
  75798. "project": c.project,
  75799. "zone": c.zone,
  75800. "instance": c.instance,
  75801. })
  75802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75803. }
  75804. // Do executes the "compute.instances.stop" call.
  75805. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75806. // status code is an error. Response headers are in either
  75807. // *Operation.ServerResponse.Header or (if a response was returned at
  75808. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75809. // to check whether the returned error was because
  75810. // http.StatusNotModified was returned.
  75811. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75812. gensupport.SetOptions(c.urlParams_, opts...)
  75813. res, err := c.doRequest("json")
  75814. if res != nil && res.StatusCode == http.StatusNotModified {
  75815. if res.Body != nil {
  75816. res.Body.Close()
  75817. }
  75818. return nil, &googleapi.Error{
  75819. Code: res.StatusCode,
  75820. Header: res.Header,
  75821. }
  75822. }
  75823. if err != nil {
  75824. return nil, err
  75825. }
  75826. defer googleapi.CloseBody(res)
  75827. if err := googleapi.CheckResponse(res); err != nil {
  75828. return nil, err
  75829. }
  75830. ret := &Operation{
  75831. ServerResponse: googleapi.ServerResponse{
  75832. Header: res.Header,
  75833. HTTPStatusCode: res.StatusCode,
  75834. },
  75835. }
  75836. target := &ret
  75837. if err := gensupport.DecodeResponse(target, res); err != nil {
  75838. return nil, err
  75839. }
  75840. return ret, nil
  75841. // {
  75842. // "description": "Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.",
  75843. // "httpMethod": "POST",
  75844. // "id": "compute.instances.stop",
  75845. // "parameterOrder": [
  75846. // "project",
  75847. // "zone",
  75848. // "instance"
  75849. // ],
  75850. // "parameters": {
  75851. // "discardLocalSsd": {
  75852. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  75853. // "location": "query",
  75854. // "type": "boolean"
  75855. // },
  75856. // "instance": {
  75857. // "description": "Name of the instance resource to stop.",
  75858. // "location": "path",
  75859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75860. // "required": true,
  75861. // "type": "string"
  75862. // },
  75863. // "project": {
  75864. // "description": "Project ID for this request.",
  75865. // "location": "path",
  75866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75867. // "required": true,
  75868. // "type": "string"
  75869. // },
  75870. // "requestId": {
  75871. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75872. // "location": "query",
  75873. // "type": "string"
  75874. // },
  75875. // "zone": {
  75876. // "description": "The name of the zone for this request.",
  75877. // "location": "path",
  75878. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75879. // "required": true,
  75880. // "type": "string"
  75881. // }
  75882. // },
  75883. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  75884. // "response": {
  75885. // "$ref": "Operation"
  75886. // },
  75887. // "scopes": [
  75888. // "https://www.googleapis.com/auth/cloud-platform",
  75889. // "https://www.googleapis.com/auth/compute"
  75890. // ]
  75891. // }
  75892. }
  75893. // method id "compute.instances.suspend":
  75894. type InstancesSuspendCall struct {
  75895. s *Service
  75896. project string
  75897. zone string
  75898. instance string
  75899. urlParams_ gensupport.URLParams
  75900. ctx_ context.Context
  75901. header_ http.Header
  75902. }
  75903. // Suspend: This method suspends a running instance, saving its state to
  75904. // persistent storage, and allows you to resume the instance at a later
  75905. // time. Suspended instances incur reduced per-minute, virtual machine
  75906. // usage charges while they are suspended. Any resources the virtual
  75907. // machine is using, such as persistent disks and static IP addresses,
  75908. // will continue to be charged until they are deleted.
  75909. func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall {
  75910. c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75911. c.project = project
  75912. c.zone = zone
  75913. c.instance = instance
  75914. return c
  75915. }
  75916. // DiscardLocalSsd sets the optional parameter "discardLocalSsd": If
  75917. // true, discard the contents of any attached localSSD partitions.
  75918. // Default value is false (== preserve localSSD data).
  75919. func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall {
  75920. c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd))
  75921. return c
  75922. }
  75923. // RequestId sets the optional parameter "requestId": An optional
  75924. // request ID to identify requests. Specify a unique request ID so that
  75925. // if you must retry your request, the server will know to ignore the
  75926. // request if it has already been completed.
  75927. //
  75928. // For example, consider a situation where you make an initial request
  75929. // and the request times out. If you make the request again with the
  75930. // same request ID, the server can check if original operation with the
  75931. // same request ID was received, and if so, will ignore the second
  75932. // request. This prevents clients from accidentally creating duplicate
  75933. // commitments.
  75934. //
  75935. // The request ID must be a valid UUID with the exception that zero UUID
  75936. // is not supported (00000000-0000-0000-0000-000000000000).
  75937. func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall {
  75938. c.urlParams_.Set("requestId", requestId)
  75939. return c
  75940. }
  75941. // Fields allows partial responses to be retrieved. See
  75942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75943. // for more information.
  75944. func (c *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall {
  75945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75946. return c
  75947. }
  75948. // Context sets the context to be used in this call's Do method. Any
  75949. // pending HTTP request will be aborted if the provided context is
  75950. // canceled.
  75951. func (c *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall {
  75952. c.ctx_ = ctx
  75953. return c
  75954. }
  75955. // Header returns an http.Header that can be modified by the caller to
  75956. // add HTTP headers to the request.
  75957. func (c *InstancesSuspendCall) Header() http.Header {
  75958. if c.header_ == nil {
  75959. c.header_ = make(http.Header)
  75960. }
  75961. return c.header_
  75962. }
  75963. func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) {
  75964. reqHeaders := make(http.Header)
  75965. for k, v := range c.header_ {
  75966. reqHeaders[k] = v
  75967. }
  75968. reqHeaders.Set("User-Agent", c.s.userAgent())
  75969. var body io.Reader = nil
  75970. c.urlParams_.Set("alt", alt)
  75971. c.urlParams_.Set("prettyPrint", "false")
  75972. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/suspend")
  75973. urls += "?" + c.urlParams_.Encode()
  75974. req, err := http.NewRequest("POST", urls, body)
  75975. if err != nil {
  75976. return nil, err
  75977. }
  75978. req.Header = reqHeaders
  75979. googleapi.Expand(req.URL, map[string]string{
  75980. "project": c.project,
  75981. "zone": c.zone,
  75982. "instance": c.instance,
  75983. })
  75984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75985. }
  75986. // Do executes the "compute.instances.suspend" call.
  75987. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75988. // status code is an error. Response headers are in either
  75989. // *Operation.ServerResponse.Header or (if a response was returned at
  75990. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75991. // to check whether the returned error was because
  75992. // http.StatusNotModified was returned.
  75993. func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75994. gensupport.SetOptions(c.urlParams_, opts...)
  75995. res, err := c.doRequest("json")
  75996. if res != nil && res.StatusCode == http.StatusNotModified {
  75997. if res.Body != nil {
  75998. res.Body.Close()
  75999. }
  76000. return nil, &googleapi.Error{
  76001. Code: res.StatusCode,
  76002. Header: res.Header,
  76003. }
  76004. }
  76005. if err != nil {
  76006. return nil, err
  76007. }
  76008. defer googleapi.CloseBody(res)
  76009. if err := googleapi.CheckResponse(res); err != nil {
  76010. return nil, err
  76011. }
  76012. ret := &Operation{
  76013. ServerResponse: googleapi.ServerResponse{
  76014. Header: res.Header,
  76015. HTTPStatusCode: res.StatusCode,
  76016. },
  76017. }
  76018. target := &ret
  76019. if err := gensupport.DecodeResponse(target, res); err != nil {
  76020. return nil, err
  76021. }
  76022. return ret, nil
  76023. // {
  76024. // "description": "This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances incur reduced per-minute, virtual machine usage charges while they are suspended. Any resources the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted.",
  76025. // "httpMethod": "POST",
  76026. // "id": "compute.instances.suspend",
  76027. // "parameterOrder": [
  76028. // "project",
  76029. // "zone",
  76030. // "instance"
  76031. // ],
  76032. // "parameters": {
  76033. // "discardLocalSsd": {
  76034. // "description": "If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data).",
  76035. // "location": "query",
  76036. // "type": "boolean"
  76037. // },
  76038. // "instance": {
  76039. // "description": "Name of the instance resource to suspend.",
  76040. // "location": "path",
  76041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76042. // "required": true,
  76043. // "type": "string"
  76044. // },
  76045. // "project": {
  76046. // "description": "Project ID for this request.",
  76047. // "location": "path",
  76048. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76049. // "required": true,
  76050. // "type": "string"
  76051. // },
  76052. // "requestId": {
  76053. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76054. // "location": "query",
  76055. // "type": "string"
  76056. // },
  76057. // "zone": {
  76058. // "description": "The name of the zone for this request.",
  76059. // "location": "path",
  76060. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76061. // "required": true,
  76062. // "type": "string"
  76063. // }
  76064. // },
  76065. // "path": "{project}/zones/{zone}/instances/{instance}/suspend",
  76066. // "response": {
  76067. // "$ref": "Operation"
  76068. // },
  76069. // "scopes": [
  76070. // "https://www.googleapis.com/auth/cloud-platform",
  76071. // "https://www.googleapis.com/auth/compute"
  76072. // ]
  76073. // }
  76074. }
  76075. // method id "compute.instances.testIamPermissions":
  76076. type InstancesTestIamPermissionsCall struct {
  76077. s *Service
  76078. project string
  76079. zone string
  76080. resource string
  76081. testpermissionsrequest *TestPermissionsRequest
  76082. urlParams_ gensupport.URLParams
  76083. ctx_ context.Context
  76084. header_ http.Header
  76085. }
  76086. // TestIamPermissions: Returns permissions that a caller has on the
  76087. // specified resource.
  76088. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  76089. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76090. c.project = project
  76091. c.zone = zone
  76092. c.resource = resource
  76093. c.testpermissionsrequest = testpermissionsrequest
  76094. return c
  76095. }
  76096. // Fields allows partial responses to be retrieved. See
  76097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76098. // for more information.
  76099. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  76100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76101. return c
  76102. }
  76103. // Context sets the context to be used in this call's Do method. Any
  76104. // pending HTTP request will be aborted if the provided context is
  76105. // canceled.
  76106. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  76107. c.ctx_ = ctx
  76108. return c
  76109. }
  76110. // Header returns an http.Header that can be modified by the caller to
  76111. // add HTTP headers to the request.
  76112. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  76113. if c.header_ == nil {
  76114. c.header_ = make(http.Header)
  76115. }
  76116. return c.header_
  76117. }
  76118. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  76119. reqHeaders := make(http.Header)
  76120. for k, v := range c.header_ {
  76121. reqHeaders[k] = v
  76122. }
  76123. reqHeaders.Set("User-Agent", c.s.userAgent())
  76124. var body io.Reader = nil
  76125. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  76126. if err != nil {
  76127. return nil, err
  76128. }
  76129. reqHeaders.Set("Content-Type", "application/json")
  76130. c.urlParams_.Set("alt", alt)
  76131. c.urlParams_.Set("prettyPrint", "false")
  76132. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  76133. urls += "?" + c.urlParams_.Encode()
  76134. req, err := http.NewRequest("POST", urls, body)
  76135. if err != nil {
  76136. return nil, err
  76137. }
  76138. req.Header = reqHeaders
  76139. googleapi.Expand(req.URL, map[string]string{
  76140. "project": c.project,
  76141. "zone": c.zone,
  76142. "resource": c.resource,
  76143. })
  76144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76145. }
  76146. // Do executes the "compute.instances.testIamPermissions" call.
  76147. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  76148. // non-2xx status code is an error. Response headers are in either
  76149. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  76150. // returned at all) in error.(*googleapi.Error).Header. Use
  76151. // googleapi.IsNotModified to check whether the returned error was
  76152. // because http.StatusNotModified was returned.
  76153. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  76154. gensupport.SetOptions(c.urlParams_, opts...)
  76155. res, err := c.doRequest("json")
  76156. if res != nil && res.StatusCode == http.StatusNotModified {
  76157. if res.Body != nil {
  76158. res.Body.Close()
  76159. }
  76160. return nil, &googleapi.Error{
  76161. Code: res.StatusCode,
  76162. Header: res.Header,
  76163. }
  76164. }
  76165. if err != nil {
  76166. return nil, err
  76167. }
  76168. defer googleapi.CloseBody(res)
  76169. if err := googleapi.CheckResponse(res); err != nil {
  76170. return nil, err
  76171. }
  76172. ret := &TestPermissionsResponse{
  76173. ServerResponse: googleapi.ServerResponse{
  76174. Header: res.Header,
  76175. HTTPStatusCode: res.StatusCode,
  76176. },
  76177. }
  76178. target := &ret
  76179. if err := gensupport.DecodeResponse(target, res); err != nil {
  76180. return nil, err
  76181. }
  76182. return ret, nil
  76183. // {
  76184. // "description": "Returns permissions that a caller has on the specified resource.",
  76185. // "httpMethod": "POST",
  76186. // "id": "compute.instances.testIamPermissions",
  76187. // "parameterOrder": [
  76188. // "project",
  76189. // "zone",
  76190. // "resource"
  76191. // ],
  76192. // "parameters": {
  76193. // "project": {
  76194. // "description": "Project ID for this request.",
  76195. // "location": "path",
  76196. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76197. // "required": true,
  76198. // "type": "string"
  76199. // },
  76200. // "resource": {
  76201. // "description": "Name or id of the resource for this request.",
  76202. // "location": "path",
  76203. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76204. // "required": true,
  76205. // "type": "string"
  76206. // },
  76207. // "zone": {
  76208. // "description": "The name of the zone for this request.",
  76209. // "location": "path",
  76210. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76211. // "required": true,
  76212. // "type": "string"
  76213. // }
  76214. // },
  76215. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  76216. // "request": {
  76217. // "$ref": "TestPermissionsRequest"
  76218. // },
  76219. // "response": {
  76220. // "$ref": "TestPermissionsResponse"
  76221. // },
  76222. // "scopes": [
  76223. // "https://www.googleapis.com/auth/cloud-platform",
  76224. // "https://www.googleapis.com/auth/compute",
  76225. // "https://www.googleapis.com/auth/compute.readonly"
  76226. // ]
  76227. // }
  76228. }
  76229. // method id "compute.instances.updateAccessConfig":
  76230. type InstancesUpdateAccessConfigCall struct {
  76231. s *Service
  76232. project string
  76233. zone string
  76234. instance string
  76235. accessconfig *AccessConfig
  76236. urlParams_ gensupport.URLParams
  76237. ctx_ context.Context
  76238. header_ http.Header
  76239. }
  76240. // UpdateAccessConfig: Updates the specified access config from an
  76241. // instance's network interface with the data included in the request.
  76242. // This method supports PATCH semantics and uses the JSON merge patch
  76243. // format and processing rules.
  76244. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  76245. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76246. c.project = project
  76247. c.zone = zone
  76248. c.instance = instance
  76249. c.urlParams_.Set("networkInterface", networkInterface)
  76250. c.accessconfig = accessconfig
  76251. return c
  76252. }
  76253. // RequestId sets the optional parameter "requestId": An optional
  76254. // request ID to identify requests. Specify a unique request ID so that
  76255. // if you must retry your request, the server will know to ignore the
  76256. // request if it has already been completed.
  76257. //
  76258. // For example, consider a situation where you make an initial request
  76259. // and the request times out. If you make the request again with the
  76260. // same request ID, the server can check if original operation with the
  76261. // same request ID was received, and if so, will ignore the second
  76262. // request. This prevents clients from accidentally creating duplicate
  76263. // commitments.
  76264. //
  76265. // The request ID must be a valid UUID with the exception that zero UUID
  76266. // is not supported (00000000-0000-0000-0000-000000000000).
  76267. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  76268. c.urlParams_.Set("requestId", requestId)
  76269. return c
  76270. }
  76271. // Fields allows partial responses to be retrieved. See
  76272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76273. // for more information.
  76274. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  76275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76276. return c
  76277. }
  76278. // Context sets the context to be used in this call's Do method. Any
  76279. // pending HTTP request will be aborted if the provided context is
  76280. // canceled.
  76281. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  76282. c.ctx_ = ctx
  76283. return c
  76284. }
  76285. // Header returns an http.Header that can be modified by the caller to
  76286. // add HTTP headers to the request.
  76287. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  76288. if c.header_ == nil {
  76289. c.header_ = make(http.Header)
  76290. }
  76291. return c.header_
  76292. }
  76293. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  76294. reqHeaders := make(http.Header)
  76295. for k, v := range c.header_ {
  76296. reqHeaders[k] = v
  76297. }
  76298. reqHeaders.Set("User-Agent", c.s.userAgent())
  76299. var body io.Reader = nil
  76300. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  76301. if err != nil {
  76302. return nil, err
  76303. }
  76304. reqHeaders.Set("Content-Type", "application/json")
  76305. c.urlParams_.Set("alt", alt)
  76306. c.urlParams_.Set("prettyPrint", "false")
  76307. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  76308. urls += "?" + c.urlParams_.Encode()
  76309. req, err := http.NewRequest("POST", urls, body)
  76310. if err != nil {
  76311. return nil, err
  76312. }
  76313. req.Header = reqHeaders
  76314. googleapi.Expand(req.URL, map[string]string{
  76315. "project": c.project,
  76316. "zone": c.zone,
  76317. "instance": c.instance,
  76318. })
  76319. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76320. }
  76321. // Do executes the "compute.instances.updateAccessConfig" call.
  76322. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76323. // status code is an error. Response headers are in either
  76324. // *Operation.ServerResponse.Header or (if a response was returned at
  76325. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76326. // to check whether the returned error was because
  76327. // http.StatusNotModified was returned.
  76328. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76329. gensupport.SetOptions(c.urlParams_, opts...)
  76330. res, err := c.doRequest("json")
  76331. if res != nil && res.StatusCode == http.StatusNotModified {
  76332. if res.Body != nil {
  76333. res.Body.Close()
  76334. }
  76335. return nil, &googleapi.Error{
  76336. Code: res.StatusCode,
  76337. Header: res.Header,
  76338. }
  76339. }
  76340. if err != nil {
  76341. return nil, err
  76342. }
  76343. defer googleapi.CloseBody(res)
  76344. if err := googleapi.CheckResponse(res); err != nil {
  76345. return nil, err
  76346. }
  76347. ret := &Operation{
  76348. ServerResponse: googleapi.ServerResponse{
  76349. Header: res.Header,
  76350. HTTPStatusCode: res.StatusCode,
  76351. },
  76352. }
  76353. target := &ret
  76354. if err := gensupport.DecodeResponse(target, res); err != nil {
  76355. return nil, err
  76356. }
  76357. return ret, nil
  76358. // {
  76359. // "description": "Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  76360. // "httpMethod": "POST",
  76361. // "id": "compute.instances.updateAccessConfig",
  76362. // "parameterOrder": [
  76363. // "project",
  76364. // "zone",
  76365. // "instance",
  76366. // "networkInterface"
  76367. // ],
  76368. // "parameters": {
  76369. // "instance": {
  76370. // "description": "The instance name for this request.",
  76371. // "location": "path",
  76372. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76373. // "required": true,
  76374. // "type": "string"
  76375. // },
  76376. // "networkInterface": {
  76377. // "description": "The name of the network interface where the access config is attached.",
  76378. // "location": "query",
  76379. // "required": true,
  76380. // "type": "string"
  76381. // },
  76382. // "project": {
  76383. // "description": "Project ID for this request.",
  76384. // "location": "path",
  76385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76386. // "required": true,
  76387. // "type": "string"
  76388. // },
  76389. // "requestId": {
  76390. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76391. // "location": "query",
  76392. // "type": "string"
  76393. // },
  76394. // "zone": {
  76395. // "description": "The name of the zone for this request.",
  76396. // "location": "path",
  76397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76398. // "required": true,
  76399. // "type": "string"
  76400. // }
  76401. // },
  76402. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  76403. // "request": {
  76404. // "$ref": "AccessConfig"
  76405. // },
  76406. // "response": {
  76407. // "$ref": "Operation"
  76408. // },
  76409. // "scopes": [
  76410. // "https://www.googleapis.com/auth/cloud-platform",
  76411. // "https://www.googleapis.com/auth/compute"
  76412. // ]
  76413. // }
  76414. }
  76415. // method id "compute.instances.updateDisplayDevice":
  76416. type InstancesUpdateDisplayDeviceCall struct {
  76417. s *Service
  76418. project string
  76419. zone string
  76420. instance string
  76421. displaydevice *DisplayDevice
  76422. urlParams_ gensupport.URLParams
  76423. ctx_ context.Context
  76424. header_ http.Header
  76425. }
  76426. // UpdateDisplayDevice: Updates the Display config for a VM instance.
  76427. // You can only use this method on a stopped VM instance. This method
  76428. // supports PATCH semantics and uses the JSON merge patch format and
  76429. // processing rules.
  76430. func (r *InstancesService) UpdateDisplayDevice(project string, zone string, instance string, displaydevice *DisplayDevice) *InstancesUpdateDisplayDeviceCall {
  76431. c := &InstancesUpdateDisplayDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76432. c.project = project
  76433. c.zone = zone
  76434. c.instance = instance
  76435. c.displaydevice = displaydevice
  76436. return c
  76437. }
  76438. // RequestId sets the optional parameter "requestId": An optional
  76439. // request ID to identify requests. Specify a unique request ID so that
  76440. // if you must retry your request, the server will know to ignore the
  76441. // request if it has already been completed.
  76442. //
  76443. // For example, consider a situation where you make an initial request
  76444. // and the request times out. If you make the request again with the
  76445. // same request ID, the server can check if original operation with the
  76446. // same request ID was received, and if so, will ignore the second
  76447. // request. This prevents clients from accidentally creating duplicate
  76448. // commitments.
  76449. //
  76450. // The request ID must be a valid UUID with the exception that zero UUID
  76451. // is not supported (00000000-0000-0000-0000-000000000000).
  76452. func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *InstancesUpdateDisplayDeviceCall {
  76453. c.urlParams_.Set("requestId", requestId)
  76454. return c
  76455. }
  76456. // Fields allows partial responses to be retrieved. See
  76457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76458. // for more information.
  76459. func (c *InstancesUpdateDisplayDeviceCall) Fields(s ...googleapi.Field) *InstancesUpdateDisplayDeviceCall {
  76460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76461. return c
  76462. }
  76463. // Context sets the context to be used in this call's Do method. Any
  76464. // pending HTTP request will be aborted if the provided context is
  76465. // canceled.
  76466. func (c *InstancesUpdateDisplayDeviceCall) Context(ctx context.Context) *InstancesUpdateDisplayDeviceCall {
  76467. c.ctx_ = ctx
  76468. return c
  76469. }
  76470. // Header returns an http.Header that can be modified by the caller to
  76471. // add HTTP headers to the request.
  76472. func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header {
  76473. if c.header_ == nil {
  76474. c.header_ = make(http.Header)
  76475. }
  76476. return c.header_
  76477. }
  76478. func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) {
  76479. reqHeaders := make(http.Header)
  76480. for k, v := range c.header_ {
  76481. reqHeaders[k] = v
  76482. }
  76483. reqHeaders.Set("User-Agent", c.s.userAgent())
  76484. var body io.Reader = nil
  76485. body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice)
  76486. if err != nil {
  76487. return nil, err
  76488. }
  76489. reqHeaders.Set("Content-Type", "application/json")
  76490. c.urlParams_.Set("alt", alt)
  76491. c.urlParams_.Set("prettyPrint", "false")
  76492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice")
  76493. urls += "?" + c.urlParams_.Encode()
  76494. req, err := http.NewRequest("PATCH", urls, body)
  76495. if err != nil {
  76496. return nil, err
  76497. }
  76498. req.Header = reqHeaders
  76499. googleapi.Expand(req.URL, map[string]string{
  76500. "project": c.project,
  76501. "zone": c.zone,
  76502. "instance": c.instance,
  76503. })
  76504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76505. }
  76506. // Do executes the "compute.instances.updateDisplayDevice" call.
  76507. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76508. // status code is an error. Response headers are in either
  76509. // *Operation.ServerResponse.Header or (if a response was returned at
  76510. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76511. // to check whether the returned error was because
  76512. // http.StatusNotModified was returned.
  76513. func (c *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76514. gensupport.SetOptions(c.urlParams_, opts...)
  76515. res, err := c.doRequest("json")
  76516. if res != nil && res.StatusCode == http.StatusNotModified {
  76517. if res.Body != nil {
  76518. res.Body.Close()
  76519. }
  76520. return nil, &googleapi.Error{
  76521. Code: res.StatusCode,
  76522. Header: res.Header,
  76523. }
  76524. }
  76525. if err != nil {
  76526. return nil, err
  76527. }
  76528. defer googleapi.CloseBody(res)
  76529. if err := googleapi.CheckResponse(res); err != nil {
  76530. return nil, err
  76531. }
  76532. ret := &Operation{
  76533. ServerResponse: googleapi.ServerResponse{
  76534. Header: res.Header,
  76535. HTTPStatusCode: res.StatusCode,
  76536. },
  76537. }
  76538. target := &ret
  76539. if err := gensupport.DecodeResponse(target, res); err != nil {
  76540. return nil, err
  76541. }
  76542. return ret, nil
  76543. // {
  76544. // "description": "Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  76545. // "httpMethod": "PATCH",
  76546. // "id": "compute.instances.updateDisplayDevice",
  76547. // "parameterOrder": [
  76548. // "project",
  76549. // "zone",
  76550. // "instance"
  76551. // ],
  76552. // "parameters": {
  76553. // "instance": {
  76554. // "description": "Name of the instance scoping this request.",
  76555. // "location": "path",
  76556. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76557. // "required": true,
  76558. // "type": "string"
  76559. // },
  76560. // "project": {
  76561. // "description": "Project ID for this request.",
  76562. // "location": "path",
  76563. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76564. // "required": true,
  76565. // "type": "string"
  76566. // },
  76567. // "requestId": {
  76568. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76569. // "location": "query",
  76570. // "type": "string"
  76571. // },
  76572. // "zone": {
  76573. // "description": "The name of the zone for this request.",
  76574. // "location": "path",
  76575. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76576. // "required": true,
  76577. // "type": "string"
  76578. // }
  76579. // },
  76580. // "path": "{project}/zones/{zone}/instances/{instance}/updateDisplayDevice",
  76581. // "request": {
  76582. // "$ref": "DisplayDevice"
  76583. // },
  76584. // "response": {
  76585. // "$ref": "Operation"
  76586. // },
  76587. // "scopes": [
  76588. // "https://www.googleapis.com/auth/cloud-platform",
  76589. // "https://www.googleapis.com/auth/compute"
  76590. // ]
  76591. // }
  76592. }
  76593. // method id "compute.instances.updateNetworkInterface":
  76594. type InstancesUpdateNetworkInterfaceCall struct {
  76595. s *Service
  76596. project string
  76597. zone string
  76598. instance string
  76599. networkinterface *NetworkInterface
  76600. urlParams_ gensupport.URLParams
  76601. ctx_ context.Context
  76602. header_ http.Header
  76603. }
  76604. // UpdateNetworkInterface: Updates an instance's network interface. This
  76605. // method follows PATCH semantics.
  76606. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  76607. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76608. c.project = project
  76609. c.zone = zone
  76610. c.instance = instance
  76611. c.urlParams_.Set("networkInterface", networkInterface)
  76612. c.networkinterface = networkinterface
  76613. return c
  76614. }
  76615. // RequestId sets the optional parameter "requestId": An optional
  76616. // request ID to identify requests. Specify a unique request ID so that
  76617. // if you must retry your request, the server will know to ignore the
  76618. // request if it has already been completed.
  76619. //
  76620. // For example, consider a situation where you make an initial request
  76621. // and the request times out. If you make the request again with the
  76622. // same request ID, the server can check if original operation with the
  76623. // same request ID was received, and if so, will ignore the second
  76624. // request. This prevents clients from accidentally creating duplicate
  76625. // commitments.
  76626. //
  76627. // The request ID must be a valid UUID with the exception that zero UUID
  76628. // is not supported (00000000-0000-0000-0000-000000000000).
  76629. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  76630. c.urlParams_.Set("requestId", requestId)
  76631. return c
  76632. }
  76633. // Fields allows partial responses to be retrieved. See
  76634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76635. // for more information.
  76636. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  76637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76638. return c
  76639. }
  76640. // Context sets the context to be used in this call's Do method. Any
  76641. // pending HTTP request will be aborted if the provided context is
  76642. // canceled.
  76643. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  76644. c.ctx_ = ctx
  76645. return c
  76646. }
  76647. // Header returns an http.Header that can be modified by the caller to
  76648. // add HTTP headers to the request.
  76649. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  76650. if c.header_ == nil {
  76651. c.header_ = make(http.Header)
  76652. }
  76653. return c.header_
  76654. }
  76655. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  76656. reqHeaders := make(http.Header)
  76657. for k, v := range c.header_ {
  76658. reqHeaders[k] = v
  76659. }
  76660. reqHeaders.Set("User-Agent", c.s.userAgent())
  76661. var body io.Reader = nil
  76662. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  76663. if err != nil {
  76664. return nil, err
  76665. }
  76666. reqHeaders.Set("Content-Type", "application/json")
  76667. c.urlParams_.Set("alt", alt)
  76668. c.urlParams_.Set("prettyPrint", "false")
  76669. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  76670. urls += "?" + c.urlParams_.Encode()
  76671. req, err := http.NewRequest("PATCH", urls, body)
  76672. if err != nil {
  76673. return nil, err
  76674. }
  76675. req.Header = reqHeaders
  76676. googleapi.Expand(req.URL, map[string]string{
  76677. "project": c.project,
  76678. "zone": c.zone,
  76679. "instance": c.instance,
  76680. })
  76681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76682. }
  76683. // Do executes the "compute.instances.updateNetworkInterface" call.
  76684. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76685. // status code is an error. Response headers are in either
  76686. // *Operation.ServerResponse.Header or (if a response was returned at
  76687. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76688. // to check whether the returned error was because
  76689. // http.StatusNotModified was returned.
  76690. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76691. gensupport.SetOptions(c.urlParams_, opts...)
  76692. res, err := c.doRequest("json")
  76693. if res != nil && res.StatusCode == http.StatusNotModified {
  76694. if res.Body != nil {
  76695. res.Body.Close()
  76696. }
  76697. return nil, &googleapi.Error{
  76698. Code: res.StatusCode,
  76699. Header: res.Header,
  76700. }
  76701. }
  76702. if err != nil {
  76703. return nil, err
  76704. }
  76705. defer googleapi.CloseBody(res)
  76706. if err := googleapi.CheckResponse(res); err != nil {
  76707. return nil, err
  76708. }
  76709. ret := &Operation{
  76710. ServerResponse: googleapi.ServerResponse{
  76711. Header: res.Header,
  76712. HTTPStatusCode: res.StatusCode,
  76713. },
  76714. }
  76715. target := &ret
  76716. if err := gensupport.DecodeResponse(target, res); err != nil {
  76717. return nil, err
  76718. }
  76719. return ret, nil
  76720. // {
  76721. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  76722. // "httpMethod": "PATCH",
  76723. // "id": "compute.instances.updateNetworkInterface",
  76724. // "parameterOrder": [
  76725. // "project",
  76726. // "zone",
  76727. // "instance",
  76728. // "networkInterface"
  76729. // ],
  76730. // "parameters": {
  76731. // "instance": {
  76732. // "description": "The instance name for this request.",
  76733. // "location": "path",
  76734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76735. // "required": true,
  76736. // "type": "string"
  76737. // },
  76738. // "networkInterface": {
  76739. // "description": "The name of the network interface to update.",
  76740. // "location": "query",
  76741. // "required": true,
  76742. // "type": "string"
  76743. // },
  76744. // "project": {
  76745. // "description": "Project ID for this request.",
  76746. // "location": "path",
  76747. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76748. // "required": true,
  76749. // "type": "string"
  76750. // },
  76751. // "requestId": {
  76752. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76753. // "location": "query",
  76754. // "type": "string"
  76755. // },
  76756. // "zone": {
  76757. // "description": "The name of the zone for this request.",
  76758. // "location": "path",
  76759. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76760. // "required": true,
  76761. // "type": "string"
  76762. // }
  76763. // },
  76764. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  76765. // "request": {
  76766. // "$ref": "NetworkInterface"
  76767. // },
  76768. // "response": {
  76769. // "$ref": "Operation"
  76770. // },
  76771. // "scopes": [
  76772. // "https://www.googleapis.com/auth/cloud-platform",
  76773. // "https://www.googleapis.com/auth/compute"
  76774. // ]
  76775. // }
  76776. }
  76777. // method id "compute.instances.updateShieldedInstanceConfig":
  76778. type InstancesUpdateShieldedInstanceConfigCall struct {
  76779. s *Service
  76780. project string
  76781. zone string
  76782. instance string
  76783. shieldedinstanceconfig *ShieldedInstanceConfig
  76784. urlParams_ gensupport.URLParams
  76785. ctx_ context.Context
  76786. header_ http.Header
  76787. }
  76788. // UpdateShieldedInstanceConfig: Updates the Shielded Instance config
  76789. // for an instance. You can only use this method on a stopped instance.
  76790. // This method supports PATCH semantics and uses the JSON merge patch
  76791. // format and processing rules.
  76792. func (r *InstancesService) UpdateShieldedInstanceConfig(project string, zone string, instance string, shieldedinstanceconfig *ShieldedInstanceConfig) *InstancesUpdateShieldedInstanceConfigCall {
  76793. c := &InstancesUpdateShieldedInstanceConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76794. c.project = project
  76795. c.zone = zone
  76796. c.instance = instance
  76797. c.shieldedinstanceconfig = shieldedinstanceconfig
  76798. return c
  76799. }
  76800. // RequestId sets the optional parameter "requestId": An optional
  76801. // request ID to identify requests. Specify a unique request ID so that
  76802. // if you must retry your request, the server will know to ignore the
  76803. // request if it has already been completed.
  76804. //
  76805. // For example, consider a situation where you make an initial request
  76806. // and the request times out. If you make the request again with the
  76807. // same request ID, the server can check if original operation with the
  76808. // same request ID was received, and if so, will ignore the second
  76809. // request. This prevents clients from accidentally creating duplicate
  76810. // commitments.
  76811. //
  76812. // The request ID must be a valid UUID with the exception that zero UUID
  76813. // is not supported (00000000-0000-0000-0000-000000000000).
  76814. func (c *InstancesUpdateShieldedInstanceConfigCall) RequestId(requestId string) *InstancesUpdateShieldedInstanceConfigCall {
  76815. c.urlParams_.Set("requestId", requestId)
  76816. return c
  76817. }
  76818. // Fields allows partial responses to be retrieved. See
  76819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76820. // for more information.
  76821. func (c *InstancesUpdateShieldedInstanceConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedInstanceConfigCall {
  76822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76823. return c
  76824. }
  76825. // Context sets the context to be used in this call's Do method. Any
  76826. // pending HTTP request will be aborted if the provided context is
  76827. // canceled.
  76828. func (c *InstancesUpdateShieldedInstanceConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedInstanceConfigCall {
  76829. c.ctx_ = ctx
  76830. return c
  76831. }
  76832. // Header returns an http.Header that can be modified by the caller to
  76833. // add HTTP headers to the request.
  76834. func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header {
  76835. if c.header_ == nil {
  76836. c.header_ = make(http.Header)
  76837. }
  76838. return c.header_
  76839. }
  76840. func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) {
  76841. reqHeaders := make(http.Header)
  76842. for k, v := range c.header_ {
  76843. reqHeaders[k] = v
  76844. }
  76845. reqHeaders.Set("User-Agent", c.s.userAgent())
  76846. var body io.Reader = nil
  76847. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig)
  76848. if err != nil {
  76849. return nil, err
  76850. }
  76851. reqHeaders.Set("Content-Type", "application/json")
  76852. c.urlParams_.Set("alt", alt)
  76853. c.urlParams_.Set("prettyPrint", "false")
  76854. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig")
  76855. urls += "?" + c.urlParams_.Encode()
  76856. req, err := http.NewRequest("PATCH", urls, body)
  76857. if err != nil {
  76858. return nil, err
  76859. }
  76860. req.Header = reqHeaders
  76861. googleapi.Expand(req.URL, map[string]string{
  76862. "project": c.project,
  76863. "zone": c.zone,
  76864. "instance": c.instance,
  76865. })
  76866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76867. }
  76868. // Do executes the "compute.instances.updateShieldedInstanceConfig" call.
  76869. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76870. // status code is an error. Response headers are in either
  76871. // *Operation.ServerResponse.Header or (if a response was returned at
  76872. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76873. // to check whether the returned error was because
  76874. // http.StatusNotModified was returned.
  76875. func (c *InstancesUpdateShieldedInstanceConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76876. gensupport.SetOptions(c.urlParams_, opts...)
  76877. res, err := c.doRequest("json")
  76878. if res != nil && res.StatusCode == http.StatusNotModified {
  76879. if res.Body != nil {
  76880. res.Body.Close()
  76881. }
  76882. return nil, &googleapi.Error{
  76883. Code: res.StatusCode,
  76884. Header: res.Header,
  76885. }
  76886. }
  76887. if err != nil {
  76888. return nil, err
  76889. }
  76890. defer googleapi.CloseBody(res)
  76891. if err := googleapi.CheckResponse(res); err != nil {
  76892. return nil, err
  76893. }
  76894. ret := &Operation{
  76895. ServerResponse: googleapi.ServerResponse{
  76896. Header: res.Header,
  76897. HTTPStatusCode: res.StatusCode,
  76898. },
  76899. }
  76900. target := &ret
  76901. if err := gensupport.DecodeResponse(target, res); err != nil {
  76902. return nil, err
  76903. }
  76904. return ret, nil
  76905. // {
  76906. // "description": "Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  76907. // "httpMethod": "PATCH",
  76908. // "id": "compute.instances.updateShieldedInstanceConfig",
  76909. // "parameterOrder": [
  76910. // "project",
  76911. // "zone",
  76912. // "instance"
  76913. // ],
  76914. // "parameters": {
  76915. // "instance": {
  76916. // "description": "Name or id of the instance scoping this request.",
  76917. // "location": "path",
  76918. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  76919. // "required": true,
  76920. // "type": "string"
  76921. // },
  76922. // "project": {
  76923. // "description": "Project ID for this request.",
  76924. // "location": "path",
  76925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76926. // "required": true,
  76927. // "type": "string"
  76928. // },
  76929. // "requestId": {
  76930. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76931. // "location": "query",
  76932. // "type": "string"
  76933. // },
  76934. // "zone": {
  76935. // "description": "The name of the zone for this request.",
  76936. // "location": "path",
  76937. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  76938. // "required": true,
  76939. // "type": "string"
  76940. // }
  76941. // },
  76942. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig",
  76943. // "request": {
  76944. // "$ref": "ShieldedInstanceConfig"
  76945. // },
  76946. // "response": {
  76947. // "$ref": "Operation"
  76948. // },
  76949. // "scopes": [
  76950. // "https://www.googleapis.com/auth/cloud-platform",
  76951. // "https://www.googleapis.com/auth/compute"
  76952. // ]
  76953. // }
  76954. }
  76955. // method id "compute.instances.updateShieldedVmConfig":
  76956. type InstancesUpdateShieldedVmConfigCall struct {
  76957. s *Service
  76958. project string
  76959. zone string
  76960. instance string
  76961. shieldedvmconfig *ShieldedVmConfig
  76962. urlParams_ gensupport.URLParams
  76963. ctx_ context.Context
  76964. header_ http.Header
  76965. }
  76966. // UpdateShieldedVmConfig: Updates the Shielded VM config for a VM
  76967. // instance. You can only use this method on a stopped VM instance. This
  76968. // method supports PATCH semantics and uses the JSON merge patch format
  76969. // and processing rules.
  76970. func (r *InstancesService) UpdateShieldedVmConfig(project string, zone string, instance string, shieldedvmconfig *ShieldedVmConfig) *InstancesUpdateShieldedVmConfigCall {
  76971. c := &InstancesUpdateShieldedVmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76972. c.project = project
  76973. c.zone = zone
  76974. c.instance = instance
  76975. c.shieldedvmconfig = shieldedvmconfig
  76976. return c
  76977. }
  76978. // RequestId sets the optional parameter "requestId": An optional
  76979. // request ID to identify requests. Specify a unique request ID so that
  76980. // if you must retry your request, the server will know to ignore the
  76981. // request if it has already been completed.
  76982. //
  76983. // For example, consider a situation where you make an initial request
  76984. // and the request times out. If you make the request again with the
  76985. // same request ID, the server can check if original operation with the
  76986. // same request ID was received, and if so, will ignore the second
  76987. // request. This prevents clients from accidentally creating duplicate
  76988. // commitments.
  76989. //
  76990. // The request ID must be a valid UUID with the exception that zero UUID
  76991. // is not supported (00000000-0000-0000-0000-000000000000).
  76992. func (c *InstancesUpdateShieldedVmConfigCall) RequestId(requestId string) *InstancesUpdateShieldedVmConfigCall {
  76993. c.urlParams_.Set("requestId", requestId)
  76994. return c
  76995. }
  76996. // Fields allows partial responses to be retrieved. See
  76997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76998. // for more information.
  76999. func (c *InstancesUpdateShieldedVmConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedVmConfigCall {
  77000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77001. return c
  77002. }
  77003. // Context sets the context to be used in this call's Do method. Any
  77004. // pending HTTP request will be aborted if the provided context is
  77005. // canceled.
  77006. func (c *InstancesUpdateShieldedVmConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedVmConfigCall {
  77007. c.ctx_ = ctx
  77008. return c
  77009. }
  77010. // Header returns an http.Header that can be modified by the caller to
  77011. // add HTTP headers to the request.
  77012. func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header {
  77013. if c.header_ == nil {
  77014. c.header_ = make(http.Header)
  77015. }
  77016. return c.header_
  77017. }
  77018. func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) {
  77019. reqHeaders := make(http.Header)
  77020. for k, v := range c.header_ {
  77021. reqHeaders[k] = v
  77022. }
  77023. reqHeaders.Set("User-Agent", c.s.userAgent())
  77024. var body io.Reader = nil
  77025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig)
  77026. if err != nil {
  77027. return nil, err
  77028. }
  77029. reqHeaders.Set("Content-Type", "application/json")
  77030. c.urlParams_.Set("alt", alt)
  77031. c.urlParams_.Set("prettyPrint", "false")
  77032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig")
  77033. urls += "?" + c.urlParams_.Encode()
  77034. req, err := http.NewRequest("PATCH", urls, body)
  77035. if err != nil {
  77036. return nil, err
  77037. }
  77038. req.Header = reqHeaders
  77039. googleapi.Expand(req.URL, map[string]string{
  77040. "project": c.project,
  77041. "zone": c.zone,
  77042. "instance": c.instance,
  77043. })
  77044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77045. }
  77046. // Do executes the "compute.instances.updateShieldedVmConfig" call.
  77047. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77048. // status code is an error. Response headers are in either
  77049. // *Operation.ServerResponse.Header or (if a response was returned at
  77050. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77051. // to check whether the returned error was because
  77052. // http.StatusNotModified was returned.
  77053. func (c *InstancesUpdateShieldedVmConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77054. gensupport.SetOptions(c.urlParams_, opts...)
  77055. res, err := c.doRequest("json")
  77056. if res != nil && res.StatusCode == http.StatusNotModified {
  77057. if res.Body != nil {
  77058. res.Body.Close()
  77059. }
  77060. return nil, &googleapi.Error{
  77061. Code: res.StatusCode,
  77062. Header: res.Header,
  77063. }
  77064. }
  77065. if err != nil {
  77066. return nil, err
  77067. }
  77068. defer googleapi.CloseBody(res)
  77069. if err := googleapi.CheckResponse(res); err != nil {
  77070. return nil, err
  77071. }
  77072. ret := &Operation{
  77073. ServerResponse: googleapi.ServerResponse{
  77074. Header: res.Header,
  77075. HTTPStatusCode: res.StatusCode,
  77076. },
  77077. }
  77078. target := &ret
  77079. if err := gensupport.DecodeResponse(target, res); err != nil {
  77080. return nil, err
  77081. }
  77082. return ret, nil
  77083. // {
  77084. // "description": "Updates the Shielded VM config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  77085. // "httpMethod": "PATCH",
  77086. // "id": "compute.instances.updateShieldedVmConfig",
  77087. // "parameterOrder": [
  77088. // "project",
  77089. // "zone",
  77090. // "instance"
  77091. // ],
  77092. // "parameters": {
  77093. // "instance": {
  77094. // "description": "Name of the instance scoping this request.",
  77095. // "location": "path",
  77096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77097. // "required": true,
  77098. // "type": "string"
  77099. // },
  77100. // "project": {
  77101. // "description": "Project ID for this request.",
  77102. // "location": "path",
  77103. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77104. // "required": true,
  77105. // "type": "string"
  77106. // },
  77107. // "requestId": {
  77108. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77109. // "location": "query",
  77110. // "type": "string"
  77111. // },
  77112. // "zone": {
  77113. // "description": "The name of the zone for this request.",
  77114. // "location": "path",
  77115. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77116. // "required": true,
  77117. // "type": "string"
  77118. // }
  77119. // },
  77120. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig",
  77121. // "request": {
  77122. // "$ref": "ShieldedVmConfig"
  77123. // },
  77124. // "response": {
  77125. // "$ref": "Operation"
  77126. // },
  77127. // "scopes": [
  77128. // "https://www.googleapis.com/auth/cloud-platform",
  77129. // "https://www.googleapis.com/auth/compute"
  77130. // ]
  77131. // }
  77132. }
  77133. // method id "compute.interconnectAttachments.aggregatedList":
  77134. type InterconnectAttachmentsAggregatedListCall struct {
  77135. s *Service
  77136. project string
  77137. urlParams_ gensupport.URLParams
  77138. ifNoneMatch_ string
  77139. ctx_ context.Context
  77140. header_ http.Header
  77141. }
  77142. // AggregatedList: Retrieves an aggregated list of interconnect
  77143. // attachments.
  77144. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  77145. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77146. c.project = project
  77147. return c
  77148. }
  77149. // Filter sets the optional parameter "filter": A filter expression that
  77150. // filters resources listed in the response. The expression must specify
  77151. // the field name, a comparison operator, and the value that you want to
  77152. // use for filtering. The value must be a string, a number, or a
  77153. // boolean. The comparison operator must be either =, !=, >, or <.
  77154. //
  77155. // For example, if you are filtering Compute Engine instances, you can
  77156. // exclude instances named example-instance by specifying name !=
  77157. // example-instance.
  77158. //
  77159. // You can also filter nested fields. For example, you could specify
  77160. // scheduling.automaticRestart = false to include instances only if they
  77161. // are not scheduled for automatic restarts. You can use filtering on
  77162. // nested fields to filter based on resource labels.
  77163. //
  77164. // To filter on multiple expressions, provide each separate expression
  77165. // within parentheses. For example, (scheduling.automaticRestart = true)
  77166. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  77167. // AND expression. However, you can include AND and OR expressions
  77168. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  77169. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  77170. // true).
  77171. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  77172. c.urlParams_.Set("filter", filter)
  77173. return c
  77174. }
  77175. // MaxResults sets the optional parameter "maxResults": The maximum
  77176. // number of results per page that should be returned. If the number of
  77177. // available results is larger than maxResults, Compute Engine returns a
  77178. // nextPageToken that can be used to get the next page of results in
  77179. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  77180. // (Default: 500)
  77181. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  77182. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  77183. return c
  77184. }
  77185. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  77186. // a certain order. By default, results are returned in alphanumerical
  77187. // order based on the resource name.
  77188. //
  77189. // You can also sort results in descending order based on the creation
  77190. // timestamp using orderBy="creationTimestamp desc". This sorts results
  77191. // based on the creationTimestamp field in reverse chronological order
  77192. // (newest result first). Use this to sort resources like operations so
  77193. // that the newest operation is returned first.
  77194. //
  77195. // Currently, only sorting by name or creationTimestamp desc is
  77196. // supported.
  77197. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  77198. c.urlParams_.Set("orderBy", orderBy)
  77199. return c
  77200. }
  77201. // PageToken sets the optional parameter "pageToken": Specifies a page
  77202. // token to use. Set pageToken to the nextPageToken returned by a
  77203. // previous list request to get the next page of results.
  77204. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  77205. c.urlParams_.Set("pageToken", pageToken)
  77206. return c
  77207. }
  77208. // Fields allows partial responses to be retrieved. See
  77209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77210. // for more information.
  77211. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  77212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77213. return c
  77214. }
  77215. // IfNoneMatch sets the optional parameter which makes the operation
  77216. // fail if the object's ETag matches the given value. This is useful for
  77217. // getting updates only after the object has changed since the last
  77218. // request. Use googleapi.IsNotModified to check whether the response
  77219. // error from Do is the result of In-None-Match.
  77220. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  77221. c.ifNoneMatch_ = entityTag
  77222. return c
  77223. }
  77224. // Context sets the context to be used in this call's Do method. Any
  77225. // pending HTTP request will be aborted if the provided context is
  77226. // canceled.
  77227. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  77228. c.ctx_ = ctx
  77229. return c
  77230. }
  77231. // Header returns an http.Header that can be modified by the caller to
  77232. // add HTTP headers to the request.
  77233. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  77234. if c.header_ == nil {
  77235. c.header_ = make(http.Header)
  77236. }
  77237. return c.header_
  77238. }
  77239. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  77240. reqHeaders := make(http.Header)
  77241. for k, v := range c.header_ {
  77242. reqHeaders[k] = v
  77243. }
  77244. reqHeaders.Set("User-Agent", c.s.userAgent())
  77245. if c.ifNoneMatch_ != "" {
  77246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77247. }
  77248. var body io.Reader = nil
  77249. c.urlParams_.Set("alt", alt)
  77250. c.urlParams_.Set("prettyPrint", "false")
  77251. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  77252. urls += "?" + c.urlParams_.Encode()
  77253. req, err := http.NewRequest("GET", urls, body)
  77254. if err != nil {
  77255. return nil, err
  77256. }
  77257. req.Header = reqHeaders
  77258. googleapi.Expand(req.URL, map[string]string{
  77259. "project": c.project,
  77260. })
  77261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77262. }
  77263. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  77264. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  77265. // non-nil. Any non-2xx status code is an error. Response headers are in
  77266. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  77267. // (if a response was returned at all) in
  77268. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  77269. // whether the returned error was because http.StatusNotModified was
  77270. // returned.
  77271. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  77272. gensupport.SetOptions(c.urlParams_, opts...)
  77273. res, err := c.doRequest("json")
  77274. if res != nil && res.StatusCode == http.StatusNotModified {
  77275. if res.Body != nil {
  77276. res.Body.Close()
  77277. }
  77278. return nil, &googleapi.Error{
  77279. Code: res.StatusCode,
  77280. Header: res.Header,
  77281. }
  77282. }
  77283. if err != nil {
  77284. return nil, err
  77285. }
  77286. defer googleapi.CloseBody(res)
  77287. if err := googleapi.CheckResponse(res); err != nil {
  77288. return nil, err
  77289. }
  77290. ret := &InterconnectAttachmentAggregatedList{
  77291. ServerResponse: googleapi.ServerResponse{
  77292. Header: res.Header,
  77293. HTTPStatusCode: res.StatusCode,
  77294. },
  77295. }
  77296. target := &ret
  77297. if err := gensupport.DecodeResponse(target, res); err != nil {
  77298. return nil, err
  77299. }
  77300. return ret, nil
  77301. // {
  77302. // "description": "Retrieves an aggregated list of interconnect attachments.",
  77303. // "httpMethod": "GET",
  77304. // "id": "compute.interconnectAttachments.aggregatedList",
  77305. // "parameterOrder": [
  77306. // "project"
  77307. // ],
  77308. // "parameters": {
  77309. // "filter": {
  77310. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  77311. // "location": "query",
  77312. // "type": "string"
  77313. // },
  77314. // "maxResults": {
  77315. // "default": "500",
  77316. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  77317. // "format": "uint32",
  77318. // "location": "query",
  77319. // "minimum": "0",
  77320. // "type": "integer"
  77321. // },
  77322. // "orderBy": {
  77323. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  77324. // "location": "query",
  77325. // "type": "string"
  77326. // },
  77327. // "pageToken": {
  77328. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  77329. // "location": "query",
  77330. // "type": "string"
  77331. // },
  77332. // "project": {
  77333. // "description": "Project ID for this request.",
  77334. // "location": "path",
  77335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77336. // "required": true,
  77337. // "type": "string"
  77338. // }
  77339. // },
  77340. // "path": "{project}/aggregated/interconnectAttachments",
  77341. // "response": {
  77342. // "$ref": "InterconnectAttachmentAggregatedList"
  77343. // },
  77344. // "scopes": [
  77345. // "https://www.googleapis.com/auth/cloud-platform",
  77346. // "https://www.googleapis.com/auth/compute",
  77347. // "https://www.googleapis.com/auth/compute.readonly"
  77348. // ]
  77349. // }
  77350. }
  77351. // Pages invokes f for each page of results.
  77352. // A non-nil error returned from f will halt the iteration.
  77353. // The provided context supersedes any context provided to the Context method.
  77354. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  77355. c.ctx_ = ctx
  77356. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  77357. for {
  77358. x, err := c.Do()
  77359. if err != nil {
  77360. return err
  77361. }
  77362. if err := f(x); err != nil {
  77363. return err
  77364. }
  77365. if x.NextPageToken == "" {
  77366. return nil
  77367. }
  77368. c.PageToken(x.NextPageToken)
  77369. }
  77370. }
  77371. // method id "compute.interconnectAttachments.delete":
  77372. type InterconnectAttachmentsDeleteCall struct {
  77373. s *Service
  77374. project string
  77375. region string
  77376. interconnectAttachment string
  77377. urlParams_ gensupport.URLParams
  77378. ctx_ context.Context
  77379. header_ http.Header
  77380. }
  77381. // Delete: Deletes the specified interconnect attachment.
  77382. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  77383. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77384. c.project = project
  77385. c.region = region
  77386. c.interconnectAttachment = interconnectAttachment
  77387. return c
  77388. }
  77389. // RequestId sets the optional parameter "requestId": An optional
  77390. // request ID to identify requests. Specify a unique request ID so that
  77391. // if you must retry your request, the server will know to ignore the
  77392. // request if it has already been completed.
  77393. //
  77394. // For example, consider a situation where you make an initial request
  77395. // and the request times out. If you make the request again with the
  77396. // same request ID, the server can check if original operation with the
  77397. // same request ID was received, and if so, will ignore the second
  77398. // request. This prevents clients from accidentally creating duplicate
  77399. // commitments.
  77400. //
  77401. // The request ID must be a valid UUID with the exception that zero UUID
  77402. // is not supported (00000000-0000-0000-0000-000000000000).
  77403. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  77404. c.urlParams_.Set("requestId", requestId)
  77405. return c
  77406. }
  77407. // Fields allows partial responses to be retrieved. See
  77408. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77409. // for more information.
  77410. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  77411. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77412. return c
  77413. }
  77414. // Context sets the context to be used in this call's Do method. Any
  77415. // pending HTTP request will be aborted if the provided context is
  77416. // canceled.
  77417. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  77418. c.ctx_ = ctx
  77419. return c
  77420. }
  77421. // Header returns an http.Header that can be modified by the caller to
  77422. // add HTTP headers to the request.
  77423. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  77424. if c.header_ == nil {
  77425. c.header_ = make(http.Header)
  77426. }
  77427. return c.header_
  77428. }
  77429. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  77430. reqHeaders := make(http.Header)
  77431. for k, v := range c.header_ {
  77432. reqHeaders[k] = v
  77433. }
  77434. reqHeaders.Set("User-Agent", c.s.userAgent())
  77435. var body io.Reader = nil
  77436. c.urlParams_.Set("alt", alt)
  77437. c.urlParams_.Set("prettyPrint", "false")
  77438. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  77439. urls += "?" + c.urlParams_.Encode()
  77440. req, err := http.NewRequest("DELETE", urls, body)
  77441. if err != nil {
  77442. return nil, err
  77443. }
  77444. req.Header = reqHeaders
  77445. googleapi.Expand(req.URL, map[string]string{
  77446. "project": c.project,
  77447. "region": c.region,
  77448. "interconnectAttachment": c.interconnectAttachment,
  77449. })
  77450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77451. }
  77452. // Do executes the "compute.interconnectAttachments.delete" call.
  77453. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77454. // status code is an error. Response headers are in either
  77455. // *Operation.ServerResponse.Header or (if a response was returned at
  77456. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77457. // to check whether the returned error was because
  77458. // http.StatusNotModified was returned.
  77459. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77460. gensupport.SetOptions(c.urlParams_, opts...)
  77461. res, err := c.doRequest("json")
  77462. if res != nil && res.StatusCode == http.StatusNotModified {
  77463. if res.Body != nil {
  77464. res.Body.Close()
  77465. }
  77466. return nil, &googleapi.Error{
  77467. Code: res.StatusCode,
  77468. Header: res.Header,
  77469. }
  77470. }
  77471. if err != nil {
  77472. return nil, err
  77473. }
  77474. defer googleapi.CloseBody(res)
  77475. if err := googleapi.CheckResponse(res); err != nil {
  77476. return nil, err
  77477. }
  77478. ret := &Operation{
  77479. ServerResponse: googleapi.ServerResponse{
  77480. Header: res.Header,
  77481. HTTPStatusCode: res.StatusCode,
  77482. },
  77483. }
  77484. target := &ret
  77485. if err := gensupport.DecodeResponse(target, res); err != nil {
  77486. return nil, err
  77487. }
  77488. return ret, nil
  77489. // {
  77490. // "description": "Deletes the specified interconnect attachment.",
  77491. // "httpMethod": "DELETE",
  77492. // "id": "compute.interconnectAttachments.delete",
  77493. // "parameterOrder": [
  77494. // "project",
  77495. // "region",
  77496. // "interconnectAttachment"
  77497. // ],
  77498. // "parameters": {
  77499. // "interconnectAttachment": {
  77500. // "description": "Name of the interconnect attachment to delete.",
  77501. // "location": "path",
  77502. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77503. // "required": true,
  77504. // "type": "string"
  77505. // },
  77506. // "project": {
  77507. // "description": "Project ID for this request.",
  77508. // "location": "path",
  77509. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77510. // "required": true,
  77511. // "type": "string"
  77512. // },
  77513. // "region": {
  77514. // "description": "Name of the region for this request.",
  77515. // "location": "path",
  77516. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77517. // "required": true,
  77518. // "type": "string"
  77519. // },
  77520. // "requestId": {
  77521. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77522. // "location": "query",
  77523. // "type": "string"
  77524. // }
  77525. // },
  77526. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  77527. // "response": {
  77528. // "$ref": "Operation"
  77529. // },
  77530. // "scopes": [
  77531. // "https://www.googleapis.com/auth/cloud-platform",
  77532. // "https://www.googleapis.com/auth/compute"
  77533. // ]
  77534. // }
  77535. }
  77536. // method id "compute.interconnectAttachments.get":
  77537. type InterconnectAttachmentsGetCall struct {
  77538. s *Service
  77539. project string
  77540. region string
  77541. interconnectAttachment string
  77542. urlParams_ gensupport.URLParams
  77543. ifNoneMatch_ string
  77544. ctx_ context.Context
  77545. header_ http.Header
  77546. }
  77547. // Get: Returns the specified interconnect attachment.
  77548. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  77549. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77550. c.project = project
  77551. c.region = region
  77552. c.interconnectAttachment = interconnectAttachment
  77553. return c
  77554. }
  77555. // Fields allows partial responses to be retrieved. See
  77556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77557. // for more information.
  77558. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  77559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77560. return c
  77561. }
  77562. // IfNoneMatch sets the optional parameter which makes the operation
  77563. // fail if the object's ETag matches the given value. This is useful for
  77564. // getting updates only after the object has changed since the last
  77565. // request. Use googleapi.IsNotModified to check whether the response
  77566. // error from Do is the result of In-None-Match.
  77567. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  77568. c.ifNoneMatch_ = entityTag
  77569. return c
  77570. }
  77571. // Context sets the context to be used in this call's Do method. Any
  77572. // pending HTTP request will be aborted if the provided context is
  77573. // canceled.
  77574. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  77575. c.ctx_ = ctx
  77576. return c
  77577. }
  77578. // Header returns an http.Header that can be modified by the caller to
  77579. // add HTTP headers to the request.
  77580. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  77581. if c.header_ == nil {
  77582. c.header_ = make(http.Header)
  77583. }
  77584. return c.header_
  77585. }
  77586. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  77587. reqHeaders := make(http.Header)
  77588. for k, v := range c.header_ {
  77589. reqHeaders[k] = v
  77590. }
  77591. reqHeaders.Set("User-Agent", c.s.userAgent())
  77592. if c.ifNoneMatch_ != "" {
  77593. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77594. }
  77595. var body io.Reader = nil
  77596. c.urlParams_.Set("alt", alt)
  77597. c.urlParams_.Set("prettyPrint", "false")
  77598. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  77599. urls += "?" + c.urlParams_.Encode()
  77600. req, err := http.NewRequest("GET", urls, body)
  77601. if err != nil {
  77602. return nil, err
  77603. }
  77604. req.Header = reqHeaders
  77605. googleapi.Expand(req.URL, map[string]string{
  77606. "project": c.project,
  77607. "region": c.region,
  77608. "interconnectAttachment": c.interconnectAttachment,
  77609. })
  77610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77611. }
  77612. // Do executes the "compute.interconnectAttachments.get" call.
  77613. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  77614. // non-2xx status code is an error. Response headers are in either
  77615. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  77616. // returned at all) in error.(*googleapi.Error).Header. Use
  77617. // googleapi.IsNotModified to check whether the returned error was
  77618. // because http.StatusNotModified was returned.
  77619. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  77620. gensupport.SetOptions(c.urlParams_, opts...)
  77621. res, err := c.doRequest("json")
  77622. if res != nil && res.StatusCode == http.StatusNotModified {
  77623. if res.Body != nil {
  77624. res.Body.Close()
  77625. }
  77626. return nil, &googleapi.Error{
  77627. Code: res.StatusCode,
  77628. Header: res.Header,
  77629. }
  77630. }
  77631. if err != nil {
  77632. return nil, err
  77633. }
  77634. defer googleapi.CloseBody(res)
  77635. if err := googleapi.CheckResponse(res); err != nil {
  77636. return nil, err
  77637. }
  77638. ret := &InterconnectAttachment{
  77639. ServerResponse: googleapi.ServerResponse{
  77640. Header: res.Header,
  77641. HTTPStatusCode: res.StatusCode,
  77642. },
  77643. }
  77644. target := &ret
  77645. if err := gensupport.DecodeResponse(target, res); err != nil {
  77646. return nil, err
  77647. }
  77648. return ret, nil
  77649. // {
  77650. // "description": "Returns the specified interconnect attachment.",
  77651. // "httpMethod": "GET",
  77652. // "id": "compute.interconnectAttachments.get",
  77653. // "parameterOrder": [
  77654. // "project",
  77655. // "region",
  77656. // "interconnectAttachment"
  77657. // ],
  77658. // "parameters": {
  77659. // "interconnectAttachment": {
  77660. // "description": "Name of the interconnect attachment to return.",
  77661. // "location": "path",
  77662. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77663. // "required": true,
  77664. // "type": "string"
  77665. // },
  77666. // "project": {
  77667. // "description": "Project ID for this request.",
  77668. // "location": "path",
  77669. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77670. // "required": true,
  77671. // "type": "string"
  77672. // },
  77673. // "region": {
  77674. // "description": "Name of the region for this request.",
  77675. // "location": "path",
  77676. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77677. // "required": true,
  77678. // "type": "string"
  77679. // }
  77680. // },
  77681. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  77682. // "response": {
  77683. // "$ref": "InterconnectAttachment"
  77684. // },
  77685. // "scopes": [
  77686. // "https://www.googleapis.com/auth/cloud-platform",
  77687. // "https://www.googleapis.com/auth/compute",
  77688. // "https://www.googleapis.com/auth/compute.readonly"
  77689. // ]
  77690. // }
  77691. }
  77692. // method id "compute.interconnectAttachments.getIamPolicy":
  77693. type InterconnectAttachmentsGetIamPolicyCall struct {
  77694. s *Service
  77695. project string
  77696. region string
  77697. resource string
  77698. urlParams_ gensupport.URLParams
  77699. ifNoneMatch_ string
  77700. ctx_ context.Context
  77701. header_ http.Header
  77702. }
  77703. // GetIamPolicy: Gets the access control policy for a resource. May be
  77704. // empty if no such policy or resource exists.
  77705. func (r *InterconnectAttachmentsService) GetIamPolicy(project string, region string, resource string) *InterconnectAttachmentsGetIamPolicyCall {
  77706. c := &InterconnectAttachmentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77707. c.project = project
  77708. c.region = region
  77709. c.resource = resource
  77710. return c
  77711. }
  77712. // Fields allows partial responses to be retrieved. See
  77713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77714. // for more information.
  77715. func (c *InterconnectAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetIamPolicyCall {
  77716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77717. return c
  77718. }
  77719. // IfNoneMatch sets the optional parameter which makes the operation
  77720. // fail if the object's ETag matches the given value. This is useful for
  77721. // getting updates only after the object has changed since the last
  77722. // request. Use googleapi.IsNotModified to check whether the response
  77723. // error from Do is the result of In-None-Match.
  77724. func (c *InterconnectAttachmentsGetIamPolicyCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetIamPolicyCall {
  77725. c.ifNoneMatch_ = entityTag
  77726. return c
  77727. }
  77728. // Context sets the context to be used in this call's Do method. Any
  77729. // pending HTTP request will be aborted if the provided context is
  77730. // canceled.
  77731. func (c *InterconnectAttachmentsGetIamPolicyCall) Context(ctx context.Context) *InterconnectAttachmentsGetIamPolicyCall {
  77732. c.ctx_ = ctx
  77733. return c
  77734. }
  77735. // Header returns an http.Header that can be modified by the caller to
  77736. // add HTTP headers to the request.
  77737. func (c *InterconnectAttachmentsGetIamPolicyCall) Header() http.Header {
  77738. if c.header_ == nil {
  77739. c.header_ = make(http.Header)
  77740. }
  77741. return c.header_
  77742. }
  77743. func (c *InterconnectAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  77744. reqHeaders := make(http.Header)
  77745. for k, v := range c.header_ {
  77746. reqHeaders[k] = v
  77747. }
  77748. reqHeaders.Set("User-Agent", c.s.userAgent())
  77749. if c.ifNoneMatch_ != "" {
  77750. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77751. }
  77752. var body io.Reader = nil
  77753. c.urlParams_.Set("alt", alt)
  77754. c.urlParams_.Set("prettyPrint", "false")
  77755. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy")
  77756. urls += "?" + c.urlParams_.Encode()
  77757. req, err := http.NewRequest("GET", urls, body)
  77758. if err != nil {
  77759. return nil, err
  77760. }
  77761. req.Header = reqHeaders
  77762. googleapi.Expand(req.URL, map[string]string{
  77763. "project": c.project,
  77764. "region": c.region,
  77765. "resource": c.resource,
  77766. })
  77767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77768. }
  77769. // Do executes the "compute.interconnectAttachments.getIamPolicy" call.
  77770. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  77771. // code is an error. Response headers are in either
  77772. // *Policy.ServerResponse.Header or (if a response was returned at all)
  77773. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  77774. // check whether the returned error was because http.StatusNotModified
  77775. // was returned.
  77776. func (c *InterconnectAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  77777. gensupport.SetOptions(c.urlParams_, opts...)
  77778. res, err := c.doRequest("json")
  77779. if res != nil && res.StatusCode == http.StatusNotModified {
  77780. if res.Body != nil {
  77781. res.Body.Close()
  77782. }
  77783. return nil, &googleapi.Error{
  77784. Code: res.StatusCode,
  77785. Header: res.Header,
  77786. }
  77787. }
  77788. if err != nil {
  77789. return nil, err
  77790. }
  77791. defer googleapi.CloseBody(res)
  77792. if err := googleapi.CheckResponse(res); err != nil {
  77793. return nil, err
  77794. }
  77795. ret := &Policy{
  77796. ServerResponse: googleapi.ServerResponse{
  77797. Header: res.Header,
  77798. HTTPStatusCode: res.StatusCode,
  77799. },
  77800. }
  77801. target := &ret
  77802. if err := gensupport.DecodeResponse(target, res); err != nil {
  77803. return nil, err
  77804. }
  77805. return ret, nil
  77806. // {
  77807. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  77808. // "httpMethod": "GET",
  77809. // "id": "compute.interconnectAttachments.getIamPolicy",
  77810. // "parameterOrder": [
  77811. // "project",
  77812. // "region",
  77813. // "resource"
  77814. // ],
  77815. // "parameters": {
  77816. // "project": {
  77817. // "description": "Project ID for this request.",
  77818. // "location": "path",
  77819. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77820. // "required": true,
  77821. // "type": "string"
  77822. // },
  77823. // "region": {
  77824. // "description": "The name of the region for this request.",
  77825. // "location": "path",
  77826. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77827. // "required": true,
  77828. // "type": "string"
  77829. // },
  77830. // "resource": {
  77831. // "description": "Name or id of the resource for this request.",
  77832. // "location": "path",
  77833. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  77834. // "required": true,
  77835. // "type": "string"
  77836. // }
  77837. // },
  77838. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy",
  77839. // "response": {
  77840. // "$ref": "Policy"
  77841. // },
  77842. // "scopes": [
  77843. // "https://www.googleapis.com/auth/cloud-platform",
  77844. // "https://www.googleapis.com/auth/compute",
  77845. // "https://www.googleapis.com/auth/compute.readonly"
  77846. // ]
  77847. // }
  77848. }
  77849. // method id "compute.interconnectAttachments.insert":
  77850. type InterconnectAttachmentsInsertCall struct {
  77851. s *Service
  77852. project string
  77853. region string
  77854. interconnectattachment *InterconnectAttachment
  77855. urlParams_ gensupport.URLParams
  77856. ctx_ context.Context
  77857. header_ http.Header
  77858. }
  77859. // Insert: Creates an InterconnectAttachment in the specified project
  77860. // using the data included in the request.
  77861. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  77862. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77863. c.project = project
  77864. c.region = region
  77865. c.interconnectattachment = interconnectattachment
  77866. return c
  77867. }
  77868. // RequestId sets the optional parameter "requestId": An optional
  77869. // request ID to identify requests. Specify a unique request ID so that
  77870. // if you must retry your request, the server will know to ignore the
  77871. // request if it has already been completed.
  77872. //
  77873. // For example, consider a situation where you make an initial request
  77874. // and the request times out. If you make the request again with the
  77875. // same request ID, the server can check if original operation with the
  77876. // same request ID was received, and if so, will ignore the second
  77877. // request. This prevents clients from accidentally creating duplicate
  77878. // commitments.
  77879. //
  77880. // The request ID must be a valid UUID with the exception that zero UUID
  77881. // is not supported (00000000-0000-0000-0000-000000000000).
  77882. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  77883. c.urlParams_.Set("requestId", requestId)
  77884. return c
  77885. }
  77886. // Fields allows partial responses to be retrieved. See
  77887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77888. // for more information.
  77889. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  77890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77891. return c
  77892. }
  77893. // Context sets the context to be used in this call's Do method. Any
  77894. // pending HTTP request will be aborted if the provided context is
  77895. // canceled.
  77896. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  77897. c.ctx_ = ctx
  77898. return c
  77899. }
  77900. // Header returns an http.Header that can be modified by the caller to
  77901. // add HTTP headers to the request.
  77902. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  77903. if c.header_ == nil {
  77904. c.header_ = make(http.Header)
  77905. }
  77906. return c.header_
  77907. }
  77908. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  77909. reqHeaders := make(http.Header)
  77910. for k, v := range c.header_ {
  77911. reqHeaders[k] = v
  77912. }
  77913. reqHeaders.Set("User-Agent", c.s.userAgent())
  77914. var body io.Reader = nil
  77915. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  77916. if err != nil {
  77917. return nil, err
  77918. }
  77919. reqHeaders.Set("Content-Type", "application/json")
  77920. c.urlParams_.Set("alt", alt)
  77921. c.urlParams_.Set("prettyPrint", "false")
  77922. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  77923. urls += "?" + c.urlParams_.Encode()
  77924. req, err := http.NewRequest("POST", urls, body)
  77925. if err != nil {
  77926. return nil, err
  77927. }
  77928. req.Header = reqHeaders
  77929. googleapi.Expand(req.URL, map[string]string{
  77930. "project": c.project,
  77931. "region": c.region,
  77932. })
  77933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77934. }
  77935. // Do executes the "compute.interconnectAttachments.insert" call.
  77936. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77937. // status code is an error. Response headers are in either
  77938. // *Operation.ServerResponse.Header or (if a response was returned at
  77939. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77940. // to check whether the returned error was because
  77941. // http.StatusNotModified was returned.
  77942. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77943. gensupport.SetOptions(c.urlParams_, opts...)
  77944. res, err := c.doRequest("json")
  77945. if res != nil && res.StatusCode == http.StatusNotModified {
  77946. if res.Body != nil {
  77947. res.Body.Close()
  77948. }
  77949. return nil, &googleapi.Error{
  77950. Code: res.StatusCode,
  77951. Header: res.Header,
  77952. }
  77953. }
  77954. if err != nil {
  77955. return nil, err
  77956. }
  77957. defer googleapi.CloseBody(res)
  77958. if err := googleapi.CheckResponse(res); err != nil {
  77959. return nil, err
  77960. }
  77961. ret := &Operation{
  77962. ServerResponse: googleapi.ServerResponse{
  77963. Header: res.Header,
  77964. HTTPStatusCode: res.StatusCode,
  77965. },
  77966. }
  77967. target := &ret
  77968. if err := gensupport.DecodeResponse(target, res); err != nil {
  77969. return nil, err
  77970. }
  77971. return ret, nil
  77972. // {
  77973. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  77974. // "httpMethod": "POST",
  77975. // "id": "compute.interconnectAttachments.insert",
  77976. // "parameterOrder": [
  77977. // "project",
  77978. // "region"
  77979. // ],
  77980. // "parameters": {
  77981. // "project": {
  77982. // "description": "Project ID for this request.",
  77983. // "location": "path",
  77984. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77985. // "required": true,
  77986. // "type": "string"
  77987. // },
  77988. // "region": {
  77989. // "description": "Name of the region for this request.",
  77990. // "location": "path",
  77991. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77992. // "required": true,
  77993. // "type": "string"
  77994. // },
  77995. // "requestId": {
  77996. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77997. // "location": "query",
  77998. // "type": "string"
  77999. // }
  78000. // },
  78001. // "path": "{project}/regions/{region}/interconnectAttachments",
  78002. // "request": {
  78003. // "$ref": "InterconnectAttachment"
  78004. // },
  78005. // "response": {
  78006. // "$ref": "Operation"
  78007. // },
  78008. // "scopes": [
  78009. // "https://www.googleapis.com/auth/cloud-platform",
  78010. // "https://www.googleapis.com/auth/compute"
  78011. // ]
  78012. // }
  78013. }
  78014. // method id "compute.interconnectAttachments.list":
  78015. type InterconnectAttachmentsListCall struct {
  78016. s *Service
  78017. project string
  78018. region string
  78019. urlParams_ gensupport.URLParams
  78020. ifNoneMatch_ string
  78021. ctx_ context.Context
  78022. header_ http.Header
  78023. }
  78024. // List: Retrieves the list of interconnect attachments contained within
  78025. // the specified region.
  78026. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  78027. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78028. c.project = project
  78029. c.region = region
  78030. return c
  78031. }
  78032. // Filter sets the optional parameter "filter": A filter expression that
  78033. // filters resources listed in the response. The expression must specify
  78034. // the field name, a comparison operator, and the value that you want to
  78035. // use for filtering. The value must be a string, a number, or a
  78036. // boolean. The comparison operator must be either =, !=, >, or <.
  78037. //
  78038. // For example, if you are filtering Compute Engine instances, you can
  78039. // exclude instances named example-instance by specifying name !=
  78040. // example-instance.
  78041. //
  78042. // You can also filter nested fields. For example, you could specify
  78043. // scheduling.automaticRestart = false to include instances only if they
  78044. // are not scheduled for automatic restarts. You can use filtering on
  78045. // nested fields to filter based on resource labels.
  78046. //
  78047. // To filter on multiple expressions, provide each separate expression
  78048. // within parentheses. For example, (scheduling.automaticRestart = true)
  78049. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78050. // AND expression. However, you can include AND and OR expressions
  78051. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78052. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78053. // true).
  78054. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  78055. c.urlParams_.Set("filter", filter)
  78056. return c
  78057. }
  78058. // MaxResults sets the optional parameter "maxResults": The maximum
  78059. // number of results per page that should be returned. If the number of
  78060. // available results is larger than maxResults, Compute Engine returns a
  78061. // nextPageToken that can be used to get the next page of results in
  78062. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78063. // (Default: 500)
  78064. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  78065. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78066. return c
  78067. }
  78068. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78069. // a certain order. By default, results are returned in alphanumerical
  78070. // order based on the resource name.
  78071. //
  78072. // You can also sort results in descending order based on the creation
  78073. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78074. // based on the creationTimestamp field in reverse chronological order
  78075. // (newest result first). Use this to sort resources like operations so
  78076. // that the newest operation is returned first.
  78077. //
  78078. // Currently, only sorting by name or creationTimestamp desc is
  78079. // supported.
  78080. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  78081. c.urlParams_.Set("orderBy", orderBy)
  78082. return c
  78083. }
  78084. // PageToken sets the optional parameter "pageToken": Specifies a page
  78085. // token to use. Set pageToken to the nextPageToken returned by a
  78086. // previous list request to get the next page of results.
  78087. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  78088. c.urlParams_.Set("pageToken", pageToken)
  78089. return c
  78090. }
  78091. // Fields allows partial responses to be retrieved. See
  78092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78093. // for more information.
  78094. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  78095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78096. return c
  78097. }
  78098. // IfNoneMatch sets the optional parameter which makes the operation
  78099. // fail if the object's ETag matches the given value. This is useful for
  78100. // getting updates only after the object has changed since the last
  78101. // request. Use googleapi.IsNotModified to check whether the response
  78102. // error from Do is the result of In-None-Match.
  78103. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  78104. c.ifNoneMatch_ = entityTag
  78105. return c
  78106. }
  78107. // Context sets the context to be used in this call's Do method. Any
  78108. // pending HTTP request will be aborted if the provided context is
  78109. // canceled.
  78110. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  78111. c.ctx_ = ctx
  78112. return c
  78113. }
  78114. // Header returns an http.Header that can be modified by the caller to
  78115. // add HTTP headers to the request.
  78116. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  78117. if c.header_ == nil {
  78118. c.header_ = make(http.Header)
  78119. }
  78120. return c.header_
  78121. }
  78122. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  78123. reqHeaders := make(http.Header)
  78124. for k, v := range c.header_ {
  78125. reqHeaders[k] = v
  78126. }
  78127. reqHeaders.Set("User-Agent", c.s.userAgent())
  78128. if c.ifNoneMatch_ != "" {
  78129. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78130. }
  78131. var body io.Reader = nil
  78132. c.urlParams_.Set("alt", alt)
  78133. c.urlParams_.Set("prettyPrint", "false")
  78134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  78135. urls += "?" + c.urlParams_.Encode()
  78136. req, err := http.NewRequest("GET", urls, body)
  78137. if err != nil {
  78138. return nil, err
  78139. }
  78140. req.Header = reqHeaders
  78141. googleapi.Expand(req.URL, map[string]string{
  78142. "project": c.project,
  78143. "region": c.region,
  78144. })
  78145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78146. }
  78147. // Do executes the "compute.interconnectAttachments.list" call.
  78148. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  78149. // Any non-2xx status code is an error. Response headers are in either
  78150. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  78151. // was returned at all) in error.(*googleapi.Error).Header. Use
  78152. // googleapi.IsNotModified to check whether the returned error was
  78153. // because http.StatusNotModified was returned.
  78154. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  78155. gensupport.SetOptions(c.urlParams_, opts...)
  78156. res, err := c.doRequest("json")
  78157. if res != nil && res.StatusCode == http.StatusNotModified {
  78158. if res.Body != nil {
  78159. res.Body.Close()
  78160. }
  78161. return nil, &googleapi.Error{
  78162. Code: res.StatusCode,
  78163. Header: res.Header,
  78164. }
  78165. }
  78166. if err != nil {
  78167. return nil, err
  78168. }
  78169. defer googleapi.CloseBody(res)
  78170. if err := googleapi.CheckResponse(res); err != nil {
  78171. return nil, err
  78172. }
  78173. ret := &InterconnectAttachmentList{
  78174. ServerResponse: googleapi.ServerResponse{
  78175. Header: res.Header,
  78176. HTTPStatusCode: res.StatusCode,
  78177. },
  78178. }
  78179. target := &ret
  78180. if err := gensupport.DecodeResponse(target, res); err != nil {
  78181. return nil, err
  78182. }
  78183. return ret, nil
  78184. // {
  78185. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  78186. // "httpMethod": "GET",
  78187. // "id": "compute.interconnectAttachments.list",
  78188. // "parameterOrder": [
  78189. // "project",
  78190. // "region"
  78191. // ],
  78192. // "parameters": {
  78193. // "filter": {
  78194. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  78195. // "location": "query",
  78196. // "type": "string"
  78197. // },
  78198. // "maxResults": {
  78199. // "default": "500",
  78200. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  78201. // "format": "uint32",
  78202. // "location": "query",
  78203. // "minimum": "0",
  78204. // "type": "integer"
  78205. // },
  78206. // "orderBy": {
  78207. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  78208. // "location": "query",
  78209. // "type": "string"
  78210. // },
  78211. // "pageToken": {
  78212. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  78213. // "location": "query",
  78214. // "type": "string"
  78215. // },
  78216. // "project": {
  78217. // "description": "Project ID for this request.",
  78218. // "location": "path",
  78219. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78220. // "required": true,
  78221. // "type": "string"
  78222. // },
  78223. // "region": {
  78224. // "description": "Name of the region for this request.",
  78225. // "location": "path",
  78226. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78227. // "required": true,
  78228. // "type": "string"
  78229. // }
  78230. // },
  78231. // "path": "{project}/regions/{region}/interconnectAttachments",
  78232. // "response": {
  78233. // "$ref": "InterconnectAttachmentList"
  78234. // },
  78235. // "scopes": [
  78236. // "https://www.googleapis.com/auth/cloud-platform",
  78237. // "https://www.googleapis.com/auth/compute",
  78238. // "https://www.googleapis.com/auth/compute.readonly"
  78239. // ]
  78240. // }
  78241. }
  78242. // Pages invokes f for each page of results.
  78243. // A non-nil error returned from f will halt the iteration.
  78244. // The provided context supersedes any context provided to the Context method.
  78245. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  78246. c.ctx_ = ctx
  78247. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78248. for {
  78249. x, err := c.Do()
  78250. if err != nil {
  78251. return err
  78252. }
  78253. if err := f(x); err != nil {
  78254. return err
  78255. }
  78256. if x.NextPageToken == "" {
  78257. return nil
  78258. }
  78259. c.PageToken(x.NextPageToken)
  78260. }
  78261. }
  78262. // method id "compute.interconnectAttachments.patch":
  78263. type InterconnectAttachmentsPatchCall struct {
  78264. s *Service
  78265. project string
  78266. region string
  78267. interconnectAttachment string
  78268. interconnectattachment *InterconnectAttachment
  78269. urlParams_ gensupport.URLParams
  78270. ctx_ context.Context
  78271. header_ http.Header
  78272. }
  78273. // Patch: Updates the specified interconnect attachment with the data
  78274. // included in the request. This method supports PATCH semantics and
  78275. // uses the JSON merge patch format and processing rules.
  78276. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  78277. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78278. c.project = project
  78279. c.region = region
  78280. c.interconnectAttachment = interconnectAttachment
  78281. c.interconnectattachment = interconnectattachment
  78282. return c
  78283. }
  78284. // RequestId sets the optional parameter "requestId": An optional
  78285. // request ID to identify requests. Specify a unique request ID so that
  78286. // if you must retry your request, the server will know to ignore the
  78287. // request if it has already been completed.
  78288. //
  78289. // For example, consider a situation where you make an initial request
  78290. // and the request times out. If you make the request again with the
  78291. // same request ID, the server can check if original operation with the
  78292. // same request ID was received, and if so, will ignore the second
  78293. // request. This prevents clients from accidentally creating duplicate
  78294. // commitments.
  78295. //
  78296. // The request ID must be a valid UUID with the exception that zero UUID
  78297. // is not supported (00000000-0000-0000-0000-000000000000).
  78298. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  78299. c.urlParams_.Set("requestId", requestId)
  78300. return c
  78301. }
  78302. // Fields allows partial responses to be retrieved. See
  78303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78304. // for more information.
  78305. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  78306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78307. return c
  78308. }
  78309. // Context sets the context to be used in this call's Do method. Any
  78310. // pending HTTP request will be aborted if the provided context is
  78311. // canceled.
  78312. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  78313. c.ctx_ = ctx
  78314. return c
  78315. }
  78316. // Header returns an http.Header that can be modified by the caller to
  78317. // add HTTP headers to the request.
  78318. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  78319. if c.header_ == nil {
  78320. c.header_ = make(http.Header)
  78321. }
  78322. return c.header_
  78323. }
  78324. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  78325. reqHeaders := make(http.Header)
  78326. for k, v := range c.header_ {
  78327. reqHeaders[k] = v
  78328. }
  78329. reqHeaders.Set("User-Agent", c.s.userAgent())
  78330. var body io.Reader = nil
  78331. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  78332. if err != nil {
  78333. return nil, err
  78334. }
  78335. reqHeaders.Set("Content-Type", "application/json")
  78336. c.urlParams_.Set("alt", alt)
  78337. c.urlParams_.Set("prettyPrint", "false")
  78338. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  78339. urls += "?" + c.urlParams_.Encode()
  78340. req, err := http.NewRequest("PATCH", urls, body)
  78341. if err != nil {
  78342. return nil, err
  78343. }
  78344. req.Header = reqHeaders
  78345. googleapi.Expand(req.URL, map[string]string{
  78346. "project": c.project,
  78347. "region": c.region,
  78348. "interconnectAttachment": c.interconnectAttachment,
  78349. })
  78350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78351. }
  78352. // Do executes the "compute.interconnectAttachments.patch" call.
  78353. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78354. // status code is an error. Response headers are in either
  78355. // *Operation.ServerResponse.Header or (if a response was returned at
  78356. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78357. // to check whether the returned error was because
  78358. // http.StatusNotModified was returned.
  78359. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78360. gensupport.SetOptions(c.urlParams_, opts...)
  78361. res, err := c.doRequest("json")
  78362. if res != nil && res.StatusCode == http.StatusNotModified {
  78363. if res.Body != nil {
  78364. res.Body.Close()
  78365. }
  78366. return nil, &googleapi.Error{
  78367. Code: res.StatusCode,
  78368. Header: res.Header,
  78369. }
  78370. }
  78371. if err != nil {
  78372. return nil, err
  78373. }
  78374. defer googleapi.CloseBody(res)
  78375. if err := googleapi.CheckResponse(res); err != nil {
  78376. return nil, err
  78377. }
  78378. ret := &Operation{
  78379. ServerResponse: googleapi.ServerResponse{
  78380. Header: res.Header,
  78381. HTTPStatusCode: res.StatusCode,
  78382. },
  78383. }
  78384. target := &ret
  78385. if err := gensupport.DecodeResponse(target, res); err != nil {
  78386. return nil, err
  78387. }
  78388. return ret, nil
  78389. // {
  78390. // "description": "Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  78391. // "httpMethod": "PATCH",
  78392. // "id": "compute.interconnectAttachments.patch",
  78393. // "parameterOrder": [
  78394. // "project",
  78395. // "region",
  78396. // "interconnectAttachment"
  78397. // ],
  78398. // "parameters": {
  78399. // "interconnectAttachment": {
  78400. // "description": "Name of the interconnect attachment to patch.",
  78401. // "location": "path",
  78402. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78403. // "required": true,
  78404. // "type": "string"
  78405. // },
  78406. // "project": {
  78407. // "description": "Project ID for this request.",
  78408. // "location": "path",
  78409. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78410. // "required": true,
  78411. // "type": "string"
  78412. // },
  78413. // "region": {
  78414. // "description": "Name of the region scoping this request.",
  78415. // "location": "path",
  78416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78417. // "required": true,
  78418. // "type": "string"
  78419. // },
  78420. // "requestId": {
  78421. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78422. // "location": "query",
  78423. // "type": "string"
  78424. // }
  78425. // },
  78426. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  78427. // "request": {
  78428. // "$ref": "InterconnectAttachment"
  78429. // },
  78430. // "response": {
  78431. // "$ref": "Operation"
  78432. // },
  78433. // "scopes": [
  78434. // "https://www.googleapis.com/auth/cloud-platform",
  78435. // "https://www.googleapis.com/auth/compute"
  78436. // ]
  78437. // }
  78438. }
  78439. // method id "compute.interconnectAttachments.setIamPolicy":
  78440. type InterconnectAttachmentsSetIamPolicyCall struct {
  78441. s *Service
  78442. project string
  78443. region string
  78444. resource string
  78445. regionsetpolicyrequest *RegionSetPolicyRequest
  78446. urlParams_ gensupport.URLParams
  78447. ctx_ context.Context
  78448. header_ http.Header
  78449. }
  78450. // SetIamPolicy: Sets the access control policy on the specified
  78451. // resource. Replaces any existing policy.
  78452. func (r *InterconnectAttachmentsService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *InterconnectAttachmentsSetIamPolicyCall {
  78453. c := &InterconnectAttachmentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78454. c.project = project
  78455. c.region = region
  78456. c.resource = resource
  78457. c.regionsetpolicyrequest = regionsetpolicyrequest
  78458. return c
  78459. }
  78460. // Fields allows partial responses to be retrieved. See
  78461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78462. // for more information.
  78463. func (c *InterconnectAttachmentsSetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetIamPolicyCall {
  78464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78465. return c
  78466. }
  78467. // Context sets the context to be used in this call's Do method. Any
  78468. // pending HTTP request will be aborted if the provided context is
  78469. // canceled.
  78470. func (c *InterconnectAttachmentsSetIamPolicyCall) Context(ctx context.Context) *InterconnectAttachmentsSetIamPolicyCall {
  78471. c.ctx_ = ctx
  78472. return c
  78473. }
  78474. // Header returns an http.Header that can be modified by the caller to
  78475. // add HTTP headers to the request.
  78476. func (c *InterconnectAttachmentsSetIamPolicyCall) Header() http.Header {
  78477. if c.header_ == nil {
  78478. c.header_ = make(http.Header)
  78479. }
  78480. return c.header_
  78481. }
  78482. func (c *InterconnectAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  78483. reqHeaders := make(http.Header)
  78484. for k, v := range c.header_ {
  78485. reqHeaders[k] = v
  78486. }
  78487. reqHeaders.Set("User-Agent", c.s.userAgent())
  78488. var body io.Reader = nil
  78489. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  78490. if err != nil {
  78491. return nil, err
  78492. }
  78493. reqHeaders.Set("Content-Type", "application/json")
  78494. c.urlParams_.Set("alt", alt)
  78495. c.urlParams_.Set("prettyPrint", "false")
  78496. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy")
  78497. urls += "?" + c.urlParams_.Encode()
  78498. req, err := http.NewRequest("POST", urls, body)
  78499. if err != nil {
  78500. return nil, err
  78501. }
  78502. req.Header = reqHeaders
  78503. googleapi.Expand(req.URL, map[string]string{
  78504. "project": c.project,
  78505. "region": c.region,
  78506. "resource": c.resource,
  78507. })
  78508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78509. }
  78510. // Do executes the "compute.interconnectAttachments.setIamPolicy" call.
  78511. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  78512. // code is an error. Response headers are in either
  78513. // *Policy.ServerResponse.Header or (if a response was returned at all)
  78514. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  78515. // check whether the returned error was because http.StatusNotModified
  78516. // was returned.
  78517. func (c *InterconnectAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  78518. gensupport.SetOptions(c.urlParams_, opts...)
  78519. res, err := c.doRequest("json")
  78520. if res != nil && res.StatusCode == http.StatusNotModified {
  78521. if res.Body != nil {
  78522. res.Body.Close()
  78523. }
  78524. return nil, &googleapi.Error{
  78525. Code: res.StatusCode,
  78526. Header: res.Header,
  78527. }
  78528. }
  78529. if err != nil {
  78530. return nil, err
  78531. }
  78532. defer googleapi.CloseBody(res)
  78533. if err := googleapi.CheckResponse(res); err != nil {
  78534. return nil, err
  78535. }
  78536. ret := &Policy{
  78537. ServerResponse: googleapi.ServerResponse{
  78538. Header: res.Header,
  78539. HTTPStatusCode: res.StatusCode,
  78540. },
  78541. }
  78542. target := &ret
  78543. if err := gensupport.DecodeResponse(target, res); err != nil {
  78544. return nil, err
  78545. }
  78546. return ret, nil
  78547. // {
  78548. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  78549. // "httpMethod": "POST",
  78550. // "id": "compute.interconnectAttachments.setIamPolicy",
  78551. // "parameterOrder": [
  78552. // "project",
  78553. // "region",
  78554. // "resource"
  78555. // ],
  78556. // "parameters": {
  78557. // "project": {
  78558. // "description": "Project ID for this request.",
  78559. // "location": "path",
  78560. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78561. // "required": true,
  78562. // "type": "string"
  78563. // },
  78564. // "region": {
  78565. // "description": "The name of the region for this request.",
  78566. // "location": "path",
  78567. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78568. // "required": true,
  78569. // "type": "string"
  78570. // },
  78571. // "resource": {
  78572. // "description": "Name or id of the resource for this request.",
  78573. // "location": "path",
  78574. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78575. // "required": true,
  78576. // "type": "string"
  78577. // }
  78578. // },
  78579. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy",
  78580. // "request": {
  78581. // "$ref": "RegionSetPolicyRequest"
  78582. // },
  78583. // "response": {
  78584. // "$ref": "Policy"
  78585. // },
  78586. // "scopes": [
  78587. // "https://www.googleapis.com/auth/cloud-platform",
  78588. // "https://www.googleapis.com/auth/compute"
  78589. // ]
  78590. // }
  78591. }
  78592. // method id "compute.interconnectAttachments.setLabels":
  78593. type InterconnectAttachmentsSetLabelsCall struct {
  78594. s *Service
  78595. project string
  78596. region string
  78597. resource string
  78598. regionsetlabelsrequest *RegionSetLabelsRequest
  78599. urlParams_ gensupport.URLParams
  78600. ctx_ context.Context
  78601. header_ http.Header
  78602. }
  78603. // SetLabels: Sets the labels on an InterconnectAttachment. To learn
  78604. // more about labels, read the Labeling Resources documentation.
  78605. func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall {
  78606. c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78607. c.project = project
  78608. c.region = region
  78609. c.resource = resource
  78610. c.regionsetlabelsrequest = regionsetlabelsrequest
  78611. return c
  78612. }
  78613. // RequestId sets the optional parameter "requestId": An optional
  78614. // request ID to identify requests. Specify a unique request ID so that
  78615. // if you must retry your request, the server will know to ignore the
  78616. // request if it has already been completed.
  78617. //
  78618. // For example, consider a situation where you make an initial request
  78619. // and the request times out. If you make the request again with the
  78620. // same request ID, the server can check if original operation with the
  78621. // same request ID was received, and if so, will ignore the second
  78622. // request. This prevents clients from accidentally creating duplicate
  78623. // commitments.
  78624. //
  78625. // The request ID must be a valid UUID with the exception that zero UUID
  78626. // is not supported (00000000-0000-0000-0000-000000000000).
  78627. func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall {
  78628. c.urlParams_.Set("requestId", requestId)
  78629. return c
  78630. }
  78631. // Fields allows partial responses to be retrieved. See
  78632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78633. // for more information.
  78634. func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall {
  78635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78636. return c
  78637. }
  78638. // Context sets the context to be used in this call's Do method. Any
  78639. // pending HTTP request will be aborted if the provided context is
  78640. // canceled.
  78641. func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall {
  78642. c.ctx_ = ctx
  78643. return c
  78644. }
  78645. // Header returns an http.Header that can be modified by the caller to
  78646. // add HTTP headers to the request.
  78647. func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header {
  78648. if c.header_ == nil {
  78649. c.header_ = make(http.Header)
  78650. }
  78651. return c.header_
  78652. }
  78653. func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  78654. reqHeaders := make(http.Header)
  78655. for k, v := range c.header_ {
  78656. reqHeaders[k] = v
  78657. }
  78658. reqHeaders.Set("User-Agent", c.s.userAgent())
  78659. var body io.Reader = nil
  78660. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  78661. if err != nil {
  78662. return nil, err
  78663. }
  78664. reqHeaders.Set("Content-Type", "application/json")
  78665. c.urlParams_.Set("alt", alt)
  78666. c.urlParams_.Set("prettyPrint", "false")
  78667. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels")
  78668. urls += "?" + c.urlParams_.Encode()
  78669. req, err := http.NewRequest("POST", urls, body)
  78670. if err != nil {
  78671. return nil, err
  78672. }
  78673. req.Header = reqHeaders
  78674. googleapi.Expand(req.URL, map[string]string{
  78675. "project": c.project,
  78676. "region": c.region,
  78677. "resource": c.resource,
  78678. })
  78679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78680. }
  78681. // Do executes the "compute.interconnectAttachments.setLabels" call.
  78682. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78683. // status code is an error. Response headers are in either
  78684. // *Operation.ServerResponse.Header or (if a response was returned at
  78685. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78686. // to check whether the returned error was because
  78687. // http.StatusNotModified was returned.
  78688. func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78689. gensupport.SetOptions(c.urlParams_, opts...)
  78690. res, err := c.doRequest("json")
  78691. if res != nil && res.StatusCode == http.StatusNotModified {
  78692. if res.Body != nil {
  78693. res.Body.Close()
  78694. }
  78695. return nil, &googleapi.Error{
  78696. Code: res.StatusCode,
  78697. Header: res.Header,
  78698. }
  78699. }
  78700. if err != nil {
  78701. return nil, err
  78702. }
  78703. defer googleapi.CloseBody(res)
  78704. if err := googleapi.CheckResponse(res); err != nil {
  78705. return nil, err
  78706. }
  78707. ret := &Operation{
  78708. ServerResponse: googleapi.ServerResponse{
  78709. Header: res.Header,
  78710. HTTPStatusCode: res.StatusCode,
  78711. },
  78712. }
  78713. target := &ret
  78714. if err := gensupport.DecodeResponse(target, res); err != nil {
  78715. return nil, err
  78716. }
  78717. return ret, nil
  78718. // {
  78719. // "description": "Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.",
  78720. // "httpMethod": "POST",
  78721. // "id": "compute.interconnectAttachments.setLabels",
  78722. // "parameterOrder": [
  78723. // "project",
  78724. // "region",
  78725. // "resource"
  78726. // ],
  78727. // "parameters": {
  78728. // "project": {
  78729. // "description": "Project ID for this request.",
  78730. // "location": "path",
  78731. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78732. // "required": true,
  78733. // "type": "string"
  78734. // },
  78735. // "region": {
  78736. // "description": "The region for this request.",
  78737. // "location": "path",
  78738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78739. // "required": true,
  78740. // "type": "string"
  78741. // },
  78742. // "requestId": {
  78743. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78744. // "location": "query",
  78745. // "type": "string"
  78746. // },
  78747. // "resource": {
  78748. // "description": "Name or id of the resource for this request.",
  78749. // "location": "path",
  78750. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78751. // "required": true,
  78752. // "type": "string"
  78753. // }
  78754. // },
  78755. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
  78756. // "request": {
  78757. // "$ref": "RegionSetLabelsRequest"
  78758. // },
  78759. // "response": {
  78760. // "$ref": "Operation"
  78761. // },
  78762. // "scopes": [
  78763. // "https://www.googleapis.com/auth/cloud-platform",
  78764. // "https://www.googleapis.com/auth/compute"
  78765. // ]
  78766. // }
  78767. }
  78768. // method id "compute.interconnectAttachments.testIamPermissions":
  78769. type InterconnectAttachmentsTestIamPermissionsCall struct {
  78770. s *Service
  78771. project string
  78772. region string
  78773. resource string
  78774. testpermissionsrequest *TestPermissionsRequest
  78775. urlParams_ gensupport.URLParams
  78776. ctx_ context.Context
  78777. header_ http.Header
  78778. }
  78779. // TestIamPermissions: Returns permissions that a caller has on the
  78780. // specified resource.
  78781. func (r *InterconnectAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectAttachmentsTestIamPermissionsCall {
  78782. c := &InterconnectAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78783. c.project = project
  78784. c.region = region
  78785. c.resource = resource
  78786. c.testpermissionsrequest = testpermissionsrequest
  78787. return c
  78788. }
  78789. // Fields allows partial responses to be retrieved. See
  78790. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78791. // for more information.
  78792. func (c *InterconnectAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsTestIamPermissionsCall {
  78793. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78794. return c
  78795. }
  78796. // Context sets the context to be used in this call's Do method. Any
  78797. // pending HTTP request will be aborted if the provided context is
  78798. // canceled.
  78799. func (c *InterconnectAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectAttachmentsTestIamPermissionsCall {
  78800. c.ctx_ = ctx
  78801. return c
  78802. }
  78803. // Header returns an http.Header that can be modified by the caller to
  78804. // add HTTP headers to the request.
  78805. func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header {
  78806. if c.header_ == nil {
  78807. c.header_ = make(http.Header)
  78808. }
  78809. return c.header_
  78810. }
  78811. func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  78812. reqHeaders := make(http.Header)
  78813. for k, v := range c.header_ {
  78814. reqHeaders[k] = v
  78815. }
  78816. reqHeaders.Set("User-Agent", c.s.userAgent())
  78817. var body io.Reader = nil
  78818. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  78819. if err != nil {
  78820. return nil, err
  78821. }
  78822. reqHeaders.Set("Content-Type", "application/json")
  78823. c.urlParams_.Set("alt", alt)
  78824. c.urlParams_.Set("prettyPrint", "false")
  78825. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions")
  78826. urls += "?" + c.urlParams_.Encode()
  78827. req, err := http.NewRequest("POST", urls, body)
  78828. if err != nil {
  78829. return nil, err
  78830. }
  78831. req.Header = reqHeaders
  78832. googleapi.Expand(req.URL, map[string]string{
  78833. "project": c.project,
  78834. "region": c.region,
  78835. "resource": c.resource,
  78836. })
  78837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78838. }
  78839. // Do executes the "compute.interconnectAttachments.testIamPermissions" call.
  78840. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  78841. // non-2xx status code is an error. Response headers are in either
  78842. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  78843. // returned at all) in error.(*googleapi.Error).Header. Use
  78844. // googleapi.IsNotModified to check whether the returned error was
  78845. // because http.StatusNotModified was returned.
  78846. func (c *InterconnectAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  78847. gensupport.SetOptions(c.urlParams_, opts...)
  78848. res, err := c.doRequest("json")
  78849. if res != nil && res.StatusCode == http.StatusNotModified {
  78850. if res.Body != nil {
  78851. res.Body.Close()
  78852. }
  78853. return nil, &googleapi.Error{
  78854. Code: res.StatusCode,
  78855. Header: res.Header,
  78856. }
  78857. }
  78858. if err != nil {
  78859. return nil, err
  78860. }
  78861. defer googleapi.CloseBody(res)
  78862. if err := googleapi.CheckResponse(res); err != nil {
  78863. return nil, err
  78864. }
  78865. ret := &TestPermissionsResponse{
  78866. ServerResponse: googleapi.ServerResponse{
  78867. Header: res.Header,
  78868. HTTPStatusCode: res.StatusCode,
  78869. },
  78870. }
  78871. target := &ret
  78872. if err := gensupport.DecodeResponse(target, res); err != nil {
  78873. return nil, err
  78874. }
  78875. return ret, nil
  78876. // {
  78877. // "description": "Returns permissions that a caller has on the specified resource.",
  78878. // "httpMethod": "POST",
  78879. // "id": "compute.interconnectAttachments.testIamPermissions",
  78880. // "parameterOrder": [
  78881. // "project",
  78882. // "region",
  78883. // "resource"
  78884. // ],
  78885. // "parameters": {
  78886. // "project": {
  78887. // "description": "Project ID for this request.",
  78888. // "location": "path",
  78889. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78890. // "required": true,
  78891. // "type": "string"
  78892. // },
  78893. // "region": {
  78894. // "description": "The name of the region for this request.",
  78895. // "location": "path",
  78896. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78897. // "required": true,
  78898. // "type": "string"
  78899. // },
  78900. // "resource": {
  78901. // "description": "Name or id of the resource for this request.",
  78902. // "location": "path",
  78903. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78904. // "required": true,
  78905. // "type": "string"
  78906. // }
  78907. // },
  78908. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions",
  78909. // "request": {
  78910. // "$ref": "TestPermissionsRequest"
  78911. // },
  78912. // "response": {
  78913. // "$ref": "TestPermissionsResponse"
  78914. // },
  78915. // "scopes": [
  78916. // "https://www.googleapis.com/auth/cloud-platform",
  78917. // "https://www.googleapis.com/auth/compute",
  78918. // "https://www.googleapis.com/auth/compute.readonly"
  78919. // ]
  78920. // }
  78921. }
  78922. // method id "compute.interconnectLocations.get":
  78923. type InterconnectLocationsGetCall struct {
  78924. s *Service
  78925. project string
  78926. interconnectLocation string
  78927. urlParams_ gensupport.URLParams
  78928. ifNoneMatch_ string
  78929. ctx_ context.Context
  78930. header_ http.Header
  78931. }
  78932. // Get: Returns the details for the specified interconnect location.
  78933. // Gets a list of available interconnect locations by making a list()
  78934. // request.
  78935. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  78936. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78937. c.project = project
  78938. c.interconnectLocation = interconnectLocation
  78939. return c
  78940. }
  78941. // Fields allows partial responses to be retrieved. See
  78942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78943. // for more information.
  78944. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  78945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78946. return c
  78947. }
  78948. // IfNoneMatch sets the optional parameter which makes the operation
  78949. // fail if the object's ETag matches the given value. This is useful for
  78950. // getting updates only after the object has changed since the last
  78951. // request. Use googleapi.IsNotModified to check whether the response
  78952. // error from Do is the result of In-None-Match.
  78953. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  78954. c.ifNoneMatch_ = entityTag
  78955. return c
  78956. }
  78957. // Context sets the context to be used in this call's Do method. Any
  78958. // pending HTTP request will be aborted if the provided context is
  78959. // canceled.
  78960. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  78961. c.ctx_ = ctx
  78962. return c
  78963. }
  78964. // Header returns an http.Header that can be modified by the caller to
  78965. // add HTTP headers to the request.
  78966. func (c *InterconnectLocationsGetCall) Header() http.Header {
  78967. if c.header_ == nil {
  78968. c.header_ = make(http.Header)
  78969. }
  78970. return c.header_
  78971. }
  78972. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  78973. reqHeaders := make(http.Header)
  78974. for k, v := range c.header_ {
  78975. reqHeaders[k] = v
  78976. }
  78977. reqHeaders.Set("User-Agent", c.s.userAgent())
  78978. if c.ifNoneMatch_ != "" {
  78979. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78980. }
  78981. var body io.Reader = nil
  78982. c.urlParams_.Set("alt", alt)
  78983. c.urlParams_.Set("prettyPrint", "false")
  78984. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  78985. urls += "?" + c.urlParams_.Encode()
  78986. req, err := http.NewRequest("GET", urls, body)
  78987. if err != nil {
  78988. return nil, err
  78989. }
  78990. req.Header = reqHeaders
  78991. googleapi.Expand(req.URL, map[string]string{
  78992. "project": c.project,
  78993. "interconnectLocation": c.interconnectLocation,
  78994. })
  78995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78996. }
  78997. // Do executes the "compute.interconnectLocations.get" call.
  78998. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  78999. // non-2xx status code is an error. Response headers are in either
  79000. // *InterconnectLocation.ServerResponse.Header or (if a response was
  79001. // returned at all) in error.(*googleapi.Error).Header. Use
  79002. // googleapi.IsNotModified to check whether the returned error was
  79003. // because http.StatusNotModified was returned.
  79004. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  79005. gensupport.SetOptions(c.urlParams_, opts...)
  79006. res, err := c.doRequest("json")
  79007. if res != nil && res.StatusCode == http.StatusNotModified {
  79008. if res.Body != nil {
  79009. res.Body.Close()
  79010. }
  79011. return nil, &googleapi.Error{
  79012. Code: res.StatusCode,
  79013. Header: res.Header,
  79014. }
  79015. }
  79016. if err != nil {
  79017. return nil, err
  79018. }
  79019. defer googleapi.CloseBody(res)
  79020. if err := googleapi.CheckResponse(res); err != nil {
  79021. return nil, err
  79022. }
  79023. ret := &InterconnectLocation{
  79024. ServerResponse: googleapi.ServerResponse{
  79025. Header: res.Header,
  79026. HTTPStatusCode: res.StatusCode,
  79027. },
  79028. }
  79029. target := &ret
  79030. if err := gensupport.DecodeResponse(target, res); err != nil {
  79031. return nil, err
  79032. }
  79033. return ret, nil
  79034. // {
  79035. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  79036. // "httpMethod": "GET",
  79037. // "id": "compute.interconnectLocations.get",
  79038. // "parameterOrder": [
  79039. // "project",
  79040. // "interconnectLocation"
  79041. // ],
  79042. // "parameters": {
  79043. // "interconnectLocation": {
  79044. // "description": "Name of the interconnect location to return.",
  79045. // "location": "path",
  79046. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79047. // "required": true,
  79048. // "type": "string"
  79049. // },
  79050. // "project": {
  79051. // "description": "Project ID for this request.",
  79052. // "location": "path",
  79053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79054. // "required": true,
  79055. // "type": "string"
  79056. // }
  79057. // },
  79058. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  79059. // "response": {
  79060. // "$ref": "InterconnectLocation"
  79061. // },
  79062. // "scopes": [
  79063. // "https://www.googleapis.com/auth/cloud-platform",
  79064. // "https://www.googleapis.com/auth/compute",
  79065. // "https://www.googleapis.com/auth/compute.readonly"
  79066. // ]
  79067. // }
  79068. }
  79069. // method id "compute.interconnectLocations.list":
  79070. type InterconnectLocationsListCall struct {
  79071. s *Service
  79072. project string
  79073. urlParams_ gensupport.URLParams
  79074. ifNoneMatch_ string
  79075. ctx_ context.Context
  79076. header_ http.Header
  79077. }
  79078. // List: Retrieves the list of interconnect locations available to the
  79079. // specified project.
  79080. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  79081. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79082. c.project = project
  79083. return c
  79084. }
  79085. // Filter sets the optional parameter "filter": A filter expression that
  79086. // filters resources listed in the response. The expression must specify
  79087. // the field name, a comparison operator, and the value that you want to
  79088. // use for filtering. The value must be a string, a number, or a
  79089. // boolean. The comparison operator must be either =, !=, >, or <.
  79090. //
  79091. // For example, if you are filtering Compute Engine instances, you can
  79092. // exclude instances named example-instance by specifying name !=
  79093. // example-instance.
  79094. //
  79095. // You can also filter nested fields. For example, you could specify
  79096. // scheduling.automaticRestart = false to include instances only if they
  79097. // are not scheduled for automatic restarts. You can use filtering on
  79098. // nested fields to filter based on resource labels.
  79099. //
  79100. // To filter on multiple expressions, provide each separate expression
  79101. // within parentheses. For example, (scheduling.automaticRestart = true)
  79102. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79103. // AND expression. However, you can include AND and OR expressions
  79104. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79105. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79106. // true).
  79107. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  79108. c.urlParams_.Set("filter", filter)
  79109. return c
  79110. }
  79111. // MaxResults sets the optional parameter "maxResults": The maximum
  79112. // number of results per page that should be returned. If the number of
  79113. // available results is larger than maxResults, Compute Engine returns a
  79114. // nextPageToken that can be used to get the next page of results in
  79115. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79116. // (Default: 500)
  79117. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  79118. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79119. return c
  79120. }
  79121. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79122. // a certain order. By default, results are returned in alphanumerical
  79123. // order based on the resource name.
  79124. //
  79125. // You can also sort results in descending order based on the creation
  79126. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79127. // based on the creationTimestamp field in reverse chronological order
  79128. // (newest result first). Use this to sort resources like operations so
  79129. // that the newest operation is returned first.
  79130. //
  79131. // Currently, only sorting by name or creationTimestamp desc is
  79132. // supported.
  79133. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  79134. c.urlParams_.Set("orderBy", orderBy)
  79135. return c
  79136. }
  79137. // PageToken sets the optional parameter "pageToken": Specifies a page
  79138. // token to use. Set pageToken to the nextPageToken returned by a
  79139. // previous list request to get the next page of results.
  79140. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  79141. c.urlParams_.Set("pageToken", pageToken)
  79142. return c
  79143. }
  79144. // Fields allows partial responses to be retrieved. See
  79145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79146. // for more information.
  79147. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  79148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79149. return c
  79150. }
  79151. // IfNoneMatch sets the optional parameter which makes the operation
  79152. // fail if the object's ETag matches the given value. This is useful for
  79153. // getting updates only after the object has changed since the last
  79154. // request. Use googleapi.IsNotModified to check whether the response
  79155. // error from Do is the result of In-None-Match.
  79156. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  79157. c.ifNoneMatch_ = entityTag
  79158. return c
  79159. }
  79160. // Context sets the context to be used in this call's Do method. Any
  79161. // pending HTTP request will be aborted if the provided context is
  79162. // canceled.
  79163. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  79164. c.ctx_ = ctx
  79165. return c
  79166. }
  79167. // Header returns an http.Header that can be modified by the caller to
  79168. // add HTTP headers to the request.
  79169. func (c *InterconnectLocationsListCall) Header() http.Header {
  79170. if c.header_ == nil {
  79171. c.header_ = make(http.Header)
  79172. }
  79173. return c.header_
  79174. }
  79175. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  79176. reqHeaders := make(http.Header)
  79177. for k, v := range c.header_ {
  79178. reqHeaders[k] = v
  79179. }
  79180. reqHeaders.Set("User-Agent", c.s.userAgent())
  79181. if c.ifNoneMatch_ != "" {
  79182. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79183. }
  79184. var body io.Reader = nil
  79185. c.urlParams_.Set("alt", alt)
  79186. c.urlParams_.Set("prettyPrint", "false")
  79187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  79188. urls += "?" + c.urlParams_.Encode()
  79189. req, err := http.NewRequest("GET", urls, body)
  79190. if err != nil {
  79191. return nil, err
  79192. }
  79193. req.Header = reqHeaders
  79194. googleapi.Expand(req.URL, map[string]string{
  79195. "project": c.project,
  79196. })
  79197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79198. }
  79199. // Do executes the "compute.interconnectLocations.list" call.
  79200. // Exactly one of *InterconnectLocationList or error will be non-nil.
  79201. // Any non-2xx status code is an error. Response headers are in either
  79202. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  79203. // returned at all) in error.(*googleapi.Error).Header. Use
  79204. // googleapi.IsNotModified to check whether the returned error was
  79205. // because http.StatusNotModified was returned.
  79206. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  79207. gensupport.SetOptions(c.urlParams_, opts...)
  79208. res, err := c.doRequest("json")
  79209. if res != nil && res.StatusCode == http.StatusNotModified {
  79210. if res.Body != nil {
  79211. res.Body.Close()
  79212. }
  79213. return nil, &googleapi.Error{
  79214. Code: res.StatusCode,
  79215. Header: res.Header,
  79216. }
  79217. }
  79218. if err != nil {
  79219. return nil, err
  79220. }
  79221. defer googleapi.CloseBody(res)
  79222. if err := googleapi.CheckResponse(res); err != nil {
  79223. return nil, err
  79224. }
  79225. ret := &InterconnectLocationList{
  79226. ServerResponse: googleapi.ServerResponse{
  79227. Header: res.Header,
  79228. HTTPStatusCode: res.StatusCode,
  79229. },
  79230. }
  79231. target := &ret
  79232. if err := gensupport.DecodeResponse(target, res); err != nil {
  79233. return nil, err
  79234. }
  79235. return ret, nil
  79236. // {
  79237. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  79238. // "httpMethod": "GET",
  79239. // "id": "compute.interconnectLocations.list",
  79240. // "parameterOrder": [
  79241. // "project"
  79242. // ],
  79243. // "parameters": {
  79244. // "filter": {
  79245. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79246. // "location": "query",
  79247. // "type": "string"
  79248. // },
  79249. // "maxResults": {
  79250. // "default": "500",
  79251. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79252. // "format": "uint32",
  79253. // "location": "query",
  79254. // "minimum": "0",
  79255. // "type": "integer"
  79256. // },
  79257. // "orderBy": {
  79258. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79259. // "location": "query",
  79260. // "type": "string"
  79261. // },
  79262. // "pageToken": {
  79263. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79264. // "location": "query",
  79265. // "type": "string"
  79266. // },
  79267. // "project": {
  79268. // "description": "Project ID for this request.",
  79269. // "location": "path",
  79270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79271. // "required": true,
  79272. // "type": "string"
  79273. // }
  79274. // },
  79275. // "path": "{project}/global/interconnectLocations",
  79276. // "response": {
  79277. // "$ref": "InterconnectLocationList"
  79278. // },
  79279. // "scopes": [
  79280. // "https://www.googleapis.com/auth/cloud-platform",
  79281. // "https://www.googleapis.com/auth/compute",
  79282. // "https://www.googleapis.com/auth/compute.readonly"
  79283. // ]
  79284. // }
  79285. }
  79286. // Pages invokes f for each page of results.
  79287. // A non-nil error returned from f will halt the iteration.
  79288. // The provided context supersedes any context provided to the Context method.
  79289. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  79290. c.ctx_ = ctx
  79291. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79292. for {
  79293. x, err := c.Do()
  79294. if err != nil {
  79295. return err
  79296. }
  79297. if err := f(x); err != nil {
  79298. return err
  79299. }
  79300. if x.NextPageToken == "" {
  79301. return nil
  79302. }
  79303. c.PageToken(x.NextPageToken)
  79304. }
  79305. }
  79306. // method id "compute.interconnectLocations.testIamPermissions":
  79307. type InterconnectLocationsTestIamPermissionsCall struct {
  79308. s *Service
  79309. project string
  79310. resource string
  79311. testpermissionsrequest *TestPermissionsRequest
  79312. urlParams_ gensupport.URLParams
  79313. ctx_ context.Context
  79314. header_ http.Header
  79315. }
  79316. // TestIamPermissions: Returns permissions that a caller has on the
  79317. // specified resource.
  79318. func (r *InterconnectLocationsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectLocationsTestIamPermissionsCall {
  79319. c := &InterconnectLocationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79320. c.project = project
  79321. c.resource = resource
  79322. c.testpermissionsrequest = testpermissionsrequest
  79323. return c
  79324. }
  79325. // Fields allows partial responses to be retrieved. See
  79326. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79327. // for more information.
  79328. func (c *InterconnectLocationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectLocationsTestIamPermissionsCall {
  79329. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79330. return c
  79331. }
  79332. // Context sets the context to be used in this call's Do method. Any
  79333. // pending HTTP request will be aborted if the provided context is
  79334. // canceled.
  79335. func (c *InterconnectLocationsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectLocationsTestIamPermissionsCall {
  79336. c.ctx_ = ctx
  79337. return c
  79338. }
  79339. // Header returns an http.Header that can be modified by the caller to
  79340. // add HTTP headers to the request.
  79341. func (c *InterconnectLocationsTestIamPermissionsCall) Header() http.Header {
  79342. if c.header_ == nil {
  79343. c.header_ = make(http.Header)
  79344. }
  79345. return c.header_
  79346. }
  79347. func (c *InterconnectLocationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  79348. reqHeaders := make(http.Header)
  79349. for k, v := range c.header_ {
  79350. reqHeaders[k] = v
  79351. }
  79352. reqHeaders.Set("User-Agent", c.s.userAgent())
  79353. var body io.Reader = nil
  79354. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  79355. if err != nil {
  79356. return nil, err
  79357. }
  79358. reqHeaders.Set("Content-Type", "application/json")
  79359. c.urlParams_.Set("alt", alt)
  79360. c.urlParams_.Set("prettyPrint", "false")
  79361. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{resource}/testIamPermissions")
  79362. urls += "?" + c.urlParams_.Encode()
  79363. req, err := http.NewRequest("POST", urls, body)
  79364. if err != nil {
  79365. return nil, err
  79366. }
  79367. req.Header = reqHeaders
  79368. googleapi.Expand(req.URL, map[string]string{
  79369. "project": c.project,
  79370. "resource": c.resource,
  79371. })
  79372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79373. }
  79374. // Do executes the "compute.interconnectLocations.testIamPermissions" call.
  79375. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  79376. // non-2xx status code is an error. Response headers are in either
  79377. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  79378. // returned at all) in error.(*googleapi.Error).Header. Use
  79379. // googleapi.IsNotModified to check whether the returned error was
  79380. // because http.StatusNotModified was returned.
  79381. func (c *InterconnectLocationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  79382. gensupport.SetOptions(c.urlParams_, opts...)
  79383. res, err := c.doRequest("json")
  79384. if res != nil && res.StatusCode == http.StatusNotModified {
  79385. if res.Body != nil {
  79386. res.Body.Close()
  79387. }
  79388. return nil, &googleapi.Error{
  79389. Code: res.StatusCode,
  79390. Header: res.Header,
  79391. }
  79392. }
  79393. if err != nil {
  79394. return nil, err
  79395. }
  79396. defer googleapi.CloseBody(res)
  79397. if err := googleapi.CheckResponse(res); err != nil {
  79398. return nil, err
  79399. }
  79400. ret := &TestPermissionsResponse{
  79401. ServerResponse: googleapi.ServerResponse{
  79402. Header: res.Header,
  79403. HTTPStatusCode: res.StatusCode,
  79404. },
  79405. }
  79406. target := &ret
  79407. if err := gensupport.DecodeResponse(target, res); err != nil {
  79408. return nil, err
  79409. }
  79410. return ret, nil
  79411. // {
  79412. // "description": "Returns permissions that a caller has on the specified resource.",
  79413. // "httpMethod": "POST",
  79414. // "id": "compute.interconnectLocations.testIamPermissions",
  79415. // "parameterOrder": [
  79416. // "project",
  79417. // "resource"
  79418. // ],
  79419. // "parameters": {
  79420. // "project": {
  79421. // "description": "Project ID for this request.",
  79422. // "location": "path",
  79423. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79424. // "required": true,
  79425. // "type": "string"
  79426. // },
  79427. // "resource": {
  79428. // "description": "Name or id of the resource for this request.",
  79429. // "location": "path",
  79430. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79431. // "required": true,
  79432. // "type": "string"
  79433. // }
  79434. // },
  79435. // "path": "{project}/global/interconnectLocations/{resource}/testIamPermissions",
  79436. // "request": {
  79437. // "$ref": "TestPermissionsRequest"
  79438. // },
  79439. // "response": {
  79440. // "$ref": "TestPermissionsResponse"
  79441. // },
  79442. // "scopes": [
  79443. // "https://www.googleapis.com/auth/cloud-platform",
  79444. // "https://www.googleapis.com/auth/compute",
  79445. // "https://www.googleapis.com/auth/compute.readonly"
  79446. // ]
  79447. // }
  79448. }
  79449. // method id "compute.interconnects.delete":
  79450. type InterconnectsDeleteCall struct {
  79451. s *Service
  79452. project string
  79453. interconnect string
  79454. urlParams_ gensupport.URLParams
  79455. ctx_ context.Context
  79456. header_ http.Header
  79457. }
  79458. // Delete: Deletes the specified interconnect.
  79459. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  79460. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79461. c.project = project
  79462. c.interconnect = interconnect
  79463. return c
  79464. }
  79465. // RequestId sets the optional parameter "requestId": An optional
  79466. // request ID to identify requests. Specify a unique request ID so that
  79467. // if you must retry your request, the server will know to ignore the
  79468. // request if it has already been completed.
  79469. //
  79470. // For example, consider a situation where you make an initial request
  79471. // and the request times out. If you make the request again with the
  79472. // same request ID, the server can check if original operation with the
  79473. // same request ID was received, and if so, will ignore the second
  79474. // request. This prevents clients from accidentally creating duplicate
  79475. // commitments.
  79476. //
  79477. // The request ID must be a valid UUID with the exception that zero UUID
  79478. // is not supported (00000000-0000-0000-0000-000000000000).
  79479. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  79480. c.urlParams_.Set("requestId", requestId)
  79481. return c
  79482. }
  79483. // Fields allows partial responses to be retrieved. See
  79484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79485. // for more information.
  79486. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  79487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79488. return c
  79489. }
  79490. // Context sets the context to be used in this call's Do method. Any
  79491. // pending HTTP request will be aborted if the provided context is
  79492. // canceled.
  79493. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  79494. c.ctx_ = ctx
  79495. return c
  79496. }
  79497. // Header returns an http.Header that can be modified by the caller to
  79498. // add HTTP headers to the request.
  79499. func (c *InterconnectsDeleteCall) Header() http.Header {
  79500. if c.header_ == nil {
  79501. c.header_ = make(http.Header)
  79502. }
  79503. return c.header_
  79504. }
  79505. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  79506. reqHeaders := make(http.Header)
  79507. for k, v := range c.header_ {
  79508. reqHeaders[k] = v
  79509. }
  79510. reqHeaders.Set("User-Agent", c.s.userAgent())
  79511. var body io.Reader = nil
  79512. c.urlParams_.Set("alt", alt)
  79513. c.urlParams_.Set("prettyPrint", "false")
  79514. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  79515. urls += "?" + c.urlParams_.Encode()
  79516. req, err := http.NewRequest("DELETE", urls, body)
  79517. if err != nil {
  79518. return nil, err
  79519. }
  79520. req.Header = reqHeaders
  79521. googleapi.Expand(req.URL, map[string]string{
  79522. "project": c.project,
  79523. "interconnect": c.interconnect,
  79524. })
  79525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79526. }
  79527. // Do executes the "compute.interconnects.delete" call.
  79528. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79529. // status code is an error. Response headers are in either
  79530. // *Operation.ServerResponse.Header or (if a response was returned at
  79531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79532. // to check whether the returned error was because
  79533. // http.StatusNotModified was returned.
  79534. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79535. gensupport.SetOptions(c.urlParams_, opts...)
  79536. res, err := c.doRequest("json")
  79537. if res != nil && res.StatusCode == http.StatusNotModified {
  79538. if res.Body != nil {
  79539. res.Body.Close()
  79540. }
  79541. return nil, &googleapi.Error{
  79542. Code: res.StatusCode,
  79543. Header: res.Header,
  79544. }
  79545. }
  79546. if err != nil {
  79547. return nil, err
  79548. }
  79549. defer googleapi.CloseBody(res)
  79550. if err := googleapi.CheckResponse(res); err != nil {
  79551. return nil, err
  79552. }
  79553. ret := &Operation{
  79554. ServerResponse: googleapi.ServerResponse{
  79555. Header: res.Header,
  79556. HTTPStatusCode: res.StatusCode,
  79557. },
  79558. }
  79559. target := &ret
  79560. if err := gensupport.DecodeResponse(target, res); err != nil {
  79561. return nil, err
  79562. }
  79563. return ret, nil
  79564. // {
  79565. // "description": "Deletes the specified interconnect.",
  79566. // "httpMethod": "DELETE",
  79567. // "id": "compute.interconnects.delete",
  79568. // "parameterOrder": [
  79569. // "project",
  79570. // "interconnect"
  79571. // ],
  79572. // "parameters": {
  79573. // "interconnect": {
  79574. // "description": "Name of the interconnect to delete.",
  79575. // "location": "path",
  79576. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79577. // "required": true,
  79578. // "type": "string"
  79579. // },
  79580. // "project": {
  79581. // "description": "Project ID for this request.",
  79582. // "location": "path",
  79583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79584. // "required": true,
  79585. // "type": "string"
  79586. // },
  79587. // "requestId": {
  79588. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  79589. // "location": "query",
  79590. // "type": "string"
  79591. // }
  79592. // },
  79593. // "path": "{project}/global/interconnects/{interconnect}",
  79594. // "response": {
  79595. // "$ref": "Operation"
  79596. // },
  79597. // "scopes": [
  79598. // "https://www.googleapis.com/auth/cloud-platform",
  79599. // "https://www.googleapis.com/auth/compute"
  79600. // ]
  79601. // }
  79602. }
  79603. // method id "compute.interconnects.get":
  79604. type InterconnectsGetCall struct {
  79605. s *Service
  79606. project string
  79607. interconnect string
  79608. urlParams_ gensupport.URLParams
  79609. ifNoneMatch_ string
  79610. ctx_ context.Context
  79611. header_ http.Header
  79612. }
  79613. // Get: Returns the specified interconnect. Get a list of available
  79614. // interconnects by making a list() request.
  79615. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  79616. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79617. c.project = project
  79618. c.interconnect = interconnect
  79619. return c
  79620. }
  79621. // Fields allows partial responses to be retrieved. See
  79622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79623. // for more information.
  79624. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  79625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79626. return c
  79627. }
  79628. // IfNoneMatch sets the optional parameter which makes the operation
  79629. // fail if the object's ETag matches the given value. This is useful for
  79630. // getting updates only after the object has changed since the last
  79631. // request. Use googleapi.IsNotModified to check whether the response
  79632. // error from Do is the result of In-None-Match.
  79633. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  79634. c.ifNoneMatch_ = entityTag
  79635. return c
  79636. }
  79637. // Context sets the context to be used in this call's Do method. Any
  79638. // pending HTTP request will be aborted if the provided context is
  79639. // canceled.
  79640. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  79641. c.ctx_ = ctx
  79642. return c
  79643. }
  79644. // Header returns an http.Header that can be modified by the caller to
  79645. // add HTTP headers to the request.
  79646. func (c *InterconnectsGetCall) Header() http.Header {
  79647. if c.header_ == nil {
  79648. c.header_ = make(http.Header)
  79649. }
  79650. return c.header_
  79651. }
  79652. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  79653. reqHeaders := make(http.Header)
  79654. for k, v := range c.header_ {
  79655. reqHeaders[k] = v
  79656. }
  79657. reqHeaders.Set("User-Agent", c.s.userAgent())
  79658. if c.ifNoneMatch_ != "" {
  79659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79660. }
  79661. var body io.Reader = nil
  79662. c.urlParams_.Set("alt", alt)
  79663. c.urlParams_.Set("prettyPrint", "false")
  79664. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  79665. urls += "?" + c.urlParams_.Encode()
  79666. req, err := http.NewRequest("GET", urls, body)
  79667. if err != nil {
  79668. return nil, err
  79669. }
  79670. req.Header = reqHeaders
  79671. googleapi.Expand(req.URL, map[string]string{
  79672. "project": c.project,
  79673. "interconnect": c.interconnect,
  79674. })
  79675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79676. }
  79677. // Do executes the "compute.interconnects.get" call.
  79678. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  79679. // status code is an error. Response headers are in either
  79680. // *Interconnect.ServerResponse.Header or (if a response was returned at
  79681. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79682. // to check whether the returned error was because
  79683. // http.StatusNotModified was returned.
  79684. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  79685. gensupport.SetOptions(c.urlParams_, opts...)
  79686. res, err := c.doRequest("json")
  79687. if res != nil && res.StatusCode == http.StatusNotModified {
  79688. if res.Body != nil {
  79689. res.Body.Close()
  79690. }
  79691. return nil, &googleapi.Error{
  79692. Code: res.StatusCode,
  79693. Header: res.Header,
  79694. }
  79695. }
  79696. if err != nil {
  79697. return nil, err
  79698. }
  79699. defer googleapi.CloseBody(res)
  79700. if err := googleapi.CheckResponse(res); err != nil {
  79701. return nil, err
  79702. }
  79703. ret := &Interconnect{
  79704. ServerResponse: googleapi.ServerResponse{
  79705. Header: res.Header,
  79706. HTTPStatusCode: res.StatusCode,
  79707. },
  79708. }
  79709. target := &ret
  79710. if err := gensupport.DecodeResponse(target, res); err != nil {
  79711. return nil, err
  79712. }
  79713. return ret, nil
  79714. // {
  79715. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  79716. // "httpMethod": "GET",
  79717. // "id": "compute.interconnects.get",
  79718. // "parameterOrder": [
  79719. // "project",
  79720. // "interconnect"
  79721. // ],
  79722. // "parameters": {
  79723. // "interconnect": {
  79724. // "description": "Name of the interconnect to return.",
  79725. // "location": "path",
  79726. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79727. // "required": true,
  79728. // "type": "string"
  79729. // },
  79730. // "project": {
  79731. // "description": "Project ID for this request.",
  79732. // "location": "path",
  79733. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79734. // "required": true,
  79735. // "type": "string"
  79736. // }
  79737. // },
  79738. // "path": "{project}/global/interconnects/{interconnect}",
  79739. // "response": {
  79740. // "$ref": "Interconnect"
  79741. // },
  79742. // "scopes": [
  79743. // "https://www.googleapis.com/auth/cloud-platform",
  79744. // "https://www.googleapis.com/auth/compute",
  79745. // "https://www.googleapis.com/auth/compute.readonly"
  79746. // ]
  79747. // }
  79748. }
  79749. // method id "compute.interconnects.getDiagnostics":
  79750. type InterconnectsGetDiagnosticsCall struct {
  79751. s *Service
  79752. project string
  79753. interconnect string
  79754. urlParams_ gensupport.URLParams
  79755. ifNoneMatch_ string
  79756. ctx_ context.Context
  79757. header_ http.Header
  79758. }
  79759. // GetDiagnostics: Returns the interconnectDiagnostics for the specified
  79760. // interconnect.
  79761. func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
  79762. c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79763. c.project = project
  79764. c.interconnect = interconnect
  79765. return c
  79766. }
  79767. // Fields allows partial responses to be retrieved. See
  79768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79769. // for more information.
  79770. func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
  79771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79772. return c
  79773. }
  79774. // IfNoneMatch sets the optional parameter which makes the operation
  79775. // fail if the object's ETag matches the given value. This is useful for
  79776. // getting updates only after the object has changed since the last
  79777. // request. Use googleapi.IsNotModified to check whether the response
  79778. // error from Do is the result of In-None-Match.
  79779. func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
  79780. c.ifNoneMatch_ = entityTag
  79781. return c
  79782. }
  79783. // Context sets the context to be used in this call's Do method. Any
  79784. // pending HTTP request will be aborted if the provided context is
  79785. // canceled.
  79786. func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
  79787. c.ctx_ = ctx
  79788. return c
  79789. }
  79790. // Header returns an http.Header that can be modified by the caller to
  79791. // add HTTP headers to the request.
  79792. func (c *InterconnectsGetDiagnosticsCall) Header() http.Header {
  79793. if c.header_ == nil {
  79794. c.header_ = make(http.Header)
  79795. }
  79796. return c.header_
  79797. }
  79798. func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
  79799. reqHeaders := make(http.Header)
  79800. for k, v := range c.header_ {
  79801. reqHeaders[k] = v
  79802. }
  79803. reqHeaders.Set("User-Agent", c.s.userAgent())
  79804. if c.ifNoneMatch_ != "" {
  79805. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79806. }
  79807. var body io.Reader = nil
  79808. c.urlParams_.Set("alt", alt)
  79809. c.urlParams_.Set("prettyPrint", "false")
  79810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}/getDiagnostics")
  79811. urls += "?" + c.urlParams_.Encode()
  79812. req, err := http.NewRequest("GET", urls, body)
  79813. if err != nil {
  79814. return nil, err
  79815. }
  79816. req.Header = reqHeaders
  79817. googleapi.Expand(req.URL, map[string]string{
  79818. "project": c.project,
  79819. "interconnect": c.interconnect,
  79820. })
  79821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79822. }
  79823. // Do executes the "compute.interconnects.getDiagnostics" call.
  79824. // Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
  79825. // non-nil. Any non-2xx status code is an error. Response headers are in
  79826. // either *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or
  79827. // (if a response was returned at all) in
  79828. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  79829. // whether the returned error was because http.StatusNotModified was
  79830. // returned.
  79831. func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) {
  79832. gensupport.SetOptions(c.urlParams_, opts...)
  79833. res, err := c.doRequest("json")
  79834. if res != nil && res.StatusCode == http.StatusNotModified {
  79835. if res.Body != nil {
  79836. res.Body.Close()
  79837. }
  79838. return nil, &googleapi.Error{
  79839. Code: res.StatusCode,
  79840. Header: res.Header,
  79841. }
  79842. }
  79843. if err != nil {
  79844. return nil, err
  79845. }
  79846. defer googleapi.CloseBody(res)
  79847. if err := googleapi.CheckResponse(res); err != nil {
  79848. return nil, err
  79849. }
  79850. ret := &InterconnectsGetDiagnosticsResponse{
  79851. ServerResponse: googleapi.ServerResponse{
  79852. Header: res.Header,
  79853. HTTPStatusCode: res.StatusCode,
  79854. },
  79855. }
  79856. target := &ret
  79857. if err := gensupport.DecodeResponse(target, res); err != nil {
  79858. return nil, err
  79859. }
  79860. return ret, nil
  79861. // {
  79862. // "description": "Returns the interconnectDiagnostics for the specified interconnect.",
  79863. // "httpMethod": "GET",
  79864. // "id": "compute.interconnects.getDiagnostics",
  79865. // "parameterOrder": [
  79866. // "project",
  79867. // "interconnect"
  79868. // ],
  79869. // "parameters": {
  79870. // "interconnect": {
  79871. // "description": "Name of the interconnect resource to query.",
  79872. // "location": "path",
  79873. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79874. // "required": true,
  79875. // "type": "string"
  79876. // },
  79877. // "project": {
  79878. // "description": "Project ID for this request.",
  79879. // "location": "path",
  79880. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79881. // "required": true,
  79882. // "type": "string"
  79883. // }
  79884. // },
  79885. // "path": "{project}/global/interconnects/{interconnect}/getDiagnostics",
  79886. // "response": {
  79887. // "$ref": "InterconnectsGetDiagnosticsResponse"
  79888. // },
  79889. // "scopes": [
  79890. // "https://www.googleapis.com/auth/cloud-platform",
  79891. // "https://www.googleapis.com/auth/compute",
  79892. // "https://www.googleapis.com/auth/compute.readonly"
  79893. // ]
  79894. // }
  79895. }
  79896. // method id "compute.interconnects.getIamPolicy":
  79897. type InterconnectsGetIamPolicyCall struct {
  79898. s *Service
  79899. project string
  79900. resource string
  79901. urlParams_ gensupport.URLParams
  79902. ifNoneMatch_ string
  79903. ctx_ context.Context
  79904. header_ http.Header
  79905. }
  79906. // GetIamPolicy: Gets the access control policy for a resource. May be
  79907. // empty if no such policy or resource exists.
  79908. func (r *InterconnectsService) GetIamPolicy(project string, resource string) *InterconnectsGetIamPolicyCall {
  79909. c := &InterconnectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79910. c.project = project
  79911. c.resource = resource
  79912. return c
  79913. }
  79914. // Fields allows partial responses to be retrieved. See
  79915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79916. // for more information.
  79917. func (c *InterconnectsGetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectsGetIamPolicyCall {
  79918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79919. return c
  79920. }
  79921. // IfNoneMatch sets the optional parameter which makes the operation
  79922. // fail if the object's ETag matches the given value. This is useful for
  79923. // getting updates only after the object has changed since the last
  79924. // request. Use googleapi.IsNotModified to check whether the response
  79925. // error from Do is the result of In-None-Match.
  79926. func (c *InterconnectsGetIamPolicyCall) IfNoneMatch(entityTag string) *InterconnectsGetIamPolicyCall {
  79927. c.ifNoneMatch_ = entityTag
  79928. return c
  79929. }
  79930. // Context sets the context to be used in this call's Do method. Any
  79931. // pending HTTP request will be aborted if the provided context is
  79932. // canceled.
  79933. func (c *InterconnectsGetIamPolicyCall) Context(ctx context.Context) *InterconnectsGetIamPolicyCall {
  79934. c.ctx_ = ctx
  79935. return c
  79936. }
  79937. // Header returns an http.Header that can be modified by the caller to
  79938. // add HTTP headers to the request.
  79939. func (c *InterconnectsGetIamPolicyCall) Header() http.Header {
  79940. if c.header_ == nil {
  79941. c.header_ = make(http.Header)
  79942. }
  79943. return c.header_
  79944. }
  79945. func (c *InterconnectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  79946. reqHeaders := make(http.Header)
  79947. for k, v := range c.header_ {
  79948. reqHeaders[k] = v
  79949. }
  79950. reqHeaders.Set("User-Agent", c.s.userAgent())
  79951. if c.ifNoneMatch_ != "" {
  79952. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79953. }
  79954. var body io.Reader = nil
  79955. c.urlParams_.Set("alt", alt)
  79956. c.urlParams_.Set("prettyPrint", "false")
  79957. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/getIamPolicy")
  79958. urls += "?" + c.urlParams_.Encode()
  79959. req, err := http.NewRequest("GET", urls, body)
  79960. if err != nil {
  79961. return nil, err
  79962. }
  79963. req.Header = reqHeaders
  79964. googleapi.Expand(req.URL, map[string]string{
  79965. "project": c.project,
  79966. "resource": c.resource,
  79967. })
  79968. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79969. }
  79970. // Do executes the "compute.interconnects.getIamPolicy" call.
  79971. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  79972. // code is an error. Response headers are in either
  79973. // *Policy.ServerResponse.Header or (if a response was returned at all)
  79974. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  79975. // check whether the returned error was because http.StatusNotModified
  79976. // was returned.
  79977. func (c *InterconnectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  79978. gensupport.SetOptions(c.urlParams_, opts...)
  79979. res, err := c.doRequest("json")
  79980. if res != nil && res.StatusCode == http.StatusNotModified {
  79981. if res.Body != nil {
  79982. res.Body.Close()
  79983. }
  79984. return nil, &googleapi.Error{
  79985. Code: res.StatusCode,
  79986. Header: res.Header,
  79987. }
  79988. }
  79989. if err != nil {
  79990. return nil, err
  79991. }
  79992. defer googleapi.CloseBody(res)
  79993. if err := googleapi.CheckResponse(res); err != nil {
  79994. return nil, err
  79995. }
  79996. ret := &Policy{
  79997. ServerResponse: googleapi.ServerResponse{
  79998. Header: res.Header,
  79999. HTTPStatusCode: res.StatusCode,
  80000. },
  80001. }
  80002. target := &ret
  80003. if err := gensupport.DecodeResponse(target, res); err != nil {
  80004. return nil, err
  80005. }
  80006. return ret, nil
  80007. // {
  80008. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  80009. // "httpMethod": "GET",
  80010. // "id": "compute.interconnects.getIamPolicy",
  80011. // "parameterOrder": [
  80012. // "project",
  80013. // "resource"
  80014. // ],
  80015. // "parameters": {
  80016. // "project": {
  80017. // "description": "Project ID for this request.",
  80018. // "location": "path",
  80019. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80020. // "required": true,
  80021. // "type": "string"
  80022. // },
  80023. // "resource": {
  80024. // "description": "Name or id of the resource for this request.",
  80025. // "location": "path",
  80026. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80027. // "required": true,
  80028. // "type": "string"
  80029. // }
  80030. // },
  80031. // "path": "{project}/global/interconnects/{resource}/getIamPolicy",
  80032. // "response": {
  80033. // "$ref": "Policy"
  80034. // },
  80035. // "scopes": [
  80036. // "https://www.googleapis.com/auth/cloud-platform",
  80037. // "https://www.googleapis.com/auth/compute",
  80038. // "https://www.googleapis.com/auth/compute.readonly"
  80039. // ]
  80040. // }
  80041. }
  80042. // method id "compute.interconnects.insert":
  80043. type InterconnectsInsertCall struct {
  80044. s *Service
  80045. project string
  80046. interconnect *Interconnect
  80047. urlParams_ gensupport.URLParams
  80048. ctx_ context.Context
  80049. header_ http.Header
  80050. }
  80051. // Insert: Creates a Interconnect in the specified project using the
  80052. // data included in the request.
  80053. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  80054. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80055. c.project = project
  80056. c.interconnect = interconnect
  80057. return c
  80058. }
  80059. // RequestId sets the optional parameter "requestId": An optional
  80060. // request ID to identify requests. Specify a unique request ID so that
  80061. // if you must retry your request, the server will know to ignore the
  80062. // request if it has already been completed.
  80063. //
  80064. // For example, consider a situation where you make an initial request
  80065. // and the request times out. If you make the request again with the
  80066. // same request ID, the server can check if original operation with the
  80067. // same request ID was received, and if so, will ignore the second
  80068. // request. This prevents clients from accidentally creating duplicate
  80069. // commitments.
  80070. //
  80071. // The request ID must be a valid UUID with the exception that zero UUID
  80072. // is not supported (00000000-0000-0000-0000-000000000000).
  80073. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  80074. c.urlParams_.Set("requestId", requestId)
  80075. return c
  80076. }
  80077. // Fields allows partial responses to be retrieved. See
  80078. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80079. // for more information.
  80080. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  80081. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80082. return c
  80083. }
  80084. // Context sets the context to be used in this call's Do method. Any
  80085. // pending HTTP request will be aborted if the provided context is
  80086. // canceled.
  80087. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  80088. c.ctx_ = ctx
  80089. return c
  80090. }
  80091. // Header returns an http.Header that can be modified by the caller to
  80092. // add HTTP headers to the request.
  80093. func (c *InterconnectsInsertCall) Header() http.Header {
  80094. if c.header_ == nil {
  80095. c.header_ = make(http.Header)
  80096. }
  80097. return c.header_
  80098. }
  80099. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  80100. reqHeaders := make(http.Header)
  80101. for k, v := range c.header_ {
  80102. reqHeaders[k] = v
  80103. }
  80104. reqHeaders.Set("User-Agent", c.s.userAgent())
  80105. var body io.Reader = nil
  80106. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  80107. if err != nil {
  80108. return nil, err
  80109. }
  80110. reqHeaders.Set("Content-Type", "application/json")
  80111. c.urlParams_.Set("alt", alt)
  80112. c.urlParams_.Set("prettyPrint", "false")
  80113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  80114. urls += "?" + c.urlParams_.Encode()
  80115. req, err := http.NewRequest("POST", urls, body)
  80116. if err != nil {
  80117. return nil, err
  80118. }
  80119. req.Header = reqHeaders
  80120. googleapi.Expand(req.URL, map[string]string{
  80121. "project": c.project,
  80122. })
  80123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80124. }
  80125. // Do executes the "compute.interconnects.insert" call.
  80126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80127. // status code is an error. Response headers are in either
  80128. // *Operation.ServerResponse.Header or (if a response was returned at
  80129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80130. // to check whether the returned error was because
  80131. // http.StatusNotModified was returned.
  80132. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80133. gensupport.SetOptions(c.urlParams_, opts...)
  80134. res, err := c.doRequest("json")
  80135. if res != nil && res.StatusCode == http.StatusNotModified {
  80136. if res.Body != nil {
  80137. res.Body.Close()
  80138. }
  80139. return nil, &googleapi.Error{
  80140. Code: res.StatusCode,
  80141. Header: res.Header,
  80142. }
  80143. }
  80144. if err != nil {
  80145. return nil, err
  80146. }
  80147. defer googleapi.CloseBody(res)
  80148. if err := googleapi.CheckResponse(res); err != nil {
  80149. return nil, err
  80150. }
  80151. ret := &Operation{
  80152. ServerResponse: googleapi.ServerResponse{
  80153. Header: res.Header,
  80154. HTTPStatusCode: res.StatusCode,
  80155. },
  80156. }
  80157. target := &ret
  80158. if err := gensupport.DecodeResponse(target, res); err != nil {
  80159. return nil, err
  80160. }
  80161. return ret, nil
  80162. // {
  80163. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  80164. // "httpMethod": "POST",
  80165. // "id": "compute.interconnects.insert",
  80166. // "parameterOrder": [
  80167. // "project"
  80168. // ],
  80169. // "parameters": {
  80170. // "project": {
  80171. // "description": "Project ID for this request.",
  80172. // "location": "path",
  80173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80174. // "required": true,
  80175. // "type": "string"
  80176. // },
  80177. // "requestId": {
  80178. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80179. // "location": "query",
  80180. // "type": "string"
  80181. // }
  80182. // },
  80183. // "path": "{project}/global/interconnects",
  80184. // "request": {
  80185. // "$ref": "Interconnect"
  80186. // },
  80187. // "response": {
  80188. // "$ref": "Operation"
  80189. // },
  80190. // "scopes": [
  80191. // "https://www.googleapis.com/auth/cloud-platform",
  80192. // "https://www.googleapis.com/auth/compute"
  80193. // ]
  80194. // }
  80195. }
  80196. // method id "compute.interconnects.list":
  80197. type InterconnectsListCall struct {
  80198. s *Service
  80199. project string
  80200. urlParams_ gensupport.URLParams
  80201. ifNoneMatch_ string
  80202. ctx_ context.Context
  80203. header_ http.Header
  80204. }
  80205. // List: Retrieves the list of interconnect available to the specified
  80206. // project.
  80207. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  80208. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80209. c.project = project
  80210. return c
  80211. }
  80212. // Filter sets the optional parameter "filter": A filter expression that
  80213. // filters resources listed in the response. The expression must specify
  80214. // the field name, a comparison operator, and the value that you want to
  80215. // use for filtering. The value must be a string, a number, or a
  80216. // boolean. The comparison operator must be either =, !=, >, or <.
  80217. //
  80218. // For example, if you are filtering Compute Engine instances, you can
  80219. // exclude instances named example-instance by specifying name !=
  80220. // example-instance.
  80221. //
  80222. // You can also filter nested fields. For example, you could specify
  80223. // scheduling.automaticRestart = false to include instances only if they
  80224. // are not scheduled for automatic restarts. You can use filtering on
  80225. // nested fields to filter based on resource labels.
  80226. //
  80227. // To filter on multiple expressions, provide each separate expression
  80228. // within parentheses. For example, (scheduling.automaticRestart = true)
  80229. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80230. // AND expression. However, you can include AND and OR expressions
  80231. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80232. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80233. // true).
  80234. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  80235. c.urlParams_.Set("filter", filter)
  80236. return c
  80237. }
  80238. // MaxResults sets the optional parameter "maxResults": The maximum
  80239. // number of results per page that should be returned. If the number of
  80240. // available results is larger than maxResults, Compute Engine returns a
  80241. // nextPageToken that can be used to get the next page of results in
  80242. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80243. // (Default: 500)
  80244. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  80245. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80246. return c
  80247. }
  80248. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80249. // a certain order. By default, results are returned in alphanumerical
  80250. // order based on the resource name.
  80251. //
  80252. // You can also sort results in descending order based on the creation
  80253. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80254. // based on the creationTimestamp field in reverse chronological order
  80255. // (newest result first). Use this to sort resources like operations so
  80256. // that the newest operation is returned first.
  80257. //
  80258. // Currently, only sorting by name or creationTimestamp desc is
  80259. // supported.
  80260. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  80261. c.urlParams_.Set("orderBy", orderBy)
  80262. return c
  80263. }
  80264. // PageToken sets the optional parameter "pageToken": Specifies a page
  80265. // token to use. Set pageToken to the nextPageToken returned by a
  80266. // previous list request to get the next page of results.
  80267. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  80268. c.urlParams_.Set("pageToken", pageToken)
  80269. return c
  80270. }
  80271. // Fields allows partial responses to be retrieved. See
  80272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80273. // for more information.
  80274. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  80275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80276. return c
  80277. }
  80278. // IfNoneMatch sets the optional parameter which makes the operation
  80279. // fail if the object's ETag matches the given value. This is useful for
  80280. // getting updates only after the object has changed since the last
  80281. // request. Use googleapi.IsNotModified to check whether the response
  80282. // error from Do is the result of In-None-Match.
  80283. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  80284. c.ifNoneMatch_ = entityTag
  80285. return c
  80286. }
  80287. // Context sets the context to be used in this call's Do method. Any
  80288. // pending HTTP request will be aborted if the provided context is
  80289. // canceled.
  80290. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  80291. c.ctx_ = ctx
  80292. return c
  80293. }
  80294. // Header returns an http.Header that can be modified by the caller to
  80295. // add HTTP headers to the request.
  80296. func (c *InterconnectsListCall) Header() http.Header {
  80297. if c.header_ == nil {
  80298. c.header_ = make(http.Header)
  80299. }
  80300. return c.header_
  80301. }
  80302. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  80303. reqHeaders := make(http.Header)
  80304. for k, v := range c.header_ {
  80305. reqHeaders[k] = v
  80306. }
  80307. reqHeaders.Set("User-Agent", c.s.userAgent())
  80308. if c.ifNoneMatch_ != "" {
  80309. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80310. }
  80311. var body io.Reader = nil
  80312. c.urlParams_.Set("alt", alt)
  80313. c.urlParams_.Set("prettyPrint", "false")
  80314. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  80315. urls += "?" + c.urlParams_.Encode()
  80316. req, err := http.NewRequest("GET", urls, body)
  80317. if err != nil {
  80318. return nil, err
  80319. }
  80320. req.Header = reqHeaders
  80321. googleapi.Expand(req.URL, map[string]string{
  80322. "project": c.project,
  80323. })
  80324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80325. }
  80326. // Do executes the "compute.interconnects.list" call.
  80327. // Exactly one of *InterconnectList or error will be non-nil. Any
  80328. // non-2xx status code is an error. Response headers are in either
  80329. // *InterconnectList.ServerResponse.Header or (if a response was
  80330. // returned at all) in error.(*googleapi.Error).Header. Use
  80331. // googleapi.IsNotModified to check whether the returned error was
  80332. // because http.StatusNotModified was returned.
  80333. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  80334. gensupport.SetOptions(c.urlParams_, opts...)
  80335. res, err := c.doRequest("json")
  80336. if res != nil && res.StatusCode == http.StatusNotModified {
  80337. if res.Body != nil {
  80338. res.Body.Close()
  80339. }
  80340. return nil, &googleapi.Error{
  80341. Code: res.StatusCode,
  80342. Header: res.Header,
  80343. }
  80344. }
  80345. if err != nil {
  80346. return nil, err
  80347. }
  80348. defer googleapi.CloseBody(res)
  80349. if err := googleapi.CheckResponse(res); err != nil {
  80350. return nil, err
  80351. }
  80352. ret := &InterconnectList{
  80353. ServerResponse: googleapi.ServerResponse{
  80354. Header: res.Header,
  80355. HTTPStatusCode: res.StatusCode,
  80356. },
  80357. }
  80358. target := &ret
  80359. if err := gensupport.DecodeResponse(target, res); err != nil {
  80360. return nil, err
  80361. }
  80362. return ret, nil
  80363. // {
  80364. // "description": "Retrieves the list of interconnect available to the specified project.",
  80365. // "httpMethod": "GET",
  80366. // "id": "compute.interconnects.list",
  80367. // "parameterOrder": [
  80368. // "project"
  80369. // ],
  80370. // "parameters": {
  80371. // "filter": {
  80372. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  80373. // "location": "query",
  80374. // "type": "string"
  80375. // },
  80376. // "maxResults": {
  80377. // "default": "500",
  80378. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  80379. // "format": "uint32",
  80380. // "location": "query",
  80381. // "minimum": "0",
  80382. // "type": "integer"
  80383. // },
  80384. // "orderBy": {
  80385. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  80386. // "location": "query",
  80387. // "type": "string"
  80388. // },
  80389. // "pageToken": {
  80390. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  80391. // "location": "query",
  80392. // "type": "string"
  80393. // },
  80394. // "project": {
  80395. // "description": "Project ID for this request.",
  80396. // "location": "path",
  80397. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80398. // "required": true,
  80399. // "type": "string"
  80400. // }
  80401. // },
  80402. // "path": "{project}/global/interconnects",
  80403. // "response": {
  80404. // "$ref": "InterconnectList"
  80405. // },
  80406. // "scopes": [
  80407. // "https://www.googleapis.com/auth/cloud-platform",
  80408. // "https://www.googleapis.com/auth/compute",
  80409. // "https://www.googleapis.com/auth/compute.readonly"
  80410. // ]
  80411. // }
  80412. }
  80413. // Pages invokes f for each page of results.
  80414. // A non-nil error returned from f will halt the iteration.
  80415. // The provided context supersedes any context provided to the Context method.
  80416. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  80417. c.ctx_ = ctx
  80418. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80419. for {
  80420. x, err := c.Do()
  80421. if err != nil {
  80422. return err
  80423. }
  80424. if err := f(x); err != nil {
  80425. return err
  80426. }
  80427. if x.NextPageToken == "" {
  80428. return nil
  80429. }
  80430. c.PageToken(x.NextPageToken)
  80431. }
  80432. }
  80433. // method id "compute.interconnects.patch":
  80434. type InterconnectsPatchCall struct {
  80435. s *Service
  80436. project string
  80437. interconnect string
  80438. interconnect2 *Interconnect
  80439. urlParams_ gensupport.URLParams
  80440. ctx_ context.Context
  80441. header_ http.Header
  80442. }
  80443. // Patch: Updates the specified interconnect with the data included in
  80444. // the request. This method supports PATCH semantics and uses the JSON
  80445. // merge patch format and processing rules.
  80446. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  80447. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80448. c.project = project
  80449. c.interconnect = interconnect
  80450. c.interconnect2 = interconnect2
  80451. return c
  80452. }
  80453. // RequestId sets the optional parameter "requestId": An optional
  80454. // request ID to identify requests. Specify a unique request ID so that
  80455. // if you must retry your request, the server will know to ignore the
  80456. // request if it has already been completed.
  80457. //
  80458. // For example, consider a situation where you make an initial request
  80459. // and the request times out. If you make the request again with the
  80460. // same request ID, the server can check if original operation with the
  80461. // same request ID was received, and if so, will ignore the second
  80462. // request. This prevents clients from accidentally creating duplicate
  80463. // commitments.
  80464. //
  80465. // The request ID must be a valid UUID with the exception that zero UUID
  80466. // is not supported (00000000-0000-0000-0000-000000000000).
  80467. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  80468. c.urlParams_.Set("requestId", requestId)
  80469. return c
  80470. }
  80471. // Fields allows partial responses to be retrieved. See
  80472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80473. // for more information.
  80474. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  80475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80476. return c
  80477. }
  80478. // Context sets the context to be used in this call's Do method. Any
  80479. // pending HTTP request will be aborted if the provided context is
  80480. // canceled.
  80481. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  80482. c.ctx_ = ctx
  80483. return c
  80484. }
  80485. // Header returns an http.Header that can be modified by the caller to
  80486. // add HTTP headers to the request.
  80487. func (c *InterconnectsPatchCall) Header() http.Header {
  80488. if c.header_ == nil {
  80489. c.header_ = make(http.Header)
  80490. }
  80491. return c.header_
  80492. }
  80493. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  80494. reqHeaders := make(http.Header)
  80495. for k, v := range c.header_ {
  80496. reqHeaders[k] = v
  80497. }
  80498. reqHeaders.Set("User-Agent", c.s.userAgent())
  80499. var body io.Reader = nil
  80500. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  80501. if err != nil {
  80502. return nil, err
  80503. }
  80504. reqHeaders.Set("Content-Type", "application/json")
  80505. c.urlParams_.Set("alt", alt)
  80506. c.urlParams_.Set("prettyPrint", "false")
  80507. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  80508. urls += "?" + c.urlParams_.Encode()
  80509. req, err := http.NewRequest("PATCH", urls, body)
  80510. if err != nil {
  80511. return nil, err
  80512. }
  80513. req.Header = reqHeaders
  80514. googleapi.Expand(req.URL, map[string]string{
  80515. "project": c.project,
  80516. "interconnect": c.interconnect,
  80517. })
  80518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80519. }
  80520. // Do executes the "compute.interconnects.patch" call.
  80521. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80522. // status code is an error. Response headers are in either
  80523. // *Operation.ServerResponse.Header or (if a response was returned at
  80524. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80525. // to check whether the returned error was because
  80526. // http.StatusNotModified was returned.
  80527. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80528. gensupport.SetOptions(c.urlParams_, opts...)
  80529. res, err := c.doRequest("json")
  80530. if res != nil && res.StatusCode == http.StatusNotModified {
  80531. if res.Body != nil {
  80532. res.Body.Close()
  80533. }
  80534. return nil, &googleapi.Error{
  80535. Code: res.StatusCode,
  80536. Header: res.Header,
  80537. }
  80538. }
  80539. if err != nil {
  80540. return nil, err
  80541. }
  80542. defer googleapi.CloseBody(res)
  80543. if err := googleapi.CheckResponse(res); err != nil {
  80544. return nil, err
  80545. }
  80546. ret := &Operation{
  80547. ServerResponse: googleapi.ServerResponse{
  80548. Header: res.Header,
  80549. HTTPStatusCode: res.StatusCode,
  80550. },
  80551. }
  80552. target := &ret
  80553. if err := gensupport.DecodeResponse(target, res); err != nil {
  80554. return nil, err
  80555. }
  80556. return ret, nil
  80557. // {
  80558. // "description": "Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  80559. // "httpMethod": "PATCH",
  80560. // "id": "compute.interconnects.patch",
  80561. // "parameterOrder": [
  80562. // "project",
  80563. // "interconnect"
  80564. // ],
  80565. // "parameters": {
  80566. // "interconnect": {
  80567. // "description": "Name of the interconnect to update.",
  80568. // "location": "path",
  80569. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80570. // "required": true,
  80571. // "type": "string"
  80572. // },
  80573. // "project": {
  80574. // "description": "Project ID for this request.",
  80575. // "location": "path",
  80576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80577. // "required": true,
  80578. // "type": "string"
  80579. // },
  80580. // "requestId": {
  80581. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80582. // "location": "query",
  80583. // "type": "string"
  80584. // }
  80585. // },
  80586. // "path": "{project}/global/interconnects/{interconnect}",
  80587. // "request": {
  80588. // "$ref": "Interconnect"
  80589. // },
  80590. // "response": {
  80591. // "$ref": "Operation"
  80592. // },
  80593. // "scopes": [
  80594. // "https://www.googleapis.com/auth/cloud-platform",
  80595. // "https://www.googleapis.com/auth/compute"
  80596. // ]
  80597. // }
  80598. }
  80599. // method id "compute.interconnects.setIamPolicy":
  80600. type InterconnectsSetIamPolicyCall struct {
  80601. s *Service
  80602. project string
  80603. resource string
  80604. globalsetpolicyrequest *GlobalSetPolicyRequest
  80605. urlParams_ gensupport.URLParams
  80606. ctx_ context.Context
  80607. header_ http.Header
  80608. }
  80609. // SetIamPolicy: Sets the access control policy on the specified
  80610. // resource. Replaces any existing policy.
  80611. func (r *InterconnectsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InterconnectsSetIamPolicyCall {
  80612. c := &InterconnectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80613. c.project = project
  80614. c.resource = resource
  80615. c.globalsetpolicyrequest = globalsetpolicyrequest
  80616. return c
  80617. }
  80618. // Fields allows partial responses to be retrieved. See
  80619. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80620. // for more information.
  80621. func (c *InterconnectsSetIamPolicyCall) Fields(s ...googleapi.Field) *InterconnectsSetIamPolicyCall {
  80622. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80623. return c
  80624. }
  80625. // Context sets the context to be used in this call's Do method. Any
  80626. // pending HTTP request will be aborted if the provided context is
  80627. // canceled.
  80628. func (c *InterconnectsSetIamPolicyCall) Context(ctx context.Context) *InterconnectsSetIamPolicyCall {
  80629. c.ctx_ = ctx
  80630. return c
  80631. }
  80632. // Header returns an http.Header that can be modified by the caller to
  80633. // add HTTP headers to the request.
  80634. func (c *InterconnectsSetIamPolicyCall) Header() http.Header {
  80635. if c.header_ == nil {
  80636. c.header_ = make(http.Header)
  80637. }
  80638. return c.header_
  80639. }
  80640. func (c *InterconnectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  80641. reqHeaders := make(http.Header)
  80642. for k, v := range c.header_ {
  80643. reqHeaders[k] = v
  80644. }
  80645. reqHeaders.Set("User-Agent", c.s.userAgent())
  80646. var body io.Reader = nil
  80647. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  80648. if err != nil {
  80649. return nil, err
  80650. }
  80651. reqHeaders.Set("Content-Type", "application/json")
  80652. c.urlParams_.Set("alt", alt)
  80653. c.urlParams_.Set("prettyPrint", "false")
  80654. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setIamPolicy")
  80655. urls += "?" + c.urlParams_.Encode()
  80656. req, err := http.NewRequest("POST", urls, body)
  80657. if err != nil {
  80658. return nil, err
  80659. }
  80660. req.Header = reqHeaders
  80661. googleapi.Expand(req.URL, map[string]string{
  80662. "project": c.project,
  80663. "resource": c.resource,
  80664. })
  80665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80666. }
  80667. // Do executes the "compute.interconnects.setIamPolicy" call.
  80668. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  80669. // code is an error. Response headers are in either
  80670. // *Policy.ServerResponse.Header or (if a response was returned at all)
  80671. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  80672. // check whether the returned error was because http.StatusNotModified
  80673. // was returned.
  80674. func (c *InterconnectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  80675. gensupport.SetOptions(c.urlParams_, opts...)
  80676. res, err := c.doRequest("json")
  80677. if res != nil && res.StatusCode == http.StatusNotModified {
  80678. if res.Body != nil {
  80679. res.Body.Close()
  80680. }
  80681. return nil, &googleapi.Error{
  80682. Code: res.StatusCode,
  80683. Header: res.Header,
  80684. }
  80685. }
  80686. if err != nil {
  80687. return nil, err
  80688. }
  80689. defer googleapi.CloseBody(res)
  80690. if err := googleapi.CheckResponse(res); err != nil {
  80691. return nil, err
  80692. }
  80693. ret := &Policy{
  80694. ServerResponse: googleapi.ServerResponse{
  80695. Header: res.Header,
  80696. HTTPStatusCode: res.StatusCode,
  80697. },
  80698. }
  80699. target := &ret
  80700. if err := gensupport.DecodeResponse(target, res); err != nil {
  80701. return nil, err
  80702. }
  80703. return ret, nil
  80704. // {
  80705. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  80706. // "httpMethod": "POST",
  80707. // "id": "compute.interconnects.setIamPolicy",
  80708. // "parameterOrder": [
  80709. // "project",
  80710. // "resource"
  80711. // ],
  80712. // "parameters": {
  80713. // "project": {
  80714. // "description": "Project ID for this request.",
  80715. // "location": "path",
  80716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80717. // "required": true,
  80718. // "type": "string"
  80719. // },
  80720. // "resource": {
  80721. // "description": "Name or id of the resource for this request.",
  80722. // "location": "path",
  80723. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80724. // "required": true,
  80725. // "type": "string"
  80726. // }
  80727. // },
  80728. // "path": "{project}/global/interconnects/{resource}/setIamPolicy",
  80729. // "request": {
  80730. // "$ref": "GlobalSetPolicyRequest"
  80731. // },
  80732. // "response": {
  80733. // "$ref": "Policy"
  80734. // },
  80735. // "scopes": [
  80736. // "https://www.googleapis.com/auth/cloud-platform",
  80737. // "https://www.googleapis.com/auth/compute"
  80738. // ]
  80739. // }
  80740. }
  80741. // method id "compute.interconnects.setLabels":
  80742. type InterconnectsSetLabelsCall struct {
  80743. s *Service
  80744. project string
  80745. resource string
  80746. globalsetlabelsrequest *GlobalSetLabelsRequest
  80747. urlParams_ gensupport.URLParams
  80748. ctx_ context.Context
  80749. header_ http.Header
  80750. }
  80751. // SetLabels: Sets the labels on an Interconnect. To learn more about
  80752. // labels, read the Labeling Resources documentation.
  80753. func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall {
  80754. c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80755. c.project = project
  80756. c.resource = resource
  80757. c.globalsetlabelsrequest = globalsetlabelsrequest
  80758. return c
  80759. }
  80760. // Fields allows partial responses to be retrieved. See
  80761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80762. // for more information.
  80763. func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall {
  80764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80765. return c
  80766. }
  80767. // Context sets the context to be used in this call's Do method. Any
  80768. // pending HTTP request will be aborted if the provided context is
  80769. // canceled.
  80770. func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall {
  80771. c.ctx_ = ctx
  80772. return c
  80773. }
  80774. // Header returns an http.Header that can be modified by the caller to
  80775. // add HTTP headers to the request.
  80776. func (c *InterconnectsSetLabelsCall) Header() http.Header {
  80777. if c.header_ == nil {
  80778. c.header_ = make(http.Header)
  80779. }
  80780. return c.header_
  80781. }
  80782. func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  80783. reqHeaders := make(http.Header)
  80784. for k, v := range c.header_ {
  80785. reqHeaders[k] = v
  80786. }
  80787. reqHeaders.Set("User-Agent", c.s.userAgent())
  80788. var body io.Reader = nil
  80789. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  80790. if err != nil {
  80791. return nil, err
  80792. }
  80793. reqHeaders.Set("Content-Type", "application/json")
  80794. c.urlParams_.Set("alt", alt)
  80795. c.urlParams_.Set("prettyPrint", "false")
  80796. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setLabels")
  80797. urls += "?" + c.urlParams_.Encode()
  80798. req, err := http.NewRequest("POST", urls, body)
  80799. if err != nil {
  80800. return nil, err
  80801. }
  80802. req.Header = reqHeaders
  80803. googleapi.Expand(req.URL, map[string]string{
  80804. "project": c.project,
  80805. "resource": c.resource,
  80806. })
  80807. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80808. }
  80809. // Do executes the "compute.interconnects.setLabels" call.
  80810. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80811. // status code is an error. Response headers are in either
  80812. // *Operation.ServerResponse.Header or (if a response was returned at
  80813. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80814. // to check whether the returned error was because
  80815. // http.StatusNotModified was returned.
  80816. func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80817. gensupport.SetOptions(c.urlParams_, opts...)
  80818. res, err := c.doRequest("json")
  80819. if res != nil && res.StatusCode == http.StatusNotModified {
  80820. if res.Body != nil {
  80821. res.Body.Close()
  80822. }
  80823. return nil, &googleapi.Error{
  80824. Code: res.StatusCode,
  80825. Header: res.Header,
  80826. }
  80827. }
  80828. if err != nil {
  80829. return nil, err
  80830. }
  80831. defer googleapi.CloseBody(res)
  80832. if err := googleapi.CheckResponse(res); err != nil {
  80833. return nil, err
  80834. }
  80835. ret := &Operation{
  80836. ServerResponse: googleapi.ServerResponse{
  80837. Header: res.Header,
  80838. HTTPStatusCode: res.StatusCode,
  80839. },
  80840. }
  80841. target := &ret
  80842. if err := gensupport.DecodeResponse(target, res); err != nil {
  80843. return nil, err
  80844. }
  80845. return ret, nil
  80846. // {
  80847. // "description": "Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.",
  80848. // "httpMethod": "POST",
  80849. // "id": "compute.interconnects.setLabels",
  80850. // "parameterOrder": [
  80851. // "project",
  80852. // "resource"
  80853. // ],
  80854. // "parameters": {
  80855. // "project": {
  80856. // "description": "Project ID for this request.",
  80857. // "location": "path",
  80858. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80859. // "required": true,
  80860. // "type": "string"
  80861. // },
  80862. // "resource": {
  80863. // "description": "Name or id of the resource for this request.",
  80864. // "location": "path",
  80865. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80866. // "required": true,
  80867. // "type": "string"
  80868. // }
  80869. // },
  80870. // "path": "{project}/global/interconnects/{resource}/setLabels",
  80871. // "request": {
  80872. // "$ref": "GlobalSetLabelsRequest"
  80873. // },
  80874. // "response": {
  80875. // "$ref": "Operation"
  80876. // },
  80877. // "scopes": [
  80878. // "https://www.googleapis.com/auth/cloud-platform",
  80879. // "https://www.googleapis.com/auth/compute"
  80880. // ]
  80881. // }
  80882. }
  80883. // method id "compute.interconnects.testIamPermissions":
  80884. type InterconnectsTestIamPermissionsCall struct {
  80885. s *Service
  80886. project string
  80887. resource string
  80888. testpermissionsrequest *TestPermissionsRequest
  80889. urlParams_ gensupport.URLParams
  80890. ctx_ context.Context
  80891. header_ http.Header
  80892. }
  80893. // TestIamPermissions: Returns permissions that a caller has on the
  80894. // specified resource.
  80895. func (r *InterconnectsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectsTestIamPermissionsCall {
  80896. c := &InterconnectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80897. c.project = project
  80898. c.resource = resource
  80899. c.testpermissionsrequest = testpermissionsrequest
  80900. return c
  80901. }
  80902. // Fields allows partial responses to be retrieved. See
  80903. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80904. // for more information.
  80905. func (c *InterconnectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectsTestIamPermissionsCall {
  80906. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80907. return c
  80908. }
  80909. // Context sets the context to be used in this call's Do method. Any
  80910. // pending HTTP request will be aborted if the provided context is
  80911. // canceled.
  80912. func (c *InterconnectsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectsTestIamPermissionsCall {
  80913. c.ctx_ = ctx
  80914. return c
  80915. }
  80916. // Header returns an http.Header that can be modified by the caller to
  80917. // add HTTP headers to the request.
  80918. func (c *InterconnectsTestIamPermissionsCall) Header() http.Header {
  80919. if c.header_ == nil {
  80920. c.header_ = make(http.Header)
  80921. }
  80922. return c.header_
  80923. }
  80924. func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  80925. reqHeaders := make(http.Header)
  80926. for k, v := range c.header_ {
  80927. reqHeaders[k] = v
  80928. }
  80929. reqHeaders.Set("User-Agent", c.s.userAgent())
  80930. var body io.Reader = nil
  80931. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  80932. if err != nil {
  80933. return nil, err
  80934. }
  80935. reqHeaders.Set("Content-Type", "application/json")
  80936. c.urlParams_.Set("alt", alt)
  80937. c.urlParams_.Set("prettyPrint", "false")
  80938. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/testIamPermissions")
  80939. urls += "?" + c.urlParams_.Encode()
  80940. req, err := http.NewRequest("POST", urls, body)
  80941. if err != nil {
  80942. return nil, err
  80943. }
  80944. req.Header = reqHeaders
  80945. googleapi.Expand(req.URL, map[string]string{
  80946. "project": c.project,
  80947. "resource": c.resource,
  80948. })
  80949. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80950. }
  80951. // Do executes the "compute.interconnects.testIamPermissions" call.
  80952. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  80953. // non-2xx status code is an error. Response headers are in either
  80954. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  80955. // returned at all) in error.(*googleapi.Error).Header. Use
  80956. // googleapi.IsNotModified to check whether the returned error was
  80957. // because http.StatusNotModified was returned.
  80958. func (c *InterconnectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  80959. gensupport.SetOptions(c.urlParams_, opts...)
  80960. res, err := c.doRequest("json")
  80961. if res != nil && res.StatusCode == http.StatusNotModified {
  80962. if res.Body != nil {
  80963. res.Body.Close()
  80964. }
  80965. return nil, &googleapi.Error{
  80966. Code: res.StatusCode,
  80967. Header: res.Header,
  80968. }
  80969. }
  80970. if err != nil {
  80971. return nil, err
  80972. }
  80973. defer googleapi.CloseBody(res)
  80974. if err := googleapi.CheckResponse(res); err != nil {
  80975. return nil, err
  80976. }
  80977. ret := &TestPermissionsResponse{
  80978. ServerResponse: googleapi.ServerResponse{
  80979. Header: res.Header,
  80980. HTTPStatusCode: res.StatusCode,
  80981. },
  80982. }
  80983. target := &ret
  80984. if err := gensupport.DecodeResponse(target, res); err != nil {
  80985. return nil, err
  80986. }
  80987. return ret, nil
  80988. // {
  80989. // "description": "Returns permissions that a caller has on the specified resource.",
  80990. // "httpMethod": "POST",
  80991. // "id": "compute.interconnects.testIamPermissions",
  80992. // "parameterOrder": [
  80993. // "project",
  80994. // "resource"
  80995. // ],
  80996. // "parameters": {
  80997. // "project": {
  80998. // "description": "Project ID for this request.",
  80999. // "location": "path",
  81000. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81001. // "required": true,
  81002. // "type": "string"
  81003. // },
  81004. // "resource": {
  81005. // "description": "Name or id of the resource for this request.",
  81006. // "location": "path",
  81007. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81008. // "required": true,
  81009. // "type": "string"
  81010. // }
  81011. // },
  81012. // "path": "{project}/global/interconnects/{resource}/testIamPermissions",
  81013. // "request": {
  81014. // "$ref": "TestPermissionsRequest"
  81015. // },
  81016. // "response": {
  81017. // "$ref": "TestPermissionsResponse"
  81018. // },
  81019. // "scopes": [
  81020. // "https://www.googleapis.com/auth/cloud-platform",
  81021. // "https://www.googleapis.com/auth/compute",
  81022. // "https://www.googleapis.com/auth/compute.readonly"
  81023. // ]
  81024. // }
  81025. }
  81026. // method id "compute.licenseCodes.get":
  81027. type LicenseCodesGetCall struct {
  81028. s *Service
  81029. project string
  81030. licenseCode string
  81031. urlParams_ gensupport.URLParams
  81032. ifNoneMatch_ string
  81033. ctx_ context.Context
  81034. header_ http.Header
  81035. }
  81036. // Get: Return a specified license code. License codes are mirrored
  81037. // across all projects that have permissions to read the License Code.
  81038. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  81039. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81040. c.project = project
  81041. c.licenseCode = licenseCode
  81042. return c
  81043. }
  81044. // Fields allows partial responses to be retrieved. See
  81045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81046. // for more information.
  81047. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  81048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81049. return c
  81050. }
  81051. // IfNoneMatch sets the optional parameter which makes the operation
  81052. // fail if the object's ETag matches the given value. This is useful for
  81053. // getting updates only after the object has changed since the last
  81054. // request. Use googleapi.IsNotModified to check whether the response
  81055. // error from Do is the result of In-None-Match.
  81056. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  81057. c.ifNoneMatch_ = entityTag
  81058. return c
  81059. }
  81060. // Context sets the context to be used in this call's Do method. Any
  81061. // pending HTTP request will be aborted if the provided context is
  81062. // canceled.
  81063. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  81064. c.ctx_ = ctx
  81065. return c
  81066. }
  81067. // Header returns an http.Header that can be modified by the caller to
  81068. // add HTTP headers to the request.
  81069. func (c *LicenseCodesGetCall) Header() http.Header {
  81070. if c.header_ == nil {
  81071. c.header_ = make(http.Header)
  81072. }
  81073. return c.header_
  81074. }
  81075. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  81076. reqHeaders := make(http.Header)
  81077. for k, v := range c.header_ {
  81078. reqHeaders[k] = v
  81079. }
  81080. reqHeaders.Set("User-Agent", c.s.userAgent())
  81081. if c.ifNoneMatch_ != "" {
  81082. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81083. }
  81084. var body io.Reader = nil
  81085. c.urlParams_.Set("alt", alt)
  81086. c.urlParams_.Set("prettyPrint", "false")
  81087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  81088. urls += "?" + c.urlParams_.Encode()
  81089. req, err := http.NewRequest("GET", urls, body)
  81090. if err != nil {
  81091. return nil, err
  81092. }
  81093. req.Header = reqHeaders
  81094. googleapi.Expand(req.URL, map[string]string{
  81095. "project": c.project,
  81096. "licenseCode": c.licenseCode,
  81097. })
  81098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81099. }
  81100. // Do executes the "compute.licenseCodes.get" call.
  81101. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  81102. // status code is an error. Response headers are in either
  81103. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  81104. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81105. // to check whether the returned error was because
  81106. // http.StatusNotModified was returned.
  81107. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  81108. gensupport.SetOptions(c.urlParams_, opts...)
  81109. res, err := c.doRequest("json")
  81110. if res != nil && res.StatusCode == http.StatusNotModified {
  81111. if res.Body != nil {
  81112. res.Body.Close()
  81113. }
  81114. return nil, &googleapi.Error{
  81115. Code: res.StatusCode,
  81116. Header: res.Header,
  81117. }
  81118. }
  81119. if err != nil {
  81120. return nil, err
  81121. }
  81122. defer googleapi.CloseBody(res)
  81123. if err := googleapi.CheckResponse(res); err != nil {
  81124. return nil, err
  81125. }
  81126. ret := &LicenseCode{
  81127. ServerResponse: googleapi.ServerResponse{
  81128. Header: res.Header,
  81129. HTTPStatusCode: res.StatusCode,
  81130. },
  81131. }
  81132. target := &ret
  81133. if err := gensupport.DecodeResponse(target, res); err != nil {
  81134. return nil, err
  81135. }
  81136. return ret, nil
  81137. // {
  81138. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  81139. // "httpMethod": "GET",
  81140. // "id": "compute.licenseCodes.get",
  81141. // "parameterOrder": [
  81142. // "project",
  81143. // "licenseCode"
  81144. // ],
  81145. // "parameters": {
  81146. // "licenseCode": {
  81147. // "description": "Number corresponding to the License code resource to return.",
  81148. // "location": "path",
  81149. // "pattern": "[0-9]{0,61}?",
  81150. // "required": true,
  81151. // "type": "string"
  81152. // },
  81153. // "project": {
  81154. // "description": "Project ID for this request.",
  81155. // "location": "path",
  81156. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81157. // "required": true,
  81158. // "type": "string"
  81159. // }
  81160. // },
  81161. // "path": "{project}/global/licenseCodes/{licenseCode}",
  81162. // "response": {
  81163. // "$ref": "LicenseCode"
  81164. // },
  81165. // "scopes": [
  81166. // "https://www.googleapis.com/auth/cloud-platform",
  81167. // "https://www.googleapis.com/auth/compute",
  81168. // "https://www.googleapis.com/auth/compute.readonly"
  81169. // ]
  81170. // }
  81171. }
  81172. // method id "compute.licenseCodes.getIamPolicy":
  81173. type LicenseCodesGetIamPolicyCall struct {
  81174. s *Service
  81175. project string
  81176. resource string
  81177. urlParams_ gensupport.URLParams
  81178. ifNoneMatch_ string
  81179. ctx_ context.Context
  81180. header_ http.Header
  81181. }
  81182. // GetIamPolicy: Gets the access control policy for a resource. May be
  81183. // empty if no such policy or resource exists.
  81184. func (r *LicenseCodesService) GetIamPolicy(project string, resource string) *LicenseCodesGetIamPolicyCall {
  81185. c := &LicenseCodesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81186. c.project = project
  81187. c.resource = resource
  81188. return c
  81189. }
  81190. // Fields allows partial responses to be retrieved. See
  81191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81192. // for more information.
  81193. func (c *LicenseCodesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesGetIamPolicyCall {
  81194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81195. return c
  81196. }
  81197. // IfNoneMatch sets the optional parameter which makes the operation
  81198. // fail if the object's ETag matches the given value. This is useful for
  81199. // getting updates only after the object has changed since the last
  81200. // request. Use googleapi.IsNotModified to check whether the response
  81201. // error from Do is the result of In-None-Match.
  81202. func (c *LicenseCodesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicenseCodesGetIamPolicyCall {
  81203. c.ifNoneMatch_ = entityTag
  81204. return c
  81205. }
  81206. // Context sets the context to be used in this call's Do method. Any
  81207. // pending HTTP request will be aborted if the provided context is
  81208. // canceled.
  81209. func (c *LicenseCodesGetIamPolicyCall) Context(ctx context.Context) *LicenseCodesGetIamPolicyCall {
  81210. c.ctx_ = ctx
  81211. return c
  81212. }
  81213. // Header returns an http.Header that can be modified by the caller to
  81214. // add HTTP headers to the request.
  81215. func (c *LicenseCodesGetIamPolicyCall) Header() http.Header {
  81216. if c.header_ == nil {
  81217. c.header_ = make(http.Header)
  81218. }
  81219. return c.header_
  81220. }
  81221. func (c *LicenseCodesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  81222. reqHeaders := make(http.Header)
  81223. for k, v := range c.header_ {
  81224. reqHeaders[k] = v
  81225. }
  81226. reqHeaders.Set("User-Agent", c.s.userAgent())
  81227. if c.ifNoneMatch_ != "" {
  81228. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81229. }
  81230. var body io.Reader = nil
  81231. c.urlParams_.Set("alt", alt)
  81232. c.urlParams_.Set("prettyPrint", "false")
  81233. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/getIamPolicy")
  81234. urls += "?" + c.urlParams_.Encode()
  81235. req, err := http.NewRequest("GET", urls, body)
  81236. if err != nil {
  81237. return nil, err
  81238. }
  81239. req.Header = reqHeaders
  81240. googleapi.Expand(req.URL, map[string]string{
  81241. "project": c.project,
  81242. "resource": c.resource,
  81243. })
  81244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81245. }
  81246. // Do executes the "compute.licenseCodes.getIamPolicy" call.
  81247. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  81248. // code is an error. Response headers are in either
  81249. // *Policy.ServerResponse.Header or (if a response was returned at all)
  81250. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81251. // check whether the returned error was because http.StatusNotModified
  81252. // was returned.
  81253. func (c *LicenseCodesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  81254. gensupport.SetOptions(c.urlParams_, opts...)
  81255. res, err := c.doRequest("json")
  81256. if res != nil && res.StatusCode == http.StatusNotModified {
  81257. if res.Body != nil {
  81258. res.Body.Close()
  81259. }
  81260. return nil, &googleapi.Error{
  81261. Code: res.StatusCode,
  81262. Header: res.Header,
  81263. }
  81264. }
  81265. if err != nil {
  81266. return nil, err
  81267. }
  81268. defer googleapi.CloseBody(res)
  81269. if err := googleapi.CheckResponse(res); err != nil {
  81270. return nil, err
  81271. }
  81272. ret := &Policy{
  81273. ServerResponse: googleapi.ServerResponse{
  81274. Header: res.Header,
  81275. HTTPStatusCode: res.StatusCode,
  81276. },
  81277. }
  81278. target := &ret
  81279. if err := gensupport.DecodeResponse(target, res); err != nil {
  81280. return nil, err
  81281. }
  81282. return ret, nil
  81283. // {
  81284. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  81285. // "httpMethod": "GET",
  81286. // "id": "compute.licenseCodes.getIamPolicy",
  81287. // "parameterOrder": [
  81288. // "project",
  81289. // "resource"
  81290. // ],
  81291. // "parameters": {
  81292. // "project": {
  81293. // "description": "Project ID for this request.",
  81294. // "location": "path",
  81295. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81296. // "required": true,
  81297. // "type": "string"
  81298. // },
  81299. // "resource": {
  81300. // "description": "Name or id of the resource for this request.",
  81301. // "location": "path",
  81302. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81303. // "required": true,
  81304. // "type": "string"
  81305. // }
  81306. // },
  81307. // "path": "{project}/global/licenseCodes/{resource}/getIamPolicy",
  81308. // "response": {
  81309. // "$ref": "Policy"
  81310. // },
  81311. // "scopes": [
  81312. // "https://www.googleapis.com/auth/cloud-platform",
  81313. // "https://www.googleapis.com/auth/compute",
  81314. // "https://www.googleapis.com/auth/compute.readonly"
  81315. // ]
  81316. // }
  81317. }
  81318. // method id "compute.licenseCodes.setIamPolicy":
  81319. type LicenseCodesSetIamPolicyCall struct {
  81320. s *Service
  81321. project string
  81322. resource string
  81323. globalsetpolicyrequest *GlobalSetPolicyRequest
  81324. urlParams_ gensupport.URLParams
  81325. ctx_ context.Context
  81326. header_ http.Header
  81327. }
  81328. // SetIamPolicy: Sets the access control policy on the specified
  81329. // resource. Replaces any existing policy.
  81330. func (r *LicenseCodesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicenseCodesSetIamPolicyCall {
  81331. c := &LicenseCodesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81332. c.project = project
  81333. c.resource = resource
  81334. c.globalsetpolicyrequest = globalsetpolicyrequest
  81335. return c
  81336. }
  81337. // Fields allows partial responses to be retrieved. See
  81338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81339. // for more information.
  81340. func (c *LicenseCodesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicenseCodesSetIamPolicyCall {
  81341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81342. return c
  81343. }
  81344. // Context sets the context to be used in this call's Do method. Any
  81345. // pending HTTP request will be aborted if the provided context is
  81346. // canceled.
  81347. func (c *LicenseCodesSetIamPolicyCall) Context(ctx context.Context) *LicenseCodesSetIamPolicyCall {
  81348. c.ctx_ = ctx
  81349. return c
  81350. }
  81351. // Header returns an http.Header that can be modified by the caller to
  81352. // add HTTP headers to the request.
  81353. func (c *LicenseCodesSetIamPolicyCall) Header() http.Header {
  81354. if c.header_ == nil {
  81355. c.header_ = make(http.Header)
  81356. }
  81357. return c.header_
  81358. }
  81359. func (c *LicenseCodesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  81360. reqHeaders := make(http.Header)
  81361. for k, v := range c.header_ {
  81362. reqHeaders[k] = v
  81363. }
  81364. reqHeaders.Set("User-Agent", c.s.userAgent())
  81365. var body io.Reader = nil
  81366. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  81367. if err != nil {
  81368. return nil, err
  81369. }
  81370. reqHeaders.Set("Content-Type", "application/json")
  81371. c.urlParams_.Set("alt", alt)
  81372. c.urlParams_.Set("prettyPrint", "false")
  81373. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/setIamPolicy")
  81374. urls += "?" + c.urlParams_.Encode()
  81375. req, err := http.NewRequest("POST", urls, body)
  81376. if err != nil {
  81377. return nil, err
  81378. }
  81379. req.Header = reqHeaders
  81380. googleapi.Expand(req.URL, map[string]string{
  81381. "project": c.project,
  81382. "resource": c.resource,
  81383. })
  81384. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81385. }
  81386. // Do executes the "compute.licenseCodes.setIamPolicy" call.
  81387. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  81388. // code is an error. Response headers are in either
  81389. // *Policy.ServerResponse.Header or (if a response was returned at all)
  81390. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81391. // check whether the returned error was because http.StatusNotModified
  81392. // was returned.
  81393. func (c *LicenseCodesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  81394. gensupport.SetOptions(c.urlParams_, opts...)
  81395. res, err := c.doRequest("json")
  81396. if res != nil && res.StatusCode == http.StatusNotModified {
  81397. if res.Body != nil {
  81398. res.Body.Close()
  81399. }
  81400. return nil, &googleapi.Error{
  81401. Code: res.StatusCode,
  81402. Header: res.Header,
  81403. }
  81404. }
  81405. if err != nil {
  81406. return nil, err
  81407. }
  81408. defer googleapi.CloseBody(res)
  81409. if err := googleapi.CheckResponse(res); err != nil {
  81410. return nil, err
  81411. }
  81412. ret := &Policy{
  81413. ServerResponse: googleapi.ServerResponse{
  81414. Header: res.Header,
  81415. HTTPStatusCode: res.StatusCode,
  81416. },
  81417. }
  81418. target := &ret
  81419. if err := gensupport.DecodeResponse(target, res); err != nil {
  81420. return nil, err
  81421. }
  81422. return ret, nil
  81423. // {
  81424. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  81425. // "httpMethod": "POST",
  81426. // "id": "compute.licenseCodes.setIamPolicy",
  81427. // "parameterOrder": [
  81428. // "project",
  81429. // "resource"
  81430. // ],
  81431. // "parameters": {
  81432. // "project": {
  81433. // "description": "Project ID for this request.",
  81434. // "location": "path",
  81435. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81436. // "required": true,
  81437. // "type": "string"
  81438. // },
  81439. // "resource": {
  81440. // "description": "Name or id of the resource for this request.",
  81441. // "location": "path",
  81442. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81443. // "required": true,
  81444. // "type": "string"
  81445. // }
  81446. // },
  81447. // "path": "{project}/global/licenseCodes/{resource}/setIamPolicy",
  81448. // "request": {
  81449. // "$ref": "GlobalSetPolicyRequest"
  81450. // },
  81451. // "response": {
  81452. // "$ref": "Policy"
  81453. // },
  81454. // "scopes": [
  81455. // "https://www.googleapis.com/auth/cloud-platform",
  81456. // "https://www.googleapis.com/auth/compute"
  81457. // ]
  81458. // }
  81459. }
  81460. // method id "compute.licenseCodes.testIamPermissions":
  81461. type LicenseCodesTestIamPermissionsCall struct {
  81462. s *Service
  81463. project string
  81464. resource string
  81465. testpermissionsrequest *TestPermissionsRequest
  81466. urlParams_ gensupport.URLParams
  81467. ctx_ context.Context
  81468. header_ http.Header
  81469. }
  81470. // TestIamPermissions: Returns permissions that a caller has on the
  81471. // specified resource.
  81472. func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
  81473. c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81474. c.project = project
  81475. c.resource = resource
  81476. c.testpermissionsrequest = testpermissionsrequest
  81477. return c
  81478. }
  81479. // Fields allows partial responses to be retrieved. See
  81480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81481. // for more information.
  81482. func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
  81483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81484. return c
  81485. }
  81486. // Context sets the context to be used in this call's Do method. Any
  81487. // pending HTTP request will be aborted if the provided context is
  81488. // canceled.
  81489. func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
  81490. c.ctx_ = ctx
  81491. return c
  81492. }
  81493. // Header returns an http.Header that can be modified by the caller to
  81494. // add HTTP headers to the request.
  81495. func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header {
  81496. if c.header_ == nil {
  81497. c.header_ = make(http.Header)
  81498. }
  81499. return c.header_
  81500. }
  81501. func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  81502. reqHeaders := make(http.Header)
  81503. for k, v := range c.header_ {
  81504. reqHeaders[k] = v
  81505. }
  81506. reqHeaders.Set("User-Agent", c.s.userAgent())
  81507. var body io.Reader = nil
  81508. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  81509. if err != nil {
  81510. return nil, err
  81511. }
  81512. reqHeaders.Set("Content-Type", "application/json")
  81513. c.urlParams_.Set("alt", alt)
  81514. c.urlParams_.Set("prettyPrint", "false")
  81515. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
  81516. urls += "?" + c.urlParams_.Encode()
  81517. req, err := http.NewRequest("POST", urls, body)
  81518. if err != nil {
  81519. return nil, err
  81520. }
  81521. req.Header = reqHeaders
  81522. googleapi.Expand(req.URL, map[string]string{
  81523. "project": c.project,
  81524. "resource": c.resource,
  81525. })
  81526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81527. }
  81528. // Do executes the "compute.licenseCodes.testIamPermissions" call.
  81529. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  81530. // non-2xx status code is an error. Response headers are in either
  81531. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  81532. // returned at all) in error.(*googleapi.Error).Header. Use
  81533. // googleapi.IsNotModified to check whether the returned error was
  81534. // because http.StatusNotModified was returned.
  81535. func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  81536. gensupport.SetOptions(c.urlParams_, opts...)
  81537. res, err := c.doRequest("json")
  81538. if res != nil && res.StatusCode == http.StatusNotModified {
  81539. if res.Body != nil {
  81540. res.Body.Close()
  81541. }
  81542. return nil, &googleapi.Error{
  81543. Code: res.StatusCode,
  81544. Header: res.Header,
  81545. }
  81546. }
  81547. if err != nil {
  81548. return nil, err
  81549. }
  81550. defer googleapi.CloseBody(res)
  81551. if err := googleapi.CheckResponse(res); err != nil {
  81552. return nil, err
  81553. }
  81554. ret := &TestPermissionsResponse{
  81555. ServerResponse: googleapi.ServerResponse{
  81556. Header: res.Header,
  81557. HTTPStatusCode: res.StatusCode,
  81558. },
  81559. }
  81560. target := &ret
  81561. if err := gensupport.DecodeResponse(target, res); err != nil {
  81562. return nil, err
  81563. }
  81564. return ret, nil
  81565. // {
  81566. // "description": "Returns permissions that a caller has on the specified resource.",
  81567. // "httpMethod": "POST",
  81568. // "id": "compute.licenseCodes.testIamPermissions",
  81569. // "parameterOrder": [
  81570. // "project",
  81571. // "resource"
  81572. // ],
  81573. // "parameters": {
  81574. // "project": {
  81575. // "description": "Project ID for this request.",
  81576. // "location": "path",
  81577. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81578. // "required": true,
  81579. // "type": "string"
  81580. // },
  81581. // "resource": {
  81582. // "description": "Name or id of the resource for this request.",
  81583. // "location": "path",
  81584. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81585. // "required": true,
  81586. // "type": "string"
  81587. // }
  81588. // },
  81589. // "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
  81590. // "request": {
  81591. // "$ref": "TestPermissionsRequest"
  81592. // },
  81593. // "response": {
  81594. // "$ref": "TestPermissionsResponse"
  81595. // },
  81596. // "scopes": [
  81597. // "https://www.googleapis.com/auth/cloud-platform",
  81598. // "https://www.googleapis.com/auth/compute",
  81599. // "https://www.googleapis.com/auth/compute.readonly"
  81600. // ]
  81601. // }
  81602. }
  81603. // method id "compute.licenses.delete":
  81604. type LicensesDeleteCall struct {
  81605. s *Service
  81606. project string
  81607. license string
  81608. urlParams_ gensupport.URLParams
  81609. ctx_ context.Context
  81610. header_ http.Header
  81611. }
  81612. // Delete: Deletes the specified license.
  81613. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  81614. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81615. c.project = project
  81616. c.license = license
  81617. return c
  81618. }
  81619. // RequestId sets the optional parameter "requestId": An optional
  81620. // request ID to identify requests. Specify a unique request ID so that
  81621. // if you must retry your request, the server will know to ignore the
  81622. // request if it has already been completed.
  81623. //
  81624. // For example, consider a situation where you make an initial request
  81625. // and the request times out. If you make the request again with the
  81626. // same request ID, the server can check if original operation with the
  81627. // same request ID was received, and if so, will ignore the second
  81628. // request. This prevents clients from accidentally creating duplicate
  81629. // commitments.
  81630. //
  81631. // The request ID must be a valid UUID with the exception that zero UUID
  81632. // is not supported (00000000-0000-0000-0000-000000000000).
  81633. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  81634. c.urlParams_.Set("requestId", requestId)
  81635. return c
  81636. }
  81637. // Fields allows partial responses to be retrieved. See
  81638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81639. // for more information.
  81640. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  81641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81642. return c
  81643. }
  81644. // Context sets the context to be used in this call's Do method. Any
  81645. // pending HTTP request will be aborted if the provided context is
  81646. // canceled.
  81647. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  81648. c.ctx_ = ctx
  81649. return c
  81650. }
  81651. // Header returns an http.Header that can be modified by the caller to
  81652. // add HTTP headers to the request.
  81653. func (c *LicensesDeleteCall) Header() http.Header {
  81654. if c.header_ == nil {
  81655. c.header_ = make(http.Header)
  81656. }
  81657. return c.header_
  81658. }
  81659. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  81660. reqHeaders := make(http.Header)
  81661. for k, v := range c.header_ {
  81662. reqHeaders[k] = v
  81663. }
  81664. reqHeaders.Set("User-Agent", c.s.userAgent())
  81665. var body io.Reader = nil
  81666. c.urlParams_.Set("alt", alt)
  81667. c.urlParams_.Set("prettyPrint", "false")
  81668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  81669. urls += "?" + c.urlParams_.Encode()
  81670. req, err := http.NewRequest("DELETE", urls, body)
  81671. if err != nil {
  81672. return nil, err
  81673. }
  81674. req.Header = reqHeaders
  81675. googleapi.Expand(req.URL, map[string]string{
  81676. "project": c.project,
  81677. "license": c.license,
  81678. })
  81679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81680. }
  81681. // Do executes the "compute.licenses.delete" call.
  81682. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81683. // status code is an error. Response headers are in either
  81684. // *Operation.ServerResponse.Header or (if a response was returned at
  81685. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81686. // to check whether the returned error was because
  81687. // http.StatusNotModified was returned.
  81688. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81689. gensupport.SetOptions(c.urlParams_, opts...)
  81690. res, err := c.doRequest("json")
  81691. if res != nil && res.StatusCode == http.StatusNotModified {
  81692. if res.Body != nil {
  81693. res.Body.Close()
  81694. }
  81695. return nil, &googleapi.Error{
  81696. Code: res.StatusCode,
  81697. Header: res.Header,
  81698. }
  81699. }
  81700. if err != nil {
  81701. return nil, err
  81702. }
  81703. defer googleapi.CloseBody(res)
  81704. if err := googleapi.CheckResponse(res); err != nil {
  81705. return nil, err
  81706. }
  81707. ret := &Operation{
  81708. ServerResponse: googleapi.ServerResponse{
  81709. Header: res.Header,
  81710. HTTPStatusCode: res.StatusCode,
  81711. },
  81712. }
  81713. target := &ret
  81714. if err := gensupport.DecodeResponse(target, res); err != nil {
  81715. return nil, err
  81716. }
  81717. return ret, nil
  81718. // {
  81719. // "description": "Deletes the specified license.",
  81720. // "httpMethod": "DELETE",
  81721. // "id": "compute.licenses.delete",
  81722. // "parameterOrder": [
  81723. // "project",
  81724. // "license"
  81725. // ],
  81726. // "parameters": {
  81727. // "license": {
  81728. // "description": "Name of the license resource to delete.",
  81729. // "location": "path",
  81730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81731. // "required": true,
  81732. // "type": "string"
  81733. // },
  81734. // "project": {
  81735. // "description": "Project ID for this request.",
  81736. // "location": "path",
  81737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81738. // "required": true,
  81739. // "type": "string"
  81740. // },
  81741. // "requestId": {
  81742. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81743. // "location": "query",
  81744. // "type": "string"
  81745. // }
  81746. // },
  81747. // "path": "{project}/global/licenses/{license}",
  81748. // "response": {
  81749. // "$ref": "Operation"
  81750. // },
  81751. // "scopes": [
  81752. // "https://www.googleapis.com/auth/cloud-platform",
  81753. // "https://www.googleapis.com/auth/compute"
  81754. // ]
  81755. // }
  81756. }
  81757. // method id "compute.licenses.get":
  81758. type LicensesGetCall struct {
  81759. s *Service
  81760. project string
  81761. license string
  81762. urlParams_ gensupport.URLParams
  81763. ifNoneMatch_ string
  81764. ctx_ context.Context
  81765. header_ http.Header
  81766. }
  81767. // Get: Returns the specified License resource.
  81768. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  81769. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  81770. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81771. c.project = project
  81772. c.license = license
  81773. return c
  81774. }
  81775. // Fields allows partial responses to be retrieved. See
  81776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81777. // for more information.
  81778. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  81779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81780. return c
  81781. }
  81782. // IfNoneMatch sets the optional parameter which makes the operation
  81783. // fail if the object's ETag matches the given value. This is useful for
  81784. // getting updates only after the object has changed since the last
  81785. // request. Use googleapi.IsNotModified to check whether the response
  81786. // error from Do is the result of In-None-Match.
  81787. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  81788. c.ifNoneMatch_ = entityTag
  81789. return c
  81790. }
  81791. // Context sets the context to be used in this call's Do method. Any
  81792. // pending HTTP request will be aborted if the provided context is
  81793. // canceled.
  81794. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  81795. c.ctx_ = ctx
  81796. return c
  81797. }
  81798. // Header returns an http.Header that can be modified by the caller to
  81799. // add HTTP headers to the request.
  81800. func (c *LicensesGetCall) Header() http.Header {
  81801. if c.header_ == nil {
  81802. c.header_ = make(http.Header)
  81803. }
  81804. return c.header_
  81805. }
  81806. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  81807. reqHeaders := make(http.Header)
  81808. for k, v := range c.header_ {
  81809. reqHeaders[k] = v
  81810. }
  81811. reqHeaders.Set("User-Agent", c.s.userAgent())
  81812. if c.ifNoneMatch_ != "" {
  81813. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81814. }
  81815. var body io.Reader = nil
  81816. c.urlParams_.Set("alt", alt)
  81817. c.urlParams_.Set("prettyPrint", "false")
  81818. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  81819. urls += "?" + c.urlParams_.Encode()
  81820. req, err := http.NewRequest("GET", urls, body)
  81821. if err != nil {
  81822. return nil, err
  81823. }
  81824. req.Header = reqHeaders
  81825. googleapi.Expand(req.URL, map[string]string{
  81826. "project": c.project,
  81827. "license": c.license,
  81828. })
  81829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81830. }
  81831. // Do executes the "compute.licenses.get" call.
  81832. // Exactly one of *License or error will be non-nil. Any non-2xx status
  81833. // code is an error. Response headers are in either
  81834. // *License.ServerResponse.Header or (if a response was returned at all)
  81835. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81836. // check whether the returned error was because http.StatusNotModified
  81837. // was returned.
  81838. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  81839. gensupport.SetOptions(c.urlParams_, opts...)
  81840. res, err := c.doRequest("json")
  81841. if res != nil && res.StatusCode == http.StatusNotModified {
  81842. if res.Body != nil {
  81843. res.Body.Close()
  81844. }
  81845. return nil, &googleapi.Error{
  81846. Code: res.StatusCode,
  81847. Header: res.Header,
  81848. }
  81849. }
  81850. if err != nil {
  81851. return nil, err
  81852. }
  81853. defer googleapi.CloseBody(res)
  81854. if err := googleapi.CheckResponse(res); err != nil {
  81855. return nil, err
  81856. }
  81857. ret := &License{
  81858. ServerResponse: googleapi.ServerResponse{
  81859. Header: res.Header,
  81860. HTTPStatusCode: res.StatusCode,
  81861. },
  81862. }
  81863. target := &ret
  81864. if err := gensupport.DecodeResponse(target, res); err != nil {
  81865. return nil, err
  81866. }
  81867. return ret, nil
  81868. // {
  81869. // "description": "Returns the specified License resource.",
  81870. // "httpMethod": "GET",
  81871. // "id": "compute.licenses.get",
  81872. // "parameterOrder": [
  81873. // "project",
  81874. // "license"
  81875. // ],
  81876. // "parameters": {
  81877. // "license": {
  81878. // "description": "Name of the License resource to return.",
  81879. // "location": "path",
  81880. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81881. // "required": true,
  81882. // "type": "string"
  81883. // },
  81884. // "project": {
  81885. // "description": "Project ID for this request.",
  81886. // "location": "path",
  81887. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81888. // "required": true,
  81889. // "type": "string"
  81890. // }
  81891. // },
  81892. // "path": "{project}/global/licenses/{license}",
  81893. // "response": {
  81894. // "$ref": "License"
  81895. // },
  81896. // "scopes": [
  81897. // "https://www.googleapis.com/auth/cloud-platform",
  81898. // "https://www.googleapis.com/auth/compute",
  81899. // "https://www.googleapis.com/auth/compute.readonly"
  81900. // ]
  81901. // }
  81902. }
  81903. // method id "compute.licenses.getIamPolicy":
  81904. type LicensesGetIamPolicyCall struct {
  81905. s *Service
  81906. project string
  81907. resource string
  81908. urlParams_ gensupport.URLParams
  81909. ifNoneMatch_ string
  81910. ctx_ context.Context
  81911. header_ http.Header
  81912. }
  81913. // GetIamPolicy: Gets the access control policy for a resource. May be
  81914. // empty if no such policy or resource exists.
  81915. func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
  81916. c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81917. c.project = project
  81918. c.resource = resource
  81919. return c
  81920. }
  81921. // Fields allows partial responses to be retrieved. See
  81922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81923. // for more information.
  81924. func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
  81925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81926. return c
  81927. }
  81928. // IfNoneMatch sets the optional parameter which makes the operation
  81929. // fail if the object's ETag matches the given value. This is useful for
  81930. // getting updates only after the object has changed since the last
  81931. // request. Use googleapi.IsNotModified to check whether the response
  81932. // error from Do is the result of In-None-Match.
  81933. func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
  81934. c.ifNoneMatch_ = entityTag
  81935. return c
  81936. }
  81937. // Context sets the context to be used in this call's Do method. Any
  81938. // pending HTTP request will be aborted if the provided context is
  81939. // canceled.
  81940. func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
  81941. c.ctx_ = ctx
  81942. return c
  81943. }
  81944. // Header returns an http.Header that can be modified by the caller to
  81945. // add HTTP headers to the request.
  81946. func (c *LicensesGetIamPolicyCall) Header() http.Header {
  81947. if c.header_ == nil {
  81948. c.header_ = make(http.Header)
  81949. }
  81950. return c.header_
  81951. }
  81952. func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  81953. reqHeaders := make(http.Header)
  81954. for k, v := range c.header_ {
  81955. reqHeaders[k] = v
  81956. }
  81957. reqHeaders.Set("User-Agent", c.s.userAgent())
  81958. if c.ifNoneMatch_ != "" {
  81959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81960. }
  81961. var body io.Reader = nil
  81962. c.urlParams_.Set("alt", alt)
  81963. c.urlParams_.Set("prettyPrint", "false")
  81964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/getIamPolicy")
  81965. urls += "?" + c.urlParams_.Encode()
  81966. req, err := http.NewRequest("GET", urls, body)
  81967. if err != nil {
  81968. return nil, err
  81969. }
  81970. req.Header = reqHeaders
  81971. googleapi.Expand(req.URL, map[string]string{
  81972. "project": c.project,
  81973. "resource": c.resource,
  81974. })
  81975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81976. }
  81977. // Do executes the "compute.licenses.getIamPolicy" call.
  81978. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  81979. // code is an error. Response headers are in either
  81980. // *Policy.ServerResponse.Header or (if a response was returned at all)
  81981. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81982. // check whether the returned error was because http.StatusNotModified
  81983. // was returned.
  81984. func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  81985. gensupport.SetOptions(c.urlParams_, opts...)
  81986. res, err := c.doRequest("json")
  81987. if res != nil && res.StatusCode == http.StatusNotModified {
  81988. if res.Body != nil {
  81989. res.Body.Close()
  81990. }
  81991. return nil, &googleapi.Error{
  81992. Code: res.StatusCode,
  81993. Header: res.Header,
  81994. }
  81995. }
  81996. if err != nil {
  81997. return nil, err
  81998. }
  81999. defer googleapi.CloseBody(res)
  82000. if err := googleapi.CheckResponse(res); err != nil {
  82001. return nil, err
  82002. }
  82003. ret := &Policy{
  82004. ServerResponse: googleapi.ServerResponse{
  82005. Header: res.Header,
  82006. HTTPStatusCode: res.StatusCode,
  82007. },
  82008. }
  82009. target := &ret
  82010. if err := gensupport.DecodeResponse(target, res); err != nil {
  82011. return nil, err
  82012. }
  82013. return ret, nil
  82014. // {
  82015. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  82016. // "httpMethod": "GET",
  82017. // "id": "compute.licenses.getIamPolicy",
  82018. // "parameterOrder": [
  82019. // "project",
  82020. // "resource"
  82021. // ],
  82022. // "parameters": {
  82023. // "project": {
  82024. // "description": "Project ID for this request.",
  82025. // "location": "path",
  82026. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82027. // "required": true,
  82028. // "type": "string"
  82029. // },
  82030. // "resource": {
  82031. // "description": "Name or id of the resource for this request.",
  82032. // "location": "path",
  82033. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82034. // "required": true,
  82035. // "type": "string"
  82036. // }
  82037. // },
  82038. // "path": "{project}/global/licenses/{resource}/getIamPolicy",
  82039. // "response": {
  82040. // "$ref": "Policy"
  82041. // },
  82042. // "scopes": [
  82043. // "https://www.googleapis.com/auth/cloud-platform",
  82044. // "https://www.googleapis.com/auth/compute",
  82045. // "https://www.googleapis.com/auth/compute.readonly"
  82046. // ]
  82047. // }
  82048. }
  82049. // method id "compute.licenses.insert":
  82050. type LicensesInsertCall struct {
  82051. s *Service
  82052. project string
  82053. license *License
  82054. urlParams_ gensupport.URLParams
  82055. ctx_ context.Context
  82056. header_ http.Header
  82057. }
  82058. // Insert: Create a License resource in the specified project.
  82059. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  82060. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82061. c.project = project
  82062. c.license = license
  82063. return c
  82064. }
  82065. // RequestId sets the optional parameter "requestId": An optional
  82066. // request ID to identify requests. Specify a unique request ID so that
  82067. // if you must retry your request, the server will know to ignore the
  82068. // request if it has already been completed.
  82069. //
  82070. // For example, consider a situation where you make an initial request
  82071. // and the request times out. If you make the request again with the
  82072. // same request ID, the server can check if original operation with the
  82073. // same request ID was received, and if so, will ignore the second
  82074. // request. This prevents clients from accidentally creating duplicate
  82075. // commitments.
  82076. //
  82077. // The request ID must be a valid UUID with the exception that zero UUID
  82078. // is not supported (00000000-0000-0000-0000-000000000000).
  82079. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  82080. c.urlParams_.Set("requestId", requestId)
  82081. return c
  82082. }
  82083. // Fields allows partial responses to be retrieved. See
  82084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82085. // for more information.
  82086. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  82087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82088. return c
  82089. }
  82090. // Context sets the context to be used in this call's Do method. Any
  82091. // pending HTTP request will be aborted if the provided context is
  82092. // canceled.
  82093. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  82094. c.ctx_ = ctx
  82095. return c
  82096. }
  82097. // Header returns an http.Header that can be modified by the caller to
  82098. // add HTTP headers to the request.
  82099. func (c *LicensesInsertCall) Header() http.Header {
  82100. if c.header_ == nil {
  82101. c.header_ = make(http.Header)
  82102. }
  82103. return c.header_
  82104. }
  82105. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  82106. reqHeaders := make(http.Header)
  82107. for k, v := range c.header_ {
  82108. reqHeaders[k] = v
  82109. }
  82110. reqHeaders.Set("User-Agent", c.s.userAgent())
  82111. var body io.Reader = nil
  82112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  82113. if err != nil {
  82114. return nil, err
  82115. }
  82116. reqHeaders.Set("Content-Type", "application/json")
  82117. c.urlParams_.Set("alt", alt)
  82118. c.urlParams_.Set("prettyPrint", "false")
  82119. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  82120. urls += "?" + c.urlParams_.Encode()
  82121. req, err := http.NewRequest("POST", urls, body)
  82122. if err != nil {
  82123. return nil, err
  82124. }
  82125. req.Header = reqHeaders
  82126. googleapi.Expand(req.URL, map[string]string{
  82127. "project": c.project,
  82128. })
  82129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82130. }
  82131. // Do executes the "compute.licenses.insert" call.
  82132. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82133. // status code is an error. Response headers are in either
  82134. // *Operation.ServerResponse.Header or (if a response was returned at
  82135. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82136. // to check whether the returned error was because
  82137. // http.StatusNotModified was returned.
  82138. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82139. gensupport.SetOptions(c.urlParams_, opts...)
  82140. res, err := c.doRequest("json")
  82141. if res != nil && res.StatusCode == http.StatusNotModified {
  82142. if res.Body != nil {
  82143. res.Body.Close()
  82144. }
  82145. return nil, &googleapi.Error{
  82146. Code: res.StatusCode,
  82147. Header: res.Header,
  82148. }
  82149. }
  82150. if err != nil {
  82151. return nil, err
  82152. }
  82153. defer googleapi.CloseBody(res)
  82154. if err := googleapi.CheckResponse(res); err != nil {
  82155. return nil, err
  82156. }
  82157. ret := &Operation{
  82158. ServerResponse: googleapi.ServerResponse{
  82159. Header: res.Header,
  82160. HTTPStatusCode: res.StatusCode,
  82161. },
  82162. }
  82163. target := &ret
  82164. if err := gensupport.DecodeResponse(target, res); err != nil {
  82165. return nil, err
  82166. }
  82167. return ret, nil
  82168. // {
  82169. // "description": "Create a License resource in the specified project.",
  82170. // "httpMethod": "POST",
  82171. // "id": "compute.licenses.insert",
  82172. // "parameterOrder": [
  82173. // "project"
  82174. // ],
  82175. // "parameters": {
  82176. // "project": {
  82177. // "description": "Project ID for this request.",
  82178. // "location": "path",
  82179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82180. // "required": true,
  82181. // "type": "string"
  82182. // },
  82183. // "requestId": {
  82184. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82185. // "location": "query",
  82186. // "type": "string"
  82187. // }
  82188. // },
  82189. // "path": "{project}/global/licenses",
  82190. // "request": {
  82191. // "$ref": "License"
  82192. // },
  82193. // "response": {
  82194. // "$ref": "Operation"
  82195. // },
  82196. // "scopes": [
  82197. // "https://www.googleapis.com/auth/cloud-platform",
  82198. // "https://www.googleapis.com/auth/compute",
  82199. // "https://www.googleapis.com/auth/devstorage.full_control",
  82200. // "https://www.googleapis.com/auth/devstorage.read_only",
  82201. // "https://www.googleapis.com/auth/devstorage.read_write"
  82202. // ]
  82203. // }
  82204. }
  82205. // method id "compute.licenses.list":
  82206. type LicensesListCall struct {
  82207. s *Service
  82208. project string
  82209. urlParams_ gensupport.URLParams
  82210. ifNoneMatch_ string
  82211. ctx_ context.Context
  82212. header_ http.Header
  82213. }
  82214. // List: Retrieves the list of licenses available in the specified
  82215. // project. This method does not get any licenses that belong to other
  82216. // projects, including licenses attached to publicly-available images,
  82217. // like Debian 9. If you want to get a list of publicly-available
  82218. // licenses, use this method to make a request to the respective image
  82219. // project, such as debian-cloud or windows-cloud.
  82220. func (r *LicensesService) List(project string) *LicensesListCall {
  82221. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82222. c.project = project
  82223. return c
  82224. }
  82225. // Filter sets the optional parameter "filter": A filter expression that
  82226. // filters resources listed in the response. The expression must specify
  82227. // the field name, a comparison operator, and the value that you want to
  82228. // use for filtering. The value must be a string, a number, or a
  82229. // boolean. The comparison operator must be either =, !=, >, or <.
  82230. //
  82231. // For example, if you are filtering Compute Engine instances, you can
  82232. // exclude instances named example-instance by specifying name !=
  82233. // example-instance.
  82234. //
  82235. // You can also filter nested fields. For example, you could specify
  82236. // scheduling.automaticRestart = false to include instances only if they
  82237. // are not scheduled for automatic restarts. You can use filtering on
  82238. // nested fields to filter based on resource labels.
  82239. //
  82240. // To filter on multiple expressions, provide each separate expression
  82241. // within parentheses. For example, (scheduling.automaticRestart = true)
  82242. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82243. // AND expression. However, you can include AND and OR expressions
  82244. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82245. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82246. // true).
  82247. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  82248. c.urlParams_.Set("filter", filter)
  82249. return c
  82250. }
  82251. // MaxResults sets the optional parameter "maxResults": The maximum
  82252. // number of results per page that should be returned. If the number of
  82253. // available results is larger than maxResults, Compute Engine returns a
  82254. // nextPageToken that can be used to get the next page of results in
  82255. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82256. // (Default: 500)
  82257. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  82258. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82259. return c
  82260. }
  82261. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82262. // a certain order. By default, results are returned in alphanumerical
  82263. // order based on the resource name.
  82264. //
  82265. // You can also sort results in descending order based on the creation
  82266. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82267. // based on the creationTimestamp field in reverse chronological order
  82268. // (newest result first). Use this to sort resources like operations so
  82269. // that the newest operation is returned first.
  82270. //
  82271. // Currently, only sorting by name or creationTimestamp desc is
  82272. // supported.
  82273. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  82274. c.urlParams_.Set("orderBy", orderBy)
  82275. return c
  82276. }
  82277. // PageToken sets the optional parameter "pageToken": Specifies a page
  82278. // token to use. Set pageToken to the nextPageToken returned by a
  82279. // previous list request to get the next page of results.
  82280. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  82281. c.urlParams_.Set("pageToken", pageToken)
  82282. return c
  82283. }
  82284. // Fields allows partial responses to be retrieved. See
  82285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82286. // for more information.
  82287. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  82288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82289. return c
  82290. }
  82291. // IfNoneMatch sets the optional parameter which makes the operation
  82292. // fail if the object's ETag matches the given value. This is useful for
  82293. // getting updates only after the object has changed since the last
  82294. // request. Use googleapi.IsNotModified to check whether the response
  82295. // error from Do is the result of In-None-Match.
  82296. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  82297. c.ifNoneMatch_ = entityTag
  82298. return c
  82299. }
  82300. // Context sets the context to be used in this call's Do method. Any
  82301. // pending HTTP request will be aborted if the provided context is
  82302. // canceled.
  82303. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  82304. c.ctx_ = ctx
  82305. return c
  82306. }
  82307. // Header returns an http.Header that can be modified by the caller to
  82308. // add HTTP headers to the request.
  82309. func (c *LicensesListCall) Header() http.Header {
  82310. if c.header_ == nil {
  82311. c.header_ = make(http.Header)
  82312. }
  82313. return c.header_
  82314. }
  82315. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  82316. reqHeaders := make(http.Header)
  82317. for k, v := range c.header_ {
  82318. reqHeaders[k] = v
  82319. }
  82320. reqHeaders.Set("User-Agent", c.s.userAgent())
  82321. if c.ifNoneMatch_ != "" {
  82322. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82323. }
  82324. var body io.Reader = nil
  82325. c.urlParams_.Set("alt", alt)
  82326. c.urlParams_.Set("prettyPrint", "false")
  82327. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  82328. urls += "?" + c.urlParams_.Encode()
  82329. req, err := http.NewRequest("GET", urls, body)
  82330. if err != nil {
  82331. return nil, err
  82332. }
  82333. req.Header = reqHeaders
  82334. googleapi.Expand(req.URL, map[string]string{
  82335. "project": c.project,
  82336. })
  82337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82338. }
  82339. // Do executes the "compute.licenses.list" call.
  82340. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  82341. // non-2xx status code is an error. Response headers are in either
  82342. // *LicensesListResponse.ServerResponse.Header or (if a response was
  82343. // returned at all) in error.(*googleapi.Error).Header. Use
  82344. // googleapi.IsNotModified to check whether the returned error was
  82345. // because http.StatusNotModified was returned.
  82346. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  82347. gensupport.SetOptions(c.urlParams_, opts...)
  82348. res, err := c.doRequest("json")
  82349. if res != nil && res.StatusCode == http.StatusNotModified {
  82350. if res.Body != nil {
  82351. res.Body.Close()
  82352. }
  82353. return nil, &googleapi.Error{
  82354. Code: res.StatusCode,
  82355. Header: res.Header,
  82356. }
  82357. }
  82358. if err != nil {
  82359. return nil, err
  82360. }
  82361. defer googleapi.CloseBody(res)
  82362. if err := googleapi.CheckResponse(res); err != nil {
  82363. return nil, err
  82364. }
  82365. ret := &LicensesListResponse{
  82366. ServerResponse: googleapi.ServerResponse{
  82367. Header: res.Header,
  82368. HTTPStatusCode: res.StatusCode,
  82369. },
  82370. }
  82371. target := &ret
  82372. if err := gensupport.DecodeResponse(target, res); err != nil {
  82373. return nil, err
  82374. }
  82375. return ret, nil
  82376. // {
  82377. // "description": "Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.",
  82378. // "httpMethod": "GET",
  82379. // "id": "compute.licenses.list",
  82380. // "parameterOrder": [
  82381. // "project"
  82382. // ],
  82383. // "parameters": {
  82384. // "filter": {
  82385. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82386. // "location": "query",
  82387. // "type": "string"
  82388. // },
  82389. // "maxResults": {
  82390. // "default": "500",
  82391. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82392. // "format": "uint32",
  82393. // "location": "query",
  82394. // "minimum": "0",
  82395. // "type": "integer"
  82396. // },
  82397. // "orderBy": {
  82398. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82399. // "location": "query",
  82400. // "type": "string"
  82401. // },
  82402. // "pageToken": {
  82403. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82404. // "location": "query",
  82405. // "type": "string"
  82406. // },
  82407. // "project": {
  82408. // "description": "Project ID for this request.",
  82409. // "location": "path",
  82410. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82411. // "required": true,
  82412. // "type": "string"
  82413. // }
  82414. // },
  82415. // "path": "{project}/global/licenses",
  82416. // "response": {
  82417. // "$ref": "LicensesListResponse"
  82418. // },
  82419. // "scopes": [
  82420. // "https://www.googleapis.com/auth/cloud-platform",
  82421. // "https://www.googleapis.com/auth/compute",
  82422. // "https://www.googleapis.com/auth/compute.readonly"
  82423. // ]
  82424. // }
  82425. }
  82426. // Pages invokes f for each page of results.
  82427. // A non-nil error returned from f will halt the iteration.
  82428. // The provided context supersedes any context provided to the Context method.
  82429. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  82430. c.ctx_ = ctx
  82431. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82432. for {
  82433. x, err := c.Do()
  82434. if err != nil {
  82435. return err
  82436. }
  82437. if err := f(x); err != nil {
  82438. return err
  82439. }
  82440. if x.NextPageToken == "" {
  82441. return nil
  82442. }
  82443. c.PageToken(x.NextPageToken)
  82444. }
  82445. }
  82446. // method id "compute.licenses.setIamPolicy":
  82447. type LicensesSetIamPolicyCall struct {
  82448. s *Service
  82449. project string
  82450. resource string
  82451. globalsetpolicyrequest *GlobalSetPolicyRequest
  82452. urlParams_ gensupport.URLParams
  82453. ctx_ context.Context
  82454. header_ http.Header
  82455. }
  82456. // SetIamPolicy: Sets the access control policy on the specified
  82457. // resource. Replaces any existing policy.
  82458. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  82459. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82460. c.project = project
  82461. c.resource = resource
  82462. c.globalsetpolicyrequest = globalsetpolicyrequest
  82463. return c
  82464. }
  82465. // Fields allows partial responses to be retrieved. See
  82466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82467. // for more information.
  82468. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  82469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82470. return c
  82471. }
  82472. // Context sets the context to be used in this call's Do method. Any
  82473. // pending HTTP request will be aborted if the provided context is
  82474. // canceled.
  82475. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  82476. c.ctx_ = ctx
  82477. return c
  82478. }
  82479. // Header returns an http.Header that can be modified by the caller to
  82480. // add HTTP headers to the request.
  82481. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  82482. if c.header_ == nil {
  82483. c.header_ = make(http.Header)
  82484. }
  82485. return c.header_
  82486. }
  82487. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  82488. reqHeaders := make(http.Header)
  82489. for k, v := range c.header_ {
  82490. reqHeaders[k] = v
  82491. }
  82492. reqHeaders.Set("User-Agent", c.s.userAgent())
  82493. var body io.Reader = nil
  82494. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  82495. if err != nil {
  82496. return nil, err
  82497. }
  82498. reqHeaders.Set("Content-Type", "application/json")
  82499. c.urlParams_.Set("alt", alt)
  82500. c.urlParams_.Set("prettyPrint", "false")
  82501. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  82502. urls += "?" + c.urlParams_.Encode()
  82503. req, err := http.NewRequest("POST", urls, body)
  82504. if err != nil {
  82505. return nil, err
  82506. }
  82507. req.Header = reqHeaders
  82508. googleapi.Expand(req.URL, map[string]string{
  82509. "project": c.project,
  82510. "resource": c.resource,
  82511. })
  82512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82513. }
  82514. // Do executes the "compute.licenses.setIamPolicy" call.
  82515. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  82516. // code is an error. Response headers are in either
  82517. // *Policy.ServerResponse.Header or (if a response was returned at all)
  82518. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  82519. // check whether the returned error was because http.StatusNotModified
  82520. // was returned.
  82521. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  82522. gensupport.SetOptions(c.urlParams_, opts...)
  82523. res, err := c.doRequest("json")
  82524. if res != nil && res.StatusCode == http.StatusNotModified {
  82525. if res.Body != nil {
  82526. res.Body.Close()
  82527. }
  82528. return nil, &googleapi.Error{
  82529. Code: res.StatusCode,
  82530. Header: res.Header,
  82531. }
  82532. }
  82533. if err != nil {
  82534. return nil, err
  82535. }
  82536. defer googleapi.CloseBody(res)
  82537. if err := googleapi.CheckResponse(res); err != nil {
  82538. return nil, err
  82539. }
  82540. ret := &Policy{
  82541. ServerResponse: googleapi.ServerResponse{
  82542. Header: res.Header,
  82543. HTTPStatusCode: res.StatusCode,
  82544. },
  82545. }
  82546. target := &ret
  82547. if err := gensupport.DecodeResponse(target, res); err != nil {
  82548. return nil, err
  82549. }
  82550. return ret, nil
  82551. // {
  82552. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  82553. // "httpMethod": "POST",
  82554. // "id": "compute.licenses.setIamPolicy",
  82555. // "parameterOrder": [
  82556. // "project",
  82557. // "resource"
  82558. // ],
  82559. // "parameters": {
  82560. // "project": {
  82561. // "description": "Project ID for this request.",
  82562. // "location": "path",
  82563. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82564. // "required": true,
  82565. // "type": "string"
  82566. // },
  82567. // "resource": {
  82568. // "description": "Name or id of the resource for this request.",
  82569. // "location": "path",
  82570. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82571. // "required": true,
  82572. // "type": "string"
  82573. // }
  82574. // },
  82575. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  82576. // "request": {
  82577. // "$ref": "GlobalSetPolicyRequest"
  82578. // },
  82579. // "response": {
  82580. // "$ref": "Policy"
  82581. // },
  82582. // "scopes": [
  82583. // "https://www.googleapis.com/auth/cloud-platform",
  82584. // "https://www.googleapis.com/auth/compute"
  82585. // ]
  82586. // }
  82587. }
  82588. // method id "compute.licenses.testIamPermissions":
  82589. type LicensesTestIamPermissionsCall struct {
  82590. s *Service
  82591. project string
  82592. resource string
  82593. testpermissionsrequest *TestPermissionsRequest
  82594. urlParams_ gensupport.URLParams
  82595. ctx_ context.Context
  82596. header_ http.Header
  82597. }
  82598. // TestIamPermissions: Returns permissions that a caller has on the
  82599. // specified resource.
  82600. func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
  82601. c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82602. c.project = project
  82603. c.resource = resource
  82604. c.testpermissionsrequest = testpermissionsrequest
  82605. return c
  82606. }
  82607. // Fields allows partial responses to be retrieved. See
  82608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82609. // for more information.
  82610. func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
  82611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82612. return c
  82613. }
  82614. // Context sets the context to be used in this call's Do method. Any
  82615. // pending HTTP request will be aborted if the provided context is
  82616. // canceled.
  82617. func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
  82618. c.ctx_ = ctx
  82619. return c
  82620. }
  82621. // Header returns an http.Header that can be modified by the caller to
  82622. // add HTTP headers to the request.
  82623. func (c *LicensesTestIamPermissionsCall) Header() http.Header {
  82624. if c.header_ == nil {
  82625. c.header_ = make(http.Header)
  82626. }
  82627. return c.header_
  82628. }
  82629. func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  82630. reqHeaders := make(http.Header)
  82631. for k, v := range c.header_ {
  82632. reqHeaders[k] = v
  82633. }
  82634. reqHeaders.Set("User-Agent", c.s.userAgent())
  82635. var body io.Reader = nil
  82636. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  82637. if err != nil {
  82638. return nil, err
  82639. }
  82640. reqHeaders.Set("Content-Type", "application/json")
  82641. c.urlParams_.Set("alt", alt)
  82642. c.urlParams_.Set("prettyPrint", "false")
  82643. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/testIamPermissions")
  82644. urls += "?" + c.urlParams_.Encode()
  82645. req, err := http.NewRequest("POST", urls, body)
  82646. if err != nil {
  82647. return nil, err
  82648. }
  82649. req.Header = reqHeaders
  82650. googleapi.Expand(req.URL, map[string]string{
  82651. "project": c.project,
  82652. "resource": c.resource,
  82653. })
  82654. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82655. }
  82656. // Do executes the "compute.licenses.testIamPermissions" call.
  82657. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  82658. // non-2xx status code is an error. Response headers are in either
  82659. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  82660. // returned at all) in error.(*googleapi.Error).Header. Use
  82661. // googleapi.IsNotModified to check whether the returned error was
  82662. // because http.StatusNotModified was returned.
  82663. func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  82664. gensupport.SetOptions(c.urlParams_, opts...)
  82665. res, err := c.doRequest("json")
  82666. if res != nil && res.StatusCode == http.StatusNotModified {
  82667. if res.Body != nil {
  82668. res.Body.Close()
  82669. }
  82670. return nil, &googleapi.Error{
  82671. Code: res.StatusCode,
  82672. Header: res.Header,
  82673. }
  82674. }
  82675. if err != nil {
  82676. return nil, err
  82677. }
  82678. defer googleapi.CloseBody(res)
  82679. if err := googleapi.CheckResponse(res); err != nil {
  82680. return nil, err
  82681. }
  82682. ret := &TestPermissionsResponse{
  82683. ServerResponse: googleapi.ServerResponse{
  82684. Header: res.Header,
  82685. HTTPStatusCode: res.StatusCode,
  82686. },
  82687. }
  82688. target := &ret
  82689. if err := gensupport.DecodeResponse(target, res); err != nil {
  82690. return nil, err
  82691. }
  82692. return ret, nil
  82693. // {
  82694. // "description": "Returns permissions that a caller has on the specified resource.",
  82695. // "httpMethod": "POST",
  82696. // "id": "compute.licenses.testIamPermissions",
  82697. // "parameterOrder": [
  82698. // "project",
  82699. // "resource"
  82700. // ],
  82701. // "parameters": {
  82702. // "project": {
  82703. // "description": "Project ID for this request.",
  82704. // "location": "path",
  82705. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82706. // "required": true,
  82707. // "type": "string"
  82708. // },
  82709. // "resource": {
  82710. // "description": "Name or id of the resource for this request.",
  82711. // "location": "path",
  82712. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82713. // "required": true,
  82714. // "type": "string"
  82715. // }
  82716. // },
  82717. // "path": "{project}/global/licenses/{resource}/testIamPermissions",
  82718. // "request": {
  82719. // "$ref": "TestPermissionsRequest"
  82720. // },
  82721. // "response": {
  82722. // "$ref": "TestPermissionsResponse"
  82723. // },
  82724. // "scopes": [
  82725. // "https://www.googleapis.com/auth/cloud-platform",
  82726. // "https://www.googleapis.com/auth/compute",
  82727. // "https://www.googleapis.com/auth/compute.readonly"
  82728. // ]
  82729. // }
  82730. }
  82731. // method id "compute.machineImages.delete":
  82732. type MachineImagesDeleteCall struct {
  82733. s *Service
  82734. project string
  82735. machineImage string
  82736. urlParams_ gensupport.URLParams
  82737. ctx_ context.Context
  82738. header_ http.Header
  82739. }
  82740. // Delete: Deletes the specified machine image. Deleting a machine image
  82741. // is permanent and cannot be undone.
  82742. func (r *MachineImagesService) Delete(project string, machineImage string) *MachineImagesDeleteCall {
  82743. c := &MachineImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82744. c.project = project
  82745. c.machineImage = machineImage
  82746. return c
  82747. }
  82748. // RequestId sets the optional parameter "requestId": An optional
  82749. // request ID to identify requests. Specify a unique request ID so that
  82750. // if you must retry your request, the server will know to ignore the
  82751. // request if it has already been completed.
  82752. //
  82753. // For example, consider a situation where you make an initial request
  82754. // and the request times out. If you make the request again with the
  82755. // same request ID, the server can check if original operation with the
  82756. // same request ID was received, and if so, will ignore the second
  82757. // request. This prevents clients from accidentally creating duplicate
  82758. // commitments.
  82759. //
  82760. // The request ID must be a valid UUID with the exception that zero UUID
  82761. // is not supported (00000000-0000-0000-0000-000000000000).
  82762. func (c *MachineImagesDeleteCall) RequestId(requestId string) *MachineImagesDeleteCall {
  82763. c.urlParams_.Set("requestId", requestId)
  82764. return c
  82765. }
  82766. // Fields allows partial responses to be retrieved. See
  82767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82768. // for more information.
  82769. func (c *MachineImagesDeleteCall) Fields(s ...googleapi.Field) *MachineImagesDeleteCall {
  82770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82771. return c
  82772. }
  82773. // Context sets the context to be used in this call's Do method. Any
  82774. // pending HTTP request will be aborted if the provided context is
  82775. // canceled.
  82776. func (c *MachineImagesDeleteCall) Context(ctx context.Context) *MachineImagesDeleteCall {
  82777. c.ctx_ = ctx
  82778. return c
  82779. }
  82780. // Header returns an http.Header that can be modified by the caller to
  82781. // add HTTP headers to the request.
  82782. func (c *MachineImagesDeleteCall) Header() http.Header {
  82783. if c.header_ == nil {
  82784. c.header_ = make(http.Header)
  82785. }
  82786. return c.header_
  82787. }
  82788. func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  82789. reqHeaders := make(http.Header)
  82790. for k, v := range c.header_ {
  82791. reqHeaders[k] = v
  82792. }
  82793. reqHeaders.Set("User-Agent", c.s.userAgent())
  82794. var body io.Reader = nil
  82795. c.urlParams_.Set("alt", alt)
  82796. c.urlParams_.Set("prettyPrint", "false")
  82797. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{machineImage}")
  82798. urls += "?" + c.urlParams_.Encode()
  82799. req, err := http.NewRequest("DELETE", urls, body)
  82800. if err != nil {
  82801. return nil, err
  82802. }
  82803. req.Header = reqHeaders
  82804. googleapi.Expand(req.URL, map[string]string{
  82805. "project": c.project,
  82806. "machineImage": c.machineImage,
  82807. })
  82808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82809. }
  82810. // Do executes the "compute.machineImages.delete" call.
  82811. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82812. // status code is an error. Response headers are in either
  82813. // *Operation.ServerResponse.Header or (if a response was returned at
  82814. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82815. // to check whether the returned error was because
  82816. // http.StatusNotModified was returned.
  82817. func (c *MachineImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82818. gensupport.SetOptions(c.urlParams_, opts...)
  82819. res, err := c.doRequest("json")
  82820. if res != nil && res.StatusCode == http.StatusNotModified {
  82821. if res.Body != nil {
  82822. res.Body.Close()
  82823. }
  82824. return nil, &googleapi.Error{
  82825. Code: res.StatusCode,
  82826. Header: res.Header,
  82827. }
  82828. }
  82829. if err != nil {
  82830. return nil, err
  82831. }
  82832. defer googleapi.CloseBody(res)
  82833. if err := googleapi.CheckResponse(res); err != nil {
  82834. return nil, err
  82835. }
  82836. ret := &Operation{
  82837. ServerResponse: googleapi.ServerResponse{
  82838. Header: res.Header,
  82839. HTTPStatusCode: res.StatusCode,
  82840. },
  82841. }
  82842. target := &ret
  82843. if err := gensupport.DecodeResponse(target, res); err != nil {
  82844. return nil, err
  82845. }
  82846. return ret, nil
  82847. // {
  82848. // "description": "Deletes the specified machine image. Deleting a machine image is permanent and cannot be undone.",
  82849. // "httpMethod": "DELETE",
  82850. // "id": "compute.machineImages.delete",
  82851. // "parameterOrder": [
  82852. // "project",
  82853. // "machineImage"
  82854. // ],
  82855. // "parameters": {
  82856. // "machineImage": {
  82857. // "description": "The name of the machine image to delete.",
  82858. // "location": "path",
  82859. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82860. // "required": true,
  82861. // "type": "string"
  82862. // },
  82863. // "project": {
  82864. // "description": "Project ID for this request.",
  82865. // "location": "path",
  82866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82867. // "required": true,
  82868. // "type": "string"
  82869. // },
  82870. // "requestId": {
  82871. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82872. // "location": "query",
  82873. // "type": "string"
  82874. // }
  82875. // },
  82876. // "path": "{project}/global/machineImages/{machineImage}",
  82877. // "response": {
  82878. // "$ref": "Operation"
  82879. // },
  82880. // "scopes": [
  82881. // "https://www.googleapis.com/auth/cloud-platform",
  82882. // "https://www.googleapis.com/auth/compute"
  82883. // ]
  82884. // }
  82885. }
  82886. // method id "compute.machineImages.get":
  82887. type MachineImagesGetCall struct {
  82888. s *Service
  82889. project string
  82890. machineImage string
  82891. urlParams_ gensupport.URLParams
  82892. ifNoneMatch_ string
  82893. ctx_ context.Context
  82894. header_ http.Header
  82895. }
  82896. // Get: Returns the specified machine image. Gets a list of available
  82897. // machine images by making a list() request.
  82898. func (r *MachineImagesService) Get(project string, machineImage string) *MachineImagesGetCall {
  82899. c := &MachineImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82900. c.project = project
  82901. c.machineImage = machineImage
  82902. return c
  82903. }
  82904. // Fields allows partial responses to be retrieved. See
  82905. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82906. // for more information.
  82907. func (c *MachineImagesGetCall) Fields(s ...googleapi.Field) *MachineImagesGetCall {
  82908. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82909. return c
  82910. }
  82911. // IfNoneMatch sets the optional parameter which makes the operation
  82912. // fail if the object's ETag matches the given value. This is useful for
  82913. // getting updates only after the object has changed since the last
  82914. // request. Use googleapi.IsNotModified to check whether the response
  82915. // error from Do is the result of In-None-Match.
  82916. func (c *MachineImagesGetCall) IfNoneMatch(entityTag string) *MachineImagesGetCall {
  82917. c.ifNoneMatch_ = entityTag
  82918. return c
  82919. }
  82920. // Context sets the context to be used in this call's Do method. Any
  82921. // pending HTTP request will be aborted if the provided context is
  82922. // canceled.
  82923. func (c *MachineImagesGetCall) Context(ctx context.Context) *MachineImagesGetCall {
  82924. c.ctx_ = ctx
  82925. return c
  82926. }
  82927. // Header returns an http.Header that can be modified by the caller to
  82928. // add HTTP headers to the request.
  82929. func (c *MachineImagesGetCall) Header() http.Header {
  82930. if c.header_ == nil {
  82931. c.header_ = make(http.Header)
  82932. }
  82933. return c.header_
  82934. }
  82935. func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) {
  82936. reqHeaders := make(http.Header)
  82937. for k, v := range c.header_ {
  82938. reqHeaders[k] = v
  82939. }
  82940. reqHeaders.Set("User-Agent", c.s.userAgent())
  82941. if c.ifNoneMatch_ != "" {
  82942. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82943. }
  82944. var body io.Reader = nil
  82945. c.urlParams_.Set("alt", alt)
  82946. c.urlParams_.Set("prettyPrint", "false")
  82947. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{machineImage}")
  82948. urls += "?" + c.urlParams_.Encode()
  82949. req, err := http.NewRequest("GET", urls, body)
  82950. if err != nil {
  82951. return nil, err
  82952. }
  82953. req.Header = reqHeaders
  82954. googleapi.Expand(req.URL, map[string]string{
  82955. "project": c.project,
  82956. "machineImage": c.machineImage,
  82957. })
  82958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82959. }
  82960. // Do executes the "compute.machineImages.get" call.
  82961. // Exactly one of *MachineImage or error will be non-nil. Any non-2xx
  82962. // status code is an error. Response headers are in either
  82963. // *MachineImage.ServerResponse.Header or (if a response was returned at
  82964. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82965. // to check whether the returned error was because
  82966. // http.StatusNotModified was returned.
  82967. func (c *MachineImagesGetCall) Do(opts ...googleapi.CallOption) (*MachineImage, error) {
  82968. gensupport.SetOptions(c.urlParams_, opts...)
  82969. res, err := c.doRequest("json")
  82970. if res != nil && res.StatusCode == http.StatusNotModified {
  82971. if res.Body != nil {
  82972. res.Body.Close()
  82973. }
  82974. return nil, &googleapi.Error{
  82975. Code: res.StatusCode,
  82976. Header: res.Header,
  82977. }
  82978. }
  82979. if err != nil {
  82980. return nil, err
  82981. }
  82982. defer googleapi.CloseBody(res)
  82983. if err := googleapi.CheckResponse(res); err != nil {
  82984. return nil, err
  82985. }
  82986. ret := &MachineImage{
  82987. ServerResponse: googleapi.ServerResponse{
  82988. Header: res.Header,
  82989. HTTPStatusCode: res.StatusCode,
  82990. },
  82991. }
  82992. target := &ret
  82993. if err := gensupport.DecodeResponse(target, res); err != nil {
  82994. return nil, err
  82995. }
  82996. return ret, nil
  82997. // {
  82998. // "description": "Returns the specified machine image. Gets a list of available machine images by making a list() request.",
  82999. // "httpMethod": "GET",
  83000. // "id": "compute.machineImages.get",
  83001. // "parameterOrder": [
  83002. // "project",
  83003. // "machineImage"
  83004. // ],
  83005. // "parameters": {
  83006. // "machineImage": {
  83007. // "description": "The name of the machine image.",
  83008. // "location": "path",
  83009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83010. // "required": true,
  83011. // "type": "string"
  83012. // },
  83013. // "project": {
  83014. // "description": "Project ID for this request.",
  83015. // "location": "path",
  83016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83017. // "required": true,
  83018. // "type": "string"
  83019. // }
  83020. // },
  83021. // "path": "{project}/global/machineImages/{machineImage}",
  83022. // "response": {
  83023. // "$ref": "MachineImage"
  83024. // },
  83025. // "scopes": [
  83026. // "https://www.googleapis.com/auth/cloud-platform",
  83027. // "https://www.googleapis.com/auth/compute",
  83028. // "https://www.googleapis.com/auth/compute.readonly"
  83029. // ]
  83030. // }
  83031. }
  83032. // method id "compute.machineImages.getIamPolicy":
  83033. type MachineImagesGetIamPolicyCall struct {
  83034. s *Service
  83035. project string
  83036. resource string
  83037. urlParams_ gensupport.URLParams
  83038. ifNoneMatch_ string
  83039. ctx_ context.Context
  83040. header_ http.Header
  83041. }
  83042. // GetIamPolicy: Gets the access control policy for a resource. May be
  83043. // empty if no such policy or resource exists.
  83044. func (r *MachineImagesService) GetIamPolicy(project string, resource string) *MachineImagesGetIamPolicyCall {
  83045. c := &MachineImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83046. c.project = project
  83047. c.resource = resource
  83048. return c
  83049. }
  83050. // Fields allows partial responses to be retrieved. See
  83051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83052. // for more information.
  83053. func (c *MachineImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesGetIamPolicyCall {
  83054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83055. return c
  83056. }
  83057. // IfNoneMatch sets the optional parameter which makes the operation
  83058. // fail if the object's ETag matches the given value. This is useful for
  83059. // getting updates only after the object has changed since the last
  83060. // request. Use googleapi.IsNotModified to check whether the response
  83061. // error from Do is the result of In-None-Match.
  83062. func (c *MachineImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *MachineImagesGetIamPolicyCall {
  83063. c.ifNoneMatch_ = entityTag
  83064. return c
  83065. }
  83066. // Context sets the context to be used in this call's Do method. Any
  83067. // pending HTTP request will be aborted if the provided context is
  83068. // canceled.
  83069. func (c *MachineImagesGetIamPolicyCall) Context(ctx context.Context) *MachineImagesGetIamPolicyCall {
  83070. c.ctx_ = ctx
  83071. return c
  83072. }
  83073. // Header returns an http.Header that can be modified by the caller to
  83074. // add HTTP headers to the request.
  83075. func (c *MachineImagesGetIamPolicyCall) Header() http.Header {
  83076. if c.header_ == nil {
  83077. c.header_ = make(http.Header)
  83078. }
  83079. return c.header_
  83080. }
  83081. func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  83082. reqHeaders := make(http.Header)
  83083. for k, v := range c.header_ {
  83084. reqHeaders[k] = v
  83085. }
  83086. reqHeaders.Set("User-Agent", c.s.userAgent())
  83087. if c.ifNoneMatch_ != "" {
  83088. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83089. }
  83090. var body io.Reader = nil
  83091. c.urlParams_.Set("alt", alt)
  83092. c.urlParams_.Set("prettyPrint", "false")
  83093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/getIamPolicy")
  83094. urls += "?" + c.urlParams_.Encode()
  83095. req, err := http.NewRequest("GET", urls, body)
  83096. if err != nil {
  83097. return nil, err
  83098. }
  83099. req.Header = reqHeaders
  83100. googleapi.Expand(req.URL, map[string]string{
  83101. "project": c.project,
  83102. "resource": c.resource,
  83103. })
  83104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83105. }
  83106. // Do executes the "compute.machineImages.getIamPolicy" call.
  83107. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  83108. // code is an error. Response headers are in either
  83109. // *Policy.ServerResponse.Header or (if a response was returned at all)
  83110. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  83111. // check whether the returned error was because http.StatusNotModified
  83112. // was returned.
  83113. func (c *MachineImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  83114. gensupport.SetOptions(c.urlParams_, opts...)
  83115. res, err := c.doRequest("json")
  83116. if res != nil && res.StatusCode == http.StatusNotModified {
  83117. if res.Body != nil {
  83118. res.Body.Close()
  83119. }
  83120. return nil, &googleapi.Error{
  83121. Code: res.StatusCode,
  83122. Header: res.Header,
  83123. }
  83124. }
  83125. if err != nil {
  83126. return nil, err
  83127. }
  83128. defer googleapi.CloseBody(res)
  83129. if err := googleapi.CheckResponse(res); err != nil {
  83130. return nil, err
  83131. }
  83132. ret := &Policy{
  83133. ServerResponse: googleapi.ServerResponse{
  83134. Header: res.Header,
  83135. HTTPStatusCode: res.StatusCode,
  83136. },
  83137. }
  83138. target := &ret
  83139. if err := gensupport.DecodeResponse(target, res); err != nil {
  83140. return nil, err
  83141. }
  83142. return ret, nil
  83143. // {
  83144. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  83145. // "httpMethod": "GET",
  83146. // "id": "compute.machineImages.getIamPolicy",
  83147. // "parameterOrder": [
  83148. // "project",
  83149. // "resource"
  83150. // ],
  83151. // "parameters": {
  83152. // "project": {
  83153. // "description": "Project ID for this request.",
  83154. // "location": "path",
  83155. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83156. // "required": true,
  83157. // "type": "string"
  83158. // },
  83159. // "resource": {
  83160. // "description": "Name or id of the resource for this request.",
  83161. // "location": "path",
  83162. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83163. // "required": true,
  83164. // "type": "string"
  83165. // }
  83166. // },
  83167. // "path": "{project}/global/machineImages/{resource}/getIamPolicy",
  83168. // "response": {
  83169. // "$ref": "Policy"
  83170. // },
  83171. // "scopes": [
  83172. // "https://www.googleapis.com/auth/cloud-platform",
  83173. // "https://www.googleapis.com/auth/compute",
  83174. // "https://www.googleapis.com/auth/compute.readonly"
  83175. // ]
  83176. // }
  83177. }
  83178. // method id "compute.machineImages.insert":
  83179. type MachineImagesInsertCall struct {
  83180. s *Service
  83181. project string
  83182. machineimage *MachineImage
  83183. urlParams_ gensupport.URLParams
  83184. ctx_ context.Context
  83185. header_ http.Header
  83186. }
  83187. // Insert: Creates a machine image in the specified project using the
  83188. // data that is included in the request. If you are creating a new
  83189. // machine image to update an existing instance, your new machine image
  83190. // should use the same network or, if applicable, the same subnetwork as
  83191. // the original instance.
  83192. func (r *MachineImagesService) Insert(project string, machineimage *MachineImage) *MachineImagesInsertCall {
  83193. c := &MachineImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83194. c.project = project
  83195. c.machineimage = machineimage
  83196. return c
  83197. }
  83198. // RequestId sets the optional parameter "requestId": An optional
  83199. // request ID to identify requests. Specify a unique request ID so that
  83200. // if you must retry your request, the server will know to ignore the
  83201. // request if it has already been completed.
  83202. //
  83203. // For example, consider a situation where you make an initial request
  83204. // and the request times out. If you make the request again with the
  83205. // same request ID, the server can check if original operation with the
  83206. // same request ID was received, and if so, will ignore the second
  83207. // request. This prevents clients from accidentally creating duplicate
  83208. // commitments.
  83209. //
  83210. // The request ID must be a valid UUID with the exception that zero UUID
  83211. // is not supported (00000000-0000-0000-0000-000000000000).
  83212. func (c *MachineImagesInsertCall) RequestId(requestId string) *MachineImagesInsertCall {
  83213. c.urlParams_.Set("requestId", requestId)
  83214. return c
  83215. }
  83216. // SourceInstance sets the optional parameter "sourceInstance":
  83217. // Required. Source instance that is used to create the machine image
  83218. // from.
  83219. func (c *MachineImagesInsertCall) SourceInstance(sourceInstance string) *MachineImagesInsertCall {
  83220. c.urlParams_.Set("sourceInstance", sourceInstance)
  83221. return c
  83222. }
  83223. // Fields allows partial responses to be retrieved. See
  83224. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83225. // for more information.
  83226. func (c *MachineImagesInsertCall) Fields(s ...googleapi.Field) *MachineImagesInsertCall {
  83227. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83228. return c
  83229. }
  83230. // Context sets the context to be used in this call's Do method. Any
  83231. // pending HTTP request will be aborted if the provided context is
  83232. // canceled.
  83233. func (c *MachineImagesInsertCall) Context(ctx context.Context) *MachineImagesInsertCall {
  83234. c.ctx_ = ctx
  83235. return c
  83236. }
  83237. // Header returns an http.Header that can be modified by the caller to
  83238. // add HTTP headers to the request.
  83239. func (c *MachineImagesInsertCall) Header() http.Header {
  83240. if c.header_ == nil {
  83241. c.header_ = make(http.Header)
  83242. }
  83243. return c.header_
  83244. }
  83245. func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  83246. reqHeaders := make(http.Header)
  83247. for k, v := range c.header_ {
  83248. reqHeaders[k] = v
  83249. }
  83250. reqHeaders.Set("User-Agent", c.s.userAgent())
  83251. var body io.Reader = nil
  83252. body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage)
  83253. if err != nil {
  83254. return nil, err
  83255. }
  83256. reqHeaders.Set("Content-Type", "application/json")
  83257. c.urlParams_.Set("alt", alt)
  83258. c.urlParams_.Set("prettyPrint", "false")
  83259. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages")
  83260. urls += "?" + c.urlParams_.Encode()
  83261. req, err := http.NewRequest("POST", urls, body)
  83262. if err != nil {
  83263. return nil, err
  83264. }
  83265. req.Header = reqHeaders
  83266. googleapi.Expand(req.URL, map[string]string{
  83267. "project": c.project,
  83268. })
  83269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83270. }
  83271. // Do executes the "compute.machineImages.insert" call.
  83272. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83273. // status code is an error. Response headers are in either
  83274. // *Operation.ServerResponse.Header or (if a response was returned at
  83275. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83276. // to check whether the returned error was because
  83277. // http.StatusNotModified was returned.
  83278. func (c *MachineImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83279. gensupport.SetOptions(c.urlParams_, opts...)
  83280. res, err := c.doRequest("json")
  83281. if res != nil && res.StatusCode == http.StatusNotModified {
  83282. if res.Body != nil {
  83283. res.Body.Close()
  83284. }
  83285. return nil, &googleapi.Error{
  83286. Code: res.StatusCode,
  83287. Header: res.Header,
  83288. }
  83289. }
  83290. if err != nil {
  83291. return nil, err
  83292. }
  83293. defer googleapi.CloseBody(res)
  83294. if err := googleapi.CheckResponse(res); err != nil {
  83295. return nil, err
  83296. }
  83297. ret := &Operation{
  83298. ServerResponse: googleapi.ServerResponse{
  83299. Header: res.Header,
  83300. HTTPStatusCode: res.StatusCode,
  83301. },
  83302. }
  83303. target := &ret
  83304. if err := gensupport.DecodeResponse(target, res); err != nil {
  83305. return nil, err
  83306. }
  83307. return ret, nil
  83308. // {
  83309. // "description": "Creates a machine image in the specified project using the data that is included in the request. If you are creating a new machine image to update an existing instance, your new machine image should use the same network or, if applicable, the same subnetwork as the original instance.",
  83310. // "httpMethod": "POST",
  83311. // "id": "compute.machineImages.insert",
  83312. // "parameterOrder": [
  83313. // "project"
  83314. // ],
  83315. // "parameters": {
  83316. // "project": {
  83317. // "description": "Project ID for this request.",
  83318. // "location": "path",
  83319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83320. // "required": true,
  83321. // "type": "string"
  83322. // },
  83323. // "requestId": {
  83324. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83325. // "location": "query",
  83326. // "type": "string"
  83327. // },
  83328. // "sourceInstance": {
  83329. // "description": "Required. Source instance that is used to create the machine image from.",
  83330. // "location": "query",
  83331. // "type": "string"
  83332. // }
  83333. // },
  83334. // "path": "{project}/global/machineImages",
  83335. // "request": {
  83336. // "$ref": "MachineImage"
  83337. // },
  83338. // "response": {
  83339. // "$ref": "Operation"
  83340. // },
  83341. // "scopes": [
  83342. // "https://www.googleapis.com/auth/cloud-platform",
  83343. // "https://www.googleapis.com/auth/compute"
  83344. // ]
  83345. // }
  83346. }
  83347. // method id "compute.machineImages.list":
  83348. type MachineImagesListCall struct {
  83349. s *Service
  83350. project string
  83351. urlParams_ gensupport.URLParams
  83352. ifNoneMatch_ string
  83353. ctx_ context.Context
  83354. header_ http.Header
  83355. }
  83356. // List: Retrieves a list of machine images that are contained within
  83357. // the specified project.
  83358. func (r *MachineImagesService) List(project string) *MachineImagesListCall {
  83359. c := &MachineImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83360. c.project = project
  83361. return c
  83362. }
  83363. // Filter sets the optional parameter "filter": A filter expression that
  83364. // filters resources listed in the response. The expression must specify
  83365. // the field name, a comparison operator, and the value that you want to
  83366. // use for filtering. The value must be a string, a number, or a
  83367. // boolean. The comparison operator must be either =, !=, >, or <.
  83368. //
  83369. // For example, if you are filtering Compute Engine instances, you can
  83370. // exclude instances named example-instance by specifying name !=
  83371. // example-instance.
  83372. //
  83373. // You can also filter nested fields. For example, you could specify
  83374. // scheduling.automaticRestart = false to include instances only if they
  83375. // are not scheduled for automatic restarts. You can use filtering on
  83376. // nested fields to filter based on resource labels.
  83377. //
  83378. // To filter on multiple expressions, provide each separate expression
  83379. // within parentheses. For example, (scheduling.automaticRestart = true)
  83380. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83381. // AND expression. However, you can include AND and OR expressions
  83382. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83383. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83384. // true).
  83385. func (c *MachineImagesListCall) Filter(filter string) *MachineImagesListCall {
  83386. c.urlParams_.Set("filter", filter)
  83387. return c
  83388. }
  83389. // MaxResults sets the optional parameter "maxResults": The maximum
  83390. // number of results per page that should be returned. If the number of
  83391. // available results is larger than maxResults, Compute Engine returns a
  83392. // nextPageToken that can be used to get the next page of results in
  83393. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83394. // (Default: 500)
  83395. func (c *MachineImagesListCall) MaxResults(maxResults int64) *MachineImagesListCall {
  83396. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83397. return c
  83398. }
  83399. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83400. // a certain order. By default, results are returned in alphanumerical
  83401. // order based on the resource name.
  83402. //
  83403. // You can also sort results in descending order based on the creation
  83404. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83405. // based on the creationTimestamp field in reverse chronological order
  83406. // (newest result first). Use this to sort resources like operations so
  83407. // that the newest operation is returned first.
  83408. //
  83409. // Currently, only sorting by name or creationTimestamp desc is
  83410. // supported.
  83411. func (c *MachineImagesListCall) OrderBy(orderBy string) *MachineImagesListCall {
  83412. c.urlParams_.Set("orderBy", orderBy)
  83413. return c
  83414. }
  83415. // PageToken sets the optional parameter "pageToken": Specifies a page
  83416. // token to use. Set pageToken to the nextPageToken returned by a
  83417. // previous list request to get the next page of results.
  83418. func (c *MachineImagesListCall) PageToken(pageToken string) *MachineImagesListCall {
  83419. c.urlParams_.Set("pageToken", pageToken)
  83420. return c
  83421. }
  83422. // Fields allows partial responses to be retrieved. See
  83423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83424. // for more information.
  83425. func (c *MachineImagesListCall) Fields(s ...googleapi.Field) *MachineImagesListCall {
  83426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83427. return c
  83428. }
  83429. // IfNoneMatch sets the optional parameter which makes the operation
  83430. // fail if the object's ETag matches the given value. This is useful for
  83431. // getting updates only after the object has changed since the last
  83432. // request. Use googleapi.IsNotModified to check whether the response
  83433. // error from Do is the result of In-None-Match.
  83434. func (c *MachineImagesListCall) IfNoneMatch(entityTag string) *MachineImagesListCall {
  83435. c.ifNoneMatch_ = entityTag
  83436. return c
  83437. }
  83438. // Context sets the context to be used in this call's Do method. Any
  83439. // pending HTTP request will be aborted if the provided context is
  83440. // canceled.
  83441. func (c *MachineImagesListCall) Context(ctx context.Context) *MachineImagesListCall {
  83442. c.ctx_ = ctx
  83443. return c
  83444. }
  83445. // Header returns an http.Header that can be modified by the caller to
  83446. // add HTTP headers to the request.
  83447. func (c *MachineImagesListCall) Header() http.Header {
  83448. if c.header_ == nil {
  83449. c.header_ = make(http.Header)
  83450. }
  83451. return c.header_
  83452. }
  83453. func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) {
  83454. reqHeaders := make(http.Header)
  83455. for k, v := range c.header_ {
  83456. reqHeaders[k] = v
  83457. }
  83458. reqHeaders.Set("User-Agent", c.s.userAgent())
  83459. if c.ifNoneMatch_ != "" {
  83460. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83461. }
  83462. var body io.Reader = nil
  83463. c.urlParams_.Set("alt", alt)
  83464. c.urlParams_.Set("prettyPrint", "false")
  83465. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages")
  83466. urls += "?" + c.urlParams_.Encode()
  83467. req, err := http.NewRequest("GET", urls, body)
  83468. if err != nil {
  83469. return nil, err
  83470. }
  83471. req.Header = reqHeaders
  83472. googleapi.Expand(req.URL, map[string]string{
  83473. "project": c.project,
  83474. })
  83475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83476. }
  83477. // Do executes the "compute.machineImages.list" call.
  83478. // Exactly one of *MachineImageList or error will be non-nil. Any
  83479. // non-2xx status code is an error. Response headers are in either
  83480. // *MachineImageList.ServerResponse.Header or (if a response was
  83481. // returned at all) in error.(*googleapi.Error).Header. Use
  83482. // googleapi.IsNotModified to check whether the returned error was
  83483. // because http.StatusNotModified was returned.
  83484. func (c *MachineImagesListCall) Do(opts ...googleapi.CallOption) (*MachineImageList, error) {
  83485. gensupport.SetOptions(c.urlParams_, opts...)
  83486. res, err := c.doRequest("json")
  83487. if res != nil && res.StatusCode == http.StatusNotModified {
  83488. if res.Body != nil {
  83489. res.Body.Close()
  83490. }
  83491. return nil, &googleapi.Error{
  83492. Code: res.StatusCode,
  83493. Header: res.Header,
  83494. }
  83495. }
  83496. if err != nil {
  83497. return nil, err
  83498. }
  83499. defer googleapi.CloseBody(res)
  83500. if err := googleapi.CheckResponse(res); err != nil {
  83501. return nil, err
  83502. }
  83503. ret := &MachineImageList{
  83504. ServerResponse: googleapi.ServerResponse{
  83505. Header: res.Header,
  83506. HTTPStatusCode: res.StatusCode,
  83507. },
  83508. }
  83509. target := &ret
  83510. if err := gensupport.DecodeResponse(target, res); err != nil {
  83511. return nil, err
  83512. }
  83513. return ret, nil
  83514. // {
  83515. // "description": "Retrieves a list of machine images that are contained within the specified project.",
  83516. // "httpMethod": "GET",
  83517. // "id": "compute.machineImages.list",
  83518. // "parameterOrder": [
  83519. // "project"
  83520. // ],
  83521. // "parameters": {
  83522. // "filter": {
  83523. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  83524. // "location": "query",
  83525. // "type": "string"
  83526. // },
  83527. // "maxResults": {
  83528. // "default": "500",
  83529. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  83530. // "format": "uint32",
  83531. // "location": "query",
  83532. // "minimum": "0",
  83533. // "type": "integer"
  83534. // },
  83535. // "orderBy": {
  83536. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  83537. // "location": "query",
  83538. // "type": "string"
  83539. // },
  83540. // "pageToken": {
  83541. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  83542. // "location": "query",
  83543. // "type": "string"
  83544. // },
  83545. // "project": {
  83546. // "description": "Project ID for this request.",
  83547. // "location": "path",
  83548. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83549. // "required": true,
  83550. // "type": "string"
  83551. // }
  83552. // },
  83553. // "path": "{project}/global/machineImages",
  83554. // "response": {
  83555. // "$ref": "MachineImageList"
  83556. // },
  83557. // "scopes": [
  83558. // "https://www.googleapis.com/auth/cloud-platform",
  83559. // "https://www.googleapis.com/auth/compute",
  83560. // "https://www.googleapis.com/auth/compute.readonly"
  83561. // ]
  83562. // }
  83563. }
  83564. // Pages invokes f for each page of results.
  83565. // A non-nil error returned from f will halt the iteration.
  83566. // The provided context supersedes any context provided to the Context method.
  83567. func (c *MachineImagesListCall) Pages(ctx context.Context, f func(*MachineImageList) error) error {
  83568. c.ctx_ = ctx
  83569. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83570. for {
  83571. x, err := c.Do()
  83572. if err != nil {
  83573. return err
  83574. }
  83575. if err := f(x); err != nil {
  83576. return err
  83577. }
  83578. if x.NextPageToken == "" {
  83579. return nil
  83580. }
  83581. c.PageToken(x.NextPageToken)
  83582. }
  83583. }
  83584. // method id "compute.machineImages.setIamPolicy":
  83585. type MachineImagesSetIamPolicyCall struct {
  83586. s *Service
  83587. project string
  83588. resource string
  83589. globalsetpolicyrequest *GlobalSetPolicyRequest
  83590. urlParams_ gensupport.URLParams
  83591. ctx_ context.Context
  83592. header_ http.Header
  83593. }
  83594. // SetIamPolicy: Sets the access control policy on the specified
  83595. // resource. Replaces any existing policy.
  83596. func (r *MachineImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *MachineImagesSetIamPolicyCall {
  83597. c := &MachineImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83598. c.project = project
  83599. c.resource = resource
  83600. c.globalsetpolicyrequest = globalsetpolicyrequest
  83601. return c
  83602. }
  83603. // Fields allows partial responses to be retrieved. See
  83604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83605. // for more information.
  83606. func (c *MachineImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesSetIamPolicyCall {
  83607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83608. return c
  83609. }
  83610. // Context sets the context to be used in this call's Do method. Any
  83611. // pending HTTP request will be aborted if the provided context is
  83612. // canceled.
  83613. func (c *MachineImagesSetIamPolicyCall) Context(ctx context.Context) *MachineImagesSetIamPolicyCall {
  83614. c.ctx_ = ctx
  83615. return c
  83616. }
  83617. // Header returns an http.Header that can be modified by the caller to
  83618. // add HTTP headers to the request.
  83619. func (c *MachineImagesSetIamPolicyCall) Header() http.Header {
  83620. if c.header_ == nil {
  83621. c.header_ = make(http.Header)
  83622. }
  83623. return c.header_
  83624. }
  83625. func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  83626. reqHeaders := make(http.Header)
  83627. for k, v := range c.header_ {
  83628. reqHeaders[k] = v
  83629. }
  83630. reqHeaders.Set("User-Agent", c.s.userAgent())
  83631. var body io.Reader = nil
  83632. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  83633. if err != nil {
  83634. return nil, err
  83635. }
  83636. reqHeaders.Set("Content-Type", "application/json")
  83637. c.urlParams_.Set("alt", alt)
  83638. c.urlParams_.Set("prettyPrint", "false")
  83639. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/setIamPolicy")
  83640. urls += "?" + c.urlParams_.Encode()
  83641. req, err := http.NewRequest("POST", urls, body)
  83642. if err != nil {
  83643. return nil, err
  83644. }
  83645. req.Header = reqHeaders
  83646. googleapi.Expand(req.URL, map[string]string{
  83647. "project": c.project,
  83648. "resource": c.resource,
  83649. })
  83650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83651. }
  83652. // Do executes the "compute.machineImages.setIamPolicy" call.
  83653. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  83654. // code is an error. Response headers are in either
  83655. // *Policy.ServerResponse.Header or (if a response was returned at all)
  83656. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  83657. // check whether the returned error was because http.StatusNotModified
  83658. // was returned.
  83659. func (c *MachineImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  83660. gensupport.SetOptions(c.urlParams_, opts...)
  83661. res, err := c.doRequest("json")
  83662. if res != nil && res.StatusCode == http.StatusNotModified {
  83663. if res.Body != nil {
  83664. res.Body.Close()
  83665. }
  83666. return nil, &googleapi.Error{
  83667. Code: res.StatusCode,
  83668. Header: res.Header,
  83669. }
  83670. }
  83671. if err != nil {
  83672. return nil, err
  83673. }
  83674. defer googleapi.CloseBody(res)
  83675. if err := googleapi.CheckResponse(res); err != nil {
  83676. return nil, err
  83677. }
  83678. ret := &Policy{
  83679. ServerResponse: googleapi.ServerResponse{
  83680. Header: res.Header,
  83681. HTTPStatusCode: res.StatusCode,
  83682. },
  83683. }
  83684. target := &ret
  83685. if err := gensupport.DecodeResponse(target, res); err != nil {
  83686. return nil, err
  83687. }
  83688. return ret, nil
  83689. // {
  83690. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  83691. // "httpMethod": "POST",
  83692. // "id": "compute.machineImages.setIamPolicy",
  83693. // "parameterOrder": [
  83694. // "project",
  83695. // "resource"
  83696. // ],
  83697. // "parameters": {
  83698. // "project": {
  83699. // "description": "Project ID for this request.",
  83700. // "location": "path",
  83701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83702. // "required": true,
  83703. // "type": "string"
  83704. // },
  83705. // "resource": {
  83706. // "description": "Name or id of the resource for this request.",
  83707. // "location": "path",
  83708. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83709. // "required": true,
  83710. // "type": "string"
  83711. // }
  83712. // },
  83713. // "path": "{project}/global/machineImages/{resource}/setIamPolicy",
  83714. // "request": {
  83715. // "$ref": "GlobalSetPolicyRequest"
  83716. // },
  83717. // "response": {
  83718. // "$ref": "Policy"
  83719. // },
  83720. // "scopes": [
  83721. // "https://www.googleapis.com/auth/cloud-platform",
  83722. // "https://www.googleapis.com/auth/compute"
  83723. // ]
  83724. // }
  83725. }
  83726. // method id "compute.machineImages.testIamPermissions":
  83727. type MachineImagesTestIamPermissionsCall struct {
  83728. s *Service
  83729. project string
  83730. resource string
  83731. testpermissionsrequest *TestPermissionsRequest
  83732. urlParams_ gensupport.URLParams
  83733. ctx_ context.Context
  83734. header_ http.Header
  83735. }
  83736. // TestIamPermissions: Returns permissions that a caller has on the
  83737. // specified resource.
  83738. func (r *MachineImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *MachineImagesTestIamPermissionsCall {
  83739. c := &MachineImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83740. c.project = project
  83741. c.resource = resource
  83742. c.testpermissionsrequest = testpermissionsrequest
  83743. return c
  83744. }
  83745. // Fields allows partial responses to be retrieved. See
  83746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83747. // for more information.
  83748. func (c *MachineImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *MachineImagesTestIamPermissionsCall {
  83749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83750. return c
  83751. }
  83752. // Context sets the context to be used in this call's Do method. Any
  83753. // pending HTTP request will be aborted if the provided context is
  83754. // canceled.
  83755. func (c *MachineImagesTestIamPermissionsCall) Context(ctx context.Context) *MachineImagesTestIamPermissionsCall {
  83756. c.ctx_ = ctx
  83757. return c
  83758. }
  83759. // Header returns an http.Header that can be modified by the caller to
  83760. // add HTTP headers to the request.
  83761. func (c *MachineImagesTestIamPermissionsCall) Header() http.Header {
  83762. if c.header_ == nil {
  83763. c.header_ = make(http.Header)
  83764. }
  83765. return c.header_
  83766. }
  83767. func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  83768. reqHeaders := make(http.Header)
  83769. for k, v := range c.header_ {
  83770. reqHeaders[k] = v
  83771. }
  83772. reqHeaders.Set("User-Agent", c.s.userAgent())
  83773. var body io.Reader = nil
  83774. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  83775. if err != nil {
  83776. return nil, err
  83777. }
  83778. reqHeaders.Set("Content-Type", "application/json")
  83779. c.urlParams_.Set("alt", alt)
  83780. c.urlParams_.Set("prettyPrint", "false")
  83781. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/machineImages/{resource}/testIamPermissions")
  83782. urls += "?" + c.urlParams_.Encode()
  83783. req, err := http.NewRequest("POST", urls, body)
  83784. if err != nil {
  83785. return nil, err
  83786. }
  83787. req.Header = reqHeaders
  83788. googleapi.Expand(req.URL, map[string]string{
  83789. "project": c.project,
  83790. "resource": c.resource,
  83791. })
  83792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83793. }
  83794. // Do executes the "compute.machineImages.testIamPermissions" call.
  83795. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  83796. // non-2xx status code is an error. Response headers are in either
  83797. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  83798. // returned at all) in error.(*googleapi.Error).Header. Use
  83799. // googleapi.IsNotModified to check whether the returned error was
  83800. // because http.StatusNotModified was returned.
  83801. func (c *MachineImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  83802. gensupport.SetOptions(c.urlParams_, opts...)
  83803. res, err := c.doRequest("json")
  83804. if res != nil && res.StatusCode == http.StatusNotModified {
  83805. if res.Body != nil {
  83806. res.Body.Close()
  83807. }
  83808. return nil, &googleapi.Error{
  83809. Code: res.StatusCode,
  83810. Header: res.Header,
  83811. }
  83812. }
  83813. if err != nil {
  83814. return nil, err
  83815. }
  83816. defer googleapi.CloseBody(res)
  83817. if err := googleapi.CheckResponse(res); err != nil {
  83818. return nil, err
  83819. }
  83820. ret := &TestPermissionsResponse{
  83821. ServerResponse: googleapi.ServerResponse{
  83822. Header: res.Header,
  83823. HTTPStatusCode: res.StatusCode,
  83824. },
  83825. }
  83826. target := &ret
  83827. if err := gensupport.DecodeResponse(target, res); err != nil {
  83828. return nil, err
  83829. }
  83830. return ret, nil
  83831. // {
  83832. // "description": "Returns permissions that a caller has on the specified resource.",
  83833. // "httpMethod": "POST",
  83834. // "id": "compute.machineImages.testIamPermissions",
  83835. // "parameterOrder": [
  83836. // "project",
  83837. // "resource"
  83838. // ],
  83839. // "parameters": {
  83840. // "project": {
  83841. // "description": "Project ID for this request.",
  83842. // "location": "path",
  83843. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83844. // "required": true,
  83845. // "type": "string"
  83846. // },
  83847. // "resource": {
  83848. // "description": "Name or id of the resource for this request.",
  83849. // "location": "path",
  83850. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83851. // "required": true,
  83852. // "type": "string"
  83853. // }
  83854. // },
  83855. // "path": "{project}/global/machineImages/{resource}/testIamPermissions",
  83856. // "request": {
  83857. // "$ref": "TestPermissionsRequest"
  83858. // },
  83859. // "response": {
  83860. // "$ref": "TestPermissionsResponse"
  83861. // },
  83862. // "scopes": [
  83863. // "https://www.googleapis.com/auth/cloud-platform",
  83864. // "https://www.googleapis.com/auth/compute",
  83865. // "https://www.googleapis.com/auth/compute.readonly"
  83866. // ]
  83867. // }
  83868. }
  83869. // method id "compute.machineTypes.aggregatedList":
  83870. type MachineTypesAggregatedListCall struct {
  83871. s *Service
  83872. project string
  83873. urlParams_ gensupport.URLParams
  83874. ifNoneMatch_ string
  83875. ctx_ context.Context
  83876. header_ http.Header
  83877. }
  83878. // AggregatedList: Retrieves an aggregated list of machine types.
  83879. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  83880. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  83881. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83882. c.project = project
  83883. return c
  83884. }
  83885. // Filter sets the optional parameter "filter": A filter expression that
  83886. // filters resources listed in the response. The expression must specify
  83887. // the field name, a comparison operator, and the value that you want to
  83888. // use for filtering. The value must be a string, a number, or a
  83889. // boolean. The comparison operator must be either =, !=, >, or <.
  83890. //
  83891. // For example, if you are filtering Compute Engine instances, you can
  83892. // exclude instances named example-instance by specifying name !=
  83893. // example-instance.
  83894. //
  83895. // You can also filter nested fields. For example, you could specify
  83896. // scheduling.automaticRestart = false to include instances only if they
  83897. // are not scheduled for automatic restarts. You can use filtering on
  83898. // nested fields to filter based on resource labels.
  83899. //
  83900. // To filter on multiple expressions, provide each separate expression
  83901. // within parentheses. For example, (scheduling.automaticRestart = true)
  83902. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83903. // AND expression. However, you can include AND and OR expressions
  83904. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83905. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83906. // true).
  83907. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  83908. c.urlParams_.Set("filter", filter)
  83909. return c
  83910. }
  83911. // MaxResults sets the optional parameter "maxResults": The maximum
  83912. // number of results per page that should be returned. If the number of
  83913. // available results is larger than maxResults, Compute Engine returns a
  83914. // nextPageToken that can be used to get the next page of results in
  83915. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83916. // (Default: 500)
  83917. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  83918. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83919. return c
  83920. }
  83921. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83922. // a certain order. By default, results are returned in alphanumerical
  83923. // order based on the resource name.
  83924. //
  83925. // You can also sort results in descending order based on the creation
  83926. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83927. // based on the creationTimestamp field in reverse chronological order
  83928. // (newest result first). Use this to sort resources like operations so
  83929. // that the newest operation is returned first.
  83930. //
  83931. // Currently, only sorting by name or creationTimestamp desc is
  83932. // supported.
  83933. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  83934. c.urlParams_.Set("orderBy", orderBy)
  83935. return c
  83936. }
  83937. // PageToken sets the optional parameter "pageToken": Specifies a page
  83938. // token to use. Set pageToken to the nextPageToken returned by a
  83939. // previous list request to get the next page of results.
  83940. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  83941. c.urlParams_.Set("pageToken", pageToken)
  83942. return c
  83943. }
  83944. // Fields allows partial responses to be retrieved. See
  83945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83946. // for more information.
  83947. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  83948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83949. return c
  83950. }
  83951. // IfNoneMatch sets the optional parameter which makes the operation
  83952. // fail if the object's ETag matches the given value. This is useful for
  83953. // getting updates only after the object has changed since the last
  83954. // request. Use googleapi.IsNotModified to check whether the response
  83955. // error from Do is the result of In-None-Match.
  83956. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  83957. c.ifNoneMatch_ = entityTag
  83958. return c
  83959. }
  83960. // Context sets the context to be used in this call's Do method. Any
  83961. // pending HTTP request will be aborted if the provided context is
  83962. // canceled.
  83963. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  83964. c.ctx_ = ctx
  83965. return c
  83966. }
  83967. // Header returns an http.Header that can be modified by the caller to
  83968. // add HTTP headers to the request.
  83969. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  83970. if c.header_ == nil {
  83971. c.header_ = make(http.Header)
  83972. }
  83973. return c.header_
  83974. }
  83975. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  83976. reqHeaders := make(http.Header)
  83977. for k, v := range c.header_ {
  83978. reqHeaders[k] = v
  83979. }
  83980. reqHeaders.Set("User-Agent", c.s.userAgent())
  83981. if c.ifNoneMatch_ != "" {
  83982. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83983. }
  83984. var body io.Reader = nil
  83985. c.urlParams_.Set("alt", alt)
  83986. c.urlParams_.Set("prettyPrint", "false")
  83987. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  83988. urls += "?" + c.urlParams_.Encode()
  83989. req, err := http.NewRequest("GET", urls, body)
  83990. if err != nil {
  83991. return nil, err
  83992. }
  83993. req.Header = reqHeaders
  83994. googleapi.Expand(req.URL, map[string]string{
  83995. "project": c.project,
  83996. })
  83997. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83998. }
  83999. // Do executes the "compute.machineTypes.aggregatedList" call.
  84000. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  84001. // Any non-2xx status code is an error. Response headers are in either
  84002. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  84003. // was returned at all) in error.(*googleapi.Error).Header. Use
  84004. // googleapi.IsNotModified to check whether the returned error was
  84005. // because http.StatusNotModified was returned.
  84006. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  84007. gensupport.SetOptions(c.urlParams_, opts...)
  84008. res, err := c.doRequest("json")
  84009. if res != nil && res.StatusCode == http.StatusNotModified {
  84010. if res.Body != nil {
  84011. res.Body.Close()
  84012. }
  84013. return nil, &googleapi.Error{
  84014. Code: res.StatusCode,
  84015. Header: res.Header,
  84016. }
  84017. }
  84018. if err != nil {
  84019. return nil, err
  84020. }
  84021. defer googleapi.CloseBody(res)
  84022. if err := googleapi.CheckResponse(res); err != nil {
  84023. return nil, err
  84024. }
  84025. ret := &MachineTypeAggregatedList{
  84026. ServerResponse: googleapi.ServerResponse{
  84027. Header: res.Header,
  84028. HTTPStatusCode: res.StatusCode,
  84029. },
  84030. }
  84031. target := &ret
  84032. if err := gensupport.DecodeResponse(target, res); err != nil {
  84033. return nil, err
  84034. }
  84035. return ret, nil
  84036. // {
  84037. // "description": "Retrieves an aggregated list of machine types.",
  84038. // "httpMethod": "GET",
  84039. // "id": "compute.machineTypes.aggregatedList",
  84040. // "parameterOrder": [
  84041. // "project"
  84042. // ],
  84043. // "parameters": {
  84044. // "filter": {
  84045. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84046. // "location": "query",
  84047. // "type": "string"
  84048. // },
  84049. // "maxResults": {
  84050. // "default": "500",
  84051. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84052. // "format": "uint32",
  84053. // "location": "query",
  84054. // "minimum": "0",
  84055. // "type": "integer"
  84056. // },
  84057. // "orderBy": {
  84058. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84059. // "location": "query",
  84060. // "type": "string"
  84061. // },
  84062. // "pageToken": {
  84063. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84064. // "location": "query",
  84065. // "type": "string"
  84066. // },
  84067. // "project": {
  84068. // "description": "Project ID for this request.",
  84069. // "location": "path",
  84070. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84071. // "required": true,
  84072. // "type": "string"
  84073. // }
  84074. // },
  84075. // "path": "{project}/aggregated/machineTypes",
  84076. // "response": {
  84077. // "$ref": "MachineTypeAggregatedList"
  84078. // },
  84079. // "scopes": [
  84080. // "https://www.googleapis.com/auth/cloud-platform",
  84081. // "https://www.googleapis.com/auth/compute",
  84082. // "https://www.googleapis.com/auth/compute.readonly"
  84083. // ]
  84084. // }
  84085. }
  84086. // Pages invokes f for each page of results.
  84087. // A non-nil error returned from f will halt the iteration.
  84088. // The provided context supersedes any context provided to the Context method.
  84089. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  84090. c.ctx_ = ctx
  84091. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84092. for {
  84093. x, err := c.Do()
  84094. if err != nil {
  84095. return err
  84096. }
  84097. if err := f(x); err != nil {
  84098. return err
  84099. }
  84100. if x.NextPageToken == "" {
  84101. return nil
  84102. }
  84103. c.PageToken(x.NextPageToken)
  84104. }
  84105. }
  84106. // method id "compute.machineTypes.get":
  84107. type MachineTypesGetCall struct {
  84108. s *Service
  84109. project string
  84110. zone string
  84111. machineType string
  84112. urlParams_ gensupport.URLParams
  84113. ifNoneMatch_ string
  84114. ctx_ context.Context
  84115. header_ http.Header
  84116. }
  84117. // Get: Returns the specified machine type. Gets a list of available
  84118. // machine types by making a list() request.
  84119. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  84120. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  84121. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84122. c.project = project
  84123. c.zone = zone
  84124. c.machineType = machineType
  84125. return c
  84126. }
  84127. // Fields allows partial responses to be retrieved. See
  84128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84129. // for more information.
  84130. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  84131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84132. return c
  84133. }
  84134. // IfNoneMatch sets the optional parameter which makes the operation
  84135. // fail if the object's ETag matches the given value. This is useful for
  84136. // getting updates only after the object has changed since the last
  84137. // request. Use googleapi.IsNotModified to check whether the response
  84138. // error from Do is the result of In-None-Match.
  84139. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  84140. c.ifNoneMatch_ = entityTag
  84141. return c
  84142. }
  84143. // Context sets the context to be used in this call's Do method. Any
  84144. // pending HTTP request will be aborted if the provided context is
  84145. // canceled.
  84146. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  84147. c.ctx_ = ctx
  84148. return c
  84149. }
  84150. // Header returns an http.Header that can be modified by the caller to
  84151. // add HTTP headers to the request.
  84152. func (c *MachineTypesGetCall) Header() http.Header {
  84153. if c.header_ == nil {
  84154. c.header_ = make(http.Header)
  84155. }
  84156. return c.header_
  84157. }
  84158. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  84159. reqHeaders := make(http.Header)
  84160. for k, v := range c.header_ {
  84161. reqHeaders[k] = v
  84162. }
  84163. reqHeaders.Set("User-Agent", c.s.userAgent())
  84164. if c.ifNoneMatch_ != "" {
  84165. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84166. }
  84167. var body io.Reader = nil
  84168. c.urlParams_.Set("alt", alt)
  84169. c.urlParams_.Set("prettyPrint", "false")
  84170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  84171. urls += "?" + c.urlParams_.Encode()
  84172. req, err := http.NewRequest("GET", urls, body)
  84173. if err != nil {
  84174. return nil, err
  84175. }
  84176. req.Header = reqHeaders
  84177. googleapi.Expand(req.URL, map[string]string{
  84178. "project": c.project,
  84179. "zone": c.zone,
  84180. "machineType": c.machineType,
  84181. })
  84182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84183. }
  84184. // Do executes the "compute.machineTypes.get" call.
  84185. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  84186. // status code is an error. Response headers are in either
  84187. // *MachineType.ServerResponse.Header or (if a response was returned at
  84188. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84189. // to check whether the returned error was because
  84190. // http.StatusNotModified was returned.
  84191. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  84192. gensupport.SetOptions(c.urlParams_, opts...)
  84193. res, err := c.doRequest("json")
  84194. if res != nil && res.StatusCode == http.StatusNotModified {
  84195. if res.Body != nil {
  84196. res.Body.Close()
  84197. }
  84198. return nil, &googleapi.Error{
  84199. Code: res.StatusCode,
  84200. Header: res.Header,
  84201. }
  84202. }
  84203. if err != nil {
  84204. return nil, err
  84205. }
  84206. defer googleapi.CloseBody(res)
  84207. if err := googleapi.CheckResponse(res); err != nil {
  84208. return nil, err
  84209. }
  84210. ret := &MachineType{
  84211. ServerResponse: googleapi.ServerResponse{
  84212. Header: res.Header,
  84213. HTTPStatusCode: res.StatusCode,
  84214. },
  84215. }
  84216. target := &ret
  84217. if err := gensupport.DecodeResponse(target, res); err != nil {
  84218. return nil, err
  84219. }
  84220. return ret, nil
  84221. // {
  84222. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  84223. // "httpMethod": "GET",
  84224. // "id": "compute.machineTypes.get",
  84225. // "parameterOrder": [
  84226. // "project",
  84227. // "zone",
  84228. // "machineType"
  84229. // ],
  84230. // "parameters": {
  84231. // "machineType": {
  84232. // "description": "Name of the machine type to return.",
  84233. // "location": "path",
  84234. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84235. // "required": true,
  84236. // "type": "string"
  84237. // },
  84238. // "project": {
  84239. // "description": "Project ID for this request.",
  84240. // "location": "path",
  84241. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84242. // "required": true,
  84243. // "type": "string"
  84244. // },
  84245. // "zone": {
  84246. // "description": "The name of the zone for this request.",
  84247. // "location": "path",
  84248. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84249. // "required": true,
  84250. // "type": "string"
  84251. // }
  84252. // },
  84253. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  84254. // "response": {
  84255. // "$ref": "MachineType"
  84256. // },
  84257. // "scopes": [
  84258. // "https://www.googleapis.com/auth/cloud-platform",
  84259. // "https://www.googleapis.com/auth/compute",
  84260. // "https://www.googleapis.com/auth/compute.readonly"
  84261. // ]
  84262. // }
  84263. }
  84264. // method id "compute.machineTypes.list":
  84265. type MachineTypesListCall struct {
  84266. s *Service
  84267. project string
  84268. zone string
  84269. urlParams_ gensupport.URLParams
  84270. ifNoneMatch_ string
  84271. ctx_ context.Context
  84272. header_ http.Header
  84273. }
  84274. // List: Retrieves a list of machine types available to the specified
  84275. // project.
  84276. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  84277. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  84278. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84279. c.project = project
  84280. c.zone = zone
  84281. return c
  84282. }
  84283. // Filter sets the optional parameter "filter": A filter expression that
  84284. // filters resources listed in the response. The expression must specify
  84285. // the field name, a comparison operator, and the value that you want to
  84286. // use for filtering. The value must be a string, a number, or a
  84287. // boolean. The comparison operator must be either =, !=, >, or <.
  84288. //
  84289. // For example, if you are filtering Compute Engine instances, you can
  84290. // exclude instances named example-instance by specifying name !=
  84291. // example-instance.
  84292. //
  84293. // You can also filter nested fields. For example, you could specify
  84294. // scheduling.automaticRestart = false to include instances only if they
  84295. // are not scheduled for automatic restarts. You can use filtering on
  84296. // nested fields to filter based on resource labels.
  84297. //
  84298. // To filter on multiple expressions, provide each separate expression
  84299. // within parentheses. For example, (scheduling.automaticRestart = true)
  84300. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84301. // AND expression. However, you can include AND and OR expressions
  84302. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84303. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84304. // true).
  84305. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  84306. c.urlParams_.Set("filter", filter)
  84307. return c
  84308. }
  84309. // MaxResults sets the optional parameter "maxResults": The maximum
  84310. // number of results per page that should be returned. If the number of
  84311. // available results is larger than maxResults, Compute Engine returns a
  84312. // nextPageToken that can be used to get the next page of results in
  84313. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84314. // (Default: 500)
  84315. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  84316. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84317. return c
  84318. }
  84319. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84320. // a certain order. By default, results are returned in alphanumerical
  84321. // order based on the resource name.
  84322. //
  84323. // You can also sort results in descending order based on the creation
  84324. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84325. // based on the creationTimestamp field in reverse chronological order
  84326. // (newest result first). Use this to sort resources like operations so
  84327. // that the newest operation is returned first.
  84328. //
  84329. // Currently, only sorting by name or creationTimestamp desc is
  84330. // supported.
  84331. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  84332. c.urlParams_.Set("orderBy", orderBy)
  84333. return c
  84334. }
  84335. // PageToken sets the optional parameter "pageToken": Specifies a page
  84336. // token to use. Set pageToken to the nextPageToken returned by a
  84337. // previous list request to get the next page of results.
  84338. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  84339. c.urlParams_.Set("pageToken", pageToken)
  84340. return c
  84341. }
  84342. // Fields allows partial responses to be retrieved. See
  84343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84344. // for more information.
  84345. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  84346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84347. return c
  84348. }
  84349. // IfNoneMatch sets the optional parameter which makes the operation
  84350. // fail if the object's ETag matches the given value. This is useful for
  84351. // getting updates only after the object has changed since the last
  84352. // request. Use googleapi.IsNotModified to check whether the response
  84353. // error from Do is the result of In-None-Match.
  84354. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  84355. c.ifNoneMatch_ = entityTag
  84356. return c
  84357. }
  84358. // Context sets the context to be used in this call's Do method. Any
  84359. // pending HTTP request will be aborted if the provided context is
  84360. // canceled.
  84361. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  84362. c.ctx_ = ctx
  84363. return c
  84364. }
  84365. // Header returns an http.Header that can be modified by the caller to
  84366. // add HTTP headers to the request.
  84367. func (c *MachineTypesListCall) Header() http.Header {
  84368. if c.header_ == nil {
  84369. c.header_ = make(http.Header)
  84370. }
  84371. return c.header_
  84372. }
  84373. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  84374. reqHeaders := make(http.Header)
  84375. for k, v := range c.header_ {
  84376. reqHeaders[k] = v
  84377. }
  84378. reqHeaders.Set("User-Agent", c.s.userAgent())
  84379. if c.ifNoneMatch_ != "" {
  84380. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84381. }
  84382. var body io.Reader = nil
  84383. c.urlParams_.Set("alt", alt)
  84384. c.urlParams_.Set("prettyPrint", "false")
  84385. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  84386. urls += "?" + c.urlParams_.Encode()
  84387. req, err := http.NewRequest("GET", urls, body)
  84388. if err != nil {
  84389. return nil, err
  84390. }
  84391. req.Header = reqHeaders
  84392. googleapi.Expand(req.URL, map[string]string{
  84393. "project": c.project,
  84394. "zone": c.zone,
  84395. })
  84396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84397. }
  84398. // Do executes the "compute.machineTypes.list" call.
  84399. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  84400. // status code is an error. Response headers are in either
  84401. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  84402. // at all) in error.(*googleapi.Error).Header. Use
  84403. // googleapi.IsNotModified to check whether the returned error was
  84404. // because http.StatusNotModified was returned.
  84405. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  84406. gensupport.SetOptions(c.urlParams_, opts...)
  84407. res, err := c.doRequest("json")
  84408. if res != nil && res.StatusCode == http.StatusNotModified {
  84409. if res.Body != nil {
  84410. res.Body.Close()
  84411. }
  84412. return nil, &googleapi.Error{
  84413. Code: res.StatusCode,
  84414. Header: res.Header,
  84415. }
  84416. }
  84417. if err != nil {
  84418. return nil, err
  84419. }
  84420. defer googleapi.CloseBody(res)
  84421. if err := googleapi.CheckResponse(res); err != nil {
  84422. return nil, err
  84423. }
  84424. ret := &MachineTypeList{
  84425. ServerResponse: googleapi.ServerResponse{
  84426. Header: res.Header,
  84427. HTTPStatusCode: res.StatusCode,
  84428. },
  84429. }
  84430. target := &ret
  84431. if err := gensupport.DecodeResponse(target, res); err != nil {
  84432. return nil, err
  84433. }
  84434. return ret, nil
  84435. // {
  84436. // "description": "Retrieves a list of machine types available to the specified project.",
  84437. // "httpMethod": "GET",
  84438. // "id": "compute.machineTypes.list",
  84439. // "parameterOrder": [
  84440. // "project",
  84441. // "zone"
  84442. // ],
  84443. // "parameters": {
  84444. // "filter": {
  84445. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84446. // "location": "query",
  84447. // "type": "string"
  84448. // },
  84449. // "maxResults": {
  84450. // "default": "500",
  84451. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84452. // "format": "uint32",
  84453. // "location": "query",
  84454. // "minimum": "0",
  84455. // "type": "integer"
  84456. // },
  84457. // "orderBy": {
  84458. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84459. // "location": "query",
  84460. // "type": "string"
  84461. // },
  84462. // "pageToken": {
  84463. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84464. // "location": "query",
  84465. // "type": "string"
  84466. // },
  84467. // "project": {
  84468. // "description": "Project ID for this request.",
  84469. // "location": "path",
  84470. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84471. // "required": true,
  84472. // "type": "string"
  84473. // },
  84474. // "zone": {
  84475. // "description": "The name of the zone for this request.",
  84476. // "location": "path",
  84477. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84478. // "required": true,
  84479. // "type": "string"
  84480. // }
  84481. // },
  84482. // "path": "{project}/zones/{zone}/machineTypes",
  84483. // "response": {
  84484. // "$ref": "MachineTypeList"
  84485. // },
  84486. // "scopes": [
  84487. // "https://www.googleapis.com/auth/cloud-platform",
  84488. // "https://www.googleapis.com/auth/compute",
  84489. // "https://www.googleapis.com/auth/compute.readonly"
  84490. // ]
  84491. // }
  84492. }
  84493. // Pages invokes f for each page of results.
  84494. // A non-nil error returned from f will halt the iteration.
  84495. // The provided context supersedes any context provided to the Context method.
  84496. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  84497. c.ctx_ = ctx
  84498. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84499. for {
  84500. x, err := c.Do()
  84501. if err != nil {
  84502. return err
  84503. }
  84504. if err := f(x); err != nil {
  84505. return err
  84506. }
  84507. if x.NextPageToken == "" {
  84508. return nil
  84509. }
  84510. c.PageToken(x.NextPageToken)
  84511. }
  84512. }
  84513. // method id "compute.networkEndpointGroups.aggregatedList":
  84514. type NetworkEndpointGroupsAggregatedListCall struct {
  84515. s *Service
  84516. project string
  84517. urlParams_ gensupport.URLParams
  84518. ifNoneMatch_ string
  84519. ctx_ context.Context
  84520. header_ http.Header
  84521. }
  84522. // AggregatedList: Retrieves the list of network endpoint groups and
  84523. // sorts them by zone.
  84524. func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
  84525. c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84526. c.project = project
  84527. return c
  84528. }
  84529. // Filter sets the optional parameter "filter": A filter expression that
  84530. // filters resources listed in the response. The expression must specify
  84531. // the field name, a comparison operator, and the value that you want to
  84532. // use for filtering. The value must be a string, a number, or a
  84533. // boolean. The comparison operator must be either =, !=, >, or <.
  84534. //
  84535. // For example, if you are filtering Compute Engine instances, you can
  84536. // exclude instances named example-instance by specifying name !=
  84537. // example-instance.
  84538. //
  84539. // You can also filter nested fields. For example, you could specify
  84540. // scheduling.automaticRestart = false to include instances only if they
  84541. // are not scheduled for automatic restarts. You can use filtering on
  84542. // nested fields to filter based on resource labels.
  84543. //
  84544. // To filter on multiple expressions, provide each separate expression
  84545. // within parentheses. For example, (scheduling.automaticRestart = true)
  84546. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84547. // AND expression. However, you can include AND and OR expressions
  84548. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84549. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84550. // true).
  84551. func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
  84552. c.urlParams_.Set("filter", filter)
  84553. return c
  84554. }
  84555. // MaxResults sets the optional parameter "maxResults": The maximum
  84556. // number of results per page that should be returned. If the number of
  84557. // available results is larger than maxResults, Compute Engine returns a
  84558. // nextPageToken that can be used to get the next page of results in
  84559. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84560. // (Default: 500)
  84561. func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
  84562. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84563. return c
  84564. }
  84565. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84566. // a certain order. By default, results are returned in alphanumerical
  84567. // order based on the resource name.
  84568. //
  84569. // You can also sort results in descending order based on the creation
  84570. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84571. // based on the creationTimestamp field in reverse chronological order
  84572. // (newest result first). Use this to sort resources like operations so
  84573. // that the newest operation is returned first.
  84574. //
  84575. // Currently, only sorting by name or creationTimestamp desc is
  84576. // supported.
  84577. func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
  84578. c.urlParams_.Set("orderBy", orderBy)
  84579. return c
  84580. }
  84581. // PageToken sets the optional parameter "pageToken": Specifies a page
  84582. // token to use. Set pageToken to the nextPageToken returned by a
  84583. // previous list request to get the next page of results.
  84584. func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
  84585. c.urlParams_.Set("pageToken", pageToken)
  84586. return c
  84587. }
  84588. // Fields allows partial responses to be retrieved. See
  84589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84590. // for more information.
  84591. func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
  84592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84593. return c
  84594. }
  84595. // IfNoneMatch sets the optional parameter which makes the operation
  84596. // fail if the object's ETag matches the given value. This is useful for
  84597. // getting updates only after the object has changed since the last
  84598. // request. Use googleapi.IsNotModified to check whether the response
  84599. // error from Do is the result of In-None-Match.
  84600. func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
  84601. c.ifNoneMatch_ = entityTag
  84602. return c
  84603. }
  84604. // Context sets the context to be used in this call's Do method. Any
  84605. // pending HTTP request will be aborted if the provided context is
  84606. // canceled.
  84607. func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
  84608. c.ctx_ = ctx
  84609. return c
  84610. }
  84611. // Header returns an http.Header that can be modified by the caller to
  84612. // add HTTP headers to the request.
  84613. func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
  84614. if c.header_ == nil {
  84615. c.header_ = make(http.Header)
  84616. }
  84617. return c.header_
  84618. }
  84619. func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  84620. reqHeaders := make(http.Header)
  84621. for k, v := range c.header_ {
  84622. reqHeaders[k] = v
  84623. }
  84624. reqHeaders.Set("User-Agent", c.s.userAgent())
  84625. if c.ifNoneMatch_ != "" {
  84626. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84627. }
  84628. var body io.Reader = nil
  84629. c.urlParams_.Set("alt", alt)
  84630. c.urlParams_.Set("prettyPrint", "false")
  84631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/networkEndpointGroups")
  84632. urls += "?" + c.urlParams_.Encode()
  84633. req, err := http.NewRequest("GET", urls, body)
  84634. if err != nil {
  84635. return nil, err
  84636. }
  84637. req.Header = reqHeaders
  84638. googleapi.Expand(req.URL, map[string]string{
  84639. "project": c.project,
  84640. })
  84641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84642. }
  84643. // Do executes the "compute.networkEndpointGroups.aggregatedList" call.
  84644. // Exactly one of *NetworkEndpointGroupAggregatedList or error will be
  84645. // non-nil. Any non-2xx status code is an error. Response headers are in
  84646. // either *NetworkEndpointGroupAggregatedList.ServerResponse.Header or
  84647. // (if a response was returned at all) in
  84648. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  84649. // whether the returned error was because http.StatusNotModified was
  84650. // returned.
  84651. func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) {
  84652. gensupport.SetOptions(c.urlParams_, opts...)
  84653. res, err := c.doRequest("json")
  84654. if res != nil && res.StatusCode == http.StatusNotModified {
  84655. if res.Body != nil {
  84656. res.Body.Close()
  84657. }
  84658. return nil, &googleapi.Error{
  84659. Code: res.StatusCode,
  84660. Header: res.Header,
  84661. }
  84662. }
  84663. if err != nil {
  84664. return nil, err
  84665. }
  84666. defer googleapi.CloseBody(res)
  84667. if err := googleapi.CheckResponse(res); err != nil {
  84668. return nil, err
  84669. }
  84670. ret := &NetworkEndpointGroupAggregatedList{
  84671. ServerResponse: googleapi.ServerResponse{
  84672. Header: res.Header,
  84673. HTTPStatusCode: res.StatusCode,
  84674. },
  84675. }
  84676. target := &ret
  84677. if err := gensupport.DecodeResponse(target, res); err != nil {
  84678. return nil, err
  84679. }
  84680. return ret, nil
  84681. // {
  84682. // "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
  84683. // "httpMethod": "GET",
  84684. // "id": "compute.networkEndpointGroups.aggregatedList",
  84685. // "parameterOrder": [
  84686. // "project"
  84687. // ],
  84688. // "parameters": {
  84689. // "filter": {
  84690. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84691. // "location": "query",
  84692. // "type": "string"
  84693. // },
  84694. // "maxResults": {
  84695. // "default": "500",
  84696. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84697. // "format": "uint32",
  84698. // "location": "query",
  84699. // "minimum": "0",
  84700. // "type": "integer"
  84701. // },
  84702. // "orderBy": {
  84703. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84704. // "location": "query",
  84705. // "type": "string"
  84706. // },
  84707. // "pageToken": {
  84708. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84709. // "location": "query",
  84710. // "type": "string"
  84711. // },
  84712. // "project": {
  84713. // "description": "Project ID for this request.",
  84714. // "location": "path",
  84715. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84716. // "required": true,
  84717. // "type": "string"
  84718. // }
  84719. // },
  84720. // "path": "{project}/aggregated/networkEndpointGroups",
  84721. // "response": {
  84722. // "$ref": "NetworkEndpointGroupAggregatedList"
  84723. // },
  84724. // "scopes": [
  84725. // "https://www.googleapis.com/auth/cloud-platform",
  84726. // "https://www.googleapis.com/auth/compute",
  84727. // "https://www.googleapis.com/auth/compute.readonly"
  84728. // ]
  84729. // }
  84730. }
  84731. // Pages invokes f for each page of results.
  84732. // A non-nil error returned from f will halt the iteration.
  84733. // The provided context supersedes any context provided to the Context method.
  84734. func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error {
  84735. c.ctx_ = ctx
  84736. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84737. for {
  84738. x, err := c.Do()
  84739. if err != nil {
  84740. return err
  84741. }
  84742. if err := f(x); err != nil {
  84743. return err
  84744. }
  84745. if x.NextPageToken == "" {
  84746. return nil
  84747. }
  84748. c.PageToken(x.NextPageToken)
  84749. }
  84750. }
  84751. // method id "compute.networkEndpointGroups.attachNetworkEndpoints":
  84752. type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  84753. s *Service
  84754. project string
  84755. zone string
  84756. networkEndpointGroup string
  84757. networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
  84758. urlParams_ gensupport.URLParams
  84759. ctx_ context.Context
  84760. header_ http.Header
  84761. }
  84762. // AttachNetworkEndpoints: Attach a list of network endpoints to the
  84763. // specified network endpoint group.
  84764. func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  84765. c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84766. c.project = project
  84767. c.zone = zone
  84768. c.networkEndpointGroup = networkEndpointGroup
  84769. c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
  84770. return c
  84771. }
  84772. // RequestId sets the optional parameter "requestId": An optional
  84773. // request ID to identify requests. Specify a unique request ID so that
  84774. // if you must retry your request, the server will know to ignore the
  84775. // request if it has already been completed.
  84776. //
  84777. // For example, consider a situation where you make an initial request
  84778. // and the request times out. If you make the request again with the
  84779. // same request ID, the server can check if original operation with the
  84780. // same request ID was received, and if so, will ignore the second
  84781. // request. This prevents clients from accidentally creating duplicate
  84782. // commitments.
  84783. //
  84784. // The request ID must be a valid UUID with the exception that zero UUID
  84785. // is not supported (00000000-0000-0000-0000-000000000000).
  84786. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  84787. c.urlParams_.Set("requestId", requestId)
  84788. return c
  84789. }
  84790. // Fields allows partial responses to be retrieved. See
  84791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84792. // for more information.
  84793. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  84794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84795. return c
  84796. }
  84797. // Context sets the context to be used in this call's Do method. Any
  84798. // pending HTTP request will be aborted if the provided context is
  84799. // canceled.
  84800. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  84801. c.ctx_ = ctx
  84802. return c
  84803. }
  84804. // Header returns an http.Header that can be modified by the caller to
  84805. // add HTTP headers to the request.
  84806. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  84807. if c.header_ == nil {
  84808. c.header_ = make(http.Header)
  84809. }
  84810. return c.header_
  84811. }
  84812. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  84813. reqHeaders := make(http.Header)
  84814. for k, v := range c.header_ {
  84815. reqHeaders[k] = v
  84816. }
  84817. reqHeaders.Set("User-Agent", c.s.userAgent())
  84818. var body io.Reader = nil
  84819. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
  84820. if err != nil {
  84821. return nil, err
  84822. }
  84823. reqHeaders.Set("Content-Type", "application/json")
  84824. c.urlParams_.Set("alt", alt)
  84825. c.urlParams_.Set("prettyPrint", "false")
  84826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  84827. urls += "?" + c.urlParams_.Encode()
  84828. req, err := http.NewRequest("POST", urls, body)
  84829. if err != nil {
  84830. return nil, err
  84831. }
  84832. req.Header = reqHeaders
  84833. googleapi.Expand(req.URL, map[string]string{
  84834. "project": c.project,
  84835. "zone": c.zone,
  84836. "networkEndpointGroup": c.networkEndpointGroup,
  84837. })
  84838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84839. }
  84840. // Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
  84841. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84842. // status code is an error. Response headers are in either
  84843. // *Operation.ServerResponse.Header or (if a response was returned at
  84844. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84845. // to check whether the returned error was because
  84846. // http.StatusNotModified was returned.
  84847. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84848. gensupport.SetOptions(c.urlParams_, opts...)
  84849. res, err := c.doRequest("json")
  84850. if res != nil && res.StatusCode == http.StatusNotModified {
  84851. if res.Body != nil {
  84852. res.Body.Close()
  84853. }
  84854. return nil, &googleapi.Error{
  84855. Code: res.StatusCode,
  84856. Header: res.Header,
  84857. }
  84858. }
  84859. if err != nil {
  84860. return nil, err
  84861. }
  84862. defer googleapi.CloseBody(res)
  84863. if err := googleapi.CheckResponse(res); err != nil {
  84864. return nil, err
  84865. }
  84866. ret := &Operation{
  84867. ServerResponse: googleapi.ServerResponse{
  84868. Header: res.Header,
  84869. HTTPStatusCode: res.StatusCode,
  84870. },
  84871. }
  84872. target := &ret
  84873. if err := gensupport.DecodeResponse(target, res); err != nil {
  84874. return nil, err
  84875. }
  84876. return ret, nil
  84877. // {
  84878. // "description": "Attach a list of network endpoints to the specified network endpoint group.",
  84879. // "httpMethod": "POST",
  84880. // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
  84881. // "parameterOrder": [
  84882. // "project",
  84883. // "zone",
  84884. // "networkEndpointGroup"
  84885. // ],
  84886. // "parameters": {
  84887. // "networkEndpointGroup": {
  84888. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  84889. // "location": "path",
  84890. // "required": true,
  84891. // "type": "string"
  84892. // },
  84893. // "project": {
  84894. // "description": "Project ID for this request.",
  84895. // "location": "path",
  84896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84897. // "required": true,
  84898. // "type": "string"
  84899. // },
  84900. // "requestId": {
  84901. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84902. // "location": "query",
  84903. // "type": "string"
  84904. // },
  84905. // "zone": {
  84906. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  84907. // "location": "path",
  84908. // "required": true,
  84909. // "type": "string"
  84910. // }
  84911. // },
  84912. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  84913. // "request": {
  84914. // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
  84915. // },
  84916. // "response": {
  84917. // "$ref": "Operation"
  84918. // },
  84919. // "scopes": [
  84920. // "https://www.googleapis.com/auth/cloud-platform",
  84921. // "https://www.googleapis.com/auth/compute"
  84922. // ]
  84923. // }
  84924. }
  84925. // method id "compute.networkEndpointGroups.delete":
  84926. type NetworkEndpointGroupsDeleteCall struct {
  84927. s *Service
  84928. project string
  84929. zone string
  84930. networkEndpointGroup string
  84931. urlParams_ gensupport.URLParams
  84932. ctx_ context.Context
  84933. header_ http.Header
  84934. }
  84935. // Delete: Deletes the specified network endpoint group. The network
  84936. // endpoints in the NEG and the VM instances they belong to are not
  84937. // terminated when the NEG is deleted. Note that the NEG cannot be
  84938. // deleted if there are backend services referencing it.
  84939. func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
  84940. c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84941. c.project = project
  84942. c.zone = zone
  84943. c.networkEndpointGroup = networkEndpointGroup
  84944. return c
  84945. }
  84946. // RequestId sets the optional parameter "requestId": An optional
  84947. // request ID to identify requests. Specify a unique request ID so that
  84948. // if you must retry your request, the server will know to ignore the
  84949. // request if it has already been completed.
  84950. //
  84951. // For example, consider a situation where you make an initial request
  84952. // and the request times out. If you make the request again with the
  84953. // same request ID, the server can check if original operation with the
  84954. // same request ID was received, and if so, will ignore the second
  84955. // request. This prevents clients from accidentally creating duplicate
  84956. // commitments.
  84957. //
  84958. // The request ID must be a valid UUID with the exception that zero UUID
  84959. // is not supported (00000000-0000-0000-0000-000000000000).
  84960. func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
  84961. c.urlParams_.Set("requestId", requestId)
  84962. return c
  84963. }
  84964. // Fields allows partial responses to be retrieved. See
  84965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84966. // for more information.
  84967. func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
  84968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84969. return c
  84970. }
  84971. // Context sets the context to be used in this call's Do method. Any
  84972. // pending HTTP request will be aborted if the provided context is
  84973. // canceled.
  84974. func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
  84975. c.ctx_ = ctx
  84976. return c
  84977. }
  84978. // Header returns an http.Header that can be modified by the caller to
  84979. // add HTTP headers to the request.
  84980. func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header {
  84981. if c.header_ == nil {
  84982. c.header_ = make(http.Header)
  84983. }
  84984. return c.header_
  84985. }
  84986. func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  84987. reqHeaders := make(http.Header)
  84988. for k, v := range c.header_ {
  84989. reqHeaders[k] = v
  84990. }
  84991. reqHeaders.Set("User-Agent", c.s.userAgent())
  84992. var body io.Reader = nil
  84993. c.urlParams_.Set("alt", alt)
  84994. c.urlParams_.Set("prettyPrint", "false")
  84995. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  84996. urls += "?" + c.urlParams_.Encode()
  84997. req, err := http.NewRequest("DELETE", urls, body)
  84998. if err != nil {
  84999. return nil, err
  85000. }
  85001. req.Header = reqHeaders
  85002. googleapi.Expand(req.URL, map[string]string{
  85003. "project": c.project,
  85004. "zone": c.zone,
  85005. "networkEndpointGroup": c.networkEndpointGroup,
  85006. })
  85007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85008. }
  85009. // Do executes the "compute.networkEndpointGroups.delete" call.
  85010. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85011. // status code is an error. Response headers are in either
  85012. // *Operation.ServerResponse.Header or (if a response was returned at
  85013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85014. // to check whether the returned error was because
  85015. // http.StatusNotModified was returned.
  85016. func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85017. gensupport.SetOptions(c.urlParams_, opts...)
  85018. res, err := c.doRequest("json")
  85019. if res != nil && res.StatusCode == http.StatusNotModified {
  85020. if res.Body != nil {
  85021. res.Body.Close()
  85022. }
  85023. return nil, &googleapi.Error{
  85024. Code: res.StatusCode,
  85025. Header: res.Header,
  85026. }
  85027. }
  85028. if err != nil {
  85029. return nil, err
  85030. }
  85031. defer googleapi.CloseBody(res)
  85032. if err := googleapi.CheckResponse(res); err != nil {
  85033. return nil, err
  85034. }
  85035. ret := &Operation{
  85036. ServerResponse: googleapi.ServerResponse{
  85037. Header: res.Header,
  85038. HTTPStatusCode: res.StatusCode,
  85039. },
  85040. }
  85041. target := &ret
  85042. if err := gensupport.DecodeResponse(target, res); err != nil {
  85043. return nil, err
  85044. }
  85045. return ret, nil
  85046. // {
  85047. // "description": "Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it.",
  85048. // "httpMethod": "DELETE",
  85049. // "id": "compute.networkEndpointGroups.delete",
  85050. // "parameterOrder": [
  85051. // "project",
  85052. // "zone",
  85053. // "networkEndpointGroup"
  85054. // ],
  85055. // "parameters": {
  85056. // "networkEndpointGroup": {
  85057. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  85058. // "location": "path",
  85059. // "required": true,
  85060. // "type": "string"
  85061. // },
  85062. // "project": {
  85063. // "description": "Project ID for this request.",
  85064. // "location": "path",
  85065. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85066. // "required": true,
  85067. // "type": "string"
  85068. // },
  85069. // "requestId": {
  85070. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85071. // "location": "query",
  85072. // "type": "string"
  85073. // },
  85074. // "zone": {
  85075. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  85076. // "location": "path",
  85077. // "required": true,
  85078. // "type": "string"
  85079. // }
  85080. // },
  85081. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  85082. // "response": {
  85083. // "$ref": "Operation"
  85084. // },
  85085. // "scopes": [
  85086. // "https://www.googleapis.com/auth/cloud-platform",
  85087. // "https://www.googleapis.com/auth/compute"
  85088. // ]
  85089. // }
  85090. }
  85091. // method id "compute.networkEndpointGroups.detachNetworkEndpoints":
  85092. type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  85093. s *Service
  85094. project string
  85095. zone string
  85096. networkEndpointGroup string
  85097. networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
  85098. urlParams_ gensupport.URLParams
  85099. ctx_ context.Context
  85100. header_ http.Header
  85101. }
  85102. // DetachNetworkEndpoints: Detach a list of network endpoints from the
  85103. // specified network endpoint group.
  85104. func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  85105. c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85106. c.project = project
  85107. c.zone = zone
  85108. c.networkEndpointGroup = networkEndpointGroup
  85109. c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
  85110. return c
  85111. }
  85112. // RequestId sets the optional parameter "requestId": An optional
  85113. // request ID to identify requests. Specify a unique request ID so that
  85114. // if you must retry your request, the server will know to ignore the
  85115. // request if it has already been completed.
  85116. //
  85117. // For example, consider a situation where you make an initial request
  85118. // and the request times out. If you make the request again with the
  85119. // same request ID, the server can check if original operation with the
  85120. // same request ID was received, and if so, will ignore the second
  85121. // request. This prevents clients from accidentally creating duplicate
  85122. // commitments.
  85123. //
  85124. // The request ID must be a valid UUID with the exception that zero UUID
  85125. // is not supported (00000000-0000-0000-0000-000000000000).
  85126. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  85127. c.urlParams_.Set("requestId", requestId)
  85128. return c
  85129. }
  85130. // Fields allows partial responses to be retrieved. See
  85131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85132. // for more information.
  85133. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  85134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85135. return c
  85136. }
  85137. // Context sets the context to be used in this call's Do method. Any
  85138. // pending HTTP request will be aborted if the provided context is
  85139. // canceled.
  85140. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  85141. c.ctx_ = ctx
  85142. return c
  85143. }
  85144. // Header returns an http.Header that can be modified by the caller to
  85145. // add HTTP headers to the request.
  85146. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  85147. if c.header_ == nil {
  85148. c.header_ = make(http.Header)
  85149. }
  85150. return c.header_
  85151. }
  85152. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  85153. reqHeaders := make(http.Header)
  85154. for k, v := range c.header_ {
  85155. reqHeaders[k] = v
  85156. }
  85157. reqHeaders.Set("User-Agent", c.s.userAgent())
  85158. var body io.Reader = nil
  85159. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
  85160. if err != nil {
  85161. return nil, err
  85162. }
  85163. reqHeaders.Set("Content-Type", "application/json")
  85164. c.urlParams_.Set("alt", alt)
  85165. c.urlParams_.Set("prettyPrint", "false")
  85166. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  85167. urls += "?" + c.urlParams_.Encode()
  85168. req, err := http.NewRequest("POST", urls, body)
  85169. if err != nil {
  85170. return nil, err
  85171. }
  85172. req.Header = reqHeaders
  85173. googleapi.Expand(req.URL, map[string]string{
  85174. "project": c.project,
  85175. "zone": c.zone,
  85176. "networkEndpointGroup": c.networkEndpointGroup,
  85177. })
  85178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85179. }
  85180. // Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
  85181. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85182. // status code is an error. Response headers are in either
  85183. // *Operation.ServerResponse.Header or (if a response was returned at
  85184. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85185. // to check whether the returned error was because
  85186. // http.StatusNotModified was returned.
  85187. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85188. gensupport.SetOptions(c.urlParams_, opts...)
  85189. res, err := c.doRequest("json")
  85190. if res != nil && res.StatusCode == http.StatusNotModified {
  85191. if res.Body != nil {
  85192. res.Body.Close()
  85193. }
  85194. return nil, &googleapi.Error{
  85195. Code: res.StatusCode,
  85196. Header: res.Header,
  85197. }
  85198. }
  85199. if err != nil {
  85200. return nil, err
  85201. }
  85202. defer googleapi.CloseBody(res)
  85203. if err := googleapi.CheckResponse(res); err != nil {
  85204. return nil, err
  85205. }
  85206. ret := &Operation{
  85207. ServerResponse: googleapi.ServerResponse{
  85208. Header: res.Header,
  85209. HTTPStatusCode: res.StatusCode,
  85210. },
  85211. }
  85212. target := &ret
  85213. if err := gensupport.DecodeResponse(target, res); err != nil {
  85214. return nil, err
  85215. }
  85216. return ret, nil
  85217. // {
  85218. // "description": "Detach a list of network endpoints from the specified network endpoint group.",
  85219. // "httpMethod": "POST",
  85220. // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
  85221. // "parameterOrder": [
  85222. // "project",
  85223. // "zone",
  85224. // "networkEndpointGroup"
  85225. // ],
  85226. // "parameters": {
  85227. // "networkEndpointGroup": {
  85228. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  85229. // "location": "path",
  85230. // "required": true,
  85231. // "type": "string"
  85232. // },
  85233. // "project": {
  85234. // "description": "Project ID for this request.",
  85235. // "location": "path",
  85236. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85237. // "required": true,
  85238. // "type": "string"
  85239. // },
  85240. // "requestId": {
  85241. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85242. // "location": "query",
  85243. // "type": "string"
  85244. // },
  85245. // "zone": {
  85246. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  85247. // "location": "path",
  85248. // "required": true,
  85249. // "type": "string"
  85250. // }
  85251. // },
  85252. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  85253. // "request": {
  85254. // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
  85255. // },
  85256. // "response": {
  85257. // "$ref": "Operation"
  85258. // },
  85259. // "scopes": [
  85260. // "https://www.googleapis.com/auth/cloud-platform",
  85261. // "https://www.googleapis.com/auth/compute"
  85262. // ]
  85263. // }
  85264. }
  85265. // method id "compute.networkEndpointGroups.get":
  85266. type NetworkEndpointGroupsGetCall struct {
  85267. s *Service
  85268. project string
  85269. zone string
  85270. networkEndpointGroup string
  85271. urlParams_ gensupport.URLParams
  85272. ifNoneMatch_ string
  85273. ctx_ context.Context
  85274. header_ http.Header
  85275. }
  85276. // Get: Returns the specified network endpoint group. Gets a list of
  85277. // available network endpoint groups by making a list() request.
  85278. func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
  85279. c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85280. c.project = project
  85281. c.zone = zone
  85282. c.networkEndpointGroup = networkEndpointGroup
  85283. return c
  85284. }
  85285. // Fields allows partial responses to be retrieved. See
  85286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85287. // for more information.
  85288. func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
  85289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85290. return c
  85291. }
  85292. // IfNoneMatch sets the optional parameter which makes the operation
  85293. // fail if the object's ETag matches the given value. This is useful for
  85294. // getting updates only after the object has changed since the last
  85295. // request. Use googleapi.IsNotModified to check whether the response
  85296. // error from Do is the result of In-None-Match.
  85297. func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
  85298. c.ifNoneMatch_ = entityTag
  85299. return c
  85300. }
  85301. // Context sets the context to be used in this call's Do method. Any
  85302. // pending HTTP request will be aborted if the provided context is
  85303. // canceled.
  85304. func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
  85305. c.ctx_ = ctx
  85306. return c
  85307. }
  85308. // Header returns an http.Header that can be modified by the caller to
  85309. // add HTTP headers to the request.
  85310. func (c *NetworkEndpointGroupsGetCall) Header() http.Header {
  85311. if c.header_ == nil {
  85312. c.header_ = make(http.Header)
  85313. }
  85314. return c.header_
  85315. }
  85316. func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  85317. reqHeaders := make(http.Header)
  85318. for k, v := range c.header_ {
  85319. reqHeaders[k] = v
  85320. }
  85321. reqHeaders.Set("User-Agent", c.s.userAgent())
  85322. if c.ifNoneMatch_ != "" {
  85323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85324. }
  85325. var body io.Reader = nil
  85326. c.urlParams_.Set("alt", alt)
  85327. c.urlParams_.Set("prettyPrint", "false")
  85328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  85329. urls += "?" + c.urlParams_.Encode()
  85330. req, err := http.NewRequest("GET", urls, body)
  85331. if err != nil {
  85332. return nil, err
  85333. }
  85334. req.Header = reqHeaders
  85335. googleapi.Expand(req.URL, map[string]string{
  85336. "project": c.project,
  85337. "zone": c.zone,
  85338. "networkEndpointGroup": c.networkEndpointGroup,
  85339. })
  85340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85341. }
  85342. // Do executes the "compute.networkEndpointGroups.get" call.
  85343. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  85344. // non-2xx status code is an error. Response headers are in either
  85345. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  85346. // returned at all) in error.(*googleapi.Error).Header. Use
  85347. // googleapi.IsNotModified to check whether the returned error was
  85348. // because http.StatusNotModified was returned.
  85349. func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  85350. gensupport.SetOptions(c.urlParams_, opts...)
  85351. res, err := c.doRequest("json")
  85352. if res != nil && res.StatusCode == http.StatusNotModified {
  85353. if res.Body != nil {
  85354. res.Body.Close()
  85355. }
  85356. return nil, &googleapi.Error{
  85357. Code: res.StatusCode,
  85358. Header: res.Header,
  85359. }
  85360. }
  85361. if err != nil {
  85362. return nil, err
  85363. }
  85364. defer googleapi.CloseBody(res)
  85365. if err := googleapi.CheckResponse(res); err != nil {
  85366. return nil, err
  85367. }
  85368. ret := &NetworkEndpointGroup{
  85369. ServerResponse: googleapi.ServerResponse{
  85370. Header: res.Header,
  85371. HTTPStatusCode: res.StatusCode,
  85372. },
  85373. }
  85374. target := &ret
  85375. if err := gensupport.DecodeResponse(target, res); err != nil {
  85376. return nil, err
  85377. }
  85378. return ret, nil
  85379. // {
  85380. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  85381. // "httpMethod": "GET",
  85382. // "id": "compute.networkEndpointGroups.get",
  85383. // "parameterOrder": [
  85384. // "project",
  85385. // "zone",
  85386. // "networkEndpointGroup"
  85387. // ],
  85388. // "parameters": {
  85389. // "networkEndpointGroup": {
  85390. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  85391. // "location": "path",
  85392. // "required": true,
  85393. // "type": "string"
  85394. // },
  85395. // "project": {
  85396. // "description": "Project ID for this request.",
  85397. // "location": "path",
  85398. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85399. // "required": true,
  85400. // "type": "string"
  85401. // },
  85402. // "zone": {
  85403. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  85404. // "location": "path",
  85405. // "required": true,
  85406. // "type": "string"
  85407. // }
  85408. // },
  85409. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  85410. // "response": {
  85411. // "$ref": "NetworkEndpointGroup"
  85412. // },
  85413. // "scopes": [
  85414. // "https://www.googleapis.com/auth/cloud-platform",
  85415. // "https://www.googleapis.com/auth/compute",
  85416. // "https://www.googleapis.com/auth/compute.readonly"
  85417. // ]
  85418. // }
  85419. }
  85420. // method id "compute.networkEndpointGroups.insert":
  85421. type NetworkEndpointGroupsInsertCall struct {
  85422. s *Service
  85423. project string
  85424. zone string
  85425. networkendpointgroup *NetworkEndpointGroup
  85426. urlParams_ gensupport.URLParams
  85427. ctx_ context.Context
  85428. header_ http.Header
  85429. }
  85430. // Insert: Creates a network endpoint group in the specified project
  85431. // using the parameters that are included in the request.
  85432. func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
  85433. c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85434. c.project = project
  85435. c.zone = zone
  85436. c.networkendpointgroup = networkendpointgroup
  85437. return c
  85438. }
  85439. // RequestId sets the optional parameter "requestId": An optional
  85440. // request ID to identify requests. Specify a unique request ID so that
  85441. // if you must retry your request, the server will know to ignore the
  85442. // request if it has already been completed.
  85443. //
  85444. // For example, consider a situation where you make an initial request
  85445. // and the request times out. If you make the request again with the
  85446. // same request ID, the server can check if original operation with the
  85447. // same request ID was received, and if so, will ignore the second
  85448. // request. This prevents clients from accidentally creating duplicate
  85449. // commitments.
  85450. //
  85451. // The request ID must be a valid UUID with the exception that zero UUID
  85452. // is not supported (00000000-0000-0000-0000-000000000000).
  85453. func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
  85454. c.urlParams_.Set("requestId", requestId)
  85455. return c
  85456. }
  85457. // Fields allows partial responses to be retrieved. See
  85458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85459. // for more information.
  85460. func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
  85461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85462. return c
  85463. }
  85464. // Context sets the context to be used in this call's Do method. Any
  85465. // pending HTTP request will be aborted if the provided context is
  85466. // canceled.
  85467. func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
  85468. c.ctx_ = ctx
  85469. return c
  85470. }
  85471. // Header returns an http.Header that can be modified by the caller to
  85472. // add HTTP headers to the request.
  85473. func (c *NetworkEndpointGroupsInsertCall) Header() http.Header {
  85474. if c.header_ == nil {
  85475. c.header_ = make(http.Header)
  85476. }
  85477. return c.header_
  85478. }
  85479. func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  85480. reqHeaders := make(http.Header)
  85481. for k, v := range c.header_ {
  85482. reqHeaders[k] = v
  85483. }
  85484. reqHeaders.Set("User-Agent", c.s.userAgent())
  85485. var body io.Reader = nil
  85486. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  85487. if err != nil {
  85488. return nil, err
  85489. }
  85490. reqHeaders.Set("Content-Type", "application/json")
  85491. c.urlParams_.Set("alt", alt)
  85492. c.urlParams_.Set("prettyPrint", "false")
  85493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  85494. urls += "?" + c.urlParams_.Encode()
  85495. req, err := http.NewRequest("POST", urls, body)
  85496. if err != nil {
  85497. return nil, err
  85498. }
  85499. req.Header = reqHeaders
  85500. googleapi.Expand(req.URL, map[string]string{
  85501. "project": c.project,
  85502. "zone": c.zone,
  85503. })
  85504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85505. }
  85506. // Do executes the "compute.networkEndpointGroups.insert" call.
  85507. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85508. // status code is an error. Response headers are in either
  85509. // *Operation.ServerResponse.Header or (if a response was returned at
  85510. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85511. // to check whether the returned error was because
  85512. // http.StatusNotModified was returned.
  85513. func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85514. gensupport.SetOptions(c.urlParams_, opts...)
  85515. res, err := c.doRequest("json")
  85516. if res != nil && res.StatusCode == http.StatusNotModified {
  85517. if res.Body != nil {
  85518. res.Body.Close()
  85519. }
  85520. return nil, &googleapi.Error{
  85521. Code: res.StatusCode,
  85522. Header: res.Header,
  85523. }
  85524. }
  85525. if err != nil {
  85526. return nil, err
  85527. }
  85528. defer googleapi.CloseBody(res)
  85529. if err := googleapi.CheckResponse(res); err != nil {
  85530. return nil, err
  85531. }
  85532. ret := &Operation{
  85533. ServerResponse: googleapi.ServerResponse{
  85534. Header: res.Header,
  85535. HTTPStatusCode: res.StatusCode,
  85536. },
  85537. }
  85538. target := &ret
  85539. if err := gensupport.DecodeResponse(target, res); err != nil {
  85540. return nil, err
  85541. }
  85542. return ret, nil
  85543. // {
  85544. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  85545. // "httpMethod": "POST",
  85546. // "id": "compute.networkEndpointGroups.insert",
  85547. // "parameterOrder": [
  85548. // "project",
  85549. // "zone"
  85550. // ],
  85551. // "parameters": {
  85552. // "project": {
  85553. // "description": "Project ID for this request.",
  85554. // "location": "path",
  85555. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85556. // "required": true,
  85557. // "type": "string"
  85558. // },
  85559. // "requestId": {
  85560. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85561. // "location": "query",
  85562. // "type": "string"
  85563. // },
  85564. // "zone": {
  85565. // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
  85566. // "location": "path",
  85567. // "required": true,
  85568. // "type": "string"
  85569. // }
  85570. // },
  85571. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  85572. // "request": {
  85573. // "$ref": "NetworkEndpointGroup"
  85574. // },
  85575. // "response": {
  85576. // "$ref": "Operation"
  85577. // },
  85578. // "scopes": [
  85579. // "https://www.googleapis.com/auth/cloud-platform",
  85580. // "https://www.googleapis.com/auth/compute"
  85581. // ]
  85582. // }
  85583. }
  85584. // method id "compute.networkEndpointGroups.list":
  85585. type NetworkEndpointGroupsListCall struct {
  85586. s *Service
  85587. project string
  85588. zone string
  85589. urlParams_ gensupport.URLParams
  85590. ifNoneMatch_ string
  85591. ctx_ context.Context
  85592. header_ http.Header
  85593. }
  85594. // List: Retrieves the list of network endpoint groups that are located
  85595. // in the specified project and zone.
  85596. func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
  85597. c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85598. c.project = project
  85599. c.zone = zone
  85600. return c
  85601. }
  85602. // Filter sets the optional parameter "filter": A filter expression that
  85603. // filters resources listed in the response. The expression must specify
  85604. // the field name, a comparison operator, and the value that you want to
  85605. // use for filtering. The value must be a string, a number, or a
  85606. // boolean. The comparison operator must be either =, !=, >, or <.
  85607. //
  85608. // For example, if you are filtering Compute Engine instances, you can
  85609. // exclude instances named example-instance by specifying name !=
  85610. // example-instance.
  85611. //
  85612. // You can also filter nested fields. For example, you could specify
  85613. // scheduling.automaticRestart = false to include instances only if they
  85614. // are not scheduled for automatic restarts. You can use filtering on
  85615. // nested fields to filter based on resource labels.
  85616. //
  85617. // To filter on multiple expressions, provide each separate expression
  85618. // within parentheses. For example, (scheduling.automaticRestart = true)
  85619. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85620. // AND expression. However, you can include AND and OR expressions
  85621. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85622. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85623. // true).
  85624. func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
  85625. c.urlParams_.Set("filter", filter)
  85626. return c
  85627. }
  85628. // MaxResults sets the optional parameter "maxResults": The maximum
  85629. // number of results per page that should be returned. If the number of
  85630. // available results is larger than maxResults, Compute Engine returns a
  85631. // nextPageToken that can be used to get the next page of results in
  85632. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85633. // (Default: 500)
  85634. func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
  85635. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85636. return c
  85637. }
  85638. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85639. // a certain order. By default, results are returned in alphanumerical
  85640. // order based on the resource name.
  85641. //
  85642. // You can also sort results in descending order based on the creation
  85643. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85644. // based on the creationTimestamp field in reverse chronological order
  85645. // (newest result first). Use this to sort resources like operations so
  85646. // that the newest operation is returned first.
  85647. //
  85648. // Currently, only sorting by name or creationTimestamp desc is
  85649. // supported.
  85650. func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
  85651. c.urlParams_.Set("orderBy", orderBy)
  85652. return c
  85653. }
  85654. // PageToken sets the optional parameter "pageToken": Specifies a page
  85655. // token to use. Set pageToken to the nextPageToken returned by a
  85656. // previous list request to get the next page of results.
  85657. func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
  85658. c.urlParams_.Set("pageToken", pageToken)
  85659. return c
  85660. }
  85661. // Fields allows partial responses to be retrieved. See
  85662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85663. // for more information.
  85664. func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
  85665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85666. return c
  85667. }
  85668. // IfNoneMatch sets the optional parameter which makes the operation
  85669. // fail if the object's ETag matches the given value. This is useful for
  85670. // getting updates only after the object has changed since the last
  85671. // request. Use googleapi.IsNotModified to check whether the response
  85672. // error from Do is the result of In-None-Match.
  85673. func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
  85674. c.ifNoneMatch_ = entityTag
  85675. return c
  85676. }
  85677. // Context sets the context to be used in this call's Do method. Any
  85678. // pending HTTP request will be aborted if the provided context is
  85679. // canceled.
  85680. func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
  85681. c.ctx_ = ctx
  85682. return c
  85683. }
  85684. // Header returns an http.Header that can be modified by the caller to
  85685. // add HTTP headers to the request.
  85686. func (c *NetworkEndpointGroupsListCall) Header() http.Header {
  85687. if c.header_ == nil {
  85688. c.header_ = make(http.Header)
  85689. }
  85690. return c.header_
  85691. }
  85692. func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  85693. reqHeaders := make(http.Header)
  85694. for k, v := range c.header_ {
  85695. reqHeaders[k] = v
  85696. }
  85697. reqHeaders.Set("User-Agent", c.s.userAgent())
  85698. if c.ifNoneMatch_ != "" {
  85699. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85700. }
  85701. var body io.Reader = nil
  85702. c.urlParams_.Set("alt", alt)
  85703. c.urlParams_.Set("prettyPrint", "false")
  85704. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  85705. urls += "?" + c.urlParams_.Encode()
  85706. req, err := http.NewRequest("GET", urls, body)
  85707. if err != nil {
  85708. return nil, err
  85709. }
  85710. req.Header = reqHeaders
  85711. googleapi.Expand(req.URL, map[string]string{
  85712. "project": c.project,
  85713. "zone": c.zone,
  85714. })
  85715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85716. }
  85717. // Do executes the "compute.networkEndpointGroups.list" call.
  85718. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  85719. // Any non-2xx status code is an error. Response headers are in either
  85720. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  85721. // returned at all) in error.(*googleapi.Error).Header. Use
  85722. // googleapi.IsNotModified to check whether the returned error was
  85723. // because http.StatusNotModified was returned.
  85724. func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  85725. gensupport.SetOptions(c.urlParams_, opts...)
  85726. res, err := c.doRequest("json")
  85727. if res != nil && res.StatusCode == http.StatusNotModified {
  85728. if res.Body != nil {
  85729. res.Body.Close()
  85730. }
  85731. return nil, &googleapi.Error{
  85732. Code: res.StatusCode,
  85733. Header: res.Header,
  85734. }
  85735. }
  85736. if err != nil {
  85737. return nil, err
  85738. }
  85739. defer googleapi.CloseBody(res)
  85740. if err := googleapi.CheckResponse(res); err != nil {
  85741. return nil, err
  85742. }
  85743. ret := &NetworkEndpointGroupList{
  85744. ServerResponse: googleapi.ServerResponse{
  85745. Header: res.Header,
  85746. HTTPStatusCode: res.StatusCode,
  85747. },
  85748. }
  85749. target := &ret
  85750. if err := gensupport.DecodeResponse(target, res); err != nil {
  85751. return nil, err
  85752. }
  85753. return ret, nil
  85754. // {
  85755. // "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
  85756. // "httpMethod": "GET",
  85757. // "id": "compute.networkEndpointGroups.list",
  85758. // "parameterOrder": [
  85759. // "project",
  85760. // "zone"
  85761. // ],
  85762. // "parameters": {
  85763. // "filter": {
  85764. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85765. // "location": "query",
  85766. // "type": "string"
  85767. // },
  85768. // "maxResults": {
  85769. // "default": "500",
  85770. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  85771. // "format": "uint32",
  85772. // "location": "query",
  85773. // "minimum": "0",
  85774. // "type": "integer"
  85775. // },
  85776. // "orderBy": {
  85777. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  85778. // "location": "query",
  85779. // "type": "string"
  85780. // },
  85781. // "pageToken": {
  85782. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  85783. // "location": "query",
  85784. // "type": "string"
  85785. // },
  85786. // "project": {
  85787. // "description": "Project ID for this request.",
  85788. // "location": "path",
  85789. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85790. // "required": true,
  85791. // "type": "string"
  85792. // },
  85793. // "zone": {
  85794. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  85795. // "location": "path",
  85796. // "required": true,
  85797. // "type": "string"
  85798. // }
  85799. // },
  85800. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  85801. // "response": {
  85802. // "$ref": "NetworkEndpointGroupList"
  85803. // },
  85804. // "scopes": [
  85805. // "https://www.googleapis.com/auth/cloud-platform",
  85806. // "https://www.googleapis.com/auth/compute",
  85807. // "https://www.googleapis.com/auth/compute.readonly"
  85808. // ]
  85809. // }
  85810. }
  85811. // Pages invokes f for each page of results.
  85812. // A non-nil error returned from f will halt the iteration.
  85813. // The provided context supersedes any context provided to the Context method.
  85814. func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  85815. c.ctx_ = ctx
  85816. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85817. for {
  85818. x, err := c.Do()
  85819. if err != nil {
  85820. return err
  85821. }
  85822. if err := f(x); err != nil {
  85823. return err
  85824. }
  85825. if x.NextPageToken == "" {
  85826. return nil
  85827. }
  85828. c.PageToken(x.NextPageToken)
  85829. }
  85830. }
  85831. // method id "compute.networkEndpointGroups.listNetworkEndpoints":
  85832. type NetworkEndpointGroupsListNetworkEndpointsCall struct {
  85833. s *Service
  85834. project string
  85835. zone string
  85836. networkEndpointGroup string
  85837. networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
  85838. urlParams_ gensupport.URLParams
  85839. ctx_ context.Context
  85840. header_ http.Header
  85841. }
  85842. // ListNetworkEndpoints: Lists the network endpoints in the specified
  85843. // network endpoint group.
  85844. func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
  85845. c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85846. c.project = project
  85847. c.zone = zone
  85848. c.networkEndpointGroup = networkEndpointGroup
  85849. c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
  85850. return c
  85851. }
  85852. // Filter sets the optional parameter "filter": A filter expression that
  85853. // filters resources listed in the response. The expression must specify
  85854. // the field name, a comparison operator, and the value that you want to
  85855. // use for filtering. The value must be a string, a number, or a
  85856. // boolean. The comparison operator must be either =, !=, >, or <.
  85857. //
  85858. // For example, if you are filtering Compute Engine instances, you can
  85859. // exclude instances named example-instance by specifying name !=
  85860. // example-instance.
  85861. //
  85862. // You can also filter nested fields. For example, you could specify
  85863. // scheduling.automaticRestart = false to include instances only if they
  85864. // are not scheduled for automatic restarts. You can use filtering on
  85865. // nested fields to filter based on resource labels.
  85866. //
  85867. // To filter on multiple expressions, provide each separate expression
  85868. // within parentheses. For example, (scheduling.automaticRestart = true)
  85869. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85870. // AND expression. However, you can include AND and OR expressions
  85871. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85872. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85873. // true).
  85874. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  85875. c.urlParams_.Set("filter", filter)
  85876. return c
  85877. }
  85878. // MaxResults sets the optional parameter "maxResults": The maximum
  85879. // number of results per page that should be returned. If the number of
  85880. // available results is larger than maxResults, Compute Engine returns a
  85881. // nextPageToken that can be used to get the next page of results in
  85882. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85883. // (Default: 500)
  85884. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
  85885. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85886. return c
  85887. }
  85888. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85889. // a certain order. By default, results are returned in alphanumerical
  85890. // order based on the resource name.
  85891. //
  85892. // You can also sort results in descending order based on the creation
  85893. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85894. // based on the creationTimestamp field in reverse chronological order
  85895. // (newest result first). Use this to sort resources like operations so
  85896. // that the newest operation is returned first.
  85897. //
  85898. // Currently, only sorting by name or creationTimestamp desc is
  85899. // supported.
  85900. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  85901. c.urlParams_.Set("orderBy", orderBy)
  85902. return c
  85903. }
  85904. // PageToken sets the optional parameter "pageToken": Specifies a page
  85905. // token to use. Set pageToken to the nextPageToken returned by a
  85906. // previous list request to get the next page of results.
  85907. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  85908. c.urlParams_.Set("pageToken", pageToken)
  85909. return c
  85910. }
  85911. // Fields allows partial responses to be retrieved. See
  85912. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85913. // for more information.
  85914. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
  85915. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85916. return c
  85917. }
  85918. // Context sets the context to be used in this call's Do method. Any
  85919. // pending HTTP request will be aborted if the provided context is
  85920. // canceled.
  85921. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
  85922. c.ctx_ = ctx
  85923. return c
  85924. }
  85925. // Header returns an http.Header that can be modified by the caller to
  85926. // add HTTP headers to the request.
  85927. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  85928. if c.header_ == nil {
  85929. c.header_ = make(http.Header)
  85930. }
  85931. return c.header_
  85932. }
  85933. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  85934. reqHeaders := make(http.Header)
  85935. for k, v := range c.header_ {
  85936. reqHeaders[k] = v
  85937. }
  85938. reqHeaders.Set("User-Agent", c.s.userAgent())
  85939. var body io.Reader = nil
  85940. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
  85941. if err != nil {
  85942. return nil, err
  85943. }
  85944. reqHeaders.Set("Content-Type", "application/json")
  85945. c.urlParams_.Set("alt", alt)
  85946. c.urlParams_.Set("prettyPrint", "false")
  85947. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  85948. urls += "?" + c.urlParams_.Encode()
  85949. req, err := http.NewRequest("POST", urls, body)
  85950. if err != nil {
  85951. return nil, err
  85952. }
  85953. req.Header = reqHeaders
  85954. googleapi.Expand(req.URL, map[string]string{
  85955. "project": c.project,
  85956. "zone": c.zone,
  85957. "networkEndpointGroup": c.networkEndpointGroup,
  85958. })
  85959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85960. }
  85961. // Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
  85962. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  85963. // will be non-nil. Any non-2xx status code is an error. Response
  85964. // headers are in either
  85965. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  85966. // (if a response was returned at all) in
  85967. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  85968. // whether the returned error was because http.StatusNotModified was
  85969. // returned.
  85970. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  85971. gensupport.SetOptions(c.urlParams_, opts...)
  85972. res, err := c.doRequest("json")
  85973. if res != nil && res.StatusCode == http.StatusNotModified {
  85974. if res.Body != nil {
  85975. res.Body.Close()
  85976. }
  85977. return nil, &googleapi.Error{
  85978. Code: res.StatusCode,
  85979. Header: res.Header,
  85980. }
  85981. }
  85982. if err != nil {
  85983. return nil, err
  85984. }
  85985. defer googleapi.CloseBody(res)
  85986. if err := googleapi.CheckResponse(res); err != nil {
  85987. return nil, err
  85988. }
  85989. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  85990. ServerResponse: googleapi.ServerResponse{
  85991. Header: res.Header,
  85992. HTTPStatusCode: res.StatusCode,
  85993. },
  85994. }
  85995. target := &ret
  85996. if err := gensupport.DecodeResponse(target, res); err != nil {
  85997. return nil, err
  85998. }
  85999. return ret, nil
  86000. // {
  86001. // "description": "Lists the network endpoints in the specified network endpoint group.",
  86002. // "httpMethod": "POST",
  86003. // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
  86004. // "parameterOrder": [
  86005. // "project",
  86006. // "zone",
  86007. // "networkEndpointGroup"
  86008. // ],
  86009. // "parameters": {
  86010. // "filter": {
  86011. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  86012. // "location": "query",
  86013. // "type": "string"
  86014. // },
  86015. // "maxResults": {
  86016. // "default": "500",
  86017. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86018. // "format": "uint32",
  86019. // "location": "query",
  86020. // "minimum": "0",
  86021. // "type": "integer"
  86022. // },
  86023. // "networkEndpointGroup": {
  86024. // "description": "The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035.",
  86025. // "location": "path",
  86026. // "required": true,
  86027. // "type": "string"
  86028. // },
  86029. // "orderBy": {
  86030. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86031. // "location": "query",
  86032. // "type": "string"
  86033. // },
  86034. // "pageToken": {
  86035. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86036. // "location": "query",
  86037. // "type": "string"
  86038. // },
  86039. // "project": {
  86040. // "description": "Project ID for this request.",
  86041. // "location": "path",
  86042. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86043. // "required": true,
  86044. // "type": "string"
  86045. // },
  86046. // "zone": {
  86047. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  86048. // "location": "path",
  86049. // "required": true,
  86050. // "type": "string"
  86051. // }
  86052. // },
  86053. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  86054. // "request": {
  86055. // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
  86056. // },
  86057. // "response": {
  86058. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  86059. // },
  86060. // "scopes": [
  86061. // "https://www.googleapis.com/auth/cloud-platform",
  86062. // "https://www.googleapis.com/auth/compute",
  86063. // "https://www.googleapis.com/auth/compute.readonly"
  86064. // ]
  86065. // }
  86066. }
  86067. // Pages invokes f for each page of results.
  86068. // A non-nil error returned from f will halt the iteration.
  86069. // The provided context supersedes any context provided to the Context method.
  86070. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  86071. c.ctx_ = ctx
  86072. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86073. for {
  86074. x, err := c.Do()
  86075. if err != nil {
  86076. return err
  86077. }
  86078. if err := f(x); err != nil {
  86079. return err
  86080. }
  86081. if x.NextPageToken == "" {
  86082. return nil
  86083. }
  86084. c.PageToken(x.NextPageToken)
  86085. }
  86086. }
  86087. // method id "compute.networkEndpointGroups.testIamPermissions":
  86088. type NetworkEndpointGroupsTestIamPermissionsCall struct {
  86089. s *Service
  86090. project string
  86091. zone string
  86092. resource string
  86093. testpermissionsrequest *TestPermissionsRequest
  86094. urlParams_ gensupport.URLParams
  86095. ctx_ context.Context
  86096. header_ http.Header
  86097. }
  86098. // TestIamPermissions: Returns permissions that a caller has on the
  86099. // specified resource.
  86100. func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
  86101. c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86102. c.project = project
  86103. c.zone = zone
  86104. c.resource = resource
  86105. c.testpermissionsrequest = testpermissionsrequest
  86106. return c
  86107. }
  86108. // Fields allows partial responses to be retrieved. See
  86109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86110. // for more information.
  86111. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
  86112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86113. return c
  86114. }
  86115. // Context sets the context to be used in this call's Do method. Any
  86116. // pending HTTP request will be aborted if the provided context is
  86117. // canceled.
  86118. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
  86119. c.ctx_ = ctx
  86120. return c
  86121. }
  86122. // Header returns an http.Header that can be modified by the caller to
  86123. // add HTTP headers to the request.
  86124. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
  86125. if c.header_ == nil {
  86126. c.header_ = make(http.Header)
  86127. }
  86128. return c.header_
  86129. }
  86130. func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  86131. reqHeaders := make(http.Header)
  86132. for k, v := range c.header_ {
  86133. reqHeaders[k] = v
  86134. }
  86135. reqHeaders.Set("User-Agent", c.s.userAgent())
  86136. var body io.Reader = nil
  86137. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  86138. if err != nil {
  86139. return nil, err
  86140. }
  86141. reqHeaders.Set("Content-Type", "application/json")
  86142. c.urlParams_.Set("alt", alt)
  86143. c.urlParams_.Set("prettyPrint", "false")
  86144. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
  86145. urls += "?" + c.urlParams_.Encode()
  86146. req, err := http.NewRequest("POST", urls, body)
  86147. if err != nil {
  86148. return nil, err
  86149. }
  86150. req.Header = reqHeaders
  86151. googleapi.Expand(req.URL, map[string]string{
  86152. "project": c.project,
  86153. "zone": c.zone,
  86154. "resource": c.resource,
  86155. })
  86156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86157. }
  86158. // Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
  86159. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  86160. // non-2xx status code is an error. Response headers are in either
  86161. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  86162. // returned at all) in error.(*googleapi.Error).Header. Use
  86163. // googleapi.IsNotModified to check whether the returned error was
  86164. // because http.StatusNotModified was returned.
  86165. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  86166. gensupport.SetOptions(c.urlParams_, opts...)
  86167. res, err := c.doRequest("json")
  86168. if res != nil && res.StatusCode == http.StatusNotModified {
  86169. if res.Body != nil {
  86170. res.Body.Close()
  86171. }
  86172. return nil, &googleapi.Error{
  86173. Code: res.StatusCode,
  86174. Header: res.Header,
  86175. }
  86176. }
  86177. if err != nil {
  86178. return nil, err
  86179. }
  86180. defer googleapi.CloseBody(res)
  86181. if err := googleapi.CheckResponse(res); err != nil {
  86182. return nil, err
  86183. }
  86184. ret := &TestPermissionsResponse{
  86185. ServerResponse: googleapi.ServerResponse{
  86186. Header: res.Header,
  86187. HTTPStatusCode: res.StatusCode,
  86188. },
  86189. }
  86190. target := &ret
  86191. if err := gensupport.DecodeResponse(target, res); err != nil {
  86192. return nil, err
  86193. }
  86194. return ret, nil
  86195. // {
  86196. // "description": "Returns permissions that a caller has on the specified resource.",
  86197. // "httpMethod": "POST",
  86198. // "id": "compute.networkEndpointGroups.testIamPermissions",
  86199. // "parameterOrder": [
  86200. // "project",
  86201. // "zone",
  86202. // "resource"
  86203. // ],
  86204. // "parameters": {
  86205. // "project": {
  86206. // "description": "Project ID for this request.",
  86207. // "location": "path",
  86208. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86209. // "required": true,
  86210. // "type": "string"
  86211. // },
  86212. // "resource": {
  86213. // "description": "Name or id of the resource for this request.",
  86214. // "location": "path",
  86215. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86216. // "required": true,
  86217. // "type": "string"
  86218. // },
  86219. // "zone": {
  86220. // "description": "The name of the zone for this request.",
  86221. // "location": "path",
  86222. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86223. // "required": true,
  86224. // "type": "string"
  86225. // }
  86226. // },
  86227. // "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
  86228. // "request": {
  86229. // "$ref": "TestPermissionsRequest"
  86230. // },
  86231. // "response": {
  86232. // "$ref": "TestPermissionsResponse"
  86233. // },
  86234. // "scopes": [
  86235. // "https://www.googleapis.com/auth/cloud-platform",
  86236. // "https://www.googleapis.com/auth/compute",
  86237. // "https://www.googleapis.com/auth/compute.readonly"
  86238. // ]
  86239. // }
  86240. }
  86241. // method id "compute.networks.addPeering":
  86242. type NetworksAddPeeringCall struct {
  86243. s *Service
  86244. project string
  86245. network string
  86246. networksaddpeeringrequest *NetworksAddPeeringRequest
  86247. urlParams_ gensupport.URLParams
  86248. ctx_ context.Context
  86249. header_ http.Header
  86250. }
  86251. // AddPeering: Adds a peering to the specified network.
  86252. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  86253. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86254. c.project = project
  86255. c.network = network
  86256. c.networksaddpeeringrequest = networksaddpeeringrequest
  86257. return c
  86258. }
  86259. // RequestId sets the optional parameter "requestId": An optional
  86260. // request ID to identify requests. Specify a unique request ID so that
  86261. // if you must retry your request, the server will know to ignore the
  86262. // request if it has already been completed.
  86263. //
  86264. // For example, consider a situation where you make an initial request
  86265. // and the request times out. If you make the request again with the
  86266. // same request ID, the server can check if original operation with the
  86267. // same request ID was received, and if so, will ignore the second
  86268. // request. This prevents clients from accidentally creating duplicate
  86269. // commitments.
  86270. //
  86271. // The request ID must be a valid UUID with the exception that zero UUID
  86272. // is not supported (00000000-0000-0000-0000-000000000000).
  86273. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  86274. c.urlParams_.Set("requestId", requestId)
  86275. return c
  86276. }
  86277. // Fields allows partial responses to be retrieved. See
  86278. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86279. // for more information.
  86280. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  86281. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86282. return c
  86283. }
  86284. // Context sets the context to be used in this call's Do method. Any
  86285. // pending HTTP request will be aborted if the provided context is
  86286. // canceled.
  86287. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  86288. c.ctx_ = ctx
  86289. return c
  86290. }
  86291. // Header returns an http.Header that can be modified by the caller to
  86292. // add HTTP headers to the request.
  86293. func (c *NetworksAddPeeringCall) Header() http.Header {
  86294. if c.header_ == nil {
  86295. c.header_ = make(http.Header)
  86296. }
  86297. return c.header_
  86298. }
  86299. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  86300. reqHeaders := make(http.Header)
  86301. for k, v := range c.header_ {
  86302. reqHeaders[k] = v
  86303. }
  86304. reqHeaders.Set("User-Agent", c.s.userAgent())
  86305. var body io.Reader = nil
  86306. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  86307. if err != nil {
  86308. return nil, err
  86309. }
  86310. reqHeaders.Set("Content-Type", "application/json")
  86311. c.urlParams_.Set("alt", alt)
  86312. c.urlParams_.Set("prettyPrint", "false")
  86313. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  86314. urls += "?" + c.urlParams_.Encode()
  86315. req, err := http.NewRequest("POST", urls, body)
  86316. if err != nil {
  86317. return nil, err
  86318. }
  86319. req.Header = reqHeaders
  86320. googleapi.Expand(req.URL, map[string]string{
  86321. "project": c.project,
  86322. "network": c.network,
  86323. })
  86324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86325. }
  86326. // Do executes the "compute.networks.addPeering" call.
  86327. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86328. // status code is an error. Response headers are in either
  86329. // *Operation.ServerResponse.Header or (if a response was returned at
  86330. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86331. // to check whether the returned error was because
  86332. // http.StatusNotModified was returned.
  86333. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86334. gensupport.SetOptions(c.urlParams_, opts...)
  86335. res, err := c.doRequest("json")
  86336. if res != nil && res.StatusCode == http.StatusNotModified {
  86337. if res.Body != nil {
  86338. res.Body.Close()
  86339. }
  86340. return nil, &googleapi.Error{
  86341. Code: res.StatusCode,
  86342. Header: res.Header,
  86343. }
  86344. }
  86345. if err != nil {
  86346. return nil, err
  86347. }
  86348. defer googleapi.CloseBody(res)
  86349. if err := googleapi.CheckResponse(res); err != nil {
  86350. return nil, err
  86351. }
  86352. ret := &Operation{
  86353. ServerResponse: googleapi.ServerResponse{
  86354. Header: res.Header,
  86355. HTTPStatusCode: res.StatusCode,
  86356. },
  86357. }
  86358. target := &ret
  86359. if err := gensupport.DecodeResponse(target, res); err != nil {
  86360. return nil, err
  86361. }
  86362. return ret, nil
  86363. // {
  86364. // "description": "Adds a peering to the specified network.",
  86365. // "httpMethod": "POST",
  86366. // "id": "compute.networks.addPeering",
  86367. // "parameterOrder": [
  86368. // "project",
  86369. // "network"
  86370. // ],
  86371. // "parameters": {
  86372. // "network": {
  86373. // "description": "Name of the network resource to add peering to.",
  86374. // "location": "path",
  86375. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86376. // "required": true,
  86377. // "type": "string"
  86378. // },
  86379. // "project": {
  86380. // "description": "Project ID for this request.",
  86381. // "location": "path",
  86382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86383. // "required": true,
  86384. // "type": "string"
  86385. // },
  86386. // "requestId": {
  86387. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86388. // "location": "query",
  86389. // "type": "string"
  86390. // }
  86391. // },
  86392. // "path": "{project}/global/networks/{network}/addPeering",
  86393. // "request": {
  86394. // "$ref": "NetworksAddPeeringRequest"
  86395. // },
  86396. // "response": {
  86397. // "$ref": "Operation"
  86398. // },
  86399. // "scopes": [
  86400. // "https://www.googleapis.com/auth/cloud-platform",
  86401. // "https://www.googleapis.com/auth/compute"
  86402. // ]
  86403. // }
  86404. }
  86405. // method id "compute.networks.delete":
  86406. type NetworksDeleteCall struct {
  86407. s *Service
  86408. project string
  86409. network string
  86410. urlParams_ gensupport.URLParams
  86411. ctx_ context.Context
  86412. header_ http.Header
  86413. }
  86414. // Delete: Deletes the specified network.
  86415. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  86416. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  86417. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86418. c.project = project
  86419. c.network = network
  86420. return c
  86421. }
  86422. // RequestId sets the optional parameter "requestId": An optional
  86423. // request ID to identify requests. Specify a unique request ID so that
  86424. // if you must retry your request, the server will know to ignore the
  86425. // request if it has already been completed.
  86426. //
  86427. // For example, consider a situation where you make an initial request
  86428. // and the request times out. If you make the request again with the
  86429. // same request ID, the server can check if original operation with the
  86430. // same request ID was received, and if so, will ignore the second
  86431. // request. This prevents clients from accidentally creating duplicate
  86432. // commitments.
  86433. //
  86434. // The request ID must be a valid UUID with the exception that zero UUID
  86435. // is not supported (00000000-0000-0000-0000-000000000000).
  86436. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  86437. c.urlParams_.Set("requestId", requestId)
  86438. return c
  86439. }
  86440. // Fields allows partial responses to be retrieved. See
  86441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86442. // for more information.
  86443. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  86444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86445. return c
  86446. }
  86447. // Context sets the context to be used in this call's Do method. Any
  86448. // pending HTTP request will be aborted if the provided context is
  86449. // canceled.
  86450. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  86451. c.ctx_ = ctx
  86452. return c
  86453. }
  86454. // Header returns an http.Header that can be modified by the caller to
  86455. // add HTTP headers to the request.
  86456. func (c *NetworksDeleteCall) Header() http.Header {
  86457. if c.header_ == nil {
  86458. c.header_ = make(http.Header)
  86459. }
  86460. return c.header_
  86461. }
  86462. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  86463. reqHeaders := make(http.Header)
  86464. for k, v := range c.header_ {
  86465. reqHeaders[k] = v
  86466. }
  86467. reqHeaders.Set("User-Agent", c.s.userAgent())
  86468. var body io.Reader = nil
  86469. c.urlParams_.Set("alt", alt)
  86470. c.urlParams_.Set("prettyPrint", "false")
  86471. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  86472. urls += "?" + c.urlParams_.Encode()
  86473. req, err := http.NewRequest("DELETE", urls, body)
  86474. if err != nil {
  86475. return nil, err
  86476. }
  86477. req.Header = reqHeaders
  86478. googleapi.Expand(req.URL, map[string]string{
  86479. "project": c.project,
  86480. "network": c.network,
  86481. })
  86482. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86483. }
  86484. // Do executes the "compute.networks.delete" call.
  86485. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86486. // status code is an error. Response headers are in either
  86487. // *Operation.ServerResponse.Header or (if a response was returned at
  86488. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86489. // to check whether the returned error was because
  86490. // http.StatusNotModified was returned.
  86491. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86492. gensupport.SetOptions(c.urlParams_, opts...)
  86493. res, err := c.doRequest("json")
  86494. if res != nil && res.StatusCode == http.StatusNotModified {
  86495. if res.Body != nil {
  86496. res.Body.Close()
  86497. }
  86498. return nil, &googleapi.Error{
  86499. Code: res.StatusCode,
  86500. Header: res.Header,
  86501. }
  86502. }
  86503. if err != nil {
  86504. return nil, err
  86505. }
  86506. defer googleapi.CloseBody(res)
  86507. if err := googleapi.CheckResponse(res); err != nil {
  86508. return nil, err
  86509. }
  86510. ret := &Operation{
  86511. ServerResponse: googleapi.ServerResponse{
  86512. Header: res.Header,
  86513. HTTPStatusCode: res.StatusCode,
  86514. },
  86515. }
  86516. target := &ret
  86517. if err := gensupport.DecodeResponse(target, res); err != nil {
  86518. return nil, err
  86519. }
  86520. return ret, nil
  86521. // {
  86522. // "description": "Deletes the specified network.",
  86523. // "httpMethod": "DELETE",
  86524. // "id": "compute.networks.delete",
  86525. // "parameterOrder": [
  86526. // "project",
  86527. // "network"
  86528. // ],
  86529. // "parameters": {
  86530. // "network": {
  86531. // "description": "Name of the network to delete.",
  86532. // "location": "path",
  86533. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86534. // "required": true,
  86535. // "type": "string"
  86536. // },
  86537. // "project": {
  86538. // "description": "Project ID for this request.",
  86539. // "location": "path",
  86540. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86541. // "required": true,
  86542. // "type": "string"
  86543. // },
  86544. // "requestId": {
  86545. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86546. // "location": "query",
  86547. // "type": "string"
  86548. // }
  86549. // },
  86550. // "path": "{project}/global/networks/{network}",
  86551. // "response": {
  86552. // "$ref": "Operation"
  86553. // },
  86554. // "scopes": [
  86555. // "https://www.googleapis.com/auth/cloud-platform",
  86556. // "https://www.googleapis.com/auth/compute"
  86557. // ]
  86558. // }
  86559. }
  86560. // method id "compute.networks.get":
  86561. type NetworksGetCall struct {
  86562. s *Service
  86563. project string
  86564. network string
  86565. urlParams_ gensupport.URLParams
  86566. ifNoneMatch_ string
  86567. ctx_ context.Context
  86568. header_ http.Header
  86569. }
  86570. // Get: Returns the specified network. Gets a list of available networks
  86571. // by making a list() request.
  86572. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  86573. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  86574. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86575. c.project = project
  86576. c.network = network
  86577. return c
  86578. }
  86579. // Fields allows partial responses to be retrieved. See
  86580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86581. // for more information.
  86582. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  86583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86584. return c
  86585. }
  86586. // IfNoneMatch sets the optional parameter which makes the operation
  86587. // fail if the object's ETag matches the given value. This is useful for
  86588. // getting updates only after the object has changed since the last
  86589. // request. Use googleapi.IsNotModified to check whether the response
  86590. // error from Do is the result of In-None-Match.
  86591. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  86592. c.ifNoneMatch_ = entityTag
  86593. return c
  86594. }
  86595. // Context sets the context to be used in this call's Do method. Any
  86596. // pending HTTP request will be aborted if the provided context is
  86597. // canceled.
  86598. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  86599. c.ctx_ = ctx
  86600. return c
  86601. }
  86602. // Header returns an http.Header that can be modified by the caller to
  86603. // add HTTP headers to the request.
  86604. func (c *NetworksGetCall) Header() http.Header {
  86605. if c.header_ == nil {
  86606. c.header_ = make(http.Header)
  86607. }
  86608. return c.header_
  86609. }
  86610. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  86611. reqHeaders := make(http.Header)
  86612. for k, v := range c.header_ {
  86613. reqHeaders[k] = v
  86614. }
  86615. reqHeaders.Set("User-Agent", c.s.userAgent())
  86616. if c.ifNoneMatch_ != "" {
  86617. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86618. }
  86619. var body io.Reader = nil
  86620. c.urlParams_.Set("alt", alt)
  86621. c.urlParams_.Set("prettyPrint", "false")
  86622. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  86623. urls += "?" + c.urlParams_.Encode()
  86624. req, err := http.NewRequest("GET", urls, body)
  86625. if err != nil {
  86626. return nil, err
  86627. }
  86628. req.Header = reqHeaders
  86629. googleapi.Expand(req.URL, map[string]string{
  86630. "project": c.project,
  86631. "network": c.network,
  86632. })
  86633. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86634. }
  86635. // Do executes the "compute.networks.get" call.
  86636. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  86637. // code is an error. Response headers are in either
  86638. // *Network.ServerResponse.Header or (if a response was returned at all)
  86639. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  86640. // check whether the returned error was because http.StatusNotModified
  86641. // was returned.
  86642. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  86643. gensupport.SetOptions(c.urlParams_, opts...)
  86644. res, err := c.doRequest("json")
  86645. if res != nil && res.StatusCode == http.StatusNotModified {
  86646. if res.Body != nil {
  86647. res.Body.Close()
  86648. }
  86649. return nil, &googleapi.Error{
  86650. Code: res.StatusCode,
  86651. Header: res.Header,
  86652. }
  86653. }
  86654. if err != nil {
  86655. return nil, err
  86656. }
  86657. defer googleapi.CloseBody(res)
  86658. if err := googleapi.CheckResponse(res); err != nil {
  86659. return nil, err
  86660. }
  86661. ret := &Network{
  86662. ServerResponse: googleapi.ServerResponse{
  86663. Header: res.Header,
  86664. HTTPStatusCode: res.StatusCode,
  86665. },
  86666. }
  86667. target := &ret
  86668. if err := gensupport.DecodeResponse(target, res); err != nil {
  86669. return nil, err
  86670. }
  86671. return ret, nil
  86672. // {
  86673. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  86674. // "httpMethod": "GET",
  86675. // "id": "compute.networks.get",
  86676. // "parameterOrder": [
  86677. // "project",
  86678. // "network"
  86679. // ],
  86680. // "parameters": {
  86681. // "network": {
  86682. // "description": "Name of the network to return.",
  86683. // "location": "path",
  86684. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86685. // "required": true,
  86686. // "type": "string"
  86687. // },
  86688. // "project": {
  86689. // "description": "Project ID for this request.",
  86690. // "location": "path",
  86691. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86692. // "required": true,
  86693. // "type": "string"
  86694. // }
  86695. // },
  86696. // "path": "{project}/global/networks/{network}",
  86697. // "response": {
  86698. // "$ref": "Network"
  86699. // },
  86700. // "scopes": [
  86701. // "https://www.googleapis.com/auth/cloud-platform",
  86702. // "https://www.googleapis.com/auth/compute",
  86703. // "https://www.googleapis.com/auth/compute.readonly"
  86704. // ]
  86705. // }
  86706. }
  86707. // method id "compute.networks.insert":
  86708. type NetworksInsertCall struct {
  86709. s *Service
  86710. project string
  86711. network *Network
  86712. urlParams_ gensupport.URLParams
  86713. ctx_ context.Context
  86714. header_ http.Header
  86715. }
  86716. // Insert: Creates a network in the specified project using the data
  86717. // included in the request.
  86718. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  86719. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  86720. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86721. c.project = project
  86722. c.network = network
  86723. return c
  86724. }
  86725. // RequestId sets the optional parameter "requestId": An optional
  86726. // request ID to identify requests. Specify a unique request ID so that
  86727. // if you must retry your request, the server will know to ignore the
  86728. // request if it has already been completed.
  86729. //
  86730. // For example, consider a situation where you make an initial request
  86731. // and the request times out. If you make the request again with the
  86732. // same request ID, the server can check if original operation with the
  86733. // same request ID was received, and if so, will ignore the second
  86734. // request. This prevents clients from accidentally creating duplicate
  86735. // commitments.
  86736. //
  86737. // The request ID must be a valid UUID with the exception that zero UUID
  86738. // is not supported (00000000-0000-0000-0000-000000000000).
  86739. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  86740. c.urlParams_.Set("requestId", requestId)
  86741. return c
  86742. }
  86743. // Fields allows partial responses to be retrieved. See
  86744. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86745. // for more information.
  86746. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  86747. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86748. return c
  86749. }
  86750. // Context sets the context to be used in this call's Do method. Any
  86751. // pending HTTP request will be aborted if the provided context is
  86752. // canceled.
  86753. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  86754. c.ctx_ = ctx
  86755. return c
  86756. }
  86757. // Header returns an http.Header that can be modified by the caller to
  86758. // add HTTP headers to the request.
  86759. func (c *NetworksInsertCall) Header() http.Header {
  86760. if c.header_ == nil {
  86761. c.header_ = make(http.Header)
  86762. }
  86763. return c.header_
  86764. }
  86765. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  86766. reqHeaders := make(http.Header)
  86767. for k, v := range c.header_ {
  86768. reqHeaders[k] = v
  86769. }
  86770. reqHeaders.Set("User-Agent", c.s.userAgent())
  86771. var body io.Reader = nil
  86772. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  86773. if err != nil {
  86774. return nil, err
  86775. }
  86776. reqHeaders.Set("Content-Type", "application/json")
  86777. c.urlParams_.Set("alt", alt)
  86778. c.urlParams_.Set("prettyPrint", "false")
  86779. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  86780. urls += "?" + c.urlParams_.Encode()
  86781. req, err := http.NewRequest("POST", urls, body)
  86782. if err != nil {
  86783. return nil, err
  86784. }
  86785. req.Header = reqHeaders
  86786. googleapi.Expand(req.URL, map[string]string{
  86787. "project": c.project,
  86788. })
  86789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86790. }
  86791. // Do executes the "compute.networks.insert" call.
  86792. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86793. // status code is an error. Response headers are in either
  86794. // *Operation.ServerResponse.Header or (if a response was returned at
  86795. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86796. // to check whether the returned error was because
  86797. // http.StatusNotModified was returned.
  86798. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86799. gensupport.SetOptions(c.urlParams_, opts...)
  86800. res, err := c.doRequest("json")
  86801. if res != nil && res.StatusCode == http.StatusNotModified {
  86802. if res.Body != nil {
  86803. res.Body.Close()
  86804. }
  86805. return nil, &googleapi.Error{
  86806. Code: res.StatusCode,
  86807. Header: res.Header,
  86808. }
  86809. }
  86810. if err != nil {
  86811. return nil, err
  86812. }
  86813. defer googleapi.CloseBody(res)
  86814. if err := googleapi.CheckResponse(res); err != nil {
  86815. return nil, err
  86816. }
  86817. ret := &Operation{
  86818. ServerResponse: googleapi.ServerResponse{
  86819. Header: res.Header,
  86820. HTTPStatusCode: res.StatusCode,
  86821. },
  86822. }
  86823. target := &ret
  86824. if err := gensupport.DecodeResponse(target, res); err != nil {
  86825. return nil, err
  86826. }
  86827. return ret, nil
  86828. // {
  86829. // "description": "Creates a network in the specified project using the data included in the request.",
  86830. // "httpMethod": "POST",
  86831. // "id": "compute.networks.insert",
  86832. // "parameterOrder": [
  86833. // "project"
  86834. // ],
  86835. // "parameters": {
  86836. // "project": {
  86837. // "description": "Project ID for this request.",
  86838. // "location": "path",
  86839. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86840. // "required": true,
  86841. // "type": "string"
  86842. // },
  86843. // "requestId": {
  86844. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86845. // "location": "query",
  86846. // "type": "string"
  86847. // }
  86848. // },
  86849. // "path": "{project}/global/networks",
  86850. // "request": {
  86851. // "$ref": "Network"
  86852. // },
  86853. // "response": {
  86854. // "$ref": "Operation"
  86855. // },
  86856. // "scopes": [
  86857. // "https://www.googleapis.com/auth/cloud-platform",
  86858. // "https://www.googleapis.com/auth/compute"
  86859. // ]
  86860. // }
  86861. }
  86862. // method id "compute.networks.list":
  86863. type NetworksListCall struct {
  86864. s *Service
  86865. project string
  86866. urlParams_ gensupport.URLParams
  86867. ifNoneMatch_ string
  86868. ctx_ context.Context
  86869. header_ http.Header
  86870. }
  86871. // List: Retrieves the list of networks available to the specified
  86872. // project.
  86873. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  86874. func (r *NetworksService) List(project string) *NetworksListCall {
  86875. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86876. c.project = project
  86877. return c
  86878. }
  86879. // Filter sets the optional parameter "filter": A filter expression that
  86880. // filters resources listed in the response. The expression must specify
  86881. // the field name, a comparison operator, and the value that you want to
  86882. // use for filtering. The value must be a string, a number, or a
  86883. // boolean. The comparison operator must be either =, !=, >, or <.
  86884. //
  86885. // For example, if you are filtering Compute Engine instances, you can
  86886. // exclude instances named example-instance by specifying name !=
  86887. // example-instance.
  86888. //
  86889. // You can also filter nested fields. For example, you could specify
  86890. // scheduling.automaticRestart = false to include instances only if they
  86891. // are not scheduled for automatic restarts. You can use filtering on
  86892. // nested fields to filter based on resource labels.
  86893. //
  86894. // To filter on multiple expressions, provide each separate expression
  86895. // within parentheses. For example, (scheduling.automaticRestart = true)
  86896. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86897. // AND expression. However, you can include AND and OR expressions
  86898. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86899. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86900. // true).
  86901. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  86902. c.urlParams_.Set("filter", filter)
  86903. return c
  86904. }
  86905. // MaxResults sets the optional parameter "maxResults": The maximum
  86906. // number of results per page that should be returned. If the number of
  86907. // available results is larger than maxResults, Compute Engine returns a
  86908. // nextPageToken that can be used to get the next page of results in
  86909. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86910. // (Default: 500)
  86911. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  86912. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86913. return c
  86914. }
  86915. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86916. // a certain order. By default, results are returned in alphanumerical
  86917. // order based on the resource name.
  86918. //
  86919. // You can also sort results in descending order based on the creation
  86920. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86921. // based on the creationTimestamp field in reverse chronological order
  86922. // (newest result first). Use this to sort resources like operations so
  86923. // that the newest operation is returned first.
  86924. //
  86925. // Currently, only sorting by name or creationTimestamp desc is
  86926. // supported.
  86927. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  86928. c.urlParams_.Set("orderBy", orderBy)
  86929. return c
  86930. }
  86931. // PageToken sets the optional parameter "pageToken": Specifies a page
  86932. // token to use. Set pageToken to the nextPageToken returned by a
  86933. // previous list request to get the next page of results.
  86934. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  86935. c.urlParams_.Set("pageToken", pageToken)
  86936. return c
  86937. }
  86938. // Fields allows partial responses to be retrieved. See
  86939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86940. // for more information.
  86941. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  86942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86943. return c
  86944. }
  86945. // IfNoneMatch sets the optional parameter which makes the operation
  86946. // fail if the object's ETag matches the given value. This is useful for
  86947. // getting updates only after the object has changed since the last
  86948. // request. Use googleapi.IsNotModified to check whether the response
  86949. // error from Do is the result of In-None-Match.
  86950. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  86951. c.ifNoneMatch_ = entityTag
  86952. return c
  86953. }
  86954. // Context sets the context to be used in this call's Do method. Any
  86955. // pending HTTP request will be aborted if the provided context is
  86956. // canceled.
  86957. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  86958. c.ctx_ = ctx
  86959. return c
  86960. }
  86961. // Header returns an http.Header that can be modified by the caller to
  86962. // add HTTP headers to the request.
  86963. func (c *NetworksListCall) Header() http.Header {
  86964. if c.header_ == nil {
  86965. c.header_ = make(http.Header)
  86966. }
  86967. return c.header_
  86968. }
  86969. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  86970. reqHeaders := make(http.Header)
  86971. for k, v := range c.header_ {
  86972. reqHeaders[k] = v
  86973. }
  86974. reqHeaders.Set("User-Agent", c.s.userAgent())
  86975. if c.ifNoneMatch_ != "" {
  86976. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86977. }
  86978. var body io.Reader = nil
  86979. c.urlParams_.Set("alt", alt)
  86980. c.urlParams_.Set("prettyPrint", "false")
  86981. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  86982. urls += "?" + c.urlParams_.Encode()
  86983. req, err := http.NewRequest("GET", urls, body)
  86984. if err != nil {
  86985. return nil, err
  86986. }
  86987. req.Header = reqHeaders
  86988. googleapi.Expand(req.URL, map[string]string{
  86989. "project": c.project,
  86990. })
  86991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86992. }
  86993. // Do executes the "compute.networks.list" call.
  86994. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  86995. // status code is an error. Response headers are in either
  86996. // *NetworkList.ServerResponse.Header or (if a response was returned at
  86997. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86998. // to check whether the returned error was because
  86999. // http.StatusNotModified was returned.
  87000. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  87001. gensupport.SetOptions(c.urlParams_, opts...)
  87002. res, err := c.doRequest("json")
  87003. if res != nil && res.StatusCode == http.StatusNotModified {
  87004. if res.Body != nil {
  87005. res.Body.Close()
  87006. }
  87007. return nil, &googleapi.Error{
  87008. Code: res.StatusCode,
  87009. Header: res.Header,
  87010. }
  87011. }
  87012. if err != nil {
  87013. return nil, err
  87014. }
  87015. defer googleapi.CloseBody(res)
  87016. if err := googleapi.CheckResponse(res); err != nil {
  87017. return nil, err
  87018. }
  87019. ret := &NetworkList{
  87020. ServerResponse: googleapi.ServerResponse{
  87021. Header: res.Header,
  87022. HTTPStatusCode: res.StatusCode,
  87023. },
  87024. }
  87025. target := &ret
  87026. if err := gensupport.DecodeResponse(target, res); err != nil {
  87027. return nil, err
  87028. }
  87029. return ret, nil
  87030. // {
  87031. // "description": "Retrieves the list of networks available to the specified project.",
  87032. // "httpMethod": "GET",
  87033. // "id": "compute.networks.list",
  87034. // "parameterOrder": [
  87035. // "project"
  87036. // ],
  87037. // "parameters": {
  87038. // "filter": {
  87039. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87040. // "location": "query",
  87041. // "type": "string"
  87042. // },
  87043. // "maxResults": {
  87044. // "default": "500",
  87045. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87046. // "format": "uint32",
  87047. // "location": "query",
  87048. // "minimum": "0",
  87049. // "type": "integer"
  87050. // },
  87051. // "orderBy": {
  87052. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87053. // "location": "query",
  87054. // "type": "string"
  87055. // },
  87056. // "pageToken": {
  87057. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87058. // "location": "query",
  87059. // "type": "string"
  87060. // },
  87061. // "project": {
  87062. // "description": "Project ID for this request.",
  87063. // "location": "path",
  87064. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87065. // "required": true,
  87066. // "type": "string"
  87067. // }
  87068. // },
  87069. // "path": "{project}/global/networks",
  87070. // "response": {
  87071. // "$ref": "NetworkList"
  87072. // },
  87073. // "scopes": [
  87074. // "https://www.googleapis.com/auth/cloud-platform",
  87075. // "https://www.googleapis.com/auth/compute",
  87076. // "https://www.googleapis.com/auth/compute.readonly"
  87077. // ]
  87078. // }
  87079. }
  87080. // Pages invokes f for each page of results.
  87081. // A non-nil error returned from f will halt the iteration.
  87082. // The provided context supersedes any context provided to the Context method.
  87083. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  87084. c.ctx_ = ctx
  87085. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87086. for {
  87087. x, err := c.Do()
  87088. if err != nil {
  87089. return err
  87090. }
  87091. if err := f(x); err != nil {
  87092. return err
  87093. }
  87094. if x.NextPageToken == "" {
  87095. return nil
  87096. }
  87097. c.PageToken(x.NextPageToken)
  87098. }
  87099. }
  87100. // method id "compute.networks.listIpAddresses":
  87101. type NetworksListIpAddressesCall struct {
  87102. s *Service
  87103. project string
  87104. network string
  87105. urlParams_ gensupport.URLParams
  87106. ifNoneMatch_ string
  87107. ctx_ context.Context
  87108. header_ http.Header
  87109. }
  87110. // ListIpAddresses: Lists the internal IP addresses in the specified
  87111. // network.
  87112. func (r *NetworksService) ListIpAddresses(project string, network string) *NetworksListIpAddressesCall {
  87113. c := &NetworksListIpAddressesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87114. c.project = project
  87115. c.network = network
  87116. return c
  87117. }
  87118. // Filter sets the optional parameter "filter": A filter expression that
  87119. // filters resources listed in the response. The expression must specify
  87120. // the field name, a comparison operator, and the value that you want to
  87121. // use for filtering. The value must be a string, a number, or a
  87122. // boolean. The comparison operator must be either =, !=, >, or <.
  87123. //
  87124. // For example, if you are filtering Compute Engine instances, you can
  87125. // exclude instances named example-instance by specifying name !=
  87126. // example-instance.
  87127. //
  87128. // You can also filter nested fields. For example, you could specify
  87129. // scheduling.automaticRestart = false to include instances only if they
  87130. // are not scheduled for automatic restarts. You can use filtering on
  87131. // nested fields to filter based on resource labels.
  87132. //
  87133. // To filter on multiple expressions, provide each separate expression
  87134. // within parentheses. For example, (scheduling.automaticRestart = true)
  87135. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87136. // AND expression. However, you can include AND and OR expressions
  87137. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87138. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87139. // true).
  87140. func (c *NetworksListIpAddressesCall) Filter(filter string) *NetworksListIpAddressesCall {
  87141. c.urlParams_.Set("filter", filter)
  87142. return c
  87143. }
  87144. // MaxResults sets the optional parameter "maxResults": The maximum
  87145. // number of results per page that should be returned. If the number of
  87146. // available results is larger than maxResults, Compute Engine returns a
  87147. // nextPageToken that can be used to get the next page of results in
  87148. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87149. // (Default: 500)
  87150. func (c *NetworksListIpAddressesCall) MaxResults(maxResults int64) *NetworksListIpAddressesCall {
  87151. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87152. return c
  87153. }
  87154. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87155. // a certain order. By default, results are returned in alphanumerical
  87156. // order based on the resource name.
  87157. //
  87158. // You can also sort results in descending order based on the creation
  87159. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87160. // based on the creationTimestamp field in reverse chronological order
  87161. // (newest result first). Use this to sort resources like operations so
  87162. // that the newest operation is returned first.
  87163. //
  87164. // Currently, only sorting by name or creationTimestamp desc is
  87165. // supported.
  87166. func (c *NetworksListIpAddressesCall) OrderBy(orderBy string) *NetworksListIpAddressesCall {
  87167. c.urlParams_.Set("orderBy", orderBy)
  87168. return c
  87169. }
  87170. // PageToken sets the optional parameter "pageToken": Specifies a page
  87171. // token to use. Set pageToken to the nextPageToken returned by a
  87172. // previous list request to get the next page of results.
  87173. func (c *NetworksListIpAddressesCall) PageToken(pageToken string) *NetworksListIpAddressesCall {
  87174. c.urlParams_.Set("pageToken", pageToken)
  87175. return c
  87176. }
  87177. // Types sets the optional parameter "types": (Optional) types filter
  87178. // separate by comma, valid values are: SUBNETWORK, RESERVED, PEER_USED,
  87179. // PEER_RESERVED, REMOTE_USED, REMOTE_RESERVED.
  87180. func (c *NetworksListIpAddressesCall) Types(types string) *NetworksListIpAddressesCall {
  87181. c.urlParams_.Set("types", types)
  87182. return c
  87183. }
  87184. // Fields allows partial responses to be retrieved. See
  87185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87186. // for more information.
  87187. func (c *NetworksListIpAddressesCall) Fields(s ...googleapi.Field) *NetworksListIpAddressesCall {
  87188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87189. return c
  87190. }
  87191. // IfNoneMatch sets the optional parameter which makes the operation
  87192. // fail if the object's ETag matches the given value. This is useful for
  87193. // getting updates only after the object has changed since the last
  87194. // request. Use googleapi.IsNotModified to check whether the response
  87195. // error from Do is the result of In-None-Match.
  87196. func (c *NetworksListIpAddressesCall) IfNoneMatch(entityTag string) *NetworksListIpAddressesCall {
  87197. c.ifNoneMatch_ = entityTag
  87198. return c
  87199. }
  87200. // Context sets the context to be used in this call's Do method. Any
  87201. // pending HTTP request will be aborted if the provided context is
  87202. // canceled.
  87203. func (c *NetworksListIpAddressesCall) Context(ctx context.Context) *NetworksListIpAddressesCall {
  87204. c.ctx_ = ctx
  87205. return c
  87206. }
  87207. // Header returns an http.Header that can be modified by the caller to
  87208. // add HTTP headers to the request.
  87209. func (c *NetworksListIpAddressesCall) Header() http.Header {
  87210. if c.header_ == nil {
  87211. c.header_ = make(http.Header)
  87212. }
  87213. return c.header_
  87214. }
  87215. func (c *NetworksListIpAddressesCall) doRequest(alt string) (*http.Response, error) {
  87216. reqHeaders := make(http.Header)
  87217. for k, v := range c.header_ {
  87218. reqHeaders[k] = v
  87219. }
  87220. reqHeaders.Set("User-Agent", c.s.userAgent())
  87221. if c.ifNoneMatch_ != "" {
  87222. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87223. }
  87224. var body io.Reader = nil
  87225. c.urlParams_.Set("alt", alt)
  87226. c.urlParams_.Set("prettyPrint", "false")
  87227. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listIpAddresses")
  87228. urls += "?" + c.urlParams_.Encode()
  87229. req, err := http.NewRequest("GET", urls, body)
  87230. if err != nil {
  87231. return nil, err
  87232. }
  87233. req.Header = reqHeaders
  87234. googleapi.Expand(req.URL, map[string]string{
  87235. "project": c.project,
  87236. "network": c.network,
  87237. })
  87238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87239. }
  87240. // Do executes the "compute.networks.listIpAddresses" call.
  87241. // Exactly one of *IpAddressesList or error will be non-nil. Any non-2xx
  87242. // status code is an error. Response headers are in either
  87243. // *IpAddressesList.ServerResponse.Header or (if a response was returned
  87244. // at all) in error.(*googleapi.Error).Header. Use
  87245. // googleapi.IsNotModified to check whether the returned error was
  87246. // because http.StatusNotModified was returned.
  87247. func (c *NetworksListIpAddressesCall) Do(opts ...googleapi.CallOption) (*IpAddressesList, error) {
  87248. gensupport.SetOptions(c.urlParams_, opts...)
  87249. res, err := c.doRequest("json")
  87250. if res != nil && res.StatusCode == http.StatusNotModified {
  87251. if res.Body != nil {
  87252. res.Body.Close()
  87253. }
  87254. return nil, &googleapi.Error{
  87255. Code: res.StatusCode,
  87256. Header: res.Header,
  87257. }
  87258. }
  87259. if err != nil {
  87260. return nil, err
  87261. }
  87262. defer googleapi.CloseBody(res)
  87263. if err := googleapi.CheckResponse(res); err != nil {
  87264. return nil, err
  87265. }
  87266. ret := &IpAddressesList{
  87267. ServerResponse: googleapi.ServerResponse{
  87268. Header: res.Header,
  87269. HTTPStatusCode: res.StatusCode,
  87270. },
  87271. }
  87272. target := &ret
  87273. if err := gensupport.DecodeResponse(target, res); err != nil {
  87274. return nil, err
  87275. }
  87276. return ret, nil
  87277. // {
  87278. // "description": "Lists the internal IP addresses in the specified network.",
  87279. // "httpMethod": "GET",
  87280. // "id": "compute.networks.listIpAddresses",
  87281. // "parameterOrder": [
  87282. // "project",
  87283. // "network"
  87284. // ],
  87285. // "parameters": {
  87286. // "filter": {
  87287. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87288. // "location": "query",
  87289. // "type": "string"
  87290. // },
  87291. // "maxResults": {
  87292. // "default": "500",
  87293. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87294. // "format": "uint32",
  87295. // "location": "query",
  87296. // "minimum": "0",
  87297. // "type": "integer"
  87298. // },
  87299. // "network": {
  87300. // "description": "Name of the network for this request.",
  87301. // "location": "path",
  87302. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87303. // "required": true,
  87304. // "type": "string"
  87305. // },
  87306. // "orderBy": {
  87307. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87308. // "location": "query",
  87309. // "type": "string"
  87310. // },
  87311. // "pageToken": {
  87312. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87313. // "location": "query",
  87314. // "type": "string"
  87315. // },
  87316. // "project": {
  87317. // "description": "Project ID for this request.",
  87318. // "location": "path",
  87319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87320. // "required": true,
  87321. // "type": "string"
  87322. // },
  87323. // "types": {
  87324. // "description": "(Optional) types filter separate by comma, valid values are: SUBNETWORK, RESERVED, PEER_USED, PEER_RESERVED, REMOTE_USED, REMOTE_RESERVED.",
  87325. // "location": "query",
  87326. // "type": "string"
  87327. // }
  87328. // },
  87329. // "path": "{project}/global/networks/{network}/listIpAddresses",
  87330. // "response": {
  87331. // "$ref": "IpAddressesList"
  87332. // },
  87333. // "scopes": [
  87334. // "https://www.googleapis.com/auth/cloud-platform",
  87335. // "https://www.googleapis.com/auth/compute",
  87336. // "https://www.googleapis.com/auth/compute.readonly"
  87337. // ]
  87338. // }
  87339. }
  87340. // Pages invokes f for each page of results.
  87341. // A non-nil error returned from f will halt the iteration.
  87342. // The provided context supersedes any context provided to the Context method.
  87343. func (c *NetworksListIpAddressesCall) Pages(ctx context.Context, f func(*IpAddressesList) error) error {
  87344. c.ctx_ = ctx
  87345. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87346. for {
  87347. x, err := c.Do()
  87348. if err != nil {
  87349. return err
  87350. }
  87351. if err := f(x); err != nil {
  87352. return err
  87353. }
  87354. if x.NextPageToken == "" {
  87355. return nil
  87356. }
  87357. c.PageToken(x.NextPageToken)
  87358. }
  87359. }
  87360. // method id "compute.networks.listIpOwners":
  87361. type NetworksListIpOwnersCall struct {
  87362. s *Service
  87363. project string
  87364. network string
  87365. urlParams_ gensupport.URLParams
  87366. ifNoneMatch_ string
  87367. ctx_ context.Context
  87368. header_ http.Header
  87369. }
  87370. // ListIpOwners: Lists the internal IP owners in the specified network.
  87371. func (r *NetworksService) ListIpOwners(project string, network string) *NetworksListIpOwnersCall {
  87372. c := &NetworksListIpOwnersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87373. c.project = project
  87374. c.network = network
  87375. return c
  87376. }
  87377. // Filter sets the optional parameter "filter": A filter expression that
  87378. // filters resources listed in the response. The expression must specify
  87379. // the field name, a comparison operator, and the value that you want to
  87380. // use for filtering. The value must be a string, a number, or a
  87381. // boolean. The comparison operator must be either =, !=, >, or <.
  87382. //
  87383. // For example, if you are filtering Compute Engine instances, you can
  87384. // exclude instances named example-instance by specifying name !=
  87385. // example-instance.
  87386. //
  87387. // You can also filter nested fields. For example, you could specify
  87388. // scheduling.automaticRestart = false to include instances only if they
  87389. // are not scheduled for automatic restarts. You can use filtering on
  87390. // nested fields to filter based on resource labels.
  87391. //
  87392. // To filter on multiple expressions, provide each separate expression
  87393. // within parentheses. For example, (scheduling.automaticRestart = true)
  87394. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87395. // AND expression. However, you can include AND and OR expressions
  87396. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87397. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87398. // true).
  87399. func (c *NetworksListIpOwnersCall) Filter(filter string) *NetworksListIpOwnersCall {
  87400. c.urlParams_.Set("filter", filter)
  87401. return c
  87402. }
  87403. // IpCidrRange sets the optional parameter "ipCidrRange": (Optional) IP
  87404. // CIDR range filter, example: "10.128.10.0/30".
  87405. func (c *NetworksListIpOwnersCall) IpCidrRange(ipCidrRange string) *NetworksListIpOwnersCall {
  87406. c.urlParams_.Set("ipCidrRange", ipCidrRange)
  87407. return c
  87408. }
  87409. // MaxResults sets the optional parameter "maxResults": The maximum
  87410. // number of results per page that should be returned. If the number of
  87411. // available results is larger than maxResults, Compute Engine returns a
  87412. // nextPageToken that can be used to get the next page of results in
  87413. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87414. // (Default: 500)
  87415. func (c *NetworksListIpOwnersCall) MaxResults(maxResults int64) *NetworksListIpOwnersCall {
  87416. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87417. return c
  87418. }
  87419. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87420. // a certain order. By default, results are returned in alphanumerical
  87421. // order based on the resource name.
  87422. //
  87423. // You can also sort results in descending order based on the creation
  87424. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87425. // based on the creationTimestamp field in reverse chronological order
  87426. // (newest result first). Use this to sort resources like operations so
  87427. // that the newest operation is returned first.
  87428. //
  87429. // Currently, only sorting by name or creationTimestamp desc is
  87430. // supported.
  87431. func (c *NetworksListIpOwnersCall) OrderBy(orderBy string) *NetworksListIpOwnersCall {
  87432. c.urlParams_.Set("orderBy", orderBy)
  87433. return c
  87434. }
  87435. // OwnerProjects sets the optional parameter "ownerProjects": (Optional)
  87436. // Project IDs filter, example: "project-1,project-2".
  87437. func (c *NetworksListIpOwnersCall) OwnerProjects(ownerProjects string) *NetworksListIpOwnersCall {
  87438. c.urlParams_.Set("ownerProjects", ownerProjects)
  87439. return c
  87440. }
  87441. // OwnerTypes sets the optional parameter "ownerTypes": (Optional) Owner
  87442. // types filter, example: "instance,forwardingRule".
  87443. func (c *NetworksListIpOwnersCall) OwnerTypes(ownerTypes string) *NetworksListIpOwnersCall {
  87444. c.urlParams_.Set("ownerTypes", ownerTypes)
  87445. return c
  87446. }
  87447. // PageToken sets the optional parameter "pageToken": Specifies a page
  87448. // token to use. Set pageToken to the nextPageToken returned by a
  87449. // previous list request to get the next page of results.
  87450. func (c *NetworksListIpOwnersCall) PageToken(pageToken string) *NetworksListIpOwnersCall {
  87451. c.urlParams_.Set("pageToken", pageToken)
  87452. return c
  87453. }
  87454. // SubnetName sets the optional parameter "subnetName": (Optional)
  87455. // Subnetwork name filter.
  87456. func (c *NetworksListIpOwnersCall) SubnetName(subnetName string) *NetworksListIpOwnersCall {
  87457. c.urlParams_.Set("subnetName", subnetName)
  87458. return c
  87459. }
  87460. // SubnetRegion sets the optional parameter "subnetRegion": (Optional)
  87461. // Subnetwork region filter.
  87462. func (c *NetworksListIpOwnersCall) SubnetRegion(subnetRegion string) *NetworksListIpOwnersCall {
  87463. c.urlParams_.Set("subnetRegion", subnetRegion)
  87464. return c
  87465. }
  87466. // Fields allows partial responses to be retrieved. See
  87467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87468. // for more information.
  87469. func (c *NetworksListIpOwnersCall) Fields(s ...googleapi.Field) *NetworksListIpOwnersCall {
  87470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87471. return c
  87472. }
  87473. // IfNoneMatch sets the optional parameter which makes the operation
  87474. // fail if the object's ETag matches the given value. This is useful for
  87475. // getting updates only after the object has changed since the last
  87476. // request. Use googleapi.IsNotModified to check whether the response
  87477. // error from Do is the result of In-None-Match.
  87478. func (c *NetworksListIpOwnersCall) IfNoneMatch(entityTag string) *NetworksListIpOwnersCall {
  87479. c.ifNoneMatch_ = entityTag
  87480. return c
  87481. }
  87482. // Context sets the context to be used in this call's Do method. Any
  87483. // pending HTTP request will be aborted if the provided context is
  87484. // canceled.
  87485. func (c *NetworksListIpOwnersCall) Context(ctx context.Context) *NetworksListIpOwnersCall {
  87486. c.ctx_ = ctx
  87487. return c
  87488. }
  87489. // Header returns an http.Header that can be modified by the caller to
  87490. // add HTTP headers to the request.
  87491. func (c *NetworksListIpOwnersCall) Header() http.Header {
  87492. if c.header_ == nil {
  87493. c.header_ = make(http.Header)
  87494. }
  87495. return c.header_
  87496. }
  87497. func (c *NetworksListIpOwnersCall) doRequest(alt string) (*http.Response, error) {
  87498. reqHeaders := make(http.Header)
  87499. for k, v := range c.header_ {
  87500. reqHeaders[k] = v
  87501. }
  87502. reqHeaders.Set("User-Agent", c.s.userAgent())
  87503. if c.ifNoneMatch_ != "" {
  87504. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87505. }
  87506. var body io.Reader = nil
  87507. c.urlParams_.Set("alt", alt)
  87508. c.urlParams_.Set("prettyPrint", "false")
  87509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listIpOwners")
  87510. urls += "?" + c.urlParams_.Encode()
  87511. req, err := http.NewRequest("GET", urls, body)
  87512. if err != nil {
  87513. return nil, err
  87514. }
  87515. req.Header = reqHeaders
  87516. googleapi.Expand(req.URL, map[string]string{
  87517. "project": c.project,
  87518. "network": c.network,
  87519. })
  87520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87521. }
  87522. // Do executes the "compute.networks.listIpOwners" call.
  87523. // Exactly one of *IpOwnerList or error will be non-nil. Any non-2xx
  87524. // status code is an error. Response headers are in either
  87525. // *IpOwnerList.ServerResponse.Header or (if a response was returned at
  87526. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87527. // to check whether the returned error was because
  87528. // http.StatusNotModified was returned.
  87529. func (c *NetworksListIpOwnersCall) Do(opts ...googleapi.CallOption) (*IpOwnerList, error) {
  87530. gensupport.SetOptions(c.urlParams_, opts...)
  87531. res, err := c.doRequest("json")
  87532. if res != nil && res.StatusCode == http.StatusNotModified {
  87533. if res.Body != nil {
  87534. res.Body.Close()
  87535. }
  87536. return nil, &googleapi.Error{
  87537. Code: res.StatusCode,
  87538. Header: res.Header,
  87539. }
  87540. }
  87541. if err != nil {
  87542. return nil, err
  87543. }
  87544. defer googleapi.CloseBody(res)
  87545. if err := googleapi.CheckResponse(res); err != nil {
  87546. return nil, err
  87547. }
  87548. ret := &IpOwnerList{
  87549. ServerResponse: googleapi.ServerResponse{
  87550. Header: res.Header,
  87551. HTTPStatusCode: res.StatusCode,
  87552. },
  87553. }
  87554. target := &ret
  87555. if err := gensupport.DecodeResponse(target, res); err != nil {
  87556. return nil, err
  87557. }
  87558. return ret, nil
  87559. // {
  87560. // "description": "Lists the internal IP owners in the specified network.",
  87561. // "httpMethod": "GET",
  87562. // "id": "compute.networks.listIpOwners",
  87563. // "parameterOrder": [
  87564. // "project",
  87565. // "network"
  87566. // ],
  87567. // "parameters": {
  87568. // "filter": {
  87569. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87570. // "location": "query",
  87571. // "type": "string"
  87572. // },
  87573. // "ipCidrRange": {
  87574. // "description": "(Optional) IP CIDR range filter, example: \"10.128.10.0/30\".",
  87575. // "location": "query",
  87576. // "type": "string"
  87577. // },
  87578. // "maxResults": {
  87579. // "default": "500",
  87580. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87581. // "format": "uint32",
  87582. // "location": "query",
  87583. // "minimum": "0",
  87584. // "type": "integer"
  87585. // },
  87586. // "network": {
  87587. // "description": "Name of the network to return.",
  87588. // "location": "path",
  87589. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87590. // "required": true,
  87591. // "type": "string"
  87592. // },
  87593. // "orderBy": {
  87594. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87595. // "location": "query",
  87596. // "type": "string"
  87597. // },
  87598. // "ownerProjects": {
  87599. // "description": "(Optional) Project IDs filter, example: \"project-1,project-2\".",
  87600. // "location": "query",
  87601. // "type": "string"
  87602. // },
  87603. // "ownerTypes": {
  87604. // "description": "(Optional) Owner types filter, example: \"instance,forwardingRule\".",
  87605. // "location": "query",
  87606. // "type": "string"
  87607. // },
  87608. // "pageToken": {
  87609. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87610. // "location": "query",
  87611. // "type": "string"
  87612. // },
  87613. // "project": {
  87614. // "description": "Project ID for this request.",
  87615. // "location": "path",
  87616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87617. // "required": true,
  87618. // "type": "string"
  87619. // },
  87620. // "subnetName": {
  87621. // "description": "(Optional) Subnetwork name filter.",
  87622. // "location": "query",
  87623. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87624. // "type": "string"
  87625. // },
  87626. // "subnetRegion": {
  87627. // "description": "(Optional) Subnetwork region filter.",
  87628. // "location": "query",
  87629. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87630. // "type": "string"
  87631. // }
  87632. // },
  87633. // "path": "{project}/global/networks/{network}/listIpOwners",
  87634. // "response": {
  87635. // "$ref": "IpOwnerList"
  87636. // },
  87637. // "scopes": [
  87638. // "https://www.googleapis.com/auth/cloud-platform",
  87639. // "https://www.googleapis.com/auth/compute",
  87640. // "https://www.googleapis.com/auth/compute.readonly"
  87641. // ]
  87642. // }
  87643. }
  87644. // Pages invokes f for each page of results.
  87645. // A non-nil error returned from f will halt the iteration.
  87646. // The provided context supersedes any context provided to the Context method.
  87647. func (c *NetworksListIpOwnersCall) Pages(ctx context.Context, f func(*IpOwnerList) error) error {
  87648. c.ctx_ = ctx
  87649. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87650. for {
  87651. x, err := c.Do()
  87652. if err != nil {
  87653. return err
  87654. }
  87655. if err := f(x); err != nil {
  87656. return err
  87657. }
  87658. if x.NextPageToken == "" {
  87659. return nil
  87660. }
  87661. c.PageToken(x.NextPageToken)
  87662. }
  87663. }
  87664. // method id "compute.networks.listPeeringRoutes":
  87665. type NetworksListPeeringRoutesCall struct {
  87666. s *Service
  87667. project string
  87668. network string
  87669. urlParams_ gensupport.URLParams
  87670. ifNoneMatch_ string
  87671. ctx_ context.Context
  87672. header_ http.Header
  87673. }
  87674. // ListPeeringRoutes: Lists the peering routes exchanged over peering
  87675. // connection.
  87676. func (r *NetworksService) ListPeeringRoutes(project string, network string) *NetworksListPeeringRoutesCall {
  87677. c := &NetworksListPeeringRoutesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87678. c.project = project
  87679. c.network = network
  87680. return c
  87681. }
  87682. // Direction sets the optional parameter "direction": The direction of
  87683. // the exchanged routes.
  87684. //
  87685. // Possible values:
  87686. // "INCOMING"
  87687. // "OUTGOING"
  87688. func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksListPeeringRoutesCall {
  87689. c.urlParams_.Set("direction", direction)
  87690. return c
  87691. }
  87692. // Filter sets the optional parameter "filter": A filter expression that
  87693. // filters resources listed in the response. The expression must specify
  87694. // the field name, a comparison operator, and the value that you want to
  87695. // use for filtering. The value must be a string, a number, or a
  87696. // boolean. The comparison operator must be either =, !=, >, or <.
  87697. //
  87698. // For example, if you are filtering Compute Engine instances, you can
  87699. // exclude instances named example-instance by specifying name !=
  87700. // example-instance.
  87701. //
  87702. // You can also filter nested fields. For example, you could specify
  87703. // scheduling.automaticRestart = false to include instances only if they
  87704. // are not scheduled for automatic restarts. You can use filtering on
  87705. // nested fields to filter based on resource labels.
  87706. //
  87707. // To filter on multiple expressions, provide each separate expression
  87708. // within parentheses. For example, (scheduling.automaticRestart = true)
  87709. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87710. // AND expression. However, you can include AND and OR expressions
  87711. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87712. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87713. // true).
  87714. func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeringRoutesCall {
  87715. c.urlParams_.Set("filter", filter)
  87716. return c
  87717. }
  87718. // MaxResults sets the optional parameter "maxResults": The maximum
  87719. // number of results per page that should be returned. If the number of
  87720. // available results is larger than maxResults, Compute Engine returns a
  87721. // nextPageToken that can be used to get the next page of results in
  87722. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87723. // (Default: 500)
  87724. func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksListPeeringRoutesCall {
  87725. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87726. return c
  87727. }
  87728. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87729. // a certain order. By default, results are returned in alphanumerical
  87730. // order based on the resource name.
  87731. //
  87732. // You can also sort results in descending order based on the creation
  87733. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87734. // based on the creationTimestamp field in reverse chronological order
  87735. // (newest result first). Use this to sort resources like operations so
  87736. // that the newest operation is returned first.
  87737. //
  87738. // Currently, only sorting by name or creationTimestamp desc is
  87739. // supported.
  87740. func (c *NetworksListPeeringRoutesCall) OrderBy(orderBy string) *NetworksListPeeringRoutesCall {
  87741. c.urlParams_.Set("orderBy", orderBy)
  87742. return c
  87743. }
  87744. // PageToken sets the optional parameter "pageToken": Specifies a page
  87745. // token to use. Set pageToken to the nextPageToken returned by a
  87746. // previous list request to get the next page of results.
  87747. func (c *NetworksListPeeringRoutesCall) PageToken(pageToken string) *NetworksListPeeringRoutesCall {
  87748. c.urlParams_.Set("pageToken", pageToken)
  87749. return c
  87750. }
  87751. // PeeringName sets the optional parameter "peeringName": The response
  87752. // will show routes exchanged over the given peering connection.
  87753. func (c *NetworksListPeeringRoutesCall) PeeringName(peeringName string) *NetworksListPeeringRoutesCall {
  87754. c.urlParams_.Set("peeringName", peeringName)
  87755. return c
  87756. }
  87757. // Region sets the optional parameter "region": The region of the
  87758. // request. The response will include all subnet routes, static routes
  87759. // and dynamic routes in the region.
  87760. func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeringRoutesCall {
  87761. c.urlParams_.Set("region", region)
  87762. return c
  87763. }
  87764. // Fields allows partial responses to be retrieved. See
  87765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87766. // for more information.
  87767. func (c *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksListPeeringRoutesCall {
  87768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87769. return c
  87770. }
  87771. // IfNoneMatch sets the optional parameter which makes the operation
  87772. // fail if the object's ETag matches the given value. This is useful for
  87773. // getting updates only after the object has changed since the last
  87774. // request. Use googleapi.IsNotModified to check whether the response
  87775. // error from Do is the result of In-None-Match.
  87776. func (c *NetworksListPeeringRoutesCall) IfNoneMatch(entityTag string) *NetworksListPeeringRoutesCall {
  87777. c.ifNoneMatch_ = entityTag
  87778. return c
  87779. }
  87780. // Context sets the context to be used in this call's Do method. Any
  87781. // pending HTTP request will be aborted if the provided context is
  87782. // canceled.
  87783. func (c *NetworksListPeeringRoutesCall) Context(ctx context.Context) *NetworksListPeeringRoutesCall {
  87784. c.ctx_ = ctx
  87785. return c
  87786. }
  87787. // Header returns an http.Header that can be modified by the caller to
  87788. // add HTTP headers to the request.
  87789. func (c *NetworksListPeeringRoutesCall) Header() http.Header {
  87790. if c.header_ == nil {
  87791. c.header_ = make(http.Header)
  87792. }
  87793. return c.header_
  87794. }
  87795. func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, error) {
  87796. reqHeaders := make(http.Header)
  87797. for k, v := range c.header_ {
  87798. reqHeaders[k] = v
  87799. }
  87800. reqHeaders.Set("User-Agent", c.s.userAgent())
  87801. if c.ifNoneMatch_ != "" {
  87802. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87803. }
  87804. var body io.Reader = nil
  87805. c.urlParams_.Set("alt", alt)
  87806. c.urlParams_.Set("prettyPrint", "false")
  87807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/listPeeringRoutes")
  87808. urls += "?" + c.urlParams_.Encode()
  87809. req, err := http.NewRequest("GET", urls, body)
  87810. if err != nil {
  87811. return nil, err
  87812. }
  87813. req.Header = reqHeaders
  87814. googleapi.Expand(req.URL, map[string]string{
  87815. "project": c.project,
  87816. "network": c.network,
  87817. })
  87818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87819. }
  87820. // Do executes the "compute.networks.listPeeringRoutes" call.
  87821. // Exactly one of *ExchangedPeeringRoutesList or error will be non-nil.
  87822. // Any non-2xx status code is an error. Response headers are in either
  87823. // *ExchangedPeeringRoutesList.ServerResponse.Header or (if a response
  87824. // was returned at all) in error.(*googleapi.Error).Header. Use
  87825. // googleapi.IsNotModified to check whether the returned error was
  87826. // because http.StatusNotModified was returned.
  87827. func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*ExchangedPeeringRoutesList, error) {
  87828. gensupport.SetOptions(c.urlParams_, opts...)
  87829. res, err := c.doRequest("json")
  87830. if res != nil && res.StatusCode == http.StatusNotModified {
  87831. if res.Body != nil {
  87832. res.Body.Close()
  87833. }
  87834. return nil, &googleapi.Error{
  87835. Code: res.StatusCode,
  87836. Header: res.Header,
  87837. }
  87838. }
  87839. if err != nil {
  87840. return nil, err
  87841. }
  87842. defer googleapi.CloseBody(res)
  87843. if err := googleapi.CheckResponse(res); err != nil {
  87844. return nil, err
  87845. }
  87846. ret := &ExchangedPeeringRoutesList{
  87847. ServerResponse: googleapi.ServerResponse{
  87848. Header: res.Header,
  87849. HTTPStatusCode: res.StatusCode,
  87850. },
  87851. }
  87852. target := &ret
  87853. if err := gensupport.DecodeResponse(target, res); err != nil {
  87854. return nil, err
  87855. }
  87856. return ret, nil
  87857. // {
  87858. // "description": "Lists the peering routes exchanged over peering connection.",
  87859. // "httpMethod": "GET",
  87860. // "id": "compute.networks.listPeeringRoutes",
  87861. // "parameterOrder": [
  87862. // "project",
  87863. // "network"
  87864. // ],
  87865. // "parameters": {
  87866. // "direction": {
  87867. // "description": "The direction of the exchanged routes.",
  87868. // "enum": [
  87869. // "INCOMING",
  87870. // "OUTGOING"
  87871. // ],
  87872. // "enumDescriptions": [
  87873. // "",
  87874. // ""
  87875. // ],
  87876. // "location": "query",
  87877. // "type": "string"
  87878. // },
  87879. // "filter": {
  87880. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87881. // "location": "query",
  87882. // "type": "string"
  87883. // },
  87884. // "maxResults": {
  87885. // "default": "500",
  87886. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87887. // "format": "uint32",
  87888. // "location": "query",
  87889. // "minimum": "0",
  87890. // "type": "integer"
  87891. // },
  87892. // "network": {
  87893. // "description": "Name of the network for this request.",
  87894. // "location": "path",
  87895. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87896. // "required": true,
  87897. // "type": "string"
  87898. // },
  87899. // "orderBy": {
  87900. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87901. // "location": "query",
  87902. // "type": "string"
  87903. // },
  87904. // "pageToken": {
  87905. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87906. // "location": "query",
  87907. // "type": "string"
  87908. // },
  87909. // "peeringName": {
  87910. // "description": "The response will show routes exchanged over the given peering connection.",
  87911. // "location": "query",
  87912. // "type": "string"
  87913. // },
  87914. // "project": {
  87915. // "description": "Project ID for this request.",
  87916. // "location": "path",
  87917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87918. // "required": true,
  87919. // "type": "string"
  87920. // },
  87921. // "region": {
  87922. // "description": "The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region.",
  87923. // "location": "query",
  87924. // "type": "string"
  87925. // }
  87926. // },
  87927. // "path": "{project}/global/networks/{network}/listPeeringRoutes",
  87928. // "response": {
  87929. // "$ref": "ExchangedPeeringRoutesList"
  87930. // },
  87931. // "scopes": [
  87932. // "https://www.googleapis.com/auth/cloud-platform",
  87933. // "https://www.googleapis.com/auth/compute",
  87934. // "https://www.googleapis.com/auth/compute.readonly"
  87935. // ]
  87936. // }
  87937. }
  87938. // Pages invokes f for each page of results.
  87939. // A non-nil error returned from f will halt the iteration.
  87940. // The provided context supersedes any context provided to the Context method.
  87941. func (c *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*ExchangedPeeringRoutesList) error) error {
  87942. c.ctx_ = ctx
  87943. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87944. for {
  87945. x, err := c.Do()
  87946. if err != nil {
  87947. return err
  87948. }
  87949. if err := f(x); err != nil {
  87950. return err
  87951. }
  87952. if x.NextPageToken == "" {
  87953. return nil
  87954. }
  87955. c.PageToken(x.NextPageToken)
  87956. }
  87957. }
  87958. // method id "compute.networks.patch":
  87959. type NetworksPatchCall struct {
  87960. s *Service
  87961. project string
  87962. network string
  87963. network2 *Network
  87964. urlParams_ gensupport.URLParams
  87965. ctx_ context.Context
  87966. header_ http.Header
  87967. }
  87968. // Patch: Patches the specified network with the data included in the
  87969. // request. Only the following fields can be modified:
  87970. // routingConfig.routingMode.
  87971. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  87972. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87973. c.project = project
  87974. c.network = network
  87975. c.network2 = network2
  87976. return c
  87977. }
  87978. // RequestId sets the optional parameter "requestId": An optional
  87979. // request ID to identify requests. Specify a unique request ID so that
  87980. // if you must retry your request, the server will know to ignore the
  87981. // request if it has already been completed.
  87982. //
  87983. // For example, consider a situation where you make an initial request
  87984. // and the request times out. If you make the request again with the
  87985. // same request ID, the server can check if original operation with the
  87986. // same request ID was received, and if so, will ignore the second
  87987. // request. This prevents clients from accidentally creating duplicate
  87988. // commitments.
  87989. //
  87990. // The request ID must be a valid UUID with the exception that zero UUID
  87991. // is not supported (00000000-0000-0000-0000-000000000000).
  87992. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  87993. c.urlParams_.Set("requestId", requestId)
  87994. return c
  87995. }
  87996. // Fields allows partial responses to be retrieved. See
  87997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87998. // for more information.
  87999. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  88000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88001. return c
  88002. }
  88003. // Context sets the context to be used in this call's Do method. Any
  88004. // pending HTTP request will be aborted if the provided context is
  88005. // canceled.
  88006. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  88007. c.ctx_ = ctx
  88008. return c
  88009. }
  88010. // Header returns an http.Header that can be modified by the caller to
  88011. // add HTTP headers to the request.
  88012. func (c *NetworksPatchCall) Header() http.Header {
  88013. if c.header_ == nil {
  88014. c.header_ = make(http.Header)
  88015. }
  88016. return c.header_
  88017. }
  88018. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  88019. reqHeaders := make(http.Header)
  88020. for k, v := range c.header_ {
  88021. reqHeaders[k] = v
  88022. }
  88023. reqHeaders.Set("User-Agent", c.s.userAgent())
  88024. var body io.Reader = nil
  88025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  88026. if err != nil {
  88027. return nil, err
  88028. }
  88029. reqHeaders.Set("Content-Type", "application/json")
  88030. c.urlParams_.Set("alt", alt)
  88031. c.urlParams_.Set("prettyPrint", "false")
  88032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  88033. urls += "?" + c.urlParams_.Encode()
  88034. req, err := http.NewRequest("PATCH", urls, body)
  88035. if err != nil {
  88036. return nil, err
  88037. }
  88038. req.Header = reqHeaders
  88039. googleapi.Expand(req.URL, map[string]string{
  88040. "project": c.project,
  88041. "network": c.network,
  88042. })
  88043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88044. }
  88045. // Do executes the "compute.networks.patch" call.
  88046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88047. // status code is an error. Response headers are in either
  88048. // *Operation.ServerResponse.Header or (if a response was returned at
  88049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88050. // to check whether the returned error was because
  88051. // http.StatusNotModified was returned.
  88052. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88053. gensupport.SetOptions(c.urlParams_, opts...)
  88054. res, err := c.doRequest("json")
  88055. if res != nil && res.StatusCode == http.StatusNotModified {
  88056. if res.Body != nil {
  88057. res.Body.Close()
  88058. }
  88059. return nil, &googleapi.Error{
  88060. Code: res.StatusCode,
  88061. Header: res.Header,
  88062. }
  88063. }
  88064. if err != nil {
  88065. return nil, err
  88066. }
  88067. defer googleapi.CloseBody(res)
  88068. if err := googleapi.CheckResponse(res); err != nil {
  88069. return nil, err
  88070. }
  88071. ret := &Operation{
  88072. ServerResponse: googleapi.ServerResponse{
  88073. Header: res.Header,
  88074. HTTPStatusCode: res.StatusCode,
  88075. },
  88076. }
  88077. target := &ret
  88078. if err := gensupport.DecodeResponse(target, res); err != nil {
  88079. return nil, err
  88080. }
  88081. return ret, nil
  88082. // {
  88083. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  88084. // "httpMethod": "PATCH",
  88085. // "id": "compute.networks.patch",
  88086. // "parameterOrder": [
  88087. // "project",
  88088. // "network"
  88089. // ],
  88090. // "parameters": {
  88091. // "network": {
  88092. // "description": "Name of the network to update.",
  88093. // "location": "path",
  88094. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88095. // "required": true,
  88096. // "type": "string"
  88097. // },
  88098. // "project": {
  88099. // "description": "Project ID for this request.",
  88100. // "location": "path",
  88101. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88102. // "required": true,
  88103. // "type": "string"
  88104. // },
  88105. // "requestId": {
  88106. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88107. // "location": "query",
  88108. // "type": "string"
  88109. // }
  88110. // },
  88111. // "path": "{project}/global/networks/{network}",
  88112. // "request": {
  88113. // "$ref": "Network"
  88114. // },
  88115. // "response": {
  88116. // "$ref": "Operation"
  88117. // },
  88118. // "scopes": [
  88119. // "https://www.googleapis.com/auth/cloud-platform",
  88120. // "https://www.googleapis.com/auth/compute"
  88121. // ]
  88122. // }
  88123. }
  88124. // method id "compute.networks.removePeering":
  88125. type NetworksRemovePeeringCall struct {
  88126. s *Service
  88127. project string
  88128. network string
  88129. networksremovepeeringrequest *NetworksRemovePeeringRequest
  88130. urlParams_ gensupport.URLParams
  88131. ctx_ context.Context
  88132. header_ http.Header
  88133. }
  88134. // RemovePeering: Removes a peering from the specified network.
  88135. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  88136. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88137. c.project = project
  88138. c.network = network
  88139. c.networksremovepeeringrequest = networksremovepeeringrequest
  88140. return c
  88141. }
  88142. // RequestId sets the optional parameter "requestId": An optional
  88143. // request ID to identify requests. Specify a unique request ID so that
  88144. // if you must retry your request, the server will know to ignore the
  88145. // request if it has already been completed.
  88146. //
  88147. // For example, consider a situation where you make an initial request
  88148. // and the request times out. If you make the request again with the
  88149. // same request ID, the server can check if original operation with the
  88150. // same request ID was received, and if so, will ignore the second
  88151. // request. This prevents clients from accidentally creating duplicate
  88152. // commitments.
  88153. //
  88154. // The request ID must be a valid UUID with the exception that zero UUID
  88155. // is not supported (00000000-0000-0000-0000-000000000000).
  88156. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  88157. c.urlParams_.Set("requestId", requestId)
  88158. return c
  88159. }
  88160. // Fields allows partial responses to be retrieved. See
  88161. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88162. // for more information.
  88163. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  88164. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88165. return c
  88166. }
  88167. // Context sets the context to be used in this call's Do method. Any
  88168. // pending HTTP request will be aborted if the provided context is
  88169. // canceled.
  88170. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  88171. c.ctx_ = ctx
  88172. return c
  88173. }
  88174. // Header returns an http.Header that can be modified by the caller to
  88175. // add HTTP headers to the request.
  88176. func (c *NetworksRemovePeeringCall) Header() http.Header {
  88177. if c.header_ == nil {
  88178. c.header_ = make(http.Header)
  88179. }
  88180. return c.header_
  88181. }
  88182. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  88183. reqHeaders := make(http.Header)
  88184. for k, v := range c.header_ {
  88185. reqHeaders[k] = v
  88186. }
  88187. reqHeaders.Set("User-Agent", c.s.userAgent())
  88188. var body io.Reader = nil
  88189. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  88190. if err != nil {
  88191. return nil, err
  88192. }
  88193. reqHeaders.Set("Content-Type", "application/json")
  88194. c.urlParams_.Set("alt", alt)
  88195. c.urlParams_.Set("prettyPrint", "false")
  88196. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  88197. urls += "?" + c.urlParams_.Encode()
  88198. req, err := http.NewRequest("POST", urls, body)
  88199. if err != nil {
  88200. return nil, err
  88201. }
  88202. req.Header = reqHeaders
  88203. googleapi.Expand(req.URL, map[string]string{
  88204. "project": c.project,
  88205. "network": c.network,
  88206. })
  88207. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88208. }
  88209. // Do executes the "compute.networks.removePeering" call.
  88210. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88211. // status code is an error. Response headers are in either
  88212. // *Operation.ServerResponse.Header or (if a response was returned at
  88213. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88214. // to check whether the returned error was because
  88215. // http.StatusNotModified was returned.
  88216. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88217. gensupport.SetOptions(c.urlParams_, opts...)
  88218. res, err := c.doRequest("json")
  88219. if res != nil && res.StatusCode == http.StatusNotModified {
  88220. if res.Body != nil {
  88221. res.Body.Close()
  88222. }
  88223. return nil, &googleapi.Error{
  88224. Code: res.StatusCode,
  88225. Header: res.Header,
  88226. }
  88227. }
  88228. if err != nil {
  88229. return nil, err
  88230. }
  88231. defer googleapi.CloseBody(res)
  88232. if err := googleapi.CheckResponse(res); err != nil {
  88233. return nil, err
  88234. }
  88235. ret := &Operation{
  88236. ServerResponse: googleapi.ServerResponse{
  88237. Header: res.Header,
  88238. HTTPStatusCode: res.StatusCode,
  88239. },
  88240. }
  88241. target := &ret
  88242. if err := gensupport.DecodeResponse(target, res); err != nil {
  88243. return nil, err
  88244. }
  88245. return ret, nil
  88246. // {
  88247. // "description": "Removes a peering from the specified network.",
  88248. // "httpMethod": "POST",
  88249. // "id": "compute.networks.removePeering",
  88250. // "parameterOrder": [
  88251. // "project",
  88252. // "network"
  88253. // ],
  88254. // "parameters": {
  88255. // "network": {
  88256. // "description": "Name of the network resource to remove peering from.",
  88257. // "location": "path",
  88258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88259. // "required": true,
  88260. // "type": "string"
  88261. // },
  88262. // "project": {
  88263. // "description": "Project ID for this request.",
  88264. // "location": "path",
  88265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88266. // "required": true,
  88267. // "type": "string"
  88268. // },
  88269. // "requestId": {
  88270. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88271. // "location": "query",
  88272. // "type": "string"
  88273. // }
  88274. // },
  88275. // "path": "{project}/global/networks/{network}/removePeering",
  88276. // "request": {
  88277. // "$ref": "NetworksRemovePeeringRequest"
  88278. // },
  88279. // "response": {
  88280. // "$ref": "Operation"
  88281. // },
  88282. // "scopes": [
  88283. // "https://www.googleapis.com/auth/cloud-platform",
  88284. // "https://www.googleapis.com/auth/compute"
  88285. // ]
  88286. // }
  88287. }
  88288. // method id "compute.networks.switchToCustomMode":
  88289. type NetworksSwitchToCustomModeCall struct {
  88290. s *Service
  88291. project string
  88292. network string
  88293. urlParams_ gensupport.URLParams
  88294. ctx_ context.Context
  88295. header_ http.Header
  88296. }
  88297. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  88298. // to custom subnet mode.
  88299. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  88300. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88301. c.project = project
  88302. c.network = network
  88303. return c
  88304. }
  88305. // RequestId sets the optional parameter "requestId": An optional
  88306. // request ID to identify requests. Specify a unique request ID so that
  88307. // if you must retry your request, the server will know to ignore the
  88308. // request if it has already been completed.
  88309. //
  88310. // For example, consider a situation where you make an initial request
  88311. // and the request times out. If you make the request again with the
  88312. // same request ID, the server can check if original operation with the
  88313. // same request ID was received, and if so, will ignore the second
  88314. // request. This prevents clients from accidentally creating duplicate
  88315. // commitments.
  88316. //
  88317. // The request ID must be a valid UUID with the exception that zero UUID
  88318. // is not supported (00000000-0000-0000-0000-000000000000).
  88319. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  88320. c.urlParams_.Set("requestId", requestId)
  88321. return c
  88322. }
  88323. // Fields allows partial responses to be retrieved. See
  88324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88325. // for more information.
  88326. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  88327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88328. return c
  88329. }
  88330. // Context sets the context to be used in this call's Do method. Any
  88331. // pending HTTP request will be aborted if the provided context is
  88332. // canceled.
  88333. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  88334. c.ctx_ = ctx
  88335. return c
  88336. }
  88337. // Header returns an http.Header that can be modified by the caller to
  88338. // add HTTP headers to the request.
  88339. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  88340. if c.header_ == nil {
  88341. c.header_ = make(http.Header)
  88342. }
  88343. return c.header_
  88344. }
  88345. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  88346. reqHeaders := make(http.Header)
  88347. for k, v := range c.header_ {
  88348. reqHeaders[k] = v
  88349. }
  88350. reqHeaders.Set("User-Agent", c.s.userAgent())
  88351. var body io.Reader = nil
  88352. c.urlParams_.Set("alt", alt)
  88353. c.urlParams_.Set("prettyPrint", "false")
  88354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  88355. urls += "?" + c.urlParams_.Encode()
  88356. req, err := http.NewRequest("POST", urls, body)
  88357. if err != nil {
  88358. return nil, err
  88359. }
  88360. req.Header = reqHeaders
  88361. googleapi.Expand(req.URL, map[string]string{
  88362. "project": c.project,
  88363. "network": c.network,
  88364. })
  88365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88366. }
  88367. // Do executes the "compute.networks.switchToCustomMode" call.
  88368. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88369. // status code is an error. Response headers are in either
  88370. // *Operation.ServerResponse.Header or (if a response was returned at
  88371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88372. // to check whether the returned error was because
  88373. // http.StatusNotModified was returned.
  88374. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88375. gensupport.SetOptions(c.urlParams_, opts...)
  88376. res, err := c.doRequest("json")
  88377. if res != nil && res.StatusCode == http.StatusNotModified {
  88378. if res.Body != nil {
  88379. res.Body.Close()
  88380. }
  88381. return nil, &googleapi.Error{
  88382. Code: res.StatusCode,
  88383. Header: res.Header,
  88384. }
  88385. }
  88386. if err != nil {
  88387. return nil, err
  88388. }
  88389. defer googleapi.CloseBody(res)
  88390. if err := googleapi.CheckResponse(res); err != nil {
  88391. return nil, err
  88392. }
  88393. ret := &Operation{
  88394. ServerResponse: googleapi.ServerResponse{
  88395. Header: res.Header,
  88396. HTTPStatusCode: res.StatusCode,
  88397. },
  88398. }
  88399. target := &ret
  88400. if err := gensupport.DecodeResponse(target, res); err != nil {
  88401. return nil, err
  88402. }
  88403. return ret, nil
  88404. // {
  88405. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  88406. // "httpMethod": "POST",
  88407. // "id": "compute.networks.switchToCustomMode",
  88408. // "parameterOrder": [
  88409. // "project",
  88410. // "network"
  88411. // ],
  88412. // "parameters": {
  88413. // "network": {
  88414. // "description": "Name of the network to be updated.",
  88415. // "location": "path",
  88416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88417. // "required": true,
  88418. // "type": "string"
  88419. // },
  88420. // "project": {
  88421. // "description": "Project ID for this request.",
  88422. // "location": "path",
  88423. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88424. // "required": true,
  88425. // "type": "string"
  88426. // },
  88427. // "requestId": {
  88428. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88429. // "location": "query",
  88430. // "type": "string"
  88431. // }
  88432. // },
  88433. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  88434. // "response": {
  88435. // "$ref": "Operation"
  88436. // },
  88437. // "scopes": [
  88438. // "https://www.googleapis.com/auth/cloud-platform",
  88439. // "https://www.googleapis.com/auth/compute"
  88440. // ]
  88441. // }
  88442. }
  88443. // method id "compute.networks.testIamPermissions":
  88444. type NetworksTestIamPermissionsCall struct {
  88445. s *Service
  88446. project string
  88447. resource string
  88448. testpermissionsrequest *TestPermissionsRequest
  88449. urlParams_ gensupport.URLParams
  88450. ctx_ context.Context
  88451. header_ http.Header
  88452. }
  88453. // TestIamPermissions: Returns permissions that a caller has on the
  88454. // specified resource.
  88455. func (r *NetworksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworksTestIamPermissionsCall {
  88456. c := &NetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88457. c.project = project
  88458. c.resource = resource
  88459. c.testpermissionsrequest = testpermissionsrequest
  88460. return c
  88461. }
  88462. // Fields allows partial responses to be retrieved. See
  88463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88464. // for more information.
  88465. func (c *NetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworksTestIamPermissionsCall {
  88466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88467. return c
  88468. }
  88469. // Context sets the context to be used in this call's Do method. Any
  88470. // pending HTTP request will be aborted if the provided context is
  88471. // canceled.
  88472. func (c *NetworksTestIamPermissionsCall) Context(ctx context.Context) *NetworksTestIamPermissionsCall {
  88473. c.ctx_ = ctx
  88474. return c
  88475. }
  88476. // Header returns an http.Header that can be modified by the caller to
  88477. // add HTTP headers to the request.
  88478. func (c *NetworksTestIamPermissionsCall) Header() http.Header {
  88479. if c.header_ == nil {
  88480. c.header_ = make(http.Header)
  88481. }
  88482. return c.header_
  88483. }
  88484. func (c *NetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  88485. reqHeaders := make(http.Header)
  88486. for k, v := range c.header_ {
  88487. reqHeaders[k] = v
  88488. }
  88489. reqHeaders.Set("User-Agent", c.s.userAgent())
  88490. var body io.Reader = nil
  88491. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  88492. if err != nil {
  88493. return nil, err
  88494. }
  88495. reqHeaders.Set("Content-Type", "application/json")
  88496. c.urlParams_.Set("alt", alt)
  88497. c.urlParams_.Set("prettyPrint", "false")
  88498. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{resource}/testIamPermissions")
  88499. urls += "?" + c.urlParams_.Encode()
  88500. req, err := http.NewRequest("POST", urls, body)
  88501. if err != nil {
  88502. return nil, err
  88503. }
  88504. req.Header = reqHeaders
  88505. googleapi.Expand(req.URL, map[string]string{
  88506. "project": c.project,
  88507. "resource": c.resource,
  88508. })
  88509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88510. }
  88511. // Do executes the "compute.networks.testIamPermissions" call.
  88512. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  88513. // non-2xx status code is an error. Response headers are in either
  88514. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  88515. // returned at all) in error.(*googleapi.Error).Header. Use
  88516. // googleapi.IsNotModified to check whether the returned error was
  88517. // because http.StatusNotModified was returned.
  88518. func (c *NetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  88519. gensupport.SetOptions(c.urlParams_, opts...)
  88520. res, err := c.doRequest("json")
  88521. if res != nil && res.StatusCode == http.StatusNotModified {
  88522. if res.Body != nil {
  88523. res.Body.Close()
  88524. }
  88525. return nil, &googleapi.Error{
  88526. Code: res.StatusCode,
  88527. Header: res.Header,
  88528. }
  88529. }
  88530. if err != nil {
  88531. return nil, err
  88532. }
  88533. defer googleapi.CloseBody(res)
  88534. if err := googleapi.CheckResponse(res); err != nil {
  88535. return nil, err
  88536. }
  88537. ret := &TestPermissionsResponse{
  88538. ServerResponse: googleapi.ServerResponse{
  88539. Header: res.Header,
  88540. HTTPStatusCode: res.StatusCode,
  88541. },
  88542. }
  88543. target := &ret
  88544. if err := gensupport.DecodeResponse(target, res); err != nil {
  88545. return nil, err
  88546. }
  88547. return ret, nil
  88548. // {
  88549. // "description": "Returns permissions that a caller has on the specified resource.",
  88550. // "httpMethod": "POST",
  88551. // "id": "compute.networks.testIamPermissions",
  88552. // "parameterOrder": [
  88553. // "project",
  88554. // "resource"
  88555. // ],
  88556. // "parameters": {
  88557. // "project": {
  88558. // "description": "Project ID for this request.",
  88559. // "location": "path",
  88560. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88561. // "required": true,
  88562. // "type": "string"
  88563. // },
  88564. // "resource": {
  88565. // "description": "Name or id of the resource for this request.",
  88566. // "location": "path",
  88567. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88568. // "required": true,
  88569. // "type": "string"
  88570. // }
  88571. // },
  88572. // "path": "{project}/global/networks/{resource}/testIamPermissions",
  88573. // "request": {
  88574. // "$ref": "TestPermissionsRequest"
  88575. // },
  88576. // "response": {
  88577. // "$ref": "TestPermissionsResponse"
  88578. // },
  88579. // "scopes": [
  88580. // "https://www.googleapis.com/auth/cloud-platform",
  88581. // "https://www.googleapis.com/auth/compute",
  88582. // "https://www.googleapis.com/auth/compute.readonly"
  88583. // ]
  88584. // }
  88585. }
  88586. // method id "compute.networks.updatePeering":
  88587. type NetworksUpdatePeeringCall struct {
  88588. s *Service
  88589. project string
  88590. network string
  88591. networksupdatepeeringrequest *NetworksUpdatePeeringRequest
  88592. urlParams_ gensupport.URLParams
  88593. ctx_ context.Context
  88594. header_ http.Header
  88595. }
  88596. // UpdatePeering: Updates the specified network peering with the data
  88597. // included in the request Only the following fields can be modified:
  88598. // NetworkPeering.export_custom_routes, and
  88599. // NetworkPeering.import_custom_routes
  88600. func (r *NetworksService) UpdatePeering(project string, network string, networksupdatepeeringrequest *NetworksUpdatePeeringRequest) *NetworksUpdatePeeringCall {
  88601. c := &NetworksUpdatePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88602. c.project = project
  88603. c.network = network
  88604. c.networksupdatepeeringrequest = networksupdatepeeringrequest
  88605. return c
  88606. }
  88607. // RequestId sets the optional parameter "requestId": An optional
  88608. // request ID to identify requests. Specify a unique request ID so that
  88609. // if you must retry your request, the server will know to ignore the
  88610. // request if it has already been completed.
  88611. //
  88612. // For example, consider a situation where you make an initial request
  88613. // and the request times out. If you make the request again with the
  88614. // same request ID, the server can check if original operation with the
  88615. // same request ID was received, and if so, will ignore the second
  88616. // request. This prevents clients from accidentally creating duplicate
  88617. // commitments.
  88618. //
  88619. // The request ID must be a valid UUID with the exception that zero UUID
  88620. // is not supported (00000000-0000-0000-0000-000000000000).
  88621. func (c *NetworksUpdatePeeringCall) RequestId(requestId string) *NetworksUpdatePeeringCall {
  88622. c.urlParams_.Set("requestId", requestId)
  88623. return c
  88624. }
  88625. // Fields allows partial responses to be retrieved. See
  88626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88627. // for more information.
  88628. func (c *NetworksUpdatePeeringCall) Fields(s ...googleapi.Field) *NetworksUpdatePeeringCall {
  88629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88630. return c
  88631. }
  88632. // Context sets the context to be used in this call's Do method. Any
  88633. // pending HTTP request will be aborted if the provided context is
  88634. // canceled.
  88635. func (c *NetworksUpdatePeeringCall) Context(ctx context.Context) *NetworksUpdatePeeringCall {
  88636. c.ctx_ = ctx
  88637. return c
  88638. }
  88639. // Header returns an http.Header that can be modified by the caller to
  88640. // add HTTP headers to the request.
  88641. func (c *NetworksUpdatePeeringCall) Header() http.Header {
  88642. if c.header_ == nil {
  88643. c.header_ = make(http.Header)
  88644. }
  88645. return c.header_
  88646. }
  88647. func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) {
  88648. reqHeaders := make(http.Header)
  88649. for k, v := range c.header_ {
  88650. reqHeaders[k] = v
  88651. }
  88652. reqHeaders.Set("User-Agent", c.s.userAgent())
  88653. var body io.Reader = nil
  88654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest)
  88655. if err != nil {
  88656. return nil, err
  88657. }
  88658. reqHeaders.Set("Content-Type", "application/json")
  88659. c.urlParams_.Set("alt", alt)
  88660. c.urlParams_.Set("prettyPrint", "false")
  88661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/updatePeering")
  88662. urls += "?" + c.urlParams_.Encode()
  88663. req, err := http.NewRequest("PATCH", urls, body)
  88664. if err != nil {
  88665. return nil, err
  88666. }
  88667. req.Header = reqHeaders
  88668. googleapi.Expand(req.URL, map[string]string{
  88669. "project": c.project,
  88670. "network": c.network,
  88671. })
  88672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88673. }
  88674. // Do executes the "compute.networks.updatePeering" call.
  88675. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88676. // status code is an error. Response headers are in either
  88677. // *Operation.ServerResponse.Header or (if a response was returned at
  88678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88679. // to check whether the returned error was because
  88680. // http.StatusNotModified was returned.
  88681. func (c *NetworksUpdatePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88682. gensupport.SetOptions(c.urlParams_, opts...)
  88683. res, err := c.doRequest("json")
  88684. if res != nil && res.StatusCode == http.StatusNotModified {
  88685. if res.Body != nil {
  88686. res.Body.Close()
  88687. }
  88688. return nil, &googleapi.Error{
  88689. Code: res.StatusCode,
  88690. Header: res.Header,
  88691. }
  88692. }
  88693. if err != nil {
  88694. return nil, err
  88695. }
  88696. defer googleapi.CloseBody(res)
  88697. if err := googleapi.CheckResponse(res); err != nil {
  88698. return nil, err
  88699. }
  88700. ret := &Operation{
  88701. ServerResponse: googleapi.ServerResponse{
  88702. Header: res.Header,
  88703. HTTPStatusCode: res.StatusCode,
  88704. },
  88705. }
  88706. target := &ret
  88707. if err := gensupport.DecodeResponse(target, res); err != nil {
  88708. return nil, err
  88709. }
  88710. return ret, nil
  88711. // {
  88712. // "description": "Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes",
  88713. // "httpMethod": "PATCH",
  88714. // "id": "compute.networks.updatePeering",
  88715. // "parameterOrder": [
  88716. // "project",
  88717. // "network"
  88718. // ],
  88719. // "parameters": {
  88720. // "network": {
  88721. // "description": "Name of the network resource which the updated peering is belonging to.",
  88722. // "location": "path",
  88723. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88724. // "required": true,
  88725. // "type": "string"
  88726. // },
  88727. // "project": {
  88728. // "description": "Project ID for this request.",
  88729. // "location": "path",
  88730. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88731. // "required": true,
  88732. // "type": "string"
  88733. // },
  88734. // "requestId": {
  88735. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88736. // "location": "query",
  88737. // "type": "string"
  88738. // }
  88739. // },
  88740. // "path": "{project}/global/networks/{network}/updatePeering",
  88741. // "request": {
  88742. // "$ref": "NetworksUpdatePeeringRequest"
  88743. // },
  88744. // "response": {
  88745. // "$ref": "Operation"
  88746. // },
  88747. // "scopes": [
  88748. // "https://www.googleapis.com/auth/cloud-platform",
  88749. // "https://www.googleapis.com/auth/compute"
  88750. // ]
  88751. // }
  88752. }
  88753. // method id "compute.nodeGroups.addNodes":
  88754. type NodeGroupsAddNodesCall struct {
  88755. s *Service
  88756. project string
  88757. zone string
  88758. nodeGroup string
  88759. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  88760. urlParams_ gensupport.URLParams
  88761. ctx_ context.Context
  88762. header_ http.Header
  88763. }
  88764. // AddNodes: Adds specified number of nodes to the node group.
  88765. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  88766. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88767. c.project = project
  88768. c.zone = zone
  88769. c.nodeGroup = nodeGroup
  88770. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  88771. return c
  88772. }
  88773. // RequestId sets the optional parameter "requestId": An optional
  88774. // request ID to identify requests. Specify a unique request ID so that
  88775. // if you must retry your request, the server will know to ignore the
  88776. // request if it has already been completed.
  88777. //
  88778. // For example, consider a situation where you make an initial request
  88779. // and the request times out. If you make the request again with the
  88780. // same request ID, the server can check if original operation with the
  88781. // same request ID was received, and if so, will ignore the second
  88782. // request. This prevents clients from accidentally creating duplicate
  88783. // commitments.
  88784. //
  88785. // The request ID must be a valid UUID with the exception that zero UUID
  88786. // is not supported (00000000-0000-0000-0000-000000000000).
  88787. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  88788. c.urlParams_.Set("requestId", requestId)
  88789. return c
  88790. }
  88791. // Fields allows partial responses to be retrieved. See
  88792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88793. // for more information.
  88794. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  88795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88796. return c
  88797. }
  88798. // Context sets the context to be used in this call's Do method. Any
  88799. // pending HTTP request will be aborted if the provided context is
  88800. // canceled.
  88801. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  88802. c.ctx_ = ctx
  88803. return c
  88804. }
  88805. // Header returns an http.Header that can be modified by the caller to
  88806. // add HTTP headers to the request.
  88807. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  88808. if c.header_ == nil {
  88809. c.header_ = make(http.Header)
  88810. }
  88811. return c.header_
  88812. }
  88813. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  88814. reqHeaders := make(http.Header)
  88815. for k, v := range c.header_ {
  88816. reqHeaders[k] = v
  88817. }
  88818. reqHeaders.Set("User-Agent", c.s.userAgent())
  88819. var body io.Reader = nil
  88820. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  88821. if err != nil {
  88822. return nil, err
  88823. }
  88824. reqHeaders.Set("Content-Type", "application/json")
  88825. c.urlParams_.Set("alt", alt)
  88826. c.urlParams_.Set("prettyPrint", "false")
  88827. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  88828. urls += "?" + c.urlParams_.Encode()
  88829. req, err := http.NewRequest("POST", urls, body)
  88830. if err != nil {
  88831. return nil, err
  88832. }
  88833. req.Header = reqHeaders
  88834. googleapi.Expand(req.URL, map[string]string{
  88835. "project": c.project,
  88836. "zone": c.zone,
  88837. "nodeGroup": c.nodeGroup,
  88838. })
  88839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88840. }
  88841. // Do executes the "compute.nodeGroups.addNodes" call.
  88842. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88843. // status code is an error. Response headers are in either
  88844. // *Operation.ServerResponse.Header or (if a response was returned at
  88845. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88846. // to check whether the returned error was because
  88847. // http.StatusNotModified was returned.
  88848. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88849. gensupport.SetOptions(c.urlParams_, opts...)
  88850. res, err := c.doRequest("json")
  88851. if res != nil && res.StatusCode == http.StatusNotModified {
  88852. if res.Body != nil {
  88853. res.Body.Close()
  88854. }
  88855. return nil, &googleapi.Error{
  88856. Code: res.StatusCode,
  88857. Header: res.Header,
  88858. }
  88859. }
  88860. if err != nil {
  88861. return nil, err
  88862. }
  88863. defer googleapi.CloseBody(res)
  88864. if err := googleapi.CheckResponse(res); err != nil {
  88865. return nil, err
  88866. }
  88867. ret := &Operation{
  88868. ServerResponse: googleapi.ServerResponse{
  88869. Header: res.Header,
  88870. HTTPStatusCode: res.StatusCode,
  88871. },
  88872. }
  88873. target := &ret
  88874. if err := gensupport.DecodeResponse(target, res); err != nil {
  88875. return nil, err
  88876. }
  88877. return ret, nil
  88878. // {
  88879. // "description": "Adds specified number of nodes to the node group.",
  88880. // "httpMethod": "POST",
  88881. // "id": "compute.nodeGroups.addNodes",
  88882. // "parameterOrder": [
  88883. // "project",
  88884. // "zone",
  88885. // "nodeGroup"
  88886. // ],
  88887. // "parameters": {
  88888. // "nodeGroup": {
  88889. // "description": "Name of the NodeGroup resource.",
  88890. // "location": "path",
  88891. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88892. // "required": true,
  88893. // "type": "string"
  88894. // },
  88895. // "project": {
  88896. // "description": "Project ID for this request.",
  88897. // "location": "path",
  88898. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88899. // "required": true,
  88900. // "type": "string"
  88901. // },
  88902. // "requestId": {
  88903. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88904. // "location": "query",
  88905. // "type": "string"
  88906. // },
  88907. // "zone": {
  88908. // "description": "The name of the zone for this request.",
  88909. // "location": "path",
  88910. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88911. // "required": true,
  88912. // "type": "string"
  88913. // }
  88914. // },
  88915. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  88916. // "request": {
  88917. // "$ref": "NodeGroupsAddNodesRequest"
  88918. // },
  88919. // "response": {
  88920. // "$ref": "Operation"
  88921. // },
  88922. // "scopes": [
  88923. // "https://www.googleapis.com/auth/cloud-platform",
  88924. // "https://www.googleapis.com/auth/compute"
  88925. // ]
  88926. // }
  88927. }
  88928. // method id "compute.nodeGroups.aggregatedList":
  88929. type NodeGroupsAggregatedListCall struct {
  88930. s *Service
  88931. project string
  88932. urlParams_ gensupport.URLParams
  88933. ifNoneMatch_ string
  88934. ctx_ context.Context
  88935. header_ http.Header
  88936. }
  88937. // AggregatedList: Retrieves an aggregated list of node groups. Note:
  88938. // use nodeGroups.listNodes for more details about each group.
  88939. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  88940. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88941. c.project = project
  88942. return c
  88943. }
  88944. // Filter sets the optional parameter "filter": A filter expression that
  88945. // filters resources listed in the response. The expression must specify
  88946. // the field name, a comparison operator, and the value that you want to
  88947. // use for filtering. The value must be a string, a number, or a
  88948. // boolean. The comparison operator must be either =, !=, >, or <.
  88949. //
  88950. // For example, if you are filtering Compute Engine instances, you can
  88951. // exclude instances named example-instance by specifying name !=
  88952. // example-instance.
  88953. //
  88954. // You can also filter nested fields. For example, you could specify
  88955. // scheduling.automaticRestart = false to include instances only if they
  88956. // are not scheduled for automatic restarts. You can use filtering on
  88957. // nested fields to filter based on resource labels.
  88958. //
  88959. // To filter on multiple expressions, provide each separate expression
  88960. // within parentheses. For example, (scheduling.automaticRestart = true)
  88961. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88962. // AND expression. However, you can include AND and OR expressions
  88963. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88964. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88965. // true).
  88966. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  88967. c.urlParams_.Set("filter", filter)
  88968. return c
  88969. }
  88970. // MaxResults sets the optional parameter "maxResults": The maximum
  88971. // number of results per page that should be returned. If the number of
  88972. // available results is larger than maxResults, Compute Engine returns a
  88973. // nextPageToken that can be used to get the next page of results in
  88974. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88975. // (Default: 500)
  88976. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  88977. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88978. return c
  88979. }
  88980. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88981. // a certain order. By default, results are returned in alphanumerical
  88982. // order based on the resource name.
  88983. //
  88984. // You can also sort results in descending order based on the creation
  88985. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88986. // based on the creationTimestamp field in reverse chronological order
  88987. // (newest result first). Use this to sort resources like operations so
  88988. // that the newest operation is returned first.
  88989. //
  88990. // Currently, only sorting by name or creationTimestamp desc is
  88991. // supported.
  88992. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  88993. c.urlParams_.Set("orderBy", orderBy)
  88994. return c
  88995. }
  88996. // PageToken sets the optional parameter "pageToken": Specifies a page
  88997. // token to use. Set pageToken to the nextPageToken returned by a
  88998. // previous list request to get the next page of results.
  88999. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  89000. c.urlParams_.Set("pageToken", pageToken)
  89001. return c
  89002. }
  89003. // Fields allows partial responses to be retrieved. See
  89004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89005. // for more information.
  89006. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  89007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89008. return c
  89009. }
  89010. // IfNoneMatch sets the optional parameter which makes the operation
  89011. // fail if the object's ETag matches the given value. This is useful for
  89012. // getting updates only after the object has changed since the last
  89013. // request. Use googleapi.IsNotModified to check whether the response
  89014. // error from Do is the result of In-None-Match.
  89015. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  89016. c.ifNoneMatch_ = entityTag
  89017. return c
  89018. }
  89019. // Context sets the context to be used in this call's Do method. Any
  89020. // pending HTTP request will be aborted if the provided context is
  89021. // canceled.
  89022. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  89023. c.ctx_ = ctx
  89024. return c
  89025. }
  89026. // Header returns an http.Header that can be modified by the caller to
  89027. // add HTTP headers to the request.
  89028. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  89029. if c.header_ == nil {
  89030. c.header_ = make(http.Header)
  89031. }
  89032. return c.header_
  89033. }
  89034. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  89035. reqHeaders := make(http.Header)
  89036. for k, v := range c.header_ {
  89037. reqHeaders[k] = v
  89038. }
  89039. reqHeaders.Set("User-Agent", c.s.userAgent())
  89040. if c.ifNoneMatch_ != "" {
  89041. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89042. }
  89043. var body io.Reader = nil
  89044. c.urlParams_.Set("alt", alt)
  89045. c.urlParams_.Set("prettyPrint", "false")
  89046. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  89047. urls += "?" + c.urlParams_.Encode()
  89048. req, err := http.NewRequest("GET", urls, body)
  89049. if err != nil {
  89050. return nil, err
  89051. }
  89052. req.Header = reqHeaders
  89053. googleapi.Expand(req.URL, map[string]string{
  89054. "project": c.project,
  89055. })
  89056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89057. }
  89058. // Do executes the "compute.nodeGroups.aggregatedList" call.
  89059. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  89060. // non-2xx status code is an error. Response headers are in either
  89061. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  89062. // returned at all) in error.(*googleapi.Error).Header. Use
  89063. // googleapi.IsNotModified to check whether the returned error was
  89064. // because http.StatusNotModified was returned.
  89065. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  89066. gensupport.SetOptions(c.urlParams_, opts...)
  89067. res, err := c.doRequest("json")
  89068. if res != nil && res.StatusCode == http.StatusNotModified {
  89069. if res.Body != nil {
  89070. res.Body.Close()
  89071. }
  89072. return nil, &googleapi.Error{
  89073. Code: res.StatusCode,
  89074. Header: res.Header,
  89075. }
  89076. }
  89077. if err != nil {
  89078. return nil, err
  89079. }
  89080. defer googleapi.CloseBody(res)
  89081. if err := googleapi.CheckResponse(res); err != nil {
  89082. return nil, err
  89083. }
  89084. ret := &NodeGroupAggregatedList{
  89085. ServerResponse: googleapi.ServerResponse{
  89086. Header: res.Header,
  89087. HTTPStatusCode: res.StatusCode,
  89088. },
  89089. }
  89090. target := &ret
  89091. if err := gensupport.DecodeResponse(target, res); err != nil {
  89092. return nil, err
  89093. }
  89094. return ret, nil
  89095. // {
  89096. // "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
  89097. // "httpMethod": "GET",
  89098. // "id": "compute.nodeGroups.aggregatedList",
  89099. // "parameterOrder": [
  89100. // "project"
  89101. // ],
  89102. // "parameters": {
  89103. // "filter": {
  89104. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  89105. // "location": "query",
  89106. // "type": "string"
  89107. // },
  89108. // "maxResults": {
  89109. // "default": "500",
  89110. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  89111. // "format": "uint32",
  89112. // "location": "query",
  89113. // "minimum": "0",
  89114. // "type": "integer"
  89115. // },
  89116. // "orderBy": {
  89117. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  89118. // "location": "query",
  89119. // "type": "string"
  89120. // },
  89121. // "pageToken": {
  89122. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  89123. // "location": "query",
  89124. // "type": "string"
  89125. // },
  89126. // "project": {
  89127. // "description": "Project ID for this request.",
  89128. // "location": "path",
  89129. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89130. // "required": true,
  89131. // "type": "string"
  89132. // }
  89133. // },
  89134. // "path": "{project}/aggregated/nodeGroups",
  89135. // "response": {
  89136. // "$ref": "NodeGroupAggregatedList"
  89137. // },
  89138. // "scopes": [
  89139. // "https://www.googleapis.com/auth/cloud-platform",
  89140. // "https://www.googleapis.com/auth/compute",
  89141. // "https://www.googleapis.com/auth/compute.readonly"
  89142. // ]
  89143. // }
  89144. }
  89145. // Pages invokes f for each page of results.
  89146. // A non-nil error returned from f will halt the iteration.
  89147. // The provided context supersedes any context provided to the Context method.
  89148. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  89149. c.ctx_ = ctx
  89150. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89151. for {
  89152. x, err := c.Do()
  89153. if err != nil {
  89154. return err
  89155. }
  89156. if err := f(x); err != nil {
  89157. return err
  89158. }
  89159. if x.NextPageToken == "" {
  89160. return nil
  89161. }
  89162. c.PageToken(x.NextPageToken)
  89163. }
  89164. }
  89165. // method id "compute.nodeGroups.delete":
  89166. type NodeGroupsDeleteCall struct {
  89167. s *Service
  89168. project string
  89169. zone string
  89170. nodeGroup string
  89171. urlParams_ gensupport.URLParams
  89172. ctx_ context.Context
  89173. header_ http.Header
  89174. }
  89175. // Delete: Deletes the specified NodeGroup resource.
  89176. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  89177. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89178. c.project = project
  89179. c.zone = zone
  89180. c.nodeGroup = nodeGroup
  89181. return c
  89182. }
  89183. // RequestId sets the optional parameter "requestId": An optional
  89184. // request ID to identify requests. Specify a unique request ID so that
  89185. // if you must retry your request, the server will know to ignore the
  89186. // request if it has already been completed.
  89187. //
  89188. // For example, consider a situation where you make an initial request
  89189. // and the request times out. If you make the request again with the
  89190. // same request ID, the server can check if original operation with the
  89191. // same request ID was received, and if so, will ignore the second
  89192. // request. This prevents clients from accidentally creating duplicate
  89193. // commitments.
  89194. //
  89195. // The request ID must be a valid UUID with the exception that zero UUID
  89196. // is not supported (00000000-0000-0000-0000-000000000000).
  89197. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  89198. c.urlParams_.Set("requestId", requestId)
  89199. return c
  89200. }
  89201. // Fields allows partial responses to be retrieved. See
  89202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89203. // for more information.
  89204. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  89205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89206. return c
  89207. }
  89208. // Context sets the context to be used in this call's Do method. Any
  89209. // pending HTTP request will be aborted if the provided context is
  89210. // canceled.
  89211. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  89212. c.ctx_ = ctx
  89213. return c
  89214. }
  89215. // Header returns an http.Header that can be modified by the caller to
  89216. // add HTTP headers to the request.
  89217. func (c *NodeGroupsDeleteCall) Header() http.Header {
  89218. if c.header_ == nil {
  89219. c.header_ = make(http.Header)
  89220. }
  89221. return c.header_
  89222. }
  89223. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  89224. reqHeaders := make(http.Header)
  89225. for k, v := range c.header_ {
  89226. reqHeaders[k] = v
  89227. }
  89228. reqHeaders.Set("User-Agent", c.s.userAgent())
  89229. var body io.Reader = nil
  89230. c.urlParams_.Set("alt", alt)
  89231. c.urlParams_.Set("prettyPrint", "false")
  89232. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  89233. urls += "?" + c.urlParams_.Encode()
  89234. req, err := http.NewRequest("DELETE", urls, body)
  89235. if err != nil {
  89236. return nil, err
  89237. }
  89238. req.Header = reqHeaders
  89239. googleapi.Expand(req.URL, map[string]string{
  89240. "project": c.project,
  89241. "zone": c.zone,
  89242. "nodeGroup": c.nodeGroup,
  89243. })
  89244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89245. }
  89246. // Do executes the "compute.nodeGroups.delete" call.
  89247. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89248. // status code is an error. Response headers are in either
  89249. // *Operation.ServerResponse.Header or (if a response was returned at
  89250. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89251. // to check whether the returned error was because
  89252. // http.StatusNotModified was returned.
  89253. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89254. gensupport.SetOptions(c.urlParams_, opts...)
  89255. res, err := c.doRequest("json")
  89256. if res != nil && res.StatusCode == http.StatusNotModified {
  89257. if res.Body != nil {
  89258. res.Body.Close()
  89259. }
  89260. return nil, &googleapi.Error{
  89261. Code: res.StatusCode,
  89262. Header: res.Header,
  89263. }
  89264. }
  89265. if err != nil {
  89266. return nil, err
  89267. }
  89268. defer googleapi.CloseBody(res)
  89269. if err := googleapi.CheckResponse(res); err != nil {
  89270. return nil, err
  89271. }
  89272. ret := &Operation{
  89273. ServerResponse: googleapi.ServerResponse{
  89274. Header: res.Header,
  89275. HTTPStatusCode: res.StatusCode,
  89276. },
  89277. }
  89278. target := &ret
  89279. if err := gensupport.DecodeResponse(target, res); err != nil {
  89280. return nil, err
  89281. }
  89282. return ret, nil
  89283. // {
  89284. // "description": "Deletes the specified NodeGroup resource.",
  89285. // "httpMethod": "DELETE",
  89286. // "id": "compute.nodeGroups.delete",
  89287. // "parameterOrder": [
  89288. // "project",
  89289. // "zone",
  89290. // "nodeGroup"
  89291. // ],
  89292. // "parameters": {
  89293. // "nodeGroup": {
  89294. // "description": "Name of the NodeGroup resource to delete.",
  89295. // "location": "path",
  89296. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89297. // "required": true,
  89298. // "type": "string"
  89299. // },
  89300. // "project": {
  89301. // "description": "Project ID for this request.",
  89302. // "location": "path",
  89303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89304. // "required": true,
  89305. // "type": "string"
  89306. // },
  89307. // "requestId": {
  89308. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89309. // "location": "query",
  89310. // "type": "string"
  89311. // },
  89312. // "zone": {
  89313. // "description": "The name of the zone for this request.",
  89314. // "location": "path",
  89315. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89316. // "required": true,
  89317. // "type": "string"
  89318. // }
  89319. // },
  89320. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  89321. // "response": {
  89322. // "$ref": "Operation"
  89323. // },
  89324. // "scopes": [
  89325. // "https://www.googleapis.com/auth/cloud-platform",
  89326. // "https://www.googleapis.com/auth/compute"
  89327. // ]
  89328. // }
  89329. }
  89330. // method id "compute.nodeGroups.deleteNodes":
  89331. type NodeGroupsDeleteNodesCall struct {
  89332. s *Service
  89333. project string
  89334. zone string
  89335. nodeGroup string
  89336. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  89337. urlParams_ gensupport.URLParams
  89338. ctx_ context.Context
  89339. header_ http.Header
  89340. }
  89341. // DeleteNodes: Deletes specified nodes from the node group.
  89342. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  89343. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89344. c.project = project
  89345. c.zone = zone
  89346. c.nodeGroup = nodeGroup
  89347. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  89348. return c
  89349. }
  89350. // RequestId sets the optional parameter "requestId": An optional
  89351. // request ID to identify requests. Specify a unique request ID so that
  89352. // if you must retry your request, the server will know to ignore the
  89353. // request if it has already been completed.
  89354. //
  89355. // For example, consider a situation where you make an initial request
  89356. // and the request times out. If you make the request again with the
  89357. // same request ID, the server can check if original operation with the
  89358. // same request ID was received, and if so, will ignore the second
  89359. // request. This prevents clients from accidentally creating duplicate
  89360. // commitments.
  89361. //
  89362. // The request ID must be a valid UUID with the exception that zero UUID
  89363. // is not supported (00000000-0000-0000-0000-000000000000).
  89364. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  89365. c.urlParams_.Set("requestId", requestId)
  89366. return c
  89367. }
  89368. // Fields allows partial responses to be retrieved. See
  89369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89370. // for more information.
  89371. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  89372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89373. return c
  89374. }
  89375. // Context sets the context to be used in this call's Do method. Any
  89376. // pending HTTP request will be aborted if the provided context is
  89377. // canceled.
  89378. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  89379. c.ctx_ = ctx
  89380. return c
  89381. }
  89382. // Header returns an http.Header that can be modified by the caller to
  89383. // add HTTP headers to the request.
  89384. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  89385. if c.header_ == nil {
  89386. c.header_ = make(http.Header)
  89387. }
  89388. return c.header_
  89389. }
  89390. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  89391. reqHeaders := make(http.Header)
  89392. for k, v := range c.header_ {
  89393. reqHeaders[k] = v
  89394. }
  89395. reqHeaders.Set("User-Agent", c.s.userAgent())
  89396. var body io.Reader = nil
  89397. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  89398. if err != nil {
  89399. return nil, err
  89400. }
  89401. reqHeaders.Set("Content-Type", "application/json")
  89402. c.urlParams_.Set("alt", alt)
  89403. c.urlParams_.Set("prettyPrint", "false")
  89404. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  89405. urls += "?" + c.urlParams_.Encode()
  89406. req, err := http.NewRequest("POST", urls, body)
  89407. if err != nil {
  89408. return nil, err
  89409. }
  89410. req.Header = reqHeaders
  89411. googleapi.Expand(req.URL, map[string]string{
  89412. "project": c.project,
  89413. "zone": c.zone,
  89414. "nodeGroup": c.nodeGroup,
  89415. })
  89416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89417. }
  89418. // Do executes the "compute.nodeGroups.deleteNodes" call.
  89419. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89420. // status code is an error. Response headers are in either
  89421. // *Operation.ServerResponse.Header or (if a response was returned at
  89422. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89423. // to check whether the returned error was because
  89424. // http.StatusNotModified was returned.
  89425. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89426. gensupport.SetOptions(c.urlParams_, opts...)
  89427. res, err := c.doRequest("json")
  89428. if res != nil && res.StatusCode == http.StatusNotModified {
  89429. if res.Body != nil {
  89430. res.Body.Close()
  89431. }
  89432. return nil, &googleapi.Error{
  89433. Code: res.StatusCode,
  89434. Header: res.Header,
  89435. }
  89436. }
  89437. if err != nil {
  89438. return nil, err
  89439. }
  89440. defer googleapi.CloseBody(res)
  89441. if err := googleapi.CheckResponse(res); err != nil {
  89442. return nil, err
  89443. }
  89444. ret := &Operation{
  89445. ServerResponse: googleapi.ServerResponse{
  89446. Header: res.Header,
  89447. HTTPStatusCode: res.StatusCode,
  89448. },
  89449. }
  89450. target := &ret
  89451. if err := gensupport.DecodeResponse(target, res); err != nil {
  89452. return nil, err
  89453. }
  89454. return ret, nil
  89455. // {
  89456. // "description": "Deletes specified nodes from the node group.",
  89457. // "httpMethod": "POST",
  89458. // "id": "compute.nodeGroups.deleteNodes",
  89459. // "parameterOrder": [
  89460. // "project",
  89461. // "zone",
  89462. // "nodeGroup"
  89463. // ],
  89464. // "parameters": {
  89465. // "nodeGroup": {
  89466. // "description": "Name of the NodeGroup resource to delete.",
  89467. // "location": "path",
  89468. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89469. // "required": true,
  89470. // "type": "string"
  89471. // },
  89472. // "project": {
  89473. // "description": "Project ID for this request.",
  89474. // "location": "path",
  89475. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89476. // "required": true,
  89477. // "type": "string"
  89478. // },
  89479. // "requestId": {
  89480. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89481. // "location": "query",
  89482. // "type": "string"
  89483. // },
  89484. // "zone": {
  89485. // "description": "The name of the zone for this request.",
  89486. // "location": "path",
  89487. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89488. // "required": true,
  89489. // "type": "string"
  89490. // }
  89491. // },
  89492. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  89493. // "request": {
  89494. // "$ref": "NodeGroupsDeleteNodesRequest"
  89495. // },
  89496. // "response": {
  89497. // "$ref": "Operation"
  89498. // },
  89499. // "scopes": [
  89500. // "https://www.googleapis.com/auth/cloud-platform",
  89501. // "https://www.googleapis.com/auth/compute"
  89502. // ]
  89503. // }
  89504. }
  89505. // method id "compute.nodeGroups.get":
  89506. type NodeGroupsGetCall struct {
  89507. s *Service
  89508. project string
  89509. zone string
  89510. nodeGroup string
  89511. urlParams_ gensupport.URLParams
  89512. ifNoneMatch_ string
  89513. ctx_ context.Context
  89514. header_ http.Header
  89515. }
  89516. // Get: Returns the specified NodeGroup. Get a list of available
  89517. // NodeGroups by making a list() request. Note: the "nodes" field should
  89518. // not be used. Use nodeGroups.listNodes instead.
  89519. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  89520. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89521. c.project = project
  89522. c.zone = zone
  89523. c.nodeGroup = nodeGroup
  89524. return c
  89525. }
  89526. // Fields allows partial responses to be retrieved. See
  89527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89528. // for more information.
  89529. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  89530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89531. return c
  89532. }
  89533. // IfNoneMatch sets the optional parameter which makes the operation
  89534. // fail if the object's ETag matches the given value. This is useful for
  89535. // getting updates only after the object has changed since the last
  89536. // request. Use googleapi.IsNotModified to check whether the response
  89537. // error from Do is the result of In-None-Match.
  89538. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  89539. c.ifNoneMatch_ = entityTag
  89540. return c
  89541. }
  89542. // Context sets the context to be used in this call's Do method. Any
  89543. // pending HTTP request will be aborted if the provided context is
  89544. // canceled.
  89545. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  89546. c.ctx_ = ctx
  89547. return c
  89548. }
  89549. // Header returns an http.Header that can be modified by the caller to
  89550. // add HTTP headers to the request.
  89551. func (c *NodeGroupsGetCall) Header() http.Header {
  89552. if c.header_ == nil {
  89553. c.header_ = make(http.Header)
  89554. }
  89555. return c.header_
  89556. }
  89557. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  89558. reqHeaders := make(http.Header)
  89559. for k, v := range c.header_ {
  89560. reqHeaders[k] = v
  89561. }
  89562. reqHeaders.Set("User-Agent", c.s.userAgent())
  89563. if c.ifNoneMatch_ != "" {
  89564. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89565. }
  89566. var body io.Reader = nil
  89567. c.urlParams_.Set("alt", alt)
  89568. c.urlParams_.Set("prettyPrint", "false")
  89569. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  89570. urls += "?" + c.urlParams_.Encode()
  89571. req, err := http.NewRequest("GET", urls, body)
  89572. if err != nil {
  89573. return nil, err
  89574. }
  89575. req.Header = reqHeaders
  89576. googleapi.Expand(req.URL, map[string]string{
  89577. "project": c.project,
  89578. "zone": c.zone,
  89579. "nodeGroup": c.nodeGroup,
  89580. })
  89581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89582. }
  89583. // Do executes the "compute.nodeGroups.get" call.
  89584. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  89585. // status code is an error. Response headers are in either
  89586. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  89587. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89588. // to check whether the returned error was because
  89589. // http.StatusNotModified was returned.
  89590. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  89591. gensupport.SetOptions(c.urlParams_, opts...)
  89592. res, err := c.doRequest("json")
  89593. if res != nil && res.StatusCode == http.StatusNotModified {
  89594. if res.Body != nil {
  89595. res.Body.Close()
  89596. }
  89597. return nil, &googleapi.Error{
  89598. Code: res.StatusCode,
  89599. Header: res.Header,
  89600. }
  89601. }
  89602. if err != nil {
  89603. return nil, err
  89604. }
  89605. defer googleapi.CloseBody(res)
  89606. if err := googleapi.CheckResponse(res); err != nil {
  89607. return nil, err
  89608. }
  89609. ret := &NodeGroup{
  89610. ServerResponse: googleapi.ServerResponse{
  89611. Header: res.Header,
  89612. HTTPStatusCode: res.StatusCode,
  89613. },
  89614. }
  89615. target := &ret
  89616. if err := gensupport.DecodeResponse(target, res); err != nil {
  89617. return nil, err
  89618. }
  89619. return ret, nil
  89620. // {
  89621. // "description": "Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the \"nodes\" field should not be used. Use nodeGroups.listNodes instead.",
  89622. // "httpMethod": "GET",
  89623. // "id": "compute.nodeGroups.get",
  89624. // "parameterOrder": [
  89625. // "project",
  89626. // "zone",
  89627. // "nodeGroup"
  89628. // ],
  89629. // "parameters": {
  89630. // "nodeGroup": {
  89631. // "description": "Name of the node group to return.",
  89632. // "location": "path",
  89633. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89634. // "required": true,
  89635. // "type": "string"
  89636. // },
  89637. // "project": {
  89638. // "description": "Project ID for this request.",
  89639. // "location": "path",
  89640. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89641. // "required": true,
  89642. // "type": "string"
  89643. // },
  89644. // "zone": {
  89645. // "description": "The name of the zone for this request.",
  89646. // "location": "path",
  89647. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89648. // "required": true,
  89649. // "type": "string"
  89650. // }
  89651. // },
  89652. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  89653. // "response": {
  89654. // "$ref": "NodeGroup"
  89655. // },
  89656. // "scopes": [
  89657. // "https://www.googleapis.com/auth/cloud-platform",
  89658. // "https://www.googleapis.com/auth/compute",
  89659. // "https://www.googleapis.com/auth/compute.readonly"
  89660. // ]
  89661. // }
  89662. }
  89663. // method id "compute.nodeGroups.getIamPolicy":
  89664. type NodeGroupsGetIamPolicyCall struct {
  89665. s *Service
  89666. project string
  89667. zone string
  89668. resource string
  89669. urlParams_ gensupport.URLParams
  89670. ifNoneMatch_ string
  89671. ctx_ context.Context
  89672. header_ http.Header
  89673. }
  89674. // GetIamPolicy: Gets the access control policy for a resource. May be
  89675. // empty if no such policy or resource exists.
  89676. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  89677. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89678. c.project = project
  89679. c.zone = zone
  89680. c.resource = resource
  89681. return c
  89682. }
  89683. // Fields allows partial responses to be retrieved. See
  89684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89685. // for more information.
  89686. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  89687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89688. return c
  89689. }
  89690. // IfNoneMatch sets the optional parameter which makes the operation
  89691. // fail if the object's ETag matches the given value. This is useful for
  89692. // getting updates only after the object has changed since the last
  89693. // request. Use googleapi.IsNotModified to check whether the response
  89694. // error from Do is the result of In-None-Match.
  89695. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  89696. c.ifNoneMatch_ = entityTag
  89697. return c
  89698. }
  89699. // Context sets the context to be used in this call's Do method. Any
  89700. // pending HTTP request will be aborted if the provided context is
  89701. // canceled.
  89702. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  89703. c.ctx_ = ctx
  89704. return c
  89705. }
  89706. // Header returns an http.Header that can be modified by the caller to
  89707. // add HTTP headers to the request.
  89708. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  89709. if c.header_ == nil {
  89710. c.header_ = make(http.Header)
  89711. }
  89712. return c.header_
  89713. }
  89714. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  89715. reqHeaders := make(http.Header)
  89716. for k, v := range c.header_ {
  89717. reqHeaders[k] = v
  89718. }
  89719. reqHeaders.Set("User-Agent", c.s.userAgent())
  89720. if c.ifNoneMatch_ != "" {
  89721. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89722. }
  89723. var body io.Reader = nil
  89724. c.urlParams_.Set("alt", alt)
  89725. c.urlParams_.Set("prettyPrint", "false")
  89726. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  89727. urls += "?" + c.urlParams_.Encode()
  89728. req, err := http.NewRequest("GET", urls, body)
  89729. if err != nil {
  89730. return nil, err
  89731. }
  89732. req.Header = reqHeaders
  89733. googleapi.Expand(req.URL, map[string]string{
  89734. "project": c.project,
  89735. "zone": c.zone,
  89736. "resource": c.resource,
  89737. })
  89738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89739. }
  89740. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  89741. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  89742. // code is an error. Response headers are in either
  89743. // *Policy.ServerResponse.Header or (if a response was returned at all)
  89744. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  89745. // check whether the returned error was because http.StatusNotModified
  89746. // was returned.
  89747. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  89748. gensupport.SetOptions(c.urlParams_, opts...)
  89749. res, err := c.doRequest("json")
  89750. if res != nil && res.StatusCode == http.StatusNotModified {
  89751. if res.Body != nil {
  89752. res.Body.Close()
  89753. }
  89754. return nil, &googleapi.Error{
  89755. Code: res.StatusCode,
  89756. Header: res.Header,
  89757. }
  89758. }
  89759. if err != nil {
  89760. return nil, err
  89761. }
  89762. defer googleapi.CloseBody(res)
  89763. if err := googleapi.CheckResponse(res); err != nil {
  89764. return nil, err
  89765. }
  89766. ret := &Policy{
  89767. ServerResponse: googleapi.ServerResponse{
  89768. Header: res.Header,
  89769. HTTPStatusCode: res.StatusCode,
  89770. },
  89771. }
  89772. target := &ret
  89773. if err := gensupport.DecodeResponse(target, res); err != nil {
  89774. return nil, err
  89775. }
  89776. return ret, nil
  89777. // {
  89778. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  89779. // "httpMethod": "GET",
  89780. // "id": "compute.nodeGroups.getIamPolicy",
  89781. // "parameterOrder": [
  89782. // "project",
  89783. // "zone",
  89784. // "resource"
  89785. // ],
  89786. // "parameters": {
  89787. // "project": {
  89788. // "description": "Project ID for this request.",
  89789. // "location": "path",
  89790. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89791. // "required": true,
  89792. // "type": "string"
  89793. // },
  89794. // "resource": {
  89795. // "description": "Name or id of the resource for this request.",
  89796. // "location": "path",
  89797. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89798. // "required": true,
  89799. // "type": "string"
  89800. // },
  89801. // "zone": {
  89802. // "description": "The name of the zone for this request.",
  89803. // "location": "path",
  89804. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89805. // "required": true,
  89806. // "type": "string"
  89807. // }
  89808. // },
  89809. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  89810. // "response": {
  89811. // "$ref": "Policy"
  89812. // },
  89813. // "scopes": [
  89814. // "https://www.googleapis.com/auth/cloud-platform",
  89815. // "https://www.googleapis.com/auth/compute",
  89816. // "https://www.googleapis.com/auth/compute.readonly"
  89817. // ]
  89818. // }
  89819. }
  89820. // method id "compute.nodeGroups.insert":
  89821. type NodeGroupsInsertCall struct {
  89822. s *Service
  89823. project string
  89824. zone string
  89825. nodegroup *NodeGroup
  89826. urlParams_ gensupport.URLParams
  89827. ctx_ context.Context
  89828. header_ http.Header
  89829. }
  89830. // Insert: Creates a NodeGroup resource in the specified project using
  89831. // the data included in the request.
  89832. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  89833. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89834. c.project = project
  89835. c.zone = zone
  89836. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  89837. c.nodegroup = nodegroup
  89838. return c
  89839. }
  89840. // RequestId sets the optional parameter "requestId": An optional
  89841. // request ID to identify requests. Specify a unique request ID so that
  89842. // if you must retry your request, the server will know to ignore the
  89843. // request if it has already been completed.
  89844. //
  89845. // For example, consider a situation where you make an initial request
  89846. // and the request times out. If you make the request again with the
  89847. // same request ID, the server can check if original operation with the
  89848. // same request ID was received, and if so, will ignore the second
  89849. // request. This prevents clients from accidentally creating duplicate
  89850. // commitments.
  89851. //
  89852. // The request ID must be a valid UUID with the exception that zero UUID
  89853. // is not supported (00000000-0000-0000-0000-000000000000).
  89854. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  89855. c.urlParams_.Set("requestId", requestId)
  89856. return c
  89857. }
  89858. // Fields allows partial responses to be retrieved. See
  89859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89860. // for more information.
  89861. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  89862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89863. return c
  89864. }
  89865. // Context sets the context to be used in this call's Do method. Any
  89866. // pending HTTP request will be aborted if the provided context is
  89867. // canceled.
  89868. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  89869. c.ctx_ = ctx
  89870. return c
  89871. }
  89872. // Header returns an http.Header that can be modified by the caller to
  89873. // add HTTP headers to the request.
  89874. func (c *NodeGroupsInsertCall) Header() http.Header {
  89875. if c.header_ == nil {
  89876. c.header_ = make(http.Header)
  89877. }
  89878. return c.header_
  89879. }
  89880. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  89881. reqHeaders := make(http.Header)
  89882. for k, v := range c.header_ {
  89883. reqHeaders[k] = v
  89884. }
  89885. reqHeaders.Set("User-Agent", c.s.userAgent())
  89886. var body io.Reader = nil
  89887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  89888. if err != nil {
  89889. return nil, err
  89890. }
  89891. reqHeaders.Set("Content-Type", "application/json")
  89892. c.urlParams_.Set("alt", alt)
  89893. c.urlParams_.Set("prettyPrint", "false")
  89894. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  89895. urls += "?" + c.urlParams_.Encode()
  89896. req, err := http.NewRequest("POST", urls, body)
  89897. if err != nil {
  89898. return nil, err
  89899. }
  89900. req.Header = reqHeaders
  89901. googleapi.Expand(req.URL, map[string]string{
  89902. "project": c.project,
  89903. "zone": c.zone,
  89904. })
  89905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89906. }
  89907. // Do executes the "compute.nodeGroups.insert" call.
  89908. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89909. // status code is an error. Response headers are in either
  89910. // *Operation.ServerResponse.Header or (if a response was returned at
  89911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89912. // to check whether the returned error was because
  89913. // http.StatusNotModified was returned.
  89914. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89915. gensupport.SetOptions(c.urlParams_, opts...)
  89916. res, err := c.doRequest("json")
  89917. if res != nil && res.StatusCode == http.StatusNotModified {
  89918. if res.Body != nil {
  89919. res.Body.Close()
  89920. }
  89921. return nil, &googleapi.Error{
  89922. Code: res.StatusCode,
  89923. Header: res.Header,
  89924. }
  89925. }
  89926. if err != nil {
  89927. return nil, err
  89928. }
  89929. defer googleapi.CloseBody(res)
  89930. if err := googleapi.CheckResponse(res); err != nil {
  89931. return nil, err
  89932. }
  89933. ret := &Operation{
  89934. ServerResponse: googleapi.ServerResponse{
  89935. Header: res.Header,
  89936. HTTPStatusCode: res.StatusCode,
  89937. },
  89938. }
  89939. target := &ret
  89940. if err := gensupport.DecodeResponse(target, res); err != nil {
  89941. return nil, err
  89942. }
  89943. return ret, nil
  89944. // {
  89945. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  89946. // "httpMethod": "POST",
  89947. // "id": "compute.nodeGroups.insert",
  89948. // "parameterOrder": [
  89949. // "project",
  89950. // "zone",
  89951. // "initialNodeCount"
  89952. // ],
  89953. // "parameters": {
  89954. // "initialNodeCount": {
  89955. // "description": "Initial count of nodes in the node group.",
  89956. // "format": "int32",
  89957. // "location": "query",
  89958. // "required": true,
  89959. // "type": "integer"
  89960. // },
  89961. // "project": {
  89962. // "description": "Project ID for this request.",
  89963. // "location": "path",
  89964. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89965. // "required": true,
  89966. // "type": "string"
  89967. // },
  89968. // "requestId": {
  89969. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89970. // "location": "query",
  89971. // "type": "string"
  89972. // },
  89973. // "zone": {
  89974. // "description": "The name of the zone for this request.",
  89975. // "location": "path",
  89976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89977. // "required": true,
  89978. // "type": "string"
  89979. // }
  89980. // },
  89981. // "path": "{project}/zones/{zone}/nodeGroups",
  89982. // "request": {
  89983. // "$ref": "NodeGroup"
  89984. // },
  89985. // "response": {
  89986. // "$ref": "Operation"
  89987. // },
  89988. // "scopes": [
  89989. // "https://www.googleapis.com/auth/cloud-platform",
  89990. // "https://www.googleapis.com/auth/compute"
  89991. // ]
  89992. // }
  89993. }
  89994. // method id "compute.nodeGroups.list":
  89995. type NodeGroupsListCall struct {
  89996. s *Service
  89997. project string
  89998. zone string
  89999. urlParams_ gensupport.URLParams
  90000. ifNoneMatch_ string
  90001. ctx_ context.Context
  90002. header_ http.Header
  90003. }
  90004. // List: Retrieves a list of node groups available to the specified
  90005. // project. Note: use nodeGroups.listNodes for more details about each
  90006. // group.
  90007. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  90008. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90009. c.project = project
  90010. c.zone = zone
  90011. return c
  90012. }
  90013. // Filter sets the optional parameter "filter": A filter expression that
  90014. // filters resources listed in the response. The expression must specify
  90015. // the field name, a comparison operator, and the value that you want to
  90016. // use for filtering. The value must be a string, a number, or a
  90017. // boolean. The comparison operator must be either =, !=, >, or <.
  90018. //
  90019. // For example, if you are filtering Compute Engine instances, you can
  90020. // exclude instances named example-instance by specifying name !=
  90021. // example-instance.
  90022. //
  90023. // You can also filter nested fields. For example, you could specify
  90024. // scheduling.automaticRestart = false to include instances only if they
  90025. // are not scheduled for automatic restarts. You can use filtering on
  90026. // nested fields to filter based on resource labels.
  90027. //
  90028. // To filter on multiple expressions, provide each separate expression
  90029. // within parentheses. For example, (scheduling.automaticRestart = true)
  90030. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90031. // AND expression. However, you can include AND and OR expressions
  90032. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90033. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90034. // true).
  90035. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  90036. c.urlParams_.Set("filter", filter)
  90037. return c
  90038. }
  90039. // MaxResults sets the optional parameter "maxResults": The maximum
  90040. // number of results per page that should be returned. If the number of
  90041. // available results is larger than maxResults, Compute Engine returns a
  90042. // nextPageToken that can be used to get the next page of results in
  90043. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90044. // (Default: 500)
  90045. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  90046. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90047. return c
  90048. }
  90049. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90050. // a certain order. By default, results are returned in alphanumerical
  90051. // order based on the resource name.
  90052. //
  90053. // You can also sort results in descending order based on the creation
  90054. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90055. // based on the creationTimestamp field in reverse chronological order
  90056. // (newest result first). Use this to sort resources like operations so
  90057. // that the newest operation is returned first.
  90058. //
  90059. // Currently, only sorting by name or creationTimestamp desc is
  90060. // supported.
  90061. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  90062. c.urlParams_.Set("orderBy", orderBy)
  90063. return c
  90064. }
  90065. // PageToken sets the optional parameter "pageToken": Specifies a page
  90066. // token to use. Set pageToken to the nextPageToken returned by a
  90067. // previous list request to get the next page of results.
  90068. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  90069. c.urlParams_.Set("pageToken", pageToken)
  90070. return c
  90071. }
  90072. // Fields allows partial responses to be retrieved. See
  90073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90074. // for more information.
  90075. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  90076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90077. return c
  90078. }
  90079. // IfNoneMatch sets the optional parameter which makes the operation
  90080. // fail if the object's ETag matches the given value. This is useful for
  90081. // getting updates only after the object has changed since the last
  90082. // request. Use googleapi.IsNotModified to check whether the response
  90083. // error from Do is the result of In-None-Match.
  90084. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  90085. c.ifNoneMatch_ = entityTag
  90086. return c
  90087. }
  90088. // Context sets the context to be used in this call's Do method. Any
  90089. // pending HTTP request will be aborted if the provided context is
  90090. // canceled.
  90091. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  90092. c.ctx_ = ctx
  90093. return c
  90094. }
  90095. // Header returns an http.Header that can be modified by the caller to
  90096. // add HTTP headers to the request.
  90097. func (c *NodeGroupsListCall) Header() http.Header {
  90098. if c.header_ == nil {
  90099. c.header_ = make(http.Header)
  90100. }
  90101. return c.header_
  90102. }
  90103. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  90104. reqHeaders := make(http.Header)
  90105. for k, v := range c.header_ {
  90106. reqHeaders[k] = v
  90107. }
  90108. reqHeaders.Set("User-Agent", c.s.userAgent())
  90109. if c.ifNoneMatch_ != "" {
  90110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90111. }
  90112. var body io.Reader = nil
  90113. c.urlParams_.Set("alt", alt)
  90114. c.urlParams_.Set("prettyPrint", "false")
  90115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  90116. urls += "?" + c.urlParams_.Encode()
  90117. req, err := http.NewRequest("GET", urls, body)
  90118. if err != nil {
  90119. return nil, err
  90120. }
  90121. req.Header = reqHeaders
  90122. googleapi.Expand(req.URL, map[string]string{
  90123. "project": c.project,
  90124. "zone": c.zone,
  90125. })
  90126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90127. }
  90128. // Do executes the "compute.nodeGroups.list" call.
  90129. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  90130. // status code is an error. Response headers are in either
  90131. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  90132. // at all) in error.(*googleapi.Error).Header. Use
  90133. // googleapi.IsNotModified to check whether the returned error was
  90134. // because http.StatusNotModified was returned.
  90135. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  90136. gensupport.SetOptions(c.urlParams_, opts...)
  90137. res, err := c.doRequest("json")
  90138. if res != nil && res.StatusCode == http.StatusNotModified {
  90139. if res.Body != nil {
  90140. res.Body.Close()
  90141. }
  90142. return nil, &googleapi.Error{
  90143. Code: res.StatusCode,
  90144. Header: res.Header,
  90145. }
  90146. }
  90147. if err != nil {
  90148. return nil, err
  90149. }
  90150. defer googleapi.CloseBody(res)
  90151. if err := googleapi.CheckResponse(res); err != nil {
  90152. return nil, err
  90153. }
  90154. ret := &NodeGroupList{
  90155. ServerResponse: googleapi.ServerResponse{
  90156. Header: res.Header,
  90157. HTTPStatusCode: res.StatusCode,
  90158. },
  90159. }
  90160. target := &ret
  90161. if err := gensupport.DecodeResponse(target, res); err != nil {
  90162. return nil, err
  90163. }
  90164. return ret, nil
  90165. // {
  90166. // "description": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
  90167. // "httpMethod": "GET",
  90168. // "id": "compute.nodeGroups.list",
  90169. // "parameterOrder": [
  90170. // "project",
  90171. // "zone"
  90172. // ],
  90173. // "parameters": {
  90174. // "filter": {
  90175. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  90176. // "location": "query",
  90177. // "type": "string"
  90178. // },
  90179. // "maxResults": {
  90180. // "default": "500",
  90181. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  90182. // "format": "uint32",
  90183. // "location": "query",
  90184. // "minimum": "0",
  90185. // "type": "integer"
  90186. // },
  90187. // "orderBy": {
  90188. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  90189. // "location": "query",
  90190. // "type": "string"
  90191. // },
  90192. // "pageToken": {
  90193. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  90194. // "location": "query",
  90195. // "type": "string"
  90196. // },
  90197. // "project": {
  90198. // "description": "Project ID for this request.",
  90199. // "location": "path",
  90200. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90201. // "required": true,
  90202. // "type": "string"
  90203. // },
  90204. // "zone": {
  90205. // "description": "The name of the zone for this request.",
  90206. // "location": "path",
  90207. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90208. // "required": true,
  90209. // "type": "string"
  90210. // }
  90211. // },
  90212. // "path": "{project}/zones/{zone}/nodeGroups",
  90213. // "response": {
  90214. // "$ref": "NodeGroupList"
  90215. // },
  90216. // "scopes": [
  90217. // "https://www.googleapis.com/auth/cloud-platform",
  90218. // "https://www.googleapis.com/auth/compute",
  90219. // "https://www.googleapis.com/auth/compute.readonly"
  90220. // ]
  90221. // }
  90222. }
  90223. // Pages invokes f for each page of results.
  90224. // A non-nil error returned from f will halt the iteration.
  90225. // The provided context supersedes any context provided to the Context method.
  90226. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  90227. c.ctx_ = ctx
  90228. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90229. for {
  90230. x, err := c.Do()
  90231. if err != nil {
  90232. return err
  90233. }
  90234. if err := f(x); err != nil {
  90235. return err
  90236. }
  90237. if x.NextPageToken == "" {
  90238. return nil
  90239. }
  90240. c.PageToken(x.NextPageToken)
  90241. }
  90242. }
  90243. // method id "compute.nodeGroups.listNodes":
  90244. type NodeGroupsListNodesCall struct {
  90245. s *Service
  90246. project string
  90247. zone string
  90248. nodeGroup string
  90249. urlParams_ gensupport.URLParams
  90250. ctx_ context.Context
  90251. header_ http.Header
  90252. }
  90253. // ListNodes: Lists nodes in the node group.
  90254. func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
  90255. c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90256. c.project = project
  90257. c.zone = zone
  90258. c.nodeGroup = nodeGroup
  90259. return c
  90260. }
  90261. // Filter sets the optional parameter "filter": A filter expression that
  90262. // filters resources listed in the response. The expression must specify
  90263. // the field name, a comparison operator, and the value that you want to
  90264. // use for filtering. The value must be a string, a number, or a
  90265. // boolean. The comparison operator must be either =, !=, >, or <.
  90266. //
  90267. // For example, if you are filtering Compute Engine instances, you can
  90268. // exclude instances named example-instance by specifying name !=
  90269. // example-instance.
  90270. //
  90271. // You can also filter nested fields. For example, you could specify
  90272. // scheduling.automaticRestart = false to include instances only if they
  90273. // are not scheduled for automatic restarts. You can use filtering on
  90274. // nested fields to filter based on resource labels.
  90275. //
  90276. // To filter on multiple expressions, provide each separate expression
  90277. // within parentheses. For example, (scheduling.automaticRestart = true)
  90278. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90279. // AND expression. However, you can include AND and OR expressions
  90280. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90281. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90282. // true).
  90283. func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
  90284. c.urlParams_.Set("filter", filter)
  90285. return c
  90286. }
  90287. // MaxResults sets the optional parameter "maxResults": The maximum
  90288. // number of results per page that should be returned. If the number of
  90289. // available results is larger than maxResults, Compute Engine returns a
  90290. // nextPageToken that can be used to get the next page of results in
  90291. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90292. // (Default: 500)
  90293. func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
  90294. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90295. return c
  90296. }
  90297. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90298. // a certain order. By default, results are returned in alphanumerical
  90299. // order based on the resource name.
  90300. //
  90301. // You can also sort results in descending order based on the creation
  90302. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90303. // based on the creationTimestamp field in reverse chronological order
  90304. // (newest result first). Use this to sort resources like operations so
  90305. // that the newest operation is returned first.
  90306. //
  90307. // Currently, only sorting by name or creationTimestamp desc is
  90308. // supported.
  90309. func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
  90310. c.urlParams_.Set("orderBy", orderBy)
  90311. return c
  90312. }
  90313. // PageToken sets the optional parameter "pageToken": Specifies a page
  90314. // token to use. Set pageToken to the nextPageToken returned by a
  90315. // previous list request to get the next page of results.
  90316. func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
  90317. c.urlParams_.Set("pageToken", pageToken)
  90318. return c
  90319. }
  90320. // Fields allows partial responses to be retrieved. See
  90321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90322. // for more information.
  90323. func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
  90324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90325. return c
  90326. }
  90327. // Context sets the context to be used in this call's Do method. Any
  90328. // pending HTTP request will be aborted if the provided context is
  90329. // canceled.
  90330. func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
  90331. c.ctx_ = ctx
  90332. return c
  90333. }
  90334. // Header returns an http.Header that can be modified by the caller to
  90335. // add HTTP headers to the request.
  90336. func (c *NodeGroupsListNodesCall) Header() http.Header {
  90337. if c.header_ == nil {
  90338. c.header_ = make(http.Header)
  90339. }
  90340. return c.header_
  90341. }
  90342. func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
  90343. reqHeaders := make(http.Header)
  90344. for k, v := range c.header_ {
  90345. reqHeaders[k] = v
  90346. }
  90347. reqHeaders.Set("User-Agent", c.s.userAgent())
  90348. var body io.Reader = nil
  90349. c.urlParams_.Set("alt", alt)
  90350. c.urlParams_.Set("prettyPrint", "false")
  90351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
  90352. urls += "?" + c.urlParams_.Encode()
  90353. req, err := http.NewRequest("POST", urls, body)
  90354. if err != nil {
  90355. return nil, err
  90356. }
  90357. req.Header = reqHeaders
  90358. googleapi.Expand(req.URL, map[string]string{
  90359. "project": c.project,
  90360. "zone": c.zone,
  90361. "nodeGroup": c.nodeGroup,
  90362. })
  90363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90364. }
  90365. // Do executes the "compute.nodeGroups.listNodes" call.
  90366. // Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
  90367. // non-2xx status code is an error. Response headers are in either
  90368. // *NodeGroupsListNodes.ServerResponse.Header or (if a response was
  90369. // returned at all) in error.(*googleapi.Error).Header. Use
  90370. // googleapi.IsNotModified to check whether the returned error was
  90371. // because http.StatusNotModified was returned.
  90372. func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) {
  90373. gensupport.SetOptions(c.urlParams_, opts...)
  90374. res, err := c.doRequest("json")
  90375. if res != nil && res.StatusCode == http.StatusNotModified {
  90376. if res.Body != nil {
  90377. res.Body.Close()
  90378. }
  90379. return nil, &googleapi.Error{
  90380. Code: res.StatusCode,
  90381. Header: res.Header,
  90382. }
  90383. }
  90384. if err != nil {
  90385. return nil, err
  90386. }
  90387. defer googleapi.CloseBody(res)
  90388. if err := googleapi.CheckResponse(res); err != nil {
  90389. return nil, err
  90390. }
  90391. ret := &NodeGroupsListNodes{
  90392. ServerResponse: googleapi.ServerResponse{
  90393. Header: res.Header,
  90394. HTTPStatusCode: res.StatusCode,
  90395. },
  90396. }
  90397. target := &ret
  90398. if err := gensupport.DecodeResponse(target, res); err != nil {
  90399. return nil, err
  90400. }
  90401. return ret, nil
  90402. // {
  90403. // "description": "Lists nodes in the node group.",
  90404. // "httpMethod": "POST",
  90405. // "id": "compute.nodeGroups.listNodes",
  90406. // "parameterOrder": [
  90407. // "project",
  90408. // "zone",
  90409. // "nodeGroup"
  90410. // ],
  90411. // "parameters": {
  90412. // "filter": {
  90413. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  90414. // "location": "query",
  90415. // "type": "string"
  90416. // },
  90417. // "maxResults": {
  90418. // "default": "500",
  90419. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  90420. // "format": "uint32",
  90421. // "location": "query",
  90422. // "minimum": "0",
  90423. // "type": "integer"
  90424. // },
  90425. // "nodeGroup": {
  90426. // "description": "Name of the NodeGroup resource whose nodes you want to list.",
  90427. // "location": "path",
  90428. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90429. // "required": true,
  90430. // "type": "string"
  90431. // },
  90432. // "orderBy": {
  90433. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  90434. // "location": "query",
  90435. // "type": "string"
  90436. // },
  90437. // "pageToken": {
  90438. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  90439. // "location": "query",
  90440. // "type": "string"
  90441. // },
  90442. // "project": {
  90443. // "description": "Project ID for this request.",
  90444. // "location": "path",
  90445. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90446. // "required": true,
  90447. // "type": "string"
  90448. // },
  90449. // "zone": {
  90450. // "description": "The name of the zone for this request.",
  90451. // "location": "path",
  90452. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90453. // "required": true,
  90454. // "type": "string"
  90455. // }
  90456. // },
  90457. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
  90458. // "response": {
  90459. // "$ref": "NodeGroupsListNodes"
  90460. // },
  90461. // "scopes": [
  90462. // "https://www.googleapis.com/auth/cloud-platform",
  90463. // "https://www.googleapis.com/auth/compute",
  90464. // "https://www.googleapis.com/auth/compute.readonly"
  90465. // ]
  90466. // }
  90467. }
  90468. // Pages invokes f for each page of results.
  90469. // A non-nil error returned from f will halt the iteration.
  90470. // The provided context supersedes any context provided to the Context method.
  90471. func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error {
  90472. c.ctx_ = ctx
  90473. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90474. for {
  90475. x, err := c.Do()
  90476. if err != nil {
  90477. return err
  90478. }
  90479. if err := f(x); err != nil {
  90480. return err
  90481. }
  90482. if x.NextPageToken == "" {
  90483. return nil
  90484. }
  90485. c.PageToken(x.NextPageToken)
  90486. }
  90487. }
  90488. // method id "compute.nodeGroups.setAutoscalingPolicy":
  90489. type NodeGroupsSetAutoscalingPolicyCall struct {
  90490. s *Service
  90491. project string
  90492. zone string
  90493. nodeGroup string
  90494. nodegroupssetautoscalingpolicyrequest *NodeGroupsSetAutoscalingPolicyRequest
  90495. urlParams_ gensupport.URLParams
  90496. ctx_ context.Context
  90497. header_ http.Header
  90498. }
  90499. // SetAutoscalingPolicy: Sets the autoscaling policy of the node group.
  90500. func (r *NodeGroupsService) SetAutoscalingPolicy(project string, zone string, nodeGroup string, nodegroupssetautoscalingpolicyrequest *NodeGroupsSetAutoscalingPolicyRequest) *NodeGroupsSetAutoscalingPolicyCall {
  90501. c := &NodeGroupsSetAutoscalingPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90502. c.project = project
  90503. c.zone = zone
  90504. c.nodeGroup = nodeGroup
  90505. c.nodegroupssetautoscalingpolicyrequest = nodegroupssetautoscalingpolicyrequest
  90506. return c
  90507. }
  90508. // RequestId sets the optional parameter "requestId": An optional
  90509. // request ID to identify requests. Specify a unique request ID so that
  90510. // if you must retry your request, the server will know to ignore the
  90511. // request if it has already been completed.
  90512. //
  90513. // For example, consider a situation where you make an initial request
  90514. // and the request times out. If you make the request again with the
  90515. // same request ID, the server can check if original operation with the
  90516. // same request ID was received, and if so, will ignore the second
  90517. // request. This prevents clients from accidentally creating duplicate
  90518. // commitments.
  90519. //
  90520. // The request ID must be a valid UUID with the exception that zero UUID
  90521. // is not supported (00000000-0000-0000-0000-000000000000).
  90522. func (c *NodeGroupsSetAutoscalingPolicyCall) RequestId(requestId string) *NodeGroupsSetAutoscalingPolicyCall {
  90523. c.urlParams_.Set("requestId", requestId)
  90524. return c
  90525. }
  90526. // Fields allows partial responses to be retrieved. See
  90527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90528. // for more information.
  90529. func (c *NodeGroupsSetAutoscalingPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetAutoscalingPolicyCall {
  90530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90531. return c
  90532. }
  90533. // Context sets the context to be used in this call's Do method. Any
  90534. // pending HTTP request will be aborted if the provided context is
  90535. // canceled.
  90536. func (c *NodeGroupsSetAutoscalingPolicyCall) Context(ctx context.Context) *NodeGroupsSetAutoscalingPolicyCall {
  90537. c.ctx_ = ctx
  90538. return c
  90539. }
  90540. // Header returns an http.Header that can be modified by the caller to
  90541. // add HTTP headers to the request.
  90542. func (c *NodeGroupsSetAutoscalingPolicyCall) Header() http.Header {
  90543. if c.header_ == nil {
  90544. c.header_ = make(http.Header)
  90545. }
  90546. return c.header_
  90547. }
  90548. func (c *NodeGroupsSetAutoscalingPolicyCall) doRequest(alt string) (*http.Response, error) {
  90549. reqHeaders := make(http.Header)
  90550. for k, v := range c.header_ {
  90551. reqHeaders[k] = v
  90552. }
  90553. reqHeaders.Set("User-Agent", c.s.userAgent())
  90554. var body io.Reader = nil
  90555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetautoscalingpolicyrequest)
  90556. if err != nil {
  90557. return nil, err
  90558. }
  90559. reqHeaders.Set("Content-Type", "application/json")
  90560. c.urlParams_.Set("alt", alt)
  90561. c.urlParams_.Set("prettyPrint", "false")
  90562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setAutoscalingPolicy")
  90563. urls += "?" + c.urlParams_.Encode()
  90564. req, err := http.NewRequest("POST", urls, body)
  90565. if err != nil {
  90566. return nil, err
  90567. }
  90568. req.Header = reqHeaders
  90569. googleapi.Expand(req.URL, map[string]string{
  90570. "project": c.project,
  90571. "zone": c.zone,
  90572. "nodeGroup": c.nodeGroup,
  90573. })
  90574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90575. }
  90576. // Do executes the "compute.nodeGroups.setAutoscalingPolicy" call.
  90577. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90578. // status code is an error. Response headers are in either
  90579. // *Operation.ServerResponse.Header or (if a response was returned at
  90580. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90581. // to check whether the returned error was because
  90582. // http.StatusNotModified was returned.
  90583. func (c *NodeGroupsSetAutoscalingPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90584. gensupport.SetOptions(c.urlParams_, opts...)
  90585. res, err := c.doRequest("json")
  90586. if res != nil && res.StatusCode == http.StatusNotModified {
  90587. if res.Body != nil {
  90588. res.Body.Close()
  90589. }
  90590. return nil, &googleapi.Error{
  90591. Code: res.StatusCode,
  90592. Header: res.Header,
  90593. }
  90594. }
  90595. if err != nil {
  90596. return nil, err
  90597. }
  90598. defer googleapi.CloseBody(res)
  90599. if err := googleapi.CheckResponse(res); err != nil {
  90600. return nil, err
  90601. }
  90602. ret := &Operation{
  90603. ServerResponse: googleapi.ServerResponse{
  90604. Header: res.Header,
  90605. HTTPStatusCode: res.StatusCode,
  90606. },
  90607. }
  90608. target := &ret
  90609. if err := gensupport.DecodeResponse(target, res); err != nil {
  90610. return nil, err
  90611. }
  90612. return ret, nil
  90613. // {
  90614. // "description": "Sets the autoscaling policy of the node group.",
  90615. // "httpMethod": "POST",
  90616. // "id": "compute.nodeGroups.setAutoscalingPolicy",
  90617. // "parameterOrder": [
  90618. // "project",
  90619. // "zone",
  90620. // "nodeGroup"
  90621. // ],
  90622. // "parameters": {
  90623. // "nodeGroup": {
  90624. // "description": "Name of the NodeGroup resource to update.",
  90625. // "location": "path",
  90626. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90627. // "required": true,
  90628. // "type": "string"
  90629. // },
  90630. // "project": {
  90631. // "description": "Project ID for this request.",
  90632. // "location": "path",
  90633. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90634. // "required": true,
  90635. // "type": "string"
  90636. // },
  90637. // "requestId": {
  90638. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90639. // "location": "query",
  90640. // "type": "string"
  90641. // },
  90642. // "zone": {
  90643. // "description": "The name of the zone for this request.",
  90644. // "location": "path",
  90645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90646. // "required": true,
  90647. // "type": "string"
  90648. // }
  90649. // },
  90650. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setAutoscalingPolicy",
  90651. // "request": {
  90652. // "$ref": "NodeGroupsSetAutoscalingPolicyRequest"
  90653. // },
  90654. // "response": {
  90655. // "$ref": "Operation"
  90656. // },
  90657. // "scopes": [
  90658. // "https://www.googleapis.com/auth/cloud-platform",
  90659. // "https://www.googleapis.com/auth/compute"
  90660. // ]
  90661. // }
  90662. }
  90663. // method id "compute.nodeGroups.setIamPolicy":
  90664. type NodeGroupsSetIamPolicyCall struct {
  90665. s *Service
  90666. project string
  90667. zone string
  90668. resource string
  90669. zonesetpolicyrequest *ZoneSetPolicyRequest
  90670. urlParams_ gensupport.URLParams
  90671. ctx_ context.Context
  90672. header_ http.Header
  90673. }
  90674. // SetIamPolicy: Sets the access control policy on the specified
  90675. // resource. Replaces any existing policy.
  90676. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  90677. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90678. c.project = project
  90679. c.zone = zone
  90680. c.resource = resource
  90681. c.zonesetpolicyrequest = zonesetpolicyrequest
  90682. return c
  90683. }
  90684. // Fields allows partial responses to be retrieved. See
  90685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90686. // for more information.
  90687. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  90688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90689. return c
  90690. }
  90691. // Context sets the context to be used in this call's Do method. Any
  90692. // pending HTTP request will be aborted if the provided context is
  90693. // canceled.
  90694. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  90695. c.ctx_ = ctx
  90696. return c
  90697. }
  90698. // Header returns an http.Header that can be modified by the caller to
  90699. // add HTTP headers to the request.
  90700. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  90701. if c.header_ == nil {
  90702. c.header_ = make(http.Header)
  90703. }
  90704. return c.header_
  90705. }
  90706. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  90707. reqHeaders := make(http.Header)
  90708. for k, v := range c.header_ {
  90709. reqHeaders[k] = v
  90710. }
  90711. reqHeaders.Set("User-Agent", c.s.userAgent())
  90712. var body io.Reader = nil
  90713. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  90714. if err != nil {
  90715. return nil, err
  90716. }
  90717. reqHeaders.Set("Content-Type", "application/json")
  90718. c.urlParams_.Set("alt", alt)
  90719. c.urlParams_.Set("prettyPrint", "false")
  90720. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  90721. urls += "?" + c.urlParams_.Encode()
  90722. req, err := http.NewRequest("POST", urls, body)
  90723. if err != nil {
  90724. return nil, err
  90725. }
  90726. req.Header = reqHeaders
  90727. googleapi.Expand(req.URL, map[string]string{
  90728. "project": c.project,
  90729. "zone": c.zone,
  90730. "resource": c.resource,
  90731. })
  90732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90733. }
  90734. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  90735. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  90736. // code is an error. Response headers are in either
  90737. // *Policy.ServerResponse.Header or (if a response was returned at all)
  90738. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  90739. // check whether the returned error was because http.StatusNotModified
  90740. // was returned.
  90741. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  90742. gensupport.SetOptions(c.urlParams_, opts...)
  90743. res, err := c.doRequest("json")
  90744. if res != nil && res.StatusCode == http.StatusNotModified {
  90745. if res.Body != nil {
  90746. res.Body.Close()
  90747. }
  90748. return nil, &googleapi.Error{
  90749. Code: res.StatusCode,
  90750. Header: res.Header,
  90751. }
  90752. }
  90753. if err != nil {
  90754. return nil, err
  90755. }
  90756. defer googleapi.CloseBody(res)
  90757. if err := googleapi.CheckResponse(res); err != nil {
  90758. return nil, err
  90759. }
  90760. ret := &Policy{
  90761. ServerResponse: googleapi.ServerResponse{
  90762. Header: res.Header,
  90763. HTTPStatusCode: res.StatusCode,
  90764. },
  90765. }
  90766. target := &ret
  90767. if err := gensupport.DecodeResponse(target, res); err != nil {
  90768. return nil, err
  90769. }
  90770. return ret, nil
  90771. // {
  90772. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  90773. // "httpMethod": "POST",
  90774. // "id": "compute.nodeGroups.setIamPolicy",
  90775. // "parameterOrder": [
  90776. // "project",
  90777. // "zone",
  90778. // "resource"
  90779. // ],
  90780. // "parameters": {
  90781. // "project": {
  90782. // "description": "Project ID for this request.",
  90783. // "location": "path",
  90784. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90785. // "required": true,
  90786. // "type": "string"
  90787. // },
  90788. // "resource": {
  90789. // "description": "Name or id of the resource for this request.",
  90790. // "location": "path",
  90791. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90792. // "required": true,
  90793. // "type": "string"
  90794. // },
  90795. // "zone": {
  90796. // "description": "The name of the zone for this request.",
  90797. // "location": "path",
  90798. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90799. // "required": true,
  90800. // "type": "string"
  90801. // }
  90802. // },
  90803. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  90804. // "request": {
  90805. // "$ref": "ZoneSetPolicyRequest"
  90806. // },
  90807. // "response": {
  90808. // "$ref": "Policy"
  90809. // },
  90810. // "scopes": [
  90811. // "https://www.googleapis.com/auth/cloud-platform",
  90812. // "https://www.googleapis.com/auth/compute"
  90813. // ]
  90814. // }
  90815. }
  90816. // method id "compute.nodeGroups.setNodeTemplate":
  90817. type NodeGroupsSetNodeTemplateCall struct {
  90818. s *Service
  90819. project string
  90820. zone string
  90821. nodeGroup string
  90822. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  90823. urlParams_ gensupport.URLParams
  90824. ctx_ context.Context
  90825. header_ http.Header
  90826. }
  90827. // SetNodeTemplate: Updates the node template of the node group.
  90828. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  90829. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90830. c.project = project
  90831. c.zone = zone
  90832. c.nodeGroup = nodeGroup
  90833. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  90834. return c
  90835. }
  90836. // RequestId sets the optional parameter "requestId": An optional
  90837. // request ID to identify requests. Specify a unique request ID so that
  90838. // if you must retry your request, the server will know to ignore the
  90839. // request if it has already been completed.
  90840. //
  90841. // For example, consider a situation where you make an initial request
  90842. // and the request times out. If you make the request again with the
  90843. // same request ID, the server can check if original operation with the
  90844. // same request ID was received, and if so, will ignore the second
  90845. // request. This prevents clients from accidentally creating duplicate
  90846. // commitments.
  90847. //
  90848. // The request ID must be a valid UUID with the exception that zero UUID
  90849. // is not supported (00000000-0000-0000-0000-000000000000).
  90850. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  90851. c.urlParams_.Set("requestId", requestId)
  90852. return c
  90853. }
  90854. // Fields allows partial responses to be retrieved. See
  90855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90856. // for more information.
  90857. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  90858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90859. return c
  90860. }
  90861. // Context sets the context to be used in this call's Do method. Any
  90862. // pending HTTP request will be aborted if the provided context is
  90863. // canceled.
  90864. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  90865. c.ctx_ = ctx
  90866. return c
  90867. }
  90868. // Header returns an http.Header that can be modified by the caller to
  90869. // add HTTP headers to the request.
  90870. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  90871. if c.header_ == nil {
  90872. c.header_ = make(http.Header)
  90873. }
  90874. return c.header_
  90875. }
  90876. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  90877. reqHeaders := make(http.Header)
  90878. for k, v := range c.header_ {
  90879. reqHeaders[k] = v
  90880. }
  90881. reqHeaders.Set("User-Agent", c.s.userAgent())
  90882. var body io.Reader = nil
  90883. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  90884. if err != nil {
  90885. return nil, err
  90886. }
  90887. reqHeaders.Set("Content-Type", "application/json")
  90888. c.urlParams_.Set("alt", alt)
  90889. c.urlParams_.Set("prettyPrint", "false")
  90890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  90891. urls += "?" + c.urlParams_.Encode()
  90892. req, err := http.NewRequest("POST", urls, body)
  90893. if err != nil {
  90894. return nil, err
  90895. }
  90896. req.Header = reqHeaders
  90897. googleapi.Expand(req.URL, map[string]string{
  90898. "project": c.project,
  90899. "zone": c.zone,
  90900. "nodeGroup": c.nodeGroup,
  90901. })
  90902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90903. }
  90904. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  90905. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90906. // status code is an error. Response headers are in either
  90907. // *Operation.ServerResponse.Header or (if a response was returned at
  90908. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90909. // to check whether the returned error was because
  90910. // http.StatusNotModified was returned.
  90911. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90912. gensupport.SetOptions(c.urlParams_, opts...)
  90913. res, err := c.doRequest("json")
  90914. if res != nil && res.StatusCode == http.StatusNotModified {
  90915. if res.Body != nil {
  90916. res.Body.Close()
  90917. }
  90918. return nil, &googleapi.Error{
  90919. Code: res.StatusCode,
  90920. Header: res.Header,
  90921. }
  90922. }
  90923. if err != nil {
  90924. return nil, err
  90925. }
  90926. defer googleapi.CloseBody(res)
  90927. if err := googleapi.CheckResponse(res); err != nil {
  90928. return nil, err
  90929. }
  90930. ret := &Operation{
  90931. ServerResponse: googleapi.ServerResponse{
  90932. Header: res.Header,
  90933. HTTPStatusCode: res.StatusCode,
  90934. },
  90935. }
  90936. target := &ret
  90937. if err := gensupport.DecodeResponse(target, res); err != nil {
  90938. return nil, err
  90939. }
  90940. return ret, nil
  90941. // {
  90942. // "description": "Updates the node template of the node group.",
  90943. // "httpMethod": "POST",
  90944. // "id": "compute.nodeGroups.setNodeTemplate",
  90945. // "parameterOrder": [
  90946. // "project",
  90947. // "zone",
  90948. // "nodeGroup"
  90949. // ],
  90950. // "parameters": {
  90951. // "nodeGroup": {
  90952. // "description": "Name of the NodeGroup resource to update.",
  90953. // "location": "path",
  90954. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90955. // "required": true,
  90956. // "type": "string"
  90957. // },
  90958. // "project": {
  90959. // "description": "Project ID for this request.",
  90960. // "location": "path",
  90961. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90962. // "required": true,
  90963. // "type": "string"
  90964. // },
  90965. // "requestId": {
  90966. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90967. // "location": "query",
  90968. // "type": "string"
  90969. // },
  90970. // "zone": {
  90971. // "description": "The name of the zone for this request.",
  90972. // "location": "path",
  90973. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90974. // "required": true,
  90975. // "type": "string"
  90976. // }
  90977. // },
  90978. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  90979. // "request": {
  90980. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  90981. // },
  90982. // "response": {
  90983. // "$ref": "Operation"
  90984. // },
  90985. // "scopes": [
  90986. // "https://www.googleapis.com/auth/cloud-platform",
  90987. // "https://www.googleapis.com/auth/compute"
  90988. // ]
  90989. // }
  90990. }
  90991. // method id "compute.nodeGroups.testIamPermissions":
  90992. type NodeGroupsTestIamPermissionsCall struct {
  90993. s *Service
  90994. project string
  90995. zone string
  90996. resource string
  90997. testpermissionsrequest *TestPermissionsRequest
  90998. urlParams_ gensupport.URLParams
  90999. ctx_ context.Context
  91000. header_ http.Header
  91001. }
  91002. // TestIamPermissions: Returns permissions that a caller has on the
  91003. // specified resource.
  91004. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  91005. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91006. c.project = project
  91007. c.zone = zone
  91008. c.resource = resource
  91009. c.testpermissionsrequest = testpermissionsrequest
  91010. return c
  91011. }
  91012. // Fields allows partial responses to be retrieved. See
  91013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91014. // for more information.
  91015. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  91016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91017. return c
  91018. }
  91019. // Context sets the context to be used in this call's Do method. Any
  91020. // pending HTTP request will be aborted if the provided context is
  91021. // canceled.
  91022. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  91023. c.ctx_ = ctx
  91024. return c
  91025. }
  91026. // Header returns an http.Header that can be modified by the caller to
  91027. // add HTTP headers to the request.
  91028. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  91029. if c.header_ == nil {
  91030. c.header_ = make(http.Header)
  91031. }
  91032. return c.header_
  91033. }
  91034. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  91035. reqHeaders := make(http.Header)
  91036. for k, v := range c.header_ {
  91037. reqHeaders[k] = v
  91038. }
  91039. reqHeaders.Set("User-Agent", c.s.userAgent())
  91040. var body io.Reader = nil
  91041. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  91042. if err != nil {
  91043. return nil, err
  91044. }
  91045. reqHeaders.Set("Content-Type", "application/json")
  91046. c.urlParams_.Set("alt", alt)
  91047. c.urlParams_.Set("prettyPrint", "false")
  91048. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  91049. urls += "?" + c.urlParams_.Encode()
  91050. req, err := http.NewRequest("POST", urls, body)
  91051. if err != nil {
  91052. return nil, err
  91053. }
  91054. req.Header = reqHeaders
  91055. googleapi.Expand(req.URL, map[string]string{
  91056. "project": c.project,
  91057. "zone": c.zone,
  91058. "resource": c.resource,
  91059. })
  91060. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91061. }
  91062. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  91063. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  91064. // non-2xx status code is an error. Response headers are in either
  91065. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  91066. // returned at all) in error.(*googleapi.Error).Header. Use
  91067. // googleapi.IsNotModified to check whether the returned error was
  91068. // because http.StatusNotModified was returned.
  91069. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  91070. gensupport.SetOptions(c.urlParams_, opts...)
  91071. res, err := c.doRequest("json")
  91072. if res != nil && res.StatusCode == http.StatusNotModified {
  91073. if res.Body != nil {
  91074. res.Body.Close()
  91075. }
  91076. return nil, &googleapi.Error{
  91077. Code: res.StatusCode,
  91078. Header: res.Header,
  91079. }
  91080. }
  91081. if err != nil {
  91082. return nil, err
  91083. }
  91084. defer googleapi.CloseBody(res)
  91085. if err := googleapi.CheckResponse(res); err != nil {
  91086. return nil, err
  91087. }
  91088. ret := &TestPermissionsResponse{
  91089. ServerResponse: googleapi.ServerResponse{
  91090. Header: res.Header,
  91091. HTTPStatusCode: res.StatusCode,
  91092. },
  91093. }
  91094. target := &ret
  91095. if err := gensupport.DecodeResponse(target, res); err != nil {
  91096. return nil, err
  91097. }
  91098. return ret, nil
  91099. // {
  91100. // "description": "Returns permissions that a caller has on the specified resource.",
  91101. // "httpMethod": "POST",
  91102. // "id": "compute.nodeGroups.testIamPermissions",
  91103. // "parameterOrder": [
  91104. // "project",
  91105. // "zone",
  91106. // "resource"
  91107. // ],
  91108. // "parameters": {
  91109. // "project": {
  91110. // "description": "Project ID for this request.",
  91111. // "location": "path",
  91112. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91113. // "required": true,
  91114. // "type": "string"
  91115. // },
  91116. // "resource": {
  91117. // "description": "Name or id of the resource for this request.",
  91118. // "location": "path",
  91119. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91120. // "required": true,
  91121. // "type": "string"
  91122. // },
  91123. // "zone": {
  91124. // "description": "The name of the zone for this request.",
  91125. // "location": "path",
  91126. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91127. // "required": true,
  91128. // "type": "string"
  91129. // }
  91130. // },
  91131. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  91132. // "request": {
  91133. // "$ref": "TestPermissionsRequest"
  91134. // },
  91135. // "response": {
  91136. // "$ref": "TestPermissionsResponse"
  91137. // },
  91138. // "scopes": [
  91139. // "https://www.googleapis.com/auth/cloud-platform",
  91140. // "https://www.googleapis.com/auth/compute",
  91141. // "https://www.googleapis.com/auth/compute.readonly"
  91142. // ]
  91143. // }
  91144. }
  91145. // method id "compute.nodeTemplates.aggregatedList":
  91146. type NodeTemplatesAggregatedListCall struct {
  91147. s *Service
  91148. project string
  91149. urlParams_ gensupport.URLParams
  91150. ifNoneMatch_ string
  91151. ctx_ context.Context
  91152. header_ http.Header
  91153. }
  91154. // AggregatedList: Retrieves an aggregated list of node templates.
  91155. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  91156. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91157. c.project = project
  91158. return c
  91159. }
  91160. // Filter sets the optional parameter "filter": A filter expression that
  91161. // filters resources listed in the response. The expression must specify
  91162. // the field name, a comparison operator, and the value that you want to
  91163. // use for filtering. The value must be a string, a number, or a
  91164. // boolean. The comparison operator must be either =, !=, >, or <.
  91165. //
  91166. // For example, if you are filtering Compute Engine instances, you can
  91167. // exclude instances named example-instance by specifying name !=
  91168. // example-instance.
  91169. //
  91170. // You can also filter nested fields. For example, you could specify
  91171. // scheduling.automaticRestart = false to include instances only if they
  91172. // are not scheduled for automatic restarts. You can use filtering on
  91173. // nested fields to filter based on resource labels.
  91174. //
  91175. // To filter on multiple expressions, provide each separate expression
  91176. // within parentheses. For example, (scheduling.automaticRestart = true)
  91177. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91178. // AND expression. However, you can include AND and OR expressions
  91179. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91180. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91181. // true).
  91182. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  91183. c.urlParams_.Set("filter", filter)
  91184. return c
  91185. }
  91186. // MaxResults sets the optional parameter "maxResults": The maximum
  91187. // number of results per page that should be returned. If the number of
  91188. // available results is larger than maxResults, Compute Engine returns a
  91189. // nextPageToken that can be used to get the next page of results in
  91190. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91191. // (Default: 500)
  91192. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  91193. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91194. return c
  91195. }
  91196. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91197. // a certain order. By default, results are returned in alphanumerical
  91198. // order based on the resource name.
  91199. //
  91200. // You can also sort results in descending order based on the creation
  91201. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91202. // based on the creationTimestamp field in reverse chronological order
  91203. // (newest result first). Use this to sort resources like operations so
  91204. // that the newest operation is returned first.
  91205. //
  91206. // Currently, only sorting by name or creationTimestamp desc is
  91207. // supported.
  91208. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  91209. c.urlParams_.Set("orderBy", orderBy)
  91210. return c
  91211. }
  91212. // PageToken sets the optional parameter "pageToken": Specifies a page
  91213. // token to use. Set pageToken to the nextPageToken returned by a
  91214. // previous list request to get the next page of results.
  91215. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  91216. c.urlParams_.Set("pageToken", pageToken)
  91217. return c
  91218. }
  91219. // Fields allows partial responses to be retrieved. See
  91220. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91221. // for more information.
  91222. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  91223. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91224. return c
  91225. }
  91226. // IfNoneMatch sets the optional parameter which makes the operation
  91227. // fail if the object's ETag matches the given value. This is useful for
  91228. // getting updates only after the object has changed since the last
  91229. // request. Use googleapi.IsNotModified to check whether the response
  91230. // error from Do is the result of In-None-Match.
  91231. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  91232. c.ifNoneMatch_ = entityTag
  91233. return c
  91234. }
  91235. // Context sets the context to be used in this call's Do method. Any
  91236. // pending HTTP request will be aborted if the provided context is
  91237. // canceled.
  91238. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  91239. c.ctx_ = ctx
  91240. return c
  91241. }
  91242. // Header returns an http.Header that can be modified by the caller to
  91243. // add HTTP headers to the request.
  91244. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  91245. if c.header_ == nil {
  91246. c.header_ = make(http.Header)
  91247. }
  91248. return c.header_
  91249. }
  91250. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  91251. reqHeaders := make(http.Header)
  91252. for k, v := range c.header_ {
  91253. reqHeaders[k] = v
  91254. }
  91255. reqHeaders.Set("User-Agent", c.s.userAgent())
  91256. if c.ifNoneMatch_ != "" {
  91257. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91258. }
  91259. var body io.Reader = nil
  91260. c.urlParams_.Set("alt", alt)
  91261. c.urlParams_.Set("prettyPrint", "false")
  91262. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  91263. urls += "?" + c.urlParams_.Encode()
  91264. req, err := http.NewRequest("GET", urls, body)
  91265. if err != nil {
  91266. return nil, err
  91267. }
  91268. req.Header = reqHeaders
  91269. googleapi.Expand(req.URL, map[string]string{
  91270. "project": c.project,
  91271. })
  91272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91273. }
  91274. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  91275. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  91276. // Any non-2xx status code is an error. Response headers are in either
  91277. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  91278. // was returned at all) in error.(*googleapi.Error).Header. Use
  91279. // googleapi.IsNotModified to check whether the returned error was
  91280. // because http.StatusNotModified was returned.
  91281. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  91282. gensupport.SetOptions(c.urlParams_, opts...)
  91283. res, err := c.doRequest("json")
  91284. if res != nil && res.StatusCode == http.StatusNotModified {
  91285. if res.Body != nil {
  91286. res.Body.Close()
  91287. }
  91288. return nil, &googleapi.Error{
  91289. Code: res.StatusCode,
  91290. Header: res.Header,
  91291. }
  91292. }
  91293. if err != nil {
  91294. return nil, err
  91295. }
  91296. defer googleapi.CloseBody(res)
  91297. if err := googleapi.CheckResponse(res); err != nil {
  91298. return nil, err
  91299. }
  91300. ret := &NodeTemplateAggregatedList{
  91301. ServerResponse: googleapi.ServerResponse{
  91302. Header: res.Header,
  91303. HTTPStatusCode: res.StatusCode,
  91304. },
  91305. }
  91306. target := &ret
  91307. if err := gensupport.DecodeResponse(target, res); err != nil {
  91308. return nil, err
  91309. }
  91310. return ret, nil
  91311. // {
  91312. // "description": "Retrieves an aggregated list of node templates.",
  91313. // "httpMethod": "GET",
  91314. // "id": "compute.nodeTemplates.aggregatedList",
  91315. // "parameterOrder": [
  91316. // "project"
  91317. // ],
  91318. // "parameters": {
  91319. // "filter": {
  91320. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  91321. // "location": "query",
  91322. // "type": "string"
  91323. // },
  91324. // "maxResults": {
  91325. // "default": "500",
  91326. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  91327. // "format": "uint32",
  91328. // "location": "query",
  91329. // "minimum": "0",
  91330. // "type": "integer"
  91331. // },
  91332. // "orderBy": {
  91333. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  91334. // "location": "query",
  91335. // "type": "string"
  91336. // },
  91337. // "pageToken": {
  91338. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  91339. // "location": "query",
  91340. // "type": "string"
  91341. // },
  91342. // "project": {
  91343. // "description": "Project ID for this request.",
  91344. // "location": "path",
  91345. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91346. // "required": true,
  91347. // "type": "string"
  91348. // }
  91349. // },
  91350. // "path": "{project}/aggregated/nodeTemplates",
  91351. // "response": {
  91352. // "$ref": "NodeTemplateAggregatedList"
  91353. // },
  91354. // "scopes": [
  91355. // "https://www.googleapis.com/auth/cloud-platform",
  91356. // "https://www.googleapis.com/auth/compute",
  91357. // "https://www.googleapis.com/auth/compute.readonly"
  91358. // ]
  91359. // }
  91360. }
  91361. // Pages invokes f for each page of results.
  91362. // A non-nil error returned from f will halt the iteration.
  91363. // The provided context supersedes any context provided to the Context method.
  91364. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  91365. c.ctx_ = ctx
  91366. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91367. for {
  91368. x, err := c.Do()
  91369. if err != nil {
  91370. return err
  91371. }
  91372. if err := f(x); err != nil {
  91373. return err
  91374. }
  91375. if x.NextPageToken == "" {
  91376. return nil
  91377. }
  91378. c.PageToken(x.NextPageToken)
  91379. }
  91380. }
  91381. // method id "compute.nodeTemplates.delete":
  91382. type NodeTemplatesDeleteCall struct {
  91383. s *Service
  91384. project string
  91385. region string
  91386. nodeTemplate string
  91387. urlParams_ gensupport.URLParams
  91388. ctx_ context.Context
  91389. header_ http.Header
  91390. }
  91391. // Delete: Deletes the specified NodeTemplate resource.
  91392. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  91393. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91394. c.project = project
  91395. c.region = region
  91396. c.nodeTemplate = nodeTemplate
  91397. return c
  91398. }
  91399. // RequestId sets the optional parameter "requestId": An optional
  91400. // request ID to identify requests. Specify a unique request ID so that
  91401. // if you must retry your request, the server will know to ignore the
  91402. // request if it has already been completed.
  91403. //
  91404. // For example, consider a situation where you make an initial request
  91405. // and the request times out. If you make the request again with the
  91406. // same request ID, the server can check if original operation with the
  91407. // same request ID was received, and if so, will ignore the second
  91408. // request. This prevents clients from accidentally creating duplicate
  91409. // commitments.
  91410. //
  91411. // The request ID must be a valid UUID with the exception that zero UUID
  91412. // is not supported (00000000-0000-0000-0000-000000000000).
  91413. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  91414. c.urlParams_.Set("requestId", requestId)
  91415. return c
  91416. }
  91417. // Fields allows partial responses to be retrieved. See
  91418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91419. // for more information.
  91420. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  91421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91422. return c
  91423. }
  91424. // Context sets the context to be used in this call's Do method. Any
  91425. // pending HTTP request will be aborted if the provided context is
  91426. // canceled.
  91427. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  91428. c.ctx_ = ctx
  91429. return c
  91430. }
  91431. // Header returns an http.Header that can be modified by the caller to
  91432. // add HTTP headers to the request.
  91433. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  91434. if c.header_ == nil {
  91435. c.header_ = make(http.Header)
  91436. }
  91437. return c.header_
  91438. }
  91439. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  91440. reqHeaders := make(http.Header)
  91441. for k, v := range c.header_ {
  91442. reqHeaders[k] = v
  91443. }
  91444. reqHeaders.Set("User-Agent", c.s.userAgent())
  91445. var body io.Reader = nil
  91446. c.urlParams_.Set("alt", alt)
  91447. c.urlParams_.Set("prettyPrint", "false")
  91448. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  91449. urls += "?" + c.urlParams_.Encode()
  91450. req, err := http.NewRequest("DELETE", urls, body)
  91451. if err != nil {
  91452. return nil, err
  91453. }
  91454. req.Header = reqHeaders
  91455. googleapi.Expand(req.URL, map[string]string{
  91456. "project": c.project,
  91457. "region": c.region,
  91458. "nodeTemplate": c.nodeTemplate,
  91459. })
  91460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91461. }
  91462. // Do executes the "compute.nodeTemplates.delete" call.
  91463. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91464. // status code is an error. Response headers are in either
  91465. // *Operation.ServerResponse.Header or (if a response was returned at
  91466. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91467. // to check whether the returned error was because
  91468. // http.StatusNotModified was returned.
  91469. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91470. gensupport.SetOptions(c.urlParams_, opts...)
  91471. res, err := c.doRequest("json")
  91472. if res != nil && res.StatusCode == http.StatusNotModified {
  91473. if res.Body != nil {
  91474. res.Body.Close()
  91475. }
  91476. return nil, &googleapi.Error{
  91477. Code: res.StatusCode,
  91478. Header: res.Header,
  91479. }
  91480. }
  91481. if err != nil {
  91482. return nil, err
  91483. }
  91484. defer googleapi.CloseBody(res)
  91485. if err := googleapi.CheckResponse(res); err != nil {
  91486. return nil, err
  91487. }
  91488. ret := &Operation{
  91489. ServerResponse: googleapi.ServerResponse{
  91490. Header: res.Header,
  91491. HTTPStatusCode: res.StatusCode,
  91492. },
  91493. }
  91494. target := &ret
  91495. if err := gensupport.DecodeResponse(target, res); err != nil {
  91496. return nil, err
  91497. }
  91498. return ret, nil
  91499. // {
  91500. // "description": "Deletes the specified NodeTemplate resource.",
  91501. // "httpMethod": "DELETE",
  91502. // "id": "compute.nodeTemplates.delete",
  91503. // "parameterOrder": [
  91504. // "project",
  91505. // "region",
  91506. // "nodeTemplate"
  91507. // ],
  91508. // "parameters": {
  91509. // "nodeTemplate": {
  91510. // "description": "Name of the NodeTemplate resource to delete.",
  91511. // "location": "path",
  91512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91513. // "required": true,
  91514. // "type": "string"
  91515. // },
  91516. // "project": {
  91517. // "description": "Project ID for this request.",
  91518. // "location": "path",
  91519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91520. // "required": true,
  91521. // "type": "string"
  91522. // },
  91523. // "region": {
  91524. // "description": "The name of the region for this request.",
  91525. // "location": "path",
  91526. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91527. // "required": true,
  91528. // "type": "string"
  91529. // },
  91530. // "requestId": {
  91531. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91532. // "location": "query",
  91533. // "type": "string"
  91534. // }
  91535. // },
  91536. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  91537. // "response": {
  91538. // "$ref": "Operation"
  91539. // },
  91540. // "scopes": [
  91541. // "https://www.googleapis.com/auth/cloud-platform",
  91542. // "https://www.googleapis.com/auth/compute"
  91543. // ]
  91544. // }
  91545. }
  91546. // method id "compute.nodeTemplates.get":
  91547. type NodeTemplatesGetCall struct {
  91548. s *Service
  91549. project string
  91550. region string
  91551. nodeTemplate string
  91552. urlParams_ gensupport.URLParams
  91553. ifNoneMatch_ string
  91554. ctx_ context.Context
  91555. header_ http.Header
  91556. }
  91557. // Get: Returns the specified node template. Gets a list of available
  91558. // node templates by making a list() request.
  91559. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  91560. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91561. c.project = project
  91562. c.region = region
  91563. c.nodeTemplate = nodeTemplate
  91564. return c
  91565. }
  91566. // Fields allows partial responses to be retrieved. See
  91567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91568. // for more information.
  91569. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  91570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91571. return c
  91572. }
  91573. // IfNoneMatch sets the optional parameter which makes the operation
  91574. // fail if the object's ETag matches the given value. This is useful for
  91575. // getting updates only after the object has changed since the last
  91576. // request. Use googleapi.IsNotModified to check whether the response
  91577. // error from Do is the result of In-None-Match.
  91578. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  91579. c.ifNoneMatch_ = entityTag
  91580. return c
  91581. }
  91582. // Context sets the context to be used in this call's Do method. Any
  91583. // pending HTTP request will be aborted if the provided context is
  91584. // canceled.
  91585. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  91586. c.ctx_ = ctx
  91587. return c
  91588. }
  91589. // Header returns an http.Header that can be modified by the caller to
  91590. // add HTTP headers to the request.
  91591. func (c *NodeTemplatesGetCall) Header() http.Header {
  91592. if c.header_ == nil {
  91593. c.header_ = make(http.Header)
  91594. }
  91595. return c.header_
  91596. }
  91597. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  91598. reqHeaders := make(http.Header)
  91599. for k, v := range c.header_ {
  91600. reqHeaders[k] = v
  91601. }
  91602. reqHeaders.Set("User-Agent", c.s.userAgent())
  91603. if c.ifNoneMatch_ != "" {
  91604. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91605. }
  91606. var body io.Reader = nil
  91607. c.urlParams_.Set("alt", alt)
  91608. c.urlParams_.Set("prettyPrint", "false")
  91609. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  91610. urls += "?" + c.urlParams_.Encode()
  91611. req, err := http.NewRequest("GET", urls, body)
  91612. if err != nil {
  91613. return nil, err
  91614. }
  91615. req.Header = reqHeaders
  91616. googleapi.Expand(req.URL, map[string]string{
  91617. "project": c.project,
  91618. "region": c.region,
  91619. "nodeTemplate": c.nodeTemplate,
  91620. })
  91621. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91622. }
  91623. // Do executes the "compute.nodeTemplates.get" call.
  91624. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  91625. // status code is an error. Response headers are in either
  91626. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  91627. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91628. // to check whether the returned error was because
  91629. // http.StatusNotModified was returned.
  91630. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  91631. gensupport.SetOptions(c.urlParams_, opts...)
  91632. res, err := c.doRequest("json")
  91633. if res != nil && res.StatusCode == http.StatusNotModified {
  91634. if res.Body != nil {
  91635. res.Body.Close()
  91636. }
  91637. return nil, &googleapi.Error{
  91638. Code: res.StatusCode,
  91639. Header: res.Header,
  91640. }
  91641. }
  91642. if err != nil {
  91643. return nil, err
  91644. }
  91645. defer googleapi.CloseBody(res)
  91646. if err := googleapi.CheckResponse(res); err != nil {
  91647. return nil, err
  91648. }
  91649. ret := &NodeTemplate{
  91650. ServerResponse: googleapi.ServerResponse{
  91651. Header: res.Header,
  91652. HTTPStatusCode: res.StatusCode,
  91653. },
  91654. }
  91655. target := &ret
  91656. if err := gensupport.DecodeResponse(target, res); err != nil {
  91657. return nil, err
  91658. }
  91659. return ret, nil
  91660. // {
  91661. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  91662. // "httpMethod": "GET",
  91663. // "id": "compute.nodeTemplates.get",
  91664. // "parameterOrder": [
  91665. // "project",
  91666. // "region",
  91667. // "nodeTemplate"
  91668. // ],
  91669. // "parameters": {
  91670. // "nodeTemplate": {
  91671. // "description": "Name of the node template to return.",
  91672. // "location": "path",
  91673. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91674. // "required": true,
  91675. // "type": "string"
  91676. // },
  91677. // "project": {
  91678. // "description": "Project ID for this request.",
  91679. // "location": "path",
  91680. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91681. // "required": true,
  91682. // "type": "string"
  91683. // },
  91684. // "region": {
  91685. // "description": "The name of the region for this request.",
  91686. // "location": "path",
  91687. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91688. // "required": true,
  91689. // "type": "string"
  91690. // }
  91691. // },
  91692. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  91693. // "response": {
  91694. // "$ref": "NodeTemplate"
  91695. // },
  91696. // "scopes": [
  91697. // "https://www.googleapis.com/auth/cloud-platform",
  91698. // "https://www.googleapis.com/auth/compute",
  91699. // "https://www.googleapis.com/auth/compute.readonly"
  91700. // ]
  91701. // }
  91702. }
  91703. // method id "compute.nodeTemplates.getIamPolicy":
  91704. type NodeTemplatesGetIamPolicyCall struct {
  91705. s *Service
  91706. project string
  91707. region string
  91708. resource string
  91709. urlParams_ gensupport.URLParams
  91710. ifNoneMatch_ string
  91711. ctx_ context.Context
  91712. header_ http.Header
  91713. }
  91714. // GetIamPolicy: Gets the access control policy for a resource. May be
  91715. // empty if no such policy or resource exists.
  91716. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  91717. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91718. c.project = project
  91719. c.region = region
  91720. c.resource = resource
  91721. return c
  91722. }
  91723. // Fields allows partial responses to be retrieved. See
  91724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91725. // for more information.
  91726. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  91727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91728. return c
  91729. }
  91730. // IfNoneMatch sets the optional parameter which makes the operation
  91731. // fail if the object's ETag matches the given value. This is useful for
  91732. // getting updates only after the object has changed since the last
  91733. // request. Use googleapi.IsNotModified to check whether the response
  91734. // error from Do is the result of In-None-Match.
  91735. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  91736. c.ifNoneMatch_ = entityTag
  91737. return c
  91738. }
  91739. // Context sets the context to be used in this call's Do method. Any
  91740. // pending HTTP request will be aborted if the provided context is
  91741. // canceled.
  91742. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  91743. c.ctx_ = ctx
  91744. return c
  91745. }
  91746. // Header returns an http.Header that can be modified by the caller to
  91747. // add HTTP headers to the request.
  91748. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  91749. if c.header_ == nil {
  91750. c.header_ = make(http.Header)
  91751. }
  91752. return c.header_
  91753. }
  91754. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  91755. reqHeaders := make(http.Header)
  91756. for k, v := range c.header_ {
  91757. reqHeaders[k] = v
  91758. }
  91759. reqHeaders.Set("User-Agent", c.s.userAgent())
  91760. if c.ifNoneMatch_ != "" {
  91761. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91762. }
  91763. var body io.Reader = nil
  91764. c.urlParams_.Set("alt", alt)
  91765. c.urlParams_.Set("prettyPrint", "false")
  91766. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  91767. urls += "?" + c.urlParams_.Encode()
  91768. req, err := http.NewRequest("GET", urls, body)
  91769. if err != nil {
  91770. return nil, err
  91771. }
  91772. req.Header = reqHeaders
  91773. googleapi.Expand(req.URL, map[string]string{
  91774. "project": c.project,
  91775. "region": c.region,
  91776. "resource": c.resource,
  91777. })
  91778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91779. }
  91780. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  91781. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  91782. // code is an error. Response headers are in either
  91783. // *Policy.ServerResponse.Header or (if a response was returned at all)
  91784. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  91785. // check whether the returned error was because http.StatusNotModified
  91786. // was returned.
  91787. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  91788. gensupport.SetOptions(c.urlParams_, opts...)
  91789. res, err := c.doRequest("json")
  91790. if res != nil && res.StatusCode == http.StatusNotModified {
  91791. if res.Body != nil {
  91792. res.Body.Close()
  91793. }
  91794. return nil, &googleapi.Error{
  91795. Code: res.StatusCode,
  91796. Header: res.Header,
  91797. }
  91798. }
  91799. if err != nil {
  91800. return nil, err
  91801. }
  91802. defer googleapi.CloseBody(res)
  91803. if err := googleapi.CheckResponse(res); err != nil {
  91804. return nil, err
  91805. }
  91806. ret := &Policy{
  91807. ServerResponse: googleapi.ServerResponse{
  91808. Header: res.Header,
  91809. HTTPStatusCode: res.StatusCode,
  91810. },
  91811. }
  91812. target := &ret
  91813. if err := gensupport.DecodeResponse(target, res); err != nil {
  91814. return nil, err
  91815. }
  91816. return ret, nil
  91817. // {
  91818. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  91819. // "httpMethod": "GET",
  91820. // "id": "compute.nodeTemplates.getIamPolicy",
  91821. // "parameterOrder": [
  91822. // "project",
  91823. // "region",
  91824. // "resource"
  91825. // ],
  91826. // "parameters": {
  91827. // "project": {
  91828. // "description": "Project ID for this request.",
  91829. // "location": "path",
  91830. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91831. // "required": true,
  91832. // "type": "string"
  91833. // },
  91834. // "region": {
  91835. // "description": "The name of the region for this request.",
  91836. // "location": "path",
  91837. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91838. // "required": true,
  91839. // "type": "string"
  91840. // },
  91841. // "resource": {
  91842. // "description": "Name or id of the resource for this request.",
  91843. // "location": "path",
  91844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91845. // "required": true,
  91846. // "type": "string"
  91847. // }
  91848. // },
  91849. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  91850. // "response": {
  91851. // "$ref": "Policy"
  91852. // },
  91853. // "scopes": [
  91854. // "https://www.googleapis.com/auth/cloud-platform",
  91855. // "https://www.googleapis.com/auth/compute",
  91856. // "https://www.googleapis.com/auth/compute.readonly"
  91857. // ]
  91858. // }
  91859. }
  91860. // method id "compute.nodeTemplates.insert":
  91861. type NodeTemplatesInsertCall struct {
  91862. s *Service
  91863. project string
  91864. region string
  91865. nodetemplate *NodeTemplate
  91866. urlParams_ gensupport.URLParams
  91867. ctx_ context.Context
  91868. header_ http.Header
  91869. }
  91870. // Insert: Creates a NodeTemplate resource in the specified project
  91871. // using the data included in the request.
  91872. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  91873. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91874. c.project = project
  91875. c.region = region
  91876. c.nodetemplate = nodetemplate
  91877. return c
  91878. }
  91879. // RequestId sets the optional parameter "requestId": An optional
  91880. // request ID to identify requests. Specify a unique request ID so that
  91881. // if you must retry your request, the server will know to ignore the
  91882. // request if it has already been completed.
  91883. //
  91884. // For example, consider a situation where you make an initial request
  91885. // and the request times out. If you make the request again with the
  91886. // same request ID, the server can check if original operation with the
  91887. // same request ID was received, and if so, will ignore the second
  91888. // request. This prevents clients from accidentally creating duplicate
  91889. // commitments.
  91890. //
  91891. // The request ID must be a valid UUID with the exception that zero UUID
  91892. // is not supported (00000000-0000-0000-0000-000000000000).
  91893. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  91894. c.urlParams_.Set("requestId", requestId)
  91895. return c
  91896. }
  91897. // Fields allows partial responses to be retrieved. See
  91898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91899. // for more information.
  91900. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  91901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91902. return c
  91903. }
  91904. // Context sets the context to be used in this call's Do method. Any
  91905. // pending HTTP request will be aborted if the provided context is
  91906. // canceled.
  91907. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  91908. c.ctx_ = ctx
  91909. return c
  91910. }
  91911. // Header returns an http.Header that can be modified by the caller to
  91912. // add HTTP headers to the request.
  91913. func (c *NodeTemplatesInsertCall) Header() http.Header {
  91914. if c.header_ == nil {
  91915. c.header_ = make(http.Header)
  91916. }
  91917. return c.header_
  91918. }
  91919. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  91920. reqHeaders := make(http.Header)
  91921. for k, v := range c.header_ {
  91922. reqHeaders[k] = v
  91923. }
  91924. reqHeaders.Set("User-Agent", c.s.userAgent())
  91925. var body io.Reader = nil
  91926. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  91927. if err != nil {
  91928. return nil, err
  91929. }
  91930. reqHeaders.Set("Content-Type", "application/json")
  91931. c.urlParams_.Set("alt", alt)
  91932. c.urlParams_.Set("prettyPrint", "false")
  91933. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  91934. urls += "?" + c.urlParams_.Encode()
  91935. req, err := http.NewRequest("POST", urls, body)
  91936. if err != nil {
  91937. return nil, err
  91938. }
  91939. req.Header = reqHeaders
  91940. googleapi.Expand(req.URL, map[string]string{
  91941. "project": c.project,
  91942. "region": c.region,
  91943. })
  91944. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91945. }
  91946. // Do executes the "compute.nodeTemplates.insert" call.
  91947. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91948. // status code is an error. Response headers are in either
  91949. // *Operation.ServerResponse.Header or (if a response was returned at
  91950. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91951. // to check whether the returned error was because
  91952. // http.StatusNotModified was returned.
  91953. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91954. gensupport.SetOptions(c.urlParams_, opts...)
  91955. res, err := c.doRequest("json")
  91956. if res != nil && res.StatusCode == http.StatusNotModified {
  91957. if res.Body != nil {
  91958. res.Body.Close()
  91959. }
  91960. return nil, &googleapi.Error{
  91961. Code: res.StatusCode,
  91962. Header: res.Header,
  91963. }
  91964. }
  91965. if err != nil {
  91966. return nil, err
  91967. }
  91968. defer googleapi.CloseBody(res)
  91969. if err := googleapi.CheckResponse(res); err != nil {
  91970. return nil, err
  91971. }
  91972. ret := &Operation{
  91973. ServerResponse: googleapi.ServerResponse{
  91974. Header: res.Header,
  91975. HTTPStatusCode: res.StatusCode,
  91976. },
  91977. }
  91978. target := &ret
  91979. if err := gensupport.DecodeResponse(target, res); err != nil {
  91980. return nil, err
  91981. }
  91982. return ret, nil
  91983. // {
  91984. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  91985. // "httpMethod": "POST",
  91986. // "id": "compute.nodeTemplates.insert",
  91987. // "parameterOrder": [
  91988. // "project",
  91989. // "region"
  91990. // ],
  91991. // "parameters": {
  91992. // "project": {
  91993. // "description": "Project ID for this request.",
  91994. // "location": "path",
  91995. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91996. // "required": true,
  91997. // "type": "string"
  91998. // },
  91999. // "region": {
  92000. // "description": "The name of the region for this request.",
  92001. // "location": "path",
  92002. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92003. // "required": true,
  92004. // "type": "string"
  92005. // },
  92006. // "requestId": {
  92007. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92008. // "location": "query",
  92009. // "type": "string"
  92010. // }
  92011. // },
  92012. // "path": "{project}/regions/{region}/nodeTemplates",
  92013. // "request": {
  92014. // "$ref": "NodeTemplate"
  92015. // },
  92016. // "response": {
  92017. // "$ref": "Operation"
  92018. // },
  92019. // "scopes": [
  92020. // "https://www.googleapis.com/auth/cloud-platform",
  92021. // "https://www.googleapis.com/auth/compute"
  92022. // ]
  92023. // }
  92024. }
  92025. // method id "compute.nodeTemplates.list":
  92026. type NodeTemplatesListCall struct {
  92027. s *Service
  92028. project string
  92029. region string
  92030. urlParams_ gensupport.URLParams
  92031. ifNoneMatch_ string
  92032. ctx_ context.Context
  92033. header_ http.Header
  92034. }
  92035. // List: Retrieves a list of node templates available to the specified
  92036. // project.
  92037. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  92038. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92039. c.project = project
  92040. c.region = region
  92041. return c
  92042. }
  92043. // Filter sets the optional parameter "filter": A filter expression that
  92044. // filters resources listed in the response. The expression must specify
  92045. // the field name, a comparison operator, and the value that you want to
  92046. // use for filtering. The value must be a string, a number, or a
  92047. // boolean. The comparison operator must be either =, !=, >, or <.
  92048. //
  92049. // For example, if you are filtering Compute Engine instances, you can
  92050. // exclude instances named example-instance by specifying name !=
  92051. // example-instance.
  92052. //
  92053. // You can also filter nested fields. For example, you could specify
  92054. // scheduling.automaticRestart = false to include instances only if they
  92055. // are not scheduled for automatic restarts. You can use filtering on
  92056. // nested fields to filter based on resource labels.
  92057. //
  92058. // To filter on multiple expressions, provide each separate expression
  92059. // within parentheses. For example, (scheduling.automaticRestart = true)
  92060. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92061. // AND expression. However, you can include AND and OR expressions
  92062. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92063. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92064. // true).
  92065. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  92066. c.urlParams_.Set("filter", filter)
  92067. return c
  92068. }
  92069. // MaxResults sets the optional parameter "maxResults": The maximum
  92070. // number of results per page that should be returned. If the number of
  92071. // available results is larger than maxResults, Compute Engine returns a
  92072. // nextPageToken that can be used to get the next page of results in
  92073. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92074. // (Default: 500)
  92075. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  92076. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92077. return c
  92078. }
  92079. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92080. // a certain order. By default, results are returned in alphanumerical
  92081. // order based on the resource name.
  92082. //
  92083. // You can also sort results in descending order based on the creation
  92084. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92085. // based on the creationTimestamp field in reverse chronological order
  92086. // (newest result first). Use this to sort resources like operations so
  92087. // that the newest operation is returned first.
  92088. //
  92089. // Currently, only sorting by name or creationTimestamp desc is
  92090. // supported.
  92091. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  92092. c.urlParams_.Set("orderBy", orderBy)
  92093. return c
  92094. }
  92095. // PageToken sets the optional parameter "pageToken": Specifies a page
  92096. // token to use. Set pageToken to the nextPageToken returned by a
  92097. // previous list request to get the next page of results.
  92098. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  92099. c.urlParams_.Set("pageToken", pageToken)
  92100. return c
  92101. }
  92102. // Fields allows partial responses to be retrieved. See
  92103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92104. // for more information.
  92105. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  92106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92107. return c
  92108. }
  92109. // IfNoneMatch sets the optional parameter which makes the operation
  92110. // fail if the object's ETag matches the given value. This is useful for
  92111. // getting updates only after the object has changed since the last
  92112. // request. Use googleapi.IsNotModified to check whether the response
  92113. // error from Do is the result of In-None-Match.
  92114. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  92115. c.ifNoneMatch_ = entityTag
  92116. return c
  92117. }
  92118. // Context sets the context to be used in this call's Do method. Any
  92119. // pending HTTP request will be aborted if the provided context is
  92120. // canceled.
  92121. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  92122. c.ctx_ = ctx
  92123. return c
  92124. }
  92125. // Header returns an http.Header that can be modified by the caller to
  92126. // add HTTP headers to the request.
  92127. func (c *NodeTemplatesListCall) Header() http.Header {
  92128. if c.header_ == nil {
  92129. c.header_ = make(http.Header)
  92130. }
  92131. return c.header_
  92132. }
  92133. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  92134. reqHeaders := make(http.Header)
  92135. for k, v := range c.header_ {
  92136. reqHeaders[k] = v
  92137. }
  92138. reqHeaders.Set("User-Agent", c.s.userAgent())
  92139. if c.ifNoneMatch_ != "" {
  92140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92141. }
  92142. var body io.Reader = nil
  92143. c.urlParams_.Set("alt", alt)
  92144. c.urlParams_.Set("prettyPrint", "false")
  92145. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  92146. urls += "?" + c.urlParams_.Encode()
  92147. req, err := http.NewRequest("GET", urls, body)
  92148. if err != nil {
  92149. return nil, err
  92150. }
  92151. req.Header = reqHeaders
  92152. googleapi.Expand(req.URL, map[string]string{
  92153. "project": c.project,
  92154. "region": c.region,
  92155. })
  92156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92157. }
  92158. // Do executes the "compute.nodeTemplates.list" call.
  92159. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  92160. // non-2xx status code is an error. Response headers are in either
  92161. // *NodeTemplateList.ServerResponse.Header or (if a response was
  92162. // returned at all) in error.(*googleapi.Error).Header. Use
  92163. // googleapi.IsNotModified to check whether the returned error was
  92164. // because http.StatusNotModified was returned.
  92165. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  92166. gensupport.SetOptions(c.urlParams_, opts...)
  92167. res, err := c.doRequest("json")
  92168. if res != nil && res.StatusCode == http.StatusNotModified {
  92169. if res.Body != nil {
  92170. res.Body.Close()
  92171. }
  92172. return nil, &googleapi.Error{
  92173. Code: res.StatusCode,
  92174. Header: res.Header,
  92175. }
  92176. }
  92177. if err != nil {
  92178. return nil, err
  92179. }
  92180. defer googleapi.CloseBody(res)
  92181. if err := googleapi.CheckResponse(res); err != nil {
  92182. return nil, err
  92183. }
  92184. ret := &NodeTemplateList{
  92185. ServerResponse: googleapi.ServerResponse{
  92186. Header: res.Header,
  92187. HTTPStatusCode: res.StatusCode,
  92188. },
  92189. }
  92190. target := &ret
  92191. if err := gensupport.DecodeResponse(target, res); err != nil {
  92192. return nil, err
  92193. }
  92194. return ret, nil
  92195. // {
  92196. // "description": "Retrieves a list of node templates available to the specified project.",
  92197. // "httpMethod": "GET",
  92198. // "id": "compute.nodeTemplates.list",
  92199. // "parameterOrder": [
  92200. // "project",
  92201. // "region"
  92202. // ],
  92203. // "parameters": {
  92204. // "filter": {
  92205. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  92206. // "location": "query",
  92207. // "type": "string"
  92208. // },
  92209. // "maxResults": {
  92210. // "default": "500",
  92211. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  92212. // "format": "uint32",
  92213. // "location": "query",
  92214. // "minimum": "0",
  92215. // "type": "integer"
  92216. // },
  92217. // "orderBy": {
  92218. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  92219. // "location": "query",
  92220. // "type": "string"
  92221. // },
  92222. // "pageToken": {
  92223. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  92224. // "location": "query",
  92225. // "type": "string"
  92226. // },
  92227. // "project": {
  92228. // "description": "Project ID for this request.",
  92229. // "location": "path",
  92230. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92231. // "required": true,
  92232. // "type": "string"
  92233. // },
  92234. // "region": {
  92235. // "description": "The name of the region for this request.",
  92236. // "location": "path",
  92237. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92238. // "required": true,
  92239. // "type": "string"
  92240. // }
  92241. // },
  92242. // "path": "{project}/regions/{region}/nodeTemplates",
  92243. // "response": {
  92244. // "$ref": "NodeTemplateList"
  92245. // },
  92246. // "scopes": [
  92247. // "https://www.googleapis.com/auth/cloud-platform",
  92248. // "https://www.googleapis.com/auth/compute",
  92249. // "https://www.googleapis.com/auth/compute.readonly"
  92250. // ]
  92251. // }
  92252. }
  92253. // Pages invokes f for each page of results.
  92254. // A non-nil error returned from f will halt the iteration.
  92255. // The provided context supersedes any context provided to the Context method.
  92256. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  92257. c.ctx_ = ctx
  92258. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92259. for {
  92260. x, err := c.Do()
  92261. if err != nil {
  92262. return err
  92263. }
  92264. if err := f(x); err != nil {
  92265. return err
  92266. }
  92267. if x.NextPageToken == "" {
  92268. return nil
  92269. }
  92270. c.PageToken(x.NextPageToken)
  92271. }
  92272. }
  92273. // method id "compute.nodeTemplates.setIamPolicy":
  92274. type NodeTemplatesSetIamPolicyCall struct {
  92275. s *Service
  92276. project string
  92277. region string
  92278. resource string
  92279. regionsetpolicyrequest *RegionSetPolicyRequest
  92280. urlParams_ gensupport.URLParams
  92281. ctx_ context.Context
  92282. header_ http.Header
  92283. }
  92284. // SetIamPolicy: Sets the access control policy on the specified
  92285. // resource. Replaces any existing policy.
  92286. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  92287. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92288. c.project = project
  92289. c.region = region
  92290. c.resource = resource
  92291. c.regionsetpolicyrequest = regionsetpolicyrequest
  92292. return c
  92293. }
  92294. // Fields allows partial responses to be retrieved. See
  92295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92296. // for more information.
  92297. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  92298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92299. return c
  92300. }
  92301. // Context sets the context to be used in this call's Do method. Any
  92302. // pending HTTP request will be aborted if the provided context is
  92303. // canceled.
  92304. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  92305. c.ctx_ = ctx
  92306. return c
  92307. }
  92308. // Header returns an http.Header that can be modified by the caller to
  92309. // add HTTP headers to the request.
  92310. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  92311. if c.header_ == nil {
  92312. c.header_ = make(http.Header)
  92313. }
  92314. return c.header_
  92315. }
  92316. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  92317. reqHeaders := make(http.Header)
  92318. for k, v := range c.header_ {
  92319. reqHeaders[k] = v
  92320. }
  92321. reqHeaders.Set("User-Agent", c.s.userAgent())
  92322. var body io.Reader = nil
  92323. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  92324. if err != nil {
  92325. return nil, err
  92326. }
  92327. reqHeaders.Set("Content-Type", "application/json")
  92328. c.urlParams_.Set("alt", alt)
  92329. c.urlParams_.Set("prettyPrint", "false")
  92330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  92331. urls += "?" + c.urlParams_.Encode()
  92332. req, err := http.NewRequest("POST", urls, body)
  92333. if err != nil {
  92334. return nil, err
  92335. }
  92336. req.Header = reqHeaders
  92337. googleapi.Expand(req.URL, map[string]string{
  92338. "project": c.project,
  92339. "region": c.region,
  92340. "resource": c.resource,
  92341. })
  92342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92343. }
  92344. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  92345. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  92346. // code is an error. Response headers are in either
  92347. // *Policy.ServerResponse.Header or (if a response was returned at all)
  92348. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  92349. // check whether the returned error was because http.StatusNotModified
  92350. // was returned.
  92351. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  92352. gensupport.SetOptions(c.urlParams_, opts...)
  92353. res, err := c.doRequest("json")
  92354. if res != nil && res.StatusCode == http.StatusNotModified {
  92355. if res.Body != nil {
  92356. res.Body.Close()
  92357. }
  92358. return nil, &googleapi.Error{
  92359. Code: res.StatusCode,
  92360. Header: res.Header,
  92361. }
  92362. }
  92363. if err != nil {
  92364. return nil, err
  92365. }
  92366. defer googleapi.CloseBody(res)
  92367. if err := googleapi.CheckResponse(res); err != nil {
  92368. return nil, err
  92369. }
  92370. ret := &Policy{
  92371. ServerResponse: googleapi.ServerResponse{
  92372. Header: res.Header,
  92373. HTTPStatusCode: res.StatusCode,
  92374. },
  92375. }
  92376. target := &ret
  92377. if err := gensupport.DecodeResponse(target, res); err != nil {
  92378. return nil, err
  92379. }
  92380. return ret, nil
  92381. // {
  92382. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  92383. // "httpMethod": "POST",
  92384. // "id": "compute.nodeTemplates.setIamPolicy",
  92385. // "parameterOrder": [
  92386. // "project",
  92387. // "region",
  92388. // "resource"
  92389. // ],
  92390. // "parameters": {
  92391. // "project": {
  92392. // "description": "Project ID for this request.",
  92393. // "location": "path",
  92394. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92395. // "required": true,
  92396. // "type": "string"
  92397. // },
  92398. // "region": {
  92399. // "description": "The name of the region for this request.",
  92400. // "location": "path",
  92401. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92402. // "required": true,
  92403. // "type": "string"
  92404. // },
  92405. // "resource": {
  92406. // "description": "Name or id of the resource for this request.",
  92407. // "location": "path",
  92408. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92409. // "required": true,
  92410. // "type": "string"
  92411. // }
  92412. // },
  92413. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  92414. // "request": {
  92415. // "$ref": "RegionSetPolicyRequest"
  92416. // },
  92417. // "response": {
  92418. // "$ref": "Policy"
  92419. // },
  92420. // "scopes": [
  92421. // "https://www.googleapis.com/auth/cloud-platform",
  92422. // "https://www.googleapis.com/auth/compute"
  92423. // ]
  92424. // }
  92425. }
  92426. // method id "compute.nodeTemplates.testIamPermissions":
  92427. type NodeTemplatesTestIamPermissionsCall struct {
  92428. s *Service
  92429. project string
  92430. region string
  92431. resource string
  92432. testpermissionsrequest *TestPermissionsRequest
  92433. urlParams_ gensupport.URLParams
  92434. ctx_ context.Context
  92435. header_ http.Header
  92436. }
  92437. // TestIamPermissions: Returns permissions that a caller has on the
  92438. // specified resource.
  92439. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  92440. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92441. c.project = project
  92442. c.region = region
  92443. c.resource = resource
  92444. c.testpermissionsrequest = testpermissionsrequest
  92445. return c
  92446. }
  92447. // Fields allows partial responses to be retrieved. See
  92448. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92449. // for more information.
  92450. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  92451. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92452. return c
  92453. }
  92454. // Context sets the context to be used in this call's Do method. Any
  92455. // pending HTTP request will be aborted if the provided context is
  92456. // canceled.
  92457. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  92458. c.ctx_ = ctx
  92459. return c
  92460. }
  92461. // Header returns an http.Header that can be modified by the caller to
  92462. // add HTTP headers to the request.
  92463. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  92464. if c.header_ == nil {
  92465. c.header_ = make(http.Header)
  92466. }
  92467. return c.header_
  92468. }
  92469. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  92470. reqHeaders := make(http.Header)
  92471. for k, v := range c.header_ {
  92472. reqHeaders[k] = v
  92473. }
  92474. reqHeaders.Set("User-Agent", c.s.userAgent())
  92475. var body io.Reader = nil
  92476. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  92477. if err != nil {
  92478. return nil, err
  92479. }
  92480. reqHeaders.Set("Content-Type", "application/json")
  92481. c.urlParams_.Set("alt", alt)
  92482. c.urlParams_.Set("prettyPrint", "false")
  92483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  92484. urls += "?" + c.urlParams_.Encode()
  92485. req, err := http.NewRequest("POST", urls, body)
  92486. if err != nil {
  92487. return nil, err
  92488. }
  92489. req.Header = reqHeaders
  92490. googleapi.Expand(req.URL, map[string]string{
  92491. "project": c.project,
  92492. "region": c.region,
  92493. "resource": c.resource,
  92494. })
  92495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92496. }
  92497. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  92498. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  92499. // non-2xx status code is an error. Response headers are in either
  92500. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  92501. // returned at all) in error.(*googleapi.Error).Header. Use
  92502. // googleapi.IsNotModified to check whether the returned error was
  92503. // because http.StatusNotModified was returned.
  92504. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  92505. gensupport.SetOptions(c.urlParams_, opts...)
  92506. res, err := c.doRequest("json")
  92507. if res != nil && res.StatusCode == http.StatusNotModified {
  92508. if res.Body != nil {
  92509. res.Body.Close()
  92510. }
  92511. return nil, &googleapi.Error{
  92512. Code: res.StatusCode,
  92513. Header: res.Header,
  92514. }
  92515. }
  92516. if err != nil {
  92517. return nil, err
  92518. }
  92519. defer googleapi.CloseBody(res)
  92520. if err := googleapi.CheckResponse(res); err != nil {
  92521. return nil, err
  92522. }
  92523. ret := &TestPermissionsResponse{
  92524. ServerResponse: googleapi.ServerResponse{
  92525. Header: res.Header,
  92526. HTTPStatusCode: res.StatusCode,
  92527. },
  92528. }
  92529. target := &ret
  92530. if err := gensupport.DecodeResponse(target, res); err != nil {
  92531. return nil, err
  92532. }
  92533. return ret, nil
  92534. // {
  92535. // "description": "Returns permissions that a caller has on the specified resource.",
  92536. // "httpMethod": "POST",
  92537. // "id": "compute.nodeTemplates.testIamPermissions",
  92538. // "parameterOrder": [
  92539. // "project",
  92540. // "region",
  92541. // "resource"
  92542. // ],
  92543. // "parameters": {
  92544. // "project": {
  92545. // "description": "Project ID for this request.",
  92546. // "location": "path",
  92547. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92548. // "required": true,
  92549. // "type": "string"
  92550. // },
  92551. // "region": {
  92552. // "description": "The name of the region for this request.",
  92553. // "location": "path",
  92554. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92555. // "required": true,
  92556. // "type": "string"
  92557. // },
  92558. // "resource": {
  92559. // "description": "Name or id of the resource for this request.",
  92560. // "location": "path",
  92561. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92562. // "required": true,
  92563. // "type": "string"
  92564. // }
  92565. // },
  92566. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  92567. // "request": {
  92568. // "$ref": "TestPermissionsRequest"
  92569. // },
  92570. // "response": {
  92571. // "$ref": "TestPermissionsResponse"
  92572. // },
  92573. // "scopes": [
  92574. // "https://www.googleapis.com/auth/cloud-platform",
  92575. // "https://www.googleapis.com/auth/compute",
  92576. // "https://www.googleapis.com/auth/compute.readonly"
  92577. // ]
  92578. // }
  92579. }
  92580. // method id "compute.nodeTypes.aggregatedList":
  92581. type NodeTypesAggregatedListCall struct {
  92582. s *Service
  92583. project string
  92584. urlParams_ gensupport.URLParams
  92585. ifNoneMatch_ string
  92586. ctx_ context.Context
  92587. header_ http.Header
  92588. }
  92589. // AggregatedList: Retrieves an aggregated list of node types.
  92590. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  92591. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92592. c.project = project
  92593. return c
  92594. }
  92595. // Filter sets the optional parameter "filter": A filter expression that
  92596. // filters resources listed in the response. The expression must specify
  92597. // the field name, a comparison operator, and the value that you want to
  92598. // use for filtering. The value must be a string, a number, or a
  92599. // boolean. The comparison operator must be either =, !=, >, or <.
  92600. //
  92601. // For example, if you are filtering Compute Engine instances, you can
  92602. // exclude instances named example-instance by specifying name !=
  92603. // example-instance.
  92604. //
  92605. // You can also filter nested fields. For example, you could specify
  92606. // scheduling.automaticRestart = false to include instances only if they
  92607. // are not scheduled for automatic restarts. You can use filtering on
  92608. // nested fields to filter based on resource labels.
  92609. //
  92610. // To filter on multiple expressions, provide each separate expression
  92611. // within parentheses. For example, (scheduling.automaticRestart = true)
  92612. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92613. // AND expression. However, you can include AND and OR expressions
  92614. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92615. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92616. // true).
  92617. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  92618. c.urlParams_.Set("filter", filter)
  92619. return c
  92620. }
  92621. // MaxResults sets the optional parameter "maxResults": The maximum
  92622. // number of results per page that should be returned. If the number of
  92623. // available results is larger than maxResults, Compute Engine returns a
  92624. // nextPageToken that can be used to get the next page of results in
  92625. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92626. // (Default: 500)
  92627. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  92628. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92629. return c
  92630. }
  92631. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92632. // a certain order. By default, results are returned in alphanumerical
  92633. // order based on the resource name.
  92634. //
  92635. // You can also sort results in descending order based on the creation
  92636. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92637. // based on the creationTimestamp field in reverse chronological order
  92638. // (newest result first). Use this to sort resources like operations so
  92639. // that the newest operation is returned first.
  92640. //
  92641. // Currently, only sorting by name or creationTimestamp desc is
  92642. // supported.
  92643. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  92644. c.urlParams_.Set("orderBy", orderBy)
  92645. return c
  92646. }
  92647. // PageToken sets the optional parameter "pageToken": Specifies a page
  92648. // token to use. Set pageToken to the nextPageToken returned by a
  92649. // previous list request to get the next page of results.
  92650. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  92651. c.urlParams_.Set("pageToken", pageToken)
  92652. return c
  92653. }
  92654. // Fields allows partial responses to be retrieved. See
  92655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92656. // for more information.
  92657. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  92658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92659. return c
  92660. }
  92661. // IfNoneMatch sets the optional parameter which makes the operation
  92662. // fail if the object's ETag matches the given value. This is useful for
  92663. // getting updates only after the object has changed since the last
  92664. // request. Use googleapi.IsNotModified to check whether the response
  92665. // error from Do is the result of In-None-Match.
  92666. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  92667. c.ifNoneMatch_ = entityTag
  92668. return c
  92669. }
  92670. // Context sets the context to be used in this call's Do method. Any
  92671. // pending HTTP request will be aborted if the provided context is
  92672. // canceled.
  92673. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  92674. c.ctx_ = ctx
  92675. return c
  92676. }
  92677. // Header returns an http.Header that can be modified by the caller to
  92678. // add HTTP headers to the request.
  92679. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  92680. if c.header_ == nil {
  92681. c.header_ = make(http.Header)
  92682. }
  92683. return c.header_
  92684. }
  92685. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  92686. reqHeaders := make(http.Header)
  92687. for k, v := range c.header_ {
  92688. reqHeaders[k] = v
  92689. }
  92690. reqHeaders.Set("User-Agent", c.s.userAgent())
  92691. if c.ifNoneMatch_ != "" {
  92692. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92693. }
  92694. var body io.Reader = nil
  92695. c.urlParams_.Set("alt", alt)
  92696. c.urlParams_.Set("prettyPrint", "false")
  92697. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  92698. urls += "?" + c.urlParams_.Encode()
  92699. req, err := http.NewRequest("GET", urls, body)
  92700. if err != nil {
  92701. return nil, err
  92702. }
  92703. req.Header = reqHeaders
  92704. googleapi.Expand(req.URL, map[string]string{
  92705. "project": c.project,
  92706. })
  92707. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92708. }
  92709. // Do executes the "compute.nodeTypes.aggregatedList" call.
  92710. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  92711. // non-2xx status code is an error. Response headers are in either
  92712. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  92713. // returned at all) in error.(*googleapi.Error).Header. Use
  92714. // googleapi.IsNotModified to check whether the returned error was
  92715. // because http.StatusNotModified was returned.
  92716. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  92717. gensupport.SetOptions(c.urlParams_, opts...)
  92718. res, err := c.doRequest("json")
  92719. if res != nil && res.StatusCode == http.StatusNotModified {
  92720. if res.Body != nil {
  92721. res.Body.Close()
  92722. }
  92723. return nil, &googleapi.Error{
  92724. Code: res.StatusCode,
  92725. Header: res.Header,
  92726. }
  92727. }
  92728. if err != nil {
  92729. return nil, err
  92730. }
  92731. defer googleapi.CloseBody(res)
  92732. if err := googleapi.CheckResponse(res); err != nil {
  92733. return nil, err
  92734. }
  92735. ret := &NodeTypeAggregatedList{
  92736. ServerResponse: googleapi.ServerResponse{
  92737. Header: res.Header,
  92738. HTTPStatusCode: res.StatusCode,
  92739. },
  92740. }
  92741. target := &ret
  92742. if err := gensupport.DecodeResponse(target, res); err != nil {
  92743. return nil, err
  92744. }
  92745. return ret, nil
  92746. // {
  92747. // "description": "Retrieves an aggregated list of node types.",
  92748. // "httpMethod": "GET",
  92749. // "id": "compute.nodeTypes.aggregatedList",
  92750. // "parameterOrder": [
  92751. // "project"
  92752. // ],
  92753. // "parameters": {
  92754. // "filter": {
  92755. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  92756. // "location": "query",
  92757. // "type": "string"
  92758. // },
  92759. // "maxResults": {
  92760. // "default": "500",
  92761. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  92762. // "format": "uint32",
  92763. // "location": "query",
  92764. // "minimum": "0",
  92765. // "type": "integer"
  92766. // },
  92767. // "orderBy": {
  92768. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  92769. // "location": "query",
  92770. // "type": "string"
  92771. // },
  92772. // "pageToken": {
  92773. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  92774. // "location": "query",
  92775. // "type": "string"
  92776. // },
  92777. // "project": {
  92778. // "description": "Project ID for this request.",
  92779. // "location": "path",
  92780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92781. // "required": true,
  92782. // "type": "string"
  92783. // }
  92784. // },
  92785. // "path": "{project}/aggregated/nodeTypes",
  92786. // "response": {
  92787. // "$ref": "NodeTypeAggregatedList"
  92788. // },
  92789. // "scopes": [
  92790. // "https://www.googleapis.com/auth/cloud-platform",
  92791. // "https://www.googleapis.com/auth/compute",
  92792. // "https://www.googleapis.com/auth/compute.readonly"
  92793. // ]
  92794. // }
  92795. }
  92796. // Pages invokes f for each page of results.
  92797. // A non-nil error returned from f will halt the iteration.
  92798. // The provided context supersedes any context provided to the Context method.
  92799. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  92800. c.ctx_ = ctx
  92801. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92802. for {
  92803. x, err := c.Do()
  92804. if err != nil {
  92805. return err
  92806. }
  92807. if err := f(x); err != nil {
  92808. return err
  92809. }
  92810. if x.NextPageToken == "" {
  92811. return nil
  92812. }
  92813. c.PageToken(x.NextPageToken)
  92814. }
  92815. }
  92816. // method id "compute.nodeTypes.get":
  92817. type NodeTypesGetCall struct {
  92818. s *Service
  92819. project string
  92820. zone string
  92821. nodeType string
  92822. urlParams_ gensupport.URLParams
  92823. ifNoneMatch_ string
  92824. ctx_ context.Context
  92825. header_ http.Header
  92826. }
  92827. // Get: Returns the specified node type. Gets a list of available node
  92828. // types by making a list() request.
  92829. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  92830. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92831. c.project = project
  92832. c.zone = zone
  92833. c.nodeType = nodeType
  92834. return c
  92835. }
  92836. // Fields allows partial responses to be retrieved. See
  92837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92838. // for more information.
  92839. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  92840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92841. return c
  92842. }
  92843. // IfNoneMatch sets the optional parameter which makes the operation
  92844. // fail if the object's ETag matches the given value. This is useful for
  92845. // getting updates only after the object has changed since the last
  92846. // request. Use googleapi.IsNotModified to check whether the response
  92847. // error from Do is the result of In-None-Match.
  92848. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  92849. c.ifNoneMatch_ = entityTag
  92850. return c
  92851. }
  92852. // Context sets the context to be used in this call's Do method. Any
  92853. // pending HTTP request will be aborted if the provided context is
  92854. // canceled.
  92855. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  92856. c.ctx_ = ctx
  92857. return c
  92858. }
  92859. // Header returns an http.Header that can be modified by the caller to
  92860. // add HTTP headers to the request.
  92861. func (c *NodeTypesGetCall) Header() http.Header {
  92862. if c.header_ == nil {
  92863. c.header_ = make(http.Header)
  92864. }
  92865. return c.header_
  92866. }
  92867. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  92868. reqHeaders := make(http.Header)
  92869. for k, v := range c.header_ {
  92870. reqHeaders[k] = v
  92871. }
  92872. reqHeaders.Set("User-Agent", c.s.userAgent())
  92873. if c.ifNoneMatch_ != "" {
  92874. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92875. }
  92876. var body io.Reader = nil
  92877. c.urlParams_.Set("alt", alt)
  92878. c.urlParams_.Set("prettyPrint", "false")
  92879. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  92880. urls += "?" + c.urlParams_.Encode()
  92881. req, err := http.NewRequest("GET", urls, body)
  92882. if err != nil {
  92883. return nil, err
  92884. }
  92885. req.Header = reqHeaders
  92886. googleapi.Expand(req.URL, map[string]string{
  92887. "project": c.project,
  92888. "zone": c.zone,
  92889. "nodeType": c.nodeType,
  92890. })
  92891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92892. }
  92893. // Do executes the "compute.nodeTypes.get" call.
  92894. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  92895. // code is an error. Response headers are in either
  92896. // *NodeType.ServerResponse.Header or (if a response was returned at
  92897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92898. // to check whether the returned error was because
  92899. // http.StatusNotModified was returned.
  92900. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  92901. gensupport.SetOptions(c.urlParams_, opts...)
  92902. res, err := c.doRequest("json")
  92903. if res != nil && res.StatusCode == http.StatusNotModified {
  92904. if res.Body != nil {
  92905. res.Body.Close()
  92906. }
  92907. return nil, &googleapi.Error{
  92908. Code: res.StatusCode,
  92909. Header: res.Header,
  92910. }
  92911. }
  92912. if err != nil {
  92913. return nil, err
  92914. }
  92915. defer googleapi.CloseBody(res)
  92916. if err := googleapi.CheckResponse(res); err != nil {
  92917. return nil, err
  92918. }
  92919. ret := &NodeType{
  92920. ServerResponse: googleapi.ServerResponse{
  92921. Header: res.Header,
  92922. HTTPStatusCode: res.StatusCode,
  92923. },
  92924. }
  92925. target := &ret
  92926. if err := gensupport.DecodeResponse(target, res); err != nil {
  92927. return nil, err
  92928. }
  92929. return ret, nil
  92930. // {
  92931. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  92932. // "httpMethod": "GET",
  92933. // "id": "compute.nodeTypes.get",
  92934. // "parameterOrder": [
  92935. // "project",
  92936. // "zone",
  92937. // "nodeType"
  92938. // ],
  92939. // "parameters": {
  92940. // "nodeType": {
  92941. // "description": "Name of the node type to return.",
  92942. // "location": "path",
  92943. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92944. // "required": true,
  92945. // "type": "string"
  92946. // },
  92947. // "project": {
  92948. // "description": "Project ID for this request.",
  92949. // "location": "path",
  92950. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92951. // "required": true,
  92952. // "type": "string"
  92953. // },
  92954. // "zone": {
  92955. // "description": "The name of the zone for this request.",
  92956. // "location": "path",
  92957. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92958. // "required": true,
  92959. // "type": "string"
  92960. // }
  92961. // },
  92962. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  92963. // "response": {
  92964. // "$ref": "NodeType"
  92965. // },
  92966. // "scopes": [
  92967. // "https://www.googleapis.com/auth/cloud-platform",
  92968. // "https://www.googleapis.com/auth/compute",
  92969. // "https://www.googleapis.com/auth/compute.readonly"
  92970. // ]
  92971. // }
  92972. }
  92973. // method id "compute.nodeTypes.list":
  92974. type NodeTypesListCall struct {
  92975. s *Service
  92976. project string
  92977. zone string
  92978. urlParams_ gensupport.URLParams
  92979. ifNoneMatch_ string
  92980. ctx_ context.Context
  92981. header_ http.Header
  92982. }
  92983. // List: Retrieves a list of node types available to the specified
  92984. // project.
  92985. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  92986. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92987. c.project = project
  92988. c.zone = zone
  92989. return c
  92990. }
  92991. // Filter sets the optional parameter "filter": A filter expression that
  92992. // filters resources listed in the response. The expression must specify
  92993. // the field name, a comparison operator, and the value that you want to
  92994. // use for filtering. The value must be a string, a number, or a
  92995. // boolean. The comparison operator must be either =, !=, >, or <.
  92996. //
  92997. // For example, if you are filtering Compute Engine instances, you can
  92998. // exclude instances named example-instance by specifying name !=
  92999. // example-instance.
  93000. //
  93001. // You can also filter nested fields. For example, you could specify
  93002. // scheduling.automaticRestart = false to include instances only if they
  93003. // are not scheduled for automatic restarts. You can use filtering on
  93004. // nested fields to filter based on resource labels.
  93005. //
  93006. // To filter on multiple expressions, provide each separate expression
  93007. // within parentheses. For example, (scheduling.automaticRestart = true)
  93008. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93009. // AND expression. However, you can include AND and OR expressions
  93010. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93011. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93012. // true).
  93013. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  93014. c.urlParams_.Set("filter", filter)
  93015. return c
  93016. }
  93017. // MaxResults sets the optional parameter "maxResults": The maximum
  93018. // number of results per page that should be returned. If the number of
  93019. // available results is larger than maxResults, Compute Engine returns a
  93020. // nextPageToken that can be used to get the next page of results in
  93021. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93022. // (Default: 500)
  93023. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  93024. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93025. return c
  93026. }
  93027. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93028. // a certain order. By default, results are returned in alphanumerical
  93029. // order based on the resource name.
  93030. //
  93031. // You can also sort results in descending order based on the creation
  93032. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93033. // based on the creationTimestamp field in reverse chronological order
  93034. // (newest result first). Use this to sort resources like operations so
  93035. // that the newest operation is returned first.
  93036. //
  93037. // Currently, only sorting by name or creationTimestamp desc is
  93038. // supported.
  93039. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  93040. c.urlParams_.Set("orderBy", orderBy)
  93041. return c
  93042. }
  93043. // PageToken sets the optional parameter "pageToken": Specifies a page
  93044. // token to use. Set pageToken to the nextPageToken returned by a
  93045. // previous list request to get the next page of results.
  93046. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  93047. c.urlParams_.Set("pageToken", pageToken)
  93048. return c
  93049. }
  93050. // Fields allows partial responses to be retrieved. See
  93051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93052. // for more information.
  93053. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  93054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93055. return c
  93056. }
  93057. // IfNoneMatch sets the optional parameter which makes the operation
  93058. // fail if the object's ETag matches the given value. This is useful for
  93059. // getting updates only after the object has changed since the last
  93060. // request. Use googleapi.IsNotModified to check whether the response
  93061. // error from Do is the result of In-None-Match.
  93062. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  93063. c.ifNoneMatch_ = entityTag
  93064. return c
  93065. }
  93066. // Context sets the context to be used in this call's Do method. Any
  93067. // pending HTTP request will be aborted if the provided context is
  93068. // canceled.
  93069. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  93070. c.ctx_ = ctx
  93071. return c
  93072. }
  93073. // Header returns an http.Header that can be modified by the caller to
  93074. // add HTTP headers to the request.
  93075. func (c *NodeTypesListCall) Header() http.Header {
  93076. if c.header_ == nil {
  93077. c.header_ = make(http.Header)
  93078. }
  93079. return c.header_
  93080. }
  93081. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  93082. reqHeaders := make(http.Header)
  93083. for k, v := range c.header_ {
  93084. reqHeaders[k] = v
  93085. }
  93086. reqHeaders.Set("User-Agent", c.s.userAgent())
  93087. if c.ifNoneMatch_ != "" {
  93088. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93089. }
  93090. var body io.Reader = nil
  93091. c.urlParams_.Set("alt", alt)
  93092. c.urlParams_.Set("prettyPrint", "false")
  93093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  93094. urls += "?" + c.urlParams_.Encode()
  93095. req, err := http.NewRequest("GET", urls, body)
  93096. if err != nil {
  93097. return nil, err
  93098. }
  93099. req.Header = reqHeaders
  93100. googleapi.Expand(req.URL, map[string]string{
  93101. "project": c.project,
  93102. "zone": c.zone,
  93103. })
  93104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93105. }
  93106. // Do executes the "compute.nodeTypes.list" call.
  93107. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  93108. // status code is an error. Response headers are in either
  93109. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  93110. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93111. // to check whether the returned error was because
  93112. // http.StatusNotModified was returned.
  93113. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  93114. gensupport.SetOptions(c.urlParams_, opts...)
  93115. res, err := c.doRequest("json")
  93116. if res != nil && res.StatusCode == http.StatusNotModified {
  93117. if res.Body != nil {
  93118. res.Body.Close()
  93119. }
  93120. return nil, &googleapi.Error{
  93121. Code: res.StatusCode,
  93122. Header: res.Header,
  93123. }
  93124. }
  93125. if err != nil {
  93126. return nil, err
  93127. }
  93128. defer googleapi.CloseBody(res)
  93129. if err := googleapi.CheckResponse(res); err != nil {
  93130. return nil, err
  93131. }
  93132. ret := &NodeTypeList{
  93133. ServerResponse: googleapi.ServerResponse{
  93134. Header: res.Header,
  93135. HTTPStatusCode: res.StatusCode,
  93136. },
  93137. }
  93138. target := &ret
  93139. if err := gensupport.DecodeResponse(target, res); err != nil {
  93140. return nil, err
  93141. }
  93142. return ret, nil
  93143. // {
  93144. // "description": "Retrieves a list of node types available to the specified project.",
  93145. // "httpMethod": "GET",
  93146. // "id": "compute.nodeTypes.list",
  93147. // "parameterOrder": [
  93148. // "project",
  93149. // "zone"
  93150. // ],
  93151. // "parameters": {
  93152. // "filter": {
  93153. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  93154. // "location": "query",
  93155. // "type": "string"
  93156. // },
  93157. // "maxResults": {
  93158. // "default": "500",
  93159. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  93160. // "format": "uint32",
  93161. // "location": "query",
  93162. // "minimum": "0",
  93163. // "type": "integer"
  93164. // },
  93165. // "orderBy": {
  93166. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  93167. // "location": "query",
  93168. // "type": "string"
  93169. // },
  93170. // "pageToken": {
  93171. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  93172. // "location": "query",
  93173. // "type": "string"
  93174. // },
  93175. // "project": {
  93176. // "description": "Project ID for this request.",
  93177. // "location": "path",
  93178. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93179. // "required": true,
  93180. // "type": "string"
  93181. // },
  93182. // "zone": {
  93183. // "description": "The name of the zone for this request.",
  93184. // "location": "path",
  93185. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93186. // "required": true,
  93187. // "type": "string"
  93188. // }
  93189. // },
  93190. // "path": "{project}/zones/{zone}/nodeTypes",
  93191. // "response": {
  93192. // "$ref": "NodeTypeList"
  93193. // },
  93194. // "scopes": [
  93195. // "https://www.googleapis.com/auth/cloud-platform",
  93196. // "https://www.googleapis.com/auth/compute",
  93197. // "https://www.googleapis.com/auth/compute.readonly"
  93198. // ]
  93199. // }
  93200. }
  93201. // Pages invokes f for each page of results.
  93202. // A non-nil error returned from f will halt the iteration.
  93203. // The provided context supersedes any context provided to the Context method.
  93204. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  93205. c.ctx_ = ctx
  93206. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93207. for {
  93208. x, err := c.Do()
  93209. if err != nil {
  93210. return err
  93211. }
  93212. if err := f(x); err != nil {
  93213. return err
  93214. }
  93215. if x.NextPageToken == "" {
  93216. return nil
  93217. }
  93218. c.PageToken(x.NextPageToken)
  93219. }
  93220. }
  93221. // method id "compute.organizationSecurityPolicies.addAssociation":
  93222. type OrganizationSecurityPoliciesAddAssociationCall struct {
  93223. s *Service
  93224. securityPolicy string
  93225. securitypolicyassociation *SecurityPolicyAssociation
  93226. urlParams_ gensupport.URLParams
  93227. ctx_ context.Context
  93228. header_ http.Header
  93229. }
  93230. // AddAssociation: Inserts an association for the specified security
  93231. // policy.
  93232. func (r *OrganizationSecurityPoliciesService) AddAssociation(securityPolicy string, securitypolicyassociation *SecurityPolicyAssociation) *OrganizationSecurityPoliciesAddAssociationCall {
  93233. c := &OrganizationSecurityPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93234. c.securityPolicy = securityPolicy
  93235. c.securitypolicyassociation = securitypolicyassociation
  93236. return c
  93237. }
  93238. // ReplaceExistingAssociation sets the optional parameter
  93239. // "replaceExistingAssociation": Indicates whether or not to replace it
  93240. // if an association of the attachment already exists. This is false by
  93241. // default, in which case an error will be returned if an assocation
  93242. // already exists.
  93243. func (c *OrganizationSecurityPoliciesAddAssociationCall) ReplaceExistingAssociation(replaceExistingAssociation bool) *OrganizationSecurityPoliciesAddAssociationCall {
  93244. c.urlParams_.Set("replaceExistingAssociation", fmt.Sprint(replaceExistingAssociation))
  93245. return c
  93246. }
  93247. // RequestId sets the optional parameter "requestId": An optional
  93248. // request ID to identify requests. Specify a unique request ID so that
  93249. // if you must retry your request, the server will know to ignore the
  93250. // request if it has already been completed.
  93251. //
  93252. // For example, consider a situation where you make an initial request
  93253. // and the request times out. If you make the request again with the
  93254. // same request ID, the server can check if original operation with the
  93255. // same request ID was received, and if so, will ignore the second
  93256. // request. This prevents clients from accidentally creating duplicate
  93257. // commitments.
  93258. //
  93259. // The request ID must be a valid UUID with the exception that zero UUID
  93260. // is not supported (00000000-0000-0000-0000-000000000000).
  93261. func (c *OrganizationSecurityPoliciesAddAssociationCall) RequestId(requestId string) *OrganizationSecurityPoliciesAddAssociationCall {
  93262. c.urlParams_.Set("requestId", requestId)
  93263. return c
  93264. }
  93265. // Fields allows partial responses to be retrieved. See
  93266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93267. // for more information.
  93268. func (c *OrganizationSecurityPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesAddAssociationCall {
  93269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93270. return c
  93271. }
  93272. // Context sets the context to be used in this call's Do method. Any
  93273. // pending HTTP request will be aborted if the provided context is
  93274. // canceled.
  93275. func (c *OrganizationSecurityPoliciesAddAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesAddAssociationCall {
  93276. c.ctx_ = ctx
  93277. return c
  93278. }
  93279. // Header returns an http.Header that can be modified by the caller to
  93280. // add HTTP headers to the request.
  93281. func (c *OrganizationSecurityPoliciesAddAssociationCall) Header() http.Header {
  93282. if c.header_ == nil {
  93283. c.header_ = make(http.Header)
  93284. }
  93285. return c.header_
  93286. }
  93287. func (c *OrganizationSecurityPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) {
  93288. reqHeaders := make(http.Header)
  93289. for k, v := range c.header_ {
  93290. reqHeaders[k] = v
  93291. }
  93292. reqHeaders.Set("User-Agent", c.s.userAgent())
  93293. var body io.Reader = nil
  93294. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyassociation)
  93295. if err != nil {
  93296. return nil, err
  93297. }
  93298. reqHeaders.Set("Content-Type", "application/json")
  93299. c.urlParams_.Set("alt", alt)
  93300. c.urlParams_.Set("prettyPrint", "false")
  93301. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/addAssociation")
  93302. urls += "?" + c.urlParams_.Encode()
  93303. req, err := http.NewRequest("POST", urls, body)
  93304. if err != nil {
  93305. return nil, err
  93306. }
  93307. req.Header = reqHeaders
  93308. googleapi.Expand(req.URL, map[string]string{
  93309. "securityPolicy": c.securityPolicy,
  93310. })
  93311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93312. }
  93313. // Do executes the "compute.organizationSecurityPolicies.addAssociation" call.
  93314. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93315. // status code is an error. Response headers are in either
  93316. // *Operation.ServerResponse.Header or (if a response was returned at
  93317. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93318. // to check whether the returned error was because
  93319. // http.StatusNotModified was returned.
  93320. func (c *OrganizationSecurityPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93321. gensupport.SetOptions(c.urlParams_, opts...)
  93322. res, err := c.doRequest("json")
  93323. if res != nil && res.StatusCode == http.StatusNotModified {
  93324. if res.Body != nil {
  93325. res.Body.Close()
  93326. }
  93327. return nil, &googleapi.Error{
  93328. Code: res.StatusCode,
  93329. Header: res.Header,
  93330. }
  93331. }
  93332. if err != nil {
  93333. return nil, err
  93334. }
  93335. defer googleapi.CloseBody(res)
  93336. if err := googleapi.CheckResponse(res); err != nil {
  93337. return nil, err
  93338. }
  93339. ret := &Operation{
  93340. ServerResponse: googleapi.ServerResponse{
  93341. Header: res.Header,
  93342. HTTPStatusCode: res.StatusCode,
  93343. },
  93344. }
  93345. target := &ret
  93346. if err := gensupport.DecodeResponse(target, res); err != nil {
  93347. return nil, err
  93348. }
  93349. return ret, nil
  93350. // {
  93351. // "description": "Inserts an association for the specified security policy.",
  93352. // "httpMethod": "POST",
  93353. // "id": "compute.organizationSecurityPolicies.addAssociation",
  93354. // "parameterOrder": [
  93355. // "securityPolicy"
  93356. // ],
  93357. // "parameters": {
  93358. // "replaceExistingAssociation": {
  93359. // "description": "Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an assocation already exists.",
  93360. // "location": "query",
  93361. // "type": "boolean"
  93362. // },
  93363. // "requestId": {
  93364. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93365. // "location": "query",
  93366. // "type": "string"
  93367. // },
  93368. // "securityPolicy": {
  93369. // "description": "Name of the security policy to update.",
  93370. // "location": "path",
  93371. // "pattern": "[0-9]{0,20}",
  93372. // "required": true,
  93373. // "type": "string"
  93374. // }
  93375. // },
  93376. // "path": "locations/global/securityPolicies/{securityPolicy}/addAssociation",
  93377. // "request": {
  93378. // "$ref": "SecurityPolicyAssociation"
  93379. // },
  93380. // "response": {
  93381. // "$ref": "Operation"
  93382. // },
  93383. // "scopes": [
  93384. // "https://www.googleapis.com/auth/cloud-platform",
  93385. // "https://www.googleapis.com/auth/compute"
  93386. // ]
  93387. // }
  93388. }
  93389. // method id "compute.organizationSecurityPolicies.addRule":
  93390. type OrganizationSecurityPoliciesAddRuleCall struct {
  93391. s *Service
  93392. securityPolicy string
  93393. securitypolicyrule *SecurityPolicyRule
  93394. urlParams_ gensupport.URLParams
  93395. ctx_ context.Context
  93396. header_ http.Header
  93397. }
  93398. // AddRule: Inserts a rule into a security policy.
  93399. func (r *OrganizationSecurityPoliciesService) AddRule(securityPolicy string, securitypolicyrule *SecurityPolicyRule) *OrganizationSecurityPoliciesAddRuleCall {
  93400. c := &OrganizationSecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93401. c.securityPolicy = securityPolicy
  93402. c.securitypolicyrule = securitypolicyrule
  93403. return c
  93404. }
  93405. // RequestId sets the optional parameter "requestId": An optional
  93406. // request ID to identify requests. Specify a unique request ID so that
  93407. // if you must retry your request, the server will know to ignore the
  93408. // request if it has already been completed.
  93409. //
  93410. // For example, consider a situation where you make an initial request
  93411. // and the request times out. If you make the request again with the
  93412. // same request ID, the server can check if original operation with the
  93413. // same request ID was received, and if so, will ignore the second
  93414. // request. This prevents clients from accidentally creating duplicate
  93415. // commitments.
  93416. //
  93417. // The request ID must be a valid UUID with the exception that zero UUID
  93418. // is not supported (00000000-0000-0000-0000-000000000000).
  93419. func (c *OrganizationSecurityPoliciesAddRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesAddRuleCall {
  93420. c.urlParams_.Set("requestId", requestId)
  93421. return c
  93422. }
  93423. // Fields allows partial responses to be retrieved. See
  93424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93425. // for more information.
  93426. func (c *OrganizationSecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesAddRuleCall {
  93427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93428. return c
  93429. }
  93430. // Context sets the context to be used in this call's Do method. Any
  93431. // pending HTTP request will be aborted if the provided context is
  93432. // canceled.
  93433. func (c *OrganizationSecurityPoliciesAddRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesAddRuleCall {
  93434. c.ctx_ = ctx
  93435. return c
  93436. }
  93437. // Header returns an http.Header that can be modified by the caller to
  93438. // add HTTP headers to the request.
  93439. func (c *OrganizationSecurityPoliciesAddRuleCall) Header() http.Header {
  93440. if c.header_ == nil {
  93441. c.header_ = make(http.Header)
  93442. }
  93443. return c.header_
  93444. }
  93445. func (c *OrganizationSecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  93446. reqHeaders := make(http.Header)
  93447. for k, v := range c.header_ {
  93448. reqHeaders[k] = v
  93449. }
  93450. reqHeaders.Set("User-Agent", c.s.userAgent())
  93451. var body io.Reader = nil
  93452. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  93453. if err != nil {
  93454. return nil, err
  93455. }
  93456. reqHeaders.Set("Content-Type", "application/json")
  93457. c.urlParams_.Set("alt", alt)
  93458. c.urlParams_.Set("prettyPrint", "false")
  93459. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/addRule")
  93460. urls += "?" + c.urlParams_.Encode()
  93461. req, err := http.NewRequest("POST", urls, body)
  93462. if err != nil {
  93463. return nil, err
  93464. }
  93465. req.Header = reqHeaders
  93466. googleapi.Expand(req.URL, map[string]string{
  93467. "securityPolicy": c.securityPolicy,
  93468. })
  93469. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93470. }
  93471. // Do executes the "compute.organizationSecurityPolicies.addRule" call.
  93472. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93473. // status code is an error. Response headers are in either
  93474. // *Operation.ServerResponse.Header or (if a response was returned at
  93475. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93476. // to check whether the returned error was because
  93477. // http.StatusNotModified was returned.
  93478. func (c *OrganizationSecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93479. gensupport.SetOptions(c.urlParams_, opts...)
  93480. res, err := c.doRequest("json")
  93481. if res != nil && res.StatusCode == http.StatusNotModified {
  93482. if res.Body != nil {
  93483. res.Body.Close()
  93484. }
  93485. return nil, &googleapi.Error{
  93486. Code: res.StatusCode,
  93487. Header: res.Header,
  93488. }
  93489. }
  93490. if err != nil {
  93491. return nil, err
  93492. }
  93493. defer googleapi.CloseBody(res)
  93494. if err := googleapi.CheckResponse(res); err != nil {
  93495. return nil, err
  93496. }
  93497. ret := &Operation{
  93498. ServerResponse: googleapi.ServerResponse{
  93499. Header: res.Header,
  93500. HTTPStatusCode: res.StatusCode,
  93501. },
  93502. }
  93503. target := &ret
  93504. if err := gensupport.DecodeResponse(target, res); err != nil {
  93505. return nil, err
  93506. }
  93507. return ret, nil
  93508. // {
  93509. // "description": "Inserts a rule into a security policy.",
  93510. // "httpMethod": "POST",
  93511. // "id": "compute.organizationSecurityPolicies.addRule",
  93512. // "parameterOrder": [
  93513. // "securityPolicy"
  93514. // ],
  93515. // "parameters": {
  93516. // "requestId": {
  93517. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93518. // "location": "query",
  93519. // "type": "string"
  93520. // },
  93521. // "securityPolicy": {
  93522. // "description": "Name of the security policy to update.",
  93523. // "location": "path",
  93524. // "pattern": "[0-9]{0,20}",
  93525. // "required": true,
  93526. // "type": "string"
  93527. // }
  93528. // },
  93529. // "path": "locations/global/securityPolicies/{securityPolicy}/addRule",
  93530. // "request": {
  93531. // "$ref": "SecurityPolicyRule"
  93532. // },
  93533. // "response": {
  93534. // "$ref": "Operation"
  93535. // },
  93536. // "scopes": [
  93537. // "https://www.googleapis.com/auth/cloud-platform",
  93538. // "https://www.googleapis.com/auth/compute"
  93539. // ]
  93540. // }
  93541. }
  93542. // method id "compute.organizationSecurityPolicies.copyRules":
  93543. type OrganizationSecurityPoliciesCopyRulesCall struct {
  93544. s *Service
  93545. securityPolicy string
  93546. urlParams_ gensupport.URLParams
  93547. ctx_ context.Context
  93548. header_ http.Header
  93549. }
  93550. // CopyRules: Copies rules to the specified security policy.
  93551. func (r *OrganizationSecurityPoliciesService) CopyRules(securityPolicy string) *OrganizationSecurityPoliciesCopyRulesCall {
  93552. c := &OrganizationSecurityPoliciesCopyRulesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93553. c.securityPolicy = securityPolicy
  93554. return c
  93555. }
  93556. // RequestId sets the optional parameter "requestId": An optional
  93557. // request ID to identify requests. Specify a unique request ID so that
  93558. // if you must retry your request, the server will know to ignore the
  93559. // request if it has already been completed.
  93560. //
  93561. // For example, consider a situation where you make an initial request
  93562. // and the request times out. If you make the request again with the
  93563. // same request ID, the server can check if original operation with the
  93564. // same request ID was received, and if so, will ignore the second
  93565. // request. This prevents clients from accidentally creating duplicate
  93566. // commitments.
  93567. //
  93568. // The request ID must be a valid UUID with the exception that zero UUID
  93569. // is not supported (00000000-0000-0000-0000-000000000000).
  93570. func (c *OrganizationSecurityPoliciesCopyRulesCall) RequestId(requestId string) *OrganizationSecurityPoliciesCopyRulesCall {
  93571. c.urlParams_.Set("requestId", requestId)
  93572. return c
  93573. }
  93574. // Fields allows partial responses to be retrieved. See
  93575. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93576. // for more information.
  93577. func (c *OrganizationSecurityPoliciesCopyRulesCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesCopyRulesCall {
  93578. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93579. return c
  93580. }
  93581. // Context sets the context to be used in this call's Do method. Any
  93582. // pending HTTP request will be aborted if the provided context is
  93583. // canceled.
  93584. func (c *OrganizationSecurityPoliciesCopyRulesCall) Context(ctx context.Context) *OrganizationSecurityPoliciesCopyRulesCall {
  93585. c.ctx_ = ctx
  93586. return c
  93587. }
  93588. // Header returns an http.Header that can be modified by the caller to
  93589. // add HTTP headers to the request.
  93590. func (c *OrganizationSecurityPoliciesCopyRulesCall) Header() http.Header {
  93591. if c.header_ == nil {
  93592. c.header_ = make(http.Header)
  93593. }
  93594. return c.header_
  93595. }
  93596. func (c *OrganizationSecurityPoliciesCopyRulesCall) doRequest(alt string) (*http.Response, error) {
  93597. reqHeaders := make(http.Header)
  93598. for k, v := range c.header_ {
  93599. reqHeaders[k] = v
  93600. }
  93601. reqHeaders.Set("User-Agent", c.s.userAgent())
  93602. var body io.Reader = nil
  93603. c.urlParams_.Set("alt", alt)
  93604. c.urlParams_.Set("prettyPrint", "false")
  93605. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/copyRules")
  93606. urls += "?" + c.urlParams_.Encode()
  93607. req, err := http.NewRequest("POST", urls, body)
  93608. if err != nil {
  93609. return nil, err
  93610. }
  93611. req.Header = reqHeaders
  93612. googleapi.Expand(req.URL, map[string]string{
  93613. "securityPolicy": c.securityPolicy,
  93614. })
  93615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93616. }
  93617. // Do executes the "compute.organizationSecurityPolicies.copyRules" call.
  93618. func (c *OrganizationSecurityPoliciesCopyRulesCall) Do(opts ...googleapi.CallOption) error {
  93619. gensupport.SetOptions(c.urlParams_, opts...)
  93620. res, err := c.doRequest("json")
  93621. if err != nil {
  93622. return err
  93623. }
  93624. defer googleapi.CloseBody(res)
  93625. if err := googleapi.CheckResponse(res); err != nil {
  93626. return err
  93627. }
  93628. return nil
  93629. // {
  93630. // "description": "Copies rules to the specified security policy.",
  93631. // "httpMethod": "POST",
  93632. // "id": "compute.organizationSecurityPolicies.copyRules",
  93633. // "parameterOrder": [
  93634. // "securityPolicy"
  93635. // ],
  93636. // "parameters": {
  93637. // "requestId": {
  93638. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93639. // "location": "query",
  93640. // "type": "string"
  93641. // },
  93642. // "securityPolicy": {
  93643. // "description": "Name of the security policy to update.",
  93644. // "location": "path",
  93645. // "pattern": "[0-9]{0,20}",
  93646. // "required": true,
  93647. // "type": "string"
  93648. // }
  93649. // },
  93650. // "path": "locations/global/securityPolicies/{securityPolicy}/copyRules",
  93651. // "scopes": [
  93652. // "https://www.googleapis.com/auth/cloud-platform",
  93653. // "https://www.googleapis.com/auth/compute"
  93654. // ]
  93655. // }
  93656. }
  93657. // method id "compute.organizationSecurityPolicies.delete":
  93658. type OrganizationSecurityPoliciesDeleteCall struct {
  93659. s *Service
  93660. securityPolicy string
  93661. urlParams_ gensupport.URLParams
  93662. ctx_ context.Context
  93663. header_ http.Header
  93664. }
  93665. // Delete: Deletes the specified policy.
  93666. func (r *OrganizationSecurityPoliciesService) Delete(securityPolicy string) *OrganizationSecurityPoliciesDeleteCall {
  93667. c := &OrganizationSecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93668. c.securityPolicy = securityPolicy
  93669. return c
  93670. }
  93671. // RequestId sets the optional parameter "requestId": An optional
  93672. // request ID to identify requests. Specify a unique request ID so that
  93673. // if you must retry your request, the server will know to ignore the
  93674. // request if it has already been completed.
  93675. //
  93676. // For example, consider a situation where you make an initial request
  93677. // and the request times out. If you make the request again with the
  93678. // same request ID, the server can check if original operation with the
  93679. // same request ID was received, and if so, will ignore the second
  93680. // request. This prevents clients from accidentally creating duplicate
  93681. // commitments.
  93682. //
  93683. // The request ID must be a valid UUID with the exception that zero UUID
  93684. // is not supported (00000000-0000-0000-0000-000000000000).
  93685. func (c *OrganizationSecurityPoliciesDeleteCall) RequestId(requestId string) *OrganizationSecurityPoliciesDeleteCall {
  93686. c.urlParams_.Set("requestId", requestId)
  93687. return c
  93688. }
  93689. // Fields allows partial responses to be retrieved. See
  93690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93691. // for more information.
  93692. func (c *OrganizationSecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesDeleteCall {
  93693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93694. return c
  93695. }
  93696. // Context sets the context to be used in this call's Do method. Any
  93697. // pending HTTP request will be aborted if the provided context is
  93698. // canceled.
  93699. func (c *OrganizationSecurityPoliciesDeleteCall) Context(ctx context.Context) *OrganizationSecurityPoliciesDeleteCall {
  93700. c.ctx_ = ctx
  93701. return c
  93702. }
  93703. // Header returns an http.Header that can be modified by the caller to
  93704. // add HTTP headers to the request.
  93705. func (c *OrganizationSecurityPoliciesDeleteCall) Header() http.Header {
  93706. if c.header_ == nil {
  93707. c.header_ = make(http.Header)
  93708. }
  93709. return c.header_
  93710. }
  93711. func (c *OrganizationSecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  93712. reqHeaders := make(http.Header)
  93713. for k, v := range c.header_ {
  93714. reqHeaders[k] = v
  93715. }
  93716. reqHeaders.Set("User-Agent", c.s.userAgent())
  93717. var body io.Reader = nil
  93718. c.urlParams_.Set("alt", alt)
  93719. c.urlParams_.Set("prettyPrint", "false")
  93720. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}")
  93721. urls += "?" + c.urlParams_.Encode()
  93722. req, err := http.NewRequest("DELETE", urls, body)
  93723. if err != nil {
  93724. return nil, err
  93725. }
  93726. req.Header = reqHeaders
  93727. googleapi.Expand(req.URL, map[string]string{
  93728. "securityPolicy": c.securityPolicy,
  93729. })
  93730. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93731. }
  93732. // Do executes the "compute.organizationSecurityPolicies.delete" call.
  93733. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93734. // status code is an error. Response headers are in either
  93735. // *Operation.ServerResponse.Header or (if a response was returned at
  93736. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93737. // to check whether the returned error was because
  93738. // http.StatusNotModified was returned.
  93739. func (c *OrganizationSecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93740. gensupport.SetOptions(c.urlParams_, opts...)
  93741. res, err := c.doRequest("json")
  93742. if res != nil && res.StatusCode == http.StatusNotModified {
  93743. if res.Body != nil {
  93744. res.Body.Close()
  93745. }
  93746. return nil, &googleapi.Error{
  93747. Code: res.StatusCode,
  93748. Header: res.Header,
  93749. }
  93750. }
  93751. if err != nil {
  93752. return nil, err
  93753. }
  93754. defer googleapi.CloseBody(res)
  93755. if err := googleapi.CheckResponse(res); err != nil {
  93756. return nil, err
  93757. }
  93758. ret := &Operation{
  93759. ServerResponse: googleapi.ServerResponse{
  93760. Header: res.Header,
  93761. HTTPStatusCode: res.StatusCode,
  93762. },
  93763. }
  93764. target := &ret
  93765. if err := gensupport.DecodeResponse(target, res); err != nil {
  93766. return nil, err
  93767. }
  93768. return ret, nil
  93769. // {
  93770. // "description": "Deletes the specified policy.",
  93771. // "httpMethod": "DELETE",
  93772. // "id": "compute.organizationSecurityPolicies.delete",
  93773. // "parameterOrder": [
  93774. // "securityPolicy"
  93775. // ],
  93776. // "parameters": {
  93777. // "requestId": {
  93778. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93779. // "location": "query",
  93780. // "type": "string"
  93781. // },
  93782. // "securityPolicy": {
  93783. // "description": "Name of the security policy to delete.",
  93784. // "location": "path",
  93785. // "pattern": "[0-9]{0,20}",
  93786. // "required": true,
  93787. // "type": "string"
  93788. // }
  93789. // },
  93790. // "path": "locations/global/securityPolicies/{securityPolicy}",
  93791. // "response": {
  93792. // "$ref": "Operation"
  93793. // },
  93794. // "scopes": [
  93795. // "https://www.googleapis.com/auth/cloud-platform",
  93796. // "https://www.googleapis.com/auth/compute"
  93797. // ]
  93798. // }
  93799. }
  93800. // method id "compute.organizationSecurityPolicies.get":
  93801. type OrganizationSecurityPoliciesGetCall struct {
  93802. s *Service
  93803. securityPolicy string
  93804. urlParams_ gensupport.URLParams
  93805. ifNoneMatch_ string
  93806. ctx_ context.Context
  93807. header_ http.Header
  93808. }
  93809. // Get: List all of the ordered rules present in a single specified
  93810. // policy.
  93811. func (r *OrganizationSecurityPoliciesService) Get(securityPolicy string) *OrganizationSecurityPoliciesGetCall {
  93812. c := &OrganizationSecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93813. c.securityPolicy = securityPolicy
  93814. return c
  93815. }
  93816. // Fields allows partial responses to be retrieved. See
  93817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93818. // for more information.
  93819. func (c *OrganizationSecurityPoliciesGetCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetCall {
  93820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93821. return c
  93822. }
  93823. // IfNoneMatch sets the optional parameter which makes the operation
  93824. // fail if the object's ETag matches the given value. This is useful for
  93825. // getting updates only after the object has changed since the last
  93826. // request. Use googleapi.IsNotModified to check whether the response
  93827. // error from Do is the result of In-None-Match.
  93828. func (c *OrganizationSecurityPoliciesGetCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetCall {
  93829. c.ifNoneMatch_ = entityTag
  93830. return c
  93831. }
  93832. // Context sets the context to be used in this call's Do method. Any
  93833. // pending HTTP request will be aborted if the provided context is
  93834. // canceled.
  93835. func (c *OrganizationSecurityPoliciesGetCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetCall {
  93836. c.ctx_ = ctx
  93837. return c
  93838. }
  93839. // Header returns an http.Header that can be modified by the caller to
  93840. // add HTTP headers to the request.
  93841. func (c *OrganizationSecurityPoliciesGetCall) Header() http.Header {
  93842. if c.header_ == nil {
  93843. c.header_ = make(http.Header)
  93844. }
  93845. return c.header_
  93846. }
  93847. func (c *OrganizationSecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  93848. reqHeaders := make(http.Header)
  93849. for k, v := range c.header_ {
  93850. reqHeaders[k] = v
  93851. }
  93852. reqHeaders.Set("User-Agent", c.s.userAgent())
  93853. if c.ifNoneMatch_ != "" {
  93854. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93855. }
  93856. var body io.Reader = nil
  93857. c.urlParams_.Set("alt", alt)
  93858. c.urlParams_.Set("prettyPrint", "false")
  93859. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}")
  93860. urls += "?" + c.urlParams_.Encode()
  93861. req, err := http.NewRequest("GET", urls, body)
  93862. if err != nil {
  93863. return nil, err
  93864. }
  93865. req.Header = reqHeaders
  93866. googleapi.Expand(req.URL, map[string]string{
  93867. "securityPolicy": c.securityPolicy,
  93868. })
  93869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93870. }
  93871. // Do executes the "compute.organizationSecurityPolicies.get" call.
  93872. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  93873. // status code is an error. Response headers are in either
  93874. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  93875. // at all) in error.(*googleapi.Error).Header. Use
  93876. // googleapi.IsNotModified to check whether the returned error was
  93877. // because http.StatusNotModified was returned.
  93878. func (c *OrganizationSecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  93879. gensupport.SetOptions(c.urlParams_, opts...)
  93880. res, err := c.doRequest("json")
  93881. if res != nil && res.StatusCode == http.StatusNotModified {
  93882. if res.Body != nil {
  93883. res.Body.Close()
  93884. }
  93885. return nil, &googleapi.Error{
  93886. Code: res.StatusCode,
  93887. Header: res.Header,
  93888. }
  93889. }
  93890. if err != nil {
  93891. return nil, err
  93892. }
  93893. defer googleapi.CloseBody(res)
  93894. if err := googleapi.CheckResponse(res); err != nil {
  93895. return nil, err
  93896. }
  93897. ret := &SecurityPolicy{
  93898. ServerResponse: googleapi.ServerResponse{
  93899. Header: res.Header,
  93900. HTTPStatusCode: res.StatusCode,
  93901. },
  93902. }
  93903. target := &ret
  93904. if err := gensupport.DecodeResponse(target, res); err != nil {
  93905. return nil, err
  93906. }
  93907. return ret, nil
  93908. // {
  93909. // "description": "List all of the ordered rules present in a single specified policy.",
  93910. // "httpMethod": "GET",
  93911. // "id": "compute.organizationSecurityPolicies.get",
  93912. // "parameterOrder": [
  93913. // "securityPolicy"
  93914. // ],
  93915. // "parameters": {
  93916. // "securityPolicy": {
  93917. // "description": "Name of the security policy to get.",
  93918. // "location": "path",
  93919. // "pattern": "[0-9]{0,20}",
  93920. // "required": true,
  93921. // "type": "string"
  93922. // }
  93923. // },
  93924. // "path": "locations/global/securityPolicies/{securityPolicy}",
  93925. // "response": {
  93926. // "$ref": "SecurityPolicy"
  93927. // },
  93928. // "scopes": [
  93929. // "https://www.googleapis.com/auth/cloud-platform",
  93930. // "https://www.googleapis.com/auth/compute",
  93931. // "https://www.googleapis.com/auth/compute.readonly"
  93932. // ]
  93933. // }
  93934. }
  93935. // method id "compute.organizationSecurityPolicies.getAssociation":
  93936. type OrganizationSecurityPoliciesGetAssociationCall struct {
  93937. s *Service
  93938. securityPolicy string
  93939. urlParams_ gensupport.URLParams
  93940. ifNoneMatch_ string
  93941. ctx_ context.Context
  93942. header_ http.Header
  93943. }
  93944. // GetAssociation: Gets an association with the specified name.
  93945. func (r *OrganizationSecurityPoliciesService) GetAssociation(securityPolicy string) *OrganizationSecurityPoliciesGetAssociationCall {
  93946. c := &OrganizationSecurityPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93947. c.securityPolicy = securityPolicy
  93948. return c
  93949. }
  93950. // Name sets the optional parameter "name": The name of the association
  93951. // to get from the security policy.
  93952. func (c *OrganizationSecurityPoliciesGetAssociationCall) Name(name string) *OrganizationSecurityPoliciesGetAssociationCall {
  93953. c.urlParams_.Set("name", name)
  93954. return c
  93955. }
  93956. // Fields allows partial responses to be retrieved. See
  93957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93958. // for more information.
  93959. func (c *OrganizationSecurityPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetAssociationCall {
  93960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93961. return c
  93962. }
  93963. // IfNoneMatch sets the optional parameter which makes the operation
  93964. // fail if the object's ETag matches the given value. This is useful for
  93965. // getting updates only after the object has changed since the last
  93966. // request. Use googleapi.IsNotModified to check whether the response
  93967. // error from Do is the result of In-None-Match.
  93968. func (c *OrganizationSecurityPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetAssociationCall {
  93969. c.ifNoneMatch_ = entityTag
  93970. return c
  93971. }
  93972. // Context sets the context to be used in this call's Do method. Any
  93973. // pending HTTP request will be aborted if the provided context is
  93974. // canceled.
  93975. func (c *OrganizationSecurityPoliciesGetAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetAssociationCall {
  93976. c.ctx_ = ctx
  93977. return c
  93978. }
  93979. // Header returns an http.Header that can be modified by the caller to
  93980. // add HTTP headers to the request.
  93981. func (c *OrganizationSecurityPoliciesGetAssociationCall) Header() http.Header {
  93982. if c.header_ == nil {
  93983. c.header_ = make(http.Header)
  93984. }
  93985. return c.header_
  93986. }
  93987. func (c *OrganizationSecurityPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) {
  93988. reqHeaders := make(http.Header)
  93989. for k, v := range c.header_ {
  93990. reqHeaders[k] = v
  93991. }
  93992. reqHeaders.Set("User-Agent", c.s.userAgent())
  93993. if c.ifNoneMatch_ != "" {
  93994. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93995. }
  93996. var body io.Reader = nil
  93997. c.urlParams_.Set("alt", alt)
  93998. c.urlParams_.Set("prettyPrint", "false")
  93999. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getAssociation")
  94000. urls += "?" + c.urlParams_.Encode()
  94001. req, err := http.NewRequest("GET", urls, body)
  94002. if err != nil {
  94003. return nil, err
  94004. }
  94005. req.Header = reqHeaders
  94006. googleapi.Expand(req.URL, map[string]string{
  94007. "securityPolicy": c.securityPolicy,
  94008. })
  94009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94010. }
  94011. // Do executes the "compute.organizationSecurityPolicies.getAssociation" call.
  94012. // Exactly one of *SecurityPolicyAssociation or error will be non-nil.
  94013. // Any non-2xx status code is an error. Response headers are in either
  94014. // *SecurityPolicyAssociation.ServerResponse.Header or (if a response
  94015. // was returned at all) in error.(*googleapi.Error).Header. Use
  94016. // googleapi.IsNotModified to check whether the returned error was
  94017. // because http.StatusNotModified was returned.
  94018. func (c *OrganizationSecurityPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyAssociation, error) {
  94019. gensupport.SetOptions(c.urlParams_, opts...)
  94020. res, err := c.doRequest("json")
  94021. if res != nil && res.StatusCode == http.StatusNotModified {
  94022. if res.Body != nil {
  94023. res.Body.Close()
  94024. }
  94025. return nil, &googleapi.Error{
  94026. Code: res.StatusCode,
  94027. Header: res.Header,
  94028. }
  94029. }
  94030. if err != nil {
  94031. return nil, err
  94032. }
  94033. defer googleapi.CloseBody(res)
  94034. if err := googleapi.CheckResponse(res); err != nil {
  94035. return nil, err
  94036. }
  94037. ret := &SecurityPolicyAssociation{
  94038. ServerResponse: googleapi.ServerResponse{
  94039. Header: res.Header,
  94040. HTTPStatusCode: res.StatusCode,
  94041. },
  94042. }
  94043. target := &ret
  94044. if err := gensupport.DecodeResponse(target, res); err != nil {
  94045. return nil, err
  94046. }
  94047. return ret, nil
  94048. // {
  94049. // "description": "Gets an association with the specified name.",
  94050. // "httpMethod": "GET",
  94051. // "id": "compute.organizationSecurityPolicies.getAssociation",
  94052. // "parameterOrder": [
  94053. // "securityPolicy"
  94054. // ],
  94055. // "parameters": {
  94056. // "name": {
  94057. // "description": "The name of the association to get from the security policy.",
  94058. // "location": "query",
  94059. // "type": "string"
  94060. // },
  94061. // "securityPolicy": {
  94062. // "description": "Name of the security policy to which the queried rule belongs.",
  94063. // "location": "path",
  94064. // "pattern": "[0-9]{0,20}",
  94065. // "required": true,
  94066. // "type": "string"
  94067. // }
  94068. // },
  94069. // "path": "locations/global/securityPolicies/{securityPolicy}/getAssociation",
  94070. // "response": {
  94071. // "$ref": "SecurityPolicyAssociation"
  94072. // },
  94073. // "scopes": [
  94074. // "https://www.googleapis.com/auth/cloud-platform",
  94075. // "https://www.googleapis.com/auth/compute",
  94076. // "https://www.googleapis.com/auth/compute.readonly"
  94077. // ]
  94078. // }
  94079. }
  94080. // method id "compute.organizationSecurityPolicies.getRule":
  94081. type OrganizationSecurityPoliciesGetRuleCall struct {
  94082. s *Service
  94083. securityPolicy string
  94084. urlParams_ gensupport.URLParams
  94085. ifNoneMatch_ string
  94086. ctx_ context.Context
  94087. header_ http.Header
  94088. }
  94089. // GetRule: Gets a rule at the specified priority.
  94090. func (r *OrganizationSecurityPoliciesService) GetRule(securityPolicy string) *OrganizationSecurityPoliciesGetRuleCall {
  94091. c := &OrganizationSecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94092. c.securityPolicy = securityPolicy
  94093. return c
  94094. }
  94095. // Priority sets the optional parameter "priority": The priority of the
  94096. // rule to get from the security policy.
  94097. func (c *OrganizationSecurityPoliciesGetRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesGetRuleCall {
  94098. c.urlParams_.Set("priority", fmt.Sprint(priority))
  94099. return c
  94100. }
  94101. // Fields allows partial responses to be retrieved. See
  94102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94103. // for more information.
  94104. func (c *OrganizationSecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesGetRuleCall {
  94105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94106. return c
  94107. }
  94108. // IfNoneMatch sets the optional parameter which makes the operation
  94109. // fail if the object's ETag matches the given value. This is useful for
  94110. // getting updates only after the object has changed since the last
  94111. // request. Use googleapi.IsNotModified to check whether the response
  94112. // error from Do is the result of In-None-Match.
  94113. func (c *OrganizationSecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesGetRuleCall {
  94114. c.ifNoneMatch_ = entityTag
  94115. return c
  94116. }
  94117. // Context sets the context to be used in this call's Do method. Any
  94118. // pending HTTP request will be aborted if the provided context is
  94119. // canceled.
  94120. func (c *OrganizationSecurityPoliciesGetRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesGetRuleCall {
  94121. c.ctx_ = ctx
  94122. return c
  94123. }
  94124. // Header returns an http.Header that can be modified by the caller to
  94125. // add HTTP headers to the request.
  94126. func (c *OrganizationSecurityPoliciesGetRuleCall) Header() http.Header {
  94127. if c.header_ == nil {
  94128. c.header_ = make(http.Header)
  94129. }
  94130. return c.header_
  94131. }
  94132. func (c *OrganizationSecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  94133. reqHeaders := make(http.Header)
  94134. for k, v := range c.header_ {
  94135. reqHeaders[k] = v
  94136. }
  94137. reqHeaders.Set("User-Agent", c.s.userAgent())
  94138. if c.ifNoneMatch_ != "" {
  94139. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94140. }
  94141. var body io.Reader = nil
  94142. c.urlParams_.Set("alt", alt)
  94143. c.urlParams_.Set("prettyPrint", "false")
  94144. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/getRule")
  94145. urls += "?" + c.urlParams_.Encode()
  94146. req, err := http.NewRequest("GET", urls, body)
  94147. if err != nil {
  94148. return nil, err
  94149. }
  94150. req.Header = reqHeaders
  94151. googleapi.Expand(req.URL, map[string]string{
  94152. "securityPolicy": c.securityPolicy,
  94153. })
  94154. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94155. }
  94156. // Do executes the "compute.organizationSecurityPolicies.getRule" call.
  94157. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  94158. // non-2xx status code is an error. Response headers are in either
  94159. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  94160. // returned at all) in error.(*googleapi.Error).Header. Use
  94161. // googleapi.IsNotModified to check whether the returned error was
  94162. // because http.StatusNotModified was returned.
  94163. func (c *OrganizationSecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  94164. gensupport.SetOptions(c.urlParams_, opts...)
  94165. res, err := c.doRequest("json")
  94166. if res != nil && res.StatusCode == http.StatusNotModified {
  94167. if res.Body != nil {
  94168. res.Body.Close()
  94169. }
  94170. return nil, &googleapi.Error{
  94171. Code: res.StatusCode,
  94172. Header: res.Header,
  94173. }
  94174. }
  94175. if err != nil {
  94176. return nil, err
  94177. }
  94178. defer googleapi.CloseBody(res)
  94179. if err := googleapi.CheckResponse(res); err != nil {
  94180. return nil, err
  94181. }
  94182. ret := &SecurityPolicyRule{
  94183. ServerResponse: googleapi.ServerResponse{
  94184. Header: res.Header,
  94185. HTTPStatusCode: res.StatusCode,
  94186. },
  94187. }
  94188. target := &ret
  94189. if err := gensupport.DecodeResponse(target, res); err != nil {
  94190. return nil, err
  94191. }
  94192. return ret, nil
  94193. // {
  94194. // "description": "Gets a rule at the specified priority.",
  94195. // "httpMethod": "GET",
  94196. // "id": "compute.organizationSecurityPolicies.getRule",
  94197. // "parameterOrder": [
  94198. // "securityPolicy"
  94199. // ],
  94200. // "parameters": {
  94201. // "priority": {
  94202. // "description": "The priority of the rule to get from the security policy.",
  94203. // "format": "int32",
  94204. // "location": "query",
  94205. // "type": "integer"
  94206. // },
  94207. // "securityPolicy": {
  94208. // "description": "Name of the security policy to which the queried rule belongs.",
  94209. // "location": "path",
  94210. // "pattern": "[0-9]{0,20}",
  94211. // "required": true,
  94212. // "type": "string"
  94213. // }
  94214. // },
  94215. // "path": "locations/global/securityPolicies/{securityPolicy}/getRule",
  94216. // "response": {
  94217. // "$ref": "SecurityPolicyRule"
  94218. // },
  94219. // "scopes": [
  94220. // "https://www.googleapis.com/auth/cloud-platform",
  94221. // "https://www.googleapis.com/auth/compute",
  94222. // "https://www.googleapis.com/auth/compute.readonly"
  94223. // ]
  94224. // }
  94225. }
  94226. // method id "compute.organizationSecurityPolicies.insert":
  94227. type OrganizationSecurityPoliciesInsertCall struct {
  94228. s *Service
  94229. securitypolicy *SecurityPolicy
  94230. urlParams_ gensupport.URLParams
  94231. ctx_ context.Context
  94232. header_ http.Header
  94233. }
  94234. // Insert: Creates a new policy in the specified project using the data
  94235. // included in the request.
  94236. func (r *OrganizationSecurityPoliciesService) Insert(securitypolicy *SecurityPolicy) *OrganizationSecurityPoliciesInsertCall {
  94237. c := &OrganizationSecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94238. c.securitypolicy = securitypolicy
  94239. return c
  94240. }
  94241. // ParentId sets the optional parameter "parentId": Parent ID for this
  94242. // request.
  94243. func (c *OrganizationSecurityPoliciesInsertCall) ParentId(parentId string) *OrganizationSecurityPoliciesInsertCall {
  94244. c.urlParams_.Set("parentId", parentId)
  94245. return c
  94246. }
  94247. // RequestId sets the optional parameter "requestId": An optional
  94248. // request ID to identify requests. Specify a unique request ID so that
  94249. // if you must retry your request, the server will know to ignore the
  94250. // request if it has already been completed.
  94251. //
  94252. // For example, consider a situation where you make an initial request
  94253. // and the request times out. If you make the request again with the
  94254. // same request ID, the server can check if original operation with the
  94255. // same request ID was received, and if so, will ignore the second
  94256. // request. This prevents clients from accidentally creating duplicate
  94257. // commitments.
  94258. //
  94259. // The request ID must be a valid UUID with the exception that zero UUID
  94260. // is not supported (00000000-0000-0000-0000-000000000000).
  94261. func (c *OrganizationSecurityPoliciesInsertCall) RequestId(requestId string) *OrganizationSecurityPoliciesInsertCall {
  94262. c.urlParams_.Set("requestId", requestId)
  94263. return c
  94264. }
  94265. // Fields allows partial responses to be retrieved. See
  94266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94267. // for more information.
  94268. func (c *OrganizationSecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesInsertCall {
  94269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94270. return c
  94271. }
  94272. // Context sets the context to be used in this call's Do method. Any
  94273. // pending HTTP request will be aborted if the provided context is
  94274. // canceled.
  94275. func (c *OrganizationSecurityPoliciesInsertCall) Context(ctx context.Context) *OrganizationSecurityPoliciesInsertCall {
  94276. c.ctx_ = ctx
  94277. return c
  94278. }
  94279. // Header returns an http.Header that can be modified by the caller to
  94280. // add HTTP headers to the request.
  94281. func (c *OrganizationSecurityPoliciesInsertCall) Header() http.Header {
  94282. if c.header_ == nil {
  94283. c.header_ = make(http.Header)
  94284. }
  94285. return c.header_
  94286. }
  94287. func (c *OrganizationSecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  94288. reqHeaders := make(http.Header)
  94289. for k, v := range c.header_ {
  94290. reqHeaders[k] = v
  94291. }
  94292. reqHeaders.Set("User-Agent", c.s.userAgent())
  94293. var body io.Reader = nil
  94294. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  94295. if err != nil {
  94296. return nil, err
  94297. }
  94298. reqHeaders.Set("Content-Type", "application/json")
  94299. c.urlParams_.Set("alt", alt)
  94300. c.urlParams_.Set("prettyPrint", "false")
  94301. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies")
  94302. urls += "?" + c.urlParams_.Encode()
  94303. req, err := http.NewRequest("POST", urls, body)
  94304. if err != nil {
  94305. return nil, err
  94306. }
  94307. req.Header = reqHeaders
  94308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94309. }
  94310. // Do executes the "compute.organizationSecurityPolicies.insert" call.
  94311. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94312. // status code is an error. Response headers are in either
  94313. // *Operation.ServerResponse.Header or (if a response was returned at
  94314. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94315. // to check whether the returned error was because
  94316. // http.StatusNotModified was returned.
  94317. func (c *OrganizationSecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94318. gensupport.SetOptions(c.urlParams_, opts...)
  94319. res, err := c.doRequest("json")
  94320. if res != nil && res.StatusCode == http.StatusNotModified {
  94321. if res.Body != nil {
  94322. res.Body.Close()
  94323. }
  94324. return nil, &googleapi.Error{
  94325. Code: res.StatusCode,
  94326. Header: res.Header,
  94327. }
  94328. }
  94329. if err != nil {
  94330. return nil, err
  94331. }
  94332. defer googleapi.CloseBody(res)
  94333. if err := googleapi.CheckResponse(res); err != nil {
  94334. return nil, err
  94335. }
  94336. ret := &Operation{
  94337. ServerResponse: googleapi.ServerResponse{
  94338. Header: res.Header,
  94339. HTTPStatusCode: res.StatusCode,
  94340. },
  94341. }
  94342. target := &ret
  94343. if err := gensupport.DecodeResponse(target, res); err != nil {
  94344. return nil, err
  94345. }
  94346. return ret, nil
  94347. // {
  94348. // "description": "Creates a new policy in the specified project using the data included in the request.",
  94349. // "httpMethod": "POST",
  94350. // "id": "compute.organizationSecurityPolicies.insert",
  94351. // "parameters": {
  94352. // "parentId": {
  94353. // "description": "Parent ID for this request.",
  94354. // "location": "query",
  94355. // "type": "string"
  94356. // },
  94357. // "requestId": {
  94358. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94359. // "location": "query",
  94360. // "type": "string"
  94361. // }
  94362. // },
  94363. // "path": "locations/global/securityPolicies",
  94364. // "request": {
  94365. // "$ref": "SecurityPolicy"
  94366. // },
  94367. // "response": {
  94368. // "$ref": "Operation"
  94369. // },
  94370. // "scopes": [
  94371. // "https://www.googleapis.com/auth/cloud-platform",
  94372. // "https://www.googleapis.com/auth/compute"
  94373. // ]
  94374. // }
  94375. }
  94376. // method id "compute.organizationSecurityPolicies.list":
  94377. type OrganizationSecurityPoliciesListCall struct {
  94378. s *Service
  94379. urlParams_ gensupport.URLParams
  94380. ifNoneMatch_ string
  94381. ctx_ context.Context
  94382. header_ http.Header
  94383. }
  94384. // List: List all the policies that have been configured for the
  94385. // specified project.
  94386. func (r *OrganizationSecurityPoliciesService) List() *OrganizationSecurityPoliciesListCall {
  94387. c := &OrganizationSecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94388. return c
  94389. }
  94390. // Filter sets the optional parameter "filter": A filter expression that
  94391. // filters resources listed in the response. The expression must specify
  94392. // the field name, a comparison operator, and the value that you want to
  94393. // use for filtering. The value must be a string, a number, or a
  94394. // boolean. The comparison operator must be either =, !=, >, or <.
  94395. //
  94396. // For example, if you are filtering Compute Engine instances, you can
  94397. // exclude instances named example-instance by specifying name !=
  94398. // example-instance.
  94399. //
  94400. // You can also filter nested fields. For example, you could specify
  94401. // scheduling.automaticRestart = false to include instances only if they
  94402. // are not scheduled for automatic restarts. You can use filtering on
  94403. // nested fields to filter based on resource labels.
  94404. //
  94405. // To filter on multiple expressions, provide each separate expression
  94406. // within parentheses. For example, (scheduling.automaticRestart = true)
  94407. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94408. // AND expression. However, you can include AND and OR expressions
  94409. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94410. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94411. // true).
  94412. func (c *OrganizationSecurityPoliciesListCall) Filter(filter string) *OrganizationSecurityPoliciesListCall {
  94413. c.urlParams_.Set("filter", filter)
  94414. return c
  94415. }
  94416. // MaxResults sets the optional parameter "maxResults": The maximum
  94417. // number of results per page that should be returned. If the number of
  94418. // available results is larger than maxResults, Compute Engine returns a
  94419. // nextPageToken that can be used to get the next page of results in
  94420. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94421. // (Default: 500)
  94422. func (c *OrganizationSecurityPoliciesListCall) MaxResults(maxResults int64) *OrganizationSecurityPoliciesListCall {
  94423. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94424. return c
  94425. }
  94426. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94427. // a certain order. By default, results are returned in alphanumerical
  94428. // order based on the resource name.
  94429. //
  94430. // You can also sort results in descending order based on the creation
  94431. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94432. // based on the creationTimestamp field in reverse chronological order
  94433. // (newest result first). Use this to sort resources like operations so
  94434. // that the newest operation is returned first.
  94435. //
  94436. // Currently, only sorting by name or creationTimestamp desc is
  94437. // supported.
  94438. func (c *OrganizationSecurityPoliciesListCall) OrderBy(orderBy string) *OrganizationSecurityPoliciesListCall {
  94439. c.urlParams_.Set("orderBy", orderBy)
  94440. return c
  94441. }
  94442. // PageToken sets the optional parameter "pageToken": Specifies a page
  94443. // token to use. Set pageToken to the nextPageToken returned by a
  94444. // previous list request to get the next page of results.
  94445. func (c *OrganizationSecurityPoliciesListCall) PageToken(pageToken string) *OrganizationSecurityPoliciesListCall {
  94446. c.urlParams_.Set("pageToken", pageToken)
  94447. return c
  94448. }
  94449. // ParentId sets the optional parameter "parentId": Parent ID for this
  94450. // request.
  94451. func (c *OrganizationSecurityPoliciesListCall) ParentId(parentId string) *OrganizationSecurityPoliciesListCall {
  94452. c.urlParams_.Set("parentId", parentId)
  94453. return c
  94454. }
  94455. // Fields allows partial responses to be retrieved. See
  94456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94457. // for more information.
  94458. func (c *OrganizationSecurityPoliciesListCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesListCall {
  94459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94460. return c
  94461. }
  94462. // IfNoneMatch sets the optional parameter which makes the operation
  94463. // fail if the object's ETag matches the given value. This is useful for
  94464. // getting updates only after the object has changed since the last
  94465. // request. Use googleapi.IsNotModified to check whether the response
  94466. // error from Do is the result of In-None-Match.
  94467. func (c *OrganizationSecurityPoliciesListCall) IfNoneMatch(entityTag string) *OrganizationSecurityPoliciesListCall {
  94468. c.ifNoneMatch_ = entityTag
  94469. return c
  94470. }
  94471. // Context sets the context to be used in this call's Do method. Any
  94472. // pending HTTP request will be aborted if the provided context is
  94473. // canceled.
  94474. func (c *OrganizationSecurityPoliciesListCall) Context(ctx context.Context) *OrganizationSecurityPoliciesListCall {
  94475. c.ctx_ = ctx
  94476. return c
  94477. }
  94478. // Header returns an http.Header that can be modified by the caller to
  94479. // add HTTP headers to the request.
  94480. func (c *OrganizationSecurityPoliciesListCall) Header() http.Header {
  94481. if c.header_ == nil {
  94482. c.header_ = make(http.Header)
  94483. }
  94484. return c.header_
  94485. }
  94486. func (c *OrganizationSecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  94487. reqHeaders := make(http.Header)
  94488. for k, v := range c.header_ {
  94489. reqHeaders[k] = v
  94490. }
  94491. reqHeaders.Set("User-Agent", c.s.userAgent())
  94492. if c.ifNoneMatch_ != "" {
  94493. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94494. }
  94495. var body io.Reader = nil
  94496. c.urlParams_.Set("alt", alt)
  94497. c.urlParams_.Set("prettyPrint", "false")
  94498. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies")
  94499. urls += "?" + c.urlParams_.Encode()
  94500. req, err := http.NewRequest("GET", urls, body)
  94501. if err != nil {
  94502. return nil, err
  94503. }
  94504. req.Header = reqHeaders
  94505. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94506. }
  94507. // Do executes the "compute.organizationSecurityPolicies.list" call.
  94508. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  94509. // non-2xx status code is an error. Response headers are in either
  94510. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  94511. // returned at all) in error.(*googleapi.Error).Header. Use
  94512. // googleapi.IsNotModified to check whether the returned error was
  94513. // because http.StatusNotModified was returned.
  94514. func (c *OrganizationSecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  94515. gensupport.SetOptions(c.urlParams_, opts...)
  94516. res, err := c.doRequest("json")
  94517. if res != nil && res.StatusCode == http.StatusNotModified {
  94518. if res.Body != nil {
  94519. res.Body.Close()
  94520. }
  94521. return nil, &googleapi.Error{
  94522. Code: res.StatusCode,
  94523. Header: res.Header,
  94524. }
  94525. }
  94526. if err != nil {
  94527. return nil, err
  94528. }
  94529. defer googleapi.CloseBody(res)
  94530. if err := googleapi.CheckResponse(res); err != nil {
  94531. return nil, err
  94532. }
  94533. ret := &SecurityPolicyList{
  94534. ServerResponse: googleapi.ServerResponse{
  94535. Header: res.Header,
  94536. HTTPStatusCode: res.StatusCode,
  94537. },
  94538. }
  94539. target := &ret
  94540. if err := gensupport.DecodeResponse(target, res); err != nil {
  94541. return nil, err
  94542. }
  94543. return ret, nil
  94544. // {
  94545. // "description": "List all the policies that have been configured for the specified project.",
  94546. // "httpMethod": "GET",
  94547. // "id": "compute.organizationSecurityPolicies.list",
  94548. // "parameters": {
  94549. // "filter": {
  94550. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  94551. // "location": "query",
  94552. // "type": "string"
  94553. // },
  94554. // "maxResults": {
  94555. // "default": "500",
  94556. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  94557. // "format": "uint32",
  94558. // "location": "query",
  94559. // "minimum": "0",
  94560. // "type": "integer"
  94561. // },
  94562. // "orderBy": {
  94563. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  94564. // "location": "query",
  94565. // "type": "string"
  94566. // },
  94567. // "pageToken": {
  94568. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  94569. // "location": "query",
  94570. // "type": "string"
  94571. // },
  94572. // "parentId": {
  94573. // "description": "Parent ID for this request.",
  94574. // "location": "query",
  94575. // "type": "string"
  94576. // }
  94577. // },
  94578. // "path": "locations/global/securityPolicies",
  94579. // "response": {
  94580. // "$ref": "SecurityPolicyList"
  94581. // },
  94582. // "scopes": [
  94583. // "https://www.googleapis.com/auth/cloud-platform",
  94584. // "https://www.googleapis.com/auth/compute",
  94585. // "https://www.googleapis.com/auth/compute.readonly"
  94586. // ]
  94587. // }
  94588. }
  94589. // Pages invokes f for each page of results.
  94590. // A non-nil error returned from f will halt the iteration.
  94591. // The provided context supersedes any context provided to the Context method.
  94592. func (c *OrganizationSecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  94593. c.ctx_ = ctx
  94594. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94595. for {
  94596. x, err := c.Do()
  94597. if err != nil {
  94598. return err
  94599. }
  94600. if err := f(x); err != nil {
  94601. return err
  94602. }
  94603. if x.NextPageToken == "" {
  94604. return nil
  94605. }
  94606. c.PageToken(x.NextPageToken)
  94607. }
  94608. }
  94609. // method id "compute.organizationSecurityPolicies.move":
  94610. type OrganizationSecurityPoliciesMoveCall struct {
  94611. s *Service
  94612. securityPolicy string
  94613. urlParams_ gensupport.URLParams
  94614. ctx_ context.Context
  94615. header_ http.Header
  94616. }
  94617. // Move: Moves the specified security policy.
  94618. func (r *OrganizationSecurityPoliciesService) Move(securityPolicy string) *OrganizationSecurityPoliciesMoveCall {
  94619. c := &OrganizationSecurityPoliciesMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94620. c.securityPolicy = securityPolicy
  94621. return c
  94622. }
  94623. // RequestId sets the optional parameter "requestId": An optional
  94624. // request ID to identify requests. Specify a unique request ID so that
  94625. // if you must retry your request, the server will know to ignore the
  94626. // request if it has already been completed.
  94627. //
  94628. // For example, consider a situation where you make an initial request
  94629. // and the request times out. If you make the request again with the
  94630. // same request ID, the server can check if original operation with the
  94631. // same request ID was received, and if so, will ignore the second
  94632. // request. This prevents clients from accidentally creating duplicate
  94633. // commitments.
  94634. //
  94635. // The request ID must be a valid UUID with the exception that zero UUID
  94636. // is not supported (00000000-0000-0000-0000-000000000000).
  94637. func (c *OrganizationSecurityPoliciesMoveCall) RequestId(requestId string) *OrganizationSecurityPoliciesMoveCall {
  94638. c.urlParams_.Set("requestId", requestId)
  94639. return c
  94640. }
  94641. // Fields allows partial responses to be retrieved. See
  94642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94643. // for more information.
  94644. func (c *OrganizationSecurityPoliciesMoveCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesMoveCall {
  94645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94646. return c
  94647. }
  94648. // Context sets the context to be used in this call's Do method. Any
  94649. // pending HTTP request will be aborted if the provided context is
  94650. // canceled.
  94651. func (c *OrganizationSecurityPoliciesMoveCall) Context(ctx context.Context) *OrganizationSecurityPoliciesMoveCall {
  94652. c.ctx_ = ctx
  94653. return c
  94654. }
  94655. // Header returns an http.Header that can be modified by the caller to
  94656. // add HTTP headers to the request.
  94657. func (c *OrganizationSecurityPoliciesMoveCall) Header() http.Header {
  94658. if c.header_ == nil {
  94659. c.header_ = make(http.Header)
  94660. }
  94661. return c.header_
  94662. }
  94663. func (c *OrganizationSecurityPoliciesMoveCall) doRequest(alt string) (*http.Response, error) {
  94664. reqHeaders := make(http.Header)
  94665. for k, v := range c.header_ {
  94666. reqHeaders[k] = v
  94667. }
  94668. reqHeaders.Set("User-Agent", c.s.userAgent())
  94669. var body io.Reader = nil
  94670. c.urlParams_.Set("alt", alt)
  94671. c.urlParams_.Set("prettyPrint", "false")
  94672. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/move")
  94673. urls += "?" + c.urlParams_.Encode()
  94674. req, err := http.NewRequest("POST", urls, body)
  94675. if err != nil {
  94676. return nil, err
  94677. }
  94678. req.Header = reqHeaders
  94679. googleapi.Expand(req.URL, map[string]string{
  94680. "securityPolicy": c.securityPolicy,
  94681. })
  94682. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94683. }
  94684. // Do executes the "compute.organizationSecurityPolicies.move" call.
  94685. func (c *OrganizationSecurityPoliciesMoveCall) Do(opts ...googleapi.CallOption) error {
  94686. gensupport.SetOptions(c.urlParams_, opts...)
  94687. res, err := c.doRequest("json")
  94688. if err != nil {
  94689. return err
  94690. }
  94691. defer googleapi.CloseBody(res)
  94692. if err := googleapi.CheckResponse(res); err != nil {
  94693. return err
  94694. }
  94695. return nil
  94696. // {
  94697. // "description": "Moves the specified security policy.",
  94698. // "httpMethod": "POST",
  94699. // "id": "compute.organizationSecurityPolicies.move",
  94700. // "parameterOrder": [
  94701. // "securityPolicy"
  94702. // ],
  94703. // "parameters": {
  94704. // "requestId": {
  94705. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94706. // "location": "query",
  94707. // "type": "string"
  94708. // },
  94709. // "securityPolicy": {
  94710. // "description": "Name of the security policy to update.",
  94711. // "location": "path",
  94712. // "pattern": "[0-9]{0,20}",
  94713. // "required": true,
  94714. // "type": "string"
  94715. // }
  94716. // },
  94717. // "path": "locations/global/securityPolicies/{securityPolicy}/move",
  94718. // "scopes": [
  94719. // "https://www.googleapis.com/auth/cloud-platform",
  94720. // "https://www.googleapis.com/auth/compute"
  94721. // ]
  94722. // }
  94723. }
  94724. // method id "compute.organizationSecurityPolicies.patch":
  94725. type OrganizationSecurityPoliciesPatchCall struct {
  94726. s *Service
  94727. securityPolicy string
  94728. securitypolicy *SecurityPolicy
  94729. urlParams_ gensupport.URLParams
  94730. ctx_ context.Context
  94731. header_ http.Header
  94732. }
  94733. // Patch: Patches the specified policy with the data included in the
  94734. // request.
  94735. func (r *OrganizationSecurityPoliciesService) Patch(securityPolicy string, securitypolicy *SecurityPolicy) *OrganizationSecurityPoliciesPatchCall {
  94736. c := &OrganizationSecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94737. c.securityPolicy = securityPolicy
  94738. c.securitypolicy = securitypolicy
  94739. return c
  94740. }
  94741. // RequestId sets the optional parameter "requestId": An optional
  94742. // request ID to identify requests. Specify a unique request ID so that
  94743. // if you must retry your request, the server will know to ignore the
  94744. // request if it has already been completed.
  94745. //
  94746. // For example, consider a situation where you make an initial request
  94747. // and the request times out. If you make the request again with the
  94748. // same request ID, the server can check if original operation with the
  94749. // same request ID was received, and if so, will ignore the second
  94750. // request. This prevents clients from accidentally creating duplicate
  94751. // commitments.
  94752. //
  94753. // The request ID must be a valid UUID with the exception that zero UUID
  94754. // is not supported (00000000-0000-0000-0000-000000000000).
  94755. func (c *OrganizationSecurityPoliciesPatchCall) RequestId(requestId string) *OrganizationSecurityPoliciesPatchCall {
  94756. c.urlParams_.Set("requestId", requestId)
  94757. return c
  94758. }
  94759. // Fields allows partial responses to be retrieved. See
  94760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94761. // for more information.
  94762. func (c *OrganizationSecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesPatchCall {
  94763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94764. return c
  94765. }
  94766. // Context sets the context to be used in this call's Do method. Any
  94767. // pending HTTP request will be aborted if the provided context is
  94768. // canceled.
  94769. func (c *OrganizationSecurityPoliciesPatchCall) Context(ctx context.Context) *OrganizationSecurityPoliciesPatchCall {
  94770. c.ctx_ = ctx
  94771. return c
  94772. }
  94773. // Header returns an http.Header that can be modified by the caller to
  94774. // add HTTP headers to the request.
  94775. func (c *OrganizationSecurityPoliciesPatchCall) Header() http.Header {
  94776. if c.header_ == nil {
  94777. c.header_ = make(http.Header)
  94778. }
  94779. return c.header_
  94780. }
  94781. func (c *OrganizationSecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  94782. reqHeaders := make(http.Header)
  94783. for k, v := range c.header_ {
  94784. reqHeaders[k] = v
  94785. }
  94786. reqHeaders.Set("User-Agent", c.s.userAgent())
  94787. var body io.Reader = nil
  94788. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  94789. if err != nil {
  94790. return nil, err
  94791. }
  94792. reqHeaders.Set("Content-Type", "application/json")
  94793. c.urlParams_.Set("alt", alt)
  94794. c.urlParams_.Set("prettyPrint", "false")
  94795. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}")
  94796. urls += "?" + c.urlParams_.Encode()
  94797. req, err := http.NewRequest("PATCH", urls, body)
  94798. if err != nil {
  94799. return nil, err
  94800. }
  94801. req.Header = reqHeaders
  94802. googleapi.Expand(req.URL, map[string]string{
  94803. "securityPolicy": c.securityPolicy,
  94804. })
  94805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94806. }
  94807. // Do executes the "compute.organizationSecurityPolicies.patch" call.
  94808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94809. // status code is an error. Response headers are in either
  94810. // *Operation.ServerResponse.Header or (if a response was returned at
  94811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94812. // to check whether the returned error was because
  94813. // http.StatusNotModified was returned.
  94814. func (c *OrganizationSecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94815. gensupport.SetOptions(c.urlParams_, opts...)
  94816. res, err := c.doRequest("json")
  94817. if res != nil && res.StatusCode == http.StatusNotModified {
  94818. if res.Body != nil {
  94819. res.Body.Close()
  94820. }
  94821. return nil, &googleapi.Error{
  94822. Code: res.StatusCode,
  94823. Header: res.Header,
  94824. }
  94825. }
  94826. if err != nil {
  94827. return nil, err
  94828. }
  94829. defer googleapi.CloseBody(res)
  94830. if err := googleapi.CheckResponse(res); err != nil {
  94831. return nil, err
  94832. }
  94833. ret := &Operation{
  94834. ServerResponse: googleapi.ServerResponse{
  94835. Header: res.Header,
  94836. HTTPStatusCode: res.StatusCode,
  94837. },
  94838. }
  94839. target := &ret
  94840. if err := gensupport.DecodeResponse(target, res); err != nil {
  94841. return nil, err
  94842. }
  94843. return ret, nil
  94844. // {
  94845. // "description": "Patches the specified policy with the data included in the request.",
  94846. // "httpMethod": "PATCH",
  94847. // "id": "compute.organizationSecurityPolicies.patch",
  94848. // "parameterOrder": [
  94849. // "securityPolicy"
  94850. // ],
  94851. // "parameters": {
  94852. // "requestId": {
  94853. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94854. // "location": "query",
  94855. // "type": "string"
  94856. // },
  94857. // "securityPolicy": {
  94858. // "description": "Name of the security policy to update.",
  94859. // "location": "path",
  94860. // "pattern": "[0-9]{0,20}",
  94861. // "required": true,
  94862. // "type": "string"
  94863. // }
  94864. // },
  94865. // "path": "locations/global/securityPolicies/{securityPolicy}",
  94866. // "request": {
  94867. // "$ref": "SecurityPolicy"
  94868. // },
  94869. // "response": {
  94870. // "$ref": "Operation"
  94871. // },
  94872. // "scopes": [
  94873. // "https://www.googleapis.com/auth/cloud-platform",
  94874. // "https://www.googleapis.com/auth/compute"
  94875. // ]
  94876. // }
  94877. }
  94878. // method id "compute.organizationSecurityPolicies.patchRule":
  94879. type OrganizationSecurityPoliciesPatchRuleCall struct {
  94880. s *Service
  94881. securityPolicy string
  94882. securitypolicyrule *SecurityPolicyRule
  94883. urlParams_ gensupport.URLParams
  94884. ctx_ context.Context
  94885. header_ http.Header
  94886. }
  94887. // PatchRule: Patches a rule at the specified priority.
  94888. func (r *OrganizationSecurityPoliciesService) PatchRule(securityPolicy string, securitypolicyrule *SecurityPolicyRule) *OrganizationSecurityPoliciesPatchRuleCall {
  94889. c := &OrganizationSecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94890. c.securityPolicy = securityPolicy
  94891. c.securitypolicyrule = securitypolicyrule
  94892. return c
  94893. }
  94894. // Priority sets the optional parameter "priority": The priority of the
  94895. // rule to patch.
  94896. func (c *OrganizationSecurityPoliciesPatchRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesPatchRuleCall {
  94897. c.urlParams_.Set("priority", fmt.Sprint(priority))
  94898. return c
  94899. }
  94900. // RequestId sets the optional parameter "requestId": An optional
  94901. // request ID to identify requests. Specify a unique request ID so that
  94902. // if you must retry your request, the server will know to ignore the
  94903. // request if it has already been completed.
  94904. //
  94905. // For example, consider a situation where you make an initial request
  94906. // and the request times out. If you make the request again with the
  94907. // same request ID, the server can check if original operation with the
  94908. // same request ID was received, and if so, will ignore the second
  94909. // request. This prevents clients from accidentally creating duplicate
  94910. // commitments.
  94911. //
  94912. // The request ID must be a valid UUID with the exception that zero UUID
  94913. // is not supported (00000000-0000-0000-0000-000000000000).
  94914. func (c *OrganizationSecurityPoliciesPatchRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesPatchRuleCall {
  94915. c.urlParams_.Set("requestId", requestId)
  94916. return c
  94917. }
  94918. // Fields allows partial responses to be retrieved. See
  94919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94920. // for more information.
  94921. func (c *OrganizationSecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesPatchRuleCall {
  94922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94923. return c
  94924. }
  94925. // Context sets the context to be used in this call's Do method. Any
  94926. // pending HTTP request will be aborted if the provided context is
  94927. // canceled.
  94928. func (c *OrganizationSecurityPoliciesPatchRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesPatchRuleCall {
  94929. c.ctx_ = ctx
  94930. return c
  94931. }
  94932. // Header returns an http.Header that can be modified by the caller to
  94933. // add HTTP headers to the request.
  94934. func (c *OrganizationSecurityPoliciesPatchRuleCall) Header() http.Header {
  94935. if c.header_ == nil {
  94936. c.header_ = make(http.Header)
  94937. }
  94938. return c.header_
  94939. }
  94940. func (c *OrganizationSecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  94941. reqHeaders := make(http.Header)
  94942. for k, v := range c.header_ {
  94943. reqHeaders[k] = v
  94944. }
  94945. reqHeaders.Set("User-Agent", c.s.userAgent())
  94946. var body io.Reader = nil
  94947. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  94948. if err != nil {
  94949. return nil, err
  94950. }
  94951. reqHeaders.Set("Content-Type", "application/json")
  94952. c.urlParams_.Set("alt", alt)
  94953. c.urlParams_.Set("prettyPrint", "false")
  94954. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/patchRule")
  94955. urls += "?" + c.urlParams_.Encode()
  94956. req, err := http.NewRequest("POST", urls, body)
  94957. if err != nil {
  94958. return nil, err
  94959. }
  94960. req.Header = reqHeaders
  94961. googleapi.Expand(req.URL, map[string]string{
  94962. "securityPolicy": c.securityPolicy,
  94963. })
  94964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94965. }
  94966. // Do executes the "compute.organizationSecurityPolicies.patchRule" call.
  94967. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94968. // status code is an error. Response headers are in either
  94969. // *Operation.ServerResponse.Header or (if a response was returned at
  94970. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94971. // to check whether the returned error was because
  94972. // http.StatusNotModified was returned.
  94973. func (c *OrganizationSecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94974. gensupport.SetOptions(c.urlParams_, opts...)
  94975. res, err := c.doRequest("json")
  94976. if res != nil && res.StatusCode == http.StatusNotModified {
  94977. if res.Body != nil {
  94978. res.Body.Close()
  94979. }
  94980. return nil, &googleapi.Error{
  94981. Code: res.StatusCode,
  94982. Header: res.Header,
  94983. }
  94984. }
  94985. if err != nil {
  94986. return nil, err
  94987. }
  94988. defer googleapi.CloseBody(res)
  94989. if err := googleapi.CheckResponse(res); err != nil {
  94990. return nil, err
  94991. }
  94992. ret := &Operation{
  94993. ServerResponse: googleapi.ServerResponse{
  94994. Header: res.Header,
  94995. HTTPStatusCode: res.StatusCode,
  94996. },
  94997. }
  94998. target := &ret
  94999. if err := gensupport.DecodeResponse(target, res); err != nil {
  95000. return nil, err
  95001. }
  95002. return ret, nil
  95003. // {
  95004. // "description": "Patches a rule at the specified priority.",
  95005. // "httpMethod": "POST",
  95006. // "id": "compute.organizationSecurityPolicies.patchRule",
  95007. // "parameterOrder": [
  95008. // "securityPolicy"
  95009. // ],
  95010. // "parameters": {
  95011. // "priority": {
  95012. // "description": "The priority of the rule to patch.",
  95013. // "format": "int32",
  95014. // "location": "query",
  95015. // "type": "integer"
  95016. // },
  95017. // "requestId": {
  95018. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95019. // "location": "query",
  95020. // "type": "string"
  95021. // },
  95022. // "securityPolicy": {
  95023. // "description": "Name of the security policy to update.",
  95024. // "location": "path",
  95025. // "pattern": "[0-9]{0,20}",
  95026. // "required": true,
  95027. // "type": "string"
  95028. // }
  95029. // },
  95030. // "path": "locations/global/securityPolicies/{securityPolicy}/patchRule",
  95031. // "request": {
  95032. // "$ref": "SecurityPolicyRule"
  95033. // },
  95034. // "response": {
  95035. // "$ref": "Operation"
  95036. // },
  95037. // "scopes": [
  95038. // "https://www.googleapis.com/auth/cloud-platform",
  95039. // "https://www.googleapis.com/auth/compute"
  95040. // ]
  95041. // }
  95042. }
  95043. // method id "compute.organizationSecurityPolicies.removeAssociation":
  95044. type OrganizationSecurityPoliciesRemoveAssociationCall struct {
  95045. s *Service
  95046. securityPolicy string
  95047. urlParams_ gensupport.URLParams
  95048. ctx_ context.Context
  95049. header_ http.Header
  95050. }
  95051. // RemoveAssociation: Removes an association for the specified security
  95052. // policy.
  95053. func (r *OrganizationSecurityPoliciesService) RemoveAssociation(securityPolicy string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  95054. c := &OrganizationSecurityPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95055. c.securityPolicy = securityPolicy
  95056. return c
  95057. }
  95058. // Name sets the optional parameter "name": Name for the attachment that
  95059. // will be removed.
  95060. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Name(name string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  95061. c.urlParams_.Set("name", name)
  95062. return c
  95063. }
  95064. // RequestId sets the optional parameter "requestId": An optional
  95065. // request ID to identify requests. Specify a unique request ID so that
  95066. // if you must retry your request, the server will know to ignore the
  95067. // request if it has already been completed.
  95068. //
  95069. // For example, consider a situation where you make an initial request
  95070. // and the request times out. If you make the request again with the
  95071. // same request ID, the server can check if original operation with the
  95072. // same request ID was received, and if so, will ignore the second
  95073. // request. This prevents clients from accidentally creating duplicate
  95074. // commitments.
  95075. //
  95076. // The request ID must be a valid UUID with the exception that zero UUID
  95077. // is not supported (00000000-0000-0000-0000-000000000000).
  95078. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) RequestId(requestId string) *OrganizationSecurityPoliciesRemoveAssociationCall {
  95079. c.urlParams_.Set("requestId", requestId)
  95080. return c
  95081. }
  95082. // Fields allows partial responses to be retrieved. See
  95083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95084. // for more information.
  95085. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesRemoveAssociationCall {
  95086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95087. return c
  95088. }
  95089. // Context sets the context to be used in this call's Do method. Any
  95090. // pending HTTP request will be aborted if the provided context is
  95091. // canceled.
  95092. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Context(ctx context.Context) *OrganizationSecurityPoliciesRemoveAssociationCall {
  95093. c.ctx_ = ctx
  95094. return c
  95095. }
  95096. // Header returns an http.Header that can be modified by the caller to
  95097. // add HTTP headers to the request.
  95098. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Header() http.Header {
  95099. if c.header_ == nil {
  95100. c.header_ = make(http.Header)
  95101. }
  95102. return c.header_
  95103. }
  95104. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) {
  95105. reqHeaders := make(http.Header)
  95106. for k, v := range c.header_ {
  95107. reqHeaders[k] = v
  95108. }
  95109. reqHeaders.Set("User-Agent", c.s.userAgent())
  95110. var body io.Reader = nil
  95111. c.urlParams_.Set("alt", alt)
  95112. c.urlParams_.Set("prettyPrint", "false")
  95113. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeAssociation")
  95114. urls += "?" + c.urlParams_.Encode()
  95115. req, err := http.NewRequest("POST", urls, body)
  95116. if err != nil {
  95117. return nil, err
  95118. }
  95119. req.Header = reqHeaders
  95120. googleapi.Expand(req.URL, map[string]string{
  95121. "securityPolicy": c.securityPolicy,
  95122. })
  95123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95124. }
  95125. // Do executes the "compute.organizationSecurityPolicies.removeAssociation" call.
  95126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95127. // status code is an error. Response headers are in either
  95128. // *Operation.ServerResponse.Header or (if a response was returned at
  95129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95130. // to check whether the returned error was because
  95131. // http.StatusNotModified was returned.
  95132. func (c *OrganizationSecurityPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95133. gensupport.SetOptions(c.urlParams_, opts...)
  95134. res, err := c.doRequest("json")
  95135. if res != nil && res.StatusCode == http.StatusNotModified {
  95136. if res.Body != nil {
  95137. res.Body.Close()
  95138. }
  95139. return nil, &googleapi.Error{
  95140. Code: res.StatusCode,
  95141. Header: res.Header,
  95142. }
  95143. }
  95144. if err != nil {
  95145. return nil, err
  95146. }
  95147. defer googleapi.CloseBody(res)
  95148. if err := googleapi.CheckResponse(res); err != nil {
  95149. return nil, err
  95150. }
  95151. ret := &Operation{
  95152. ServerResponse: googleapi.ServerResponse{
  95153. Header: res.Header,
  95154. HTTPStatusCode: res.StatusCode,
  95155. },
  95156. }
  95157. target := &ret
  95158. if err := gensupport.DecodeResponse(target, res); err != nil {
  95159. return nil, err
  95160. }
  95161. return ret, nil
  95162. // {
  95163. // "description": "Removes an association for the specified security policy.",
  95164. // "httpMethod": "POST",
  95165. // "id": "compute.organizationSecurityPolicies.removeAssociation",
  95166. // "parameterOrder": [
  95167. // "securityPolicy"
  95168. // ],
  95169. // "parameters": {
  95170. // "name": {
  95171. // "description": "Name for the attachment that will be removed.",
  95172. // "location": "query",
  95173. // "type": "string"
  95174. // },
  95175. // "requestId": {
  95176. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95177. // "location": "query",
  95178. // "type": "string"
  95179. // },
  95180. // "securityPolicy": {
  95181. // "description": "Name of the security policy to update.",
  95182. // "location": "path",
  95183. // "pattern": "[0-9]{0,20}",
  95184. // "required": true,
  95185. // "type": "string"
  95186. // }
  95187. // },
  95188. // "path": "locations/global/securityPolicies/{securityPolicy}/removeAssociation",
  95189. // "response": {
  95190. // "$ref": "Operation"
  95191. // },
  95192. // "scopes": [
  95193. // "https://www.googleapis.com/auth/cloud-platform",
  95194. // "https://www.googleapis.com/auth/compute"
  95195. // ]
  95196. // }
  95197. }
  95198. // method id "compute.organizationSecurityPolicies.removeRule":
  95199. type OrganizationSecurityPoliciesRemoveRuleCall struct {
  95200. s *Service
  95201. securityPolicy string
  95202. urlParams_ gensupport.URLParams
  95203. ctx_ context.Context
  95204. header_ http.Header
  95205. }
  95206. // RemoveRule: Deletes a rule at the specified priority.
  95207. func (r *OrganizationSecurityPoliciesService) RemoveRule(securityPolicy string) *OrganizationSecurityPoliciesRemoveRuleCall {
  95208. c := &OrganizationSecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95209. c.securityPolicy = securityPolicy
  95210. return c
  95211. }
  95212. // Priority sets the optional parameter "priority": The priority of the
  95213. // rule to remove from the security policy.
  95214. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Priority(priority int64) *OrganizationSecurityPoliciesRemoveRuleCall {
  95215. c.urlParams_.Set("priority", fmt.Sprint(priority))
  95216. return c
  95217. }
  95218. // RequestId sets the optional parameter "requestId": An optional
  95219. // request ID to identify requests. Specify a unique request ID so that
  95220. // if you must retry your request, the server will know to ignore the
  95221. // request if it has already been completed.
  95222. //
  95223. // For example, consider a situation where you make an initial request
  95224. // and the request times out. If you make the request again with the
  95225. // same request ID, the server can check if original operation with the
  95226. // same request ID was received, and if so, will ignore the second
  95227. // request. This prevents clients from accidentally creating duplicate
  95228. // commitments.
  95229. //
  95230. // The request ID must be a valid UUID with the exception that zero UUID
  95231. // is not supported (00000000-0000-0000-0000-000000000000).
  95232. func (c *OrganizationSecurityPoliciesRemoveRuleCall) RequestId(requestId string) *OrganizationSecurityPoliciesRemoveRuleCall {
  95233. c.urlParams_.Set("requestId", requestId)
  95234. return c
  95235. }
  95236. // Fields allows partial responses to be retrieved. See
  95237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95238. // for more information.
  95239. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *OrganizationSecurityPoliciesRemoveRuleCall {
  95240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95241. return c
  95242. }
  95243. // Context sets the context to be used in this call's Do method. Any
  95244. // pending HTTP request will be aborted if the provided context is
  95245. // canceled.
  95246. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *OrganizationSecurityPoliciesRemoveRuleCall {
  95247. c.ctx_ = ctx
  95248. return c
  95249. }
  95250. // Header returns an http.Header that can be modified by the caller to
  95251. // add HTTP headers to the request.
  95252. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Header() http.Header {
  95253. if c.header_ == nil {
  95254. c.header_ = make(http.Header)
  95255. }
  95256. return c.header_
  95257. }
  95258. func (c *OrganizationSecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  95259. reqHeaders := make(http.Header)
  95260. for k, v := range c.header_ {
  95261. reqHeaders[k] = v
  95262. }
  95263. reqHeaders.Set("User-Agent", c.s.userAgent())
  95264. var body io.Reader = nil
  95265. c.urlParams_.Set("alt", alt)
  95266. c.urlParams_.Set("prettyPrint", "false")
  95267. urls := googleapi.ResolveRelative(c.s.BasePath, "locations/global/securityPolicies/{securityPolicy}/removeRule")
  95268. urls += "?" + c.urlParams_.Encode()
  95269. req, err := http.NewRequest("POST", urls, body)
  95270. if err != nil {
  95271. return nil, err
  95272. }
  95273. req.Header = reqHeaders
  95274. googleapi.Expand(req.URL, map[string]string{
  95275. "securityPolicy": c.securityPolicy,
  95276. })
  95277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95278. }
  95279. // Do executes the "compute.organizationSecurityPolicies.removeRule" call.
  95280. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95281. // status code is an error. Response headers are in either
  95282. // *Operation.ServerResponse.Header or (if a response was returned at
  95283. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95284. // to check whether the returned error was because
  95285. // http.StatusNotModified was returned.
  95286. func (c *OrganizationSecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95287. gensupport.SetOptions(c.urlParams_, opts...)
  95288. res, err := c.doRequest("json")
  95289. if res != nil && res.StatusCode == http.StatusNotModified {
  95290. if res.Body != nil {
  95291. res.Body.Close()
  95292. }
  95293. return nil, &googleapi.Error{
  95294. Code: res.StatusCode,
  95295. Header: res.Header,
  95296. }
  95297. }
  95298. if err != nil {
  95299. return nil, err
  95300. }
  95301. defer googleapi.CloseBody(res)
  95302. if err := googleapi.CheckResponse(res); err != nil {
  95303. return nil, err
  95304. }
  95305. ret := &Operation{
  95306. ServerResponse: googleapi.ServerResponse{
  95307. Header: res.Header,
  95308. HTTPStatusCode: res.StatusCode,
  95309. },
  95310. }
  95311. target := &ret
  95312. if err := gensupport.DecodeResponse(target, res); err != nil {
  95313. return nil, err
  95314. }
  95315. return ret, nil
  95316. // {
  95317. // "description": "Deletes a rule at the specified priority.",
  95318. // "httpMethod": "POST",
  95319. // "id": "compute.organizationSecurityPolicies.removeRule",
  95320. // "parameterOrder": [
  95321. // "securityPolicy"
  95322. // ],
  95323. // "parameters": {
  95324. // "priority": {
  95325. // "description": "The priority of the rule to remove from the security policy.",
  95326. // "format": "int32",
  95327. // "location": "query",
  95328. // "type": "integer"
  95329. // },
  95330. // "requestId": {
  95331. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95332. // "location": "query",
  95333. // "type": "string"
  95334. // },
  95335. // "securityPolicy": {
  95336. // "description": "Name of the security policy to update.",
  95337. // "location": "path",
  95338. // "pattern": "[0-9]{0,20}",
  95339. // "required": true,
  95340. // "type": "string"
  95341. // }
  95342. // },
  95343. // "path": "locations/global/securityPolicies/{securityPolicy}/removeRule",
  95344. // "response": {
  95345. // "$ref": "Operation"
  95346. // },
  95347. // "scopes": [
  95348. // "https://www.googleapis.com/auth/cloud-platform",
  95349. // "https://www.googleapis.com/auth/compute"
  95350. // ]
  95351. // }
  95352. }
  95353. // method id "compute.projects.disableXpnHost":
  95354. type ProjectsDisableXpnHostCall struct {
  95355. s *Service
  95356. project string
  95357. urlParams_ gensupport.URLParams
  95358. ctx_ context.Context
  95359. header_ http.Header
  95360. }
  95361. // DisableXpnHost: Disable this project as a shared VPC host project.
  95362. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  95363. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95364. c.project = project
  95365. return c
  95366. }
  95367. // RequestId sets the optional parameter "requestId": An optional
  95368. // request ID to identify requests. Specify a unique request ID so that
  95369. // if you must retry your request, the server will know to ignore the
  95370. // request if it has already been completed.
  95371. //
  95372. // For example, consider a situation where you make an initial request
  95373. // and the request times out. If you make the request again with the
  95374. // same request ID, the server can check if original operation with the
  95375. // same request ID was received, and if so, will ignore the second
  95376. // request. This prevents clients from accidentally creating duplicate
  95377. // commitments.
  95378. //
  95379. // The request ID must be a valid UUID with the exception that zero UUID
  95380. // is not supported (00000000-0000-0000-0000-000000000000).
  95381. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  95382. c.urlParams_.Set("requestId", requestId)
  95383. return c
  95384. }
  95385. // Fields allows partial responses to be retrieved. See
  95386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95387. // for more information.
  95388. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  95389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95390. return c
  95391. }
  95392. // Context sets the context to be used in this call's Do method. Any
  95393. // pending HTTP request will be aborted if the provided context is
  95394. // canceled.
  95395. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  95396. c.ctx_ = ctx
  95397. return c
  95398. }
  95399. // Header returns an http.Header that can be modified by the caller to
  95400. // add HTTP headers to the request.
  95401. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  95402. if c.header_ == nil {
  95403. c.header_ = make(http.Header)
  95404. }
  95405. return c.header_
  95406. }
  95407. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  95408. reqHeaders := make(http.Header)
  95409. for k, v := range c.header_ {
  95410. reqHeaders[k] = v
  95411. }
  95412. reqHeaders.Set("User-Agent", c.s.userAgent())
  95413. var body io.Reader = nil
  95414. c.urlParams_.Set("alt", alt)
  95415. c.urlParams_.Set("prettyPrint", "false")
  95416. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  95417. urls += "?" + c.urlParams_.Encode()
  95418. req, err := http.NewRequest("POST", urls, body)
  95419. if err != nil {
  95420. return nil, err
  95421. }
  95422. req.Header = reqHeaders
  95423. googleapi.Expand(req.URL, map[string]string{
  95424. "project": c.project,
  95425. })
  95426. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95427. }
  95428. // Do executes the "compute.projects.disableXpnHost" call.
  95429. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95430. // status code is an error. Response headers are in either
  95431. // *Operation.ServerResponse.Header or (if a response was returned at
  95432. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95433. // to check whether the returned error was because
  95434. // http.StatusNotModified was returned.
  95435. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95436. gensupport.SetOptions(c.urlParams_, opts...)
  95437. res, err := c.doRequest("json")
  95438. if res != nil && res.StatusCode == http.StatusNotModified {
  95439. if res.Body != nil {
  95440. res.Body.Close()
  95441. }
  95442. return nil, &googleapi.Error{
  95443. Code: res.StatusCode,
  95444. Header: res.Header,
  95445. }
  95446. }
  95447. if err != nil {
  95448. return nil, err
  95449. }
  95450. defer googleapi.CloseBody(res)
  95451. if err := googleapi.CheckResponse(res); err != nil {
  95452. return nil, err
  95453. }
  95454. ret := &Operation{
  95455. ServerResponse: googleapi.ServerResponse{
  95456. Header: res.Header,
  95457. HTTPStatusCode: res.StatusCode,
  95458. },
  95459. }
  95460. target := &ret
  95461. if err := gensupport.DecodeResponse(target, res); err != nil {
  95462. return nil, err
  95463. }
  95464. return ret, nil
  95465. // {
  95466. // "description": "Disable this project as a shared VPC host project.",
  95467. // "httpMethod": "POST",
  95468. // "id": "compute.projects.disableXpnHost",
  95469. // "parameterOrder": [
  95470. // "project"
  95471. // ],
  95472. // "parameters": {
  95473. // "project": {
  95474. // "description": "Project ID for this request.",
  95475. // "location": "path",
  95476. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95477. // "required": true,
  95478. // "type": "string"
  95479. // },
  95480. // "requestId": {
  95481. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95482. // "location": "query",
  95483. // "type": "string"
  95484. // }
  95485. // },
  95486. // "path": "{project}/disableXpnHost",
  95487. // "response": {
  95488. // "$ref": "Operation"
  95489. // },
  95490. // "scopes": [
  95491. // "https://www.googleapis.com/auth/cloud-platform",
  95492. // "https://www.googleapis.com/auth/compute"
  95493. // ]
  95494. // }
  95495. }
  95496. // method id "compute.projects.disableXpnResource":
  95497. type ProjectsDisableXpnResourceCall struct {
  95498. s *Service
  95499. project string
  95500. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  95501. urlParams_ gensupport.URLParams
  95502. ctx_ context.Context
  95503. header_ http.Header
  95504. }
  95505. // DisableXpnResource: Disable a serivce resource (a.k.a service
  95506. // project) associated with this host project.
  95507. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  95508. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95509. c.project = project
  95510. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  95511. return c
  95512. }
  95513. // RequestId sets the optional parameter "requestId": An optional
  95514. // request ID to identify requests. Specify a unique request ID so that
  95515. // if you must retry your request, the server will know to ignore the
  95516. // request if it has already been completed.
  95517. //
  95518. // For example, consider a situation where you make an initial request
  95519. // and the request times out. If you make the request again with the
  95520. // same request ID, the server can check if original operation with the
  95521. // same request ID was received, and if so, will ignore the second
  95522. // request. This prevents clients from accidentally creating duplicate
  95523. // commitments.
  95524. //
  95525. // The request ID must be a valid UUID with the exception that zero UUID
  95526. // is not supported (00000000-0000-0000-0000-000000000000).
  95527. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  95528. c.urlParams_.Set("requestId", requestId)
  95529. return c
  95530. }
  95531. // Fields allows partial responses to be retrieved. See
  95532. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95533. // for more information.
  95534. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  95535. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95536. return c
  95537. }
  95538. // Context sets the context to be used in this call's Do method. Any
  95539. // pending HTTP request will be aborted if the provided context is
  95540. // canceled.
  95541. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  95542. c.ctx_ = ctx
  95543. return c
  95544. }
  95545. // Header returns an http.Header that can be modified by the caller to
  95546. // add HTTP headers to the request.
  95547. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  95548. if c.header_ == nil {
  95549. c.header_ = make(http.Header)
  95550. }
  95551. return c.header_
  95552. }
  95553. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  95554. reqHeaders := make(http.Header)
  95555. for k, v := range c.header_ {
  95556. reqHeaders[k] = v
  95557. }
  95558. reqHeaders.Set("User-Agent", c.s.userAgent())
  95559. var body io.Reader = nil
  95560. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  95561. if err != nil {
  95562. return nil, err
  95563. }
  95564. reqHeaders.Set("Content-Type", "application/json")
  95565. c.urlParams_.Set("alt", alt)
  95566. c.urlParams_.Set("prettyPrint", "false")
  95567. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  95568. urls += "?" + c.urlParams_.Encode()
  95569. req, err := http.NewRequest("POST", urls, body)
  95570. if err != nil {
  95571. return nil, err
  95572. }
  95573. req.Header = reqHeaders
  95574. googleapi.Expand(req.URL, map[string]string{
  95575. "project": c.project,
  95576. })
  95577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95578. }
  95579. // Do executes the "compute.projects.disableXpnResource" call.
  95580. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95581. // status code is an error. Response headers are in either
  95582. // *Operation.ServerResponse.Header or (if a response was returned at
  95583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95584. // to check whether the returned error was because
  95585. // http.StatusNotModified was returned.
  95586. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95587. gensupport.SetOptions(c.urlParams_, opts...)
  95588. res, err := c.doRequest("json")
  95589. if res != nil && res.StatusCode == http.StatusNotModified {
  95590. if res.Body != nil {
  95591. res.Body.Close()
  95592. }
  95593. return nil, &googleapi.Error{
  95594. Code: res.StatusCode,
  95595. Header: res.Header,
  95596. }
  95597. }
  95598. if err != nil {
  95599. return nil, err
  95600. }
  95601. defer googleapi.CloseBody(res)
  95602. if err := googleapi.CheckResponse(res); err != nil {
  95603. return nil, err
  95604. }
  95605. ret := &Operation{
  95606. ServerResponse: googleapi.ServerResponse{
  95607. Header: res.Header,
  95608. HTTPStatusCode: res.StatusCode,
  95609. },
  95610. }
  95611. target := &ret
  95612. if err := gensupport.DecodeResponse(target, res); err != nil {
  95613. return nil, err
  95614. }
  95615. return ret, nil
  95616. // {
  95617. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  95618. // "httpMethod": "POST",
  95619. // "id": "compute.projects.disableXpnResource",
  95620. // "parameterOrder": [
  95621. // "project"
  95622. // ],
  95623. // "parameters": {
  95624. // "project": {
  95625. // "description": "Project ID for this request.",
  95626. // "location": "path",
  95627. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95628. // "required": true,
  95629. // "type": "string"
  95630. // },
  95631. // "requestId": {
  95632. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95633. // "location": "query",
  95634. // "type": "string"
  95635. // }
  95636. // },
  95637. // "path": "{project}/disableXpnResource",
  95638. // "request": {
  95639. // "$ref": "ProjectsDisableXpnResourceRequest"
  95640. // },
  95641. // "response": {
  95642. // "$ref": "Operation"
  95643. // },
  95644. // "scopes": [
  95645. // "https://www.googleapis.com/auth/cloud-platform",
  95646. // "https://www.googleapis.com/auth/compute"
  95647. // ]
  95648. // }
  95649. }
  95650. // method id "compute.projects.enableXpnHost":
  95651. type ProjectsEnableXpnHostCall struct {
  95652. s *Service
  95653. project string
  95654. urlParams_ gensupport.URLParams
  95655. ctx_ context.Context
  95656. header_ http.Header
  95657. }
  95658. // EnableXpnHost: Enable this project as a shared VPC host project.
  95659. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  95660. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95661. c.project = project
  95662. return c
  95663. }
  95664. // RequestId sets the optional parameter "requestId": An optional
  95665. // request ID to identify requests. Specify a unique request ID so that
  95666. // if you must retry your request, the server will know to ignore the
  95667. // request if it has already been completed.
  95668. //
  95669. // For example, consider a situation where you make an initial request
  95670. // and the request times out. If you make the request again with the
  95671. // same request ID, the server can check if original operation with the
  95672. // same request ID was received, and if so, will ignore the second
  95673. // request. This prevents clients from accidentally creating duplicate
  95674. // commitments.
  95675. //
  95676. // The request ID must be a valid UUID with the exception that zero UUID
  95677. // is not supported (00000000-0000-0000-0000-000000000000).
  95678. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  95679. c.urlParams_.Set("requestId", requestId)
  95680. return c
  95681. }
  95682. // Fields allows partial responses to be retrieved. See
  95683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95684. // for more information.
  95685. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  95686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95687. return c
  95688. }
  95689. // Context sets the context to be used in this call's Do method. Any
  95690. // pending HTTP request will be aborted if the provided context is
  95691. // canceled.
  95692. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  95693. c.ctx_ = ctx
  95694. return c
  95695. }
  95696. // Header returns an http.Header that can be modified by the caller to
  95697. // add HTTP headers to the request.
  95698. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  95699. if c.header_ == nil {
  95700. c.header_ = make(http.Header)
  95701. }
  95702. return c.header_
  95703. }
  95704. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  95705. reqHeaders := make(http.Header)
  95706. for k, v := range c.header_ {
  95707. reqHeaders[k] = v
  95708. }
  95709. reqHeaders.Set("User-Agent", c.s.userAgent())
  95710. var body io.Reader = nil
  95711. c.urlParams_.Set("alt", alt)
  95712. c.urlParams_.Set("prettyPrint", "false")
  95713. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  95714. urls += "?" + c.urlParams_.Encode()
  95715. req, err := http.NewRequest("POST", urls, body)
  95716. if err != nil {
  95717. return nil, err
  95718. }
  95719. req.Header = reqHeaders
  95720. googleapi.Expand(req.URL, map[string]string{
  95721. "project": c.project,
  95722. })
  95723. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95724. }
  95725. // Do executes the "compute.projects.enableXpnHost" call.
  95726. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95727. // status code is an error. Response headers are in either
  95728. // *Operation.ServerResponse.Header or (if a response was returned at
  95729. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95730. // to check whether the returned error was because
  95731. // http.StatusNotModified was returned.
  95732. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95733. gensupport.SetOptions(c.urlParams_, opts...)
  95734. res, err := c.doRequest("json")
  95735. if res != nil && res.StatusCode == http.StatusNotModified {
  95736. if res.Body != nil {
  95737. res.Body.Close()
  95738. }
  95739. return nil, &googleapi.Error{
  95740. Code: res.StatusCode,
  95741. Header: res.Header,
  95742. }
  95743. }
  95744. if err != nil {
  95745. return nil, err
  95746. }
  95747. defer googleapi.CloseBody(res)
  95748. if err := googleapi.CheckResponse(res); err != nil {
  95749. return nil, err
  95750. }
  95751. ret := &Operation{
  95752. ServerResponse: googleapi.ServerResponse{
  95753. Header: res.Header,
  95754. HTTPStatusCode: res.StatusCode,
  95755. },
  95756. }
  95757. target := &ret
  95758. if err := gensupport.DecodeResponse(target, res); err != nil {
  95759. return nil, err
  95760. }
  95761. return ret, nil
  95762. // {
  95763. // "description": "Enable this project as a shared VPC host project.",
  95764. // "httpMethod": "POST",
  95765. // "id": "compute.projects.enableXpnHost",
  95766. // "parameterOrder": [
  95767. // "project"
  95768. // ],
  95769. // "parameters": {
  95770. // "project": {
  95771. // "description": "Project ID for this request.",
  95772. // "location": "path",
  95773. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95774. // "required": true,
  95775. // "type": "string"
  95776. // },
  95777. // "requestId": {
  95778. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95779. // "location": "query",
  95780. // "type": "string"
  95781. // }
  95782. // },
  95783. // "path": "{project}/enableXpnHost",
  95784. // "response": {
  95785. // "$ref": "Operation"
  95786. // },
  95787. // "scopes": [
  95788. // "https://www.googleapis.com/auth/cloud-platform",
  95789. // "https://www.googleapis.com/auth/compute"
  95790. // ]
  95791. // }
  95792. }
  95793. // method id "compute.projects.enableXpnResource":
  95794. type ProjectsEnableXpnResourceCall struct {
  95795. s *Service
  95796. project string
  95797. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  95798. urlParams_ gensupport.URLParams
  95799. ctx_ context.Context
  95800. header_ http.Header
  95801. }
  95802. // EnableXpnResource: Enable service resource (a.k.a service project)
  95803. // for a host project, so that subnets in the host project can be used
  95804. // by instances in the service project.
  95805. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  95806. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95807. c.project = project
  95808. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  95809. return c
  95810. }
  95811. // RequestId sets the optional parameter "requestId": An optional
  95812. // request ID to identify requests. Specify a unique request ID so that
  95813. // if you must retry your request, the server will know to ignore the
  95814. // request if it has already been completed.
  95815. //
  95816. // For example, consider a situation where you make an initial request
  95817. // and the request times out. If you make the request again with the
  95818. // same request ID, the server can check if original operation with the
  95819. // same request ID was received, and if so, will ignore the second
  95820. // request. This prevents clients from accidentally creating duplicate
  95821. // commitments.
  95822. //
  95823. // The request ID must be a valid UUID with the exception that zero UUID
  95824. // is not supported (00000000-0000-0000-0000-000000000000).
  95825. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  95826. c.urlParams_.Set("requestId", requestId)
  95827. return c
  95828. }
  95829. // Fields allows partial responses to be retrieved. See
  95830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95831. // for more information.
  95832. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  95833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95834. return c
  95835. }
  95836. // Context sets the context to be used in this call's Do method. Any
  95837. // pending HTTP request will be aborted if the provided context is
  95838. // canceled.
  95839. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  95840. c.ctx_ = ctx
  95841. return c
  95842. }
  95843. // Header returns an http.Header that can be modified by the caller to
  95844. // add HTTP headers to the request.
  95845. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  95846. if c.header_ == nil {
  95847. c.header_ = make(http.Header)
  95848. }
  95849. return c.header_
  95850. }
  95851. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  95852. reqHeaders := make(http.Header)
  95853. for k, v := range c.header_ {
  95854. reqHeaders[k] = v
  95855. }
  95856. reqHeaders.Set("User-Agent", c.s.userAgent())
  95857. var body io.Reader = nil
  95858. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  95859. if err != nil {
  95860. return nil, err
  95861. }
  95862. reqHeaders.Set("Content-Type", "application/json")
  95863. c.urlParams_.Set("alt", alt)
  95864. c.urlParams_.Set("prettyPrint", "false")
  95865. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  95866. urls += "?" + c.urlParams_.Encode()
  95867. req, err := http.NewRequest("POST", urls, body)
  95868. if err != nil {
  95869. return nil, err
  95870. }
  95871. req.Header = reqHeaders
  95872. googleapi.Expand(req.URL, map[string]string{
  95873. "project": c.project,
  95874. })
  95875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95876. }
  95877. // Do executes the "compute.projects.enableXpnResource" call.
  95878. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95879. // status code is an error. Response headers are in either
  95880. // *Operation.ServerResponse.Header or (if a response was returned at
  95881. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95882. // to check whether the returned error was because
  95883. // http.StatusNotModified was returned.
  95884. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95885. gensupport.SetOptions(c.urlParams_, opts...)
  95886. res, err := c.doRequest("json")
  95887. if res != nil && res.StatusCode == http.StatusNotModified {
  95888. if res.Body != nil {
  95889. res.Body.Close()
  95890. }
  95891. return nil, &googleapi.Error{
  95892. Code: res.StatusCode,
  95893. Header: res.Header,
  95894. }
  95895. }
  95896. if err != nil {
  95897. return nil, err
  95898. }
  95899. defer googleapi.CloseBody(res)
  95900. if err := googleapi.CheckResponse(res); err != nil {
  95901. return nil, err
  95902. }
  95903. ret := &Operation{
  95904. ServerResponse: googleapi.ServerResponse{
  95905. Header: res.Header,
  95906. HTTPStatusCode: res.StatusCode,
  95907. },
  95908. }
  95909. target := &ret
  95910. if err := gensupport.DecodeResponse(target, res); err != nil {
  95911. return nil, err
  95912. }
  95913. return ret, nil
  95914. // {
  95915. // "description": "Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.",
  95916. // "httpMethod": "POST",
  95917. // "id": "compute.projects.enableXpnResource",
  95918. // "parameterOrder": [
  95919. // "project"
  95920. // ],
  95921. // "parameters": {
  95922. // "project": {
  95923. // "description": "Project ID for this request.",
  95924. // "location": "path",
  95925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95926. // "required": true,
  95927. // "type": "string"
  95928. // },
  95929. // "requestId": {
  95930. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95931. // "location": "query",
  95932. // "type": "string"
  95933. // }
  95934. // },
  95935. // "path": "{project}/enableXpnResource",
  95936. // "request": {
  95937. // "$ref": "ProjectsEnableXpnResourceRequest"
  95938. // },
  95939. // "response": {
  95940. // "$ref": "Operation"
  95941. // },
  95942. // "scopes": [
  95943. // "https://www.googleapis.com/auth/cloud-platform",
  95944. // "https://www.googleapis.com/auth/compute"
  95945. // ]
  95946. // }
  95947. }
  95948. // method id "compute.projects.get":
  95949. type ProjectsGetCall struct {
  95950. s *Service
  95951. project string
  95952. urlParams_ gensupport.URLParams
  95953. ifNoneMatch_ string
  95954. ctx_ context.Context
  95955. header_ http.Header
  95956. }
  95957. // Get: Returns the specified Project resource.
  95958. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  95959. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  95960. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95961. c.project = project
  95962. return c
  95963. }
  95964. // Fields allows partial responses to be retrieved. See
  95965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95966. // for more information.
  95967. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  95968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95969. return c
  95970. }
  95971. // IfNoneMatch sets the optional parameter which makes the operation
  95972. // fail if the object's ETag matches the given value. This is useful for
  95973. // getting updates only after the object has changed since the last
  95974. // request. Use googleapi.IsNotModified to check whether the response
  95975. // error from Do is the result of In-None-Match.
  95976. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  95977. c.ifNoneMatch_ = entityTag
  95978. return c
  95979. }
  95980. // Context sets the context to be used in this call's Do method. Any
  95981. // pending HTTP request will be aborted if the provided context is
  95982. // canceled.
  95983. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  95984. c.ctx_ = ctx
  95985. return c
  95986. }
  95987. // Header returns an http.Header that can be modified by the caller to
  95988. // add HTTP headers to the request.
  95989. func (c *ProjectsGetCall) Header() http.Header {
  95990. if c.header_ == nil {
  95991. c.header_ = make(http.Header)
  95992. }
  95993. return c.header_
  95994. }
  95995. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  95996. reqHeaders := make(http.Header)
  95997. for k, v := range c.header_ {
  95998. reqHeaders[k] = v
  95999. }
  96000. reqHeaders.Set("User-Agent", c.s.userAgent())
  96001. if c.ifNoneMatch_ != "" {
  96002. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96003. }
  96004. var body io.Reader = nil
  96005. c.urlParams_.Set("alt", alt)
  96006. c.urlParams_.Set("prettyPrint", "false")
  96007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  96008. urls += "?" + c.urlParams_.Encode()
  96009. req, err := http.NewRequest("GET", urls, body)
  96010. if err != nil {
  96011. return nil, err
  96012. }
  96013. req.Header = reqHeaders
  96014. googleapi.Expand(req.URL, map[string]string{
  96015. "project": c.project,
  96016. })
  96017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96018. }
  96019. // Do executes the "compute.projects.get" call.
  96020. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  96021. // code is an error. Response headers are in either
  96022. // *Project.ServerResponse.Header or (if a response was returned at all)
  96023. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  96024. // check whether the returned error was because http.StatusNotModified
  96025. // was returned.
  96026. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  96027. gensupport.SetOptions(c.urlParams_, opts...)
  96028. res, err := c.doRequest("json")
  96029. if res != nil && res.StatusCode == http.StatusNotModified {
  96030. if res.Body != nil {
  96031. res.Body.Close()
  96032. }
  96033. return nil, &googleapi.Error{
  96034. Code: res.StatusCode,
  96035. Header: res.Header,
  96036. }
  96037. }
  96038. if err != nil {
  96039. return nil, err
  96040. }
  96041. defer googleapi.CloseBody(res)
  96042. if err := googleapi.CheckResponse(res); err != nil {
  96043. return nil, err
  96044. }
  96045. ret := &Project{
  96046. ServerResponse: googleapi.ServerResponse{
  96047. Header: res.Header,
  96048. HTTPStatusCode: res.StatusCode,
  96049. },
  96050. }
  96051. target := &ret
  96052. if err := gensupport.DecodeResponse(target, res); err != nil {
  96053. return nil, err
  96054. }
  96055. return ret, nil
  96056. // {
  96057. // "description": "Returns the specified Project resource.",
  96058. // "httpMethod": "GET",
  96059. // "id": "compute.projects.get",
  96060. // "parameterOrder": [
  96061. // "project"
  96062. // ],
  96063. // "parameters": {
  96064. // "project": {
  96065. // "description": "Project ID for this request.",
  96066. // "location": "path",
  96067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96068. // "required": true,
  96069. // "type": "string"
  96070. // }
  96071. // },
  96072. // "path": "{project}",
  96073. // "response": {
  96074. // "$ref": "Project"
  96075. // },
  96076. // "scopes": [
  96077. // "https://www.googleapis.com/auth/cloud-platform",
  96078. // "https://www.googleapis.com/auth/compute",
  96079. // "https://www.googleapis.com/auth/compute.readonly"
  96080. // ]
  96081. // }
  96082. }
  96083. // method id "compute.projects.getXpnHost":
  96084. type ProjectsGetXpnHostCall struct {
  96085. s *Service
  96086. project string
  96087. urlParams_ gensupport.URLParams
  96088. ifNoneMatch_ string
  96089. ctx_ context.Context
  96090. header_ http.Header
  96091. }
  96092. // GetXpnHost: Gets the shared VPC host project that this project links
  96093. // to. May be empty if no link exists.
  96094. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  96095. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96096. c.project = project
  96097. return c
  96098. }
  96099. // Fields allows partial responses to be retrieved. See
  96100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96101. // for more information.
  96102. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  96103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96104. return c
  96105. }
  96106. // IfNoneMatch sets the optional parameter which makes the operation
  96107. // fail if the object's ETag matches the given value. This is useful for
  96108. // getting updates only after the object has changed since the last
  96109. // request. Use googleapi.IsNotModified to check whether the response
  96110. // error from Do is the result of In-None-Match.
  96111. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  96112. c.ifNoneMatch_ = entityTag
  96113. return c
  96114. }
  96115. // Context sets the context to be used in this call's Do method. Any
  96116. // pending HTTP request will be aborted if the provided context is
  96117. // canceled.
  96118. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  96119. c.ctx_ = ctx
  96120. return c
  96121. }
  96122. // Header returns an http.Header that can be modified by the caller to
  96123. // add HTTP headers to the request.
  96124. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  96125. if c.header_ == nil {
  96126. c.header_ = make(http.Header)
  96127. }
  96128. return c.header_
  96129. }
  96130. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  96131. reqHeaders := make(http.Header)
  96132. for k, v := range c.header_ {
  96133. reqHeaders[k] = v
  96134. }
  96135. reqHeaders.Set("User-Agent", c.s.userAgent())
  96136. if c.ifNoneMatch_ != "" {
  96137. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96138. }
  96139. var body io.Reader = nil
  96140. c.urlParams_.Set("alt", alt)
  96141. c.urlParams_.Set("prettyPrint", "false")
  96142. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  96143. urls += "?" + c.urlParams_.Encode()
  96144. req, err := http.NewRequest("GET", urls, body)
  96145. if err != nil {
  96146. return nil, err
  96147. }
  96148. req.Header = reqHeaders
  96149. googleapi.Expand(req.URL, map[string]string{
  96150. "project": c.project,
  96151. })
  96152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96153. }
  96154. // Do executes the "compute.projects.getXpnHost" call.
  96155. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  96156. // code is an error. Response headers are in either
  96157. // *Project.ServerResponse.Header or (if a response was returned at all)
  96158. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  96159. // check whether the returned error was because http.StatusNotModified
  96160. // was returned.
  96161. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  96162. gensupport.SetOptions(c.urlParams_, opts...)
  96163. res, err := c.doRequest("json")
  96164. if res != nil && res.StatusCode == http.StatusNotModified {
  96165. if res.Body != nil {
  96166. res.Body.Close()
  96167. }
  96168. return nil, &googleapi.Error{
  96169. Code: res.StatusCode,
  96170. Header: res.Header,
  96171. }
  96172. }
  96173. if err != nil {
  96174. return nil, err
  96175. }
  96176. defer googleapi.CloseBody(res)
  96177. if err := googleapi.CheckResponse(res); err != nil {
  96178. return nil, err
  96179. }
  96180. ret := &Project{
  96181. ServerResponse: googleapi.ServerResponse{
  96182. Header: res.Header,
  96183. HTTPStatusCode: res.StatusCode,
  96184. },
  96185. }
  96186. target := &ret
  96187. if err := gensupport.DecodeResponse(target, res); err != nil {
  96188. return nil, err
  96189. }
  96190. return ret, nil
  96191. // {
  96192. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  96193. // "httpMethod": "GET",
  96194. // "id": "compute.projects.getXpnHost",
  96195. // "parameterOrder": [
  96196. // "project"
  96197. // ],
  96198. // "parameters": {
  96199. // "project": {
  96200. // "description": "Project ID for this request.",
  96201. // "location": "path",
  96202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96203. // "required": true,
  96204. // "type": "string"
  96205. // }
  96206. // },
  96207. // "path": "{project}/getXpnHost",
  96208. // "response": {
  96209. // "$ref": "Project"
  96210. // },
  96211. // "scopes": [
  96212. // "https://www.googleapis.com/auth/cloud-platform",
  96213. // "https://www.googleapis.com/auth/compute"
  96214. // ]
  96215. // }
  96216. }
  96217. // method id "compute.projects.getXpnResources":
  96218. type ProjectsGetXpnResourcesCall struct {
  96219. s *Service
  96220. project string
  96221. urlParams_ gensupport.URLParams
  96222. ifNoneMatch_ string
  96223. ctx_ context.Context
  96224. header_ http.Header
  96225. }
  96226. // GetXpnResources: Gets service resources (a.k.a service project)
  96227. // associated with this host project.
  96228. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  96229. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96230. c.project = project
  96231. return c
  96232. }
  96233. // Filter sets the optional parameter "filter": A filter expression that
  96234. // filters resources listed in the response. The expression must specify
  96235. // the field name, a comparison operator, and the value that you want to
  96236. // use for filtering. The value must be a string, a number, or a
  96237. // boolean. The comparison operator must be either =, !=, >, or <.
  96238. //
  96239. // For example, if you are filtering Compute Engine instances, you can
  96240. // exclude instances named example-instance by specifying name !=
  96241. // example-instance.
  96242. //
  96243. // You can also filter nested fields. For example, you could specify
  96244. // scheduling.automaticRestart = false to include instances only if they
  96245. // are not scheduled for automatic restarts. You can use filtering on
  96246. // nested fields to filter based on resource labels.
  96247. //
  96248. // To filter on multiple expressions, provide each separate expression
  96249. // within parentheses. For example, (scheduling.automaticRestart = true)
  96250. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96251. // AND expression. However, you can include AND and OR expressions
  96252. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96253. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96254. // true).
  96255. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  96256. c.urlParams_.Set("filter", filter)
  96257. return c
  96258. }
  96259. // MaxResults sets the optional parameter "maxResults": The maximum
  96260. // number of results per page that should be returned. If the number of
  96261. // available results is larger than maxResults, Compute Engine returns a
  96262. // nextPageToken that can be used to get the next page of results in
  96263. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96264. // (Default: 500)
  96265. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  96266. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96267. return c
  96268. }
  96269. // OrderBy sets the optional parameter "order_by": Sorts list results by
  96270. // a certain order. By default, results are returned in alphanumerical
  96271. // order based on the resource name.
  96272. //
  96273. // You can also sort results in descending order based on the creation
  96274. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96275. // based on the creationTimestamp field in reverse chronological order
  96276. // (newest result first). Use this to sort resources like operations so
  96277. // that the newest operation is returned first.
  96278. //
  96279. // Currently, only sorting by name or creationTimestamp desc is
  96280. // supported.
  96281. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  96282. c.urlParams_.Set("order_by", orderBy)
  96283. return c
  96284. }
  96285. // PageToken sets the optional parameter "pageToken": Specifies a page
  96286. // token to use. Set pageToken to the nextPageToken returned by a
  96287. // previous list request to get the next page of results.
  96288. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  96289. c.urlParams_.Set("pageToken", pageToken)
  96290. return c
  96291. }
  96292. // Fields allows partial responses to be retrieved. See
  96293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96294. // for more information.
  96295. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  96296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96297. return c
  96298. }
  96299. // IfNoneMatch sets the optional parameter which makes the operation
  96300. // fail if the object's ETag matches the given value. This is useful for
  96301. // getting updates only after the object has changed since the last
  96302. // request. Use googleapi.IsNotModified to check whether the response
  96303. // error from Do is the result of In-None-Match.
  96304. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  96305. c.ifNoneMatch_ = entityTag
  96306. return c
  96307. }
  96308. // Context sets the context to be used in this call's Do method. Any
  96309. // pending HTTP request will be aborted if the provided context is
  96310. // canceled.
  96311. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  96312. c.ctx_ = ctx
  96313. return c
  96314. }
  96315. // Header returns an http.Header that can be modified by the caller to
  96316. // add HTTP headers to the request.
  96317. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  96318. if c.header_ == nil {
  96319. c.header_ = make(http.Header)
  96320. }
  96321. return c.header_
  96322. }
  96323. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  96324. reqHeaders := make(http.Header)
  96325. for k, v := range c.header_ {
  96326. reqHeaders[k] = v
  96327. }
  96328. reqHeaders.Set("User-Agent", c.s.userAgent())
  96329. if c.ifNoneMatch_ != "" {
  96330. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96331. }
  96332. var body io.Reader = nil
  96333. c.urlParams_.Set("alt", alt)
  96334. c.urlParams_.Set("prettyPrint", "false")
  96335. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  96336. urls += "?" + c.urlParams_.Encode()
  96337. req, err := http.NewRequest("GET", urls, body)
  96338. if err != nil {
  96339. return nil, err
  96340. }
  96341. req.Header = reqHeaders
  96342. googleapi.Expand(req.URL, map[string]string{
  96343. "project": c.project,
  96344. })
  96345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96346. }
  96347. // Do executes the "compute.projects.getXpnResources" call.
  96348. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  96349. // non-2xx status code is an error. Response headers are in either
  96350. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  96351. // returned at all) in error.(*googleapi.Error).Header. Use
  96352. // googleapi.IsNotModified to check whether the returned error was
  96353. // because http.StatusNotModified was returned.
  96354. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  96355. gensupport.SetOptions(c.urlParams_, opts...)
  96356. res, err := c.doRequest("json")
  96357. if res != nil && res.StatusCode == http.StatusNotModified {
  96358. if res.Body != nil {
  96359. res.Body.Close()
  96360. }
  96361. return nil, &googleapi.Error{
  96362. Code: res.StatusCode,
  96363. Header: res.Header,
  96364. }
  96365. }
  96366. if err != nil {
  96367. return nil, err
  96368. }
  96369. defer googleapi.CloseBody(res)
  96370. if err := googleapi.CheckResponse(res); err != nil {
  96371. return nil, err
  96372. }
  96373. ret := &ProjectsGetXpnResources{
  96374. ServerResponse: googleapi.ServerResponse{
  96375. Header: res.Header,
  96376. HTTPStatusCode: res.StatusCode,
  96377. },
  96378. }
  96379. target := &ret
  96380. if err := gensupport.DecodeResponse(target, res); err != nil {
  96381. return nil, err
  96382. }
  96383. return ret, nil
  96384. // {
  96385. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  96386. // "httpMethod": "GET",
  96387. // "id": "compute.projects.getXpnResources",
  96388. // "parameterOrder": [
  96389. // "project"
  96390. // ],
  96391. // "parameters": {
  96392. // "filter": {
  96393. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96394. // "location": "query",
  96395. // "type": "string"
  96396. // },
  96397. // "maxResults": {
  96398. // "default": "500",
  96399. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96400. // "format": "uint32",
  96401. // "location": "query",
  96402. // "minimum": "0",
  96403. // "type": "integer"
  96404. // },
  96405. // "order_by": {
  96406. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96407. // "location": "query",
  96408. // "type": "string"
  96409. // },
  96410. // "pageToken": {
  96411. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96412. // "location": "query",
  96413. // "type": "string"
  96414. // },
  96415. // "project": {
  96416. // "description": "Project ID for this request.",
  96417. // "location": "path",
  96418. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96419. // "required": true,
  96420. // "type": "string"
  96421. // }
  96422. // },
  96423. // "path": "{project}/getXpnResources",
  96424. // "response": {
  96425. // "$ref": "ProjectsGetXpnResources"
  96426. // },
  96427. // "scopes": [
  96428. // "https://www.googleapis.com/auth/cloud-platform",
  96429. // "https://www.googleapis.com/auth/compute"
  96430. // ]
  96431. // }
  96432. }
  96433. // Pages invokes f for each page of results.
  96434. // A non-nil error returned from f will halt the iteration.
  96435. // The provided context supersedes any context provided to the Context method.
  96436. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  96437. c.ctx_ = ctx
  96438. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96439. for {
  96440. x, err := c.Do()
  96441. if err != nil {
  96442. return err
  96443. }
  96444. if err := f(x); err != nil {
  96445. return err
  96446. }
  96447. if x.NextPageToken == "" {
  96448. return nil
  96449. }
  96450. c.PageToken(x.NextPageToken)
  96451. }
  96452. }
  96453. // method id "compute.projects.listXpnHosts":
  96454. type ProjectsListXpnHostsCall struct {
  96455. s *Service
  96456. project string
  96457. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  96458. urlParams_ gensupport.URLParams
  96459. ctx_ context.Context
  96460. header_ http.Header
  96461. }
  96462. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  96463. // in an organization.
  96464. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  96465. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96466. c.project = project
  96467. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  96468. return c
  96469. }
  96470. // Filter sets the optional parameter "filter": A filter expression that
  96471. // filters resources listed in the response. The expression must specify
  96472. // the field name, a comparison operator, and the value that you want to
  96473. // use for filtering. The value must be a string, a number, or a
  96474. // boolean. The comparison operator must be either =, !=, >, or <.
  96475. //
  96476. // For example, if you are filtering Compute Engine instances, you can
  96477. // exclude instances named example-instance by specifying name !=
  96478. // example-instance.
  96479. //
  96480. // You can also filter nested fields. For example, you could specify
  96481. // scheduling.automaticRestart = false to include instances only if they
  96482. // are not scheduled for automatic restarts. You can use filtering on
  96483. // nested fields to filter based on resource labels.
  96484. //
  96485. // To filter on multiple expressions, provide each separate expression
  96486. // within parentheses. For example, (scheduling.automaticRestart = true)
  96487. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96488. // AND expression. However, you can include AND and OR expressions
  96489. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96490. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96491. // true).
  96492. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  96493. c.urlParams_.Set("filter", filter)
  96494. return c
  96495. }
  96496. // MaxResults sets the optional parameter "maxResults": The maximum
  96497. // number of results per page that should be returned. If the number of
  96498. // available results is larger than maxResults, Compute Engine returns a
  96499. // nextPageToken that can be used to get the next page of results in
  96500. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96501. // (Default: 500)
  96502. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  96503. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96504. return c
  96505. }
  96506. // OrderBy sets the optional parameter "order_by": Sorts list results by
  96507. // a certain order. By default, results are returned in alphanumerical
  96508. // order based on the resource name.
  96509. //
  96510. // You can also sort results in descending order based on the creation
  96511. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96512. // based on the creationTimestamp field in reverse chronological order
  96513. // (newest result first). Use this to sort resources like operations so
  96514. // that the newest operation is returned first.
  96515. //
  96516. // Currently, only sorting by name or creationTimestamp desc is
  96517. // supported.
  96518. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  96519. c.urlParams_.Set("order_by", orderBy)
  96520. return c
  96521. }
  96522. // PageToken sets the optional parameter "pageToken": Specifies a page
  96523. // token to use. Set pageToken to the nextPageToken returned by a
  96524. // previous list request to get the next page of results.
  96525. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  96526. c.urlParams_.Set("pageToken", pageToken)
  96527. return c
  96528. }
  96529. // Fields allows partial responses to be retrieved. See
  96530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96531. // for more information.
  96532. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  96533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96534. return c
  96535. }
  96536. // Context sets the context to be used in this call's Do method. Any
  96537. // pending HTTP request will be aborted if the provided context is
  96538. // canceled.
  96539. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  96540. c.ctx_ = ctx
  96541. return c
  96542. }
  96543. // Header returns an http.Header that can be modified by the caller to
  96544. // add HTTP headers to the request.
  96545. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  96546. if c.header_ == nil {
  96547. c.header_ = make(http.Header)
  96548. }
  96549. return c.header_
  96550. }
  96551. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  96552. reqHeaders := make(http.Header)
  96553. for k, v := range c.header_ {
  96554. reqHeaders[k] = v
  96555. }
  96556. reqHeaders.Set("User-Agent", c.s.userAgent())
  96557. var body io.Reader = nil
  96558. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  96559. if err != nil {
  96560. return nil, err
  96561. }
  96562. reqHeaders.Set("Content-Type", "application/json")
  96563. c.urlParams_.Set("alt", alt)
  96564. c.urlParams_.Set("prettyPrint", "false")
  96565. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  96566. urls += "?" + c.urlParams_.Encode()
  96567. req, err := http.NewRequest("POST", urls, body)
  96568. if err != nil {
  96569. return nil, err
  96570. }
  96571. req.Header = reqHeaders
  96572. googleapi.Expand(req.URL, map[string]string{
  96573. "project": c.project,
  96574. })
  96575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96576. }
  96577. // Do executes the "compute.projects.listXpnHosts" call.
  96578. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  96579. // status code is an error. Response headers are in either
  96580. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  96581. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96582. // to check whether the returned error was because
  96583. // http.StatusNotModified was returned.
  96584. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  96585. gensupport.SetOptions(c.urlParams_, opts...)
  96586. res, err := c.doRequest("json")
  96587. if res != nil && res.StatusCode == http.StatusNotModified {
  96588. if res.Body != nil {
  96589. res.Body.Close()
  96590. }
  96591. return nil, &googleapi.Error{
  96592. Code: res.StatusCode,
  96593. Header: res.Header,
  96594. }
  96595. }
  96596. if err != nil {
  96597. return nil, err
  96598. }
  96599. defer googleapi.CloseBody(res)
  96600. if err := googleapi.CheckResponse(res); err != nil {
  96601. return nil, err
  96602. }
  96603. ret := &XpnHostList{
  96604. ServerResponse: googleapi.ServerResponse{
  96605. Header: res.Header,
  96606. HTTPStatusCode: res.StatusCode,
  96607. },
  96608. }
  96609. target := &ret
  96610. if err := gensupport.DecodeResponse(target, res); err != nil {
  96611. return nil, err
  96612. }
  96613. return ret, nil
  96614. // {
  96615. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  96616. // "httpMethod": "POST",
  96617. // "id": "compute.projects.listXpnHosts",
  96618. // "parameterOrder": [
  96619. // "project"
  96620. // ],
  96621. // "parameters": {
  96622. // "filter": {
  96623. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96624. // "location": "query",
  96625. // "type": "string"
  96626. // },
  96627. // "maxResults": {
  96628. // "default": "500",
  96629. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96630. // "format": "uint32",
  96631. // "location": "query",
  96632. // "minimum": "0",
  96633. // "type": "integer"
  96634. // },
  96635. // "order_by": {
  96636. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96637. // "location": "query",
  96638. // "type": "string"
  96639. // },
  96640. // "pageToken": {
  96641. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96642. // "location": "query",
  96643. // "type": "string"
  96644. // },
  96645. // "project": {
  96646. // "description": "Project ID for this request.",
  96647. // "location": "path",
  96648. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96649. // "required": true,
  96650. // "type": "string"
  96651. // }
  96652. // },
  96653. // "path": "{project}/listXpnHosts",
  96654. // "request": {
  96655. // "$ref": "ProjectsListXpnHostsRequest"
  96656. // },
  96657. // "response": {
  96658. // "$ref": "XpnHostList"
  96659. // },
  96660. // "scopes": [
  96661. // "https://www.googleapis.com/auth/cloud-platform",
  96662. // "https://www.googleapis.com/auth/compute"
  96663. // ]
  96664. // }
  96665. }
  96666. // Pages invokes f for each page of results.
  96667. // A non-nil error returned from f will halt the iteration.
  96668. // The provided context supersedes any context provided to the Context method.
  96669. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  96670. c.ctx_ = ctx
  96671. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96672. for {
  96673. x, err := c.Do()
  96674. if err != nil {
  96675. return err
  96676. }
  96677. if err := f(x); err != nil {
  96678. return err
  96679. }
  96680. if x.NextPageToken == "" {
  96681. return nil
  96682. }
  96683. c.PageToken(x.NextPageToken)
  96684. }
  96685. }
  96686. // method id "compute.projects.moveDisk":
  96687. type ProjectsMoveDiskCall struct {
  96688. s *Service
  96689. project string
  96690. diskmoverequest *DiskMoveRequest
  96691. urlParams_ gensupport.URLParams
  96692. ctx_ context.Context
  96693. header_ http.Header
  96694. }
  96695. // MoveDisk: Moves a persistent disk from one zone to another.
  96696. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  96697. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96698. c.project = project
  96699. c.diskmoverequest = diskmoverequest
  96700. return c
  96701. }
  96702. // RequestId sets the optional parameter "requestId": An optional
  96703. // request ID to identify requests. Specify a unique request ID so that
  96704. // if you must retry your request, the server will know to ignore the
  96705. // request if it has already been completed.
  96706. //
  96707. // For example, consider a situation where you make an initial request
  96708. // and the request times out. If you make the request again with the
  96709. // same request ID, the server can check if original operation with the
  96710. // same request ID was received, and if so, will ignore the second
  96711. // request. This prevents clients from accidentally creating duplicate
  96712. // commitments.
  96713. //
  96714. // The request ID must be a valid UUID with the exception that zero UUID
  96715. // is not supported (00000000-0000-0000-0000-000000000000).
  96716. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  96717. c.urlParams_.Set("requestId", requestId)
  96718. return c
  96719. }
  96720. // Fields allows partial responses to be retrieved. See
  96721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96722. // for more information.
  96723. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  96724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96725. return c
  96726. }
  96727. // Context sets the context to be used in this call's Do method. Any
  96728. // pending HTTP request will be aborted if the provided context is
  96729. // canceled.
  96730. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  96731. c.ctx_ = ctx
  96732. return c
  96733. }
  96734. // Header returns an http.Header that can be modified by the caller to
  96735. // add HTTP headers to the request.
  96736. func (c *ProjectsMoveDiskCall) Header() http.Header {
  96737. if c.header_ == nil {
  96738. c.header_ = make(http.Header)
  96739. }
  96740. return c.header_
  96741. }
  96742. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  96743. reqHeaders := make(http.Header)
  96744. for k, v := range c.header_ {
  96745. reqHeaders[k] = v
  96746. }
  96747. reqHeaders.Set("User-Agent", c.s.userAgent())
  96748. var body io.Reader = nil
  96749. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  96750. if err != nil {
  96751. return nil, err
  96752. }
  96753. reqHeaders.Set("Content-Type", "application/json")
  96754. c.urlParams_.Set("alt", alt)
  96755. c.urlParams_.Set("prettyPrint", "false")
  96756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  96757. urls += "?" + c.urlParams_.Encode()
  96758. req, err := http.NewRequest("POST", urls, body)
  96759. if err != nil {
  96760. return nil, err
  96761. }
  96762. req.Header = reqHeaders
  96763. googleapi.Expand(req.URL, map[string]string{
  96764. "project": c.project,
  96765. })
  96766. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96767. }
  96768. // Do executes the "compute.projects.moveDisk" call.
  96769. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96770. // status code is an error. Response headers are in either
  96771. // *Operation.ServerResponse.Header or (if a response was returned at
  96772. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96773. // to check whether the returned error was because
  96774. // http.StatusNotModified was returned.
  96775. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96776. gensupport.SetOptions(c.urlParams_, opts...)
  96777. res, err := c.doRequest("json")
  96778. if res != nil && res.StatusCode == http.StatusNotModified {
  96779. if res.Body != nil {
  96780. res.Body.Close()
  96781. }
  96782. return nil, &googleapi.Error{
  96783. Code: res.StatusCode,
  96784. Header: res.Header,
  96785. }
  96786. }
  96787. if err != nil {
  96788. return nil, err
  96789. }
  96790. defer googleapi.CloseBody(res)
  96791. if err := googleapi.CheckResponse(res); err != nil {
  96792. return nil, err
  96793. }
  96794. ret := &Operation{
  96795. ServerResponse: googleapi.ServerResponse{
  96796. Header: res.Header,
  96797. HTTPStatusCode: res.StatusCode,
  96798. },
  96799. }
  96800. target := &ret
  96801. if err := gensupport.DecodeResponse(target, res); err != nil {
  96802. return nil, err
  96803. }
  96804. return ret, nil
  96805. // {
  96806. // "description": "Moves a persistent disk from one zone to another.",
  96807. // "httpMethod": "POST",
  96808. // "id": "compute.projects.moveDisk",
  96809. // "parameterOrder": [
  96810. // "project"
  96811. // ],
  96812. // "parameters": {
  96813. // "project": {
  96814. // "description": "Project ID for this request.",
  96815. // "location": "path",
  96816. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96817. // "required": true,
  96818. // "type": "string"
  96819. // },
  96820. // "requestId": {
  96821. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96822. // "location": "query",
  96823. // "type": "string"
  96824. // }
  96825. // },
  96826. // "path": "{project}/moveDisk",
  96827. // "request": {
  96828. // "$ref": "DiskMoveRequest"
  96829. // },
  96830. // "response": {
  96831. // "$ref": "Operation"
  96832. // },
  96833. // "scopes": [
  96834. // "https://www.googleapis.com/auth/cloud-platform",
  96835. // "https://www.googleapis.com/auth/compute"
  96836. // ]
  96837. // }
  96838. }
  96839. // method id "compute.projects.moveInstance":
  96840. type ProjectsMoveInstanceCall struct {
  96841. s *Service
  96842. project string
  96843. instancemoverequest *InstanceMoveRequest
  96844. urlParams_ gensupport.URLParams
  96845. ctx_ context.Context
  96846. header_ http.Header
  96847. }
  96848. // MoveInstance: Moves an instance and its attached persistent disks
  96849. // from one zone to another.
  96850. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  96851. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96852. c.project = project
  96853. c.instancemoverequest = instancemoverequest
  96854. return c
  96855. }
  96856. // RequestId sets the optional parameter "requestId": An optional
  96857. // request ID to identify requests. Specify a unique request ID so that
  96858. // if you must retry your request, the server will know to ignore the
  96859. // request if it has already been completed.
  96860. //
  96861. // For example, consider a situation where you make an initial request
  96862. // and the request times out. If you make the request again with the
  96863. // same request ID, the server can check if original operation with the
  96864. // same request ID was received, and if so, will ignore the second
  96865. // request. This prevents clients from accidentally creating duplicate
  96866. // commitments.
  96867. //
  96868. // The request ID must be a valid UUID with the exception that zero UUID
  96869. // is not supported (00000000-0000-0000-0000-000000000000).
  96870. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  96871. c.urlParams_.Set("requestId", requestId)
  96872. return c
  96873. }
  96874. // Fields allows partial responses to be retrieved. See
  96875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96876. // for more information.
  96877. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  96878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96879. return c
  96880. }
  96881. // Context sets the context to be used in this call's Do method. Any
  96882. // pending HTTP request will be aborted if the provided context is
  96883. // canceled.
  96884. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  96885. c.ctx_ = ctx
  96886. return c
  96887. }
  96888. // Header returns an http.Header that can be modified by the caller to
  96889. // add HTTP headers to the request.
  96890. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  96891. if c.header_ == nil {
  96892. c.header_ = make(http.Header)
  96893. }
  96894. return c.header_
  96895. }
  96896. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  96897. reqHeaders := make(http.Header)
  96898. for k, v := range c.header_ {
  96899. reqHeaders[k] = v
  96900. }
  96901. reqHeaders.Set("User-Agent", c.s.userAgent())
  96902. var body io.Reader = nil
  96903. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  96904. if err != nil {
  96905. return nil, err
  96906. }
  96907. reqHeaders.Set("Content-Type", "application/json")
  96908. c.urlParams_.Set("alt", alt)
  96909. c.urlParams_.Set("prettyPrint", "false")
  96910. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  96911. urls += "?" + c.urlParams_.Encode()
  96912. req, err := http.NewRequest("POST", urls, body)
  96913. if err != nil {
  96914. return nil, err
  96915. }
  96916. req.Header = reqHeaders
  96917. googleapi.Expand(req.URL, map[string]string{
  96918. "project": c.project,
  96919. })
  96920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96921. }
  96922. // Do executes the "compute.projects.moveInstance" call.
  96923. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96924. // status code is an error. Response headers are in either
  96925. // *Operation.ServerResponse.Header or (if a response was returned at
  96926. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96927. // to check whether the returned error was because
  96928. // http.StatusNotModified was returned.
  96929. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96930. gensupport.SetOptions(c.urlParams_, opts...)
  96931. res, err := c.doRequest("json")
  96932. if res != nil && res.StatusCode == http.StatusNotModified {
  96933. if res.Body != nil {
  96934. res.Body.Close()
  96935. }
  96936. return nil, &googleapi.Error{
  96937. Code: res.StatusCode,
  96938. Header: res.Header,
  96939. }
  96940. }
  96941. if err != nil {
  96942. return nil, err
  96943. }
  96944. defer googleapi.CloseBody(res)
  96945. if err := googleapi.CheckResponse(res); err != nil {
  96946. return nil, err
  96947. }
  96948. ret := &Operation{
  96949. ServerResponse: googleapi.ServerResponse{
  96950. Header: res.Header,
  96951. HTTPStatusCode: res.StatusCode,
  96952. },
  96953. }
  96954. target := &ret
  96955. if err := gensupport.DecodeResponse(target, res); err != nil {
  96956. return nil, err
  96957. }
  96958. return ret, nil
  96959. // {
  96960. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  96961. // "httpMethod": "POST",
  96962. // "id": "compute.projects.moveInstance",
  96963. // "parameterOrder": [
  96964. // "project"
  96965. // ],
  96966. // "parameters": {
  96967. // "project": {
  96968. // "description": "Project ID for this request.",
  96969. // "location": "path",
  96970. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96971. // "required": true,
  96972. // "type": "string"
  96973. // },
  96974. // "requestId": {
  96975. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96976. // "location": "query",
  96977. // "type": "string"
  96978. // }
  96979. // },
  96980. // "path": "{project}/moveInstance",
  96981. // "request": {
  96982. // "$ref": "InstanceMoveRequest"
  96983. // },
  96984. // "response": {
  96985. // "$ref": "Operation"
  96986. // },
  96987. // "scopes": [
  96988. // "https://www.googleapis.com/auth/cloud-platform",
  96989. // "https://www.googleapis.com/auth/compute"
  96990. // ]
  96991. // }
  96992. }
  96993. // method id "compute.projects.setCommonInstanceMetadata":
  96994. type ProjectsSetCommonInstanceMetadataCall struct {
  96995. s *Service
  96996. project string
  96997. metadata *Metadata
  96998. urlParams_ gensupport.URLParams
  96999. ctx_ context.Context
  97000. header_ http.Header
  97001. }
  97002. // SetCommonInstanceMetadata: Sets metadata common to all instances
  97003. // within the specified project using the data included in the request.
  97004. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  97005. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  97006. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97007. c.project = project
  97008. c.metadata = metadata
  97009. return c
  97010. }
  97011. // RequestId sets the optional parameter "requestId": An optional
  97012. // request ID to identify requests. Specify a unique request ID so that
  97013. // if you must retry your request, the server will know to ignore the
  97014. // request if it has already been completed.
  97015. //
  97016. // For example, consider a situation where you make an initial request
  97017. // and the request times out. If you make the request again with the
  97018. // same request ID, the server can check if original operation with the
  97019. // same request ID was received, and if so, will ignore the second
  97020. // request. This prevents clients from accidentally creating duplicate
  97021. // commitments.
  97022. //
  97023. // The request ID must be a valid UUID with the exception that zero UUID
  97024. // is not supported (00000000-0000-0000-0000-000000000000).
  97025. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  97026. c.urlParams_.Set("requestId", requestId)
  97027. return c
  97028. }
  97029. // Fields allows partial responses to be retrieved. See
  97030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97031. // for more information.
  97032. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  97033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97034. return c
  97035. }
  97036. // Context sets the context to be used in this call's Do method. Any
  97037. // pending HTTP request will be aborted if the provided context is
  97038. // canceled.
  97039. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  97040. c.ctx_ = ctx
  97041. return c
  97042. }
  97043. // Header returns an http.Header that can be modified by the caller to
  97044. // add HTTP headers to the request.
  97045. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  97046. if c.header_ == nil {
  97047. c.header_ = make(http.Header)
  97048. }
  97049. return c.header_
  97050. }
  97051. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  97052. reqHeaders := make(http.Header)
  97053. for k, v := range c.header_ {
  97054. reqHeaders[k] = v
  97055. }
  97056. reqHeaders.Set("User-Agent", c.s.userAgent())
  97057. var body io.Reader = nil
  97058. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  97059. if err != nil {
  97060. return nil, err
  97061. }
  97062. reqHeaders.Set("Content-Type", "application/json")
  97063. c.urlParams_.Set("alt", alt)
  97064. c.urlParams_.Set("prettyPrint", "false")
  97065. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  97066. urls += "?" + c.urlParams_.Encode()
  97067. req, err := http.NewRequest("POST", urls, body)
  97068. if err != nil {
  97069. return nil, err
  97070. }
  97071. req.Header = reqHeaders
  97072. googleapi.Expand(req.URL, map[string]string{
  97073. "project": c.project,
  97074. })
  97075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97076. }
  97077. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  97078. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97079. // status code is an error. Response headers are in either
  97080. // *Operation.ServerResponse.Header or (if a response was returned at
  97081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97082. // to check whether the returned error was because
  97083. // http.StatusNotModified was returned.
  97084. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97085. gensupport.SetOptions(c.urlParams_, opts...)
  97086. res, err := c.doRequest("json")
  97087. if res != nil && res.StatusCode == http.StatusNotModified {
  97088. if res.Body != nil {
  97089. res.Body.Close()
  97090. }
  97091. return nil, &googleapi.Error{
  97092. Code: res.StatusCode,
  97093. Header: res.Header,
  97094. }
  97095. }
  97096. if err != nil {
  97097. return nil, err
  97098. }
  97099. defer googleapi.CloseBody(res)
  97100. if err := googleapi.CheckResponse(res); err != nil {
  97101. return nil, err
  97102. }
  97103. ret := &Operation{
  97104. ServerResponse: googleapi.ServerResponse{
  97105. Header: res.Header,
  97106. HTTPStatusCode: res.StatusCode,
  97107. },
  97108. }
  97109. target := &ret
  97110. if err := gensupport.DecodeResponse(target, res); err != nil {
  97111. return nil, err
  97112. }
  97113. return ret, nil
  97114. // {
  97115. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  97116. // "httpMethod": "POST",
  97117. // "id": "compute.projects.setCommonInstanceMetadata",
  97118. // "parameterOrder": [
  97119. // "project"
  97120. // ],
  97121. // "parameters": {
  97122. // "project": {
  97123. // "description": "Project ID for this request.",
  97124. // "location": "path",
  97125. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97126. // "required": true,
  97127. // "type": "string"
  97128. // },
  97129. // "requestId": {
  97130. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97131. // "location": "query",
  97132. // "type": "string"
  97133. // }
  97134. // },
  97135. // "path": "{project}/setCommonInstanceMetadata",
  97136. // "request": {
  97137. // "$ref": "Metadata"
  97138. // },
  97139. // "response": {
  97140. // "$ref": "Operation"
  97141. // },
  97142. // "scopes": [
  97143. // "https://www.googleapis.com/auth/cloud-platform",
  97144. // "https://www.googleapis.com/auth/compute"
  97145. // ]
  97146. // }
  97147. }
  97148. // method id "compute.projects.setDefaultNetworkTier":
  97149. type ProjectsSetDefaultNetworkTierCall struct {
  97150. s *Service
  97151. project string
  97152. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  97153. urlParams_ gensupport.URLParams
  97154. ctx_ context.Context
  97155. header_ http.Header
  97156. }
  97157. // SetDefaultNetworkTier: Sets the default network tier of the project.
  97158. // The default network tier is used when an
  97159. // address/forwardingRule/instance is created without specifying the
  97160. // network tier field.
  97161. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  97162. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97163. c.project = project
  97164. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  97165. return c
  97166. }
  97167. // RequestId sets the optional parameter "requestId": An optional
  97168. // request ID to identify requests. Specify a unique request ID so that
  97169. // if you must retry your request, the server will know to ignore the
  97170. // request if it has already been completed.
  97171. //
  97172. // For example, consider a situation where you make an initial request
  97173. // and the request times out. If you make the request again with the
  97174. // same request ID, the server can check if original operation with the
  97175. // same request ID was received, and if so, will ignore the second
  97176. // request. This prevents clients from accidentally creating duplicate
  97177. // commitments.
  97178. //
  97179. // The request ID must be a valid UUID with the exception that zero UUID
  97180. // is not supported (00000000-0000-0000-0000-000000000000).
  97181. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  97182. c.urlParams_.Set("requestId", requestId)
  97183. return c
  97184. }
  97185. // Fields allows partial responses to be retrieved. See
  97186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97187. // for more information.
  97188. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  97189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97190. return c
  97191. }
  97192. // Context sets the context to be used in this call's Do method. Any
  97193. // pending HTTP request will be aborted if the provided context is
  97194. // canceled.
  97195. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  97196. c.ctx_ = ctx
  97197. return c
  97198. }
  97199. // Header returns an http.Header that can be modified by the caller to
  97200. // add HTTP headers to the request.
  97201. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  97202. if c.header_ == nil {
  97203. c.header_ = make(http.Header)
  97204. }
  97205. return c.header_
  97206. }
  97207. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  97208. reqHeaders := make(http.Header)
  97209. for k, v := range c.header_ {
  97210. reqHeaders[k] = v
  97211. }
  97212. reqHeaders.Set("User-Agent", c.s.userAgent())
  97213. var body io.Reader = nil
  97214. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  97215. if err != nil {
  97216. return nil, err
  97217. }
  97218. reqHeaders.Set("Content-Type", "application/json")
  97219. c.urlParams_.Set("alt", alt)
  97220. c.urlParams_.Set("prettyPrint", "false")
  97221. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  97222. urls += "?" + c.urlParams_.Encode()
  97223. req, err := http.NewRequest("POST", urls, body)
  97224. if err != nil {
  97225. return nil, err
  97226. }
  97227. req.Header = reqHeaders
  97228. googleapi.Expand(req.URL, map[string]string{
  97229. "project": c.project,
  97230. })
  97231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97232. }
  97233. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  97234. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97235. // status code is an error. Response headers are in either
  97236. // *Operation.ServerResponse.Header or (if a response was returned at
  97237. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97238. // to check whether the returned error was because
  97239. // http.StatusNotModified was returned.
  97240. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97241. gensupport.SetOptions(c.urlParams_, opts...)
  97242. res, err := c.doRequest("json")
  97243. if res != nil && res.StatusCode == http.StatusNotModified {
  97244. if res.Body != nil {
  97245. res.Body.Close()
  97246. }
  97247. return nil, &googleapi.Error{
  97248. Code: res.StatusCode,
  97249. Header: res.Header,
  97250. }
  97251. }
  97252. if err != nil {
  97253. return nil, err
  97254. }
  97255. defer googleapi.CloseBody(res)
  97256. if err := googleapi.CheckResponse(res); err != nil {
  97257. return nil, err
  97258. }
  97259. ret := &Operation{
  97260. ServerResponse: googleapi.ServerResponse{
  97261. Header: res.Header,
  97262. HTTPStatusCode: res.StatusCode,
  97263. },
  97264. }
  97265. target := &ret
  97266. if err := gensupport.DecodeResponse(target, res); err != nil {
  97267. return nil, err
  97268. }
  97269. return ret, nil
  97270. // {
  97271. // "description": "Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.",
  97272. // "httpMethod": "POST",
  97273. // "id": "compute.projects.setDefaultNetworkTier",
  97274. // "parameterOrder": [
  97275. // "project"
  97276. // ],
  97277. // "parameters": {
  97278. // "project": {
  97279. // "description": "Project ID for this request.",
  97280. // "location": "path",
  97281. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97282. // "required": true,
  97283. // "type": "string"
  97284. // },
  97285. // "requestId": {
  97286. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97287. // "location": "query",
  97288. // "type": "string"
  97289. // }
  97290. // },
  97291. // "path": "{project}/setDefaultNetworkTier",
  97292. // "request": {
  97293. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  97294. // },
  97295. // "response": {
  97296. // "$ref": "Operation"
  97297. // },
  97298. // "scopes": [
  97299. // "https://www.googleapis.com/auth/cloud-platform",
  97300. // "https://www.googleapis.com/auth/compute"
  97301. // ]
  97302. // }
  97303. }
  97304. // method id "compute.projects.setDefaultServiceAccount":
  97305. type ProjectsSetDefaultServiceAccountCall struct {
  97306. s *Service
  97307. project string
  97308. projectssetdefaultserviceaccountrequest *ProjectsSetDefaultServiceAccountRequest
  97309. urlParams_ gensupport.URLParams
  97310. ctx_ context.Context
  97311. header_ http.Header
  97312. }
  97313. // SetDefaultServiceAccount: Sets the default service account of the
  97314. // project. The default service account is used when a VM instance is
  97315. // created with the service account email address set to "default".
  97316. func (r *ProjectsService) SetDefaultServiceAccount(project string, projectssetdefaultserviceaccountrequest *ProjectsSetDefaultServiceAccountRequest) *ProjectsSetDefaultServiceAccountCall {
  97317. c := &ProjectsSetDefaultServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97318. c.project = project
  97319. c.projectssetdefaultserviceaccountrequest = projectssetdefaultserviceaccountrequest
  97320. return c
  97321. }
  97322. // RequestId sets the optional parameter "requestId": An optional
  97323. // request ID to identify requests. Specify a unique request ID so that
  97324. // if you must retry your request, the server will know to ignore the
  97325. // request if it has already been completed.
  97326. //
  97327. // For example, consider a situation where you make an initial request
  97328. // and the request times out. If you make the request again with the
  97329. // same request ID, the server can check if original operation with the
  97330. // same request ID was received, and if so, will ignore the second
  97331. // request. This prevents clients from accidentally creating duplicate
  97332. // commitments.
  97333. //
  97334. // The request ID must be a valid UUID with the exception that zero UUID
  97335. // is not supported (00000000-0000-0000-0000-000000000000).
  97336. func (c *ProjectsSetDefaultServiceAccountCall) RequestId(requestId string) *ProjectsSetDefaultServiceAccountCall {
  97337. c.urlParams_.Set("requestId", requestId)
  97338. return c
  97339. }
  97340. // Fields allows partial responses to be retrieved. See
  97341. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97342. // for more information.
  97343. func (c *ProjectsSetDefaultServiceAccountCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultServiceAccountCall {
  97344. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97345. return c
  97346. }
  97347. // Context sets the context to be used in this call's Do method. Any
  97348. // pending HTTP request will be aborted if the provided context is
  97349. // canceled.
  97350. func (c *ProjectsSetDefaultServiceAccountCall) Context(ctx context.Context) *ProjectsSetDefaultServiceAccountCall {
  97351. c.ctx_ = ctx
  97352. return c
  97353. }
  97354. // Header returns an http.Header that can be modified by the caller to
  97355. // add HTTP headers to the request.
  97356. func (c *ProjectsSetDefaultServiceAccountCall) Header() http.Header {
  97357. if c.header_ == nil {
  97358. c.header_ = make(http.Header)
  97359. }
  97360. return c.header_
  97361. }
  97362. func (c *ProjectsSetDefaultServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  97363. reqHeaders := make(http.Header)
  97364. for k, v := range c.header_ {
  97365. reqHeaders[k] = v
  97366. }
  97367. reqHeaders.Set("User-Agent", c.s.userAgent())
  97368. var body io.Reader = nil
  97369. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultserviceaccountrequest)
  97370. if err != nil {
  97371. return nil, err
  97372. }
  97373. reqHeaders.Set("Content-Type", "application/json")
  97374. c.urlParams_.Set("alt", alt)
  97375. c.urlParams_.Set("prettyPrint", "false")
  97376. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultServiceAccount")
  97377. urls += "?" + c.urlParams_.Encode()
  97378. req, err := http.NewRequest("POST", urls, body)
  97379. if err != nil {
  97380. return nil, err
  97381. }
  97382. req.Header = reqHeaders
  97383. googleapi.Expand(req.URL, map[string]string{
  97384. "project": c.project,
  97385. })
  97386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97387. }
  97388. // Do executes the "compute.projects.setDefaultServiceAccount" call.
  97389. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97390. // status code is an error. Response headers are in either
  97391. // *Operation.ServerResponse.Header or (if a response was returned at
  97392. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97393. // to check whether the returned error was because
  97394. // http.StatusNotModified was returned.
  97395. func (c *ProjectsSetDefaultServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97396. gensupport.SetOptions(c.urlParams_, opts...)
  97397. res, err := c.doRequest("json")
  97398. if res != nil && res.StatusCode == http.StatusNotModified {
  97399. if res.Body != nil {
  97400. res.Body.Close()
  97401. }
  97402. return nil, &googleapi.Error{
  97403. Code: res.StatusCode,
  97404. Header: res.Header,
  97405. }
  97406. }
  97407. if err != nil {
  97408. return nil, err
  97409. }
  97410. defer googleapi.CloseBody(res)
  97411. if err := googleapi.CheckResponse(res); err != nil {
  97412. return nil, err
  97413. }
  97414. ret := &Operation{
  97415. ServerResponse: googleapi.ServerResponse{
  97416. Header: res.Header,
  97417. HTTPStatusCode: res.StatusCode,
  97418. },
  97419. }
  97420. target := &ret
  97421. if err := gensupport.DecodeResponse(target, res); err != nil {
  97422. return nil, err
  97423. }
  97424. return ret, nil
  97425. // {
  97426. // "description": "Sets the default service account of the project. The default service account is used when a VM instance is created with the service account email address set to \"default\".",
  97427. // "httpMethod": "POST",
  97428. // "id": "compute.projects.setDefaultServiceAccount",
  97429. // "parameterOrder": [
  97430. // "project"
  97431. // ],
  97432. // "parameters": {
  97433. // "project": {
  97434. // "description": "Project ID for this request.",
  97435. // "location": "path",
  97436. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97437. // "required": true,
  97438. // "type": "string"
  97439. // },
  97440. // "requestId": {
  97441. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97442. // "location": "query",
  97443. // "type": "string"
  97444. // }
  97445. // },
  97446. // "path": "{project}/setDefaultServiceAccount",
  97447. // "request": {
  97448. // "$ref": "ProjectsSetDefaultServiceAccountRequest"
  97449. // },
  97450. // "response": {
  97451. // "$ref": "Operation"
  97452. // },
  97453. // "scopes": [
  97454. // "https://www.googleapis.com/auth/cloud-platform",
  97455. // "https://www.googleapis.com/auth/compute"
  97456. // ]
  97457. // }
  97458. }
  97459. // method id "compute.projects.setUsageExportBucket":
  97460. type ProjectsSetUsageExportBucketCall struct {
  97461. s *Service
  97462. project string
  97463. usageexportlocation *UsageExportLocation
  97464. urlParams_ gensupport.URLParams
  97465. ctx_ context.Context
  97466. header_ http.Header
  97467. }
  97468. // SetUsageExportBucket: Enables the usage export feature and sets the
  97469. // usage export bucket where reports are stored. If you provide an empty
  97470. // request body using this method, the usage export feature will be
  97471. // disabled.
  97472. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  97473. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  97474. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97475. c.project = project
  97476. c.usageexportlocation = usageexportlocation
  97477. return c
  97478. }
  97479. // RequestId sets the optional parameter "requestId": An optional
  97480. // request ID to identify requests. Specify a unique request ID so that
  97481. // if you must retry your request, the server will know to ignore the
  97482. // request if it has already been completed.
  97483. //
  97484. // For example, consider a situation where you make an initial request
  97485. // and the request times out. If you make the request again with the
  97486. // same request ID, the server can check if original operation with the
  97487. // same request ID was received, and if so, will ignore the second
  97488. // request. This prevents clients from accidentally creating duplicate
  97489. // commitments.
  97490. //
  97491. // The request ID must be a valid UUID with the exception that zero UUID
  97492. // is not supported (00000000-0000-0000-0000-000000000000).
  97493. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  97494. c.urlParams_.Set("requestId", requestId)
  97495. return c
  97496. }
  97497. // Fields allows partial responses to be retrieved. See
  97498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97499. // for more information.
  97500. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  97501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97502. return c
  97503. }
  97504. // Context sets the context to be used in this call's Do method. Any
  97505. // pending HTTP request will be aborted if the provided context is
  97506. // canceled.
  97507. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  97508. c.ctx_ = ctx
  97509. return c
  97510. }
  97511. // Header returns an http.Header that can be modified by the caller to
  97512. // add HTTP headers to the request.
  97513. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  97514. if c.header_ == nil {
  97515. c.header_ = make(http.Header)
  97516. }
  97517. return c.header_
  97518. }
  97519. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  97520. reqHeaders := make(http.Header)
  97521. for k, v := range c.header_ {
  97522. reqHeaders[k] = v
  97523. }
  97524. reqHeaders.Set("User-Agent", c.s.userAgent())
  97525. var body io.Reader = nil
  97526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  97527. if err != nil {
  97528. return nil, err
  97529. }
  97530. reqHeaders.Set("Content-Type", "application/json")
  97531. c.urlParams_.Set("alt", alt)
  97532. c.urlParams_.Set("prettyPrint", "false")
  97533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  97534. urls += "?" + c.urlParams_.Encode()
  97535. req, err := http.NewRequest("POST", urls, body)
  97536. if err != nil {
  97537. return nil, err
  97538. }
  97539. req.Header = reqHeaders
  97540. googleapi.Expand(req.URL, map[string]string{
  97541. "project": c.project,
  97542. })
  97543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97544. }
  97545. // Do executes the "compute.projects.setUsageExportBucket" call.
  97546. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97547. // status code is an error. Response headers are in either
  97548. // *Operation.ServerResponse.Header or (if a response was returned at
  97549. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97550. // to check whether the returned error was because
  97551. // http.StatusNotModified was returned.
  97552. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97553. gensupport.SetOptions(c.urlParams_, opts...)
  97554. res, err := c.doRequest("json")
  97555. if res != nil && res.StatusCode == http.StatusNotModified {
  97556. if res.Body != nil {
  97557. res.Body.Close()
  97558. }
  97559. return nil, &googleapi.Error{
  97560. Code: res.StatusCode,
  97561. Header: res.Header,
  97562. }
  97563. }
  97564. if err != nil {
  97565. return nil, err
  97566. }
  97567. defer googleapi.CloseBody(res)
  97568. if err := googleapi.CheckResponse(res); err != nil {
  97569. return nil, err
  97570. }
  97571. ret := &Operation{
  97572. ServerResponse: googleapi.ServerResponse{
  97573. Header: res.Header,
  97574. HTTPStatusCode: res.StatusCode,
  97575. },
  97576. }
  97577. target := &ret
  97578. if err := gensupport.DecodeResponse(target, res); err != nil {
  97579. return nil, err
  97580. }
  97581. return ret, nil
  97582. // {
  97583. // "description": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.",
  97584. // "httpMethod": "POST",
  97585. // "id": "compute.projects.setUsageExportBucket",
  97586. // "parameterOrder": [
  97587. // "project"
  97588. // ],
  97589. // "parameters": {
  97590. // "project": {
  97591. // "description": "Project ID for this request.",
  97592. // "location": "path",
  97593. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97594. // "required": true,
  97595. // "type": "string"
  97596. // },
  97597. // "requestId": {
  97598. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97599. // "location": "query",
  97600. // "type": "string"
  97601. // }
  97602. // },
  97603. // "path": "{project}/setUsageExportBucket",
  97604. // "request": {
  97605. // "$ref": "UsageExportLocation"
  97606. // },
  97607. // "response": {
  97608. // "$ref": "Operation"
  97609. // },
  97610. // "scopes": [
  97611. // "https://www.googleapis.com/auth/cloud-platform",
  97612. // "https://www.googleapis.com/auth/compute",
  97613. // "https://www.googleapis.com/auth/devstorage.full_control",
  97614. // "https://www.googleapis.com/auth/devstorage.read_only",
  97615. // "https://www.googleapis.com/auth/devstorage.read_write"
  97616. // ]
  97617. // }
  97618. }
  97619. // method id "compute.regionAutoscalers.delete":
  97620. type RegionAutoscalersDeleteCall struct {
  97621. s *Service
  97622. project string
  97623. region string
  97624. autoscaler string
  97625. urlParams_ gensupport.URLParams
  97626. ctx_ context.Context
  97627. header_ http.Header
  97628. }
  97629. // Delete: Deletes the specified autoscaler.
  97630. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  97631. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97632. c.project = project
  97633. c.region = region
  97634. c.autoscaler = autoscaler
  97635. return c
  97636. }
  97637. // RequestId sets the optional parameter "requestId": An optional
  97638. // request ID to identify requests. Specify a unique request ID so that
  97639. // if you must retry your request, the server will know to ignore the
  97640. // request if it has already been completed.
  97641. //
  97642. // For example, consider a situation where you make an initial request
  97643. // and the request times out. If you make the request again with the
  97644. // same request ID, the server can check if original operation with the
  97645. // same request ID was received, and if so, will ignore the second
  97646. // request. This prevents clients from accidentally creating duplicate
  97647. // commitments.
  97648. //
  97649. // The request ID must be a valid UUID with the exception that zero UUID
  97650. // is not supported (00000000-0000-0000-0000-000000000000).
  97651. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  97652. c.urlParams_.Set("requestId", requestId)
  97653. return c
  97654. }
  97655. // Fields allows partial responses to be retrieved. See
  97656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97657. // for more information.
  97658. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  97659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97660. return c
  97661. }
  97662. // Context sets the context to be used in this call's Do method. Any
  97663. // pending HTTP request will be aborted if the provided context is
  97664. // canceled.
  97665. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  97666. c.ctx_ = ctx
  97667. return c
  97668. }
  97669. // Header returns an http.Header that can be modified by the caller to
  97670. // add HTTP headers to the request.
  97671. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  97672. if c.header_ == nil {
  97673. c.header_ = make(http.Header)
  97674. }
  97675. return c.header_
  97676. }
  97677. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  97678. reqHeaders := make(http.Header)
  97679. for k, v := range c.header_ {
  97680. reqHeaders[k] = v
  97681. }
  97682. reqHeaders.Set("User-Agent", c.s.userAgent())
  97683. var body io.Reader = nil
  97684. c.urlParams_.Set("alt", alt)
  97685. c.urlParams_.Set("prettyPrint", "false")
  97686. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  97687. urls += "?" + c.urlParams_.Encode()
  97688. req, err := http.NewRequest("DELETE", urls, body)
  97689. if err != nil {
  97690. return nil, err
  97691. }
  97692. req.Header = reqHeaders
  97693. googleapi.Expand(req.URL, map[string]string{
  97694. "project": c.project,
  97695. "region": c.region,
  97696. "autoscaler": c.autoscaler,
  97697. })
  97698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97699. }
  97700. // Do executes the "compute.regionAutoscalers.delete" call.
  97701. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97702. // status code is an error. Response headers are in either
  97703. // *Operation.ServerResponse.Header or (if a response was returned at
  97704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97705. // to check whether the returned error was because
  97706. // http.StatusNotModified was returned.
  97707. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97708. gensupport.SetOptions(c.urlParams_, opts...)
  97709. res, err := c.doRequest("json")
  97710. if res != nil && res.StatusCode == http.StatusNotModified {
  97711. if res.Body != nil {
  97712. res.Body.Close()
  97713. }
  97714. return nil, &googleapi.Error{
  97715. Code: res.StatusCode,
  97716. Header: res.Header,
  97717. }
  97718. }
  97719. if err != nil {
  97720. return nil, err
  97721. }
  97722. defer googleapi.CloseBody(res)
  97723. if err := googleapi.CheckResponse(res); err != nil {
  97724. return nil, err
  97725. }
  97726. ret := &Operation{
  97727. ServerResponse: googleapi.ServerResponse{
  97728. Header: res.Header,
  97729. HTTPStatusCode: res.StatusCode,
  97730. },
  97731. }
  97732. target := &ret
  97733. if err := gensupport.DecodeResponse(target, res); err != nil {
  97734. return nil, err
  97735. }
  97736. return ret, nil
  97737. // {
  97738. // "description": "Deletes the specified autoscaler.",
  97739. // "httpMethod": "DELETE",
  97740. // "id": "compute.regionAutoscalers.delete",
  97741. // "parameterOrder": [
  97742. // "project",
  97743. // "region",
  97744. // "autoscaler"
  97745. // ],
  97746. // "parameters": {
  97747. // "autoscaler": {
  97748. // "description": "Name of the autoscaler to delete.",
  97749. // "location": "path",
  97750. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97751. // "required": true,
  97752. // "type": "string"
  97753. // },
  97754. // "project": {
  97755. // "description": "Project ID for this request.",
  97756. // "location": "path",
  97757. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97758. // "required": true,
  97759. // "type": "string"
  97760. // },
  97761. // "region": {
  97762. // "description": "Name of the region scoping this request.",
  97763. // "location": "path",
  97764. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97765. // "required": true,
  97766. // "type": "string"
  97767. // },
  97768. // "requestId": {
  97769. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97770. // "location": "query",
  97771. // "type": "string"
  97772. // }
  97773. // },
  97774. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  97775. // "response": {
  97776. // "$ref": "Operation"
  97777. // },
  97778. // "scopes": [
  97779. // "https://www.googleapis.com/auth/cloud-platform",
  97780. // "https://www.googleapis.com/auth/compute"
  97781. // ]
  97782. // }
  97783. }
  97784. // method id "compute.regionAutoscalers.get":
  97785. type RegionAutoscalersGetCall struct {
  97786. s *Service
  97787. project string
  97788. region string
  97789. autoscaler string
  97790. urlParams_ gensupport.URLParams
  97791. ifNoneMatch_ string
  97792. ctx_ context.Context
  97793. header_ http.Header
  97794. }
  97795. // Get: Returns the specified autoscaler.
  97796. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  97797. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97798. c.project = project
  97799. c.region = region
  97800. c.autoscaler = autoscaler
  97801. return c
  97802. }
  97803. // Fields allows partial responses to be retrieved. See
  97804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97805. // for more information.
  97806. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  97807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97808. return c
  97809. }
  97810. // IfNoneMatch sets the optional parameter which makes the operation
  97811. // fail if the object's ETag matches the given value. This is useful for
  97812. // getting updates only after the object has changed since the last
  97813. // request. Use googleapi.IsNotModified to check whether the response
  97814. // error from Do is the result of In-None-Match.
  97815. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  97816. c.ifNoneMatch_ = entityTag
  97817. return c
  97818. }
  97819. // Context sets the context to be used in this call's Do method. Any
  97820. // pending HTTP request will be aborted if the provided context is
  97821. // canceled.
  97822. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  97823. c.ctx_ = ctx
  97824. return c
  97825. }
  97826. // Header returns an http.Header that can be modified by the caller to
  97827. // add HTTP headers to the request.
  97828. func (c *RegionAutoscalersGetCall) Header() http.Header {
  97829. if c.header_ == nil {
  97830. c.header_ = make(http.Header)
  97831. }
  97832. return c.header_
  97833. }
  97834. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  97835. reqHeaders := make(http.Header)
  97836. for k, v := range c.header_ {
  97837. reqHeaders[k] = v
  97838. }
  97839. reqHeaders.Set("User-Agent", c.s.userAgent())
  97840. if c.ifNoneMatch_ != "" {
  97841. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97842. }
  97843. var body io.Reader = nil
  97844. c.urlParams_.Set("alt", alt)
  97845. c.urlParams_.Set("prettyPrint", "false")
  97846. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  97847. urls += "?" + c.urlParams_.Encode()
  97848. req, err := http.NewRequest("GET", urls, body)
  97849. if err != nil {
  97850. return nil, err
  97851. }
  97852. req.Header = reqHeaders
  97853. googleapi.Expand(req.URL, map[string]string{
  97854. "project": c.project,
  97855. "region": c.region,
  97856. "autoscaler": c.autoscaler,
  97857. })
  97858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97859. }
  97860. // Do executes the "compute.regionAutoscalers.get" call.
  97861. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  97862. // status code is an error. Response headers are in either
  97863. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  97864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97865. // to check whether the returned error was because
  97866. // http.StatusNotModified was returned.
  97867. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  97868. gensupport.SetOptions(c.urlParams_, opts...)
  97869. res, err := c.doRequest("json")
  97870. if res != nil && res.StatusCode == http.StatusNotModified {
  97871. if res.Body != nil {
  97872. res.Body.Close()
  97873. }
  97874. return nil, &googleapi.Error{
  97875. Code: res.StatusCode,
  97876. Header: res.Header,
  97877. }
  97878. }
  97879. if err != nil {
  97880. return nil, err
  97881. }
  97882. defer googleapi.CloseBody(res)
  97883. if err := googleapi.CheckResponse(res); err != nil {
  97884. return nil, err
  97885. }
  97886. ret := &Autoscaler{
  97887. ServerResponse: googleapi.ServerResponse{
  97888. Header: res.Header,
  97889. HTTPStatusCode: res.StatusCode,
  97890. },
  97891. }
  97892. target := &ret
  97893. if err := gensupport.DecodeResponse(target, res); err != nil {
  97894. return nil, err
  97895. }
  97896. return ret, nil
  97897. // {
  97898. // "description": "Returns the specified autoscaler.",
  97899. // "httpMethod": "GET",
  97900. // "id": "compute.regionAutoscalers.get",
  97901. // "parameterOrder": [
  97902. // "project",
  97903. // "region",
  97904. // "autoscaler"
  97905. // ],
  97906. // "parameters": {
  97907. // "autoscaler": {
  97908. // "description": "Name of the autoscaler to return.",
  97909. // "location": "path",
  97910. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97911. // "required": true,
  97912. // "type": "string"
  97913. // },
  97914. // "project": {
  97915. // "description": "Project ID for this request.",
  97916. // "location": "path",
  97917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97918. // "required": true,
  97919. // "type": "string"
  97920. // },
  97921. // "region": {
  97922. // "description": "Name of the region scoping this request.",
  97923. // "location": "path",
  97924. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97925. // "required": true,
  97926. // "type": "string"
  97927. // }
  97928. // },
  97929. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  97930. // "response": {
  97931. // "$ref": "Autoscaler"
  97932. // },
  97933. // "scopes": [
  97934. // "https://www.googleapis.com/auth/cloud-platform",
  97935. // "https://www.googleapis.com/auth/compute",
  97936. // "https://www.googleapis.com/auth/compute.readonly"
  97937. // ]
  97938. // }
  97939. }
  97940. // method id "compute.regionAutoscalers.insert":
  97941. type RegionAutoscalersInsertCall struct {
  97942. s *Service
  97943. project string
  97944. region string
  97945. autoscaler *Autoscaler
  97946. urlParams_ gensupport.URLParams
  97947. ctx_ context.Context
  97948. header_ http.Header
  97949. }
  97950. // Insert: Creates an autoscaler in the specified project using the data
  97951. // included in the request.
  97952. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  97953. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97954. c.project = project
  97955. c.region = region
  97956. c.autoscaler = autoscaler
  97957. return c
  97958. }
  97959. // RequestId sets the optional parameter "requestId": An optional
  97960. // request ID to identify requests. Specify a unique request ID so that
  97961. // if you must retry your request, the server will know to ignore the
  97962. // request if it has already been completed.
  97963. //
  97964. // For example, consider a situation where you make an initial request
  97965. // and the request times out. If you make the request again with the
  97966. // same request ID, the server can check if original operation with the
  97967. // same request ID was received, and if so, will ignore the second
  97968. // request. This prevents clients from accidentally creating duplicate
  97969. // commitments.
  97970. //
  97971. // The request ID must be a valid UUID with the exception that zero UUID
  97972. // is not supported (00000000-0000-0000-0000-000000000000).
  97973. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  97974. c.urlParams_.Set("requestId", requestId)
  97975. return c
  97976. }
  97977. // Fields allows partial responses to be retrieved. See
  97978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97979. // for more information.
  97980. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  97981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97982. return c
  97983. }
  97984. // Context sets the context to be used in this call's Do method. Any
  97985. // pending HTTP request will be aborted if the provided context is
  97986. // canceled.
  97987. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  97988. c.ctx_ = ctx
  97989. return c
  97990. }
  97991. // Header returns an http.Header that can be modified by the caller to
  97992. // add HTTP headers to the request.
  97993. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  97994. if c.header_ == nil {
  97995. c.header_ = make(http.Header)
  97996. }
  97997. return c.header_
  97998. }
  97999. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  98000. reqHeaders := make(http.Header)
  98001. for k, v := range c.header_ {
  98002. reqHeaders[k] = v
  98003. }
  98004. reqHeaders.Set("User-Agent", c.s.userAgent())
  98005. var body io.Reader = nil
  98006. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  98007. if err != nil {
  98008. return nil, err
  98009. }
  98010. reqHeaders.Set("Content-Type", "application/json")
  98011. c.urlParams_.Set("alt", alt)
  98012. c.urlParams_.Set("prettyPrint", "false")
  98013. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  98014. urls += "?" + c.urlParams_.Encode()
  98015. req, err := http.NewRequest("POST", urls, body)
  98016. if err != nil {
  98017. return nil, err
  98018. }
  98019. req.Header = reqHeaders
  98020. googleapi.Expand(req.URL, map[string]string{
  98021. "project": c.project,
  98022. "region": c.region,
  98023. })
  98024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98025. }
  98026. // Do executes the "compute.regionAutoscalers.insert" call.
  98027. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98028. // status code is an error. Response headers are in either
  98029. // *Operation.ServerResponse.Header or (if a response was returned at
  98030. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98031. // to check whether the returned error was because
  98032. // http.StatusNotModified was returned.
  98033. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98034. gensupport.SetOptions(c.urlParams_, opts...)
  98035. res, err := c.doRequest("json")
  98036. if res != nil && res.StatusCode == http.StatusNotModified {
  98037. if res.Body != nil {
  98038. res.Body.Close()
  98039. }
  98040. return nil, &googleapi.Error{
  98041. Code: res.StatusCode,
  98042. Header: res.Header,
  98043. }
  98044. }
  98045. if err != nil {
  98046. return nil, err
  98047. }
  98048. defer googleapi.CloseBody(res)
  98049. if err := googleapi.CheckResponse(res); err != nil {
  98050. return nil, err
  98051. }
  98052. ret := &Operation{
  98053. ServerResponse: googleapi.ServerResponse{
  98054. Header: res.Header,
  98055. HTTPStatusCode: res.StatusCode,
  98056. },
  98057. }
  98058. target := &ret
  98059. if err := gensupport.DecodeResponse(target, res); err != nil {
  98060. return nil, err
  98061. }
  98062. return ret, nil
  98063. // {
  98064. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  98065. // "httpMethod": "POST",
  98066. // "id": "compute.regionAutoscalers.insert",
  98067. // "parameterOrder": [
  98068. // "project",
  98069. // "region"
  98070. // ],
  98071. // "parameters": {
  98072. // "project": {
  98073. // "description": "Project ID for this request.",
  98074. // "location": "path",
  98075. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98076. // "required": true,
  98077. // "type": "string"
  98078. // },
  98079. // "region": {
  98080. // "description": "Name of the region scoping this request.",
  98081. // "location": "path",
  98082. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98083. // "required": true,
  98084. // "type": "string"
  98085. // },
  98086. // "requestId": {
  98087. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98088. // "location": "query",
  98089. // "type": "string"
  98090. // }
  98091. // },
  98092. // "path": "{project}/regions/{region}/autoscalers",
  98093. // "request": {
  98094. // "$ref": "Autoscaler"
  98095. // },
  98096. // "response": {
  98097. // "$ref": "Operation"
  98098. // },
  98099. // "scopes": [
  98100. // "https://www.googleapis.com/auth/cloud-platform",
  98101. // "https://www.googleapis.com/auth/compute"
  98102. // ]
  98103. // }
  98104. }
  98105. // method id "compute.regionAutoscalers.list":
  98106. type RegionAutoscalersListCall struct {
  98107. s *Service
  98108. project string
  98109. region string
  98110. urlParams_ gensupport.URLParams
  98111. ifNoneMatch_ string
  98112. ctx_ context.Context
  98113. header_ http.Header
  98114. }
  98115. // List: Retrieves a list of autoscalers contained within the specified
  98116. // region.
  98117. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  98118. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98119. c.project = project
  98120. c.region = region
  98121. return c
  98122. }
  98123. // Filter sets the optional parameter "filter": A filter expression that
  98124. // filters resources listed in the response. The expression must specify
  98125. // the field name, a comparison operator, and the value that you want to
  98126. // use for filtering. The value must be a string, a number, or a
  98127. // boolean. The comparison operator must be either =, !=, >, or <.
  98128. //
  98129. // For example, if you are filtering Compute Engine instances, you can
  98130. // exclude instances named example-instance by specifying name !=
  98131. // example-instance.
  98132. //
  98133. // You can also filter nested fields. For example, you could specify
  98134. // scheduling.automaticRestart = false to include instances only if they
  98135. // are not scheduled for automatic restarts. You can use filtering on
  98136. // nested fields to filter based on resource labels.
  98137. //
  98138. // To filter on multiple expressions, provide each separate expression
  98139. // within parentheses. For example, (scheduling.automaticRestart = true)
  98140. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  98141. // AND expression. However, you can include AND and OR expressions
  98142. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  98143. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  98144. // true).
  98145. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  98146. c.urlParams_.Set("filter", filter)
  98147. return c
  98148. }
  98149. // MaxResults sets the optional parameter "maxResults": The maximum
  98150. // number of results per page that should be returned. If the number of
  98151. // available results is larger than maxResults, Compute Engine returns a
  98152. // nextPageToken that can be used to get the next page of results in
  98153. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  98154. // (Default: 500)
  98155. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  98156. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  98157. return c
  98158. }
  98159. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  98160. // a certain order. By default, results are returned in alphanumerical
  98161. // order based on the resource name.
  98162. //
  98163. // You can also sort results in descending order based on the creation
  98164. // timestamp using orderBy="creationTimestamp desc". This sorts results
  98165. // based on the creationTimestamp field in reverse chronological order
  98166. // (newest result first). Use this to sort resources like operations so
  98167. // that the newest operation is returned first.
  98168. //
  98169. // Currently, only sorting by name or creationTimestamp desc is
  98170. // supported.
  98171. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  98172. c.urlParams_.Set("orderBy", orderBy)
  98173. return c
  98174. }
  98175. // PageToken sets the optional parameter "pageToken": Specifies a page
  98176. // token to use. Set pageToken to the nextPageToken returned by a
  98177. // previous list request to get the next page of results.
  98178. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  98179. c.urlParams_.Set("pageToken", pageToken)
  98180. return c
  98181. }
  98182. // Fields allows partial responses to be retrieved. See
  98183. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98184. // for more information.
  98185. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  98186. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98187. return c
  98188. }
  98189. // IfNoneMatch sets the optional parameter which makes the operation
  98190. // fail if the object's ETag matches the given value. This is useful for
  98191. // getting updates only after the object has changed since the last
  98192. // request. Use googleapi.IsNotModified to check whether the response
  98193. // error from Do is the result of In-None-Match.
  98194. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  98195. c.ifNoneMatch_ = entityTag
  98196. return c
  98197. }
  98198. // Context sets the context to be used in this call's Do method. Any
  98199. // pending HTTP request will be aborted if the provided context is
  98200. // canceled.
  98201. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  98202. c.ctx_ = ctx
  98203. return c
  98204. }
  98205. // Header returns an http.Header that can be modified by the caller to
  98206. // add HTTP headers to the request.
  98207. func (c *RegionAutoscalersListCall) Header() http.Header {
  98208. if c.header_ == nil {
  98209. c.header_ = make(http.Header)
  98210. }
  98211. return c.header_
  98212. }
  98213. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  98214. reqHeaders := make(http.Header)
  98215. for k, v := range c.header_ {
  98216. reqHeaders[k] = v
  98217. }
  98218. reqHeaders.Set("User-Agent", c.s.userAgent())
  98219. if c.ifNoneMatch_ != "" {
  98220. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98221. }
  98222. var body io.Reader = nil
  98223. c.urlParams_.Set("alt", alt)
  98224. c.urlParams_.Set("prettyPrint", "false")
  98225. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  98226. urls += "?" + c.urlParams_.Encode()
  98227. req, err := http.NewRequest("GET", urls, body)
  98228. if err != nil {
  98229. return nil, err
  98230. }
  98231. req.Header = reqHeaders
  98232. googleapi.Expand(req.URL, map[string]string{
  98233. "project": c.project,
  98234. "region": c.region,
  98235. })
  98236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98237. }
  98238. // Do executes the "compute.regionAutoscalers.list" call.
  98239. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  98240. // non-2xx status code is an error. Response headers are in either
  98241. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  98242. // returned at all) in error.(*googleapi.Error).Header. Use
  98243. // googleapi.IsNotModified to check whether the returned error was
  98244. // because http.StatusNotModified was returned.
  98245. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  98246. gensupport.SetOptions(c.urlParams_, opts...)
  98247. res, err := c.doRequest("json")
  98248. if res != nil && res.StatusCode == http.StatusNotModified {
  98249. if res.Body != nil {
  98250. res.Body.Close()
  98251. }
  98252. return nil, &googleapi.Error{
  98253. Code: res.StatusCode,
  98254. Header: res.Header,
  98255. }
  98256. }
  98257. if err != nil {
  98258. return nil, err
  98259. }
  98260. defer googleapi.CloseBody(res)
  98261. if err := googleapi.CheckResponse(res); err != nil {
  98262. return nil, err
  98263. }
  98264. ret := &RegionAutoscalerList{
  98265. ServerResponse: googleapi.ServerResponse{
  98266. Header: res.Header,
  98267. HTTPStatusCode: res.StatusCode,
  98268. },
  98269. }
  98270. target := &ret
  98271. if err := gensupport.DecodeResponse(target, res); err != nil {
  98272. return nil, err
  98273. }
  98274. return ret, nil
  98275. // {
  98276. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  98277. // "httpMethod": "GET",
  98278. // "id": "compute.regionAutoscalers.list",
  98279. // "parameterOrder": [
  98280. // "project",
  98281. // "region"
  98282. // ],
  98283. // "parameters": {
  98284. // "filter": {
  98285. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  98286. // "location": "query",
  98287. // "type": "string"
  98288. // },
  98289. // "maxResults": {
  98290. // "default": "500",
  98291. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  98292. // "format": "uint32",
  98293. // "location": "query",
  98294. // "minimum": "0",
  98295. // "type": "integer"
  98296. // },
  98297. // "orderBy": {
  98298. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  98299. // "location": "query",
  98300. // "type": "string"
  98301. // },
  98302. // "pageToken": {
  98303. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  98304. // "location": "query",
  98305. // "type": "string"
  98306. // },
  98307. // "project": {
  98308. // "description": "Project ID for this request.",
  98309. // "location": "path",
  98310. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98311. // "required": true,
  98312. // "type": "string"
  98313. // },
  98314. // "region": {
  98315. // "description": "Name of the region scoping this request.",
  98316. // "location": "path",
  98317. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98318. // "required": true,
  98319. // "type": "string"
  98320. // }
  98321. // },
  98322. // "path": "{project}/regions/{region}/autoscalers",
  98323. // "response": {
  98324. // "$ref": "RegionAutoscalerList"
  98325. // },
  98326. // "scopes": [
  98327. // "https://www.googleapis.com/auth/cloud-platform",
  98328. // "https://www.googleapis.com/auth/compute",
  98329. // "https://www.googleapis.com/auth/compute.readonly"
  98330. // ]
  98331. // }
  98332. }
  98333. // Pages invokes f for each page of results.
  98334. // A non-nil error returned from f will halt the iteration.
  98335. // The provided context supersedes any context provided to the Context method.
  98336. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  98337. c.ctx_ = ctx
  98338. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98339. for {
  98340. x, err := c.Do()
  98341. if err != nil {
  98342. return err
  98343. }
  98344. if err := f(x); err != nil {
  98345. return err
  98346. }
  98347. if x.NextPageToken == "" {
  98348. return nil
  98349. }
  98350. c.PageToken(x.NextPageToken)
  98351. }
  98352. }
  98353. // method id "compute.regionAutoscalers.patch":
  98354. type RegionAutoscalersPatchCall struct {
  98355. s *Service
  98356. project string
  98357. region string
  98358. autoscaler *Autoscaler
  98359. urlParams_ gensupport.URLParams
  98360. ctx_ context.Context
  98361. header_ http.Header
  98362. }
  98363. // Patch: Updates an autoscaler in the specified project using the data
  98364. // included in the request. This method supports PATCH semantics and
  98365. // uses the JSON merge patch format and processing rules.
  98366. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  98367. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98368. c.project = project
  98369. c.region = region
  98370. c.autoscaler = autoscaler
  98371. return c
  98372. }
  98373. // Autoscaler sets the optional parameter "autoscaler": Name of the
  98374. // autoscaler to patch.
  98375. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  98376. c.urlParams_.Set("autoscaler", autoscaler)
  98377. return c
  98378. }
  98379. // RequestId sets the optional parameter "requestId": An optional
  98380. // request ID to identify requests. Specify a unique request ID so that
  98381. // if you must retry your request, the server will know to ignore the
  98382. // request if it has already been completed.
  98383. //
  98384. // For example, consider a situation where you make an initial request
  98385. // and the request times out. If you make the request again with the
  98386. // same request ID, the server can check if original operation with the
  98387. // same request ID was received, and if so, will ignore the second
  98388. // request. This prevents clients from accidentally creating duplicate
  98389. // commitments.
  98390. //
  98391. // The request ID must be a valid UUID with the exception that zero UUID
  98392. // is not supported (00000000-0000-0000-0000-000000000000).
  98393. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  98394. c.urlParams_.Set("requestId", requestId)
  98395. return c
  98396. }
  98397. // Fields allows partial responses to be retrieved. See
  98398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98399. // for more information.
  98400. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  98401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98402. return c
  98403. }
  98404. // Context sets the context to be used in this call's Do method. Any
  98405. // pending HTTP request will be aborted if the provided context is
  98406. // canceled.
  98407. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  98408. c.ctx_ = ctx
  98409. return c
  98410. }
  98411. // Header returns an http.Header that can be modified by the caller to
  98412. // add HTTP headers to the request.
  98413. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  98414. if c.header_ == nil {
  98415. c.header_ = make(http.Header)
  98416. }
  98417. return c.header_
  98418. }
  98419. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  98420. reqHeaders := make(http.Header)
  98421. for k, v := range c.header_ {
  98422. reqHeaders[k] = v
  98423. }
  98424. reqHeaders.Set("User-Agent", c.s.userAgent())
  98425. var body io.Reader = nil
  98426. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  98427. if err != nil {
  98428. return nil, err
  98429. }
  98430. reqHeaders.Set("Content-Type", "application/json")
  98431. c.urlParams_.Set("alt", alt)
  98432. c.urlParams_.Set("prettyPrint", "false")
  98433. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  98434. urls += "?" + c.urlParams_.Encode()
  98435. req, err := http.NewRequest("PATCH", urls, body)
  98436. if err != nil {
  98437. return nil, err
  98438. }
  98439. req.Header = reqHeaders
  98440. googleapi.Expand(req.URL, map[string]string{
  98441. "project": c.project,
  98442. "region": c.region,
  98443. })
  98444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98445. }
  98446. // Do executes the "compute.regionAutoscalers.patch" call.
  98447. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98448. // status code is an error. Response headers are in either
  98449. // *Operation.ServerResponse.Header or (if a response was returned at
  98450. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98451. // to check whether the returned error was because
  98452. // http.StatusNotModified was returned.
  98453. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98454. gensupport.SetOptions(c.urlParams_, opts...)
  98455. res, err := c.doRequest("json")
  98456. if res != nil && res.StatusCode == http.StatusNotModified {
  98457. if res.Body != nil {
  98458. res.Body.Close()
  98459. }
  98460. return nil, &googleapi.Error{
  98461. Code: res.StatusCode,
  98462. Header: res.Header,
  98463. }
  98464. }
  98465. if err != nil {
  98466. return nil, err
  98467. }
  98468. defer googleapi.CloseBody(res)
  98469. if err := googleapi.CheckResponse(res); err != nil {
  98470. return nil, err
  98471. }
  98472. ret := &Operation{
  98473. ServerResponse: googleapi.ServerResponse{
  98474. Header: res.Header,
  98475. HTTPStatusCode: res.StatusCode,
  98476. },
  98477. }
  98478. target := &ret
  98479. if err := gensupport.DecodeResponse(target, res); err != nil {
  98480. return nil, err
  98481. }
  98482. return ret, nil
  98483. // {
  98484. // "description": "Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  98485. // "httpMethod": "PATCH",
  98486. // "id": "compute.regionAutoscalers.patch",
  98487. // "parameterOrder": [
  98488. // "project",
  98489. // "region"
  98490. // ],
  98491. // "parameters": {
  98492. // "autoscaler": {
  98493. // "description": "Name of the autoscaler to patch.",
  98494. // "location": "query",
  98495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98496. // "type": "string"
  98497. // },
  98498. // "project": {
  98499. // "description": "Project ID for this request.",
  98500. // "location": "path",
  98501. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98502. // "required": true,
  98503. // "type": "string"
  98504. // },
  98505. // "region": {
  98506. // "description": "Name of the region scoping this request.",
  98507. // "location": "path",
  98508. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98509. // "required": true,
  98510. // "type": "string"
  98511. // },
  98512. // "requestId": {
  98513. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98514. // "location": "query",
  98515. // "type": "string"
  98516. // }
  98517. // },
  98518. // "path": "{project}/regions/{region}/autoscalers",
  98519. // "request": {
  98520. // "$ref": "Autoscaler"
  98521. // },
  98522. // "response": {
  98523. // "$ref": "Operation"
  98524. // },
  98525. // "scopes": [
  98526. // "https://www.googleapis.com/auth/cloud-platform",
  98527. // "https://www.googleapis.com/auth/compute"
  98528. // ]
  98529. // }
  98530. }
  98531. // method id "compute.regionAutoscalers.testIamPermissions":
  98532. type RegionAutoscalersTestIamPermissionsCall struct {
  98533. s *Service
  98534. project string
  98535. region string
  98536. resource string
  98537. testpermissionsrequest *TestPermissionsRequest
  98538. urlParams_ gensupport.URLParams
  98539. ctx_ context.Context
  98540. header_ http.Header
  98541. }
  98542. // TestIamPermissions: Returns permissions that a caller has on the
  98543. // specified resource.
  98544. func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall {
  98545. c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98546. c.project = project
  98547. c.region = region
  98548. c.resource = resource
  98549. c.testpermissionsrequest = testpermissionsrequest
  98550. return c
  98551. }
  98552. // Fields allows partial responses to be retrieved. See
  98553. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98554. // for more information.
  98555. func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall {
  98556. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98557. return c
  98558. }
  98559. // Context sets the context to be used in this call's Do method. Any
  98560. // pending HTTP request will be aborted if the provided context is
  98561. // canceled.
  98562. func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall {
  98563. c.ctx_ = ctx
  98564. return c
  98565. }
  98566. // Header returns an http.Header that can be modified by the caller to
  98567. // add HTTP headers to the request.
  98568. func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header {
  98569. if c.header_ == nil {
  98570. c.header_ = make(http.Header)
  98571. }
  98572. return c.header_
  98573. }
  98574. func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  98575. reqHeaders := make(http.Header)
  98576. for k, v := range c.header_ {
  98577. reqHeaders[k] = v
  98578. }
  98579. reqHeaders.Set("User-Agent", c.s.userAgent())
  98580. var body io.Reader = nil
  98581. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  98582. if err != nil {
  98583. return nil, err
  98584. }
  98585. reqHeaders.Set("Content-Type", "application/json")
  98586. c.urlParams_.Set("alt", alt)
  98587. c.urlParams_.Set("prettyPrint", "false")
  98588. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions")
  98589. urls += "?" + c.urlParams_.Encode()
  98590. req, err := http.NewRequest("POST", urls, body)
  98591. if err != nil {
  98592. return nil, err
  98593. }
  98594. req.Header = reqHeaders
  98595. googleapi.Expand(req.URL, map[string]string{
  98596. "project": c.project,
  98597. "region": c.region,
  98598. "resource": c.resource,
  98599. })
  98600. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98601. }
  98602. // Do executes the "compute.regionAutoscalers.testIamPermissions" call.
  98603. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  98604. // non-2xx status code is an error. Response headers are in either
  98605. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  98606. // returned at all) in error.(*googleapi.Error).Header. Use
  98607. // googleapi.IsNotModified to check whether the returned error was
  98608. // because http.StatusNotModified was returned.
  98609. func (c *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  98610. gensupport.SetOptions(c.urlParams_, opts...)
  98611. res, err := c.doRequest("json")
  98612. if res != nil && res.StatusCode == http.StatusNotModified {
  98613. if res.Body != nil {
  98614. res.Body.Close()
  98615. }
  98616. return nil, &googleapi.Error{
  98617. Code: res.StatusCode,
  98618. Header: res.Header,
  98619. }
  98620. }
  98621. if err != nil {
  98622. return nil, err
  98623. }
  98624. defer googleapi.CloseBody(res)
  98625. if err := googleapi.CheckResponse(res); err != nil {
  98626. return nil, err
  98627. }
  98628. ret := &TestPermissionsResponse{
  98629. ServerResponse: googleapi.ServerResponse{
  98630. Header: res.Header,
  98631. HTTPStatusCode: res.StatusCode,
  98632. },
  98633. }
  98634. target := &ret
  98635. if err := gensupport.DecodeResponse(target, res); err != nil {
  98636. return nil, err
  98637. }
  98638. return ret, nil
  98639. // {
  98640. // "description": "Returns permissions that a caller has on the specified resource.",
  98641. // "httpMethod": "POST",
  98642. // "id": "compute.regionAutoscalers.testIamPermissions",
  98643. // "parameterOrder": [
  98644. // "project",
  98645. // "region",
  98646. // "resource"
  98647. // ],
  98648. // "parameters": {
  98649. // "project": {
  98650. // "description": "Project ID for this request.",
  98651. // "location": "path",
  98652. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98653. // "required": true,
  98654. // "type": "string"
  98655. // },
  98656. // "region": {
  98657. // "description": "The name of the region for this request.",
  98658. // "location": "path",
  98659. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98660. // "required": true,
  98661. // "type": "string"
  98662. // },
  98663. // "resource": {
  98664. // "description": "Name or id of the resource for this request.",
  98665. // "location": "path",
  98666. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98667. // "required": true,
  98668. // "type": "string"
  98669. // }
  98670. // },
  98671. // "path": "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions",
  98672. // "request": {
  98673. // "$ref": "TestPermissionsRequest"
  98674. // },
  98675. // "response": {
  98676. // "$ref": "TestPermissionsResponse"
  98677. // },
  98678. // "scopes": [
  98679. // "https://www.googleapis.com/auth/cloud-platform",
  98680. // "https://www.googleapis.com/auth/compute",
  98681. // "https://www.googleapis.com/auth/compute.readonly"
  98682. // ]
  98683. // }
  98684. }
  98685. // method id "compute.regionAutoscalers.update":
  98686. type RegionAutoscalersUpdateCall struct {
  98687. s *Service
  98688. project string
  98689. region string
  98690. autoscaler *Autoscaler
  98691. urlParams_ gensupport.URLParams
  98692. ctx_ context.Context
  98693. header_ http.Header
  98694. }
  98695. // Update: Updates an autoscaler in the specified project using the data
  98696. // included in the request.
  98697. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  98698. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98699. c.project = project
  98700. c.region = region
  98701. c.autoscaler = autoscaler
  98702. return c
  98703. }
  98704. // Autoscaler sets the optional parameter "autoscaler": Name of the
  98705. // autoscaler to update.
  98706. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  98707. c.urlParams_.Set("autoscaler", autoscaler)
  98708. return c
  98709. }
  98710. // RequestId sets the optional parameter "requestId": An optional
  98711. // request ID to identify requests. Specify a unique request ID so that
  98712. // if you must retry your request, the server will know to ignore the
  98713. // request if it has already been completed.
  98714. //
  98715. // For example, consider a situation where you make an initial request
  98716. // and the request times out. If you make the request again with the
  98717. // same request ID, the server can check if original operation with the
  98718. // same request ID was received, and if so, will ignore the second
  98719. // request. This prevents clients from accidentally creating duplicate
  98720. // commitments.
  98721. //
  98722. // The request ID must be a valid UUID with the exception that zero UUID
  98723. // is not supported (00000000-0000-0000-0000-000000000000).
  98724. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  98725. c.urlParams_.Set("requestId", requestId)
  98726. return c
  98727. }
  98728. // Fields allows partial responses to be retrieved. See
  98729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98730. // for more information.
  98731. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  98732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98733. return c
  98734. }
  98735. // Context sets the context to be used in this call's Do method. Any
  98736. // pending HTTP request will be aborted if the provided context is
  98737. // canceled.
  98738. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  98739. c.ctx_ = ctx
  98740. return c
  98741. }
  98742. // Header returns an http.Header that can be modified by the caller to
  98743. // add HTTP headers to the request.
  98744. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  98745. if c.header_ == nil {
  98746. c.header_ = make(http.Header)
  98747. }
  98748. return c.header_
  98749. }
  98750. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  98751. reqHeaders := make(http.Header)
  98752. for k, v := range c.header_ {
  98753. reqHeaders[k] = v
  98754. }
  98755. reqHeaders.Set("User-Agent", c.s.userAgent())
  98756. var body io.Reader = nil
  98757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  98758. if err != nil {
  98759. return nil, err
  98760. }
  98761. reqHeaders.Set("Content-Type", "application/json")
  98762. c.urlParams_.Set("alt", alt)
  98763. c.urlParams_.Set("prettyPrint", "false")
  98764. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  98765. urls += "?" + c.urlParams_.Encode()
  98766. req, err := http.NewRequest("PUT", urls, body)
  98767. if err != nil {
  98768. return nil, err
  98769. }
  98770. req.Header = reqHeaders
  98771. googleapi.Expand(req.URL, map[string]string{
  98772. "project": c.project,
  98773. "region": c.region,
  98774. })
  98775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98776. }
  98777. // Do executes the "compute.regionAutoscalers.update" call.
  98778. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98779. // status code is an error. Response headers are in either
  98780. // *Operation.ServerResponse.Header or (if a response was returned at
  98781. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98782. // to check whether the returned error was because
  98783. // http.StatusNotModified was returned.
  98784. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98785. gensupport.SetOptions(c.urlParams_, opts...)
  98786. res, err := c.doRequest("json")
  98787. if res != nil && res.StatusCode == http.StatusNotModified {
  98788. if res.Body != nil {
  98789. res.Body.Close()
  98790. }
  98791. return nil, &googleapi.Error{
  98792. Code: res.StatusCode,
  98793. Header: res.Header,
  98794. }
  98795. }
  98796. if err != nil {
  98797. return nil, err
  98798. }
  98799. defer googleapi.CloseBody(res)
  98800. if err := googleapi.CheckResponse(res); err != nil {
  98801. return nil, err
  98802. }
  98803. ret := &Operation{
  98804. ServerResponse: googleapi.ServerResponse{
  98805. Header: res.Header,
  98806. HTTPStatusCode: res.StatusCode,
  98807. },
  98808. }
  98809. target := &ret
  98810. if err := gensupport.DecodeResponse(target, res); err != nil {
  98811. return nil, err
  98812. }
  98813. return ret, nil
  98814. // {
  98815. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  98816. // "httpMethod": "PUT",
  98817. // "id": "compute.regionAutoscalers.update",
  98818. // "parameterOrder": [
  98819. // "project",
  98820. // "region"
  98821. // ],
  98822. // "parameters": {
  98823. // "autoscaler": {
  98824. // "description": "Name of the autoscaler to update.",
  98825. // "location": "query",
  98826. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98827. // "type": "string"
  98828. // },
  98829. // "project": {
  98830. // "description": "Project ID for this request.",
  98831. // "location": "path",
  98832. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98833. // "required": true,
  98834. // "type": "string"
  98835. // },
  98836. // "region": {
  98837. // "description": "Name of the region scoping this request.",
  98838. // "location": "path",
  98839. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98840. // "required": true,
  98841. // "type": "string"
  98842. // },
  98843. // "requestId": {
  98844. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98845. // "location": "query",
  98846. // "type": "string"
  98847. // }
  98848. // },
  98849. // "path": "{project}/regions/{region}/autoscalers",
  98850. // "request": {
  98851. // "$ref": "Autoscaler"
  98852. // },
  98853. // "response": {
  98854. // "$ref": "Operation"
  98855. // },
  98856. // "scopes": [
  98857. // "https://www.googleapis.com/auth/cloud-platform",
  98858. // "https://www.googleapis.com/auth/compute"
  98859. // ]
  98860. // }
  98861. }
  98862. // method id "compute.regionBackendServices.delete":
  98863. type RegionBackendServicesDeleteCall struct {
  98864. s *Service
  98865. project string
  98866. region string
  98867. backendService string
  98868. urlParams_ gensupport.URLParams
  98869. ctx_ context.Context
  98870. header_ http.Header
  98871. }
  98872. // Delete: Deletes the specified regional BackendService resource.
  98873. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  98874. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98875. c.project = project
  98876. c.region = region
  98877. c.backendService = backendService
  98878. return c
  98879. }
  98880. // RequestId sets the optional parameter "requestId": An optional
  98881. // request ID to identify requests. Specify a unique request ID so that
  98882. // if you must retry your request, the server will know to ignore the
  98883. // request if it has already been completed.
  98884. //
  98885. // For example, consider a situation where you make an initial request
  98886. // and the request times out. If you make the request again with the
  98887. // same request ID, the server can check if original operation with the
  98888. // same request ID was received, and if so, will ignore the second
  98889. // request. This prevents clients from accidentally creating duplicate
  98890. // commitments.
  98891. //
  98892. // The request ID must be a valid UUID with the exception that zero UUID
  98893. // is not supported (00000000-0000-0000-0000-000000000000).
  98894. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  98895. c.urlParams_.Set("requestId", requestId)
  98896. return c
  98897. }
  98898. // Fields allows partial responses to be retrieved. See
  98899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98900. // for more information.
  98901. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  98902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98903. return c
  98904. }
  98905. // Context sets the context to be used in this call's Do method. Any
  98906. // pending HTTP request will be aborted if the provided context is
  98907. // canceled.
  98908. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  98909. c.ctx_ = ctx
  98910. return c
  98911. }
  98912. // Header returns an http.Header that can be modified by the caller to
  98913. // add HTTP headers to the request.
  98914. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  98915. if c.header_ == nil {
  98916. c.header_ = make(http.Header)
  98917. }
  98918. return c.header_
  98919. }
  98920. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  98921. reqHeaders := make(http.Header)
  98922. for k, v := range c.header_ {
  98923. reqHeaders[k] = v
  98924. }
  98925. reqHeaders.Set("User-Agent", c.s.userAgent())
  98926. var body io.Reader = nil
  98927. c.urlParams_.Set("alt", alt)
  98928. c.urlParams_.Set("prettyPrint", "false")
  98929. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  98930. urls += "?" + c.urlParams_.Encode()
  98931. req, err := http.NewRequest("DELETE", urls, body)
  98932. if err != nil {
  98933. return nil, err
  98934. }
  98935. req.Header = reqHeaders
  98936. googleapi.Expand(req.URL, map[string]string{
  98937. "project": c.project,
  98938. "region": c.region,
  98939. "backendService": c.backendService,
  98940. })
  98941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98942. }
  98943. // Do executes the "compute.regionBackendServices.delete" call.
  98944. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98945. // status code is an error. Response headers are in either
  98946. // *Operation.ServerResponse.Header or (if a response was returned at
  98947. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98948. // to check whether the returned error was because
  98949. // http.StatusNotModified was returned.
  98950. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98951. gensupport.SetOptions(c.urlParams_, opts...)
  98952. res, err := c.doRequest("json")
  98953. if res != nil && res.StatusCode == http.StatusNotModified {
  98954. if res.Body != nil {
  98955. res.Body.Close()
  98956. }
  98957. return nil, &googleapi.Error{
  98958. Code: res.StatusCode,
  98959. Header: res.Header,
  98960. }
  98961. }
  98962. if err != nil {
  98963. return nil, err
  98964. }
  98965. defer googleapi.CloseBody(res)
  98966. if err := googleapi.CheckResponse(res); err != nil {
  98967. return nil, err
  98968. }
  98969. ret := &Operation{
  98970. ServerResponse: googleapi.ServerResponse{
  98971. Header: res.Header,
  98972. HTTPStatusCode: res.StatusCode,
  98973. },
  98974. }
  98975. target := &ret
  98976. if err := gensupport.DecodeResponse(target, res); err != nil {
  98977. return nil, err
  98978. }
  98979. return ret, nil
  98980. // {
  98981. // "description": "Deletes the specified regional BackendService resource.",
  98982. // "httpMethod": "DELETE",
  98983. // "id": "compute.regionBackendServices.delete",
  98984. // "parameterOrder": [
  98985. // "project",
  98986. // "region",
  98987. // "backendService"
  98988. // ],
  98989. // "parameters": {
  98990. // "backendService": {
  98991. // "description": "Name of the BackendService resource to delete.",
  98992. // "location": "path",
  98993. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98994. // "required": true,
  98995. // "type": "string"
  98996. // },
  98997. // "project": {
  98998. // "description": "Project ID for this request.",
  98999. // "location": "path",
  99000. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99001. // "required": true,
  99002. // "type": "string"
  99003. // },
  99004. // "region": {
  99005. // "description": "Name of the region scoping this request.",
  99006. // "location": "path",
  99007. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99008. // "required": true,
  99009. // "type": "string"
  99010. // },
  99011. // "requestId": {
  99012. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99013. // "location": "query",
  99014. // "type": "string"
  99015. // }
  99016. // },
  99017. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  99018. // "response": {
  99019. // "$ref": "Operation"
  99020. // },
  99021. // "scopes": [
  99022. // "https://www.googleapis.com/auth/cloud-platform",
  99023. // "https://www.googleapis.com/auth/compute"
  99024. // ]
  99025. // }
  99026. }
  99027. // method id "compute.regionBackendServices.get":
  99028. type RegionBackendServicesGetCall struct {
  99029. s *Service
  99030. project string
  99031. region string
  99032. backendService string
  99033. urlParams_ gensupport.URLParams
  99034. ifNoneMatch_ string
  99035. ctx_ context.Context
  99036. header_ http.Header
  99037. }
  99038. // Get: Returns the specified regional BackendService resource.
  99039. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  99040. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99041. c.project = project
  99042. c.region = region
  99043. c.backendService = backendService
  99044. return c
  99045. }
  99046. // Fields allows partial responses to be retrieved. See
  99047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99048. // for more information.
  99049. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  99050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99051. return c
  99052. }
  99053. // IfNoneMatch sets the optional parameter which makes the operation
  99054. // fail if the object's ETag matches the given value. This is useful for
  99055. // getting updates only after the object has changed since the last
  99056. // request. Use googleapi.IsNotModified to check whether the response
  99057. // error from Do is the result of In-None-Match.
  99058. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  99059. c.ifNoneMatch_ = entityTag
  99060. return c
  99061. }
  99062. // Context sets the context to be used in this call's Do method. Any
  99063. // pending HTTP request will be aborted if the provided context is
  99064. // canceled.
  99065. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  99066. c.ctx_ = ctx
  99067. return c
  99068. }
  99069. // Header returns an http.Header that can be modified by the caller to
  99070. // add HTTP headers to the request.
  99071. func (c *RegionBackendServicesGetCall) Header() http.Header {
  99072. if c.header_ == nil {
  99073. c.header_ = make(http.Header)
  99074. }
  99075. return c.header_
  99076. }
  99077. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  99078. reqHeaders := make(http.Header)
  99079. for k, v := range c.header_ {
  99080. reqHeaders[k] = v
  99081. }
  99082. reqHeaders.Set("User-Agent", c.s.userAgent())
  99083. if c.ifNoneMatch_ != "" {
  99084. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99085. }
  99086. var body io.Reader = nil
  99087. c.urlParams_.Set("alt", alt)
  99088. c.urlParams_.Set("prettyPrint", "false")
  99089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  99090. urls += "?" + c.urlParams_.Encode()
  99091. req, err := http.NewRequest("GET", urls, body)
  99092. if err != nil {
  99093. return nil, err
  99094. }
  99095. req.Header = reqHeaders
  99096. googleapi.Expand(req.URL, map[string]string{
  99097. "project": c.project,
  99098. "region": c.region,
  99099. "backendService": c.backendService,
  99100. })
  99101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99102. }
  99103. // Do executes the "compute.regionBackendServices.get" call.
  99104. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  99105. // status code is an error. Response headers are in either
  99106. // *BackendService.ServerResponse.Header or (if a response was returned
  99107. // at all) in error.(*googleapi.Error).Header. Use
  99108. // googleapi.IsNotModified to check whether the returned error was
  99109. // because http.StatusNotModified was returned.
  99110. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  99111. gensupport.SetOptions(c.urlParams_, opts...)
  99112. res, err := c.doRequest("json")
  99113. if res != nil && res.StatusCode == http.StatusNotModified {
  99114. if res.Body != nil {
  99115. res.Body.Close()
  99116. }
  99117. return nil, &googleapi.Error{
  99118. Code: res.StatusCode,
  99119. Header: res.Header,
  99120. }
  99121. }
  99122. if err != nil {
  99123. return nil, err
  99124. }
  99125. defer googleapi.CloseBody(res)
  99126. if err := googleapi.CheckResponse(res); err != nil {
  99127. return nil, err
  99128. }
  99129. ret := &BackendService{
  99130. ServerResponse: googleapi.ServerResponse{
  99131. Header: res.Header,
  99132. HTTPStatusCode: res.StatusCode,
  99133. },
  99134. }
  99135. target := &ret
  99136. if err := gensupport.DecodeResponse(target, res); err != nil {
  99137. return nil, err
  99138. }
  99139. return ret, nil
  99140. // {
  99141. // "description": "Returns the specified regional BackendService resource.",
  99142. // "httpMethod": "GET",
  99143. // "id": "compute.regionBackendServices.get",
  99144. // "parameterOrder": [
  99145. // "project",
  99146. // "region",
  99147. // "backendService"
  99148. // ],
  99149. // "parameters": {
  99150. // "backendService": {
  99151. // "description": "Name of the BackendService resource to return.",
  99152. // "location": "path",
  99153. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99154. // "required": true,
  99155. // "type": "string"
  99156. // },
  99157. // "project": {
  99158. // "description": "Project ID for this request.",
  99159. // "location": "path",
  99160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99161. // "required": true,
  99162. // "type": "string"
  99163. // },
  99164. // "region": {
  99165. // "description": "Name of the region scoping this request.",
  99166. // "location": "path",
  99167. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99168. // "required": true,
  99169. // "type": "string"
  99170. // }
  99171. // },
  99172. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  99173. // "response": {
  99174. // "$ref": "BackendService"
  99175. // },
  99176. // "scopes": [
  99177. // "https://www.googleapis.com/auth/cloud-platform",
  99178. // "https://www.googleapis.com/auth/compute",
  99179. // "https://www.googleapis.com/auth/compute.readonly"
  99180. // ]
  99181. // }
  99182. }
  99183. // method id "compute.regionBackendServices.getHealth":
  99184. type RegionBackendServicesGetHealthCall struct {
  99185. s *Service
  99186. project string
  99187. region string
  99188. backendService string
  99189. resourcegroupreference *ResourceGroupReference
  99190. urlParams_ gensupport.URLParams
  99191. ctx_ context.Context
  99192. header_ http.Header
  99193. }
  99194. // GetHealth: Gets the most recent health check results for this
  99195. // regional BackendService.
  99196. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  99197. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99198. c.project = project
  99199. c.region = region
  99200. c.backendService = backendService
  99201. c.resourcegroupreference = resourcegroupreference
  99202. return c
  99203. }
  99204. // Fields allows partial responses to be retrieved. See
  99205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99206. // for more information.
  99207. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  99208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99209. return c
  99210. }
  99211. // Context sets the context to be used in this call's Do method. Any
  99212. // pending HTTP request will be aborted if the provided context is
  99213. // canceled.
  99214. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  99215. c.ctx_ = ctx
  99216. return c
  99217. }
  99218. // Header returns an http.Header that can be modified by the caller to
  99219. // add HTTP headers to the request.
  99220. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  99221. if c.header_ == nil {
  99222. c.header_ = make(http.Header)
  99223. }
  99224. return c.header_
  99225. }
  99226. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  99227. reqHeaders := make(http.Header)
  99228. for k, v := range c.header_ {
  99229. reqHeaders[k] = v
  99230. }
  99231. reqHeaders.Set("User-Agent", c.s.userAgent())
  99232. var body io.Reader = nil
  99233. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  99234. if err != nil {
  99235. return nil, err
  99236. }
  99237. reqHeaders.Set("Content-Type", "application/json")
  99238. c.urlParams_.Set("alt", alt)
  99239. c.urlParams_.Set("prettyPrint", "false")
  99240. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  99241. urls += "?" + c.urlParams_.Encode()
  99242. req, err := http.NewRequest("POST", urls, body)
  99243. if err != nil {
  99244. return nil, err
  99245. }
  99246. req.Header = reqHeaders
  99247. googleapi.Expand(req.URL, map[string]string{
  99248. "project": c.project,
  99249. "region": c.region,
  99250. "backendService": c.backendService,
  99251. })
  99252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99253. }
  99254. // Do executes the "compute.regionBackendServices.getHealth" call.
  99255. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  99256. // Any non-2xx status code is an error. Response headers are in either
  99257. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  99258. // was returned at all) in error.(*googleapi.Error).Header. Use
  99259. // googleapi.IsNotModified to check whether the returned error was
  99260. // because http.StatusNotModified was returned.
  99261. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  99262. gensupport.SetOptions(c.urlParams_, opts...)
  99263. res, err := c.doRequest("json")
  99264. if res != nil && res.StatusCode == http.StatusNotModified {
  99265. if res.Body != nil {
  99266. res.Body.Close()
  99267. }
  99268. return nil, &googleapi.Error{
  99269. Code: res.StatusCode,
  99270. Header: res.Header,
  99271. }
  99272. }
  99273. if err != nil {
  99274. return nil, err
  99275. }
  99276. defer googleapi.CloseBody(res)
  99277. if err := googleapi.CheckResponse(res); err != nil {
  99278. return nil, err
  99279. }
  99280. ret := &BackendServiceGroupHealth{
  99281. ServerResponse: googleapi.ServerResponse{
  99282. Header: res.Header,
  99283. HTTPStatusCode: res.StatusCode,
  99284. },
  99285. }
  99286. target := &ret
  99287. if err := gensupport.DecodeResponse(target, res); err != nil {
  99288. return nil, err
  99289. }
  99290. return ret, nil
  99291. // {
  99292. // "description": "Gets the most recent health check results for this regional BackendService.",
  99293. // "httpMethod": "POST",
  99294. // "id": "compute.regionBackendServices.getHealth",
  99295. // "parameterOrder": [
  99296. // "project",
  99297. // "region",
  99298. // "backendService"
  99299. // ],
  99300. // "parameters": {
  99301. // "backendService": {
  99302. // "description": "Name of the BackendService resource for which to get health.",
  99303. // "location": "path",
  99304. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99305. // "required": true,
  99306. // "type": "string"
  99307. // },
  99308. // "project": {
  99309. // "location": "path",
  99310. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99311. // "required": true,
  99312. // "type": "string"
  99313. // },
  99314. // "region": {
  99315. // "description": "Name of the region scoping this request.",
  99316. // "location": "path",
  99317. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99318. // "required": true,
  99319. // "type": "string"
  99320. // }
  99321. // },
  99322. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  99323. // "request": {
  99324. // "$ref": "ResourceGroupReference"
  99325. // },
  99326. // "response": {
  99327. // "$ref": "BackendServiceGroupHealth"
  99328. // },
  99329. // "scopes": [
  99330. // "https://www.googleapis.com/auth/cloud-platform",
  99331. // "https://www.googleapis.com/auth/compute",
  99332. // "https://www.googleapis.com/auth/compute.readonly"
  99333. // ]
  99334. // }
  99335. }
  99336. // method id "compute.regionBackendServices.insert":
  99337. type RegionBackendServicesInsertCall struct {
  99338. s *Service
  99339. project string
  99340. region string
  99341. backendservice *BackendService
  99342. urlParams_ gensupport.URLParams
  99343. ctx_ context.Context
  99344. header_ http.Header
  99345. }
  99346. // Insert: Creates a regional BackendService resource in the specified
  99347. // project using the data included in the request. There are several
  99348. // restrictions and guidelines to keep in mind when creating a regional
  99349. // backend service. Read Restrictions and Guidelines for more
  99350. // information.
  99351. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  99352. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99353. c.project = project
  99354. c.region = region
  99355. c.backendservice = backendservice
  99356. return c
  99357. }
  99358. // RequestId sets the optional parameter "requestId": An optional
  99359. // request ID to identify requests. Specify a unique request ID so that
  99360. // if you must retry your request, the server will know to ignore the
  99361. // request if it has already been completed.
  99362. //
  99363. // For example, consider a situation where you make an initial request
  99364. // and the request times out. If you make the request again with the
  99365. // same request ID, the server can check if original operation with the
  99366. // same request ID was received, and if so, will ignore the second
  99367. // request. This prevents clients from accidentally creating duplicate
  99368. // commitments.
  99369. //
  99370. // The request ID must be a valid UUID with the exception that zero UUID
  99371. // is not supported (00000000-0000-0000-0000-000000000000).
  99372. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  99373. c.urlParams_.Set("requestId", requestId)
  99374. return c
  99375. }
  99376. // Fields allows partial responses to be retrieved. See
  99377. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99378. // for more information.
  99379. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  99380. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99381. return c
  99382. }
  99383. // Context sets the context to be used in this call's Do method. Any
  99384. // pending HTTP request will be aborted if the provided context is
  99385. // canceled.
  99386. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  99387. c.ctx_ = ctx
  99388. return c
  99389. }
  99390. // Header returns an http.Header that can be modified by the caller to
  99391. // add HTTP headers to the request.
  99392. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  99393. if c.header_ == nil {
  99394. c.header_ = make(http.Header)
  99395. }
  99396. return c.header_
  99397. }
  99398. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  99399. reqHeaders := make(http.Header)
  99400. for k, v := range c.header_ {
  99401. reqHeaders[k] = v
  99402. }
  99403. reqHeaders.Set("User-Agent", c.s.userAgent())
  99404. var body io.Reader = nil
  99405. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  99406. if err != nil {
  99407. return nil, err
  99408. }
  99409. reqHeaders.Set("Content-Type", "application/json")
  99410. c.urlParams_.Set("alt", alt)
  99411. c.urlParams_.Set("prettyPrint", "false")
  99412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  99413. urls += "?" + c.urlParams_.Encode()
  99414. req, err := http.NewRequest("POST", urls, body)
  99415. if err != nil {
  99416. return nil, err
  99417. }
  99418. req.Header = reqHeaders
  99419. googleapi.Expand(req.URL, map[string]string{
  99420. "project": c.project,
  99421. "region": c.region,
  99422. })
  99423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99424. }
  99425. // Do executes the "compute.regionBackendServices.insert" call.
  99426. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99427. // status code is an error. Response headers are in either
  99428. // *Operation.ServerResponse.Header or (if a response was returned at
  99429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99430. // to check whether the returned error was because
  99431. // http.StatusNotModified was returned.
  99432. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99433. gensupport.SetOptions(c.urlParams_, opts...)
  99434. res, err := c.doRequest("json")
  99435. if res != nil && res.StatusCode == http.StatusNotModified {
  99436. if res.Body != nil {
  99437. res.Body.Close()
  99438. }
  99439. return nil, &googleapi.Error{
  99440. Code: res.StatusCode,
  99441. Header: res.Header,
  99442. }
  99443. }
  99444. if err != nil {
  99445. return nil, err
  99446. }
  99447. defer googleapi.CloseBody(res)
  99448. if err := googleapi.CheckResponse(res); err != nil {
  99449. return nil, err
  99450. }
  99451. ret := &Operation{
  99452. ServerResponse: googleapi.ServerResponse{
  99453. Header: res.Header,
  99454. HTTPStatusCode: res.StatusCode,
  99455. },
  99456. }
  99457. target := &ret
  99458. if err := gensupport.DecodeResponse(target, res); err != nil {
  99459. return nil, err
  99460. }
  99461. return ret, nil
  99462. // {
  99463. // "description": "Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information.",
  99464. // "httpMethod": "POST",
  99465. // "id": "compute.regionBackendServices.insert",
  99466. // "parameterOrder": [
  99467. // "project",
  99468. // "region"
  99469. // ],
  99470. // "parameters": {
  99471. // "project": {
  99472. // "description": "Project ID for this request.",
  99473. // "location": "path",
  99474. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99475. // "required": true,
  99476. // "type": "string"
  99477. // },
  99478. // "region": {
  99479. // "description": "Name of the region scoping this request.",
  99480. // "location": "path",
  99481. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99482. // "required": true,
  99483. // "type": "string"
  99484. // },
  99485. // "requestId": {
  99486. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99487. // "location": "query",
  99488. // "type": "string"
  99489. // }
  99490. // },
  99491. // "path": "{project}/regions/{region}/backendServices",
  99492. // "request": {
  99493. // "$ref": "BackendService"
  99494. // },
  99495. // "response": {
  99496. // "$ref": "Operation"
  99497. // },
  99498. // "scopes": [
  99499. // "https://www.googleapis.com/auth/cloud-platform",
  99500. // "https://www.googleapis.com/auth/compute"
  99501. // ]
  99502. // }
  99503. }
  99504. // method id "compute.regionBackendServices.list":
  99505. type RegionBackendServicesListCall struct {
  99506. s *Service
  99507. project string
  99508. region string
  99509. urlParams_ gensupport.URLParams
  99510. ifNoneMatch_ string
  99511. ctx_ context.Context
  99512. header_ http.Header
  99513. }
  99514. // List: Retrieves the list of regional BackendService resources
  99515. // available to the specified project in the given region.
  99516. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  99517. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99518. c.project = project
  99519. c.region = region
  99520. return c
  99521. }
  99522. // Filter sets the optional parameter "filter": A filter expression that
  99523. // filters resources listed in the response. The expression must specify
  99524. // the field name, a comparison operator, and the value that you want to
  99525. // use for filtering. The value must be a string, a number, or a
  99526. // boolean. The comparison operator must be either =, !=, >, or <.
  99527. //
  99528. // For example, if you are filtering Compute Engine instances, you can
  99529. // exclude instances named example-instance by specifying name !=
  99530. // example-instance.
  99531. //
  99532. // You can also filter nested fields. For example, you could specify
  99533. // scheduling.automaticRestart = false to include instances only if they
  99534. // are not scheduled for automatic restarts. You can use filtering on
  99535. // nested fields to filter based on resource labels.
  99536. //
  99537. // To filter on multiple expressions, provide each separate expression
  99538. // within parentheses. For example, (scheduling.automaticRestart = true)
  99539. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99540. // AND expression. However, you can include AND and OR expressions
  99541. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99542. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99543. // true).
  99544. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  99545. c.urlParams_.Set("filter", filter)
  99546. return c
  99547. }
  99548. // MaxResults sets the optional parameter "maxResults": The maximum
  99549. // number of results per page that should be returned. If the number of
  99550. // available results is larger than maxResults, Compute Engine returns a
  99551. // nextPageToken that can be used to get the next page of results in
  99552. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99553. // (Default: 500)
  99554. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  99555. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99556. return c
  99557. }
  99558. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99559. // a certain order. By default, results are returned in alphanumerical
  99560. // order based on the resource name.
  99561. //
  99562. // You can also sort results in descending order based on the creation
  99563. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99564. // based on the creationTimestamp field in reverse chronological order
  99565. // (newest result first). Use this to sort resources like operations so
  99566. // that the newest operation is returned first.
  99567. //
  99568. // Currently, only sorting by name or creationTimestamp desc is
  99569. // supported.
  99570. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  99571. c.urlParams_.Set("orderBy", orderBy)
  99572. return c
  99573. }
  99574. // PageToken sets the optional parameter "pageToken": Specifies a page
  99575. // token to use. Set pageToken to the nextPageToken returned by a
  99576. // previous list request to get the next page of results.
  99577. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  99578. c.urlParams_.Set("pageToken", pageToken)
  99579. return c
  99580. }
  99581. // Fields allows partial responses to be retrieved. See
  99582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99583. // for more information.
  99584. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  99585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99586. return c
  99587. }
  99588. // IfNoneMatch sets the optional parameter which makes the operation
  99589. // fail if the object's ETag matches the given value. This is useful for
  99590. // getting updates only after the object has changed since the last
  99591. // request. Use googleapi.IsNotModified to check whether the response
  99592. // error from Do is the result of In-None-Match.
  99593. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  99594. c.ifNoneMatch_ = entityTag
  99595. return c
  99596. }
  99597. // Context sets the context to be used in this call's Do method. Any
  99598. // pending HTTP request will be aborted if the provided context is
  99599. // canceled.
  99600. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  99601. c.ctx_ = ctx
  99602. return c
  99603. }
  99604. // Header returns an http.Header that can be modified by the caller to
  99605. // add HTTP headers to the request.
  99606. func (c *RegionBackendServicesListCall) Header() http.Header {
  99607. if c.header_ == nil {
  99608. c.header_ = make(http.Header)
  99609. }
  99610. return c.header_
  99611. }
  99612. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  99613. reqHeaders := make(http.Header)
  99614. for k, v := range c.header_ {
  99615. reqHeaders[k] = v
  99616. }
  99617. reqHeaders.Set("User-Agent", c.s.userAgent())
  99618. if c.ifNoneMatch_ != "" {
  99619. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99620. }
  99621. var body io.Reader = nil
  99622. c.urlParams_.Set("alt", alt)
  99623. c.urlParams_.Set("prettyPrint", "false")
  99624. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  99625. urls += "?" + c.urlParams_.Encode()
  99626. req, err := http.NewRequest("GET", urls, body)
  99627. if err != nil {
  99628. return nil, err
  99629. }
  99630. req.Header = reqHeaders
  99631. googleapi.Expand(req.URL, map[string]string{
  99632. "project": c.project,
  99633. "region": c.region,
  99634. })
  99635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99636. }
  99637. // Do executes the "compute.regionBackendServices.list" call.
  99638. // Exactly one of *BackendServiceList or error will be non-nil. Any
  99639. // non-2xx status code is an error. Response headers are in either
  99640. // *BackendServiceList.ServerResponse.Header or (if a response was
  99641. // returned at all) in error.(*googleapi.Error).Header. Use
  99642. // googleapi.IsNotModified to check whether the returned error was
  99643. // because http.StatusNotModified was returned.
  99644. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  99645. gensupport.SetOptions(c.urlParams_, opts...)
  99646. res, err := c.doRequest("json")
  99647. if res != nil && res.StatusCode == http.StatusNotModified {
  99648. if res.Body != nil {
  99649. res.Body.Close()
  99650. }
  99651. return nil, &googleapi.Error{
  99652. Code: res.StatusCode,
  99653. Header: res.Header,
  99654. }
  99655. }
  99656. if err != nil {
  99657. return nil, err
  99658. }
  99659. defer googleapi.CloseBody(res)
  99660. if err := googleapi.CheckResponse(res); err != nil {
  99661. return nil, err
  99662. }
  99663. ret := &BackendServiceList{
  99664. ServerResponse: googleapi.ServerResponse{
  99665. Header: res.Header,
  99666. HTTPStatusCode: res.StatusCode,
  99667. },
  99668. }
  99669. target := &ret
  99670. if err := gensupport.DecodeResponse(target, res); err != nil {
  99671. return nil, err
  99672. }
  99673. return ret, nil
  99674. // {
  99675. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  99676. // "httpMethod": "GET",
  99677. // "id": "compute.regionBackendServices.list",
  99678. // "parameterOrder": [
  99679. // "project",
  99680. // "region"
  99681. // ],
  99682. // "parameters": {
  99683. // "filter": {
  99684. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  99685. // "location": "query",
  99686. // "type": "string"
  99687. // },
  99688. // "maxResults": {
  99689. // "default": "500",
  99690. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  99691. // "format": "uint32",
  99692. // "location": "query",
  99693. // "minimum": "0",
  99694. // "type": "integer"
  99695. // },
  99696. // "orderBy": {
  99697. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  99698. // "location": "query",
  99699. // "type": "string"
  99700. // },
  99701. // "pageToken": {
  99702. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  99703. // "location": "query",
  99704. // "type": "string"
  99705. // },
  99706. // "project": {
  99707. // "description": "Project ID for this request.",
  99708. // "location": "path",
  99709. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99710. // "required": true,
  99711. // "type": "string"
  99712. // },
  99713. // "region": {
  99714. // "description": "Name of the region scoping this request.",
  99715. // "location": "path",
  99716. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99717. // "required": true,
  99718. // "type": "string"
  99719. // }
  99720. // },
  99721. // "path": "{project}/regions/{region}/backendServices",
  99722. // "response": {
  99723. // "$ref": "BackendServiceList"
  99724. // },
  99725. // "scopes": [
  99726. // "https://www.googleapis.com/auth/cloud-platform",
  99727. // "https://www.googleapis.com/auth/compute",
  99728. // "https://www.googleapis.com/auth/compute.readonly"
  99729. // ]
  99730. // }
  99731. }
  99732. // Pages invokes f for each page of results.
  99733. // A non-nil error returned from f will halt the iteration.
  99734. // The provided context supersedes any context provided to the Context method.
  99735. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  99736. c.ctx_ = ctx
  99737. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  99738. for {
  99739. x, err := c.Do()
  99740. if err != nil {
  99741. return err
  99742. }
  99743. if err := f(x); err != nil {
  99744. return err
  99745. }
  99746. if x.NextPageToken == "" {
  99747. return nil
  99748. }
  99749. c.PageToken(x.NextPageToken)
  99750. }
  99751. }
  99752. // method id "compute.regionBackendServices.patch":
  99753. type RegionBackendServicesPatchCall struct {
  99754. s *Service
  99755. project string
  99756. region string
  99757. backendService string
  99758. backendservice *BackendService
  99759. urlParams_ gensupport.URLParams
  99760. ctx_ context.Context
  99761. header_ http.Header
  99762. }
  99763. // Patch: Updates the specified regional BackendService resource with
  99764. // the data included in the request. There are several restrictions and
  99765. // guidelines to keep in mind when updating a backend service. Read
  99766. // Restrictions and Guidelines for more information. This method
  99767. // supports PATCH semantics and uses the JSON merge patch format and
  99768. // processing rules.
  99769. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  99770. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99771. c.project = project
  99772. c.region = region
  99773. c.backendService = backendService
  99774. c.backendservice = backendservice
  99775. return c
  99776. }
  99777. // RequestId sets the optional parameter "requestId": An optional
  99778. // request ID to identify requests. Specify a unique request ID so that
  99779. // if you must retry your request, the server will know to ignore the
  99780. // request if it has already been completed.
  99781. //
  99782. // For example, consider a situation where you make an initial request
  99783. // and the request times out. If you make the request again with the
  99784. // same request ID, the server can check if original operation with the
  99785. // same request ID was received, and if so, will ignore the second
  99786. // request. This prevents clients from accidentally creating duplicate
  99787. // commitments.
  99788. //
  99789. // The request ID must be a valid UUID with the exception that zero UUID
  99790. // is not supported (00000000-0000-0000-0000-000000000000).
  99791. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  99792. c.urlParams_.Set("requestId", requestId)
  99793. return c
  99794. }
  99795. // Fields allows partial responses to be retrieved. See
  99796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99797. // for more information.
  99798. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  99799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99800. return c
  99801. }
  99802. // Context sets the context to be used in this call's Do method. Any
  99803. // pending HTTP request will be aborted if the provided context is
  99804. // canceled.
  99805. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  99806. c.ctx_ = ctx
  99807. return c
  99808. }
  99809. // Header returns an http.Header that can be modified by the caller to
  99810. // add HTTP headers to the request.
  99811. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  99812. if c.header_ == nil {
  99813. c.header_ = make(http.Header)
  99814. }
  99815. return c.header_
  99816. }
  99817. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  99818. reqHeaders := make(http.Header)
  99819. for k, v := range c.header_ {
  99820. reqHeaders[k] = v
  99821. }
  99822. reqHeaders.Set("User-Agent", c.s.userAgent())
  99823. var body io.Reader = nil
  99824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  99825. if err != nil {
  99826. return nil, err
  99827. }
  99828. reqHeaders.Set("Content-Type", "application/json")
  99829. c.urlParams_.Set("alt", alt)
  99830. c.urlParams_.Set("prettyPrint", "false")
  99831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  99832. urls += "?" + c.urlParams_.Encode()
  99833. req, err := http.NewRequest("PATCH", urls, body)
  99834. if err != nil {
  99835. return nil, err
  99836. }
  99837. req.Header = reqHeaders
  99838. googleapi.Expand(req.URL, map[string]string{
  99839. "project": c.project,
  99840. "region": c.region,
  99841. "backendService": c.backendService,
  99842. })
  99843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99844. }
  99845. // Do executes the "compute.regionBackendServices.patch" call.
  99846. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99847. // status code is an error. Response headers are in either
  99848. // *Operation.ServerResponse.Header or (if a response was returned at
  99849. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99850. // to check whether the returned error was because
  99851. // http.StatusNotModified was returned.
  99852. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99853. gensupport.SetOptions(c.urlParams_, opts...)
  99854. res, err := c.doRequest("json")
  99855. if res != nil && res.StatusCode == http.StatusNotModified {
  99856. if res.Body != nil {
  99857. res.Body.Close()
  99858. }
  99859. return nil, &googleapi.Error{
  99860. Code: res.StatusCode,
  99861. Header: res.Header,
  99862. }
  99863. }
  99864. if err != nil {
  99865. return nil, err
  99866. }
  99867. defer googleapi.CloseBody(res)
  99868. if err := googleapi.CheckResponse(res); err != nil {
  99869. return nil, err
  99870. }
  99871. ret := &Operation{
  99872. ServerResponse: googleapi.ServerResponse{
  99873. Header: res.Header,
  99874. HTTPStatusCode: res.StatusCode,
  99875. },
  99876. }
  99877. target := &ret
  99878. if err := gensupport.DecodeResponse(target, res); err != nil {
  99879. return nil, err
  99880. }
  99881. return ret, nil
  99882. // {
  99883. // "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  99884. // "httpMethod": "PATCH",
  99885. // "id": "compute.regionBackendServices.patch",
  99886. // "parameterOrder": [
  99887. // "project",
  99888. // "region",
  99889. // "backendService"
  99890. // ],
  99891. // "parameters": {
  99892. // "backendService": {
  99893. // "description": "Name of the BackendService resource to patch.",
  99894. // "location": "path",
  99895. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99896. // "required": true,
  99897. // "type": "string"
  99898. // },
  99899. // "project": {
  99900. // "description": "Project ID for this request.",
  99901. // "location": "path",
  99902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99903. // "required": true,
  99904. // "type": "string"
  99905. // },
  99906. // "region": {
  99907. // "description": "Name of the region scoping this request.",
  99908. // "location": "path",
  99909. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99910. // "required": true,
  99911. // "type": "string"
  99912. // },
  99913. // "requestId": {
  99914. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99915. // "location": "query",
  99916. // "type": "string"
  99917. // }
  99918. // },
  99919. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  99920. // "request": {
  99921. // "$ref": "BackendService"
  99922. // },
  99923. // "response": {
  99924. // "$ref": "Operation"
  99925. // },
  99926. // "scopes": [
  99927. // "https://www.googleapis.com/auth/cloud-platform",
  99928. // "https://www.googleapis.com/auth/compute"
  99929. // ]
  99930. // }
  99931. }
  99932. // method id "compute.regionBackendServices.testIamPermissions":
  99933. type RegionBackendServicesTestIamPermissionsCall struct {
  99934. s *Service
  99935. project string
  99936. region string
  99937. resource string
  99938. testpermissionsrequest *TestPermissionsRequest
  99939. urlParams_ gensupport.URLParams
  99940. ctx_ context.Context
  99941. header_ http.Header
  99942. }
  99943. // TestIamPermissions: Returns permissions that a caller has on the
  99944. // specified resource.
  99945. func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall {
  99946. c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99947. c.project = project
  99948. c.region = region
  99949. c.resource = resource
  99950. c.testpermissionsrequest = testpermissionsrequest
  99951. return c
  99952. }
  99953. // Fields allows partial responses to be retrieved. See
  99954. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99955. // for more information.
  99956. func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall {
  99957. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99958. return c
  99959. }
  99960. // Context sets the context to be used in this call's Do method. Any
  99961. // pending HTTP request will be aborted if the provided context is
  99962. // canceled.
  99963. func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall {
  99964. c.ctx_ = ctx
  99965. return c
  99966. }
  99967. // Header returns an http.Header that can be modified by the caller to
  99968. // add HTTP headers to the request.
  99969. func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header {
  99970. if c.header_ == nil {
  99971. c.header_ = make(http.Header)
  99972. }
  99973. return c.header_
  99974. }
  99975. func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  99976. reqHeaders := make(http.Header)
  99977. for k, v := range c.header_ {
  99978. reqHeaders[k] = v
  99979. }
  99980. reqHeaders.Set("User-Agent", c.s.userAgent())
  99981. var body io.Reader = nil
  99982. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  99983. if err != nil {
  99984. return nil, err
  99985. }
  99986. reqHeaders.Set("Content-Type", "application/json")
  99987. c.urlParams_.Set("alt", alt)
  99988. c.urlParams_.Set("prettyPrint", "false")
  99989. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{resource}/testIamPermissions")
  99990. urls += "?" + c.urlParams_.Encode()
  99991. req, err := http.NewRequest("POST", urls, body)
  99992. if err != nil {
  99993. return nil, err
  99994. }
  99995. req.Header = reqHeaders
  99996. googleapi.Expand(req.URL, map[string]string{
  99997. "project": c.project,
  99998. "region": c.region,
  99999. "resource": c.resource,
  100000. })
  100001. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100002. }
  100003. // Do executes the "compute.regionBackendServices.testIamPermissions" call.
  100004. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  100005. // non-2xx status code is an error. Response headers are in either
  100006. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  100007. // returned at all) in error.(*googleapi.Error).Header. Use
  100008. // googleapi.IsNotModified to check whether the returned error was
  100009. // because http.StatusNotModified was returned.
  100010. func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  100011. gensupport.SetOptions(c.urlParams_, opts...)
  100012. res, err := c.doRequest("json")
  100013. if res != nil && res.StatusCode == http.StatusNotModified {
  100014. if res.Body != nil {
  100015. res.Body.Close()
  100016. }
  100017. return nil, &googleapi.Error{
  100018. Code: res.StatusCode,
  100019. Header: res.Header,
  100020. }
  100021. }
  100022. if err != nil {
  100023. return nil, err
  100024. }
  100025. defer googleapi.CloseBody(res)
  100026. if err := googleapi.CheckResponse(res); err != nil {
  100027. return nil, err
  100028. }
  100029. ret := &TestPermissionsResponse{
  100030. ServerResponse: googleapi.ServerResponse{
  100031. Header: res.Header,
  100032. HTTPStatusCode: res.StatusCode,
  100033. },
  100034. }
  100035. target := &ret
  100036. if err := gensupport.DecodeResponse(target, res); err != nil {
  100037. return nil, err
  100038. }
  100039. return ret, nil
  100040. // {
  100041. // "description": "Returns permissions that a caller has on the specified resource.",
  100042. // "httpMethod": "POST",
  100043. // "id": "compute.regionBackendServices.testIamPermissions",
  100044. // "parameterOrder": [
  100045. // "project",
  100046. // "region",
  100047. // "resource"
  100048. // ],
  100049. // "parameters": {
  100050. // "project": {
  100051. // "description": "Project ID for this request.",
  100052. // "location": "path",
  100053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100054. // "required": true,
  100055. // "type": "string"
  100056. // },
  100057. // "region": {
  100058. // "description": "The name of the region for this request.",
  100059. // "location": "path",
  100060. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100061. // "required": true,
  100062. // "type": "string"
  100063. // },
  100064. // "resource": {
  100065. // "description": "Name or id of the resource for this request.",
  100066. // "location": "path",
  100067. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100068. // "required": true,
  100069. // "type": "string"
  100070. // }
  100071. // },
  100072. // "path": "{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
  100073. // "request": {
  100074. // "$ref": "TestPermissionsRequest"
  100075. // },
  100076. // "response": {
  100077. // "$ref": "TestPermissionsResponse"
  100078. // },
  100079. // "scopes": [
  100080. // "https://www.googleapis.com/auth/cloud-platform",
  100081. // "https://www.googleapis.com/auth/compute",
  100082. // "https://www.googleapis.com/auth/compute.readonly"
  100083. // ]
  100084. // }
  100085. }
  100086. // method id "compute.regionBackendServices.update":
  100087. type RegionBackendServicesUpdateCall struct {
  100088. s *Service
  100089. project string
  100090. region string
  100091. backendService string
  100092. backendservice *BackendService
  100093. urlParams_ gensupport.URLParams
  100094. ctx_ context.Context
  100095. header_ http.Header
  100096. }
  100097. // Update: Updates the specified regional BackendService resource with
  100098. // the data included in the request. There are several restrictions and
  100099. // guidelines to keep in mind when updating a backend service. Read
  100100. // Restrictions and Guidelines for more information.
  100101. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  100102. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100103. c.project = project
  100104. c.region = region
  100105. c.backendService = backendService
  100106. c.backendservice = backendservice
  100107. return c
  100108. }
  100109. // RequestId sets the optional parameter "requestId": An optional
  100110. // request ID to identify requests. Specify a unique request ID so that
  100111. // if you must retry your request, the server will know to ignore the
  100112. // request if it has already been completed.
  100113. //
  100114. // For example, consider a situation where you make an initial request
  100115. // and the request times out. If you make the request again with the
  100116. // same request ID, the server can check if original operation with the
  100117. // same request ID was received, and if so, will ignore the second
  100118. // request. This prevents clients from accidentally creating duplicate
  100119. // commitments.
  100120. //
  100121. // The request ID must be a valid UUID with the exception that zero UUID
  100122. // is not supported (00000000-0000-0000-0000-000000000000).
  100123. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  100124. c.urlParams_.Set("requestId", requestId)
  100125. return c
  100126. }
  100127. // Fields allows partial responses to be retrieved. See
  100128. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100129. // for more information.
  100130. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  100131. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100132. return c
  100133. }
  100134. // Context sets the context to be used in this call's Do method. Any
  100135. // pending HTTP request will be aborted if the provided context is
  100136. // canceled.
  100137. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  100138. c.ctx_ = ctx
  100139. return c
  100140. }
  100141. // Header returns an http.Header that can be modified by the caller to
  100142. // add HTTP headers to the request.
  100143. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  100144. if c.header_ == nil {
  100145. c.header_ = make(http.Header)
  100146. }
  100147. return c.header_
  100148. }
  100149. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  100150. reqHeaders := make(http.Header)
  100151. for k, v := range c.header_ {
  100152. reqHeaders[k] = v
  100153. }
  100154. reqHeaders.Set("User-Agent", c.s.userAgent())
  100155. var body io.Reader = nil
  100156. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  100157. if err != nil {
  100158. return nil, err
  100159. }
  100160. reqHeaders.Set("Content-Type", "application/json")
  100161. c.urlParams_.Set("alt", alt)
  100162. c.urlParams_.Set("prettyPrint", "false")
  100163. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  100164. urls += "?" + c.urlParams_.Encode()
  100165. req, err := http.NewRequest("PUT", urls, body)
  100166. if err != nil {
  100167. return nil, err
  100168. }
  100169. req.Header = reqHeaders
  100170. googleapi.Expand(req.URL, map[string]string{
  100171. "project": c.project,
  100172. "region": c.region,
  100173. "backendService": c.backendService,
  100174. })
  100175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100176. }
  100177. // Do executes the "compute.regionBackendServices.update" call.
  100178. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100179. // status code is an error. Response headers are in either
  100180. // *Operation.ServerResponse.Header or (if a response was returned at
  100181. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100182. // to check whether the returned error was because
  100183. // http.StatusNotModified was returned.
  100184. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100185. gensupport.SetOptions(c.urlParams_, opts...)
  100186. res, err := c.doRequest("json")
  100187. if res != nil && res.StatusCode == http.StatusNotModified {
  100188. if res.Body != nil {
  100189. res.Body.Close()
  100190. }
  100191. return nil, &googleapi.Error{
  100192. Code: res.StatusCode,
  100193. Header: res.Header,
  100194. }
  100195. }
  100196. if err != nil {
  100197. return nil, err
  100198. }
  100199. defer googleapi.CloseBody(res)
  100200. if err := googleapi.CheckResponse(res); err != nil {
  100201. return nil, err
  100202. }
  100203. ret := &Operation{
  100204. ServerResponse: googleapi.ServerResponse{
  100205. Header: res.Header,
  100206. HTTPStatusCode: res.StatusCode,
  100207. },
  100208. }
  100209. target := &ret
  100210. if err := gensupport.DecodeResponse(target, res); err != nil {
  100211. return nil, err
  100212. }
  100213. return ret, nil
  100214. // {
  100215. // "description": "Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information.",
  100216. // "httpMethod": "PUT",
  100217. // "id": "compute.regionBackendServices.update",
  100218. // "parameterOrder": [
  100219. // "project",
  100220. // "region",
  100221. // "backendService"
  100222. // ],
  100223. // "parameters": {
  100224. // "backendService": {
  100225. // "description": "Name of the BackendService resource to update.",
  100226. // "location": "path",
  100227. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100228. // "required": true,
  100229. // "type": "string"
  100230. // },
  100231. // "project": {
  100232. // "description": "Project ID for this request.",
  100233. // "location": "path",
  100234. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100235. // "required": true,
  100236. // "type": "string"
  100237. // },
  100238. // "region": {
  100239. // "description": "Name of the region scoping this request.",
  100240. // "location": "path",
  100241. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100242. // "required": true,
  100243. // "type": "string"
  100244. // },
  100245. // "requestId": {
  100246. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100247. // "location": "query",
  100248. // "type": "string"
  100249. // }
  100250. // },
  100251. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  100252. // "request": {
  100253. // "$ref": "BackendService"
  100254. // },
  100255. // "response": {
  100256. // "$ref": "Operation"
  100257. // },
  100258. // "scopes": [
  100259. // "https://www.googleapis.com/auth/cloud-platform",
  100260. // "https://www.googleapis.com/auth/compute"
  100261. // ]
  100262. // }
  100263. }
  100264. // method id "compute.regionCommitments.aggregatedList":
  100265. type RegionCommitmentsAggregatedListCall struct {
  100266. s *Service
  100267. project string
  100268. urlParams_ gensupport.URLParams
  100269. ifNoneMatch_ string
  100270. ctx_ context.Context
  100271. header_ http.Header
  100272. }
  100273. // AggregatedList: Retrieves an aggregated list of commitments.
  100274. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  100275. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100276. c.project = project
  100277. return c
  100278. }
  100279. // Filter sets the optional parameter "filter": A filter expression that
  100280. // filters resources listed in the response. The expression must specify
  100281. // the field name, a comparison operator, and the value that you want to
  100282. // use for filtering. The value must be a string, a number, or a
  100283. // boolean. The comparison operator must be either =, !=, >, or <.
  100284. //
  100285. // For example, if you are filtering Compute Engine instances, you can
  100286. // exclude instances named example-instance by specifying name !=
  100287. // example-instance.
  100288. //
  100289. // You can also filter nested fields. For example, you could specify
  100290. // scheduling.automaticRestart = false to include instances only if they
  100291. // are not scheduled for automatic restarts. You can use filtering on
  100292. // nested fields to filter based on resource labels.
  100293. //
  100294. // To filter on multiple expressions, provide each separate expression
  100295. // within parentheses. For example, (scheduling.automaticRestart = true)
  100296. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100297. // AND expression. However, you can include AND and OR expressions
  100298. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100299. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100300. // true).
  100301. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  100302. c.urlParams_.Set("filter", filter)
  100303. return c
  100304. }
  100305. // MaxResults sets the optional parameter "maxResults": The maximum
  100306. // number of results per page that should be returned. If the number of
  100307. // available results is larger than maxResults, Compute Engine returns a
  100308. // nextPageToken that can be used to get the next page of results in
  100309. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100310. // (Default: 500)
  100311. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  100312. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100313. return c
  100314. }
  100315. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100316. // a certain order. By default, results are returned in alphanumerical
  100317. // order based on the resource name.
  100318. //
  100319. // You can also sort results in descending order based on the creation
  100320. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100321. // based on the creationTimestamp field in reverse chronological order
  100322. // (newest result first). Use this to sort resources like operations so
  100323. // that the newest operation is returned first.
  100324. //
  100325. // Currently, only sorting by name or creationTimestamp desc is
  100326. // supported.
  100327. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  100328. c.urlParams_.Set("orderBy", orderBy)
  100329. return c
  100330. }
  100331. // PageToken sets the optional parameter "pageToken": Specifies a page
  100332. // token to use. Set pageToken to the nextPageToken returned by a
  100333. // previous list request to get the next page of results.
  100334. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  100335. c.urlParams_.Set("pageToken", pageToken)
  100336. return c
  100337. }
  100338. // Fields allows partial responses to be retrieved. See
  100339. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100340. // for more information.
  100341. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  100342. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100343. return c
  100344. }
  100345. // IfNoneMatch sets the optional parameter which makes the operation
  100346. // fail if the object's ETag matches the given value. This is useful for
  100347. // getting updates only after the object has changed since the last
  100348. // request. Use googleapi.IsNotModified to check whether the response
  100349. // error from Do is the result of In-None-Match.
  100350. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  100351. c.ifNoneMatch_ = entityTag
  100352. return c
  100353. }
  100354. // Context sets the context to be used in this call's Do method. Any
  100355. // pending HTTP request will be aborted if the provided context is
  100356. // canceled.
  100357. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  100358. c.ctx_ = ctx
  100359. return c
  100360. }
  100361. // Header returns an http.Header that can be modified by the caller to
  100362. // add HTTP headers to the request.
  100363. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  100364. if c.header_ == nil {
  100365. c.header_ = make(http.Header)
  100366. }
  100367. return c.header_
  100368. }
  100369. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  100370. reqHeaders := make(http.Header)
  100371. for k, v := range c.header_ {
  100372. reqHeaders[k] = v
  100373. }
  100374. reqHeaders.Set("User-Agent", c.s.userAgent())
  100375. if c.ifNoneMatch_ != "" {
  100376. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100377. }
  100378. var body io.Reader = nil
  100379. c.urlParams_.Set("alt", alt)
  100380. c.urlParams_.Set("prettyPrint", "false")
  100381. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  100382. urls += "?" + c.urlParams_.Encode()
  100383. req, err := http.NewRequest("GET", urls, body)
  100384. if err != nil {
  100385. return nil, err
  100386. }
  100387. req.Header = reqHeaders
  100388. googleapi.Expand(req.URL, map[string]string{
  100389. "project": c.project,
  100390. })
  100391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100392. }
  100393. // Do executes the "compute.regionCommitments.aggregatedList" call.
  100394. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  100395. // Any non-2xx status code is an error. Response headers are in either
  100396. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  100397. // returned at all) in error.(*googleapi.Error).Header. Use
  100398. // googleapi.IsNotModified to check whether the returned error was
  100399. // because http.StatusNotModified was returned.
  100400. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  100401. gensupport.SetOptions(c.urlParams_, opts...)
  100402. res, err := c.doRequest("json")
  100403. if res != nil && res.StatusCode == http.StatusNotModified {
  100404. if res.Body != nil {
  100405. res.Body.Close()
  100406. }
  100407. return nil, &googleapi.Error{
  100408. Code: res.StatusCode,
  100409. Header: res.Header,
  100410. }
  100411. }
  100412. if err != nil {
  100413. return nil, err
  100414. }
  100415. defer googleapi.CloseBody(res)
  100416. if err := googleapi.CheckResponse(res); err != nil {
  100417. return nil, err
  100418. }
  100419. ret := &CommitmentAggregatedList{
  100420. ServerResponse: googleapi.ServerResponse{
  100421. Header: res.Header,
  100422. HTTPStatusCode: res.StatusCode,
  100423. },
  100424. }
  100425. target := &ret
  100426. if err := gensupport.DecodeResponse(target, res); err != nil {
  100427. return nil, err
  100428. }
  100429. return ret, nil
  100430. // {
  100431. // "description": "Retrieves an aggregated list of commitments.",
  100432. // "httpMethod": "GET",
  100433. // "id": "compute.regionCommitments.aggregatedList",
  100434. // "parameterOrder": [
  100435. // "project"
  100436. // ],
  100437. // "parameters": {
  100438. // "filter": {
  100439. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  100440. // "location": "query",
  100441. // "type": "string"
  100442. // },
  100443. // "maxResults": {
  100444. // "default": "500",
  100445. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  100446. // "format": "uint32",
  100447. // "location": "query",
  100448. // "minimum": "0",
  100449. // "type": "integer"
  100450. // },
  100451. // "orderBy": {
  100452. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  100453. // "location": "query",
  100454. // "type": "string"
  100455. // },
  100456. // "pageToken": {
  100457. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  100458. // "location": "query",
  100459. // "type": "string"
  100460. // },
  100461. // "project": {
  100462. // "description": "Project ID for this request.",
  100463. // "location": "path",
  100464. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100465. // "required": true,
  100466. // "type": "string"
  100467. // }
  100468. // },
  100469. // "path": "{project}/aggregated/commitments",
  100470. // "response": {
  100471. // "$ref": "CommitmentAggregatedList"
  100472. // },
  100473. // "scopes": [
  100474. // "https://www.googleapis.com/auth/cloud-platform",
  100475. // "https://www.googleapis.com/auth/compute",
  100476. // "https://www.googleapis.com/auth/compute.readonly"
  100477. // ]
  100478. // }
  100479. }
  100480. // Pages invokes f for each page of results.
  100481. // A non-nil error returned from f will halt the iteration.
  100482. // The provided context supersedes any context provided to the Context method.
  100483. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  100484. c.ctx_ = ctx
  100485. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100486. for {
  100487. x, err := c.Do()
  100488. if err != nil {
  100489. return err
  100490. }
  100491. if err := f(x); err != nil {
  100492. return err
  100493. }
  100494. if x.NextPageToken == "" {
  100495. return nil
  100496. }
  100497. c.PageToken(x.NextPageToken)
  100498. }
  100499. }
  100500. // method id "compute.regionCommitments.get":
  100501. type RegionCommitmentsGetCall struct {
  100502. s *Service
  100503. project string
  100504. region string
  100505. commitment string
  100506. urlParams_ gensupport.URLParams
  100507. ifNoneMatch_ string
  100508. ctx_ context.Context
  100509. header_ http.Header
  100510. }
  100511. // Get: Returns the specified commitment resource. Gets a list of
  100512. // available commitments by making a list() request.
  100513. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  100514. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100515. c.project = project
  100516. c.region = region
  100517. c.commitment = commitment
  100518. return c
  100519. }
  100520. // Fields allows partial responses to be retrieved. See
  100521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100522. // for more information.
  100523. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  100524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100525. return c
  100526. }
  100527. // IfNoneMatch sets the optional parameter which makes the operation
  100528. // fail if the object's ETag matches the given value. This is useful for
  100529. // getting updates only after the object has changed since the last
  100530. // request. Use googleapi.IsNotModified to check whether the response
  100531. // error from Do is the result of In-None-Match.
  100532. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  100533. c.ifNoneMatch_ = entityTag
  100534. return c
  100535. }
  100536. // Context sets the context to be used in this call's Do method. Any
  100537. // pending HTTP request will be aborted if the provided context is
  100538. // canceled.
  100539. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  100540. c.ctx_ = ctx
  100541. return c
  100542. }
  100543. // Header returns an http.Header that can be modified by the caller to
  100544. // add HTTP headers to the request.
  100545. func (c *RegionCommitmentsGetCall) Header() http.Header {
  100546. if c.header_ == nil {
  100547. c.header_ = make(http.Header)
  100548. }
  100549. return c.header_
  100550. }
  100551. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  100552. reqHeaders := make(http.Header)
  100553. for k, v := range c.header_ {
  100554. reqHeaders[k] = v
  100555. }
  100556. reqHeaders.Set("User-Agent", c.s.userAgent())
  100557. if c.ifNoneMatch_ != "" {
  100558. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100559. }
  100560. var body io.Reader = nil
  100561. c.urlParams_.Set("alt", alt)
  100562. c.urlParams_.Set("prettyPrint", "false")
  100563. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  100564. urls += "?" + c.urlParams_.Encode()
  100565. req, err := http.NewRequest("GET", urls, body)
  100566. if err != nil {
  100567. return nil, err
  100568. }
  100569. req.Header = reqHeaders
  100570. googleapi.Expand(req.URL, map[string]string{
  100571. "project": c.project,
  100572. "region": c.region,
  100573. "commitment": c.commitment,
  100574. })
  100575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100576. }
  100577. // Do executes the "compute.regionCommitments.get" call.
  100578. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  100579. // status code is an error. Response headers are in either
  100580. // *Commitment.ServerResponse.Header or (if a response was returned at
  100581. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100582. // to check whether the returned error was because
  100583. // http.StatusNotModified was returned.
  100584. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  100585. gensupport.SetOptions(c.urlParams_, opts...)
  100586. res, err := c.doRequest("json")
  100587. if res != nil && res.StatusCode == http.StatusNotModified {
  100588. if res.Body != nil {
  100589. res.Body.Close()
  100590. }
  100591. return nil, &googleapi.Error{
  100592. Code: res.StatusCode,
  100593. Header: res.Header,
  100594. }
  100595. }
  100596. if err != nil {
  100597. return nil, err
  100598. }
  100599. defer googleapi.CloseBody(res)
  100600. if err := googleapi.CheckResponse(res); err != nil {
  100601. return nil, err
  100602. }
  100603. ret := &Commitment{
  100604. ServerResponse: googleapi.ServerResponse{
  100605. Header: res.Header,
  100606. HTTPStatusCode: res.StatusCode,
  100607. },
  100608. }
  100609. target := &ret
  100610. if err := gensupport.DecodeResponse(target, res); err != nil {
  100611. return nil, err
  100612. }
  100613. return ret, nil
  100614. // {
  100615. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  100616. // "httpMethod": "GET",
  100617. // "id": "compute.regionCommitments.get",
  100618. // "parameterOrder": [
  100619. // "project",
  100620. // "region",
  100621. // "commitment"
  100622. // ],
  100623. // "parameters": {
  100624. // "commitment": {
  100625. // "description": "Name of the commitment to return.",
  100626. // "location": "path",
  100627. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100628. // "required": true,
  100629. // "type": "string"
  100630. // },
  100631. // "project": {
  100632. // "description": "Project ID for this request.",
  100633. // "location": "path",
  100634. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100635. // "required": true,
  100636. // "type": "string"
  100637. // },
  100638. // "region": {
  100639. // "description": "Name of the region for this request.",
  100640. // "location": "path",
  100641. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100642. // "required": true,
  100643. // "type": "string"
  100644. // }
  100645. // },
  100646. // "path": "{project}/regions/{region}/commitments/{commitment}",
  100647. // "response": {
  100648. // "$ref": "Commitment"
  100649. // },
  100650. // "scopes": [
  100651. // "https://www.googleapis.com/auth/cloud-platform",
  100652. // "https://www.googleapis.com/auth/compute",
  100653. // "https://www.googleapis.com/auth/compute.readonly"
  100654. // ]
  100655. // }
  100656. }
  100657. // method id "compute.regionCommitments.insert":
  100658. type RegionCommitmentsInsertCall struct {
  100659. s *Service
  100660. project string
  100661. region string
  100662. commitment *Commitment
  100663. urlParams_ gensupport.URLParams
  100664. ctx_ context.Context
  100665. header_ http.Header
  100666. }
  100667. // Insert: Creates a commitment in the specified project using the data
  100668. // included in the request.
  100669. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  100670. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100671. c.project = project
  100672. c.region = region
  100673. c.commitment = commitment
  100674. return c
  100675. }
  100676. // RequestId sets the optional parameter "requestId": An optional
  100677. // request ID to identify requests. Specify a unique request ID so that
  100678. // if you must retry your request, the server will know to ignore the
  100679. // request if it has already been completed.
  100680. //
  100681. // For example, consider a situation where you make an initial request
  100682. // and the request times out. If you make the request again with the
  100683. // same request ID, the server can check if original operation with the
  100684. // same request ID was received, and if so, will ignore the second
  100685. // request. This prevents clients from accidentally creating duplicate
  100686. // commitments.
  100687. //
  100688. // The request ID must be a valid UUID with the exception that zero UUID
  100689. // is not supported (00000000-0000-0000-0000-000000000000).
  100690. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  100691. c.urlParams_.Set("requestId", requestId)
  100692. return c
  100693. }
  100694. // Fields allows partial responses to be retrieved. See
  100695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100696. // for more information.
  100697. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  100698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100699. return c
  100700. }
  100701. // Context sets the context to be used in this call's Do method. Any
  100702. // pending HTTP request will be aborted if the provided context is
  100703. // canceled.
  100704. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  100705. c.ctx_ = ctx
  100706. return c
  100707. }
  100708. // Header returns an http.Header that can be modified by the caller to
  100709. // add HTTP headers to the request.
  100710. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  100711. if c.header_ == nil {
  100712. c.header_ = make(http.Header)
  100713. }
  100714. return c.header_
  100715. }
  100716. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  100717. reqHeaders := make(http.Header)
  100718. for k, v := range c.header_ {
  100719. reqHeaders[k] = v
  100720. }
  100721. reqHeaders.Set("User-Agent", c.s.userAgent())
  100722. var body io.Reader = nil
  100723. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  100724. if err != nil {
  100725. return nil, err
  100726. }
  100727. reqHeaders.Set("Content-Type", "application/json")
  100728. c.urlParams_.Set("alt", alt)
  100729. c.urlParams_.Set("prettyPrint", "false")
  100730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  100731. urls += "?" + c.urlParams_.Encode()
  100732. req, err := http.NewRequest("POST", urls, body)
  100733. if err != nil {
  100734. return nil, err
  100735. }
  100736. req.Header = reqHeaders
  100737. googleapi.Expand(req.URL, map[string]string{
  100738. "project": c.project,
  100739. "region": c.region,
  100740. })
  100741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100742. }
  100743. // Do executes the "compute.regionCommitments.insert" call.
  100744. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100745. // status code is an error. Response headers are in either
  100746. // *Operation.ServerResponse.Header or (if a response was returned at
  100747. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100748. // to check whether the returned error was because
  100749. // http.StatusNotModified was returned.
  100750. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100751. gensupport.SetOptions(c.urlParams_, opts...)
  100752. res, err := c.doRequest("json")
  100753. if res != nil && res.StatusCode == http.StatusNotModified {
  100754. if res.Body != nil {
  100755. res.Body.Close()
  100756. }
  100757. return nil, &googleapi.Error{
  100758. Code: res.StatusCode,
  100759. Header: res.Header,
  100760. }
  100761. }
  100762. if err != nil {
  100763. return nil, err
  100764. }
  100765. defer googleapi.CloseBody(res)
  100766. if err := googleapi.CheckResponse(res); err != nil {
  100767. return nil, err
  100768. }
  100769. ret := &Operation{
  100770. ServerResponse: googleapi.ServerResponse{
  100771. Header: res.Header,
  100772. HTTPStatusCode: res.StatusCode,
  100773. },
  100774. }
  100775. target := &ret
  100776. if err := gensupport.DecodeResponse(target, res); err != nil {
  100777. return nil, err
  100778. }
  100779. return ret, nil
  100780. // {
  100781. // "description": "Creates a commitment in the specified project using the data included in the request.",
  100782. // "httpMethod": "POST",
  100783. // "id": "compute.regionCommitments.insert",
  100784. // "parameterOrder": [
  100785. // "project",
  100786. // "region"
  100787. // ],
  100788. // "parameters": {
  100789. // "project": {
  100790. // "description": "Project ID for this request.",
  100791. // "location": "path",
  100792. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100793. // "required": true,
  100794. // "type": "string"
  100795. // },
  100796. // "region": {
  100797. // "description": "Name of the region for this request.",
  100798. // "location": "path",
  100799. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100800. // "required": true,
  100801. // "type": "string"
  100802. // },
  100803. // "requestId": {
  100804. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100805. // "location": "query",
  100806. // "type": "string"
  100807. // }
  100808. // },
  100809. // "path": "{project}/regions/{region}/commitments",
  100810. // "request": {
  100811. // "$ref": "Commitment"
  100812. // },
  100813. // "response": {
  100814. // "$ref": "Operation"
  100815. // },
  100816. // "scopes": [
  100817. // "https://www.googleapis.com/auth/cloud-platform",
  100818. // "https://www.googleapis.com/auth/compute"
  100819. // ]
  100820. // }
  100821. }
  100822. // method id "compute.regionCommitments.list":
  100823. type RegionCommitmentsListCall struct {
  100824. s *Service
  100825. project string
  100826. region string
  100827. urlParams_ gensupport.URLParams
  100828. ifNoneMatch_ string
  100829. ctx_ context.Context
  100830. header_ http.Header
  100831. }
  100832. // List: Retrieves a list of commitments contained within the specified
  100833. // region.
  100834. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  100835. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100836. c.project = project
  100837. c.region = region
  100838. return c
  100839. }
  100840. // Filter sets the optional parameter "filter": A filter expression that
  100841. // filters resources listed in the response. The expression must specify
  100842. // the field name, a comparison operator, and the value that you want to
  100843. // use for filtering. The value must be a string, a number, or a
  100844. // boolean. The comparison operator must be either =, !=, >, or <.
  100845. //
  100846. // For example, if you are filtering Compute Engine instances, you can
  100847. // exclude instances named example-instance by specifying name !=
  100848. // example-instance.
  100849. //
  100850. // You can also filter nested fields. For example, you could specify
  100851. // scheduling.automaticRestart = false to include instances only if they
  100852. // are not scheduled for automatic restarts. You can use filtering on
  100853. // nested fields to filter based on resource labels.
  100854. //
  100855. // To filter on multiple expressions, provide each separate expression
  100856. // within parentheses. For example, (scheduling.automaticRestart = true)
  100857. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100858. // AND expression. However, you can include AND and OR expressions
  100859. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100860. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100861. // true).
  100862. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  100863. c.urlParams_.Set("filter", filter)
  100864. return c
  100865. }
  100866. // MaxResults sets the optional parameter "maxResults": The maximum
  100867. // number of results per page that should be returned. If the number of
  100868. // available results is larger than maxResults, Compute Engine returns a
  100869. // nextPageToken that can be used to get the next page of results in
  100870. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100871. // (Default: 500)
  100872. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  100873. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100874. return c
  100875. }
  100876. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100877. // a certain order. By default, results are returned in alphanumerical
  100878. // order based on the resource name.
  100879. //
  100880. // You can also sort results in descending order based on the creation
  100881. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100882. // based on the creationTimestamp field in reverse chronological order
  100883. // (newest result first). Use this to sort resources like operations so
  100884. // that the newest operation is returned first.
  100885. //
  100886. // Currently, only sorting by name or creationTimestamp desc is
  100887. // supported.
  100888. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  100889. c.urlParams_.Set("orderBy", orderBy)
  100890. return c
  100891. }
  100892. // PageToken sets the optional parameter "pageToken": Specifies a page
  100893. // token to use. Set pageToken to the nextPageToken returned by a
  100894. // previous list request to get the next page of results.
  100895. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  100896. c.urlParams_.Set("pageToken", pageToken)
  100897. return c
  100898. }
  100899. // Fields allows partial responses to be retrieved. See
  100900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100901. // for more information.
  100902. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  100903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100904. return c
  100905. }
  100906. // IfNoneMatch sets the optional parameter which makes the operation
  100907. // fail if the object's ETag matches the given value. This is useful for
  100908. // getting updates only after the object has changed since the last
  100909. // request. Use googleapi.IsNotModified to check whether the response
  100910. // error from Do is the result of In-None-Match.
  100911. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  100912. c.ifNoneMatch_ = entityTag
  100913. return c
  100914. }
  100915. // Context sets the context to be used in this call's Do method. Any
  100916. // pending HTTP request will be aborted if the provided context is
  100917. // canceled.
  100918. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  100919. c.ctx_ = ctx
  100920. return c
  100921. }
  100922. // Header returns an http.Header that can be modified by the caller to
  100923. // add HTTP headers to the request.
  100924. func (c *RegionCommitmentsListCall) Header() http.Header {
  100925. if c.header_ == nil {
  100926. c.header_ = make(http.Header)
  100927. }
  100928. return c.header_
  100929. }
  100930. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  100931. reqHeaders := make(http.Header)
  100932. for k, v := range c.header_ {
  100933. reqHeaders[k] = v
  100934. }
  100935. reqHeaders.Set("User-Agent", c.s.userAgent())
  100936. if c.ifNoneMatch_ != "" {
  100937. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100938. }
  100939. var body io.Reader = nil
  100940. c.urlParams_.Set("alt", alt)
  100941. c.urlParams_.Set("prettyPrint", "false")
  100942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  100943. urls += "?" + c.urlParams_.Encode()
  100944. req, err := http.NewRequest("GET", urls, body)
  100945. if err != nil {
  100946. return nil, err
  100947. }
  100948. req.Header = reqHeaders
  100949. googleapi.Expand(req.URL, map[string]string{
  100950. "project": c.project,
  100951. "region": c.region,
  100952. })
  100953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100954. }
  100955. // Do executes the "compute.regionCommitments.list" call.
  100956. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  100957. // status code is an error. Response headers are in either
  100958. // *CommitmentList.ServerResponse.Header or (if a response was returned
  100959. // at all) in error.(*googleapi.Error).Header. Use
  100960. // googleapi.IsNotModified to check whether the returned error was
  100961. // because http.StatusNotModified was returned.
  100962. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  100963. gensupport.SetOptions(c.urlParams_, opts...)
  100964. res, err := c.doRequest("json")
  100965. if res != nil && res.StatusCode == http.StatusNotModified {
  100966. if res.Body != nil {
  100967. res.Body.Close()
  100968. }
  100969. return nil, &googleapi.Error{
  100970. Code: res.StatusCode,
  100971. Header: res.Header,
  100972. }
  100973. }
  100974. if err != nil {
  100975. return nil, err
  100976. }
  100977. defer googleapi.CloseBody(res)
  100978. if err := googleapi.CheckResponse(res); err != nil {
  100979. return nil, err
  100980. }
  100981. ret := &CommitmentList{
  100982. ServerResponse: googleapi.ServerResponse{
  100983. Header: res.Header,
  100984. HTTPStatusCode: res.StatusCode,
  100985. },
  100986. }
  100987. target := &ret
  100988. if err := gensupport.DecodeResponse(target, res); err != nil {
  100989. return nil, err
  100990. }
  100991. return ret, nil
  100992. // {
  100993. // "description": "Retrieves a list of commitments contained within the specified region.",
  100994. // "httpMethod": "GET",
  100995. // "id": "compute.regionCommitments.list",
  100996. // "parameterOrder": [
  100997. // "project",
  100998. // "region"
  100999. // ],
  101000. // "parameters": {
  101001. // "filter": {
  101002. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  101003. // "location": "query",
  101004. // "type": "string"
  101005. // },
  101006. // "maxResults": {
  101007. // "default": "500",
  101008. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  101009. // "format": "uint32",
  101010. // "location": "query",
  101011. // "minimum": "0",
  101012. // "type": "integer"
  101013. // },
  101014. // "orderBy": {
  101015. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  101016. // "location": "query",
  101017. // "type": "string"
  101018. // },
  101019. // "pageToken": {
  101020. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  101021. // "location": "query",
  101022. // "type": "string"
  101023. // },
  101024. // "project": {
  101025. // "description": "Project ID for this request.",
  101026. // "location": "path",
  101027. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101028. // "required": true,
  101029. // "type": "string"
  101030. // },
  101031. // "region": {
  101032. // "description": "Name of the region for this request.",
  101033. // "location": "path",
  101034. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101035. // "required": true,
  101036. // "type": "string"
  101037. // }
  101038. // },
  101039. // "path": "{project}/regions/{region}/commitments",
  101040. // "response": {
  101041. // "$ref": "CommitmentList"
  101042. // },
  101043. // "scopes": [
  101044. // "https://www.googleapis.com/auth/cloud-platform",
  101045. // "https://www.googleapis.com/auth/compute",
  101046. // "https://www.googleapis.com/auth/compute.readonly"
  101047. // ]
  101048. // }
  101049. }
  101050. // Pages invokes f for each page of results.
  101051. // A non-nil error returned from f will halt the iteration.
  101052. // The provided context supersedes any context provided to the Context method.
  101053. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  101054. c.ctx_ = ctx
  101055. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  101056. for {
  101057. x, err := c.Do()
  101058. if err != nil {
  101059. return err
  101060. }
  101061. if err := f(x); err != nil {
  101062. return err
  101063. }
  101064. if x.NextPageToken == "" {
  101065. return nil
  101066. }
  101067. c.PageToken(x.NextPageToken)
  101068. }
  101069. }
  101070. // method id "compute.regionCommitments.testIamPermissions":
  101071. type RegionCommitmentsTestIamPermissionsCall struct {
  101072. s *Service
  101073. project string
  101074. region string
  101075. resource string
  101076. testpermissionsrequest *TestPermissionsRequest
  101077. urlParams_ gensupport.URLParams
  101078. ctx_ context.Context
  101079. header_ http.Header
  101080. }
  101081. // TestIamPermissions: Returns permissions that a caller has on the
  101082. // specified resource.
  101083. func (r *RegionCommitmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionCommitmentsTestIamPermissionsCall {
  101084. c := &RegionCommitmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101085. c.project = project
  101086. c.region = region
  101087. c.resource = resource
  101088. c.testpermissionsrequest = testpermissionsrequest
  101089. return c
  101090. }
  101091. // Fields allows partial responses to be retrieved. See
  101092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101093. // for more information.
  101094. func (c *RegionCommitmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionCommitmentsTestIamPermissionsCall {
  101095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101096. return c
  101097. }
  101098. // Context sets the context to be used in this call's Do method. Any
  101099. // pending HTTP request will be aborted if the provided context is
  101100. // canceled.
  101101. func (c *RegionCommitmentsTestIamPermissionsCall) Context(ctx context.Context) *RegionCommitmentsTestIamPermissionsCall {
  101102. c.ctx_ = ctx
  101103. return c
  101104. }
  101105. // Header returns an http.Header that can be modified by the caller to
  101106. // add HTTP headers to the request.
  101107. func (c *RegionCommitmentsTestIamPermissionsCall) Header() http.Header {
  101108. if c.header_ == nil {
  101109. c.header_ = make(http.Header)
  101110. }
  101111. return c.header_
  101112. }
  101113. func (c *RegionCommitmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  101114. reqHeaders := make(http.Header)
  101115. for k, v := range c.header_ {
  101116. reqHeaders[k] = v
  101117. }
  101118. reqHeaders.Set("User-Agent", c.s.userAgent())
  101119. var body io.Reader = nil
  101120. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  101121. if err != nil {
  101122. return nil, err
  101123. }
  101124. reqHeaders.Set("Content-Type", "application/json")
  101125. c.urlParams_.Set("alt", alt)
  101126. c.urlParams_.Set("prettyPrint", "false")
  101127. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{resource}/testIamPermissions")
  101128. urls += "?" + c.urlParams_.Encode()
  101129. req, err := http.NewRequest("POST", urls, body)
  101130. if err != nil {
  101131. return nil, err
  101132. }
  101133. req.Header = reqHeaders
  101134. googleapi.Expand(req.URL, map[string]string{
  101135. "project": c.project,
  101136. "region": c.region,
  101137. "resource": c.resource,
  101138. })
  101139. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101140. }
  101141. // Do executes the "compute.regionCommitments.testIamPermissions" call.
  101142. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  101143. // non-2xx status code is an error. Response headers are in either
  101144. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  101145. // returned at all) in error.(*googleapi.Error).Header. Use
  101146. // googleapi.IsNotModified to check whether the returned error was
  101147. // because http.StatusNotModified was returned.
  101148. func (c *RegionCommitmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  101149. gensupport.SetOptions(c.urlParams_, opts...)
  101150. res, err := c.doRequest("json")
  101151. if res != nil && res.StatusCode == http.StatusNotModified {
  101152. if res.Body != nil {
  101153. res.Body.Close()
  101154. }
  101155. return nil, &googleapi.Error{
  101156. Code: res.StatusCode,
  101157. Header: res.Header,
  101158. }
  101159. }
  101160. if err != nil {
  101161. return nil, err
  101162. }
  101163. defer googleapi.CloseBody(res)
  101164. if err := googleapi.CheckResponse(res); err != nil {
  101165. return nil, err
  101166. }
  101167. ret := &TestPermissionsResponse{
  101168. ServerResponse: googleapi.ServerResponse{
  101169. Header: res.Header,
  101170. HTTPStatusCode: res.StatusCode,
  101171. },
  101172. }
  101173. target := &ret
  101174. if err := gensupport.DecodeResponse(target, res); err != nil {
  101175. return nil, err
  101176. }
  101177. return ret, nil
  101178. // {
  101179. // "description": "Returns permissions that a caller has on the specified resource.",
  101180. // "httpMethod": "POST",
  101181. // "id": "compute.regionCommitments.testIamPermissions",
  101182. // "parameterOrder": [
  101183. // "project",
  101184. // "region",
  101185. // "resource"
  101186. // ],
  101187. // "parameters": {
  101188. // "project": {
  101189. // "description": "Project ID for this request.",
  101190. // "location": "path",
  101191. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101192. // "required": true,
  101193. // "type": "string"
  101194. // },
  101195. // "region": {
  101196. // "description": "The name of the region for this request.",
  101197. // "location": "path",
  101198. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101199. // "required": true,
  101200. // "type": "string"
  101201. // },
  101202. // "resource": {
  101203. // "description": "Name or id of the resource for this request.",
  101204. // "location": "path",
  101205. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101206. // "required": true,
  101207. // "type": "string"
  101208. // }
  101209. // },
  101210. // "path": "{project}/regions/{region}/commitments/{resource}/testIamPermissions",
  101211. // "request": {
  101212. // "$ref": "TestPermissionsRequest"
  101213. // },
  101214. // "response": {
  101215. // "$ref": "TestPermissionsResponse"
  101216. // },
  101217. // "scopes": [
  101218. // "https://www.googleapis.com/auth/cloud-platform",
  101219. // "https://www.googleapis.com/auth/compute",
  101220. // "https://www.googleapis.com/auth/compute.readonly"
  101221. // ]
  101222. // }
  101223. }
  101224. // method id "compute.regionCommitments.updateAllocations":
  101225. type RegionCommitmentsUpdateAllocationsCall struct {
  101226. s *Service
  101227. project string
  101228. region string
  101229. commitment string
  101230. regioncommitmentsupdateallocationsrequest *RegionCommitmentsUpdateAllocationsRequest
  101231. urlParams_ gensupport.URLParams
  101232. ctx_ context.Context
  101233. header_ http.Header
  101234. }
  101235. // UpdateAllocations: Update the shape of allocations for GPUS/Local
  101236. // SSDs of allocations within the commitments.
  101237. func (r *RegionCommitmentsService) UpdateAllocations(project string, region string, commitment string, regioncommitmentsupdateallocationsrequest *RegionCommitmentsUpdateAllocationsRequest) *RegionCommitmentsUpdateAllocationsCall {
  101238. c := &RegionCommitmentsUpdateAllocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101239. c.project = project
  101240. c.region = region
  101241. c.commitment = commitment
  101242. c.regioncommitmentsupdateallocationsrequest = regioncommitmentsupdateallocationsrequest
  101243. return c
  101244. }
  101245. // RequestId sets the optional parameter "requestId": An optional
  101246. // request ID to identify requests. Specify a unique request ID so that
  101247. // if you must retry your request, the server will know to ignore the
  101248. // request if it has already been completed.
  101249. //
  101250. // For example, consider a situation where you make an initial request
  101251. // and the request times out. If you make the request again with the
  101252. // same request ID, the server can check if original operation with the
  101253. // same request ID was received, and if so, will ignore the second
  101254. // request. This prevents clients from accidentally creating duplicate
  101255. // commitments.
  101256. //
  101257. // The request ID must be a valid UUID with the exception that zero UUID
  101258. // is not supported (00000000-0000-0000-0000-000000000000).
  101259. func (c *RegionCommitmentsUpdateAllocationsCall) RequestId(requestId string) *RegionCommitmentsUpdateAllocationsCall {
  101260. c.urlParams_.Set("requestId", requestId)
  101261. return c
  101262. }
  101263. // Fields allows partial responses to be retrieved. See
  101264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101265. // for more information.
  101266. func (c *RegionCommitmentsUpdateAllocationsCall) Fields(s ...googleapi.Field) *RegionCommitmentsUpdateAllocationsCall {
  101267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101268. return c
  101269. }
  101270. // Context sets the context to be used in this call's Do method. Any
  101271. // pending HTTP request will be aborted if the provided context is
  101272. // canceled.
  101273. func (c *RegionCommitmentsUpdateAllocationsCall) Context(ctx context.Context) *RegionCommitmentsUpdateAllocationsCall {
  101274. c.ctx_ = ctx
  101275. return c
  101276. }
  101277. // Header returns an http.Header that can be modified by the caller to
  101278. // add HTTP headers to the request.
  101279. func (c *RegionCommitmentsUpdateAllocationsCall) Header() http.Header {
  101280. if c.header_ == nil {
  101281. c.header_ = make(http.Header)
  101282. }
  101283. return c.header_
  101284. }
  101285. func (c *RegionCommitmentsUpdateAllocationsCall) doRequest(alt string) (*http.Response, error) {
  101286. reqHeaders := make(http.Header)
  101287. for k, v := range c.header_ {
  101288. reqHeaders[k] = v
  101289. }
  101290. reqHeaders.Set("User-Agent", c.s.userAgent())
  101291. var body io.Reader = nil
  101292. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioncommitmentsupdateallocationsrequest)
  101293. if err != nil {
  101294. return nil, err
  101295. }
  101296. reqHeaders.Set("Content-Type", "application/json")
  101297. c.urlParams_.Set("alt", alt)
  101298. c.urlParams_.Set("prettyPrint", "false")
  101299. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}/updateAllocations")
  101300. urls += "?" + c.urlParams_.Encode()
  101301. req, err := http.NewRequest("POST", urls, body)
  101302. if err != nil {
  101303. return nil, err
  101304. }
  101305. req.Header = reqHeaders
  101306. googleapi.Expand(req.URL, map[string]string{
  101307. "project": c.project,
  101308. "region": c.region,
  101309. "commitment": c.commitment,
  101310. })
  101311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101312. }
  101313. // Do executes the "compute.regionCommitments.updateAllocations" call.
  101314. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101315. // status code is an error. Response headers are in either
  101316. // *Operation.ServerResponse.Header or (if a response was returned at
  101317. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101318. // to check whether the returned error was because
  101319. // http.StatusNotModified was returned.
  101320. func (c *RegionCommitmentsUpdateAllocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101321. gensupport.SetOptions(c.urlParams_, opts...)
  101322. res, err := c.doRequest("json")
  101323. if res != nil && res.StatusCode == http.StatusNotModified {
  101324. if res.Body != nil {
  101325. res.Body.Close()
  101326. }
  101327. return nil, &googleapi.Error{
  101328. Code: res.StatusCode,
  101329. Header: res.Header,
  101330. }
  101331. }
  101332. if err != nil {
  101333. return nil, err
  101334. }
  101335. defer googleapi.CloseBody(res)
  101336. if err := googleapi.CheckResponse(res); err != nil {
  101337. return nil, err
  101338. }
  101339. ret := &Operation{
  101340. ServerResponse: googleapi.ServerResponse{
  101341. Header: res.Header,
  101342. HTTPStatusCode: res.StatusCode,
  101343. },
  101344. }
  101345. target := &ret
  101346. if err := gensupport.DecodeResponse(target, res); err != nil {
  101347. return nil, err
  101348. }
  101349. return ret, nil
  101350. // {
  101351. // "description": "Update the shape of allocations for GPUS/Local SSDs of allocations within the commitments.",
  101352. // "httpMethod": "POST",
  101353. // "id": "compute.regionCommitments.updateAllocations",
  101354. // "parameterOrder": [
  101355. // "project",
  101356. // "region",
  101357. // "commitment"
  101358. // ],
  101359. // "parameters": {
  101360. // "commitment": {
  101361. // "description": "Name of the commitment of which the allocation's capacities are being updated.",
  101362. // "location": "path",
  101363. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101364. // "required": true,
  101365. // "type": "string"
  101366. // },
  101367. // "project": {
  101368. // "description": "Project ID for this request.",
  101369. // "location": "path",
  101370. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101371. // "required": true,
  101372. // "type": "string"
  101373. // },
  101374. // "region": {
  101375. // "description": "Name of the region for this request.",
  101376. // "location": "path",
  101377. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101378. // "required": true,
  101379. // "type": "string"
  101380. // },
  101381. // "requestId": {
  101382. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101383. // "location": "query",
  101384. // "type": "string"
  101385. // }
  101386. // },
  101387. // "path": "{project}/regions/{region}/commitments/{commitment}/updateAllocations",
  101388. // "request": {
  101389. // "$ref": "RegionCommitmentsUpdateAllocationsRequest"
  101390. // },
  101391. // "response": {
  101392. // "$ref": "Operation"
  101393. // },
  101394. // "scopes": [
  101395. // "https://www.googleapis.com/auth/cloud-platform",
  101396. // "https://www.googleapis.com/auth/compute"
  101397. // ]
  101398. // }
  101399. }
  101400. // method id "compute.regionDiskTypes.get":
  101401. type RegionDiskTypesGetCall struct {
  101402. s *Service
  101403. project string
  101404. region string
  101405. diskType string
  101406. urlParams_ gensupport.URLParams
  101407. ifNoneMatch_ string
  101408. ctx_ context.Context
  101409. header_ http.Header
  101410. }
  101411. // Get: Returns the specified regional disk type. Gets a list of
  101412. // available disk types by making a list() request.
  101413. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  101414. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101415. c.project = project
  101416. c.region = region
  101417. c.diskType = diskType
  101418. return c
  101419. }
  101420. // Fields allows partial responses to be retrieved. See
  101421. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101422. // for more information.
  101423. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  101424. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101425. return c
  101426. }
  101427. // IfNoneMatch sets the optional parameter which makes the operation
  101428. // fail if the object's ETag matches the given value. This is useful for
  101429. // getting updates only after the object has changed since the last
  101430. // request. Use googleapi.IsNotModified to check whether the response
  101431. // error from Do is the result of In-None-Match.
  101432. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  101433. c.ifNoneMatch_ = entityTag
  101434. return c
  101435. }
  101436. // Context sets the context to be used in this call's Do method. Any
  101437. // pending HTTP request will be aborted if the provided context is
  101438. // canceled.
  101439. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  101440. c.ctx_ = ctx
  101441. return c
  101442. }
  101443. // Header returns an http.Header that can be modified by the caller to
  101444. // add HTTP headers to the request.
  101445. func (c *RegionDiskTypesGetCall) Header() http.Header {
  101446. if c.header_ == nil {
  101447. c.header_ = make(http.Header)
  101448. }
  101449. return c.header_
  101450. }
  101451. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  101452. reqHeaders := make(http.Header)
  101453. for k, v := range c.header_ {
  101454. reqHeaders[k] = v
  101455. }
  101456. reqHeaders.Set("User-Agent", c.s.userAgent())
  101457. if c.ifNoneMatch_ != "" {
  101458. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101459. }
  101460. var body io.Reader = nil
  101461. c.urlParams_.Set("alt", alt)
  101462. c.urlParams_.Set("prettyPrint", "false")
  101463. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  101464. urls += "?" + c.urlParams_.Encode()
  101465. req, err := http.NewRequest("GET", urls, body)
  101466. if err != nil {
  101467. return nil, err
  101468. }
  101469. req.Header = reqHeaders
  101470. googleapi.Expand(req.URL, map[string]string{
  101471. "project": c.project,
  101472. "region": c.region,
  101473. "diskType": c.diskType,
  101474. })
  101475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101476. }
  101477. // Do executes the "compute.regionDiskTypes.get" call.
  101478. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  101479. // code is an error. Response headers are in either
  101480. // *DiskType.ServerResponse.Header or (if a response was returned at
  101481. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101482. // to check whether the returned error was because
  101483. // http.StatusNotModified was returned.
  101484. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  101485. gensupport.SetOptions(c.urlParams_, opts...)
  101486. res, err := c.doRequest("json")
  101487. if res != nil && res.StatusCode == http.StatusNotModified {
  101488. if res.Body != nil {
  101489. res.Body.Close()
  101490. }
  101491. return nil, &googleapi.Error{
  101492. Code: res.StatusCode,
  101493. Header: res.Header,
  101494. }
  101495. }
  101496. if err != nil {
  101497. return nil, err
  101498. }
  101499. defer googleapi.CloseBody(res)
  101500. if err := googleapi.CheckResponse(res); err != nil {
  101501. return nil, err
  101502. }
  101503. ret := &DiskType{
  101504. ServerResponse: googleapi.ServerResponse{
  101505. Header: res.Header,
  101506. HTTPStatusCode: res.StatusCode,
  101507. },
  101508. }
  101509. target := &ret
  101510. if err := gensupport.DecodeResponse(target, res); err != nil {
  101511. return nil, err
  101512. }
  101513. return ret, nil
  101514. // {
  101515. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  101516. // "httpMethod": "GET",
  101517. // "id": "compute.regionDiskTypes.get",
  101518. // "parameterOrder": [
  101519. // "project",
  101520. // "region",
  101521. // "diskType"
  101522. // ],
  101523. // "parameters": {
  101524. // "diskType": {
  101525. // "description": "Name of the disk type to return.",
  101526. // "location": "path",
  101527. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101528. // "required": true,
  101529. // "type": "string"
  101530. // },
  101531. // "project": {
  101532. // "description": "Project ID for this request.",
  101533. // "location": "path",
  101534. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101535. // "required": true,
  101536. // "type": "string"
  101537. // },
  101538. // "region": {
  101539. // "description": "The name of the region for this request.",
  101540. // "location": "path",
  101541. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101542. // "required": true,
  101543. // "type": "string"
  101544. // }
  101545. // },
  101546. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  101547. // "response": {
  101548. // "$ref": "DiskType"
  101549. // },
  101550. // "scopes": [
  101551. // "https://www.googleapis.com/auth/cloud-platform",
  101552. // "https://www.googleapis.com/auth/compute",
  101553. // "https://www.googleapis.com/auth/compute.readonly"
  101554. // ]
  101555. // }
  101556. }
  101557. // method id "compute.regionDiskTypes.list":
  101558. type RegionDiskTypesListCall struct {
  101559. s *Service
  101560. project string
  101561. region string
  101562. urlParams_ gensupport.URLParams
  101563. ifNoneMatch_ string
  101564. ctx_ context.Context
  101565. header_ http.Header
  101566. }
  101567. // List: Retrieves a list of regional disk types available to the
  101568. // specified project.
  101569. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  101570. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101571. c.project = project
  101572. c.region = region
  101573. return c
  101574. }
  101575. // Filter sets the optional parameter "filter": A filter expression that
  101576. // filters resources listed in the response. The expression must specify
  101577. // the field name, a comparison operator, and the value that you want to
  101578. // use for filtering. The value must be a string, a number, or a
  101579. // boolean. The comparison operator must be either =, !=, >, or <.
  101580. //
  101581. // For example, if you are filtering Compute Engine instances, you can
  101582. // exclude instances named example-instance by specifying name !=
  101583. // example-instance.
  101584. //
  101585. // You can also filter nested fields. For example, you could specify
  101586. // scheduling.automaticRestart = false to include instances only if they
  101587. // are not scheduled for automatic restarts. You can use filtering on
  101588. // nested fields to filter based on resource labels.
  101589. //
  101590. // To filter on multiple expressions, provide each separate expression
  101591. // within parentheses. For example, (scheduling.automaticRestart = true)
  101592. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101593. // AND expression. However, you can include AND and OR expressions
  101594. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101595. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101596. // true).
  101597. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  101598. c.urlParams_.Set("filter", filter)
  101599. return c
  101600. }
  101601. // MaxResults sets the optional parameter "maxResults": The maximum
  101602. // number of results per page that should be returned. If the number of
  101603. // available results is larger than maxResults, Compute Engine returns a
  101604. // nextPageToken that can be used to get the next page of results in
  101605. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101606. // (Default: 500)
  101607. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  101608. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101609. return c
  101610. }
  101611. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101612. // a certain order. By default, results are returned in alphanumerical
  101613. // order based on the resource name.
  101614. //
  101615. // You can also sort results in descending order based on the creation
  101616. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101617. // based on the creationTimestamp field in reverse chronological order
  101618. // (newest result first). Use this to sort resources like operations so
  101619. // that the newest operation is returned first.
  101620. //
  101621. // Currently, only sorting by name or creationTimestamp desc is
  101622. // supported.
  101623. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  101624. c.urlParams_.Set("orderBy", orderBy)
  101625. return c
  101626. }
  101627. // PageToken sets the optional parameter "pageToken": Specifies a page
  101628. // token to use. Set pageToken to the nextPageToken returned by a
  101629. // previous list request to get the next page of results.
  101630. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  101631. c.urlParams_.Set("pageToken", pageToken)
  101632. return c
  101633. }
  101634. // Fields allows partial responses to be retrieved. See
  101635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101636. // for more information.
  101637. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  101638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101639. return c
  101640. }
  101641. // IfNoneMatch sets the optional parameter which makes the operation
  101642. // fail if the object's ETag matches the given value. This is useful for
  101643. // getting updates only after the object has changed since the last
  101644. // request. Use googleapi.IsNotModified to check whether the response
  101645. // error from Do is the result of In-None-Match.
  101646. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  101647. c.ifNoneMatch_ = entityTag
  101648. return c
  101649. }
  101650. // Context sets the context to be used in this call's Do method. Any
  101651. // pending HTTP request will be aborted if the provided context is
  101652. // canceled.
  101653. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  101654. c.ctx_ = ctx
  101655. return c
  101656. }
  101657. // Header returns an http.Header that can be modified by the caller to
  101658. // add HTTP headers to the request.
  101659. func (c *RegionDiskTypesListCall) Header() http.Header {
  101660. if c.header_ == nil {
  101661. c.header_ = make(http.Header)
  101662. }
  101663. return c.header_
  101664. }
  101665. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  101666. reqHeaders := make(http.Header)
  101667. for k, v := range c.header_ {
  101668. reqHeaders[k] = v
  101669. }
  101670. reqHeaders.Set("User-Agent", c.s.userAgent())
  101671. if c.ifNoneMatch_ != "" {
  101672. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101673. }
  101674. var body io.Reader = nil
  101675. c.urlParams_.Set("alt", alt)
  101676. c.urlParams_.Set("prettyPrint", "false")
  101677. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  101678. urls += "?" + c.urlParams_.Encode()
  101679. req, err := http.NewRequest("GET", urls, body)
  101680. if err != nil {
  101681. return nil, err
  101682. }
  101683. req.Header = reqHeaders
  101684. googleapi.Expand(req.URL, map[string]string{
  101685. "project": c.project,
  101686. "region": c.region,
  101687. })
  101688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101689. }
  101690. // Do executes the "compute.regionDiskTypes.list" call.
  101691. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  101692. // non-2xx status code is an error. Response headers are in either
  101693. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  101694. // returned at all) in error.(*googleapi.Error).Header. Use
  101695. // googleapi.IsNotModified to check whether the returned error was
  101696. // because http.StatusNotModified was returned.
  101697. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  101698. gensupport.SetOptions(c.urlParams_, opts...)
  101699. res, err := c.doRequest("json")
  101700. if res != nil && res.StatusCode == http.StatusNotModified {
  101701. if res.Body != nil {
  101702. res.Body.Close()
  101703. }
  101704. return nil, &googleapi.Error{
  101705. Code: res.StatusCode,
  101706. Header: res.Header,
  101707. }
  101708. }
  101709. if err != nil {
  101710. return nil, err
  101711. }
  101712. defer googleapi.CloseBody(res)
  101713. if err := googleapi.CheckResponse(res); err != nil {
  101714. return nil, err
  101715. }
  101716. ret := &RegionDiskTypeList{
  101717. ServerResponse: googleapi.ServerResponse{
  101718. Header: res.Header,
  101719. HTTPStatusCode: res.StatusCode,
  101720. },
  101721. }
  101722. target := &ret
  101723. if err := gensupport.DecodeResponse(target, res); err != nil {
  101724. return nil, err
  101725. }
  101726. return ret, nil
  101727. // {
  101728. // "description": "Retrieves a list of regional disk types available to the specified project.",
  101729. // "httpMethod": "GET",
  101730. // "id": "compute.regionDiskTypes.list",
  101731. // "parameterOrder": [
  101732. // "project",
  101733. // "region"
  101734. // ],
  101735. // "parameters": {
  101736. // "filter": {
  101737. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  101738. // "location": "query",
  101739. // "type": "string"
  101740. // },
  101741. // "maxResults": {
  101742. // "default": "500",
  101743. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  101744. // "format": "uint32",
  101745. // "location": "query",
  101746. // "minimum": "0",
  101747. // "type": "integer"
  101748. // },
  101749. // "orderBy": {
  101750. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  101751. // "location": "query",
  101752. // "type": "string"
  101753. // },
  101754. // "pageToken": {
  101755. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  101756. // "location": "query",
  101757. // "type": "string"
  101758. // },
  101759. // "project": {
  101760. // "description": "Project ID for this request.",
  101761. // "location": "path",
  101762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101763. // "required": true,
  101764. // "type": "string"
  101765. // },
  101766. // "region": {
  101767. // "description": "The name of the region for this request.",
  101768. // "location": "path",
  101769. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101770. // "required": true,
  101771. // "type": "string"
  101772. // }
  101773. // },
  101774. // "path": "{project}/regions/{region}/diskTypes",
  101775. // "response": {
  101776. // "$ref": "RegionDiskTypeList"
  101777. // },
  101778. // "scopes": [
  101779. // "https://www.googleapis.com/auth/cloud-platform",
  101780. // "https://www.googleapis.com/auth/compute",
  101781. // "https://www.googleapis.com/auth/compute.readonly"
  101782. // ]
  101783. // }
  101784. }
  101785. // Pages invokes f for each page of results.
  101786. // A non-nil error returned from f will halt the iteration.
  101787. // The provided context supersedes any context provided to the Context method.
  101788. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  101789. c.ctx_ = ctx
  101790. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  101791. for {
  101792. x, err := c.Do()
  101793. if err != nil {
  101794. return err
  101795. }
  101796. if err := f(x); err != nil {
  101797. return err
  101798. }
  101799. if x.NextPageToken == "" {
  101800. return nil
  101801. }
  101802. c.PageToken(x.NextPageToken)
  101803. }
  101804. }
  101805. // method id "compute.regionDisks.addResourcePolicies":
  101806. type RegionDisksAddResourcePoliciesCall struct {
  101807. s *Service
  101808. project string
  101809. region string
  101810. disk string
  101811. regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest
  101812. urlParams_ gensupport.URLParams
  101813. ctx_ context.Context
  101814. header_ http.Header
  101815. }
  101816. // AddResourcePolicies: Adds existing resource policies to a regional
  101817. // disk. You can only add one policy which will be applied to this disk
  101818. // for scheduling snapshot creation.
  101819. func (r *RegionDisksService) AddResourcePolicies(project string, region string, disk string, regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest) *RegionDisksAddResourcePoliciesCall {
  101820. c := &RegionDisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101821. c.project = project
  101822. c.region = region
  101823. c.disk = disk
  101824. c.regiondisksaddresourcepoliciesrequest = regiondisksaddresourcepoliciesrequest
  101825. return c
  101826. }
  101827. // RequestId sets the optional parameter "requestId": An optional
  101828. // request ID to identify requests. Specify a unique request ID so that
  101829. // if you must retry your request, the server will know to ignore the
  101830. // request if it has already been completed.
  101831. //
  101832. // For example, consider a situation where you make an initial request
  101833. // and the request times out. If you make the request again with the
  101834. // same request ID, the server can check if original operation with the
  101835. // same request ID was received, and if so, will ignore the second
  101836. // request. This prevents clients from accidentally creating duplicate
  101837. // commitments.
  101838. //
  101839. // The request ID must be a valid UUID with the exception that zero UUID
  101840. // is not supported (00000000-0000-0000-0000-000000000000).
  101841. func (c *RegionDisksAddResourcePoliciesCall) RequestId(requestId string) *RegionDisksAddResourcePoliciesCall {
  101842. c.urlParams_.Set("requestId", requestId)
  101843. return c
  101844. }
  101845. // Fields allows partial responses to be retrieved. See
  101846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101847. // for more information.
  101848. func (c *RegionDisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksAddResourcePoliciesCall {
  101849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101850. return c
  101851. }
  101852. // Context sets the context to be used in this call's Do method. Any
  101853. // pending HTTP request will be aborted if the provided context is
  101854. // canceled.
  101855. func (c *RegionDisksAddResourcePoliciesCall) Context(ctx context.Context) *RegionDisksAddResourcePoliciesCall {
  101856. c.ctx_ = ctx
  101857. return c
  101858. }
  101859. // Header returns an http.Header that can be modified by the caller to
  101860. // add HTTP headers to the request.
  101861. func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header {
  101862. if c.header_ == nil {
  101863. c.header_ = make(http.Header)
  101864. }
  101865. return c.header_
  101866. }
  101867. func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  101868. reqHeaders := make(http.Header)
  101869. for k, v := range c.header_ {
  101870. reqHeaders[k] = v
  101871. }
  101872. reqHeaders.Set("User-Agent", c.s.userAgent())
  101873. var body io.Reader = nil
  101874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest)
  101875. if err != nil {
  101876. return nil, err
  101877. }
  101878. reqHeaders.Set("Content-Type", "application/json")
  101879. c.urlParams_.Set("alt", alt)
  101880. c.urlParams_.Set("prettyPrint", "false")
  101881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/addResourcePolicies")
  101882. urls += "?" + c.urlParams_.Encode()
  101883. req, err := http.NewRequest("POST", urls, body)
  101884. if err != nil {
  101885. return nil, err
  101886. }
  101887. req.Header = reqHeaders
  101888. googleapi.Expand(req.URL, map[string]string{
  101889. "project": c.project,
  101890. "region": c.region,
  101891. "disk": c.disk,
  101892. })
  101893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101894. }
  101895. // Do executes the "compute.regionDisks.addResourcePolicies" call.
  101896. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101897. // status code is an error. Response headers are in either
  101898. // *Operation.ServerResponse.Header or (if a response was returned at
  101899. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101900. // to check whether the returned error was because
  101901. // http.StatusNotModified was returned.
  101902. func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101903. gensupport.SetOptions(c.urlParams_, opts...)
  101904. res, err := c.doRequest("json")
  101905. if res != nil && res.StatusCode == http.StatusNotModified {
  101906. if res.Body != nil {
  101907. res.Body.Close()
  101908. }
  101909. return nil, &googleapi.Error{
  101910. Code: res.StatusCode,
  101911. Header: res.Header,
  101912. }
  101913. }
  101914. if err != nil {
  101915. return nil, err
  101916. }
  101917. defer googleapi.CloseBody(res)
  101918. if err := googleapi.CheckResponse(res); err != nil {
  101919. return nil, err
  101920. }
  101921. ret := &Operation{
  101922. ServerResponse: googleapi.ServerResponse{
  101923. Header: res.Header,
  101924. HTTPStatusCode: res.StatusCode,
  101925. },
  101926. }
  101927. target := &ret
  101928. if err := gensupport.DecodeResponse(target, res); err != nil {
  101929. return nil, err
  101930. }
  101931. return ret, nil
  101932. // {
  101933. // "description": "Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.",
  101934. // "httpMethod": "POST",
  101935. // "id": "compute.regionDisks.addResourcePolicies",
  101936. // "parameterOrder": [
  101937. // "project",
  101938. // "region",
  101939. // "disk"
  101940. // ],
  101941. // "parameters": {
  101942. // "disk": {
  101943. // "description": "The disk name for this request.",
  101944. // "location": "path",
  101945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  101946. // "required": true,
  101947. // "type": "string"
  101948. // },
  101949. // "project": {
  101950. // "description": "Project ID for this request.",
  101951. // "location": "path",
  101952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101953. // "required": true,
  101954. // "type": "string"
  101955. // },
  101956. // "region": {
  101957. // "description": "The name of the region for this request.",
  101958. // "location": "path",
  101959. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101960. // "required": true,
  101961. // "type": "string"
  101962. // },
  101963. // "requestId": {
  101964. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101965. // "location": "query",
  101966. // "type": "string"
  101967. // }
  101968. // },
  101969. // "path": "{project}/regions/{region}/disks/{disk}/addResourcePolicies",
  101970. // "request": {
  101971. // "$ref": "RegionDisksAddResourcePoliciesRequest"
  101972. // },
  101973. // "response": {
  101974. // "$ref": "Operation"
  101975. // },
  101976. // "scopes": [
  101977. // "https://www.googleapis.com/auth/cloud-platform",
  101978. // "https://www.googleapis.com/auth/compute"
  101979. // ]
  101980. // }
  101981. }
  101982. // method id "compute.regionDisks.createSnapshot":
  101983. type RegionDisksCreateSnapshotCall struct {
  101984. s *Service
  101985. project string
  101986. region string
  101987. disk string
  101988. snapshot *Snapshot
  101989. urlParams_ gensupport.URLParams
  101990. ctx_ context.Context
  101991. header_ http.Header
  101992. }
  101993. // CreateSnapshot: Creates a snapshot of this regional disk.
  101994. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  101995. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101996. c.project = project
  101997. c.region = region
  101998. c.disk = disk
  101999. c.snapshot = snapshot
  102000. return c
  102001. }
  102002. // GuestFlush sets the optional parameter "guestFlush":
  102003. func (c *RegionDisksCreateSnapshotCall) GuestFlush(guestFlush bool) *RegionDisksCreateSnapshotCall {
  102004. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  102005. return c
  102006. }
  102007. // RequestId sets the optional parameter "requestId": An optional
  102008. // request ID to identify requests. Specify a unique request ID so that
  102009. // if you must retry your request, the server will know to ignore the
  102010. // request if it has already been completed.
  102011. //
  102012. // For example, consider a situation where you make an initial request
  102013. // and the request times out. If you make the request again with the
  102014. // same request ID, the server can check if original operation with the
  102015. // same request ID was received, and if so, will ignore the second
  102016. // request. This prevents clients from accidentally creating duplicate
  102017. // commitments.
  102018. //
  102019. // The request ID must be a valid UUID with the exception that zero UUID
  102020. // is not supported (00000000-0000-0000-0000-000000000000).
  102021. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  102022. c.urlParams_.Set("requestId", requestId)
  102023. return c
  102024. }
  102025. // Fields allows partial responses to be retrieved. See
  102026. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102027. // for more information.
  102028. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  102029. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102030. return c
  102031. }
  102032. // Context sets the context to be used in this call's Do method. Any
  102033. // pending HTTP request will be aborted if the provided context is
  102034. // canceled.
  102035. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  102036. c.ctx_ = ctx
  102037. return c
  102038. }
  102039. // Header returns an http.Header that can be modified by the caller to
  102040. // add HTTP headers to the request.
  102041. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  102042. if c.header_ == nil {
  102043. c.header_ = make(http.Header)
  102044. }
  102045. return c.header_
  102046. }
  102047. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  102048. reqHeaders := make(http.Header)
  102049. for k, v := range c.header_ {
  102050. reqHeaders[k] = v
  102051. }
  102052. reqHeaders.Set("User-Agent", c.s.userAgent())
  102053. var body io.Reader = nil
  102054. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  102055. if err != nil {
  102056. return nil, err
  102057. }
  102058. reqHeaders.Set("Content-Type", "application/json")
  102059. c.urlParams_.Set("alt", alt)
  102060. c.urlParams_.Set("prettyPrint", "false")
  102061. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  102062. urls += "?" + c.urlParams_.Encode()
  102063. req, err := http.NewRequest("POST", urls, body)
  102064. if err != nil {
  102065. return nil, err
  102066. }
  102067. req.Header = reqHeaders
  102068. googleapi.Expand(req.URL, map[string]string{
  102069. "project": c.project,
  102070. "region": c.region,
  102071. "disk": c.disk,
  102072. })
  102073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102074. }
  102075. // Do executes the "compute.regionDisks.createSnapshot" call.
  102076. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102077. // status code is an error. Response headers are in either
  102078. // *Operation.ServerResponse.Header or (if a response was returned at
  102079. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102080. // to check whether the returned error was because
  102081. // http.StatusNotModified was returned.
  102082. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102083. gensupport.SetOptions(c.urlParams_, opts...)
  102084. res, err := c.doRequest("json")
  102085. if res != nil && res.StatusCode == http.StatusNotModified {
  102086. if res.Body != nil {
  102087. res.Body.Close()
  102088. }
  102089. return nil, &googleapi.Error{
  102090. Code: res.StatusCode,
  102091. Header: res.Header,
  102092. }
  102093. }
  102094. if err != nil {
  102095. return nil, err
  102096. }
  102097. defer googleapi.CloseBody(res)
  102098. if err := googleapi.CheckResponse(res); err != nil {
  102099. return nil, err
  102100. }
  102101. ret := &Operation{
  102102. ServerResponse: googleapi.ServerResponse{
  102103. Header: res.Header,
  102104. HTTPStatusCode: res.StatusCode,
  102105. },
  102106. }
  102107. target := &ret
  102108. if err := gensupport.DecodeResponse(target, res); err != nil {
  102109. return nil, err
  102110. }
  102111. return ret, nil
  102112. // {
  102113. // "description": "Creates a snapshot of this regional disk.",
  102114. // "httpMethod": "POST",
  102115. // "id": "compute.regionDisks.createSnapshot",
  102116. // "parameterOrder": [
  102117. // "project",
  102118. // "region",
  102119. // "disk"
  102120. // ],
  102121. // "parameters": {
  102122. // "disk": {
  102123. // "description": "Name of the regional persistent disk to snapshot.",
  102124. // "location": "path",
  102125. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102126. // "required": true,
  102127. // "type": "string"
  102128. // },
  102129. // "guestFlush": {
  102130. // "location": "query",
  102131. // "type": "boolean"
  102132. // },
  102133. // "project": {
  102134. // "description": "Project ID for this request.",
  102135. // "location": "path",
  102136. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102137. // "required": true,
  102138. // "type": "string"
  102139. // },
  102140. // "region": {
  102141. // "description": "Name of the region for this request.",
  102142. // "location": "path",
  102143. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102144. // "required": true,
  102145. // "type": "string"
  102146. // },
  102147. // "requestId": {
  102148. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102149. // "location": "query",
  102150. // "type": "string"
  102151. // }
  102152. // },
  102153. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  102154. // "request": {
  102155. // "$ref": "Snapshot"
  102156. // },
  102157. // "response": {
  102158. // "$ref": "Operation"
  102159. // },
  102160. // "scopes": [
  102161. // "https://www.googleapis.com/auth/cloud-platform",
  102162. // "https://www.googleapis.com/auth/compute"
  102163. // ]
  102164. // }
  102165. }
  102166. // method id "compute.regionDisks.delete":
  102167. type RegionDisksDeleteCall struct {
  102168. s *Service
  102169. project string
  102170. region string
  102171. disk string
  102172. urlParams_ gensupport.URLParams
  102173. ctx_ context.Context
  102174. header_ http.Header
  102175. }
  102176. // Delete: Deletes the specified regional persistent disk. Deleting a
  102177. // regional disk removes all the replicas of its data permanently and is
  102178. // irreversible. However, deleting a disk does not delete any snapshots
  102179. // previously made from the disk. You must separately delete snapshots.
  102180. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  102181. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102182. c.project = project
  102183. c.region = region
  102184. c.disk = disk
  102185. return c
  102186. }
  102187. // RequestId sets the optional parameter "requestId": An optional
  102188. // request ID to identify requests. Specify a unique request ID so that
  102189. // if you must retry your request, the server will know to ignore the
  102190. // request if it has already been completed.
  102191. //
  102192. // For example, consider a situation where you make an initial request
  102193. // and the request times out. If you make the request again with the
  102194. // same request ID, the server can check if original operation with the
  102195. // same request ID was received, and if so, will ignore the second
  102196. // request. This prevents clients from accidentally creating duplicate
  102197. // commitments.
  102198. //
  102199. // The request ID must be a valid UUID with the exception that zero UUID
  102200. // is not supported (00000000-0000-0000-0000-000000000000).
  102201. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  102202. c.urlParams_.Set("requestId", requestId)
  102203. return c
  102204. }
  102205. // Fields allows partial responses to be retrieved. See
  102206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102207. // for more information.
  102208. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  102209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102210. return c
  102211. }
  102212. // Context sets the context to be used in this call's Do method. Any
  102213. // pending HTTP request will be aborted if the provided context is
  102214. // canceled.
  102215. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  102216. c.ctx_ = ctx
  102217. return c
  102218. }
  102219. // Header returns an http.Header that can be modified by the caller to
  102220. // add HTTP headers to the request.
  102221. func (c *RegionDisksDeleteCall) Header() http.Header {
  102222. if c.header_ == nil {
  102223. c.header_ = make(http.Header)
  102224. }
  102225. return c.header_
  102226. }
  102227. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  102228. reqHeaders := make(http.Header)
  102229. for k, v := range c.header_ {
  102230. reqHeaders[k] = v
  102231. }
  102232. reqHeaders.Set("User-Agent", c.s.userAgent())
  102233. var body io.Reader = nil
  102234. c.urlParams_.Set("alt", alt)
  102235. c.urlParams_.Set("prettyPrint", "false")
  102236. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  102237. urls += "?" + c.urlParams_.Encode()
  102238. req, err := http.NewRequest("DELETE", urls, body)
  102239. if err != nil {
  102240. return nil, err
  102241. }
  102242. req.Header = reqHeaders
  102243. googleapi.Expand(req.URL, map[string]string{
  102244. "project": c.project,
  102245. "region": c.region,
  102246. "disk": c.disk,
  102247. })
  102248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102249. }
  102250. // Do executes the "compute.regionDisks.delete" call.
  102251. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102252. // status code is an error. Response headers are in either
  102253. // *Operation.ServerResponse.Header or (if a response was returned at
  102254. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102255. // to check whether the returned error was because
  102256. // http.StatusNotModified was returned.
  102257. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102258. gensupport.SetOptions(c.urlParams_, opts...)
  102259. res, err := c.doRequest("json")
  102260. if res != nil && res.StatusCode == http.StatusNotModified {
  102261. if res.Body != nil {
  102262. res.Body.Close()
  102263. }
  102264. return nil, &googleapi.Error{
  102265. Code: res.StatusCode,
  102266. Header: res.Header,
  102267. }
  102268. }
  102269. if err != nil {
  102270. return nil, err
  102271. }
  102272. defer googleapi.CloseBody(res)
  102273. if err := googleapi.CheckResponse(res); err != nil {
  102274. return nil, err
  102275. }
  102276. ret := &Operation{
  102277. ServerResponse: googleapi.ServerResponse{
  102278. Header: res.Header,
  102279. HTTPStatusCode: res.StatusCode,
  102280. },
  102281. }
  102282. target := &ret
  102283. if err := gensupport.DecodeResponse(target, res); err != nil {
  102284. return nil, err
  102285. }
  102286. return ret, nil
  102287. // {
  102288. // "description": "Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.",
  102289. // "httpMethod": "DELETE",
  102290. // "id": "compute.regionDisks.delete",
  102291. // "parameterOrder": [
  102292. // "project",
  102293. // "region",
  102294. // "disk"
  102295. // ],
  102296. // "parameters": {
  102297. // "disk": {
  102298. // "description": "Name of the regional persistent disk to delete.",
  102299. // "location": "path",
  102300. // "required": true,
  102301. // "type": "string"
  102302. // },
  102303. // "project": {
  102304. // "description": "Project ID for this request.",
  102305. // "location": "path",
  102306. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102307. // "required": true,
  102308. // "type": "string"
  102309. // },
  102310. // "region": {
  102311. // "description": "Name of the region for this request.",
  102312. // "location": "path",
  102313. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102314. // "required": true,
  102315. // "type": "string"
  102316. // },
  102317. // "requestId": {
  102318. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102319. // "location": "query",
  102320. // "type": "string"
  102321. // }
  102322. // },
  102323. // "path": "{project}/regions/{region}/disks/{disk}",
  102324. // "response": {
  102325. // "$ref": "Operation"
  102326. // },
  102327. // "scopes": [
  102328. // "https://www.googleapis.com/auth/cloud-platform",
  102329. // "https://www.googleapis.com/auth/compute"
  102330. // ]
  102331. // }
  102332. }
  102333. // method id "compute.regionDisks.get":
  102334. type RegionDisksGetCall struct {
  102335. s *Service
  102336. project string
  102337. region string
  102338. disk string
  102339. urlParams_ gensupport.URLParams
  102340. ifNoneMatch_ string
  102341. ctx_ context.Context
  102342. header_ http.Header
  102343. }
  102344. // Get: Returns a specified regional persistent disk.
  102345. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  102346. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102347. c.project = project
  102348. c.region = region
  102349. c.disk = disk
  102350. return c
  102351. }
  102352. // Fields allows partial responses to be retrieved. See
  102353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102354. // for more information.
  102355. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  102356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102357. return c
  102358. }
  102359. // IfNoneMatch sets the optional parameter which makes the operation
  102360. // fail if the object's ETag matches the given value. This is useful for
  102361. // getting updates only after the object has changed since the last
  102362. // request. Use googleapi.IsNotModified to check whether the response
  102363. // error from Do is the result of In-None-Match.
  102364. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  102365. c.ifNoneMatch_ = entityTag
  102366. return c
  102367. }
  102368. // Context sets the context to be used in this call's Do method. Any
  102369. // pending HTTP request will be aborted if the provided context is
  102370. // canceled.
  102371. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  102372. c.ctx_ = ctx
  102373. return c
  102374. }
  102375. // Header returns an http.Header that can be modified by the caller to
  102376. // add HTTP headers to the request.
  102377. func (c *RegionDisksGetCall) Header() http.Header {
  102378. if c.header_ == nil {
  102379. c.header_ = make(http.Header)
  102380. }
  102381. return c.header_
  102382. }
  102383. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  102384. reqHeaders := make(http.Header)
  102385. for k, v := range c.header_ {
  102386. reqHeaders[k] = v
  102387. }
  102388. reqHeaders.Set("User-Agent", c.s.userAgent())
  102389. if c.ifNoneMatch_ != "" {
  102390. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102391. }
  102392. var body io.Reader = nil
  102393. c.urlParams_.Set("alt", alt)
  102394. c.urlParams_.Set("prettyPrint", "false")
  102395. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  102396. urls += "?" + c.urlParams_.Encode()
  102397. req, err := http.NewRequest("GET", urls, body)
  102398. if err != nil {
  102399. return nil, err
  102400. }
  102401. req.Header = reqHeaders
  102402. googleapi.Expand(req.URL, map[string]string{
  102403. "project": c.project,
  102404. "region": c.region,
  102405. "disk": c.disk,
  102406. })
  102407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102408. }
  102409. // Do executes the "compute.regionDisks.get" call.
  102410. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  102411. // code is an error. Response headers are in either
  102412. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  102413. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  102414. // whether the returned error was because http.StatusNotModified was
  102415. // returned.
  102416. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  102417. gensupport.SetOptions(c.urlParams_, opts...)
  102418. res, err := c.doRequest("json")
  102419. if res != nil && res.StatusCode == http.StatusNotModified {
  102420. if res.Body != nil {
  102421. res.Body.Close()
  102422. }
  102423. return nil, &googleapi.Error{
  102424. Code: res.StatusCode,
  102425. Header: res.Header,
  102426. }
  102427. }
  102428. if err != nil {
  102429. return nil, err
  102430. }
  102431. defer googleapi.CloseBody(res)
  102432. if err := googleapi.CheckResponse(res); err != nil {
  102433. return nil, err
  102434. }
  102435. ret := &Disk{
  102436. ServerResponse: googleapi.ServerResponse{
  102437. Header: res.Header,
  102438. HTTPStatusCode: res.StatusCode,
  102439. },
  102440. }
  102441. target := &ret
  102442. if err := gensupport.DecodeResponse(target, res); err != nil {
  102443. return nil, err
  102444. }
  102445. return ret, nil
  102446. // {
  102447. // "description": "Returns a specified regional persistent disk.",
  102448. // "httpMethod": "GET",
  102449. // "id": "compute.regionDisks.get",
  102450. // "parameterOrder": [
  102451. // "project",
  102452. // "region",
  102453. // "disk"
  102454. // ],
  102455. // "parameters": {
  102456. // "disk": {
  102457. // "description": "Name of the regional persistent disk to return.",
  102458. // "location": "path",
  102459. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102460. // "required": true,
  102461. // "type": "string"
  102462. // },
  102463. // "project": {
  102464. // "description": "Project ID for this request.",
  102465. // "location": "path",
  102466. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102467. // "required": true,
  102468. // "type": "string"
  102469. // },
  102470. // "region": {
  102471. // "description": "Name of the region for this request.",
  102472. // "location": "path",
  102473. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102474. // "required": true,
  102475. // "type": "string"
  102476. // }
  102477. // },
  102478. // "path": "{project}/regions/{region}/disks/{disk}",
  102479. // "response": {
  102480. // "$ref": "Disk"
  102481. // },
  102482. // "scopes": [
  102483. // "https://www.googleapis.com/auth/cloud-platform",
  102484. // "https://www.googleapis.com/auth/compute",
  102485. // "https://www.googleapis.com/auth/compute.readonly"
  102486. // ]
  102487. // }
  102488. }
  102489. // method id "compute.regionDisks.getIamPolicy":
  102490. type RegionDisksGetIamPolicyCall struct {
  102491. s *Service
  102492. project string
  102493. region string
  102494. resource string
  102495. urlParams_ gensupport.URLParams
  102496. ifNoneMatch_ string
  102497. ctx_ context.Context
  102498. header_ http.Header
  102499. }
  102500. // GetIamPolicy: Gets the access control policy for a resource. May be
  102501. // empty if no such policy or resource exists.
  102502. func (r *RegionDisksService) GetIamPolicy(project string, region string, resource string) *RegionDisksGetIamPolicyCall {
  102503. c := &RegionDisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102504. c.project = project
  102505. c.region = region
  102506. c.resource = resource
  102507. return c
  102508. }
  102509. // Fields allows partial responses to be retrieved. See
  102510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102511. // for more information.
  102512. func (c *RegionDisksGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksGetIamPolicyCall {
  102513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102514. return c
  102515. }
  102516. // IfNoneMatch sets the optional parameter which makes the operation
  102517. // fail if the object's ETag matches the given value. This is useful for
  102518. // getting updates only after the object has changed since the last
  102519. // request. Use googleapi.IsNotModified to check whether the response
  102520. // error from Do is the result of In-None-Match.
  102521. func (c *RegionDisksGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionDisksGetIamPolicyCall {
  102522. c.ifNoneMatch_ = entityTag
  102523. return c
  102524. }
  102525. // Context sets the context to be used in this call's Do method. Any
  102526. // pending HTTP request will be aborted if the provided context is
  102527. // canceled.
  102528. func (c *RegionDisksGetIamPolicyCall) Context(ctx context.Context) *RegionDisksGetIamPolicyCall {
  102529. c.ctx_ = ctx
  102530. return c
  102531. }
  102532. // Header returns an http.Header that can be modified by the caller to
  102533. // add HTTP headers to the request.
  102534. func (c *RegionDisksGetIamPolicyCall) Header() http.Header {
  102535. if c.header_ == nil {
  102536. c.header_ = make(http.Header)
  102537. }
  102538. return c.header_
  102539. }
  102540. func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  102541. reqHeaders := make(http.Header)
  102542. for k, v := range c.header_ {
  102543. reqHeaders[k] = v
  102544. }
  102545. reqHeaders.Set("User-Agent", c.s.userAgent())
  102546. if c.ifNoneMatch_ != "" {
  102547. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102548. }
  102549. var body io.Reader = nil
  102550. c.urlParams_.Set("alt", alt)
  102551. c.urlParams_.Set("prettyPrint", "false")
  102552. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/getIamPolicy")
  102553. urls += "?" + c.urlParams_.Encode()
  102554. req, err := http.NewRequest("GET", urls, body)
  102555. if err != nil {
  102556. return nil, err
  102557. }
  102558. req.Header = reqHeaders
  102559. googleapi.Expand(req.URL, map[string]string{
  102560. "project": c.project,
  102561. "region": c.region,
  102562. "resource": c.resource,
  102563. })
  102564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102565. }
  102566. // Do executes the "compute.regionDisks.getIamPolicy" call.
  102567. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  102568. // code is an error. Response headers are in either
  102569. // *Policy.ServerResponse.Header or (if a response was returned at all)
  102570. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  102571. // check whether the returned error was because http.StatusNotModified
  102572. // was returned.
  102573. func (c *RegionDisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  102574. gensupport.SetOptions(c.urlParams_, opts...)
  102575. res, err := c.doRequest("json")
  102576. if res != nil && res.StatusCode == http.StatusNotModified {
  102577. if res.Body != nil {
  102578. res.Body.Close()
  102579. }
  102580. return nil, &googleapi.Error{
  102581. Code: res.StatusCode,
  102582. Header: res.Header,
  102583. }
  102584. }
  102585. if err != nil {
  102586. return nil, err
  102587. }
  102588. defer googleapi.CloseBody(res)
  102589. if err := googleapi.CheckResponse(res); err != nil {
  102590. return nil, err
  102591. }
  102592. ret := &Policy{
  102593. ServerResponse: googleapi.ServerResponse{
  102594. Header: res.Header,
  102595. HTTPStatusCode: res.StatusCode,
  102596. },
  102597. }
  102598. target := &ret
  102599. if err := gensupport.DecodeResponse(target, res); err != nil {
  102600. return nil, err
  102601. }
  102602. return ret, nil
  102603. // {
  102604. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  102605. // "httpMethod": "GET",
  102606. // "id": "compute.regionDisks.getIamPolicy",
  102607. // "parameterOrder": [
  102608. // "project",
  102609. // "region",
  102610. // "resource"
  102611. // ],
  102612. // "parameters": {
  102613. // "project": {
  102614. // "description": "Project ID for this request.",
  102615. // "location": "path",
  102616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102617. // "required": true,
  102618. // "type": "string"
  102619. // },
  102620. // "region": {
  102621. // "description": "The name of the region for this request.",
  102622. // "location": "path",
  102623. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102624. // "required": true,
  102625. // "type": "string"
  102626. // },
  102627. // "resource": {
  102628. // "description": "Name or id of the resource for this request.",
  102629. // "location": "path",
  102630. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  102631. // "required": true,
  102632. // "type": "string"
  102633. // }
  102634. // },
  102635. // "path": "{project}/regions/{region}/disks/{resource}/getIamPolicy",
  102636. // "response": {
  102637. // "$ref": "Policy"
  102638. // },
  102639. // "scopes": [
  102640. // "https://www.googleapis.com/auth/cloud-platform",
  102641. // "https://www.googleapis.com/auth/compute",
  102642. // "https://www.googleapis.com/auth/compute.readonly"
  102643. // ]
  102644. // }
  102645. }
  102646. // method id "compute.regionDisks.insert":
  102647. type RegionDisksInsertCall struct {
  102648. s *Service
  102649. project string
  102650. region string
  102651. disk *Disk
  102652. urlParams_ gensupport.URLParams
  102653. ctx_ context.Context
  102654. header_ http.Header
  102655. }
  102656. // Insert: Creates a persistent regional disk in the specified project
  102657. // using the data included in the request.
  102658. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  102659. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102660. c.project = project
  102661. c.region = region
  102662. c.disk = disk
  102663. return c
  102664. }
  102665. // RequestId sets the optional parameter "requestId": An optional
  102666. // request ID to identify requests. Specify a unique request ID so that
  102667. // if you must retry your request, the server will know to ignore the
  102668. // request if it has already been completed.
  102669. //
  102670. // For example, consider a situation where you make an initial request
  102671. // and the request times out. If you make the request again with the
  102672. // same request ID, the server can check if original operation with the
  102673. // same request ID was received, and if so, will ignore the second
  102674. // request. This prevents clients from accidentally creating duplicate
  102675. // commitments.
  102676. //
  102677. // The request ID must be a valid UUID with the exception that zero UUID
  102678. // is not supported (00000000-0000-0000-0000-000000000000).
  102679. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  102680. c.urlParams_.Set("requestId", requestId)
  102681. return c
  102682. }
  102683. // SourceImage sets the optional parameter "sourceImage": Source image
  102684. // to restore onto a disk.
  102685. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  102686. c.urlParams_.Set("sourceImage", sourceImage)
  102687. return c
  102688. }
  102689. // Fields allows partial responses to be retrieved. See
  102690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102691. // for more information.
  102692. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  102693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102694. return c
  102695. }
  102696. // Context sets the context to be used in this call's Do method. Any
  102697. // pending HTTP request will be aborted if the provided context is
  102698. // canceled.
  102699. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  102700. c.ctx_ = ctx
  102701. return c
  102702. }
  102703. // Header returns an http.Header that can be modified by the caller to
  102704. // add HTTP headers to the request.
  102705. func (c *RegionDisksInsertCall) Header() http.Header {
  102706. if c.header_ == nil {
  102707. c.header_ = make(http.Header)
  102708. }
  102709. return c.header_
  102710. }
  102711. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  102712. reqHeaders := make(http.Header)
  102713. for k, v := range c.header_ {
  102714. reqHeaders[k] = v
  102715. }
  102716. reqHeaders.Set("User-Agent", c.s.userAgent())
  102717. var body io.Reader = nil
  102718. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  102719. if err != nil {
  102720. return nil, err
  102721. }
  102722. reqHeaders.Set("Content-Type", "application/json")
  102723. c.urlParams_.Set("alt", alt)
  102724. c.urlParams_.Set("prettyPrint", "false")
  102725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  102726. urls += "?" + c.urlParams_.Encode()
  102727. req, err := http.NewRequest("POST", urls, body)
  102728. if err != nil {
  102729. return nil, err
  102730. }
  102731. req.Header = reqHeaders
  102732. googleapi.Expand(req.URL, map[string]string{
  102733. "project": c.project,
  102734. "region": c.region,
  102735. })
  102736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102737. }
  102738. // Do executes the "compute.regionDisks.insert" call.
  102739. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  102740. // status code is an error. Response headers are in either
  102741. // *Operation.ServerResponse.Header or (if a response was returned at
  102742. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102743. // to check whether the returned error was because
  102744. // http.StatusNotModified was returned.
  102745. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  102746. gensupport.SetOptions(c.urlParams_, opts...)
  102747. res, err := c.doRequest("json")
  102748. if res != nil && res.StatusCode == http.StatusNotModified {
  102749. if res.Body != nil {
  102750. res.Body.Close()
  102751. }
  102752. return nil, &googleapi.Error{
  102753. Code: res.StatusCode,
  102754. Header: res.Header,
  102755. }
  102756. }
  102757. if err != nil {
  102758. return nil, err
  102759. }
  102760. defer googleapi.CloseBody(res)
  102761. if err := googleapi.CheckResponse(res); err != nil {
  102762. return nil, err
  102763. }
  102764. ret := &Operation{
  102765. ServerResponse: googleapi.ServerResponse{
  102766. Header: res.Header,
  102767. HTTPStatusCode: res.StatusCode,
  102768. },
  102769. }
  102770. target := &ret
  102771. if err := gensupport.DecodeResponse(target, res); err != nil {
  102772. return nil, err
  102773. }
  102774. return ret, nil
  102775. // {
  102776. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  102777. // "httpMethod": "POST",
  102778. // "id": "compute.regionDisks.insert",
  102779. // "parameterOrder": [
  102780. // "project",
  102781. // "region"
  102782. // ],
  102783. // "parameters": {
  102784. // "project": {
  102785. // "description": "Project ID for this request.",
  102786. // "location": "path",
  102787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102788. // "required": true,
  102789. // "type": "string"
  102790. // },
  102791. // "region": {
  102792. // "description": "Name of the region for this request.",
  102793. // "location": "path",
  102794. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  102795. // "required": true,
  102796. // "type": "string"
  102797. // },
  102798. // "requestId": {
  102799. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  102800. // "location": "query",
  102801. // "type": "string"
  102802. // },
  102803. // "sourceImage": {
  102804. // "description": "Optional. Source image to restore onto a disk.",
  102805. // "location": "query",
  102806. // "type": "string"
  102807. // }
  102808. // },
  102809. // "path": "{project}/regions/{region}/disks",
  102810. // "request": {
  102811. // "$ref": "Disk"
  102812. // },
  102813. // "response": {
  102814. // "$ref": "Operation"
  102815. // },
  102816. // "scopes": [
  102817. // "https://www.googleapis.com/auth/cloud-platform",
  102818. // "https://www.googleapis.com/auth/compute"
  102819. // ]
  102820. // }
  102821. }
  102822. // method id "compute.regionDisks.list":
  102823. type RegionDisksListCall struct {
  102824. s *Service
  102825. project string
  102826. region string
  102827. urlParams_ gensupport.URLParams
  102828. ifNoneMatch_ string
  102829. ctx_ context.Context
  102830. header_ http.Header
  102831. }
  102832. // List: Retrieves the list of persistent disks contained within the
  102833. // specified region.
  102834. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  102835. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  102836. c.project = project
  102837. c.region = region
  102838. return c
  102839. }
  102840. // Filter sets the optional parameter "filter": A filter expression that
  102841. // filters resources listed in the response. The expression must specify
  102842. // the field name, a comparison operator, and the value that you want to
  102843. // use for filtering. The value must be a string, a number, or a
  102844. // boolean. The comparison operator must be either =, !=, >, or <.
  102845. //
  102846. // For example, if you are filtering Compute Engine instances, you can
  102847. // exclude instances named example-instance by specifying name !=
  102848. // example-instance.
  102849. //
  102850. // You can also filter nested fields. For example, you could specify
  102851. // scheduling.automaticRestart = false to include instances only if they
  102852. // are not scheduled for automatic restarts. You can use filtering on
  102853. // nested fields to filter based on resource labels.
  102854. //
  102855. // To filter on multiple expressions, provide each separate expression
  102856. // within parentheses. For example, (scheduling.automaticRestart = true)
  102857. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  102858. // AND expression. However, you can include AND and OR expressions
  102859. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  102860. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  102861. // true).
  102862. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  102863. c.urlParams_.Set("filter", filter)
  102864. return c
  102865. }
  102866. // MaxResults sets the optional parameter "maxResults": The maximum
  102867. // number of results per page that should be returned. If the number of
  102868. // available results is larger than maxResults, Compute Engine returns a
  102869. // nextPageToken that can be used to get the next page of results in
  102870. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  102871. // (Default: 500)
  102872. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  102873. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  102874. return c
  102875. }
  102876. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  102877. // a certain order. By default, results are returned in alphanumerical
  102878. // order based on the resource name.
  102879. //
  102880. // You can also sort results in descending order based on the creation
  102881. // timestamp using orderBy="creationTimestamp desc". This sorts results
  102882. // based on the creationTimestamp field in reverse chronological order
  102883. // (newest result first). Use this to sort resources like operations so
  102884. // that the newest operation is returned first.
  102885. //
  102886. // Currently, only sorting by name or creationTimestamp desc is
  102887. // supported.
  102888. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  102889. c.urlParams_.Set("orderBy", orderBy)
  102890. return c
  102891. }
  102892. // PageToken sets the optional parameter "pageToken": Specifies a page
  102893. // token to use. Set pageToken to the nextPageToken returned by a
  102894. // previous list request to get the next page of results.
  102895. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  102896. c.urlParams_.Set("pageToken", pageToken)
  102897. return c
  102898. }
  102899. // Fields allows partial responses to be retrieved. See
  102900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  102901. // for more information.
  102902. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  102903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  102904. return c
  102905. }
  102906. // IfNoneMatch sets the optional parameter which makes the operation
  102907. // fail if the object's ETag matches the given value. This is useful for
  102908. // getting updates only after the object has changed since the last
  102909. // request. Use googleapi.IsNotModified to check whether the response
  102910. // error from Do is the result of In-None-Match.
  102911. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  102912. c.ifNoneMatch_ = entityTag
  102913. return c
  102914. }
  102915. // Context sets the context to be used in this call's Do method. Any
  102916. // pending HTTP request will be aborted if the provided context is
  102917. // canceled.
  102918. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  102919. c.ctx_ = ctx
  102920. return c
  102921. }
  102922. // Header returns an http.Header that can be modified by the caller to
  102923. // add HTTP headers to the request.
  102924. func (c *RegionDisksListCall) Header() http.Header {
  102925. if c.header_ == nil {
  102926. c.header_ = make(http.Header)
  102927. }
  102928. return c.header_
  102929. }
  102930. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  102931. reqHeaders := make(http.Header)
  102932. for k, v := range c.header_ {
  102933. reqHeaders[k] = v
  102934. }
  102935. reqHeaders.Set("User-Agent", c.s.userAgent())
  102936. if c.ifNoneMatch_ != "" {
  102937. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  102938. }
  102939. var body io.Reader = nil
  102940. c.urlParams_.Set("alt", alt)
  102941. c.urlParams_.Set("prettyPrint", "false")
  102942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  102943. urls += "?" + c.urlParams_.Encode()
  102944. req, err := http.NewRequest("GET", urls, body)
  102945. if err != nil {
  102946. return nil, err
  102947. }
  102948. req.Header = reqHeaders
  102949. googleapi.Expand(req.URL, map[string]string{
  102950. "project": c.project,
  102951. "region": c.region,
  102952. })
  102953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  102954. }
  102955. // Do executes the "compute.regionDisks.list" call.
  102956. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  102957. // code is an error. Response headers are in either
  102958. // *DiskList.ServerResponse.Header or (if a response was returned at
  102959. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  102960. // to check whether the returned error was because
  102961. // http.StatusNotModified was returned.
  102962. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  102963. gensupport.SetOptions(c.urlParams_, opts...)
  102964. res, err := c.doRequest("json")
  102965. if res != nil && res.StatusCode == http.StatusNotModified {
  102966. if res.Body != nil {
  102967. res.Body.Close()
  102968. }
  102969. return nil, &googleapi.Error{
  102970. Code: res.StatusCode,
  102971. Header: res.Header,
  102972. }
  102973. }
  102974. if err != nil {
  102975. return nil, err
  102976. }
  102977. defer googleapi.CloseBody(res)
  102978. if err := googleapi.CheckResponse(res); err != nil {
  102979. return nil, err
  102980. }
  102981. ret := &DiskList{
  102982. ServerResponse: googleapi.ServerResponse{
  102983. Header: res.Header,
  102984. HTTPStatusCode: res.StatusCode,
  102985. },
  102986. }
  102987. target := &ret
  102988. if err := gensupport.DecodeResponse(target, res); err != nil {
  102989. return nil, err
  102990. }
  102991. return ret, nil
  102992. // {
  102993. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  102994. // "httpMethod": "GET",
  102995. // "id": "compute.regionDisks.list",
  102996. // "parameterOrder": [
  102997. // "project",
  102998. // "region"
  102999. // ],
  103000. // "parameters": {
  103001. // "filter": {
  103002. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  103003. // "location": "query",
  103004. // "type": "string"
  103005. // },
  103006. // "maxResults": {
  103007. // "default": "500",
  103008. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  103009. // "format": "uint32",
  103010. // "location": "query",
  103011. // "minimum": "0",
  103012. // "type": "integer"
  103013. // },
  103014. // "orderBy": {
  103015. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  103016. // "location": "query",
  103017. // "type": "string"
  103018. // },
  103019. // "pageToken": {
  103020. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  103021. // "location": "query",
  103022. // "type": "string"
  103023. // },
  103024. // "project": {
  103025. // "description": "Project ID for this request.",
  103026. // "location": "path",
  103027. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103028. // "required": true,
  103029. // "type": "string"
  103030. // },
  103031. // "region": {
  103032. // "description": "Name of the region for this request.",
  103033. // "location": "path",
  103034. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103035. // "required": true,
  103036. // "type": "string"
  103037. // }
  103038. // },
  103039. // "path": "{project}/regions/{region}/disks",
  103040. // "response": {
  103041. // "$ref": "DiskList"
  103042. // },
  103043. // "scopes": [
  103044. // "https://www.googleapis.com/auth/cloud-platform",
  103045. // "https://www.googleapis.com/auth/compute",
  103046. // "https://www.googleapis.com/auth/compute.readonly"
  103047. // ]
  103048. // }
  103049. }
  103050. // Pages invokes f for each page of results.
  103051. // A non-nil error returned from f will halt the iteration.
  103052. // The provided context supersedes any context provided to the Context method.
  103053. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  103054. c.ctx_ = ctx
  103055. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  103056. for {
  103057. x, err := c.Do()
  103058. if err != nil {
  103059. return err
  103060. }
  103061. if err := f(x); err != nil {
  103062. return err
  103063. }
  103064. if x.NextPageToken == "" {
  103065. return nil
  103066. }
  103067. c.PageToken(x.NextPageToken)
  103068. }
  103069. }
  103070. // method id "compute.regionDisks.removeResourcePolicies":
  103071. type RegionDisksRemoveResourcePoliciesCall struct {
  103072. s *Service
  103073. project string
  103074. region string
  103075. disk string
  103076. regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest
  103077. urlParams_ gensupport.URLParams
  103078. ctx_ context.Context
  103079. header_ http.Header
  103080. }
  103081. // RemoveResourcePolicies: Removes resource policies from a regional
  103082. // disk.
  103083. func (r *RegionDisksService) RemoveResourcePolicies(project string, region string, disk string, regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest) *RegionDisksRemoveResourcePoliciesCall {
  103084. c := &RegionDisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103085. c.project = project
  103086. c.region = region
  103087. c.disk = disk
  103088. c.regiondisksremoveresourcepoliciesrequest = regiondisksremoveresourcepoliciesrequest
  103089. return c
  103090. }
  103091. // RequestId sets the optional parameter "requestId": An optional
  103092. // request ID to identify requests. Specify a unique request ID so that
  103093. // if you must retry your request, the server will know to ignore the
  103094. // request if it has already been completed.
  103095. //
  103096. // For example, consider a situation where you make an initial request
  103097. // and the request times out. If you make the request again with the
  103098. // same request ID, the server can check if original operation with the
  103099. // same request ID was received, and if so, will ignore the second
  103100. // request. This prevents clients from accidentally creating duplicate
  103101. // commitments.
  103102. //
  103103. // The request ID must be a valid UUID with the exception that zero UUID
  103104. // is not supported (00000000-0000-0000-0000-000000000000).
  103105. func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *RegionDisksRemoveResourcePoliciesCall {
  103106. c.urlParams_.Set("requestId", requestId)
  103107. return c
  103108. }
  103109. // Fields allows partial responses to be retrieved. See
  103110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103111. // for more information.
  103112. func (c *RegionDisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksRemoveResourcePoliciesCall {
  103113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103114. return c
  103115. }
  103116. // Context sets the context to be used in this call's Do method. Any
  103117. // pending HTTP request will be aborted if the provided context is
  103118. // canceled.
  103119. func (c *RegionDisksRemoveResourcePoliciesCall) Context(ctx context.Context) *RegionDisksRemoveResourcePoliciesCall {
  103120. c.ctx_ = ctx
  103121. return c
  103122. }
  103123. // Header returns an http.Header that can be modified by the caller to
  103124. // add HTTP headers to the request.
  103125. func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header {
  103126. if c.header_ == nil {
  103127. c.header_ = make(http.Header)
  103128. }
  103129. return c.header_
  103130. }
  103131. func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) {
  103132. reqHeaders := make(http.Header)
  103133. for k, v := range c.header_ {
  103134. reqHeaders[k] = v
  103135. }
  103136. reqHeaders.Set("User-Agent", c.s.userAgent())
  103137. var body io.Reader = nil
  103138. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest)
  103139. if err != nil {
  103140. return nil, err
  103141. }
  103142. reqHeaders.Set("Content-Type", "application/json")
  103143. c.urlParams_.Set("alt", alt)
  103144. c.urlParams_.Set("prettyPrint", "false")
  103145. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/removeResourcePolicies")
  103146. urls += "?" + c.urlParams_.Encode()
  103147. req, err := http.NewRequest("POST", urls, body)
  103148. if err != nil {
  103149. return nil, err
  103150. }
  103151. req.Header = reqHeaders
  103152. googleapi.Expand(req.URL, map[string]string{
  103153. "project": c.project,
  103154. "region": c.region,
  103155. "disk": c.disk,
  103156. })
  103157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103158. }
  103159. // Do executes the "compute.regionDisks.removeResourcePolicies" call.
  103160. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103161. // status code is an error. Response headers are in either
  103162. // *Operation.ServerResponse.Header or (if a response was returned at
  103163. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103164. // to check whether the returned error was because
  103165. // http.StatusNotModified was returned.
  103166. func (c *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103167. gensupport.SetOptions(c.urlParams_, opts...)
  103168. res, err := c.doRequest("json")
  103169. if res != nil && res.StatusCode == http.StatusNotModified {
  103170. if res.Body != nil {
  103171. res.Body.Close()
  103172. }
  103173. return nil, &googleapi.Error{
  103174. Code: res.StatusCode,
  103175. Header: res.Header,
  103176. }
  103177. }
  103178. if err != nil {
  103179. return nil, err
  103180. }
  103181. defer googleapi.CloseBody(res)
  103182. if err := googleapi.CheckResponse(res); err != nil {
  103183. return nil, err
  103184. }
  103185. ret := &Operation{
  103186. ServerResponse: googleapi.ServerResponse{
  103187. Header: res.Header,
  103188. HTTPStatusCode: res.StatusCode,
  103189. },
  103190. }
  103191. target := &ret
  103192. if err := gensupport.DecodeResponse(target, res); err != nil {
  103193. return nil, err
  103194. }
  103195. return ret, nil
  103196. // {
  103197. // "description": "Removes resource policies from a regional disk.",
  103198. // "httpMethod": "POST",
  103199. // "id": "compute.regionDisks.removeResourcePolicies",
  103200. // "parameterOrder": [
  103201. // "project",
  103202. // "region",
  103203. // "disk"
  103204. // ],
  103205. // "parameters": {
  103206. // "disk": {
  103207. // "description": "The disk name for this request.",
  103208. // "location": "path",
  103209. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103210. // "required": true,
  103211. // "type": "string"
  103212. // },
  103213. // "project": {
  103214. // "description": "Project ID for this request.",
  103215. // "location": "path",
  103216. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103217. // "required": true,
  103218. // "type": "string"
  103219. // },
  103220. // "region": {
  103221. // "description": "The name of the region for this request.",
  103222. // "location": "path",
  103223. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103224. // "required": true,
  103225. // "type": "string"
  103226. // },
  103227. // "requestId": {
  103228. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103229. // "location": "query",
  103230. // "type": "string"
  103231. // }
  103232. // },
  103233. // "path": "{project}/regions/{region}/disks/{disk}/removeResourcePolicies",
  103234. // "request": {
  103235. // "$ref": "RegionDisksRemoveResourcePoliciesRequest"
  103236. // },
  103237. // "response": {
  103238. // "$ref": "Operation"
  103239. // },
  103240. // "scopes": [
  103241. // "https://www.googleapis.com/auth/cloud-platform",
  103242. // "https://www.googleapis.com/auth/compute"
  103243. // ]
  103244. // }
  103245. }
  103246. // method id "compute.regionDisks.resize":
  103247. type RegionDisksResizeCall struct {
  103248. s *Service
  103249. project string
  103250. region string
  103251. disk string
  103252. regiondisksresizerequest *RegionDisksResizeRequest
  103253. urlParams_ gensupport.URLParams
  103254. ctx_ context.Context
  103255. header_ http.Header
  103256. }
  103257. // Resize: Resizes the specified regional persistent disk.
  103258. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  103259. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103260. c.project = project
  103261. c.region = region
  103262. c.disk = disk
  103263. c.regiondisksresizerequest = regiondisksresizerequest
  103264. return c
  103265. }
  103266. // RequestId sets the optional parameter "requestId": An optional
  103267. // request ID to identify requests. Specify a unique request ID so that
  103268. // if you must retry your request, the server will know to ignore the
  103269. // request if it has already been completed.
  103270. //
  103271. // For example, consider a situation where you make an initial request
  103272. // and the request times out. If you make the request again with the
  103273. // same request ID, the server can check if original operation with the
  103274. // same request ID was received, and if so, will ignore the second
  103275. // request. This prevents clients from accidentally creating duplicate
  103276. // commitments.
  103277. //
  103278. // The request ID must be a valid UUID with the exception that zero UUID
  103279. // is not supported (00000000-0000-0000-0000-000000000000).
  103280. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  103281. c.urlParams_.Set("requestId", requestId)
  103282. return c
  103283. }
  103284. // Fields allows partial responses to be retrieved. See
  103285. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103286. // for more information.
  103287. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  103288. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103289. return c
  103290. }
  103291. // Context sets the context to be used in this call's Do method. Any
  103292. // pending HTTP request will be aborted if the provided context is
  103293. // canceled.
  103294. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  103295. c.ctx_ = ctx
  103296. return c
  103297. }
  103298. // Header returns an http.Header that can be modified by the caller to
  103299. // add HTTP headers to the request.
  103300. func (c *RegionDisksResizeCall) Header() http.Header {
  103301. if c.header_ == nil {
  103302. c.header_ = make(http.Header)
  103303. }
  103304. return c.header_
  103305. }
  103306. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  103307. reqHeaders := make(http.Header)
  103308. for k, v := range c.header_ {
  103309. reqHeaders[k] = v
  103310. }
  103311. reqHeaders.Set("User-Agent", c.s.userAgent())
  103312. var body io.Reader = nil
  103313. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  103314. if err != nil {
  103315. return nil, err
  103316. }
  103317. reqHeaders.Set("Content-Type", "application/json")
  103318. c.urlParams_.Set("alt", alt)
  103319. c.urlParams_.Set("prettyPrint", "false")
  103320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  103321. urls += "?" + c.urlParams_.Encode()
  103322. req, err := http.NewRequest("POST", urls, body)
  103323. if err != nil {
  103324. return nil, err
  103325. }
  103326. req.Header = reqHeaders
  103327. googleapi.Expand(req.URL, map[string]string{
  103328. "project": c.project,
  103329. "region": c.region,
  103330. "disk": c.disk,
  103331. })
  103332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103333. }
  103334. // Do executes the "compute.regionDisks.resize" call.
  103335. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103336. // status code is an error. Response headers are in either
  103337. // *Operation.ServerResponse.Header or (if a response was returned at
  103338. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103339. // to check whether the returned error was because
  103340. // http.StatusNotModified was returned.
  103341. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103342. gensupport.SetOptions(c.urlParams_, opts...)
  103343. res, err := c.doRequest("json")
  103344. if res != nil && res.StatusCode == http.StatusNotModified {
  103345. if res.Body != nil {
  103346. res.Body.Close()
  103347. }
  103348. return nil, &googleapi.Error{
  103349. Code: res.StatusCode,
  103350. Header: res.Header,
  103351. }
  103352. }
  103353. if err != nil {
  103354. return nil, err
  103355. }
  103356. defer googleapi.CloseBody(res)
  103357. if err := googleapi.CheckResponse(res); err != nil {
  103358. return nil, err
  103359. }
  103360. ret := &Operation{
  103361. ServerResponse: googleapi.ServerResponse{
  103362. Header: res.Header,
  103363. HTTPStatusCode: res.StatusCode,
  103364. },
  103365. }
  103366. target := &ret
  103367. if err := gensupport.DecodeResponse(target, res); err != nil {
  103368. return nil, err
  103369. }
  103370. return ret, nil
  103371. // {
  103372. // "description": "Resizes the specified regional persistent disk.",
  103373. // "httpMethod": "POST",
  103374. // "id": "compute.regionDisks.resize",
  103375. // "parameterOrder": [
  103376. // "project",
  103377. // "region",
  103378. // "disk"
  103379. // ],
  103380. // "parameters": {
  103381. // "disk": {
  103382. // "description": "Name of the regional persistent disk.",
  103383. // "location": "path",
  103384. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103385. // "required": true,
  103386. // "type": "string"
  103387. // },
  103388. // "project": {
  103389. // "description": "The project ID for this request.",
  103390. // "location": "path",
  103391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103392. // "required": true,
  103393. // "type": "string"
  103394. // },
  103395. // "region": {
  103396. // "description": "Name of the region for this request.",
  103397. // "location": "path",
  103398. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103399. // "required": true,
  103400. // "type": "string"
  103401. // },
  103402. // "requestId": {
  103403. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103404. // "location": "query",
  103405. // "type": "string"
  103406. // }
  103407. // },
  103408. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  103409. // "request": {
  103410. // "$ref": "RegionDisksResizeRequest"
  103411. // },
  103412. // "response": {
  103413. // "$ref": "Operation"
  103414. // },
  103415. // "scopes": [
  103416. // "https://www.googleapis.com/auth/cloud-platform",
  103417. // "https://www.googleapis.com/auth/compute"
  103418. // ]
  103419. // }
  103420. }
  103421. // method id "compute.regionDisks.setIamPolicy":
  103422. type RegionDisksSetIamPolicyCall struct {
  103423. s *Service
  103424. project string
  103425. region string
  103426. resource string
  103427. regionsetpolicyrequest *RegionSetPolicyRequest
  103428. urlParams_ gensupport.URLParams
  103429. ctx_ context.Context
  103430. header_ http.Header
  103431. }
  103432. // SetIamPolicy: Sets the access control policy on the specified
  103433. // resource. Replaces any existing policy.
  103434. func (r *RegionDisksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionDisksSetIamPolicyCall {
  103435. c := &RegionDisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103436. c.project = project
  103437. c.region = region
  103438. c.resource = resource
  103439. c.regionsetpolicyrequest = regionsetpolicyrequest
  103440. return c
  103441. }
  103442. // Fields allows partial responses to be retrieved. See
  103443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103444. // for more information.
  103445. func (c *RegionDisksSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksSetIamPolicyCall {
  103446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103447. return c
  103448. }
  103449. // Context sets the context to be used in this call's Do method. Any
  103450. // pending HTTP request will be aborted if the provided context is
  103451. // canceled.
  103452. func (c *RegionDisksSetIamPolicyCall) Context(ctx context.Context) *RegionDisksSetIamPolicyCall {
  103453. c.ctx_ = ctx
  103454. return c
  103455. }
  103456. // Header returns an http.Header that can be modified by the caller to
  103457. // add HTTP headers to the request.
  103458. func (c *RegionDisksSetIamPolicyCall) Header() http.Header {
  103459. if c.header_ == nil {
  103460. c.header_ = make(http.Header)
  103461. }
  103462. return c.header_
  103463. }
  103464. func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  103465. reqHeaders := make(http.Header)
  103466. for k, v := range c.header_ {
  103467. reqHeaders[k] = v
  103468. }
  103469. reqHeaders.Set("User-Agent", c.s.userAgent())
  103470. var body io.Reader = nil
  103471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  103472. if err != nil {
  103473. return nil, err
  103474. }
  103475. reqHeaders.Set("Content-Type", "application/json")
  103476. c.urlParams_.Set("alt", alt)
  103477. c.urlParams_.Set("prettyPrint", "false")
  103478. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setIamPolicy")
  103479. urls += "?" + c.urlParams_.Encode()
  103480. req, err := http.NewRequest("POST", urls, body)
  103481. if err != nil {
  103482. return nil, err
  103483. }
  103484. req.Header = reqHeaders
  103485. googleapi.Expand(req.URL, map[string]string{
  103486. "project": c.project,
  103487. "region": c.region,
  103488. "resource": c.resource,
  103489. })
  103490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103491. }
  103492. // Do executes the "compute.regionDisks.setIamPolicy" call.
  103493. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  103494. // code is an error. Response headers are in either
  103495. // *Policy.ServerResponse.Header or (if a response was returned at all)
  103496. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  103497. // check whether the returned error was because http.StatusNotModified
  103498. // was returned.
  103499. func (c *RegionDisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  103500. gensupport.SetOptions(c.urlParams_, opts...)
  103501. res, err := c.doRequest("json")
  103502. if res != nil && res.StatusCode == http.StatusNotModified {
  103503. if res.Body != nil {
  103504. res.Body.Close()
  103505. }
  103506. return nil, &googleapi.Error{
  103507. Code: res.StatusCode,
  103508. Header: res.Header,
  103509. }
  103510. }
  103511. if err != nil {
  103512. return nil, err
  103513. }
  103514. defer googleapi.CloseBody(res)
  103515. if err := googleapi.CheckResponse(res); err != nil {
  103516. return nil, err
  103517. }
  103518. ret := &Policy{
  103519. ServerResponse: googleapi.ServerResponse{
  103520. Header: res.Header,
  103521. HTTPStatusCode: res.StatusCode,
  103522. },
  103523. }
  103524. target := &ret
  103525. if err := gensupport.DecodeResponse(target, res); err != nil {
  103526. return nil, err
  103527. }
  103528. return ret, nil
  103529. // {
  103530. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  103531. // "httpMethod": "POST",
  103532. // "id": "compute.regionDisks.setIamPolicy",
  103533. // "parameterOrder": [
  103534. // "project",
  103535. // "region",
  103536. // "resource"
  103537. // ],
  103538. // "parameters": {
  103539. // "project": {
  103540. // "description": "Project ID for this request.",
  103541. // "location": "path",
  103542. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103543. // "required": true,
  103544. // "type": "string"
  103545. // },
  103546. // "region": {
  103547. // "description": "The name of the region for this request.",
  103548. // "location": "path",
  103549. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103550. // "required": true,
  103551. // "type": "string"
  103552. // },
  103553. // "resource": {
  103554. // "description": "Name or id of the resource for this request.",
  103555. // "location": "path",
  103556. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103557. // "required": true,
  103558. // "type": "string"
  103559. // }
  103560. // },
  103561. // "path": "{project}/regions/{region}/disks/{resource}/setIamPolicy",
  103562. // "request": {
  103563. // "$ref": "RegionSetPolicyRequest"
  103564. // },
  103565. // "response": {
  103566. // "$ref": "Policy"
  103567. // },
  103568. // "scopes": [
  103569. // "https://www.googleapis.com/auth/cloud-platform",
  103570. // "https://www.googleapis.com/auth/compute"
  103571. // ]
  103572. // }
  103573. }
  103574. // method id "compute.regionDisks.setLabels":
  103575. type RegionDisksSetLabelsCall struct {
  103576. s *Service
  103577. project string
  103578. region string
  103579. resource string
  103580. regionsetlabelsrequest *RegionSetLabelsRequest
  103581. urlParams_ gensupport.URLParams
  103582. ctx_ context.Context
  103583. header_ http.Header
  103584. }
  103585. // SetLabels: Sets the labels on the target regional disk.
  103586. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  103587. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103588. c.project = project
  103589. c.region = region
  103590. c.resource = resource
  103591. c.regionsetlabelsrequest = regionsetlabelsrequest
  103592. return c
  103593. }
  103594. // RequestId sets the optional parameter "requestId": An optional
  103595. // request ID to identify requests. Specify a unique request ID so that
  103596. // if you must retry your request, the server will know to ignore the
  103597. // request if it has already been completed.
  103598. //
  103599. // For example, consider a situation where you make an initial request
  103600. // and the request times out. If you make the request again with the
  103601. // same request ID, the server can check if original operation with the
  103602. // same request ID was received, and if so, will ignore the second
  103603. // request. This prevents clients from accidentally creating duplicate
  103604. // commitments.
  103605. //
  103606. // The request ID must be a valid UUID with the exception that zero UUID
  103607. // is not supported (00000000-0000-0000-0000-000000000000).
  103608. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  103609. c.urlParams_.Set("requestId", requestId)
  103610. return c
  103611. }
  103612. // Fields allows partial responses to be retrieved. See
  103613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103614. // for more information.
  103615. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  103616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103617. return c
  103618. }
  103619. // Context sets the context to be used in this call's Do method. Any
  103620. // pending HTTP request will be aborted if the provided context is
  103621. // canceled.
  103622. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  103623. c.ctx_ = ctx
  103624. return c
  103625. }
  103626. // Header returns an http.Header that can be modified by the caller to
  103627. // add HTTP headers to the request.
  103628. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  103629. if c.header_ == nil {
  103630. c.header_ = make(http.Header)
  103631. }
  103632. return c.header_
  103633. }
  103634. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  103635. reqHeaders := make(http.Header)
  103636. for k, v := range c.header_ {
  103637. reqHeaders[k] = v
  103638. }
  103639. reqHeaders.Set("User-Agent", c.s.userAgent())
  103640. var body io.Reader = nil
  103641. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  103642. if err != nil {
  103643. return nil, err
  103644. }
  103645. reqHeaders.Set("Content-Type", "application/json")
  103646. c.urlParams_.Set("alt", alt)
  103647. c.urlParams_.Set("prettyPrint", "false")
  103648. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  103649. urls += "?" + c.urlParams_.Encode()
  103650. req, err := http.NewRequest("POST", urls, body)
  103651. if err != nil {
  103652. return nil, err
  103653. }
  103654. req.Header = reqHeaders
  103655. googleapi.Expand(req.URL, map[string]string{
  103656. "project": c.project,
  103657. "region": c.region,
  103658. "resource": c.resource,
  103659. })
  103660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103661. }
  103662. // Do executes the "compute.regionDisks.setLabels" call.
  103663. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103664. // status code is an error. Response headers are in either
  103665. // *Operation.ServerResponse.Header or (if a response was returned at
  103666. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103667. // to check whether the returned error was because
  103668. // http.StatusNotModified was returned.
  103669. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103670. gensupport.SetOptions(c.urlParams_, opts...)
  103671. res, err := c.doRequest("json")
  103672. if res != nil && res.StatusCode == http.StatusNotModified {
  103673. if res.Body != nil {
  103674. res.Body.Close()
  103675. }
  103676. return nil, &googleapi.Error{
  103677. Code: res.StatusCode,
  103678. Header: res.Header,
  103679. }
  103680. }
  103681. if err != nil {
  103682. return nil, err
  103683. }
  103684. defer googleapi.CloseBody(res)
  103685. if err := googleapi.CheckResponse(res); err != nil {
  103686. return nil, err
  103687. }
  103688. ret := &Operation{
  103689. ServerResponse: googleapi.ServerResponse{
  103690. Header: res.Header,
  103691. HTTPStatusCode: res.StatusCode,
  103692. },
  103693. }
  103694. target := &ret
  103695. if err := gensupport.DecodeResponse(target, res); err != nil {
  103696. return nil, err
  103697. }
  103698. return ret, nil
  103699. // {
  103700. // "description": "Sets the labels on the target regional disk.",
  103701. // "httpMethod": "POST",
  103702. // "id": "compute.regionDisks.setLabels",
  103703. // "parameterOrder": [
  103704. // "project",
  103705. // "region",
  103706. // "resource"
  103707. // ],
  103708. // "parameters": {
  103709. // "project": {
  103710. // "description": "Project ID for this request.",
  103711. // "location": "path",
  103712. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103713. // "required": true,
  103714. // "type": "string"
  103715. // },
  103716. // "region": {
  103717. // "description": "The region for this request.",
  103718. // "location": "path",
  103719. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103720. // "required": true,
  103721. // "type": "string"
  103722. // },
  103723. // "requestId": {
  103724. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  103725. // "location": "query",
  103726. // "type": "string"
  103727. // },
  103728. // "resource": {
  103729. // "description": "Name or id of the resource for this request.",
  103730. // "location": "path",
  103731. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103732. // "required": true,
  103733. // "type": "string"
  103734. // }
  103735. // },
  103736. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  103737. // "request": {
  103738. // "$ref": "RegionSetLabelsRequest"
  103739. // },
  103740. // "response": {
  103741. // "$ref": "Operation"
  103742. // },
  103743. // "scopes": [
  103744. // "https://www.googleapis.com/auth/cloud-platform",
  103745. // "https://www.googleapis.com/auth/compute"
  103746. // ]
  103747. // }
  103748. }
  103749. // method id "compute.regionDisks.testIamPermissions":
  103750. type RegionDisksTestIamPermissionsCall struct {
  103751. s *Service
  103752. project string
  103753. region string
  103754. resource string
  103755. testpermissionsrequest *TestPermissionsRequest
  103756. urlParams_ gensupport.URLParams
  103757. ctx_ context.Context
  103758. header_ http.Header
  103759. }
  103760. // TestIamPermissions: Returns permissions that a caller has on the
  103761. // specified resource.
  103762. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  103763. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103764. c.project = project
  103765. c.region = region
  103766. c.resource = resource
  103767. c.testpermissionsrequest = testpermissionsrequest
  103768. return c
  103769. }
  103770. // Fields allows partial responses to be retrieved. See
  103771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103772. // for more information.
  103773. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  103774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103775. return c
  103776. }
  103777. // Context sets the context to be used in this call's Do method. Any
  103778. // pending HTTP request will be aborted if the provided context is
  103779. // canceled.
  103780. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  103781. c.ctx_ = ctx
  103782. return c
  103783. }
  103784. // Header returns an http.Header that can be modified by the caller to
  103785. // add HTTP headers to the request.
  103786. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  103787. if c.header_ == nil {
  103788. c.header_ = make(http.Header)
  103789. }
  103790. return c.header_
  103791. }
  103792. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  103793. reqHeaders := make(http.Header)
  103794. for k, v := range c.header_ {
  103795. reqHeaders[k] = v
  103796. }
  103797. reqHeaders.Set("User-Agent", c.s.userAgent())
  103798. var body io.Reader = nil
  103799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  103800. if err != nil {
  103801. return nil, err
  103802. }
  103803. reqHeaders.Set("Content-Type", "application/json")
  103804. c.urlParams_.Set("alt", alt)
  103805. c.urlParams_.Set("prettyPrint", "false")
  103806. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  103807. urls += "?" + c.urlParams_.Encode()
  103808. req, err := http.NewRequest("POST", urls, body)
  103809. if err != nil {
  103810. return nil, err
  103811. }
  103812. req.Header = reqHeaders
  103813. googleapi.Expand(req.URL, map[string]string{
  103814. "project": c.project,
  103815. "region": c.region,
  103816. "resource": c.resource,
  103817. })
  103818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103819. }
  103820. // Do executes the "compute.regionDisks.testIamPermissions" call.
  103821. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  103822. // non-2xx status code is an error. Response headers are in either
  103823. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  103824. // returned at all) in error.(*googleapi.Error).Header. Use
  103825. // googleapi.IsNotModified to check whether the returned error was
  103826. // because http.StatusNotModified was returned.
  103827. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  103828. gensupport.SetOptions(c.urlParams_, opts...)
  103829. res, err := c.doRequest("json")
  103830. if res != nil && res.StatusCode == http.StatusNotModified {
  103831. if res.Body != nil {
  103832. res.Body.Close()
  103833. }
  103834. return nil, &googleapi.Error{
  103835. Code: res.StatusCode,
  103836. Header: res.Header,
  103837. }
  103838. }
  103839. if err != nil {
  103840. return nil, err
  103841. }
  103842. defer googleapi.CloseBody(res)
  103843. if err := googleapi.CheckResponse(res); err != nil {
  103844. return nil, err
  103845. }
  103846. ret := &TestPermissionsResponse{
  103847. ServerResponse: googleapi.ServerResponse{
  103848. Header: res.Header,
  103849. HTTPStatusCode: res.StatusCode,
  103850. },
  103851. }
  103852. target := &ret
  103853. if err := gensupport.DecodeResponse(target, res); err != nil {
  103854. return nil, err
  103855. }
  103856. return ret, nil
  103857. // {
  103858. // "description": "Returns permissions that a caller has on the specified resource.",
  103859. // "httpMethod": "POST",
  103860. // "id": "compute.regionDisks.testIamPermissions",
  103861. // "parameterOrder": [
  103862. // "project",
  103863. // "region",
  103864. // "resource"
  103865. // ],
  103866. // "parameters": {
  103867. // "project": {
  103868. // "description": "Project ID for this request.",
  103869. // "location": "path",
  103870. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  103871. // "required": true,
  103872. // "type": "string"
  103873. // },
  103874. // "region": {
  103875. // "description": "The name of the region for this request.",
  103876. // "location": "path",
  103877. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  103878. // "required": true,
  103879. // "type": "string"
  103880. // },
  103881. // "resource": {
  103882. // "description": "Name or id of the resource for this request.",
  103883. // "location": "path",
  103884. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  103885. // "required": true,
  103886. // "type": "string"
  103887. // }
  103888. // },
  103889. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  103890. // "request": {
  103891. // "$ref": "TestPermissionsRequest"
  103892. // },
  103893. // "response": {
  103894. // "$ref": "TestPermissionsResponse"
  103895. // },
  103896. // "scopes": [
  103897. // "https://www.googleapis.com/auth/cloud-platform",
  103898. // "https://www.googleapis.com/auth/compute",
  103899. // "https://www.googleapis.com/auth/compute.readonly"
  103900. // ]
  103901. // }
  103902. }
  103903. // method id "compute.regionHealthCheckServices.delete":
  103904. type RegionHealthCheckServicesDeleteCall struct {
  103905. s *Service
  103906. project string
  103907. region string
  103908. healthCheckService string
  103909. urlParams_ gensupport.URLParams
  103910. ctx_ context.Context
  103911. header_ http.Header
  103912. }
  103913. // Delete: Deletes the specified regional HealthCheckService.
  103914. func (r *RegionHealthCheckServicesService) Delete(project string, region string, healthCheckService string) *RegionHealthCheckServicesDeleteCall {
  103915. c := &RegionHealthCheckServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  103916. c.project = project
  103917. c.region = region
  103918. c.healthCheckService = healthCheckService
  103919. return c
  103920. }
  103921. // RequestId sets the optional parameter "requestId": An optional
  103922. // request ID to identify requests. Specify a unique request ID so that
  103923. // if you must retry your request, the server will know to ignore the
  103924. // request if it has already been completed.
  103925. //
  103926. // For example, consider a situation where you make an initial request
  103927. // and the request times out. If you make the request again with the
  103928. // same request ID, the server can check if original operation with the
  103929. // same request ID was received, and if so, will ignore the second
  103930. // request. This prevents clients from accidentally creating duplicate
  103931. // commitments.
  103932. //
  103933. // The request ID must be a valid UUID with the exception that zero UUID
  103934. // is not supported (00000000-0000-0000-0000-000000000000).
  103935. func (c *RegionHealthCheckServicesDeleteCall) RequestId(requestId string) *RegionHealthCheckServicesDeleteCall {
  103936. c.urlParams_.Set("requestId", requestId)
  103937. return c
  103938. }
  103939. // Fields allows partial responses to be retrieved. See
  103940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  103941. // for more information.
  103942. func (c *RegionHealthCheckServicesDeleteCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesDeleteCall {
  103943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  103944. return c
  103945. }
  103946. // Context sets the context to be used in this call's Do method. Any
  103947. // pending HTTP request will be aborted if the provided context is
  103948. // canceled.
  103949. func (c *RegionHealthCheckServicesDeleteCall) Context(ctx context.Context) *RegionHealthCheckServicesDeleteCall {
  103950. c.ctx_ = ctx
  103951. return c
  103952. }
  103953. // Header returns an http.Header that can be modified by the caller to
  103954. // add HTTP headers to the request.
  103955. func (c *RegionHealthCheckServicesDeleteCall) Header() http.Header {
  103956. if c.header_ == nil {
  103957. c.header_ = make(http.Header)
  103958. }
  103959. return c.header_
  103960. }
  103961. func (c *RegionHealthCheckServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  103962. reqHeaders := make(http.Header)
  103963. for k, v := range c.header_ {
  103964. reqHeaders[k] = v
  103965. }
  103966. reqHeaders.Set("User-Agent", c.s.userAgent())
  103967. var body io.Reader = nil
  103968. c.urlParams_.Set("alt", alt)
  103969. c.urlParams_.Set("prettyPrint", "false")
  103970. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices/{healthCheckService}")
  103971. urls += "?" + c.urlParams_.Encode()
  103972. req, err := http.NewRequest("DELETE", urls, body)
  103973. if err != nil {
  103974. return nil, err
  103975. }
  103976. req.Header = reqHeaders
  103977. googleapi.Expand(req.URL, map[string]string{
  103978. "project": c.project,
  103979. "region": c.region,
  103980. "healthCheckService": c.healthCheckService,
  103981. })
  103982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  103983. }
  103984. // Do executes the "compute.regionHealthCheckServices.delete" call.
  103985. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  103986. // status code is an error. Response headers are in either
  103987. // *Operation.ServerResponse.Header or (if a response was returned at
  103988. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  103989. // to check whether the returned error was because
  103990. // http.StatusNotModified was returned.
  103991. func (c *RegionHealthCheckServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  103992. gensupport.SetOptions(c.urlParams_, opts...)
  103993. res, err := c.doRequest("json")
  103994. if res != nil && res.StatusCode == http.StatusNotModified {
  103995. if res.Body != nil {
  103996. res.Body.Close()
  103997. }
  103998. return nil, &googleapi.Error{
  103999. Code: res.StatusCode,
  104000. Header: res.Header,
  104001. }
  104002. }
  104003. if err != nil {
  104004. return nil, err
  104005. }
  104006. defer googleapi.CloseBody(res)
  104007. if err := googleapi.CheckResponse(res); err != nil {
  104008. return nil, err
  104009. }
  104010. ret := &Operation{
  104011. ServerResponse: googleapi.ServerResponse{
  104012. Header: res.Header,
  104013. HTTPStatusCode: res.StatusCode,
  104014. },
  104015. }
  104016. target := &ret
  104017. if err := gensupport.DecodeResponse(target, res); err != nil {
  104018. return nil, err
  104019. }
  104020. return ret, nil
  104021. // {
  104022. // "description": "Deletes the specified regional HealthCheckService.",
  104023. // "httpMethod": "DELETE",
  104024. // "id": "compute.regionHealthCheckServices.delete",
  104025. // "parameterOrder": [
  104026. // "project",
  104027. // "region",
  104028. // "healthCheckService"
  104029. // ],
  104030. // "parameters": {
  104031. // "healthCheckService": {
  104032. // "description": "Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  104033. // "location": "path",
  104034. // "required": true,
  104035. // "type": "string"
  104036. // },
  104037. // "project": {
  104038. // "description": "Project ID for this request.",
  104039. // "location": "path",
  104040. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104041. // "required": true,
  104042. // "type": "string"
  104043. // },
  104044. // "region": {
  104045. // "description": "Name of the region scoping this request.",
  104046. // "location": "path",
  104047. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104048. // "required": true,
  104049. // "type": "string"
  104050. // },
  104051. // "requestId": {
  104052. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104053. // "location": "query",
  104054. // "type": "string"
  104055. // }
  104056. // },
  104057. // "path": "{project}/regions/{region}/healthCheckServices/{healthCheckService}",
  104058. // "response": {
  104059. // "$ref": "Operation"
  104060. // },
  104061. // "scopes": [
  104062. // "https://www.googleapis.com/auth/cloud-platform",
  104063. // "https://www.googleapis.com/auth/compute"
  104064. // ]
  104065. // }
  104066. }
  104067. // method id "compute.regionHealthCheckServices.get":
  104068. type RegionHealthCheckServicesGetCall struct {
  104069. s *Service
  104070. project string
  104071. region string
  104072. healthCheckService string
  104073. urlParams_ gensupport.URLParams
  104074. ifNoneMatch_ string
  104075. ctx_ context.Context
  104076. header_ http.Header
  104077. }
  104078. // Get: Returns the specified regional HealthCheckService resource.
  104079. func (r *RegionHealthCheckServicesService) Get(project string, region string, healthCheckService string) *RegionHealthCheckServicesGetCall {
  104080. c := &RegionHealthCheckServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104081. c.project = project
  104082. c.region = region
  104083. c.healthCheckService = healthCheckService
  104084. return c
  104085. }
  104086. // Fields allows partial responses to be retrieved. See
  104087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104088. // for more information.
  104089. func (c *RegionHealthCheckServicesGetCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesGetCall {
  104090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104091. return c
  104092. }
  104093. // IfNoneMatch sets the optional parameter which makes the operation
  104094. // fail if the object's ETag matches the given value. This is useful for
  104095. // getting updates only after the object has changed since the last
  104096. // request. Use googleapi.IsNotModified to check whether the response
  104097. // error from Do is the result of In-None-Match.
  104098. func (c *RegionHealthCheckServicesGetCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesGetCall {
  104099. c.ifNoneMatch_ = entityTag
  104100. return c
  104101. }
  104102. // Context sets the context to be used in this call's Do method. Any
  104103. // pending HTTP request will be aborted if the provided context is
  104104. // canceled.
  104105. func (c *RegionHealthCheckServicesGetCall) Context(ctx context.Context) *RegionHealthCheckServicesGetCall {
  104106. c.ctx_ = ctx
  104107. return c
  104108. }
  104109. // Header returns an http.Header that can be modified by the caller to
  104110. // add HTTP headers to the request.
  104111. func (c *RegionHealthCheckServicesGetCall) Header() http.Header {
  104112. if c.header_ == nil {
  104113. c.header_ = make(http.Header)
  104114. }
  104115. return c.header_
  104116. }
  104117. func (c *RegionHealthCheckServicesGetCall) doRequest(alt string) (*http.Response, error) {
  104118. reqHeaders := make(http.Header)
  104119. for k, v := range c.header_ {
  104120. reqHeaders[k] = v
  104121. }
  104122. reqHeaders.Set("User-Agent", c.s.userAgent())
  104123. if c.ifNoneMatch_ != "" {
  104124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104125. }
  104126. var body io.Reader = nil
  104127. c.urlParams_.Set("alt", alt)
  104128. c.urlParams_.Set("prettyPrint", "false")
  104129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices/{healthCheckService}")
  104130. urls += "?" + c.urlParams_.Encode()
  104131. req, err := http.NewRequest("GET", urls, body)
  104132. if err != nil {
  104133. return nil, err
  104134. }
  104135. req.Header = reqHeaders
  104136. googleapi.Expand(req.URL, map[string]string{
  104137. "project": c.project,
  104138. "region": c.region,
  104139. "healthCheckService": c.healthCheckService,
  104140. })
  104141. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104142. }
  104143. // Do executes the "compute.regionHealthCheckServices.get" call.
  104144. // Exactly one of *HealthCheckService or error will be non-nil. Any
  104145. // non-2xx status code is an error. Response headers are in either
  104146. // *HealthCheckService.ServerResponse.Header or (if a response was
  104147. // returned at all) in error.(*googleapi.Error).Header. Use
  104148. // googleapi.IsNotModified to check whether the returned error was
  104149. // because http.StatusNotModified was returned.
  104150. func (c *RegionHealthCheckServicesGetCall) Do(opts ...googleapi.CallOption) (*HealthCheckService, error) {
  104151. gensupport.SetOptions(c.urlParams_, opts...)
  104152. res, err := c.doRequest("json")
  104153. if res != nil && res.StatusCode == http.StatusNotModified {
  104154. if res.Body != nil {
  104155. res.Body.Close()
  104156. }
  104157. return nil, &googleapi.Error{
  104158. Code: res.StatusCode,
  104159. Header: res.Header,
  104160. }
  104161. }
  104162. if err != nil {
  104163. return nil, err
  104164. }
  104165. defer googleapi.CloseBody(res)
  104166. if err := googleapi.CheckResponse(res); err != nil {
  104167. return nil, err
  104168. }
  104169. ret := &HealthCheckService{
  104170. ServerResponse: googleapi.ServerResponse{
  104171. Header: res.Header,
  104172. HTTPStatusCode: res.StatusCode,
  104173. },
  104174. }
  104175. target := &ret
  104176. if err := gensupport.DecodeResponse(target, res); err != nil {
  104177. return nil, err
  104178. }
  104179. return ret, nil
  104180. // {
  104181. // "description": "Returns the specified regional HealthCheckService resource.",
  104182. // "httpMethod": "GET",
  104183. // "id": "compute.regionHealthCheckServices.get",
  104184. // "parameterOrder": [
  104185. // "project",
  104186. // "region",
  104187. // "healthCheckService"
  104188. // ],
  104189. // "parameters": {
  104190. // "healthCheckService": {
  104191. // "description": "Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035.",
  104192. // "location": "path",
  104193. // "required": true,
  104194. // "type": "string"
  104195. // },
  104196. // "project": {
  104197. // "description": "Project ID for this request.",
  104198. // "location": "path",
  104199. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104200. // "required": true,
  104201. // "type": "string"
  104202. // },
  104203. // "region": {
  104204. // "description": "Name of the region scoping this request.",
  104205. // "location": "path",
  104206. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104207. // "required": true,
  104208. // "type": "string"
  104209. // }
  104210. // },
  104211. // "path": "{project}/regions/{region}/healthCheckServices/{healthCheckService}",
  104212. // "response": {
  104213. // "$ref": "HealthCheckService"
  104214. // },
  104215. // "scopes": [
  104216. // "https://www.googleapis.com/auth/cloud-platform",
  104217. // "https://www.googleapis.com/auth/compute",
  104218. // "https://www.googleapis.com/auth/compute.readonly"
  104219. // ]
  104220. // }
  104221. }
  104222. // method id "compute.regionHealthCheckServices.insert":
  104223. type RegionHealthCheckServicesInsertCall struct {
  104224. s *Service
  104225. project string
  104226. region string
  104227. healthcheckservice *HealthCheckService
  104228. urlParams_ gensupport.URLParams
  104229. ctx_ context.Context
  104230. header_ http.Header
  104231. }
  104232. // Insert: Creates a regional HealthCheckService resource in the
  104233. // specified project and region using the data included in the request.
  104234. func (r *RegionHealthCheckServicesService) Insert(project string, region string, healthcheckservice *HealthCheckService) *RegionHealthCheckServicesInsertCall {
  104235. c := &RegionHealthCheckServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104236. c.project = project
  104237. c.region = region
  104238. c.healthcheckservice = healthcheckservice
  104239. return c
  104240. }
  104241. // RequestId sets the optional parameter "requestId": An optional
  104242. // request ID to identify requests. Specify a unique request ID so that
  104243. // if you must retry your request, the server will know to ignore the
  104244. // request if it has already been completed.
  104245. //
  104246. // For example, consider a situation where you make an initial request
  104247. // and the request times out. If you make the request again with the
  104248. // same request ID, the server can check if original operation with the
  104249. // same request ID was received, and if so, will ignore the second
  104250. // request. This prevents clients from accidentally creating duplicate
  104251. // commitments.
  104252. //
  104253. // The request ID must be a valid UUID with the exception that zero UUID
  104254. // is not supported (00000000-0000-0000-0000-000000000000).
  104255. func (c *RegionHealthCheckServicesInsertCall) RequestId(requestId string) *RegionHealthCheckServicesInsertCall {
  104256. c.urlParams_.Set("requestId", requestId)
  104257. return c
  104258. }
  104259. // Fields allows partial responses to be retrieved. See
  104260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104261. // for more information.
  104262. func (c *RegionHealthCheckServicesInsertCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesInsertCall {
  104263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104264. return c
  104265. }
  104266. // Context sets the context to be used in this call's Do method. Any
  104267. // pending HTTP request will be aborted if the provided context is
  104268. // canceled.
  104269. func (c *RegionHealthCheckServicesInsertCall) Context(ctx context.Context) *RegionHealthCheckServicesInsertCall {
  104270. c.ctx_ = ctx
  104271. return c
  104272. }
  104273. // Header returns an http.Header that can be modified by the caller to
  104274. // add HTTP headers to the request.
  104275. func (c *RegionHealthCheckServicesInsertCall) Header() http.Header {
  104276. if c.header_ == nil {
  104277. c.header_ = make(http.Header)
  104278. }
  104279. return c.header_
  104280. }
  104281. func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  104282. reqHeaders := make(http.Header)
  104283. for k, v := range c.header_ {
  104284. reqHeaders[k] = v
  104285. }
  104286. reqHeaders.Set("User-Agent", c.s.userAgent())
  104287. var body io.Reader = nil
  104288. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice)
  104289. if err != nil {
  104290. return nil, err
  104291. }
  104292. reqHeaders.Set("Content-Type", "application/json")
  104293. c.urlParams_.Set("alt", alt)
  104294. c.urlParams_.Set("prettyPrint", "false")
  104295. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices")
  104296. urls += "?" + c.urlParams_.Encode()
  104297. req, err := http.NewRequest("POST", urls, body)
  104298. if err != nil {
  104299. return nil, err
  104300. }
  104301. req.Header = reqHeaders
  104302. googleapi.Expand(req.URL, map[string]string{
  104303. "project": c.project,
  104304. "region": c.region,
  104305. })
  104306. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104307. }
  104308. // Do executes the "compute.regionHealthCheckServices.insert" call.
  104309. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104310. // status code is an error. Response headers are in either
  104311. // *Operation.ServerResponse.Header or (if a response was returned at
  104312. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104313. // to check whether the returned error was because
  104314. // http.StatusNotModified was returned.
  104315. func (c *RegionHealthCheckServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104316. gensupport.SetOptions(c.urlParams_, opts...)
  104317. res, err := c.doRequest("json")
  104318. if res != nil && res.StatusCode == http.StatusNotModified {
  104319. if res.Body != nil {
  104320. res.Body.Close()
  104321. }
  104322. return nil, &googleapi.Error{
  104323. Code: res.StatusCode,
  104324. Header: res.Header,
  104325. }
  104326. }
  104327. if err != nil {
  104328. return nil, err
  104329. }
  104330. defer googleapi.CloseBody(res)
  104331. if err := googleapi.CheckResponse(res); err != nil {
  104332. return nil, err
  104333. }
  104334. ret := &Operation{
  104335. ServerResponse: googleapi.ServerResponse{
  104336. Header: res.Header,
  104337. HTTPStatusCode: res.StatusCode,
  104338. },
  104339. }
  104340. target := &ret
  104341. if err := gensupport.DecodeResponse(target, res); err != nil {
  104342. return nil, err
  104343. }
  104344. return ret, nil
  104345. // {
  104346. // "description": "Creates a regional HealthCheckService resource in the specified project and region using the data included in the request.",
  104347. // "httpMethod": "POST",
  104348. // "id": "compute.regionHealthCheckServices.insert",
  104349. // "parameterOrder": [
  104350. // "project",
  104351. // "region"
  104352. // ],
  104353. // "parameters": {
  104354. // "project": {
  104355. // "description": "Project ID for this request.",
  104356. // "location": "path",
  104357. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104358. // "required": true,
  104359. // "type": "string"
  104360. // },
  104361. // "region": {
  104362. // "description": "Name of the region scoping this request.",
  104363. // "location": "path",
  104364. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104365. // "required": true,
  104366. // "type": "string"
  104367. // },
  104368. // "requestId": {
  104369. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104370. // "location": "query",
  104371. // "type": "string"
  104372. // }
  104373. // },
  104374. // "path": "{project}/regions/{region}/healthCheckServices",
  104375. // "request": {
  104376. // "$ref": "HealthCheckService"
  104377. // },
  104378. // "response": {
  104379. // "$ref": "Operation"
  104380. // },
  104381. // "scopes": [
  104382. // "https://www.googleapis.com/auth/cloud-platform",
  104383. // "https://www.googleapis.com/auth/compute"
  104384. // ]
  104385. // }
  104386. }
  104387. // method id "compute.regionHealthCheckServices.list":
  104388. type RegionHealthCheckServicesListCall struct {
  104389. s *Service
  104390. project string
  104391. region string
  104392. urlParams_ gensupport.URLParams
  104393. ifNoneMatch_ string
  104394. ctx_ context.Context
  104395. header_ http.Header
  104396. }
  104397. // List: Lists all the HealthCheckService resources that have been
  104398. // configured for the specified project in the given region.
  104399. func (r *RegionHealthCheckServicesService) List(project string, region string) *RegionHealthCheckServicesListCall {
  104400. c := &RegionHealthCheckServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104401. c.project = project
  104402. c.region = region
  104403. return c
  104404. }
  104405. // Filter sets the optional parameter "filter": A filter expression that
  104406. // filters resources listed in the response. The expression must specify
  104407. // the field name, a comparison operator, and the value that you want to
  104408. // use for filtering. The value must be a string, a number, or a
  104409. // boolean. The comparison operator must be either =, !=, >, or <.
  104410. //
  104411. // For example, if you are filtering Compute Engine instances, you can
  104412. // exclude instances named example-instance by specifying name !=
  104413. // example-instance.
  104414. //
  104415. // You can also filter nested fields. For example, you could specify
  104416. // scheduling.automaticRestart = false to include instances only if they
  104417. // are not scheduled for automatic restarts. You can use filtering on
  104418. // nested fields to filter based on resource labels.
  104419. //
  104420. // To filter on multiple expressions, provide each separate expression
  104421. // within parentheses. For example, (scheduling.automaticRestart = true)
  104422. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  104423. // AND expression. However, you can include AND and OR expressions
  104424. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  104425. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  104426. // true).
  104427. func (c *RegionHealthCheckServicesListCall) Filter(filter string) *RegionHealthCheckServicesListCall {
  104428. c.urlParams_.Set("filter", filter)
  104429. return c
  104430. }
  104431. // MaxResults sets the optional parameter "maxResults": The maximum
  104432. // number of results per page that should be returned. If the number of
  104433. // available results is larger than maxResults, Compute Engine returns a
  104434. // nextPageToken that can be used to get the next page of results in
  104435. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  104436. // (Default: 500)
  104437. func (c *RegionHealthCheckServicesListCall) MaxResults(maxResults int64) *RegionHealthCheckServicesListCall {
  104438. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  104439. return c
  104440. }
  104441. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  104442. // a certain order. By default, results are returned in alphanumerical
  104443. // order based on the resource name.
  104444. //
  104445. // You can also sort results in descending order based on the creation
  104446. // timestamp using orderBy="creationTimestamp desc". This sorts results
  104447. // based on the creationTimestamp field in reverse chronological order
  104448. // (newest result first). Use this to sort resources like operations so
  104449. // that the newest operation is returned first.
  104450. //
  104451. // Currently, only sorting by name or creationTimestamp desc is
  104452. // supported.
  104453. func (c *RegionHealthCheckServicesListCall) OrderBy(orderBy string) *RegionHealthCheckServicesListCall {
  104454. c.urlParams_.Set("orderBy", orderBy)
  104455. return c
  104456. }
  104457. // PageToken sets the optional parameter "pageToken": Specifies a page
  104458. // token to use. Set pageToken to the nextPageToken returned by a
  104459. // previous list request to get the next page of results.
  104460. func (c *RegionHealthCheckServicesListCall) PageToken(pageToken string) *RegionHealthCheckServicesListCall {
  104461. c.urlParams_.Set("pageToken", pageToken)
  104462. return c
  104463. }
  104464. // Fields allows partial responses to be retrieved. See
  104465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104466. // for more information.
  104467. func (c *RegionHealthCheckServicesListCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesListCall {
  104468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104469. return c
  104470. }
  104471. // IfNoneMatch sets the optional parameter which makes the operation
  104472. // fail if the object's ETag matches the given value. This is useful for
  104473. // getting updates only after the object has changed since the last
  104474. // request. Use googleapi.IsNotModified to check whether the response
  104475. // error from Do is the result of In-None-Match.
  104476. func (c *RegionHealthCheckServicesListCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesListCall {
  104477. c.ifNoneMatch_ = entityTag
  104478. return c
  104479. }
  104480. // Context sets the context to be used in this call's Do method. Any
  104481. // pending HTTP request will be aborted if the provided context is
  104482. // canceled.
  104483. func (c *RegionHealthCheckServicesListCall) Context(ctx context.Context) *RegionHealthCheckServicesListCall {
  104484. c.ctx_ = ctx
  104485. return c
  104486. }
  104487. // Header returns an http.Header that can be modified by the caller to
  104488. // add HTTP headers to the request.
  104489. func (c *RegionHealthCheckServicesListCall) Header() http.Header {
  104490. if c.header_ == nil {
  104491. c.header_ = make(http.Header)
  104492. }
  104493. return c.header_
  104494. }
  104495. func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Response, error) {
  104496. reqHeaders := make(http.Header)
  104497. for k, v := range c.header_ {
  104498. reqHeaders[k] = v
  104499. }
  104500. reqHeaders.Set("User-Agent", c.s.userAgent())
  104501. if c.ifNoneMatch_ != "" {
  104502. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  104503. }
  104504. var body io.Reader = nil
  104505. c.urlParams_.Set("alt", alt)
  104506. c.urlParams_.Set("prettyPrint", "false")
  104507. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices")
  104508. urls += "?" + c.urlParams_.Encode()
  104509. req, err := http.NewRequest("GET", urls, body)
  104510. if err != nil {
  104511. return nil, err
  104512. }
  104513. req.Header = reqHeaders
  104514. googleapi.Expand(req.URL, map[string]string{
  104515. "project": c.project,
  104516. "region": c.region,
  104517. })
  104518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104519. }
  104520. // Do executes the "compute.regionHealthCheckServices.list" call.
  104521. // Exactly one of *HealthCheckServicesList or error will be non-nil. Any
  104522. // non-2xx status code is an error. Response headers are in either
  104523. // *HealthCheckServicesList.ServerResponse.Header or (if a response was
  104524. // returned at all) in error.(*googleapi.Error).Header. Use
  104525. // googleapi.IsNotModified to check whether the returned error was
  104526. // because http.StatusNotModified was returned.
  104527. func (c *RegionHealthCheckServicesListCall) Do(opts ...googleapi.CallOption) (*HealthCheckServicesList, error) {
  104528. gensupport.SetOptions(c.urlParams_, opts...)
  104529. res, err := c.doRequest("json")
  104530. if res != nil && res.StatusCode == http.StatusNotModified {
  104531. if res.Body != nil {
  104532. res.Body.Close()
  104533. }
  104534. return nil, &googleapi.Error{
  104535. Code: res.StatusCode,
  104536. Header: res.Header,
  104537. }
  104538. }
  104539. if err != nil {
  104540. return nil, err
  104541. }
  104542. defer googleapi.CloseBody(res)
  104543. if err := googleapi.CheckResponse(res); err != nil {
  104544. return nil, err
  104545. }
  104546. ret := &HealthCheckServicesList{
  104547. ServerResponse: googleapi.ServerResponse{
  104548. Header: res.Header,
  104549. HTTPStatusCode: res.StatusCode,
  104550. },
  104551. }
  104552. target := &ret
  104553. if err := gensupport.DecodeResponse(target, res); err != nil {
  104554. return nil, err
  104555. }
  104556. return ret, nil
  104557. // {
  104558. // "description": "Lists all the HealthCheckService resources that have been configured for the specified project in the given region.",
  104559. // "httpMethod": "GET",
  104560. // "id": "compute.regionHealthCheckServices.list",
  104561. // "parameterOrder": [
  104562. // "project",
  104563. // "region"
  104564. // ],
  104565. // "parameters": {
  104566. // "filter": {
  104567. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  104568. // "location": "query",
  104569. // "type": "string"
  104570. // },
  104571. // "maxResults": {
  104572. // "default": "500",
  104573. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  104574. // "format": "uint32",
  104575. // "location": "query",
  104576. // "minimum": "0",
  104577. // "type": "integer"
  104578. // },
  104579. // "orderBy": {
  104580. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  104581. // "location": "query",
  104582. // "type": "string"
  104583. // },
  104584. // "pageToken": {
  104585. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  104586. // "location": "query",
  104587. // "type": "string"
  104588. // },
  104589. // "project": {
  104590. // "description": "Project ID for this request.",
  104591. // "location": "path",
  104592. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104593. // "required": true,
  104594. // "type": "string"
  104595. // },
  104596. // "region": {
  104597. // "description": "Name of the region scoping this request.",
  104598. // "location": "path",
  104599. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104600. // "required": true,
  104601. // "type": "string"
  104602. // }
  104603. // },
  104604. // "path": "{project}/regions/{region}/healthCheckServices",
  104605. // "response": {
  104606. // "$ref": "HealthCheckServicesList"
  104607. // },
  104608. // "scopes": [
  104609. // "https://www.googleapis.com/auth/cloud-platform",
  104610. // "https://www.googleapis.com/auth/compute",
  104611. // "https://www.googleapis.com/auth/compute.readonly"
  104612. // ]
  104613. // }
  104614. }
  104615. // Pages invokes f for each page of results.
  104616. // A non-nil error returned from f will halt the iteration.
  104617. // The provided context supersedes any context provided to the Context method.
  104618. func (c *RegionHealthCheckServicesListCall) Pages(ctx context.Context, f func(*HealthCheckServicesList) error) error {
  104619. c.ctx_ = ctx
  104620. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  104621. for {
  104622. x, err := c.Do()
  104623. if err != nil {
  104624. return err
  104625. }
  104626. if err := f(x); err != nil {
  104627. return err
  104628. }
  104629. if x.NextPageToken == "" {
  104630. return nil
  104631. }
  104632. c.PageToken(x.NextPageToken)
  104633. }
  104634. }
  104635. // method id "compute.regionHealthCheckServices.testIamPermissions":
  104636. type RegionHealthCheckServicesTestIamPermissionsCall struct {
  104637. s *Service
  104638. project string
  104639. region string
  104640. resource string
  104641. testpermissionsrequest *TestPermissionsRequest
  104642. urlParams_ gensupport.URLParams
  104643. ctx_ context.Context
  104644. header_ http.Header
  104645. }
  104646. // TestIamPermissions: Returns permissions that a caller has on the
  104647. // specified resource.
  104648. func (r *RegionHealthCheckServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionHealthCheckServicesTestIamPermissionsCall {
  104649. c := &RegionHealthCheckServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104650. c.project = project
  104651. c.region = region
  104652. c.resource = resource
  104653. c.testpermissionsrequest = testpermissionsrequest
  104654. return c
  104655. }
  104656. // Fields allows partial responses to be retrieved. See
  104657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104658. // for more information.
  104659. func (c *RegionHealthCheckServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesTestIamPermissionsCall {
  104660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104661. return c
  104662. }
  104663. // Context sets the context to be used in this call's Do method. Any
  104664. // pending HTTP request will be aborted if the provided context is
  104665. // canceled.
  104666. func (c *RegionHealthCheckServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionHealthCheckServicesTestIamPermissionsCall {
  104667. c.ctx_ = ctx
  104668. return c
  104669. }
  104670. // Header returns an http.Header that can be modified by the caller to
  104671. // add HTTP headers to the request.
  104672. func (c *RegionHealthCheckServicesTestIamPermissionsCall) Header() http.Header {
  104673. if c.header_ == nil {
  104674. c.header_ = make(http.Header)
  104675. }
  104676. return c.header_
  104677. }
  104678. func (c *RegionHealthCheckServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  104679. reqHeaders := make(http.Header)
  104680. for k, v := range c.header_ {
  104681. reqHeaders[k] = v
  104682. }
  104683. reqHeaders.Set("User-Agent", c.s.userAgent())
  104684. var body io.Reader = nil
  104685. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  104686. if err != nil {
  104687. return nil, err
  104688. }
  104689. reqHeaders.Set("Content-Type", "application/json")
  104690. c.urlParams_.Set("alt", alt)
  104691. c.urlParams_.Set("prettyPrint", "false")
  104692. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthCheckServices/{resource}/testIamPermissions")
  104693. urls += "?" + c.urlParams_.Encode()
  104694. req, err := http.NewRequest("POST", urls, body)
  104695. if err != nil {
  104696. return nil, err
  104697. }
  104698. req.Header = reqHeaders
  104699. googleapi.Expand(req.URL, map[string]string{
  104700. "project": c.project,
  104701. "region": c.region,
  104702. "resource": c.resource,
  104703. })
  104704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104705. }
  104706. // Do executes the "compute.regionHealthCheckServices.testIamPermissions" call.
  104707. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  104708. // non-2xx status code is an error. Response headers are in either
  104709. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  104710. // returned at all) in error.(*googleapi.Error).Header. Use
  104711. // googleapi.IsNotModified to check whether the returned error was
  104712. // because http.StatusNotModified was returned.
  104713. func (c *RegionHealthCheckServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  104714. gensupport.SetOptions(c.urlParams_, opts...)
  104715. res, err := c.doRequest("json")
  104716. if res != nil && res.StatusCode == http.StatusNotModified {
  104717. if res.Body != nil {
  104718. res.Body.Close()
  104719. }
  104720. return nil, &googleapi.Error{
  104721. Code: res.StatusCode,
  104722. Header: res.Header,
  104723. }
  104724. }
  104725. if err != nil {
  104726. return nil, err
  104727. }
  104728. defer googleapi.CloseBody(res)
  104729. if err := googleapi.CheckResponse(res); err != nil {
  104730. return nil, err
  104731. }
  104732. ret := &TestPermissionsResponse{
  104733. ServerResponse: googleapi.ServerResponse{
  104734. Header: res.Header,
  104735. HTTPStatusCode: res.StatusCode,
  104736. },
  104737. }
  104738. target := &ret
  104739. if err := gensupport.DecodeResponse(target, res); err != nil {
  104740. return nil, err
  104741. }
  104742. return ret, nil
  104743. // {
  104744. // "description": "Returns permissions that a caller has on the specified resource.",
  104745. // "httpMethod": "POST",
  104746. // "id": "compute.regionHealthCheckServices.testIamPermissions",
  104747. // "parameterOrder": [
  104748. // "project",
  104749. // "region",
  104750. // "resource"
  104751. // ],
  104752. // "parameters": {
  104753. // "project": {
  104754. // "description": "Project ID for this request.",
  104755. // "location": "path",
  104756. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104757. // "required": true,
  104758. // "type": "string"
  104759. // },
  104760. // "region": {
  104761. // "description": "The name of the region for this request.",
  104762. // "location": "path",
  104763. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104764. // "required": true,
  104765. // "type": "string"
  104766. // },
  104767. // "resource": {
  104768. // "description": "Name or id of the resource for this request.",
  104769. // "location": "path",
  104770. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104771. // "required": true,
  104772. // "type": "string"
  104773. // }
  104774. // },
  104775. // "path": "{project}/regions/{region}/healthCheckServices/{resource}/testIamPermissions",
  104776. // "request": {
  104777. // "$ref": "TestPermissionsRequest"
  104778. // },
  104779. // "response": {
  104780. // "$ref": "TestPermissionsResponse"
  104781. // },
  104782. // "scopes": [
  104783. // "https://www.googleapis.com/auth/cloud-platform",
  104784. // "https://www.googleapis.com/auth/compute",
  104785. // "https://www.googleapis.com/auth/compute.readonly"
  104786. // ]
  104787. // }
  104788. }
  104789. // method id "compute.regionHealthChecks.delete":
  104790. type RegionHealthChecksDeleteCall struct {
  104791. s *Service
  104792. project string
  104793. region string
  104794. healthCheck string
  104795. urlParams_ gensupport.URLParams
  104796. ctx_ context.Context
  104797. header_ http.Header
  104798. }
  104799. // Delete: Deletes the specified HealthCheck resource.
  104800. func (r *RegionHealthChecksService) Delete(project string, region string, healthCheck string) *RegionHealthChecksDeleteCall {
  104801. c := &RegionHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104802. c.project = project
  104803. c.region = region
  104804. c.healthCheck = healthCheck
  104805. return c
  104806. }
  104807. // RequestId sets the optional parameter "requestId": An optional
  104808. // request ID to identify requests. Specify a unique request ID so that
  104809. // if you must retry your request, the server will know to ignore the
  104810. // request if it has already been completed.
  104811. //
  104812. // For example, consider a situation where you make an initial request
  104813. // and the request times out. If you make the request again with the
  104814. // same request ID, the server can check if original operation with the
  104815. // same request ID was received, and if so, will ignore the second
  104816. // request. This prevents clients from accidentally creating duplicate
  104817. // commitments.
  104818. //
  104819. // The request ID must be a valid UUID with the exception that zero UUID
  104820. // is not supported (00000000-0000-0000-0000-000000000000).
  104821. func (c *RegionHealthChecksDeleteCall) RequestId(requestId string) *RegionHealthChecksDeleteCall {
  104822. c.urlParams_.Set("requestId", requestId)
  104823. return c
  104824. }
  104825. // Fields allows partial responses to be retrieved. See
  104826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104827. // for more information.
  104828. func (c *RegionHealthChecksDeleteCall) Fields(s ...googleapi.Field) *RegionHealthChecksDeleteCall {
  104829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104830. return c
  104831. }
  104832. // Context sets the context to be used in this call's Do method. Any
  104833. // pending HTTP request will be aborted if the provided context is
  104834. // canceled.
  104835. func (c *RegionHealthChecksDeleteCall) Context(ctx context.Context) *RegionHealthChecksDeleteCall {
  104836. c.ctx_ = ctx
  104837. return c
  104838. }
  104839. // Header returns an http.Header that can be modified by the caller to
  104840. // add HTTP headers to the request.
  104841. func (c *RegionHealthChecksDeleteCall) Header() http.Header {
  104842. if c.header_ == nil {
  104843. c.header_ = make(http.Header)
  104844. }
  104845. return c.header_
  104846. }
  104847. func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  104848. reqHeaders := make(http.Header)
  104849. for k, v := range c.header_ {
  104850. reqHeaders[k] = v
  104851. }
  104852. reqHeaders.Set("User-Agent", c.s.userAgent())
  104853. var body io.Reader = nil
  104854. c.urlParams_.Set("alt", alt)
  104855. c.urlParams_.Set("prettyPrint", "false")
  104856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  104857. urls += "?" + c.urlParams_.Encode()
  104858. req, err := http.NewRequest("DELETE", urls, body)
  104859. if err != nil {
  104860. return nil, err
  104861. }
  104862. req.Header = reqHeaders
  104863. googleapi.Expand(req.URL, map[string]string{
  104864. "project": c.project,
  104865. "region": c.region,
  104866. "healthCheck": c.healthCheck,
  104867. })
  104868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  104869. }
  104870. // Do executes the "compute.regionHealthChecks.delete" call.
  104871. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  104872. // status code is an error. Response headers are in either
  104873. // *Operation.ServerResponse.Header or (if a response was returned at
  104874. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  104875. // to check whether the returned error was because
  104876. // http.StatusNotModified was returned.
  104877. func (c *RegionHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  104878. gensupport.SetOptions(c.urlParams_, opts...)
  104879. res, err := c.doRequest("json")
  104880. if res != nil && res.StatusCode == http.StatusNotModified {
  104881. if res.Body != nil {
  104882. res.Body.Close()
  104883. }
  104884. return nil, &googleapi.Error{
  104885. Code: res.StatusCode,
  104886. Header: res.Header,
  104887. }
  104888. }
  104889. if err != nil {
  104890. return nil, err
  104891. }
  104892. defer googleapi.CloseBody(res)
  104893. if err := googleapi.CheckResponse(res); err != nil {
  104894. return nil, err
  104895. }
  104896. ret := &Operation{
  104897. ServerResponse: googleapi.ServerResponse{
  104898. Header: res.Header,
  104899. HTTPStatusCode: res.StatusCode,
  104900. },
  104901. }
  104902. target := &ret
  104903. if err := gensupport.DecodeResponse(target, res); err != nil {
  104904. return nil, err
  104905. }
  104906. return ret, nil
  104907. // {
  104908. // "description": "Deletes the specified HealthCheck resource.",
  104909. // "httpMethod": "DELETE",
  104910. // "id": "compute.regionHealthChecks.delete",
  104911. // "parameterOrder": [
  104912. // "project",
  104913. // "region",
  104914. // "healthCheck"
  104915. // ],
  104916. // "parameters": {
  104917. // "healthCheck": {
  104918. // "description": "Name of the HealthCheck resource to delete.",
  104919. // "location": "path",
  104920. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  104921. // "required": true,
  104922. // "type": "string"
  104923. // },
  104924. // "project": {
  104925. // "description": "Project ID for this request.",
  104926. // "location": "path",
  104927. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  104928. // "required": true,
  104929. // "type": "string"
  104930. // },
  104931. // "region": {
  104932. // "description": "Name of the region scoping this request.",
  104933. // "location": "path",
  104934. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  104935. // "required": true,
  104936. // "type": "string"
  104937. // },
  104938. // "requestId": {
  104939. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  104940. // "location": "query",
  104941. // "type": "string"
  104942. // }
  104943. // },
  104944. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  104945. // "response": {
  104946. // "$ref": "Operation"
  104947. // },
  104948. // "scopes": [
  104949. // "https://www.googleapis.com/auth/cloud-platform",
  104950. // "https://www.googleapis.com/auth/compute"
  104951. // ]
  104952. // }
  104953. }
  104954. // method id "compute.regionHealthChecks.get":
  104955. type RegionHealthChecksGetCall struct {
  104956. s *Service
  104957. project string
  104958. region string
  104959. healthCheck string
  104960. urlParams_ gensupport.URLParams
  104961. ifNoneMatch_ string
  104962. ctx_ context.Context
  104963. header_ http.Header
  104964. }
  104965. // Get: Returns the specified HealthCheck resource. Gets a list of
  104966. // available health checks by making a list() request.
  104967. func (r *RegionHealthChecksService) Get(project string, region string, healthCheck string) *RegionHealthChecksGetCall {
  104968. c := &RegionHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  104969. c.project = project
  104970. c.region = region
  104971. c.healthCheck = healthCheck
  104972. return c
  104973. }
  104974. // Fields allows partial responses to be retrieved. See
  104975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  104976. // for more information.
  104977. func (c *RegionHealthChecksGetCall) Fields(s ...googleapi.Field) *RegionHealthChecksGetCall {
  104978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  104979. return c
  104980. }
  104981. // IfNoneMatch sets the optional parameter which makes the operation
  104982. // fail if the object's ETag matches the given value. This is useful for
  104983. // getting updates only after the object has changed since the last
  104984. // request. Use googleapi.IsNotModified to check whether the response
  104985. // error from Do is the result of In-None-Match.
  104986. func (c *RegionHealthChecksGetCall) IfNoneMatch(entityTag string) *RegionHealthChecksGetCall {
  104987. c.ifNoneMatch_ = entityTag
  104988. return c
  104989. }
  104990. // Context sets the context to be used in this call's Do method. Any
  104991. // pending HTTP request will be aborted if the provided context is
  104992. // canceled.
  104993. func (c *RegionHealthChecksGetCall) Context(ctx context.Context) *RegionHealthChecksGetCall {
  104994. c.ctx_ = ctx
  104995. return c
  104996. }
  104997. // Header returns an http.Header that can be modified by the caller to
  104998. // add HTTP headers to the request.
  104999. func (c *RegionHealthChecksGetCall) Header() http.Header {
  105000. if c.header_ == nil {
  105001. c.header_ = make(http.Header)
  105002. }
  105003. return c.header_
  105004. }
  105005. func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  105006. reqHeaders := make(http.Header)
  105007. for k, v := range c.header_ {
  105008. reqHeaders[k] = v
  105009. }
  105010. reqHeaders.Set("User-Agent", c.s.userAgent())
  105011. if c.ifNoneMatch_ != "" {
  105012. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105013. }
  105014. var body io.Reader = nil
  105015. c.urlParams_.Set("alt", alt)
  105016. c.urlParams_.Set("prettyPrint", "false")
  105017. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  105018. urls += "?" + c.urlParams_.Encode()
  105019. req, err := http.NewRequest("GET", urls, body)
  105020. if err != nil {
  105021. return nil, err
  105022. }
  105023. req.Header = reqHeaders
  105024. googleapi.Expand(req.URL, map[string]string{
  105025. "project": c.project,
  105026. "region": c.region,
  105027. "healthCheck": c.healthCheck,
  105028. })
  105029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105030. }
  105031. // Do executes the "compute.regionHealthChecks.get" call.
  105032. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  105033. // status code is an error. Response headers are in either
  105034. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  105035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105036. // to check whether the returned error was because
  105037. // http.StatusNotModified was returned.
  105038. func (c *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  105039. gensupport.SetOptions(c.urlParams_, opts...)
  105040. res, err := c.doRequest("json")
  105041. if res != nil && res.StatusCode == http.StatusNotModified {
  105042. if res.Body != nil {
  105043. res.Body.Close()
  105044. }
  105045. return nil, &googleapi.Error{
  105046. Code: res.StatusCode,
  105047. Header: res.Header,
  105048. }
  105049. }
  105050. if err != nil {
  105051. return nil, err
  105052. }
  105053. defer googleapi.CloseBody(res)
  105054. if err := googleapi.CheckResponse(res); err != nil {
  105055. return nil, err
  105056. }
  105057. ret := &HealthCheck{
  105058. ServerResponse: googleapi.ServerResponse{
  105059. Header: res.Header,
  105060. HTTPStatusCode: res.StatusCode,
  105061. },
  105062. }
  105063. target := &ret
  105064. if err := gensupport.DecodeResponse(target, res); err != nil {
  105065. return nil, err
  105066. }
  105067. return ret, nil
  105068. // {
  105069. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  105070. // "httpMethod": "GET",
  105071. // "id": "compute.regionHealthChecks.get",
  105072. // "parameterOrder": [
  105073. // "project",
  105074. // "region",
  105075. // "healthCheck"
  105076. // ],
  105077. // "parameters": {
  105078. // "healthCheck": {
  105079. // "description": "Name of the HealthCheck resource to return.",
  105080. // "location": "path",
  105081. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105082. // "required": true,
  105083. // "type": "string"
  105084. // },
  105085. // "project": {
  105086. // "description": "Project ID for this request.",
  105087. // "location": "path",
  105088. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105089. // "required": true,
  105090. // "type": "string"
  105091. // },
  105092. // "region": {
  105093. // "description": "Name of the region scoping this request.",
  105094. // "location": "path",
  105095. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105096. // "required": true,
  105097. // "type": "string"
  105098. // }
  105099. // },
  105100. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  105101. // "response": {
  105102. // "$ref": "HealthCheck"
  105103. // },
  105104. // "scopes": [
  105105. // "https://www.googleapis.com/auth/cloud-platform",
  105106. // "https://www.googleapis.com/auth/compute",
  105107. // "https://www.googleapis.com/auth/compute.readonly"
  105108. // ]
  105109. // }
  105110. }
  105111. // method id "compute.regionHealthChecks.insert":
  105112. type RegionHealthChecksInsertCall struct {
  105113. s *Service
  105114. project string
  105115. region string
  105116. healthcheck *HealthCheck
  105117. urlParams_ gensupport.URLParams
  105118. ctx_ context.Context
  105119. header_ http.Header
  105120. }
  105121. // Insert: Creates a HealthCheck resource in the specified project using
  105122. // the data included in the request.
  105123. func (r *RegionHealthChecksService) Insert(project string, region string, healthcheck *HealthCheck) *RegionHealthChecksInsertCall {
  105124. c := &RegionHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105125. c.project = project
  105126. c.region = region
  105127. c.healthcheck = healthcheck
  105128. return c
  105129. }
  105130. // RequestId sets the optional parameter "requestId": An optional
  105131. // request ID to identify requests. Specify a unique request ID so that
  105132. // if you must retry your request, the server will know to ignore the
  105133. // request if it has already been completed.
  105134. //
  105135. // For example, consider a situation where you make an initial request
  105136. // and the request times out. If you make the request again with the
  105137. // same request ID, the server can check if original operation with the
  105138. // same request ID was received, and if so, will ignore the second
  105139. // request. This prevents clients from accidentally creating duplicate
  105140. // commitments.
  105141. //
  105142. // The request ID must be a valid UUID with the exception that zero UUID
  105143. // is not supported (00000000-0000-0000-0000-000000000000).
  105144. func (c *RegionHealthChecksInsertCall) RequestId(requestId string) *RegionHealthChecksInsertCall {
  105145. c.urlParams_.Set("requestId", requestId)
  105146. return c
  105147. }
  105148. // Fields allows partial responses to be retrieved. See
  105149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105150. // for more information.
  105151. func (c *RegionHealthChecksInsertCall) Fields(s ...googleapi.Field) *RegionHealthChecksInsertCall {
  105152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105153. return c
  105154. }
  105155. // Context sets the context to be used in this call's Do method. Any
  105156. // pending HTTP request will be aborted if the provided context is
  105157. // canceled.
  105158. func (c *RegionHealthChecksInsertCall) Context(ctx context.Context) *RegionHealthChecksInsertCall {
  105159. c.ctx_ = ctx
  105160. return c
  105161. }
  105162. // Header returns an http.Header that can be modified by the caller to
  105163. // add HTTP headers to the request.
  105164. func (c *RegionHealthChecksInsertCall) Header() http.Header {
  105165. if c.header_ == nil {
  105166. c.header_ = make(http.Header)
  105167. }
  105168. return c.header_
  105169. }
  105170. func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  105171. reqHeaders := make(http.Header)
  105172. for k, v := range c.header_ {
  105173. reqHeaders[k] = v
  105174. }
  105175. reqHeaders.Set("User-Agent", c.s.userAgent())
  105176. var body io.Reader = nil
  105177. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  105178. if err != nil {
  105179. return nil, err
  105180. }
  105181. reqHeaders.Set("Content-Type", "application/json")
  105182. c.urlParams_.Set("alt", alt)
  105183. c.urlParams_.Set("prettyPrint", "false")
  105184. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks")
  105185. urls += "?" + c.urlParams_.Encode()
  105186. req, err := http.NewRequest("POST", urls, body)
  105187. if err != nil {
  105188. return nil, err
  105189. }
  105190. req.Header = reqHeaders
  105191. googleapi.Expand(req.URL, map[string]string{
  105192. "project": c.project,
  105193. "region": c.region,
  105194. })
  105195. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105196. }
  105197. // Do executes the "compute.regionHealthChecks.insert" call.
  105198. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105199. // status code is an error. Response headers are in either
  105200. // *Operation.ServerResponse.Header or (if a response was returned at
  105201. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105202. // to check whether the returned error was because
  105203. // http.StatusNotModified was returned.
  105204. func (c *RegionHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105205. gensupport.SetOptions(c.urlParams_, opts...)
  105206. res, err := c.doRequest("json")
  105207. if res != nil && res.StatusCode == http.StatusNotModified {
  105208. if res.Body != nil {
  105209. res.Body.Close()
  105210. }
  105211. return nil, &googleapi.Error{
  105212. Code: res.StatusCode,
  105213. Header: res.Header,
  105214. }
  105215. }
  105216. if err != nil {
  105217. return nil, err
  105218. }
  105219. defer googleapi.CloseBody(res)
  105220. if err := googleapi.CheckResponse(res); err != nil {
  105221. return nil, err
  105222. }
  105223. ret := &Operation{
  105224. ServerResponse: googleapi.ServerResponse{
  105225. Header: res.Header,
  105226. HTTPStatusCode: res.StatusCode,
  105227. },
  105228. }
  105229. target := &ret
  105230. if err := gensupport.DecodeResponse(target, res); err != nil {
  105231. return nil, err
  105232. }
  105233. return ret, nil
  105234. // {
  105235. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  105236. // "httpMethod": "POST",
  105237. // "id": "compute.regionHealthChecks.insert",
  105238. // "parameterOrder": [
  105239. // "project",
  105240. // "region"
  105241. // ],
  105242. // "parameters": {
  105243. // "project": {
  105244. // "description": "Project ID for this request.",
  105245. // "location": "path",
  105246. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105247. // "required": true,
  105248. // "type": "string"
  105249. // },
  105250. // "region": {
  105251. // "description": "Name of the region scoping this request.",
  105252. // "location": "path",
  105253. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105254. // "required": true,
  105255. // "type": "string"
  105256. // },
  105257. // "requestId": {
  105258. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105259. // "location": "query",
  105260. // "type": "string"
  105261. // }
  105262. // },
  105263. // "path": "{project}/regions/{region}/healthChecks",
  105264. // "request": {
  105265. // "$ref": "HealthCheck"
  105266. // },
  105267. // "response": {
  105268. // "$ref": "Operation"
  105269. // },
  105270. // "scopes": [
  105271. // "https://www.googleapis.com/auth/cloud-platform",
  105272. // "https://www.googleapis.com/auth/compute"
  105273. // ]
  105274. // }
  105275. }
  105276. // method id "compute.regionHealthChecks.list":
  105277. type RegionHealthChecksListCall struct {
  105278. s *Service
  105279. project string
  105280. region string
  105281. urlParams_ gensupport.URLParams
  105282. ifNoneMatch_ string
  105283. ctx_ context.Context
  105284. header_ http.Header
  105285. }
  105286. // List: Retrieves the list of HealthCheck resources available to the
  105287. // specified project.
  105288. func (r *RegionHealthChecksService) List(project string, region string) *RegionHealthChecksListCall {
  105289. c := &RegionHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105290. c.project = project
  105291. c.region = region
  105292. return c
  105293. }
  105294. // Filter sets the optional parameter "filter": A filter expression that
  105295. // filters resources listed in the response. The expression must specify
  105296. // the field name, a comparison operator, and the value that you want to
  105297. // use for filtering. The value must be a string, a number, or a
  105298. // boolean. The comparison operator must be either =, !=, >, or <.
  105299. //
  105300. // For example, if you are filtering Compute Engine instances, you can
  105301. // exclude instances named example-instance by specifying name !=
  105302. // example-instance.
  105303. //
  105304. // You can also filter nested fields. For example, you could specify
  105305. // scheduling.automaticRestart = false to include instances only if they
  105306. // are not scheduled for automatic restarts. You can use filtering on
  105307. // nested fields to filter based on resource labels.
  105308. //
  105309. // To filter on multiple expressions, provide each separate expression
  105310. // within parentheses. For example, (scheduling.automaticRestart = true)
  105311. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  105312. // AND expression. However, you can include AND and OR expressions
  105313. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  105314. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  105315. // true).
  105316. func (c *RegionHealthChecksListCall) Filter(filter string) *RegionHealthChecksListCall {
  105317. c.urlParams_.Set("filter", filter)
  105318. return c
  105319. }
  105320. // MaxResults sets the optional parameter "maxResults": The maximum
  105321. // number of results per page that should be returned. If the number of
  105322. // available results is larger than maxResults, Compute Engine returns a
  105323. // nextPageToken that can be used to get the next page of results in
  105324. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  105325. // (Default: 500)
  105326. func (c *RegionHealthChecksListCall) MaxResults(maxResults int64) *RegionHealthChecksListCall {
  105327. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  105328. return c
  105329. }
  105330. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  105331. // a certain order. By default, results are returned in alphanumerical
  105332. // order based on the resource name.
  105333. //
  105334. // You can also sort results in descending order based on the creation
  105335. // timestamp using orderBy="creationTimestamp desc". This sorts results
  105336. // based on the creationTimestamp field in reverse chronological order
  105337. // (newest result first). Use this to sort resources like operations so
  105338. // that the newest operation is returned first.
  105339. //
  105340. // Currently, only sorting by name or creationTimestamp desc is
  105341. // supported.
  105342. func (c *RegionHealthChecksListCall) OrderBy(orderBy string) *RegionHealthChecksListCall {
  105343. c.urlParams_.Set("orderBy", orderBy)
  105344. return c
  105345. }
  105346. // PageToken sets the optional parameter "pageToken": Specifies a page
  105347. // token to use. Set pageToken to the nextPageToken returned by a
  105348. // previous list request to get the next page of results.
  105349. func (c *RegionHealthChecksListCall) PageToken(pageToken string) *RegionHealthChecksListCall {
  105350. c.urlParams_.Set("pageToken", pageToken)
  105351. return c
  105352. }
  105353. // Fields allows partial responses to be retrieved. See
  105354. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105355. // for more information.
  105356. func (c *RegionHealthChecksListCall) Fields(s ...googleapi.Field) *RegionHealthChecksListCall {
  105357. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105358. return c
  105359. }
  105360. // IfNoneMatch sets the optional parameter which makes the operation
  105361. // fail if the object's ETag matches the given value. This is useful for
  105362. // getting updates only after the object has changed since the last
  105363. // request. Use googleapi.IsNotModified to check whether the response
  105364. // error from Do is the result of In-None-Match.
  105365. func (c *RegionHealthChecksListCall) IfNoneMatch(entityTag string) *RegionHealthChecksListCall {
  105366. c.ifNoneMatch_ = entityTag
  105367. return c
  105368. }
  105369. // Context sets the context to be used in this call's Do method. Any
  105370. // pending HTTP request will be aborted if the provided context is
  105371. // canceled.
  105372. func (c *RegionHealthChecksListCall) Context(ctx context.Context) *RegionHealthChecksListCall {
  105373. c.ctx_ = ctx
  105374. return c
  105375. }
  105376. // Header returns an http.Header that can be modified by the caller to
  105377. // add HTTP headers to the request.
  105378. func (c *RegionHealthChecksListCall) Header() http.Header {
  105379. if c.header_ == nil {
  105380. c.header_ = make(http.Header)
  105381. }
  105382. return c.header_
  105383. }
  105384. func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  105385. reqHeaders := make(http.Header)
  105386. for k, v := range c.header_ {
  105387. reqHeaders[k] = v
  105388. }
  105389. reqHeaders.Set("User-Agent", c.s.userAgent())
  105390. if c.ifNoneMatch_ != "" {
  105391. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  105392. }
  105393. var body io.Reader = nil
  105394. c.urlParams_.Set("alt", alt)
  105395. c.urlParams_.Set("prettyPrint", "false")
  105396. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks")
  105397. urls += "?" + c.urlParams_.Encode()
  105398. req, err := http.NewRequest("GET", urls, body)
  105399. if err != nil {
  105400. return nil, err
  105401. }
  105402. req.Header = reqHeaders
  105403. googleapi.Expand(req.URL, map[string]string{
  105404. "project": c.project,
  105405. "region": c.region,
  105406. })
  105407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105408. }
  105409. // Do executes the "compute.regionHealthChecks.list" call.
  105410. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  105411. // status code is an error. Response headers are in either
  105412. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  105413. // at all) in error.(*googleapi.Error).Header. Use
  105414. // googleapi.IsNotModified to check whether the returned error was
  105415. // because http.StatusNotModified was returned.
  105416. func (c *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  105417. gensupport.SetOptions(c.urlParams_, opts...)
  105418. res, err := c.doRequest("json")
  105419. if res != nil && res.StatusCode == http.StatusNotModified {
  105420. if res.Body != nil {
  105421. res.Body.Close()
  105422. }
  105423. return nil, &googleapi.Error{
  105424. Code: res.StatusCode,
  105425. Header: res.Header,
  105426. }
  105427. }
  105428. if err != nil {
  105429. return nil, err
  105430. }
  105431. defer googleapi.CloseBody(res)
  105432. if err := googleapi.CheckResponse(res); err != nil {
  105433. return nil, err
  105434. }
  105435. ret := &HealthCheckList{
  105436. ServerResponse: googleapi.ServerResponse{
  105437. Header: res.Header,
  105438. HTTPStatusCode: res.StatusCode,
  105439. },
  105440. }
  105441. target := &ret
  105442. if err := gensupport.DecodeResponse(target, res); err != nil {
  105443. return nil, err
  105444. }
  105445. return ret, nil
  105446. // {
  105447. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  105448. // "httpMethod": "GET",
  105449. // "id": "compute.regionHealthChecks.list",
  105450. // "parameterOrder": [
  105451. // "project",
  105452. // "region"
  105453. // ],
  105454. // "parameters": {
  105455. // "filter": {
  105456. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  105457. // "location": "query",
  105458. // "type": "string"
  105459. // },
  105460. // "maxResults": {
  105461. // "default": "500",
  105462. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  105463. // "format": "uint32",
  105464. // "location": "query",
  105465. // "minimum": "0",
  105466. // "type": "integer"
  105467. // },
  105468. // "orderBy": {
  105469. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  105470. // "location": "query",
  105471. // "type": "string"
  105472. // },
  105473. // "pageToken": {
  105474. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  105475. // "location": "query",
  105476. // "type": "string"
  105477. // },
  105478. // "project": {
  105479. // "description": "Project ID for this request.",
  105480. // "location": "path",
  105481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105482. // "required": true,
  105483. // "type": "string"
  105484. // },
  105485. // "region": {
  105486. // "description": "Name of the region scoping this request.",
  105487. // "location": "path",
  105488. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105489. // "required": true,
  105490. // "type": "string"
  105491. // }
  105492. // },
  105493. // "path": "{project}/regions/{region}/healthChecks",
  105494. // "response": {
  105495. // "$ref": "HealthCheckList"
  105496. // },
  105497. // "scopes": [
  105498. // "https://www.googleapis.com/auth/cloud-platform",
  105499. // "https://www.googleapis.com/auth/compute",
  105500. // "https://www.googleapis.com/auth/compute.readonly"
  105501. // ]
  105502. // }
  105503. }
  105504. // Pages invokes f for each page of results.
  105505. // A non-nil error returned from f will halt the iteration.
  105506. // The provided context supersedes any context provided to the Context method.
  105507. func (c *RegionHealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  105508. c.ctx_ = ctx
  105509. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  105510. for {
  105511. x, err := c.Do()
  105512. if err != nil {
  105513. return err
  105514. }
  105515. if err := f(x); err != nil {
  105516. return err
  105517. }
  105518. if x.NextPageToken == "" {
  105519. return nil
  105520. }
  105521. c.PageToken(x.NextPageToken)
  105522. }
  105523. }
  105524. // method id "compute.regionHealthChecks.patch":
  105525. type RegionHealthChecksPatchCall struct {
  105526. s *Service
  105527. project string
  105528. region string
  105529. healthCheck string
  105530. healthcheck *HealthCheck
  105531. urlParams_ gensupport.URLParams
  105532. ctx_ context.Context
  105533. header_ http.Header
  105534. }
  105535. // Patch: Updates a HealthCheck resource in the specified project using
  105536. // the data included in the request. This method supports PATCH
  105537. // semantics and uses the JSON merge patch format and processing rules.
  105538. func (r *RegionHealthChecksService) Patch(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksPatchCall {
  105539. c := &RegionHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105540. c.project = project
  105541. c.region = region
  105542. c.healthCheck = healthCheck
  105543. c.healthcheck = healthcheck
  105544. return c
  105545. }
  105546. // RequestId sets the optional parameter "requestId": An optional
  105547. // request ID to identify requests. Specify a unique request ID so that
  105548. // if you must retry your request, the server will know to ignore the
  105549. // request if it has already been completed.
  105550. //
  105551. // For example, consider a situation where you make an initial request
  105552. // and the request times out. If you make the request again with the
  105553. // same request ID, the server can check if original operation with the
  105554. // same request ID was received, and if so, will ignore the second
  105555. // request. This prevents clients from accidentally creating duplicate
  105556. // commitments.
  105557. //
  105558. // The request ID must be a valid UUID with the exception that zero UUID
  105559. // is not supported (00000000-0000-0000-0000-000000000000).
  105560. func (c *RegionHealthChecksPatchCall) RequestId(requestId string) *RegionHealthChecksPatchCall {
  105561. c.urlParams_.Set("requestId", requestId)
  105562. return c
  105563. }
  105564. // Fields allows partial responses to be retrieved. See
  105565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105566. // for more information.
  105567. func (c *RegionHealthChecksPatchCall) Fields(s ...googleapi.Field) *RegionHealthChecksPatchCall {
  105568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105569. return c
  105570. }
  105571. // Context sets the context to be used in this call's Do method. Any
  105572. // pending HTTP request will be aborted if the provided context is
  105573. // canceled.
  105574. func (c *RegionHealthChecksPatchCall) Context(ctx context.Context) *RegionHealthChecksPatchCall {
  105575. c.ctx_ = ctx
  105576. return c
  105577. }
  105578. // Header returns an http.Header that can be modified by the caller to
  105579. // add HTTP headers to the request.
  105580. func (c *RegionHealthChecksPatchCall) Header() http.Header {
  105581. if c.header_ == nil {
  105582. c.header_ = make(http.Header)
  105583. }
  105584. return c.header_
  105585. }
  105586. func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  105587. reqHeaders := make(http.Header)
  105588. for k, v := range c.header_ {
  105589. reqHeaders[k] = v
  105590. }
  105591. reqHeaders.Set("User-Agent", c.s.userAgent())
  105592. var body io.Reader = nil
  105593. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  105594. if err != nil {
  105595. return nil, err
  105596. }
  105597. reqHeaders.Set("Content-Type", "application/json")
  105598. c.urlParams_.Set("alt", alt)
  105599. c.urlParams_.Set("prettyPrint", "false")
  105600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  105601. urls += "?" + c.urlParams_.Encode()
  105602. req, err := http.NewRequest("PATCH", urls, body)
  105603. if err != nil {
  105604. return nil, err
  105605. }
  105606. req.Header = reqHeaders
  105607. googleapi.Expand(req.URL, map[string]string{
  105608. "project": c.project,
  105609. "region": c.region,
  105610. "healthCheck": c.healthCheck,
  105611. })
  105612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105613. }
  105614. // Do executes the "compute.regionHealthChecks.patch" call.
  105615. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105616. // status code is an error. Response headers are in either
  105617. // *Operation.ServerResponse.Header or (if a response was returned at
  105618. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105619. // to check whether the returned error was because
  105620. // http.StatusNotModified was returned.
  105621. func (c *RegionHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105622. gensupport.SetOptions(c.urlParams_, opts...)
  105623. res, err := c.doRequest("json")
  105624. if res != nil && res.StatusCode == http.StatusNotModified {
  105625. if res.Body != nil {
  105626. res.Body.Close()
  105627. }
  105628. return nil, &googleapi.Error{
  105629. Code: res.StatusCode,
  105630. Header: res.Header,
  105631. }
  105632. }
  105633. if err != nil {
  105634. return nil, err
  105635. }
  105636. defer googleapi.CloseBody(res)
  105637. if err := googleapi.CheckResponse(res); err != nil {
  105638. return nil, err
  105639. }
  105640. ret := &Operation{
  105641. ServerResponse: googleapi.ServerResponse{
  105642. Header: res.Header,
  105643. HTTPStatusCode: res.StatusCode,
  105644. },
  105645. }
  105646. target := &ret
  105647. if err := gensupport.DecodeResponse(target, res); err != nil {
  105648. return nil, err
  105649. }
  105650. return ret, nil
  105651. // {
  105652. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  105653. // "httpMethod": "PATCH",
  105654. // "id": "compute.regionHealthChecks.patch",
  105655. // "parameterOrder": [
  105656. // "project",
  105657. // "region",
  105658. // "healthCheck"
  105659. // ],
  105660. // "parameters": {
  105661. // "healthCheck": {
  105662. // "description": "Name of the HealthCheck resource to patch.",
  105663. // "location": "path",
  105664. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105665. // "required": true,
  105666. // "type": "string"
  105667. // },
  105668. // "project": {
  105669. // "description": "Project ID for this request.",
  105670. // "location": "path",
  105671. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105672. // "required": true,
  105673. // "type": "string"
  105674. // },
  105675. // "region": {
  105676. // "description": "Name of the region scoping this request.",
  105677. // "location": "path",
  105678. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105679. // "required": true,
  105680. // "type": "string"
  105681. // },
  105682. // "requestId": {
  105683. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  105684. // "location": "query",
  105685. // "type": "string"
  105686. // }
  105687. // },
  105688. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  105689. // "request": {
  105690. // "$ref": "HealthCheck"
  105691. // },
  105692. // "response": {
  105693. // "$ref": "Operation"
  105694. // },
  105695. // "scopes": [
  105696. // "https://www.googleapis.com/auth/cloud-platform",
  105697. // "https://www.googleapis.com/auth/compute"
  105698. // ]
  105699. // }
  105700. }
  105701. // method id "compute.regionHealthChecks.testIamPermissions":
  105702. type RegionHealthChecksTestIamPermissionsCall struct {
  105703. s *Service
  105704. project string
  105705. region string
  105706. resource string
  105707. testpermissionsrequest *TestPermissionsRequest
  105708. urlParams_ gensupport.URLParams
  105709. ctx_ context.Context
  105710. header_ http.Header
  105711. }
  105712. // TestIamPermissions: Returns permissions that a caller has on the
  105713. // specified resource.
  105714. func (r *RegionHealthChecksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionHealthChecksTestIamPermissionsCall {
  105715. c := &RegionHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105716. c.project = project
  105717. c.region = region
  105718. c.resource = resource
  105719. c.testpermissionsrequest = testpermissionsrequest
  105720. return c
  105721. }
  105722. // Fields allows partial responses to be retrieved. See
  105723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105724. // for more information.
  105725. func (c *RegionHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionHealthChecksTestIamPermissionsCall {
  105726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105727. return c
  105728. }
  105729. // Context sets the context to be used in this call's Do method. Any
  105730. // pending HTTP request will be aborted if the provided context is
  105731. // canceled.
  105732. func (c *RegionHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *RegionHealthChecksTestIamPermissionsCall {
  105733. c.ctx_ = ctx
  105734. return c
  105735. }
  105736. // Header returns an http.Header that can be modified by the caller to
  105737. // add HTTP headers to the request.
  105738. func (c *RegionHealthChecksTestIamPermissionsCall) Header() http.Header {
  105739. if c.header_ == nil {
  105740. c.header_ = make(http.Header)
  105741. }
  105742. return c.header_
  105743. }
  105744. func (c *RegionHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  105745. reqHeaders := make(http.Header)
  105746. for k, v := range c.header_ {
  105747. reqHeaders[k] = v
  105748. }
  105749. reqHeaders.Set("User-Agent", c.s.userAgent())
  105750. var body io.Reader = nil
  105751. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  105752. if err != nil {
  105753. return nil, err
  105754. }
  105755. reqHeaders.Set("Content-Type", "application/json")
  105756. c.urlParams_.Set("alt", alt)
  105757. c.urlParams_.Set("prettyPrint", "false")
  105758. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{resource}/testIamPermissions")
  105759. urls += "?" + c.urlParams_.Encode()
  105760. req, err := http.NewRequest("POST", urls, body)
  105761. if err != nil {
  105762. return nil, err
  105763. }
  105764. req.Header = reqHeaders
  105765. googleapi.Expand(req.URL, map[string]string{
  105766. "project": c.project,
  105767. "region": c.region,
  105768. "resource": c.resource,
  105769. })
  105770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105771. }
  105772. // Do executes the "compute.regionHealthChecks.testIamPermissions" call.
  105773. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  105774. // non-2xx status code is an error. Response headers are in either
  105775. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  105776. // returned at all) in error.(*googleapi.Error).Header. Use
  105777. // googleapi.IsNotModified to check whether the returned error was
  105778. // because http.StatusNotModified was returned.
  105779. func (c *RegionHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  105780. gensupport.SetOptions(c.urlParams_, opts...)
  105781. res, err := c.doRequest("json")
  105782. if res != nil && res.StatusCode == http.StatusNotModified {
  105783. if res.Body != nil {
  105784. res.Body.Close()
  105785. }
  105786. return nil, &googleapi.Error{
  105787. Code: res.StatusCode,
  105788. Header: res.Header,
  105789. }
  105790. }
  105791. if err != nil {
  105792. return nil, err
  105793. }
  105794. defer googleapi.CloseBody(res)
  105795. if err := googleapi.CheckResponse(res); err != nil {
  105796. return nil, err
  105797. }
  105798. ret := &TestPermissionsResponse{
  105799. ServerResponse: googleapi.ServerResponse{
  105800. Header: res.Header,
  105801. HTTPStatusCode: res.StatusCode,
  105802. },
  105803. }
  105804. target := &ret
  105805. if err := gensupport.DecodeResponse(target, res); err != nil {
  105806. return nil, err
  105807. }
  105808. return ret, nil
  105809. // {
  105810. // "description": "Returns permissions that a caller has on the specified resource.",
  105811. // "httpMethod": "POST",
  105812. // "id": "compute.regionHealthChecks.testIamPermissions",
  105813. // "parameterOrder": [
  105814. // "project",
  105815. // "region",
  105816. // "resource"
  105817. // ],
  105818. // "parameters": {
  105819. // "project": {
  105820. // "description": "Project ID for this request.",
  105821. // "location": "path",
  105822. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  105823. // "required": true,
  105824. // "type": "string"
  105825. // },
  105826. // "region": {
  105827. // "description": "The name of the region for this request.",
  105828. // "location": "path",
  105829. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  105830. // "required": true,
  105831. // "type": "string"
  105832. // },
  105833. // "resource": {
  105834. // "description": "Name or id of the resource for this request.",
  105835. // "location": "path",
  105836. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105837. // "required": true,
  105838. // "type": "string"
  105839. // }
  105840. // },
  105841. // "path": "{project}/regions/{region}/healthChecks/{resource}/testIamPermissions",
  105842. // "request": {
  105843. // "$ref": "TestPermissionsRequest"
  105844. // },
  105845. // "response": {
  105846. // "$ref": "TestPermissionsResponse"
  105847. // },
  105848. // "scopes": [
  105849. // "https://www.googleapis.com/auth/cloud-platform",
  105850. // "https://www.googleapis.com/auth/compute",
  105851. // "https://www.googleapis.com/auth/compute.readonly"
  105852. // ]
  105853. // }
  105854. }
  105855. // method id "compute.regionHealthChecks.update":
  105856. type RegionHealthChecksUpdateCall struct {
  105857. s *Service
  105858. project string
  105859. region string
  105860. healthCheck string
  105861. healthcheck *HealthCheck
  105862. urlParams_ gensupport.URLParams
  105863. ctx_ context.Context
  105864. header_ http.Header
  105865. }
  105866. // Update: Updates a HealthCheck resource in the specified project using
  105867. // the data included in the request.
  105868. func (r *RegionHealthChecksService) Update(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksUpdateCall {
  105869. c := &RegionHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  105870. c.project = project
  105871. c.region = region
  105872. c.healthCheck = healthCheck
  105873. c.healthcheck = healthcheck
  105874. return c
  105875. }
  105876. // RequestId sets the optional parameter "requestId": An optional
  105877. // request ID to identify requests. Specify a unique request ID so that
  105878. // if you must retry your request, the server will know to ignore the
  105879. // request if it has already been completed.
  105880. //
  105881. // For example, consider a situation where you make an initial request
  105882. // and the request times out. If you make the request again with the
  105883. // same request ID, the server can check if original operation with the
  105884. // same request ID was received, and if so, will ignore the second
  105885. // request. This prevents clients from accidentally creating duplicate
  105886. // commitments.
  105887. //
  105888. // The request ID must be a valid UUID with the exception that zero UUID
  105889. // is not supported (00000000-0000-0000-0000-000000000000).
  105890. func (c *RegionHealthChecksUpdateCall) RequestId(requestId string) *RegionHealthChecksUpdateCall {
  105891. c.urlParams_.Set("requestId", requestId)
  105892. return c
  105893. }
  105894. // Fields allows partial responses to be retrieved. See
  105895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  105896. // for more information.
  105897. func (c *RegionHealthChecksUpdateCall) Fields(s ...googleapi.Field) *RegionHealthChecksUpdateCall {
  105898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  105899. return c
  105900. }
  105901. // Context sets the context to be used in this call's Do method. Any
  105902. // pending HTTP request will be aborted if the provided context is
  105903. // canceled.
  105904. func (c *RegionHealthChecksUpdateCall) Context(ctx context.Context) *RegionHealthChecksUpdateCall {
  105905. c.ctx_ = ctx
  105906. return c
  105907. }
  105908. // Header returns an http.Header that can be modified by the caller to
  105909. // add HTTP headers to the request.
  105910. func (c *RegionHealthChecksUpdateCall) Header() http.Header {
  105911. if c.header_ == nil {
  105912. c.header_ = make(http.Header)
  105913. }
  105914. return c.header_
  105915. }
  105916. func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  105917. reqHeaders := make(http.Header)
  105918. for k, v := range c.header_ {
  105919. reqHeaders[k] = v
  105920. }
  105921. reqHeaders.Set("User-Agent", c.s.userAgent())
  105922. var body io.Reader = nil
  105923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  105924. if err != nil {
  105925. return nil, err
  105926. }
  105927. reqHeaders.Set("Content-Type", "application/json")
  105928. c.urlParams_.Set("alt", alt)
  105929. c.urlParams_.Set("prettyPrint", "false")
  105930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/healthChecks/{healthCheck}")
  105931. urls += "?" + c.urlParams_.Encode()
  105932. req, err := http.NewRequest("PUT", urls, body)
  105933. if err != nil {
  105934. return nil, err
  105935. }
  105936. req.Header = reqHeaders
  105937. googleapi.Expand(req.URL, map[string]string{
  105938. "project": c.project,
  105939. "region": c.region,
  105940. "healthCheck": c.healthCheck,
  105941. })
  105942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  105943. }
  105944. // Do executes the "compute.regionHealthChecks.update" call.
  105945. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  105946. // status code is an error. Response headers are in either
  105947. // *Operation.ServerResponse.Header or (if a response was returned at
  105948. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  105949. // to check whether the returned error was because
  105950. // http.StatusNotModified was returned.
  105951. func (c *RegionHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  105952. gensupport.SetOptions(c.urlParams_, opts...)
  105953. res, err := c.doRequest("json")
  105954. if res != nil && res.StatusCode == http.StatusNotModified {
  105955. if res.Body != nil {
  105956. res.Body.Close()
  105957. }
  105958. return nil, &googleapi.Error{
  105959. Code: res.StatusCode,
  105960. Header: res.Header,
  105961. }
  105962. }
  105963. if err != nil {
  105964. return nil, err
  105965. }
  105966. defer googleapi.CloseBody(res)
  105967. if err := googleapi.CheckResponse(res); err != nil {
  105968. return nil, err
  105969. }
  105970. ret := &Operation{
  105971. ServerResponse: googleapi.ServerResponse{
  105972. Header: res.Header,
  105973. HTTPStatusCode: res.StatusCode,
  105974. },
  105975. }
  105976. target := &ret
  105977. if err := gensupport.DecodeResponse(target, res); err != nil {
  105978. return nil, err
  105979. }
  105980. return ret, nil
  105981. // {
  105982. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  105983. // "httpMethod": "PUT",
  105984. // "id": "compute.regionHealthChecks.update",
  105985. // "parameterOrder": [
  105986. // "project",
  105987. // "region",
  105988. // "healthCheck"
  105989. // ],
  105990. // "parameters": {
  105991. // "healthCheck": {
  105992. // "description": "Name of the HealthCheck resource to update.",
  105993. // "location": "path",
  105994. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  105995. // "required": true,
  105996. // "type": "string"
  105997. // },
  105998. // "project": {
  105999. // "description": "Project ID for this request.",
  106000. // "location": "path",
  106001. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106002. // "required": true,
  106003. // "type": "string"
  106004. // },
  106005. // "region": {
  106006. // "description": "Name of the region scoping this request.",
  106007. // "location": "path",
  106008. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  106009. // "required": true,
  106010. // "type": "string"
  106011. // },
  106012. // "requestId": {
  106013. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106014. // "location": "query",
  106015. // "type": "string"
  106016. // }
  106017. // },
  106018. // "path": "{project}/regions/{region}/healthChecks/{healthCheck}",
  106019. // "request": {
  106020. // "$ref": "HealthCheck"
  106021. // },
  106022. // "response": {
  106023. // "$ref": "Operation"
  106024. // },
  106025. // "scopes": [
  106026. // "https://www.googleapis.com/auth/cloud-platform",
  106027. // "https://www.googleapis.com/auth/compute"
  106028. // ]
  106029. // }
  106030. }
  106031. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  106032. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  106033. s *Service
  106034. project string
  106035. region string
  106036. instanceGroupManager string
  106037. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  106038. urlParams_ gensupport.URLParams
  106039. ctx_ context.Context
  106040. header_ http.Header
  106041. }
  106042. // AbandonInstances: Flags the specified instances to be immediately
  106043. // removed from the managed instance group. Abandoning an instance does
  106044. // not delete the instance, but it does remove the instance from any
  106045. // target pools that are applied by the managed instance group. This
  106046. // method reduces the targetSize of the managed instance group by the
  106047. // number of instances that you abandon. This operation is marked as
  106048. // DONE when the action is scheduled even if the instances have not yet
  106049. // been removed from the group. You must separately verify the status of
  106050. // the abandoning action with the listmanagedinstances method.
  106051. //
  106052. // If the group is part of a backend service that has enabled connection
  106053. // draining, it can take up to 60 seconds after the connection draining
  106054. // duration has elapsed before the VM instance is removed or
  106055. // deleted.
  106056. //
  106057. // You can specify a maximum of 1000 instances with this method per
  106058. // request.
  106059. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  106060. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106061. c.project = project
  106062. c.region = region
  106063. c.instanceGroupManager = instanceGroupManager
  106064. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  106065. return c
  106066. }
  106067. // RequestId sets the optional parameter "requestId": An optional
  106068. // request ID to identify requests. Specify a unique request ID so that
  106069. // if you must retry your request, the server will know to ignore the
  106070. // request if it has already been completed.
  106071. //
  106072. // For example, consider a situation where you make an initial request
  106073. // and the request times out. If you make the request again with the
  106074. // same request ID, the server can check if original operation with the
  106075. // same request ID was received, and if so, will ignore the second
  106076. // request. This prevents clients from accidentally creating duplicate
  106077. // commitments.
  106078. //
  106079. // The request ID must be a valid UUID with the exception that zero UUID
  106080. // is not supported (00000000-0000-0000-0000-000000000000).
  106081. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  106082. c.urlParams_.Set("requestId", requestId)
  106083. return c
  106084. }
  106085. // Fields allows partial responses to be retrieved. See
  106086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106087. // for more information.
  106088. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  106089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106090. return c
  106091. }
  106092. // Context sets the context to be used in this call's Do method. Any
  106093. // pending HTTP request will be aborted if the provided context is
  106094. // canceled.
  106095. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  106096. c.ctx_ = ctx
  106097. return c
  106098. }
  106099. // Header returns an http.Header that can be modified by the caller to
  106100. // add HTTP headers to the request.
  106101. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  106102. if c.header_ == nil {
  106103. c.header_ = make(http.Header)
  106104. }
  106105. return c.header_
  106106. }
  106107. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  106108. reqHeaders := make(http.Header)
  106109. for k, v := range c.header_ {
  106110. reqHeaders[k] = v
  106111. }
  106112. reqHeaders.Set("User-Agent", c.s.userAgent())
  106113. var body io.Reader = nil
  106114. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  106115. if err != nil {
  106116. return nil, err
  106117. }
  106118. reqHeaders.Set("Content-Type", "application/json")
  106119. c.urlParams_.Set("alt", alt)
  106120. c.urlParams_.Set("prettyPrint", "false")
  106121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  106122. urls += "?" + c.urlParams_.Encode()
  106123. req, err := http.NewRequest("POST", urls, body)
  106124. if err != nil {
  106125. return nil, err
  106126. }
  106127. req.Header = reqHeaders
  106128. googleapi.Expand(req.URL, map[string]string{
  106129. "project": c.project,
  106130. "region": c.region,
  106131. "instanceGroupManager": c.instanceGroupManager,
  106132. })
  106133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106134. }
  106135. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  106136. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106137. // status code is an error. Response headers are in either
  106138. // *Operation.ServerResponse.Header or (if a response was returned at
  106139. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106140. // to check whether the returned error was because
  106141. // http.StatusNotModified was returned.
  106142. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106143. gensupport.SetOptions(c.urlParams_, opts...)
  106144. res, err := c.doRequest("json")
  106145. if res != nil && res.StatusCode == http.StatusNotModified {
  106146. if res.Body != nil {
  106147. res.Body.Close()
  106148. }
  106149. return nil, &googleapi.Error{
  106150. Code: res.StatusCode,
  106151. Header: res.Header,
  106152. }
  106153. }
  106154. if err != nil {
  106155. return nil, err
  106156. }
  106157. defer googleapi.CloseBody(res)
  106158. if err := googleapi.CheckResponse(res); err != nil {
  106159. return nil, err
  106160. }
  106161. ret := &Operation{
  106162. ServerResponse: googleapi.ServerResponse{
  106163. Header: res.Header,
  106164. HTTPStatusCode: res.StatusCode,
  106165. },
  106166. }
  106167. target := &ret
  106168. if err := gensupport.DecodeResponse(target, res); err != nil {
  106169. return nil, err
  106170. }
  106171. return ret, nil
  106172. // {
  106173. // "description": "Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  106174. // "httpMethod": "POST",
  106175. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  106176. // "parameterOrder": [
  106177. // "project",
  106178. // "region",
  106179. // "instanceGroupManager"
  106180. // ],
  106181. // "parameters": {
  106182. // "instanceGroupManager": {
  106183. // "description": "Name of the managed instance group.",
  106184. // "location": "path",
  106185. // "required": true,
  106186. // "type": "string"
  106187. // },
  106188. // "project": {
  106189. // "description": "Project ID for this request.",
  106190. // "location": "path",
  106191. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106192. // "required": true,
  106193. // "type": "string"
  106194. // },
  106195. // "region": {
  106196. // "description": "Name of the region scoping this request.",
  106197. // "location": "path",
  106198. // "required": true,
  106199. // "type": "string"
  106200. // },
  106201. // "requestId": {
  106202. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106203. // "location": "query",
  106204. // "type": "string"
  106205. // }
  106206. // },
  106207. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  106208. // "request": {
  106209. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  106210. // },
  106211. // "response": {
  106212. // "$ref": "Operation"
  106213. // },
  106214. // "scopes": [
  106215. // "https://www.googleapis.com/auth/cloud-platform",
  106216. // "https://www.googleapis.com/auth/compute"
  106217. // ]
  106218. // }
  106219. }
  106220. // method id "compute.regionInstanceGroupManagers.applyUpdatesToInstances":
  106221. type RegionInstanceGroupManagersApplyUpdatesToInstancesCall struct {
  106222. s *Service
  106223. project string
  106224. region string
  106225. instanceGroupManager string
  106226. regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest
  106227. urlParams_ gensupport.URLParams
  106228. ctx_ context.Context
  106229. header_ http.Header
  106230. }
  106231. // ApplyUpdatesToInstances: Apply updates to selected instances the
  106232. // managed instance group.
  106233. func (r *RegionInstanceGroupManagersService) ApplyUpdatesToInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  106234. c := &RegionInstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106235. c.project = project
  106236. c.region = region
  106237. c.instanceGroupManager = instanceGroupManager
  106238. c.regioninstancegroupmanagersapplyupdatesrequest = regioninstancegroupmanagersapplyupdatesrequest
  106239. return c
  106240. }
  106241. // Fields allows partial responses to be retrieved. See
  106242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106243. // for more information.
  106244. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  106245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106246. return c
  106247. }
  106248. // Context sets the context to be used in this call's Do method. Any
  106249. // pending HTTP request will be aborted if the provided context is
  106250. // canceled.
  106251. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall {
  106252. c.ctx_ = ctx
  106253. return c
  106254. }
  106255. // Header returns an http.Header that can be modified by the caller to
  106256. // add HTTP headers to the request.
  106257. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header {
  106258. if c.header_ == nil {
  106259. c.header_ = make(http.Header)
  106260. }
  106261. return c.header_
  106262. }
  106263. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) {
  106264. reqHeaders := make(http.Header)
  106265. for k, v := range c.header_ {
  106266. reqHeaders[k] = v
  106267. }
  106268. reqHeaders.Set("User-Agent", c.s.userAgent())
  106269. var body io.Reader = nil
  106270. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest)
  106271. if err != nil {
  106272. return nil, err
  106273. }
  106274. reqHeaders.Set("Content-Type", "application/json")
  106275. c.urlParams_.Set("alt", alt)
  106276. c.urlParams_.Set("prettyPrint", "false")
  106277. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances")
  106278. urls += "?" + c.urlParams_.Encode()
  106279. req, err := http.NewRequest("POST", urls, body)
  106280. if err != nil {
  106281. return nil, err
  106282. }
  106283. req.Header = reqHeaders
  106284. googleapi.Expand(req.URL, map[string]string{
  106285. "project": c.project,
  106286. "region": c.region,
  106287. "instanceGroupManager": c.instanceGroupManager,
  106288. })
  106289. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106290. }
  106291. // Do executes the "compute.regionInstanceGroupManagers.applyUpdatesToInstances" call.
  106292. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106293. // status code is an error. Response headers are in either
  106294. // *Operation.ServerResponse.Header or (if a response was returned at
  106295. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106296. // to check whether the returned error was because
  106297. // http.StatusNotModified was returned.
  106298. func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106299. gensupport.SetOptions(c.urlParams_, opts...)
  106300. res, err := c.doRequest("json")
  106301. if res != nil && res.StatusCode == http.StatusNotModified {
  106302. if res.Body != nil {
  106303. res.Body.Close()
  106304. }
  106305. return nil, &googleapi.Error{
  106306. Code: res.StatusCode,
  106307. Header: res.Header,
  106308. }
  106309. }
  106310. if err != nil {
  106311. return nil, err
  106312. }
  106313. defer googleapi.CloseBody(res)
  106314. if err := googleapi.CheckResponse(res); err != nil {
  106315. return nil, err
  106316. }
  106317. ret := &Operation{
  106318. ServerResponse: googleapi.ServerResponse{
  106319. Header: res.Header,
  106320. HTTPStatusCode: res.StatusCode,
  106321. },
  106322. }
  106323. target := &ret
  106324. if err := gensupport.DecodeResponse(target, res); err != nil {
  106325. return nil, err
  106326. }
  106327. return ret, nil
  106328. // {
  106329. // "description": "Apply updates to selected instances the managed instance group.",
  106330. // "httpMethod": "POST",
  106331. // "id": "compute.regionInstanceGroupManagers.applyUpdatesToInstances",
  106332. // "parameterOrder": [
  106333. // "project",
  106334. // "region",
  106335. // "instanceGroupManager"
  106336. // ],
  106337. // "parameters": {
  106338. // "instanceGroupManager": {
  106339. // "description": "The name of the managed instance group, should conform to RFC1035.",
  106340. // "location": "path",
  106341. // "required": true,
  106342. // "type": "string"
  106343. // },
  106344. // "project": {
  106345. // "description": "Project ID for this request.",
  106346. // "location": "path",
  106347. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106348. // "required": true,
  106349. // "type": "string"
  106350. // },
  106351. // "region": {
  106352. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  106353. // "location": "path",
  106354. // "required": true,
  106355. // "type": "string"
  106356. // }
  106357. // },
  106358. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances",
  106359. // "request": {
  106360. // "$ref": "RegionInstanceGroupManagersApplyUpdatesRequest"
  106361. // },
  106362. // "response": {
  106363. // "$ref": "Operation"
  106364. // },
  106365. // "scopes": [
  106366. // "https://www.googleapis.com/auth/cloud-platform",
  106367. // "https://www.googleapis.com/auth/compute"
  106368. // ]
  106369. // }
  106370. }
  106371. // method id "compute.regionInstanceGroupManagers.createInstances":
  106372. type RegionInstanceGroupManagersCreateInstancesCall struct {
  106373. s *Service
  106374. project string
  106375. region string
  106376. instanceGroupManager string
  106377. regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest
  106378. urlParams_ gensupport.URLParams
  106379. ctx_ context.Context
  106380. header_ http.Header
  106381. }
  106382. // CreateInstances: Creates instances with per-instance configs in this
  106383. // regional managed instance group. Instances are created using the
  106384. // current instance template. The create instances operation is marked
  106385. // DONE if the createInstances request is successful. The underlying
  106386. // actions take additional time. You must separately verify the status
  106387. // of the creating or actions with the listmanagedinstances method.
  106388. func (r *RegionInstanceGroupManagersService) CreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest) *RegionInstanceGroupManagersCreateInstancesCall {
  106389. c := &RegionInstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106390. c.project = project
  106391. c.region = region
  106392. c.instanceGroupManager = instanceGroupManager
  106393. c.regioninstancegroupmanagerscreateinstancesrequest = regioninstancegroupmanagerscreateinstancesrequest
  106394. return c
  106395. }
  106396. // RequestId sets the optional parameter "requestId": An optional
  106397. // request ID to identify requests. Specify a unique request ID so that
  106398. // if you must retry your request, the server will know to ignore the
  106399. // request if it has already been completed.
  106400. //
  106401. // For example, consider a situation where you make an initial request
  106402. // and the request times out. If you make the request again with the
  106403. // same request ID, the server can check if original operation with the
  106404. // same request ID was received, and if so, will ignore the second
  106405. // request.
  106406. //
  106407. // The request ID must be a valid UUID with the exception that zero UUID
  106408. // is not supported (00000000-0000-0000-0000-000000000000).
  106409. func (c *RegionInstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersCreateInstancesCall {
  106410. c.urlParams_.Set("requestId", requestId)
  106411. return c
  106412. }
  106413. // Fields allows partial responses to be retrieved. See
  106414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106415. // for more information.
  106416. func (c *RegionInstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersCreateInstancesCall {
  106417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106418. return c
  106419. }
  106420. // Context sets the context to be used in this call's Do method. Any
  106421. // pending HTTP request will be aborted if the provided context is
  106422. // canceled.
  106423. func (c *RegionInstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersCreateInstancesCall {
  106424. c.ctx_ = ctx
  106425. return c
  106426. }
  106427. // Header returns an http.Header that can be modified by the caller to
  106428. // add HTTP headers to the request.
  106429. func (c *RegionInstanceGroupManagersCreateInstancesCall) Header() http.Header {
  106430. if c.header_ == nil {
  106431. c.header_ = make(http.Header)
  106432. }
  106433. return c.header_
  106434. }
  106435. func (c *RegionInstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  106436. reqHeaders := make(http.Header)
  106437. for k, v := range c.header_ {
  106438. reqHeaders[k] = v
  106439. }
  106440. reqHeaders.Set("User-Agent", c.s.userAgent())
  106441. var body io.Reader = nil
  106442. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerscreateinstancesrequest)
  106443. if err != nil {
  106444. return nil, err
  106445. }
  106446. reqHeaders.Set("Content-Type", "application/json")
  106447. c.urlParams_.Set("alt", alt)
  106448. c.urlParams_.Set("prettyPrint", "false")
  106449. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances")
  106450. urls += "?" + c.urlParams_.Encode()
  106451. req, err := http.NewRequest("POST", urls, body)
  106452. if err != nil {
  106453. return nil, err
  106454. }
  106455. req.Header = reqHeaders
  106456. googleapi.Expand(req.URL, map[string]string{
  106457. "project": c.project,
  106458. "region": c.region,
  106459. "instanceGroupManager": c.instanceGroupManager,
  106460. })
  106461. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106462. }
  106463. // Do executes the "compute.regionInstanceGroupManagers.createInstances" call.
  106464. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106465. // status code is an error. Response headers are in either
  106466. // *Operation.ServerResponse.Header or (if a response was returned at
  106467. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106468. // to check whether the returned error was because
  106469. // http.StatusNotModified was returned.
  106470. func (c *RegionInstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106471. gensupport.SetOptions(c.urlParams_, opts...)
  106472. res, err := c.doRequest("json")
  106473. if res != nil && res.StatusCode == http.StatusNotModified {
  106474. if res.Body != nil {
  106475. res.Body.Close()
  106476. }
  106477. return nil, &googleapi.Error{
  106478. Code: res.StatusCode,
  106479. Header: res.Header,
  106480. }
  106481. }
  106482. if err != nil {
  106483. return nil, err
  106484. }
  106485. defer googleapi.CloseBody(res)
  106486. if err := googleapi.CheckResponse(res); err != nil {
  106487. return nil, err
  106488. }
  106489. ret := &Operation{
  106490. ServerResponse: googleapi.ServerResponse{
  106491. Header: res.Header,
  106492. HTTPStatusCode: res.StatusCode,
  106493. },
  106494. }
  106495. target := &ret
  106496. if err := gensupport.DecodeResponse(target, res); err != nil {
  106497. return nil, err
  106498. }
  106499. return ret, nil
  106500. // {
  106501. // "description": "Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.",
  106502. // "httpMethod": "POST",
  106503. // "id": "compute.regionInstanceGroupManagers.createInstances",
  106504. // "parameterOrder": [
  106505. // "project",
  106506. // "region",
  106507. // "instanceGroupManager"
  106508. // ],
  106509. // "parameters": {
  106510. // "instanceGroupManager": {
  106511. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  106512. // "location": "path",
  106513. // "required": true,
  106514. // "type": "string"
  106515. // },
  106516. // "project": {
  106517. // "description": "Project ID for this request.",
  106518. // "location": "path",
  106519. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106520. // "required": true,
  106521. // "type": "string"
  106522. // },
  106523. // "region": {
  106524. // "description": "The name of the region where the managed instance group is located. It should conform to RFC1035.",
  106525. // "location": "path",
  106526. // "required": true,
  106527. // "type": "string"
  106528. // },
  106529. // "requestId": {
  106530. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106531. // "location": "query",
  106532. // "type": "string"
  106533. // }
  106534. // },
  106535. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances",
  106536. // "request": {
  106537. // "$ref": "RegionInstanceGroupManagersCreateInstancesRequest"
  106538. // },
  106539. // "response": {
  106540. // "$ref": "Operation"
  106541. // },
  106542. // "scopes": [
  106543. // "https://www.googleapis.com/auth/cloud-platform",
  106544. // "https://www.googleapis.com/auth/compute"
  106545. // ]
  106546. // }
  106547. }
  106548. // method id "compute.regionInstanceGroupManagers.delete":
  106549. type RegionInstanceGroupManagersDeleteCall struct {
  106550. s *Service
  106551. project string
  106552. region string
  106553. instanceGroupManager string
  106554. urlParams_ gensupport.URLParams
  106555. ctx_ context.Context
  106556. header_ http.Header
  106557. }
  106558. // Delete: Deletes the specified managed instance group and all of the
  106559. // instances in that group.
  106560. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  106561. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106562. c.project = project
  106563. c.region = region
  106564. c.instanceGroupManager = instanceGroupManager
  106565. return c
  106566. }
  106567. // RequestId sets the optional parameter "requestId": An optional
  106568. // request ID to identify requests. Specify a unique request ID so that
  106569. // if you must retry your request, the server will know to ignore the
  106570. // request if it has already been completed.
  106571. //
  106572. // For example, consider a situation where you make an initial request
  106573. // and the request times out. If you make the request again with the
  106574. // same request ID, the server can check if original operation with the
  106575. // same request ID was received, and if so, will ignore the second
  106576. // request. This prevents clients from accidentally creating duplicate
  106577. // commitments.
  106578. //
  106579. // The request ID must be a valid UUID with the exception that zero UUID
  106580. // is not supported (00000000-0000-0000-0000-000000000000).
  106581. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  106582. c.urlParams_.Set("requestId", requestId)
  106583. return c
  106584. }
  106585. // Fields allows partial responses to be retrieved. See
  106586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106587. // for more information.
  106588. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  106589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106590. return c
  106591. }
  106592. // Context sets the context to be used in this call's Do method. Any
  106593. // pending HTTP request will be aborted if the provided context is
  106594. // canceled.
  106595. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  106596. c.ctx_ = ctx
  106597. return c
  106598. }
  106599. // Header returns an http.Header that can be modified by the caller to
  106600. // add HTTP headers to the request.
  106601. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  106602. if c.header_ == nil {
  106603. c.header_ = make(http.Header)
  106604. }
  106605. return c.header_
  106606. }
  106607. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  106608. reqHeaders := make(http.Header)
  106609. for k, v := range c.header_ {
  106610. reqHeaders[k] = v
  106611. }
  106612. reqHeaders.Set("User-Agent", c.s.userAgent())
  106613. var body io.Reader = nil
  106614. c.urlParams_.Set("alt", alt)
  106615. c.urlParams_.Set("prettyPrint", "false")
  106616. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  106617. urls += "?" + c.urlParams_.Encode()
  106618. req, err := http.NewRequest("DELETE", urls, body)
  106619. if err != nil {
  106620. return nil, err
  106621. }
  106622. req.Header = reqHeaders
  106623. googleapi.Expand(req.URL, map[string]string{
  106624. "project": c.project,
  106625. "region": c.region,
  106626. "instanceGroupManager": c.instanceGroupManager,
  106627. })
  106628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106629. }
  106630. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  106631. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106632. // status code is an error. Response headers are in either
  106633. // *Operation.ServerResponse.Header or (if a response was returned at
  106634. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106635. // to check whether the returned error was because
  106636. // http.StatusNotModified was returned.
  106637. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106638. gensupport.SetOptions(c.urlParams_, opts...)
  106639. res, err := c.doRequest("json")
  106640. if res != nil && res.StatusCode == http.StatusNotModified {
  106641. if res.Body != nil {
  106642. res.Body.Close()
  106643. }
  106644. return nil, &googleapi.Error{
  106645. Code: res.StatusCode,
  106646. Header: res.Header,
  106647. }
  106648. }
  106649. if err != nil {
  106650. return nil, err
  106651. }
  106652. defer googleapi.CloseBody(res)
  106653. if err := googleapi.CheckResponse(res); err != nil {
  106654. return nil, err
  106655. }
  106656. ret := &Operation{
  106657. ServerResponse: googleapi.ServerResponse{
  106658. Header: res.Header,
  106659. HTTPStatusCode: res.StatusCode,
  106660. },
  106661. }
  106662. target := &ret
  106663. if err := gensupport.DecodeResponse(target, res); err != nil {
  106664. return nil, err
  106665. }
  106666. return ret, nil
  106667. // {
  106668. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  106669. // "httpMethod": "DELETE",
  106670. // "id": "compute.regionInstanceGroupManagers.delete",
  106671. // "parameterOrder": [
  106672. // "project",
  106673. // "region",
  106674. // "instanceGroupManager"
  106675. // ],
  106676. // "parameters": {
  106677. // "instanceGroupManager": {
  106678. // "description": "Name of the managed instance group to delete.",
  106679. // "location": "path",
  106680. // "required": true,
  106681. // "type": "string"
  106682. // },
  106683. // "project": {
  106684. // "description": "Project ID for this request.",
  106685. // "location": "path",
  106686. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106687. // "required": true,
  106688. // "type": "string"
  106689. // },
  106690. // "region": {
  106691. // "description": "Name of the region scoping this request.",
  106692. // "location": "path",
  106693. // "required": true,
  106694. // "type": "string"
  106695. // },
  106696. // "requestId": {
  106697. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106698. // "location": "query",
  106699. // "type": "string"
  106700. // }
  106701. // },
  106702. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  106703. // "response": {
  106704. // "$ref": "Operation"
  106705. // },
  106706. // "scopes": [
  106707. // "https://www.googleapis.com/auth/cloud-platform",
  106708. // "https://www.googleapis.com/auth/compute"
  106709. // ]
  106710. // }
  106711. }
  106712. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  106713. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  106714. s *Service
  106715. project string
  106716. region string
  106717. instanceGroupManager string
  106718. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  106719. urlParams_ gensupport.URLParams
  106720. ctx_ context.Context
  106721. header_ http.Header
  106722. }
  106723. // DeleteInstances: Flags the specified instances in the managed
  106724. // instance group to be immediately deleted. The instances are also
  106725. // removed from any target pools of which they were a member. This
  106726. // method reduces the targetSize of the managed instance group by the
  106727. // number of instances that you delete. The deleteInstances operation is
  106728. // marked DONE if the deleteInstances request is successful. The
  106729. // underlying actions take additional time. You must separately verify
  106730. // the status of the deleting action with the listmanagedinstances
  106731. // method.
  106732. //
  106733. // If the group is part of a backend service that has enabled connection
  106734. // draining, it can take up to 60 seconds after the connection draining
  106735. // duration has elapsed before the VM instance is removed or
  106736. // deleted.
  106737. //
  106738. // You can specify a maximum of 1000 instances with this method per
  106739. // request.
  106740. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  106741. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106742. c.project = project
  106743. c.region = region
  106744. c.instanceGroupManager = instanceGroupManager
  106745. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  106746. return c
  106747. }
  106748. // RequestId sets the optional parameter "requestId": An optional
  106749. // request ID to identify requests. Specify a unique request ID so that
  106750. // if you must retry your request, the server will know to ignore the
  106751. // request if it has already been completed.
  106752. //
  106753. // For example, consider a situation where you make an initial request
  106754. // and the request times out. If you make the request again with the
  106755. // same request ID, the server can check if original operation with the
  106756. // same request ID was received, and if so, will ignore the second
  106757. // request. This prevents clients from accidentally creating duplicate
  106758. // commitments.
  106759. //
  106760. // The request ID must be a valid UUID with the exception that zero UUID
  106761. // is not supported (00000000-0000-0000-0000-000000000000).
  106762. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  106763. c.urlParams_.Set("requestId", requestId)
  106764. return c
  106765. }
  106766. // Fields allows partial responses to be retrieved. See
  106767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106768. // for more information.
  106769. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  106770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106771. return c
  106772. }
  106773. // Context sets the context to be used in this call's Do method. Any
  106774. // pending HTTP request will be aborted if the provided context is
  106775. // canceled.
  106776. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  106777. c.ctx_ = ctx
  106778. return c
  106779. }
  106780. // Header returns an http.Header that can be modified by the caller to
  106781. // add HTTP headers to the request.
  106782. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  106783. if c.header_ == nil {
  106784. c.header_ = make(http.Header)
  106785. }
  106786. return c.header_
  106787. }
  106788. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  106789. reqHeaders := make(http.Header)
  106790. for k, v := range c.header_ {
  106791. reqHeaders[k] = v
  106792. }
  106793. reqHeaders.Set("User-Agent", c.s.userAgent())
  106794. var body io.Reader = nil
  106795. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  106796. if err != nil {
  106797. return nil, err
  106798. }
  106799. reqHeaders.Set("Content-Type", "application/json")
  106800. c.urlParams_.Set("alt", alt)
  106801. c.urlParams_.Set("prettyPrint", "false")
  106802. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  106803. urls += "?" + c.urlParams_.Encode()
  106804. req, err := http.NewRequest("POST", urls, body)
  106805. if err != nil {
  106806. return nil, err
  106807. }
  106808. req.Header = reqHeaders
  106809. googleapi.Expand(req.URL, map[string]string{
  106810. "project": c.project,
  106811. "region": c.region,
  106812. "instanceGroupManager": c.instanceGroupManager,
  106813. })
  106814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106815. }
  106816. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  106817. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106818. // status code is an error. Response headers are in either
  106819. // *Operation.ServerResponse.Header or (if a response was returned at
  106820. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106821. // to check whether the returned error was because
  106822. // http.StatusNotModified was returned.
  106823. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106824. gensupport.SetOptions(c.urlParams_, opts...)
  106825. res, err := c.doRequest("json")
  106826. if res != nil && res.StatusCode == http.StatusNotModified {
  106827. if res.Body != nil {
  106828. res.Body.Close()
  106829. }
  106830. return nil, &googleapi.Error{
  106831. Code: res.StatusCode,
  106832. Header: res.Header,
  106833. }
  106834. }
  106835. if err != nil {
  106836. return nil, err
  106837. }
  106838. defer googleapi.CloseBody(res)
  106839. if err := googleapi.CheckResponse(res); err != nil {
  106840. return nil, err
  106841. }
  106842. ret := &Operation{
  106843. ServerResponse: googleapi.ServerResponse{
  106844. Header: res.Header,
  106845. HTTPStatusCode: res.StatusCode,
  106846. },
  106847. }
  106848. target := &ret
  106849. if err := gensupport.DecodeResponse(target, res); err != nil {
  106850. return nil, err
  106851. }
  106852. return ret, nil
  106853. // {
  106854. // "description": "Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  106855. // "httpMethod": "POST",
  106856. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  106857. // "parameterOrder": [
  106858. // "project",
  106859. // "region",
  106860. // "instanceGroupManager"
  106861. // ],
  106862. // "parameters": {
  106863. // "instanceGroupManager": {
  106864. // "description": "Name of the managed instance group.",
  106865. // "location": "path",
  106866. // "required": true,
  106867. // "type": "string"
  106868. // },
  106869. // "project": {
  106870. // "description": "Project ID for this request.",
  106871. // "location": "path",
  106872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  106873. // "required": true,
  106874. // "type": "string"
  106875. // },
  106876. // "region": {
  106877. // "description": "Name of the region scoping this request.",
  106878. // "location": "path",
  106879. // "required": true,
  106880. // "type": "string"
  106881. // },
  106882. // "requestId": {
  106883. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  106884. // "location": "query",
  106885. // "type": "string"
  106886. // }
  106887. // },
  106888. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  106889. // "request": {
  106890. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  106891. // },
  106892. // "response": {
  106893. // "$ref": "Operation"
  106894. // },
  106895. // "scopes": [
  106896. // "https://www.googleapis.com/auth/cloud-platform",
  106897. // "https://www.googleapis.com/auth/compute"
  106898. // ]
  106899. // }
  106900. }
  106901. // method id "compute.regionInstanceGroupManagers.deletePerInstanceConfigs":
  106902. type RegionInstanceGroupManagersDeletePerInstanceConfigsCall struct {
  106903. s *Service
  106904. project string
  106905. region string
  106906. instanceGroupManager string
  106907. regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq
  106908. urlParams_ gensupport.URLParams
  106909. ctx_ context.Context
  106910. header_ http.Header
  106911. }
  106912. // DeletePerInstanceConfigs: Deletes selected per-instance configs for
  106913. // the managed instance group.
  106914. func (r *RegionInstanceGroupManagersService) DeletePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  106915. c := &RegionInstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  106916. c.project = project
  106917. c.region = region
  106918. c.instanceGroupManager = instanceGroupManager
  106919. c.regioninstancegroupmanagerdeleteinstanceconfigreq = regioninstancegroupmanagerdeleteinstanceconfigreq
  106920. return c
  106921. }
  106922. // Fields allows partial responses to be retrieved. See
  106923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  106924. // for more information.
  106925. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  106926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  106927. return c
  106928. }
  106929. // Context sets the context to be used in this call's Do method. Any
  106930. // pending HTTP request will be aborted if the provided context is
  106931. // canceled.
  106932. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall {
  106933. c.ctx_ = ctx
  106934. return c
  106935. }
  106936. // Header returns an http.Header that can be modified by the caller to
  106937. // add HTTP headers to the request.
  106938. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header {
  106939. if c.header_ == nil {
  106940. c.header_ = make(http.Header)
  106941. }
  106942. return c.header_
  106943. }
  106944. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  106945. reqHeaders := make(http.Header)
  106946. for k, v := range c.header_ {
  106947. reqHeaders[k] = v
  106948. }
  106949. reqHeaders.Set("User-Agent", c.s.userAgent())
  106950. var body io.Reader = nil
  106951. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq)
  106952. if err != nil {
  106953. return nil, err
  106954. }
  106955. reqHeaders.Set("Content-Type", "application/json")
  106956. c.urlParams_.Set("alt", alt)
  106957. c.urlParams_.Set("prettyPrint", "false")
  106958. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs")
  106959. urls += "?" + c.urlParams_.Encode()
  106960. req, err := http.NewRequest("POST", urls, body)
  106961. if err != nil {
  106962. return nil, err
  106963. }
  106964. req.Header = reqHeaders
  106965. googleapi.Expand(req.URL, map[string]string{
  106966. "project": c.project,
  106967. "region": c.region,
  106968. "instanceGroupManager": c.instanceGroupManager,
  106969. })
  106970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  106971. }
  106972. // Do executes the "compute.regionInstanceGroupManagers.deletePerInstanceConfigs" call.
  106973. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  106974. // status code is an error. Response headers are in either
  106975. // *Operation.ServerResponse.Header or (if a response was returned at
  106976. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  106977. // to check whether the returned error was because
  106978. // http.StatusNotModified was returned.
  106979. func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  106980. gensupport.SetOptions(c.urlParams_, opts...)
  106981. res, err := c.doRequest("json")
  106982. if res != nil && res.StatusCode == http.StatusNotModified {
  106983. if res.Body != nil {
  106984. res.Body.Close()
  106985. }
  106986. return nil, &googleapi.Error{
  106987. Code: res.StatusCode,
  106988. Header: res.Header,
  106989. }
  106990. }
  106991. if err != nil {
  106992. return nil, err
  106993. }
  106994. defer googleapi.CloseBody(res)
  106995. if err := googleapi.CheckResponse(res); err != nil {
  106996. return nil, err
  106997. }
  106998. ret := &Operation{
  106999. ServerResponse: googleapi.ServerResponse{
  107000. Header: res.Header,
  107001. HTTPStatusCode: res.StatusCode,
  107002. },
  107003. }
  107004. target := &ret
  107005. if err := gensupport.DecodeResponse(target, res); err != nil {
  107006. return nil, err
  107007. }
  107008. return ret, nil
  107009. // {
  107010. // "description": "Deletes selected per-instance configs for the managed instance group.",
  107011. // "httpMethod": "POST",
  107012. // "id": "compute.regionInstanceGroupManagers.deletePerInstanceConfigs",
  107013. // "parameterOrder": [
  107014. // "project",
  107015. // "region",
  107016. // "instanceGroupManager"
  107017. // ],
  107018. // "parameters": {
  107019. // "instanceGroupManager": {
  107020. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  107021. // "location": "path",
  107022. // "required": true,
  107023. // "type": "string"
  107024. // },
  107025. // "project": {
  107026. // "description": "Project ID for this request.",
  107027. // "location": "path",
  107028. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107029. // "required": true,
  107030. // "type": "string"
  107031. // },
  107032. // "region": {
  107033. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  107034. // "location": "path",
  107035. // "required": true,
  107036. // "type": "string"
  107037. // }
  107038. // },
  107039. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs",
  107040. // "request": {
  107041. // "$ref": "RegionInstanceGroupManagerDeleteInstanceConfigReq"
  107042. // },
  107043. // "response": {
  107044. // "$ref": "Operation"
  107045. // },
  107046. // "scopes": [
  107047. // "https://www.googleapis.com/auth/cloud-platform",
  107048. // "https://www.googleapis.com/auth/compute"
  107049. // ]
  107050. // }
  107051. }
  107052. // method id "compute.regionInstanceGroupManagers.get":
  107053. type RegionInstanceGroupManagersGetCall struct {
  107054. s *Service
  107055. project string
  107056. region string
  107057. instanceGroupManager string
  107058. urlParams_ gensupport.URLParams
  107059. ifNoneMatch_ string
  107060. ctx_ context.Context
  107061. header_ http.Header
  107062. }
  107063. // Get: Returns all of the details about the specified managed instance
  107064. // group.
  107065. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  107066. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107067. c.project = project
  107068. c.region = region
  107069. c.instanceGroupManager = instanceGroupManager
  107070. return c
  107071. }
  107072. // Fields allows partial responses to be retrieved. See
  107073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107074. // for more information.
  107075. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  107076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107077. return c
  107078. }
  107079. // IfNoneMatch sets the optional parameter which makes the operation
  107080. // fail if the object's ETag matches the given value. This is useful for
  107081. // getting updates only after the object has changed since the last
  107082. // request. Use googleapi.IsNotModified to check whether the response
  107083. // error from Do is the result of In-None-Match.
  107084. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  107085. c.ifNoneMatch_ = entityTag
  107086. return c
  107087. }
  107088. // Context sets the context to be used in this call's Do method. Any
  107089. // pending HTTP request will be aborted if the provided context is
  107090. // canceled.
  107091. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  107092. c.ctx_ = ctx
  107093. return c
  107094. }
  107095. // Header returns an http.Header that can be modified by the caller to
  107096. // add HTTP headers to the request.
  107097. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  107098. if c.header_ == nil {
  107099. c.header_ = make(http.Header)
  107100. }
  107101. return c.header_
  107102. }
  107103. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  107104. reqHeaders := make(http.Header)
  107105. for k, v := range c.header_ {
  107106. reqHeaders[k] = v
  107107. }
  107108. reqHeaders.Set("User-Agent", c.s.userAgent())
  107109. if c.ifNoneMatch_ != "" {
  107110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107111. }
  107112. var body io.Reader = nil
  107113. c.urlParams_.Set("alt", alt)
  107114. c.urlParams_.Set("prettyPrint", "false")
  107115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  107116. urls += "?" + c.urlParams_.Encode()
  107117. req, err := http.NewRequest("GET", urls, body)
  107118. if err != nil {
  107119. return nil, err
  107120. }
  107121. req.Header = reqHeaders
  107122. googleapi.Expand(req.URL, map[string]string{
  107123. "project": c.project,
  107124. "region": c.region,
  107125. "instanceGroupManager": c.instanceGroupManager,
  107126. })
  107127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107128. }
  107129. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  107130. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  107131. // non-2xx status code is an error. Response headers are in either
  107132. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  107133. // returned at all) in error.(*googleapi.Error).Header. Use
  107134. // googleapi.IsNotModified to check whether the returned error was
  107135. // because http.StatusNotModified was returned.
  107136. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  107137. gensupport.SetOptions(c.urlParams_, opts...)
  107138. res, err := c.doRequest("json")
  107139. if res != nil && res.StatusCode == http.StatusNotModified {
  107140. if res.Body != nil {
  107141. res.Body.Close()
  107142. }
  107143. return nil, &googleapi.Error{
  107144. Code: res.StatusCode,
  107145. Header: res.Header,
  107146. }
  107147. }
  107148. if err != nil {
  107149. return nil, err
  107150. }
  107151. defer googleapi.CloseBody(res)
  107152. if err := googleapi.CheckResponse(res); err != nil {
  107153. return nil, err
  107154. }
  107155. ret := &InstanceGroupManager{
  107156. ServerResponse: googleapi.ServerResponse{
  107157. Header: res.Header,
  107158. HTTPStatusCode: res.StatusCode,
  107159. },
  107160. }
  107161. target := &ret
  107162. if err := gensupport.DecodeResponse(target, res); err != nil {
  107163. return nil, err
  107164. }
  107165. return ret, nil
  107166. // {
  107167. // "description": "Returns all of the details about the specified managed instance group.",
  107168. // "httpMethod": "GET",
  107169. // "id": "compute.regionInstanceGroupManagers.get",
  107170. // "parameterOrder": [
  107171. // "project",
  107172. // "region",
  107173. // "instanceGroupManager"
  107174. // ],
  107175. // "parameters": {
  107176. // "instanceGroupManager": {
  107177. // "description": "Name of the managed instance group to return.",
  107178. // "location": "path",
  107179. // "required": true,
  107180. // "type": "string"
  107181. // },
  107182. // "project": {
  107183. // "description": "Project ID for this request.",
  107184. // "location": "path",
  107185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107186. // "required": true,
  107187. // "type": "string"
  107188. // },
  107189. // "region": {
  107190. // "description": "Name of the region scoping this request.",
  107191. // "location": "path",
  107192. // "required": true,
  107193. // "type": "string"
  107194. // }
  107195. // },
  107196. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  107197. // "response": {
  107198. // "$ref": "InstanceGroupManager"
  107199. // },
  107200. // "scopes": [
  107201. // "https://www.googleapis.com/auth/cloud-platform",
  107202. // "https://www.googleapis.com/auth/compute",
  107203. // "https://www.googleapis.com/auth/compute.readonly"
  107204. // ]
  107205. // }
  107206. }
  107207. // method id "compute.regionInstanceGroupManagers.insert":
  107208. type RegionInstanceGroupManagersInsertCall struct {
  107209. s *Service
  107210. project string
  107211. region string
  107212. instancegroupmanager *InstanceGroupManager
  107213. urlParams_ gensupport.URLParams
  107214. ctx_ context.Context
  107215. header_ http.Header
  107216. }
  107217. // Insert: Creates a managed instance group using the information that
  107218. // you specify in the request. After the group is created, instances in
  107219. // the group are created using the specified instance template. This
  107220. // operation is marked as DONE when the group is created even if the
  107221. // instances in the group have not yet been created. You must separately
  107222. // verify the status of the individual instances with the
  107223. // listmanagedinstances method.
  107224. //
  107225. // A regional managed instance group can contain up to 2000 instances.
  107226. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  107227. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107228. c.project = project
  107229. c.region = region
  107230. c.instancegroupmanager = instancegroupmanager
  107231. return c
  107232. }
  107233. // RequestId sets the optional parameter "requestId": An optional
  107234. // request ID to identify requests. Specify a unique request ID so that
  107235. // if you must retry your request, the server will know to ignore the
  107236. // request if it has already been completed.
  107237. //
  107238. // For example, consider a situation where you make an initial request
  107239. // and the request times out. If you make the request again with the
  107240. // same request ID, the server can check if original operation with the
  107241. // same request ID was received, and if so, will ignore the second
  107242. // request. This prevents clients from accidentally creating duplicate
  107243. // commitments.
  107244. //
  107245. // The request ID must be a valid UUID with the exception that zero UUID
  107246. // is not supported (00000000-0000-0000-0000-000000000000).
  107247. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  107248. c.urlParams_.Set("requestId", requestId)
  107249. return c
  107250. }
  107251. // Fields allows partial responses to be retrieved. See
  107252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107253. // for more information.
  107254. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  107255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107256. return c
  107257. }
  107258. // Context sets the context to be used in this call's Do method. Any
  107259. // pending HTTP request will be aborted if the provided context is
  107260. // canceled.
  107261. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  107262. c.ctx_ = ctx
  107263. return c
  107264. }
  107265. // Header returns an http.Header that can be modified by the caller to
  107266. // add HTTP headers to the request.
  107267. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  107268. if c.header_ == nil {
  107269. c.header_ = make(http.Header)
  107270. }
  107271. return c.header_
  107272. }
  107273. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  107274. reqHeaders := make(http.Header)
  107275. for k, v := range c.header_ {
  107276. reqHeaders[k] = v
  107277. }
  107278. reqHeaders.Set("User-Agent", c.s.userAgent())
  107279. var body io.Reader = nil
  107280. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  107281. if err != nil {
  107282. return nil, err
  107283. }
  107284. reqHeaders.Set("Content-Type", "application/json")
  107285. c.urlParams_.Set("alt", alt)
  107286. c.urlParams_.Set("prettyPrint", "false")
  107287. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  107288. urls += "?" + c.urlParams_.Encode()
  107289. req, err := http.NewRequest("POST", urls, body)
  107290. if err != nil {
  107291. return nil, err
  107292. }
  107293. req.Header = reqHeaders
  107294. googleapi.Expand(req.URL, map[string]string{
  107295. "project": c.project,
  107296. "region": c.region,
  107297. })
  107298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107299. }
  107300. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  107301. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  107302. // status code is an error. Response headers are in either
  107303. // *Operation.ServerResponse.Header or (if a response was returned at
  107304. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  107305. // to check whether the returned error was because
  107306. // http.StatusNotModified was returned.
  107307. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  107308. gensupport.SetOptions(c.urlParams_, opts...)
  107309. res, err := c.doRequest("json")
  107310. if res != nil && res.StatusCode == http.StatusNotModified {
  107311. if res.Body != nil {
  107312. res.Body.Close()
  107313. }
  107314. return nil, &googleapi.Error{
  107315. Code: res.StatusCode,
  107316. Header: res.Header,
  107317. }
  107318. }
  107319. if err != nil {
  107320. return nil, err
  107321. }
  107322. defer googleapi.CloseBody(res)
  107323. if err := googleapi.CheckResponse(res); err != nil {
  107324. return nil, err
  107325. }
  107326. ret := &Operation{
  107327. ServerResponse: googleapi.ServerResponse{
  107328. Header: res.Header,
  107329. HTTPStatusCode: res.StatusCode,
  107330. },
  107331. }
  107332. target := &ret
  107333. if err := gensupport.DecodeResponse(target, res); err != nil {
  107334. return nil, err
  107335. }
  107336. return ret, nil
  107337. // {
  107338. // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.\n\nA regional managed instance group can contain up to 2000 instances.",
  107339. // "httpMethod": "POST",
  107340. // "id": "compute.regionInstanceGroupManagers.insert",
  107341. // "parameterOrder": [
  107342. // "project",
  107343. // "region"
  107344. // ],
  107345. // "parameters": {
  107346. // "project": {
  107347. // "description": "Project ID for this request.",
  107348. // "location": "path",
  107349. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107350. // "required": true,
  107351. // "type": "string"
  107352. // },
  107353. // "region": {
  107354. // "description": "Name of the region scoping this request.",
  107355. // "location": "path",
  107356. // "required": true,
  107357. // "type": "string"
  107358. // },
  107359. // "requestId": {
  107360. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  107361. // "location": "query",
  107362. // "type": "string"
  107363. // }
  107364. // },
  107365. // "path": "{project}/regions/{region}/instanceGroupManagers",
  107366. // "request": {
  107367. // "$ref": "InstanceGroupManager"
  107368. // },
  107369. // "response": {
  107370. // "$ref": "Operation"
  107371. // },
  107372. // "scopes": [
  107373. // "https://www.googleapis.com/auth/cloud-platform",
  107374. // "https://www.googleapis.com/auth/compute"
  107375. // ]
  107376. // }
  107377. }
  107378. // method id "compute.regionInstanceGroupManagers.list":
  107379. type RegionInstanceGroupManagersListCall struct {
  107380. s *Service
  107381. project string
  107382. region string
  107383. urlParams_ gensupport.URLParams
  107384. ifNoneMatch_ string
  107385. ctx_ context.Context
  107386. header_ http.Header
  107387. }
  107388. // List: Retrieves the list of managed instance groups that are
  107389. // contained within the specified region.
  107390. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  107391. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107392. c.project = project
  107393. c.region = region
  107394. return c
  107395. }
  107396. // Filter sets the optional parameter "filter": A filter expression that
  107397. // filters resources listed in the response. The expression must specify
  107398. // the field name, a comparison operator, and the value that you want to
  107399. // use for filtering. The value must be a string, a number, or a
  107400. // boolean. The comparison operator must be either =, !=, >, or <.
  107401. //
  107402. // For example, if you are filtering Compute Engine instances, you can
  107403. // exclude instances named example-instance by specifying name !=
  107404. // example-instance.
  107405. //
  107406. // You can also filter nested fields. For example, you could specify
  107407. // scheduling.automaticRestart = false to include instances only if they
  107408. // are not scheduled for automatic restarts. You can use filtering on
  107409. // nested fields to filter based on resource labels.
  107410. //
  107411. // To filter on multiple expressions, provide each separate expression
  107412. // within parentheses. For example, (scheduling.automaticRestart = true)
  107413. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  107414. // AND expression. However, you can include AND and OR expressions
  107415. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  107416. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  107417. // true).
  107418. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  107419. c.urlParams_.Set("filter", filter)
  107420. return c
  107421. }
  107422. // MaxResults sets the optional parameter "maxResults": The maximum
  107423. // number of results per page that should be returned. If the number of
  107424. // available results is larger than maxResults, Compute Engine returns a
  107425. // nextPageToken that can be used to get the next page of results in
  107426. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  107427. // (Default: 500)
  107428. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  107429. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  107430. return c
  107431. }
  107432. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  107433. // a certain order. By default, results are returned in alphanumerical
  107434. // order based on the resource name.
  107435. //
  107436. // You can also sort results in descending order based on the creation
  107437. // timestamp using orderBy="creationTimestamp desc". This sorts results
  107438. // based on the creationTimestamp field in reverse chronological order
  107439. // (newest result first). Use this to sort resources like operations so
  107440. // that the newest operation is returned first.
  107441. //
  107442. // Currently, only sorting by name or creationTimestamp desc is
  107443. // supported.
  107444. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  107445. c.urlParams_.Set("orderBy", orderBy)
  107446. return c
  107447. }
  107448. // PageToken sets the optional parameter "pageToken": Specifies a page
  107449. // token to use. Set pageToken to the nextPageToken returned by a
  107450. // previous list request to get the next page of results.
  107451. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  107452. c.urlParams_.Set("pageToken", pageToken)
  107453. return c
  107454. }
  107455. // Fields allows partial responses to be retrieved. See
  107456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107457. // for more information.
  107458. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  107459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107460. return c
  107461. }
  107462. // IfNoneMatch sets the optional parameter which makes the operation
  107463. // fail if the object's ETag matches the given value. This is useful for
  107464. // getting updates only after the object has changed since the last
  107465. // request. Use googleapi.IsNotModified to check whether the response
  107466. // error from Do is the result of In-None-Match.
  107467. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  107468. c.ifNoneMatch_ = entityTag
  107469. return c
  107470. }
  107471. // Context sets the context to be used in this call's Do method. Any
  107472. // pending HTTP request will be aborted if the provided context is
  107473. // canceled.
  107474. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  107475. c.ctx_ = ctx
  107476. return c
  107477. }
  107478. // Header returns an http.Header that can be modified by the caller to
  107479. // add HTTP headers to the request.
  107480. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  107481. if c.header_ == nil {
  107482. c.header_ = make(http.Header)
  107483. }
  107484. return c.header_
  107485. }
  107486. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  107487. reqHeaders := make(http.Header)
  107488. for k, v := range c.header_ {
  107489. reqHeaders[k] = v
  107490. }
  107491. reqHeaders.Set("User-Agent", c.s.userAgent())
  107492. if c.ifNoneMatch_ != "" {
  107493. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  107494. }
  107495. var body io.Reader = nil
  107496. c.urlParams_.Set("alt", alt)
  107497. c.urlParams_.Set("prettyPrint", "false")
  107498. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  107499. urls += "?" + c.urlParams_.Encode()
  107500. req, err := http.NewRequest("GET", urls, body)
  107501. if err != nil {
  107502. return nil, err
  107503. }
  107504. req.Header = reqHeaders
  107505. googleapi.Expand(req.URL, map[string]string{
  107506. "project": c.project,
  107507. "region": c.region,
  107508. })
  107509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107510. }
  107511. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  107512. // Exactly one of *RegionInstanceGroupManagerList or error will be
  107513. // non-nil. Any non-2xx status code is an error. Response headers are in
  107514. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  107515. // response was returned at all) in error.(*googleapi.Error).Header. Use
  107516. // googleapi.IsNotModified to check whether the returned error was
  107517. // because http.StatusNotModified was returned.
  107518. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  107519. gensupport.SetOptions(c.urlParams_, opts...)
  107520. res, err := c.doRequest("json")
  107521. if res != nil && res.StatusCode == http.StatusNotModified {
  107522. if res.Body != nil {
  107523. res.Body.Close()
  107524. }
  107525. return nil, &googleapi.Error{
  107526. Code: res.StatusCode,
  107527. Header: res.Header,
  107528. }
  107529. }
  107530. if err != nil {
  107531. return nil, err
  107532. }
  107533. defer googleapi.CloseBody(res)
  107534. if err := googleapi.CheckResponse(res); err != nil {
  107535. return nil, err
  107536. }
  107537. ret := &RegionInstanceGroupManagerList{
  107538. ServerResponse: googleapi.ServerResponse{
  107539. Header: res.Header,
  107540. HTTPStatusCode: res.StatusCode,
  107541. },
  107542. }
  107543. target := &ret
  107544. if err := gensupport.DecodeResponse(target, res); err != nil {
  107545. return nil, err
  107546. }
  107547. return ret, nil
  107548. // {
  107549. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  107550. // "httpMethod": "GET",
  107551. // "id": "compute.regionInstanceGroupManagers.list",
  107552. // "parameterOrder": [
  107553. // "project",
  107554. // "region"
  107555. // ],
  107556. // "parameters": {
  107557. // "filter": {
  107558. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  107559. // "location": "query",
  107560. // "type": "string"
  107561. // },
  107562. // "maxResults": {
  107563. // "default": "500",
  107564. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  107565. // "format": "uint32",
  107566. // "location": "query",
  107567. // "minimum": "0",
  107568. // "type": "integer"
  107569. // },
  107570. // "orderBy": {
  107571. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  107572. // "location": "query",
  107573. // "type": "string"
  107574. // },
  107575. // "pageToken": {
  107576. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  107577. // "location": "query",
  107578. // "type": "string"
  107579. // },
  107580. // "project": {
  107581. // "description": "Project ID for this request.",
  107582. // "location": "path",
  107583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107584. // "required": true,
  107585. // "type": "string"
  107586. // },
  107587. // "region": {
  107588. // "description": "Name of the region scoping this request.",
  107589. // "location": "path",
  107590. // "required": true,
  107591. // "type": "string"
  107592. // }
  107593. // },
  107594. // "path": "{project}/regions/{region}/instanceGroupManagers",
  107595. // "response": {
  107596. // "$ref": "RegionInstanceGroupManagerList"
  107597. // },
  107598. // "scopes": [
  107599. // "https://www.googleapis.com/auth/cloud-platform",
  107600. // "https://www.googleapis.com/auth/compute",
  107601. // "https://www.googleapis.com/auth/compute.readonly"
  107602. // ]
  107603. // }
  107604. }
  107605. // Pages invokes f for each page of results.
  107606. // A non-nil error returned from f will halt the iteration.
  107607. // The provided context supersedes any context provided to the Context method.
  107608. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  107609. c.ctx_ = ctx
  107610. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  107611. for {
  107612. x, err := c.Do()
  107613. if err != nil {
  107614. return err
  107615. }
  107616. if err := f(x); err != nil {
  107617. return err
  107618. }
  107619. if x.NextPageToken == "" {
  107620. return nil
  107621. }
  107622. c.PageToken(x.NextPageToken)
  107623. }
  107624. }
  107625. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  107626. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  107627. s *Service
  107628. project string
  107629. region string
  107630. instanceGroupManager string
  107631. urlParams_ gensupport.URLParams
  107632. ctx_ context.Context
  107633. header_ http.Header
  107634. }
  107635. // ListManagedInstances: Lists the instances in the managed instance
  107636. // group and instances that are scheduled to be created. The list
  107637. // includes any current actions that the group has scheduled for its
  107638. // instances.
  107639. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  107640. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107641. c.project = project
  107642. c.region = region
  107643. c.instanceGroupManager = instanceGroupManager
  107644. return c
  107645. }
  107646. // Filter sets the optional parameter "filter": A filter expression that
  107647. // filters resources listed in the response. The expression must specify
  107648. // the field name, a comparison operator, and the value that you want to
  107649. // use for filtering. The value must be a string, a number, or a
  107650. // boolean. The comparison operator must be either =, !=, >, or <.
  107651. //
  107652. // For example, if you are filtering Compute Engine instances, you can
  107653. // exclude instances named example-instance by specifying name !=
  107654. // example-instance.
  107655. //
  107656. // You can also filter nested fields. For example, you could specify
  107657. // scheduling.automaticRestart = false to include instances only if they
  107658. // are not scheduled for automatic restarts. You can use filtering on
  107659. // nested fields to filter based on resource labels.
  107660. //
  107661. // To filter on multiple expressions, provide each separate expression
  107662. // within parentheses. For example, (scheduling.automaticRestart = true)
  107663. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  107664. // AND expression. However, you can include AND and OR expressions
  107665. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  107666. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  107667. // true).
  107668. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  107669. c.urlParams_.Set("filter", filter)
  107670. return c
  107671. }
  107672. // MaxResults sets the optional parameter "maxResults": The maximum
  107673. // number of results per page that should be returned. If the number of
  107674. // available results is larger than maxResults, Compute Engine returns a
  107675. // nextPageToken that can be used to get the next page of results in
  107676. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  107677. // (Default: 500)
  107678. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  107679. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  107680. return c
  107681. }
  107682. // OrderBy sets the optional parameter "order_by": Sorts list results by
  107683. // a certain order. By default, results are returned in alphanumerical
  107684. // order based on the resource name.
  107685. //
  107686. // You can also sort results in descending order based on the creation
  107687. // timestamp using orderBy="creationTimestamp desc". This sorts results
  107688. // based on the creationTimestamp field in reverse chronological order
  107689. // (newest result first). Use this to sort resources like operations so
  107690. // that the newest operation is returned first.
  107691. //
  107692. // Currently, only sorting by name or creationTimestamp desc is
  107693. // supported.
  107694. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  107695. c.urlParams_.Set("order_by", orderBy)
  107696. return c
  107697. }
  107698. // PageToken sets the optional parameter "pageToken": Specifies a page
  107699. // token to use. Set pageToken to the nextPageToken returned by a
  107700. // previous list request to get the next page of results.
  107701. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  107702. c.urlParams_.Set("pageToken", pageToken)
  107703. return c
  107704. }
  107705. // Fields allows partial responses to be retrieved. See
  107706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107707. // for more information.
  107708. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  107709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107710. return c
  107711. }
  107712. // Context sets the context to be used in this call's Do method. Any
  107713. // pending HTTP request will be aborted if the provided context is
  107714. // canceled.
  107715. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  107716. c.ctx_ = ctx
  107717. return c
  107718. }
  107719. // Header returns an http.Header that can be modified by the caller to
  107720. // add HTTP headers to the request.
  107721. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  107722. if c.header_ == nil {
  107723. c.header_ = make(http.Header)
  107724. }
  107725. return c.header_
  107726. }
  107727. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  107728. reqHeaders := make(http.Header)
  107729. for k, v := range c.header_ {
  107730. reqHeaders[k] = v
  107731. }
  107732. reqHeaders.Set("User-Agent", c.s.userAgent())
  107733. var body io.Reader = nil
  107734. c.urlParams_.Set("alt", alt)
  107735. c.urlParams_.Set("prettyPrint", "false")
  107736. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  107737. urls += "?" + c.urlParams_.Encode()
  107738. req, err := http.NewRequest("POST", urls, body)
  107739. if err != nil {
  107740. return nil, err
  107741. }
  107742. req.Header = reqHeaders
  107743. googleapi.Expand(req.URL, map[string]string{
  107744. "project": c.project,
  107745. "region": c.region,
  107746. "instanceGroupManager": c.instanceGroupManager,
  107747. })
  107748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107749. }
  107750. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  107751. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  107752. // error will be non-nil. Any non-2xx status code is an error. Response
  107753. // headers are in either
  107754. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  107755. // r or (if a response was returned at all) in
  107756. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  107757. // whether the returned error was because http.StatusNotModified was
  107758. // returned.
  107759. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  107760. gensupport.SetOptions(c.urlParams_, opts...)
  107761. res, err := c.doRequest("json")
  107762. if res != nil && res.StatusCode == http.StatusNotModified {
  107763. if res.Body != nil {
  107764. res.Body.Close()
  107765. }
  107766. return nil, &googleapi.Error{
  107767. Code: res.StatusCode,
  107768. Header: res.Header,
  107769. }
  107770. }
  107771. if err != nil {
  107772. return nil, err
  107773. }
  107774. defer googleapi.CloseBody(res)
  107775. if err := googleapi.CheckResponse(res); err != nil {
  107776. return nil, err
  107777. }
  107778. ret := &RegionInstanceGroupManagersListInstancesResponse{
  107779. ServerResponse: googleapi.ServerResponse{
  107780. Header: res.Header,
  107781. HTTPStatusCode: res.StatusCode,
  107782. },
  107783. }
  107784. target := &ret
  107785. if err := gensupport.DecodeResponse(target, res); err != nil {
  107786. return nil, err
  107787. }
  107788. return ret, nil
  107789. // {
  107790. // "description": "Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances.",
  107791. // "httpMethod": "POST",
  107792. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  107793. // "parameterOrder": [
  107794. // "project",
  107795. // "region",
  107796. // "instanceGroupManager"
  107797. // ],
  107798. // "parameters": {
  107799. // "filter": {
  107800. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  107801. // "location": "query",
  107802. // "type": "string"
  107803. // },
  107804. // "instanceGroupManager": {
  107805. // "description": "The name of the managed instance group.",
  107806. // "location": "path",
  107807. // "required": true,
  107808. // "type": "string"
  107809. // },
  107810. // "maxResults": {
  107811. // "default": "500",
  107812. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  107813. // "format": "uint32",
  107814. // "location": "query",
  107815. // "minimum": "0",
  107816. // "type": "integer"
  107817. // },
  107818. // "order_by": {
  107819. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  107820. // "location": "query",
  107821. // "type": "string"
  107822. // },
  107823. // "pageToken": {
  107824. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  107825. // "location": "query",
  107826. // "type": "string"
  107827. // },
  107828. // "project": {
  107829. // "description": "Project ID for this request.",
  107830. // "location": "path",
  107831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  107832. // "required": true,
  107833. // "type": "string"
  107834. // },
  107835. // "region": {
  107836. // "description": "Name of the region scoping this request.",
  107837. // "location": "path",
  107838. // "required": true,
  107839. // "type": "string"
  107840. // }
  107841. // },
  107842. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  107843. // "response": {
  107844. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  107845. // },
  107846. // "scopes": [
  107847. // "https://www.googleapis.com/auth/cloud-platform",
  107848. // "https://www.googleapis.com/auth/compute",
  107849. // "https://www.googleapis.com/auth/compute.readonly"
  107850. // ]
  107851. // }
  107852. }
  107853. // Pages invokes f for each page of results.
  107854. // A non-nil error returned from f will halt the iteration.
  107855. // The provided context supersedes any context provided to the Context method.
  107856. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error {
  107857. c.ctx_ = ctx
  107858. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  107859. for {
  107860. x, err := c.Do()
  107861. if err != nil {
  107862. return err
  107863. }
  107864. if err := f(x); err != nil {
  107865. return err
  107866. }
  107867. if x.NextPageToken == "" {
  107868. return nil
  107869. }
  107870. c.PageToken(x.NextPageToken)
  107871. }
  107872. }
  107873. // method id "compute.regionInstanceGroupManagers.listPerInstanceConfigs":
  107874. type RegionInstanceGroupManagersListPerInstanceConfigsCall struct {
  107875. s *Service
  107876. project string
  107877. region string
  107878. instanceGroupManager string
  107879. urlParams_ gensupport.URLParams
  107880. ctx_ context.Context
  107881. header_ http.Header
  107882. }
  107883. // ListPerInstanceConfigs: Lists all of the per-instance configs defined
  107884. // for the managed instance group.
  107885. func (r *RegionInstanceGroupManagersService) ListPerInstanceConfigs(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  107886. c := &RegionInstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  107887. c.project = project
  107888. c.region = region
  107889. c.instanceGroupManager = instanceGroupManager
  107890. return c
  107891. }
  107892. // Filter sets the optional parameter "filter": A filter expression that
  107893. // filters resources listed in the response. The expression must specify
  107894. // the field name, a comparison operator, and the value that you want to
  107895. // use for filtering. The value must be a string, a number, or a
  107896. // boolean. The comparison operator must be either =, !=, >, or <.
  107897. //
  107898. // For example, if you are filtering Compute Engine instances, you can
  107899. // exclude instances named example-instance by specifying name !=
  107900. // example-instance.
  107901. //
  107902. // You can also filter nested fields. For example, you could specify
  107903. // scheduling.automaticRestart = false to include instances only if they
  107904. // are not scheduled for automatic restarts. You can use filtering on
  107905. // nested fields to filter based on resource labels.
  107906. //
  107907. // To filter on multiple expressions, provide each separate expression
  107908. // within parentheses. For example, (scheduling.automaticRestart = true)
  107909. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  107910. // AND expression. However, you can include AND and OR expressions
  107911. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  107912. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  107913. // true).
  107914. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  107915. c.urlParams_.Set("filter", filter)
  107916. return c
  107917. }
  107918. // MaxResults sets the optional parameter "maxResults": The maximum
  107919. // number of results per page that should be returned. If the number of
  107920. // available results is larger than maxResults, Compute Engine returns a
  107921. // nextPageToken that can be used to get the next page of results in
  107922. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  107923. // (Default: 500)
  107924. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  107925. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  107926. return c
  107927. }
  107928. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  107929. // a certain order. By default, results are returned in alphanumerical
  107930. // order based on the resource name.
  107931. //
  107932. // You can also sort results in descending order based on the creation
  107933. // timestamp using orderBy="creationTimestamp desc". This sorts results
  107934. // based on the creationTimestamp field in reverse chronological order
  107935. // (newest result first). Use this to sort resources like operations so
  107936. // that the newest operation is returned first.
  107937. //
  107938. // Currently, only sorting by name or creationTimestamp desc is
  107939. // supported.
  107940. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  107941. c.urlParams_.Set("orderBy", orderBy)
  107942. return c
  107943. }
  107944. // PageToken sets the optional parameter "pageToken": Specifies a page
  107945. // token to use. Set pageToken to the nextPageToken returned by a
  107946. // previous list request to get the next page of results.
  107947. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  107948. c.urlParams_.Set("pageToken", pageToken)
  107949. return c
  107950. }
  107951. // Fields allows partial responses to be retrieved. See
  107952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  107953. // for more information.
  107954. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  107955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  107956. return c
  107957. }
  107958. // Context sets the context to be used in this call's Do method. Any
  107959. // pending HTTP request will be aborted if the provided context is
  107960. // canceled.
  107961. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListPerInstanceConfigsCall {
  107962. c.ctx_ = ctx
  107963. return c
  107964. }
  107965. // Header returns an http.Header that can be modified by the caller to
  107966. // add HTTP headers to the request.
  107967. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header {
  107968. if c.header_ == nil {
  107969. c.header_ = make(http.Header)
  107970. }
  107971. return c.header_
  107972. }
  107973. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  107974. reqHeaders := make(http.Header)
  107975. for k, v := range c.header_ {
  107976. reqHeaders[k] = v
  107977. }
  107978. reqHeaders.Set("User-Agent", c.s.userAgent())
  107979. var body io.Reader = nil
  107980. c.urlParams_.Set("alt", alt)
  107981. c.urlParams_.Set("prettyPrint", "false")
  107982. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs")
  107983. urls += "?" + c.urlParams_.Encode()
  107984. req, err := http.NewRequest("POST", urls, body)
  107985. if err != nil {
  107986. return nil, err
  107987. }
  107988. req.Header = reqHeaders
  107989. googleapi.Expand(req.URL, map[string]string{
  107990. "project": c.project,
  107991. "region": c.region,
  107992. "instanceGroupManager": c.instanceGroupManager,
  107993. })
  107994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  107995. }
  107996. // Do executes the "compute.regionInstanceGroupManagers.listPerInstanceConfigs" call.
  107997. // Exactly one of *RegionInstanceGroupManagersListInstanceConfigsResp or
  107998. // error will be non-nil. Any non-2xx status code is an error. Response
  107999. // headers are in either
  108000. // *RegionInstanceGroupManagersListInstanceConfigsResp.ServerResponse.Hea
  108001. // der or (if a response was returned at all) in
  108002. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  108003. // whether the returned error was because http.StatusNotModified was
  108004. // returned.
  108005. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstanceConfigsResp, error) {
  108006. gensupport.SetOptions(c.urlParams_, opts...)
  108007. res, err := c.doRequest("json")
  108008. if res != nil && res.StatusCode == http.StatusNotModified {
  108009. if res.Body != nil {
  108010. res.Body.Close()
  108011. }
  108012. return nil, &googleapi.Error{
  108013. Code: res.StatusCode,
  108014. Header: res.Header,
  108015. }
  108016. }
  108017. if err != nil {
  108018. return nil, err
  108019. }
  108020. defer googleapi.CloseBody(res)
  108021. if err := googleapi.CheckResponse(res); err != nil {
  108022. return nil, err
  108023. }
  108024. ret := &RegionInstanceGroupManagersListInstanceConfigsResp{
  108025. ServerResponse: googleapi.ServerResponse{
  108026. Header: res.Header,
  108027. HTTPStatusCode: res.StatusCode,
  108028. },
  108029. }
  108030. target := &ret
  108031. if err := gensupport.DecodeResponse(target, res); err != nil {
  108032. return nil, err
  108033. }
  108034. return ret, nil
  108035. // {
  108036. // "description": "Lists all of the per-instance configs defined for the managed instance group.",
  108037. // "httpMethod": "POST",
  108038. // "id": "compute.regionInstanceGroupManagers.listPerInstanceConfigs",
  108039. // "parameterOrder": [
  108040. // "project",
  108041. // "region",
  108042. // "instanceGroupManager"
  108043. // ],
  108044. // "parameters": {
  108045. // "filter": {
  108046. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  108047. // "location": "query",
  108048. // "type": "string"
  108049. // },
  108050. // "instanceGroupManager": {
  108051. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  108052. // "location": "path",
  108053. // "required": true,
  108054. // "type": "string"
  108055. // },
  108056. // "maxResults": {
  108057. // "default": "500",
  108058. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  108059. // "format": "uint32",
  108060. // "location": "query",
  108061. // "minimum": "0",
  108062. // "type": "integer"
  108063. // },
  108064. // "orderBy": {
  108065. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  108066. // "location": "query",
  108067. // "type": "string"
  108068. // },
  108069. // "pageToken": {
  108070. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  108071. // "location": "query",
  108072. // "type": "string"
  108073. // },
  108074. // "project": {
  108075. // "description": "Project ID for this request.",
  108076. // "location": "path",
  108077. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108078. // "required": true,
  108079. // "type": "string"
  108080. // },
  108081. // "region": {
  108082. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  108083. // "location": "path",
  108084. // "required": true,
  108085. // "type": "string"
  108086. // }
  108087. // },
  108088. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs",
  108089. // "response": {
  108090. // "$ref": "RegionInstanceGroupManagersListInstanceConfigsResp"
  108091. // },
  108092. // "scopes": [
  108093. // "https://www.googleapis.com/auth/cloud-platform",
  108094. // "https://www.googleapis.com/auth/compute",
  108095. // "https://www.googleapis.com/auth/compute.readonly"
  108096. // ]
  108097. // }
  108098. }
  108099. // Pages invokes f for each page of results.
  108100. // A non-nil error returned from f will halt the iteration.
  108101. // The provided context supersedes any context provided to the Context method.
  108102. func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstanceConfigsResp) error) error {
  108103. c.ctx_ = ctx
  108104. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  108105. for {
  108106. x, err := c.Do()
  108107. if err != nil {
  108108. return err
  108109. }
  108110. if err := f(x); err != nil {
  108111. return err
  108112. }
  108113. if x.NextPageToken == "" {
  108114. return nil
  108115. }
  108116. c.PageToken(x.NextPageToken)
  108117. }
  108118. }
  108119. // method id "compute.regionInstanceGroupManagers.patch":
  108120. type RegionInstanceGroupManagersPatchCall struct {
  108121. s *Service
  108122. project string
  108123. region string
  108124. instanceGroupManager string
  108125. instancegroupmanager *InstanceGroupManager
  108126. urlParams_ gensupport.URLParams
  108127. ctx_ context.Context
  108128. header_ http.Header
  108129. }
  108130. // Patch: Updates a managed instance group using the information that
  108131. // you specify in the request. This operation is marked as DONE when the
  108132. // group is patched even if the instances in the group are still in the
  108133. // process of being patched. You must separately verify the status of
  108134. // the individual instances with the listmanagedinstances method. This
  108135. // method supports PATCH semantics and uses the JSON merge patch format
  108136. // and processing rules.
  108137. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  108138. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108139. c.project = project
  108140. c.region = region
  108141. c.instanceGroupManager = instanceGroupManager
  108142. c.instancegroupmanager = instancegroupmanager
  108143. return c
  108144. }
  108145. // RequestId sets the optional parameter "requestId": An optional
  108146. // request ID to identify requests. Specify a unique request ID so that
  108147. // if you must retry your request, the server will know to ignore the
  108148. // request if it has already been completed.
  108149. //
  108150. // For example, consider a situation where you make an initial request
  108151. // and the request times out. If you make the request again with the
  108152. // same request ID, the server can check if original operation with the
  108153. // same request ID was received, and if so, will ignore the second
  108154. // request. This prevents clients from accidentally creating duplicate
  108155. // commitments.
  108156. //
  108157. // The request ID must be a valid UUID with the exception that zero UUID
  108158. // is not supported (00000000-0000-0000-0000-000000000000).
  108159. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  108160. c.urlParams_.Set("requestId", requestId)
  108161. return c
  108162. }
  108163. // Fields allows partial responses to be retrieved. See
  108164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108165. // for more information.
  108166. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  108167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108168. return c
  108169. }
  108170. // Context sets the context to be used in this call's Do method. Any
  108171. // pending HTTP request will be aborted if the provided context is
  108172. // canceled.
  108173. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  108174. c.ctx_ = ctx
  108175. return c
  108176. }
  108177. // Header returns an http.Header that can be modified by the caller to
  108178. // add HTTP headers to the request.
  108179. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  108180. if c.header_ == nil {
  108181. c.header_ = make(http.Header)
  108182. }
  108183. return c.header_
  108184. }
  108185. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  108186. reqHeaders := make(http.Header)
  108187. for k, v := range c.header_ {
  108188. reqHeaders[k] = v
  108189. }
  108190. reqHeaders.Set("User-Agent", c.s.userAgent())
  108191. var body io.Reader = nil
  108192. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  108193. if err != nil {
  108194. return nil, err
  108195. }
  108196. reqHeaders.Set("Content-Type", "application/json")
  108197. c.urlParams_.Set("alt", alt)
  108198. c.urlParams_.Set("prettyPrint", "false")
  108199. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  108200. urls += "?" + c.urlParams_.Encode()
  108201. req, err := http.NewRequest("PATCH", urls, body)
  108202. if err != nil {
  108203. return nil, err
  108204. }
  108205. req.Header = reqHeaders
  108206. googleapi.Expand(req.URL, map[string]string{
  108207. "project": c.project,
  108208. "region": c.region,
  108209. "instanceGroupManager": c.instanceGroupManager,
  108210. })
  108211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108212. }
  108213. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  108214. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108215. // status code is an error. Response headers are in either
  108216. // *Operation.ServerResponse.Header or (if a response was returned at
  108217. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108218. // to check whether the returned error was because
  108219. // http.StatusNotModified was returned.
  108220. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108221. gensupport.SetOptions(c.urlParams_, opts...)
  108222. res, err := c.doRequest("json")
  108223. if res != nil && res.StatusCode == http.StatusNotModified {
  108224. if res.Body != nil {
  108225. res.Body.Close()
  108226. }
  108227. return nil, &googleapi.Error{
  108228. Code: res.StatusCode,
  108229. Header: res.Header,
  108230. }
  108231. }
  108232. if err != nil {
  108233. return nil, err
  108234. }
  108235. defer googleapi.CloseBody(res)
  108236. if err := googleapi.CheckResponse(res); err != nil {
  108237. return nil, err
  108238. }
  108239. ret := &Operation{
  108240. ServerResponse: googleapi.ServerResponse{
  108241. Header: res.Header,
  108242. HTTPStatusCode: res.StatusCode,
  108243. },
  108244. }
  108245. target := &ret
  108246. if err := gensupport.DecodeResponse(target, res); err != nil {
  108247. return nil, err
  108248. }
  108249. return ret, nil
  108250. // {
  108251. // "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  108252. // "httpMethod": "PATCH",
  108253. // "id": "compute.regionInstanceGroupManagers.patch",
  108254. // "parameterOrder": [
  108255. // "project",
  108256. // "region",
  108257. // "instanceGroupManager"
  108258. // ],
  108259. // "parameters": {
  108260. // "instanceGroupManager": {
  108261. // "description": "The name of the instance group manager.",
  108262. // "location": "path",
  108263. // "required": true,
  108264. // "type": "string"
  108265. // },
  108266. // "project": {
  108267. // "description": "Project ID for this request.",
  108268. // "location": "path",
  108269. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108270. // "required": true,
  108271. // "type": "string"
  108272. // },
  108273. // "region": {
  108274. // "description": "Name of the region scoping this request.",
  108275. // "location": "path",
  108276. // "required": true,
  108277. // "type": "string"
  108278. // },
  108279. // "requestId": {
  108280. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108281. // "location": "query",
  108282. // "type": "string"
  108283. // }
  108284. // },
  108285. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  108286. // "request": {
  108287. // "$ref": "InstanceGroupManager"
  108288. // },
  108289. // "response": {
  108290. // "$ref": "Operation"
  108291. // },
  108292. // "scopes": [
  108293. // "https://www.googleapis.com/auth/cloud-platform",
  108294. // "https://www.googleapis.com/auth/compute"
  108295. // ]
  108296. // }
  108297. }
  108298. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  108299. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  108300. s *Service
  108301. project string
  108302. region string
  108303. instanceGroupManager string
  108304. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  108305. urlParams_ gensupport.URLParams
  108306. ctx_ context.Context
  108307. header_ http.Header
  108308. }
  108309. // RecreateInstances: Flags the specified instances in the managed
  108310. // instance group to be immediately recreated. The instances are deleted
  108311. // and recreated using the current instance template for the managed
  108312. // instance group. This operation is marked as DONE when the flag is set
  108313. // even if the instances have not yet been recreated. You must
  108314. // separately verify the status of the recreating action with the
  108315. // listmanagedinstances method.
  108316. //
  108317. // If the group is part of a backend service that has enabled connection
  108318. // draining, it can take up to 60 seconds after the connection draining
  108319. // duration has elapsed before the VM instance is removed or
  108320. // deleted.
  108321. //
  108322. // You can specify a maximum of 1000 instances with this method per
  108323. // request.
  108324. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  108325. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108326. c.project = project
  108327. c.region = region
  108328. c.instanceGroupManager = instanceGroupManager
  108329. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  108330. return c
  108331. }
  108332. // RequestId sets the optional parameter "requestId": An optional
  108333. // request ID to identify requests. Specify a unique request ID so that
  108334. // if you must retry your request, the server will know to ignore the
  108335. // request if it has already been completed.
  108336. //
  108337. // For example, consider a situation where you make an initial request
  108338. // and the request times out. If you make the request again with the
  108339. // same request ID, the server can check if original operation with the
  108340. // same request ID was received, and if so, will ignore the second
  108341. // request. This prevents clients from accidentally creating duplicate
  108342. // commitments.
  108343. //
  108344. // The request ID must be a valid UUID with the exception that zero UUID
  108345. // is not supported (00000000-0000-0000-0000-000000000000).
  108346. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  108347. c.urlParams_.Set("requestId", requestId)
  108348. return c
  108349. }
  108350. // Fields allows partial responses to be retrieved. See
  108351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108352. // for more information.
  108353. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  108354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108355. return c
  108356. }
  108357. // Context sets the context to be used in this call's Do method. Any
  108358. // pending HTTP request will be aborted if the provided context is
  108359. // canceled.
  108360. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  108361. c.ctx_ = ctx
  108362. return c
  108363. }
  108364. // Header returns an http.Header that can be modified by the caller to
  108365. // add HTTP headers to the request.
  108366. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  108367. if c.header_ == nil {
  108368. c.header_ = make(http.Header)
  108369. }
  108370. return c.header_
  108371. }
  108372. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  108373. reqHeaders := make(http.Header)
  108374. for k, v := range c.header_ {
  108375. reqHeaders[k] = v
  108376. }
  108377. reqHeaders.Set("User-Agent", c.s.userAgent())
  108378. var body io.Reader = nil
  108379. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  108380. if err != nil {
  108381. return nil, err
  108382. }
  108383. reqHeaders.Set("Content-Type", "application/json")
  108384. c.urlParams_.Set("alt", alt)
  108385. c.urlParams_.Set("prettyPrint", "false")
  108386. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  108387. urls += "?" + c.urlParams_.Encode()
  108388. req, err := http.NewRequest("POST", urls, body)
  108389. if err != nil {
  108390. return nil, err
  108391. }
  108392. req.Header = reqHeaders
  108393. googleapi.Expand(req.URL, map[string]string{
  108394. "project": c.project,
  108395. "region": c.region,
  108396. "instanceGroupManager": c.instanceGroupManager,
  108397. })
  108398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108399. }
  108400. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  108401. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108402. // status code is an error. Response headers are in either
  108403. // *Operation.ServerResponse.Header or (if a response was returned at
  108404. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108405. // to check whether the returned error was because
  108406. // http.StatusNotModified was returned.
  108407. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108408. gensupport.SetOptions(c.urlParams_, opts...)
  108409. res, err := c.doRequest("json")
  108410. if res != nil && res.StatusCode == http.StatusNotModified {
  108411. if res.Body != nil {
  108412. res.Body.Close()
  108413. }
  108414. return nil, &googleapi.Error{
  108415. Code: res.StatusCode,
  108416. Header: res.Header,
  108417. }
  108418. }
  108419. if err != nil {
  108420. return nil, err
  108421. }
  108422. defer googleapi.CloseBody(res)
  108423. if err := googleapi.CheckResponse(res); err != nil {
  108424. return nil, err
  108425. }
  108426. ret := &Operation{
  108427. ServerResponse: googleapi.ServerResponse{
  108428. Header: res.Header,
  108429. HTTPStatusCode: res.StatusCode,
  108430. },
  108431. }
  108432. target := &ret
  108433. if err := gensupport.DecodeResponse(target, res); err != nil {
  108434. return nil, err
  108435. }
  108436. return ret, nil
  108437. // {
  108438. // "description": "Flags the specified instances in the managed instance group to be immediately recreated. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.\n\nYou can specify a maximum of 1000 instances with this method per request.",
  108439. // "httpMethod": "POST",
  108440. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  108441. // "parameterOrder": [
  108442. // "project",
  108443. // "region",
  108444. // "instanceGroupManager"
  108445. // ],
  108446. // "parameters": {
  108447. // "instanceGroupManager": {
  108448. // "description": "Name of the managed instance group.",
  108449. // "location": "path",
  108450. // "required": true,
  108451. // "type": "string"
  108452. // },
  108453. // "project": {
  108454. // "description": "Project ID for this request.",
  108455. // "location": "path",
  108456. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108457. // "required": true,
  108458. // "type": "string"
  108459. // },
  108460. // "region": {
  108461. // "description": "Name of the region scoping this request.",
  108462. // "location": "path",
  108463. // "required": true,
  108464. // "type": "string"
  108465. // },
  108466. // "requestId": {
  108467. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108468. // "location": "query",
  108469. // "type": "string"
  108470. // }
  108471. // },
  108472. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  108473. // "request": {
  108474. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  108475. // },
  108476. // "response": {
  108477. // "$ref": "Operation"
  108478. // },
  108479. // "scopes": [
  108480. // "https://www.googleapis.com/auth/cloud-platform",
  108481. // "https://www.googleapis.com/auth/compute"
  108482. // ]
  108483. // }
  108484. }
  108485. // method id "compute.regionInstanceGroupManagers.resize":
  108486. type RegionInstanceGroupManagersResizeCall struct {
  108487. s *Service
  108488. project string
  108489. region string
  108490. instanceGroupManager string
  108491. urlParams_ gensupport.URLParams
  108492. ctx_ context.Context
  108493. header_ http.Header
  108494. }
  108495. // Resize: Changes the intended size of the managed instance group. If
  108496. // you increase the size, the group creates new instances using the
  108497. // current instance template. If you decrease the size, the group
  108498. // deletes one or more instances.
  108499. //
  108500. // The resize operation is marked DONE if the resize request is
  108501. // successful. The underlying actions take additional time. You must
  108502. // separately verify the status of the creating or deleting actions with
  108503. // the listmanagedinstances method.
  108504. //
  108505. // If the group is part of a backend service that has enabled connection
  108506. // draining, it can take up to 60 seconds after the connection draining
  108507. // duration has elapsed before the VM instance is removed or deleted.
  108508. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  108509. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108510. c.project = project
  108511. c.region = region
  108512. c.instanceGroupManager = instanceGroupManager
  108513. c.urlParams_.Set("size", fmt.Sprint(size))
  108514. return c
  108515. }
  108516. // RequestId sets the optional parameter "requestId": An optional
  108517. // request ID to identify requests. Specify a unique request ID so that
  108518. // if you must retry your request, the server will know to ignore the
  108519. // request if it has already been completed.
  108520. //
  108521. // For example, consider a situation where you make an initial request
  108522. // and the request times out. If you make the request again with the
  108523. // same request ID, the server can check if original operation with the
  108524. // same request ID was received, and if so, will ignore the second
  108525. // request. This prevents clients from accidentally creating duplicate
  108526. // commitments.
  108527. //
  108528. // The request ID must be a valid UUID with the exception that zero UUID
  108529. // is not supported (00000000-0000-0000-0000-000000000000).
  108530. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  108531. c.urlParams_.Set("requestId", requestId)
  108532. return c
  108533. }
  108534. // Fields allows partial responses to be retrieved. See
  108535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108536. // for more information.
  108537. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  108538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108539. return c
  108540. }
  108541. // Context sets the context to be used in this call's Do method. Any
  108542. // pending HTTP request will be aborted if the provided context is
  108543. // canceled.
  108544. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  108545. c.ctx_ = ctx
  108546. return c
  108547. }
  108548. // Header returns an http.Header that can be modified by the caller to
  108549. // add HTTP headers to the request.
  108550. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  108551. if c.header_ == nil {
  108552. c.header_ = make(http.Header)
  108553. }
  108554. return c.header_
  108555. }
  108556. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  108557. reqHeaders := make(http.Header)
  108558. for k, v := range c.header_ {
  108559. reqHeaders[k] = v
  108560. }
  108561. reqHeaders.Set("User-Agent", c.s.userAgent())
  108562. var body io.Reader = nil
  108563. c.urlParams_.Set("alt", alt)
  108564. c.urlParams_.Set("prettyPrint", "false")
  108565. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  108566. urls += "?" + c.urlParams_.Encode()
  108567. req, err := http.NewRequest("POST", urls, body)
  108568. if err != nil {
  108569. return nil, err
  108570. }
  108571. req.Header = reqHeaders
  108572. googleapi.Expand(req.URL, map[string]string{
  108573. "project": c.project,
  108574. "region": c.region,
  108575. "instanceGroupManager": c.instanceGroupManager,
  108576. })
  108577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108578. }
  108579. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  108580. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108581. // status code is an error. Response headers are in either
  108582. // *Operation.ServerResponse.Header or (if a response was returned at
  108583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108584. // to check whether the returned error was because
  108585. // http.StatusNotModified was returned.
  108586. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108587. gensupport.SetOptions(c.urlParams_, opts...)
  108588. res, err := c.doRequest("json")
  108589. if res != nil && res.StatusCode == http.StatusNotModified {
  108590. if res.Body != nil {
  108591. res.Body.Close()
  108592. }
  108593. return nil, &googleapi.Error{
  108594. Code: res.StatusCode,
  108595. Header: res.Header,
  108596. }
  108597. }
  108598. if err != nil {
  108599. return nil, err
  108600. }
  108601. defer googleapi.CloseBody(res)
  108602. if err := googleapi.CheckResponse(res); err != nil {
  108603. return nil, err
  108604. }
  108605. ret := &Operation{
  108606. ServerResponse: googleapi.ServerResponse{
  108607. Header: res.Header,
  108608. HTTPStatusCode: res.StatusCode,
  108609. },
  108610. }
  108611. target := &ret
  108612. if err := gensupport.DecodeResponse(target, res); err != nil {
  108613. return nil, err
  108614. }
  108615. return ret, nil
  108616. // {
  108617. // "description": "Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances.\n\nThe resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.\n\nIf the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.",
  108618. // "httpMethod": "POST",
  108619. // "id": "compute.regionInstanceGroupManagers.resize",
  108620. // "parameterOrder": [
  108621. // "project",
  108622. // "region",
  108623. // "instanceGroupManager",
  108624. // "size"
  108625. // ],
  108626. // "parameters": {
  108627. // "instanceGroupManager": {
  108628. // "description": "Name of the managed instance group.",
  108629. // "location": "path",
  108630. // "required": true,
  108631. // "type": "string"
  108632. // },
  108633. // "project": {
  108634. // "description": "Project ID for this request.",
  108635. // "location": "path",
  108636. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108637. // "required": true,
  108638. // "type": "string"
  108639. // },
  108640. // "region": {
  108641. // "description": "Name of the region scoping this request.",
  108642. // "location": "path",
  108643. // "required": true,
  108644. // "type": "string"
  108645. // },
  108646. // "requestId": {
  108647. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108648. // "location": "query",
  108649. // "type": "string"
  108650. // },
  108651. // "size": {
  108652. // "description": "Number of instances that should exist in this instance group manager.",
  108653. // "format": "int32",
  108654. // "location": "query",
  108655. // "minimum": "0",
  108656. // "required": true,
  108657. // "type": "integer"
  108658. // }
  108659. // },
  108660. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  108661. // "response": {
  108662. // "$ref": "Operation"
  108663. // },
  108664. // "scopes": [
  108665. // "https://www.googleapis.com/auth/cloud-platform",
  108666. // "https://www.googleapis.com/auth/compute"
  108667. // ]
  108668. // }
  108669. }
  108670. // method id "compute.regionInstanceGroupManagers.setAutoHealingPolicies":
  108671. type RegionInstanceGroupManagersSetAutoHealingPoliciesCall struct {
  108672. s *Service
  108673. project string
  108674. region string
  108675. instanceGroupManager string
  108676. regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest
  108677. urlParams_ gensupport.URLParams
  108678. ctx_ context.Context
  108679. header_ http.Header
  108680. }
  108681. // SetAutoHealingPolicies: Modifies the autohealing policy for the
  108682. // instances in this managed instance group. [Deprecated] This method is
  108683. // deprecated. Please use Patch instead.
  108684. func (r *RegionInstanceGroupManagersService) SetAutoHealingPolicies(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  108685. c := &RegionInstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108686. c.project = project
  108687. c.region = region
  108688. c.instanceGroupManager = instanceGroupManager
  108689. c.regioninstancegroupmanagerssetautohealingrequest = regioninstancegroupmanagerssetautohealingrequest
  108690. return c
  108691. }
  108692. // RequestId sets the optional parameter "requestId": An optional
  108693. // request ID to identify requests. Specify a unique request ID so that
  108694. // if you must retry your request, the server will know to ignore the
  108695. // request if it has already been completed.
  108696. //
  108697. // For example, consider a situation where you make an initial request
  108698. // and the request times out. If you make the request again with the
  108699. // same request ID, the server can check if original operation with the
  108700. // same request ID was received, and if so, will ignore the second
  108701. // request. This prevents clients from accidentally creating duplicate
  108702. // commitments.
  108703. //
  108704. // The request ID must be a valid UUID with the exception that zero UUID
  108705. // is not supported (00000000-0000-0000-0000-000000000000).
  108706. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  108707. c.urlParams_.Set("requestId", requestId)
  108708. return c
  108709. }
  108710. // Fields allows partial responses to be retrieved. See
  108711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108712. // for more information.
  108713. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  108714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108715. return c
  108716. }
  108717. // Context sets the context to be used in this call's Do method. Any
  108718. // pending HTTP request will be aborted if the provided context is
  108719. // canceled.
  108720. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  108721. c.ctx_ = ctx
  108722. return c
  108723. }
  108724. // Header returns an http.Header that can be modified by the caller to
  108725. // add HTTP headers to the request.
  108726. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  108727. if c.header_ == nil {
  108728. c.header_ = make(http.Header)
  108729. }
  108730. return c.header_
  108731. }
  108732. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  108733. reqHeaders := make(http.Header)
  108734. for k, v := range c.header_ {
  108735. reqHeaders[k] = v
  108736. }
  108737. reqHeaders.Set("User-Agent", c.s.userAgent())
  108738. var body io.Reader = nil
  108739. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest)
  108740. if err != nil {
  108741. return nil, err
  108742. }
  108743. reqHeaders.Set("Content-Type", "application/json")
  108744. c.urlParams_.Set("alt", alt)
  108745. c.urlParams_.Set("prettyPrint", "false")
  108746. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  108747. urls += "?" + c.urlParams_.Encode()
  108748. req, err := http.NewRequest("POST", urls, body)
  108749. if err != nil {
  108750. return nil, err
  108751. }
  108752. req.Header = reqHeaders
  108753. googleapi.Expand(req.URL, map[string]string{
  108754. "project": c.project,
  108755. "region": c.region,
  108756. "instanceGroupManager": c.instanceGroupManager,
  108757. })
  108758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108759. }
  108760. // Do executes the "compute.regionInstanceGroupManagers.setAutoHealingPolicies" call.
  108761. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108762. // status code is an error. Response headers are in either
  108763. // *Operation.ServerResponse.Header or (if a response was returned at
  108764. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108765. // to check whether the returned error was because
  108766. // http.StatusNotModified was returned.
  108767. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108768. gensupport.SetOptions(c.urlParams_, opts...)
  108769. res, err := c.doRequest("json")
  108770. if res != nil && res.StatusCode == http.StatusNotModified {
  108771. if res.Body != nil {
  108772. res.Body.Close()
  108773. }
  108774. return nil, &googleapi.Error{
  108775. Code: res.StatusCode,
  108776. Header: res.Header,
  108777. }
  108778. }
  108779. if err != nil {
  108780. return nil, err
  108781. }
  108782. defer googleapi.CloseBody(res)
  108783. if err := googleapi.CheckResponse(res); err != nil {
  108784. return nil, err
  108785. }
  108786. ret := &Operation{
  108787. ServerResponse: googleapi.ServerResponse{
  108788. Header: res.Header,
  108789. HTTPStatusCode: res.StatusCode,
  108790. },
  108791. }
  108792. target := &ret
  108793. if err := gensupport.DecodeResponse(target, res); err != nil {
  108794. return nil, err
  108795. }
  108796. return ret, nil
  108797. // {
  108798. // "description": "Modifies the autohealing policy for the instances in this managed instance group. [Deprecated] This method is deprecated. Please use Patch instead.",
  108799. // "httpMethod": "POST",
  108800. // "id": "compute.regionInstanceGroupManagers.setAutoHealingPolicies",
  108801. // "parameterOrder": [
  108802. // "project",
  108803. // "region",
  108804. // "instanceGroupManager"
  108805. // ],
  108806. // "parameters": {
  108807. // "instanceGroupManager": {
  108808. // "description": "Name of the managed instance group.",
  108809. // "location": "path",
  108810. // "required": true,
  108811. // "type": "string"
  108812. // },
  108813. // "project": {
  108814. // "description": "Project ID for this request.",
  108815. // "location": "path",
  108816. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108817. // "required": true,
  108818. // "type": "string"
  108819. // },
  108820. // "region": {
  108821. // "description": "Name of the region scoping this request.",
  108822. // "location": "path",
  108823. // "required": true,
  108824. // "type": "string"
  108825. // },
  108826. // "requestId": {
  108827. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  108828. // "location": "query",
  108829. // "type": "string"
  108830. // }
  108831. // },
  108832. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  108833. // "request": {
  108834. // "$ref": "RegionInstanceGroupManagersSetAutoHealingRequest"
  108835. // },
  108836. // "response": {
  108837. // "$ref": "Operation"
  108838. // },
  108839. // "scopes": [
  108840. // "https://www.googleapis.com/auth/cloud-platform",
  108841. // "https://www.googleapis.com/auth/compute"
  108842. // ]
  108843. // }
  108844. }
  108845. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  108846. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  108847. s *Service
  108848. project string
  108849. region string
  108850. instanceGroupManager string
  108851. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  108852. urlParams_ gensupport.URLParams
  108853. ctx_ context.Context
  108854. header_ http.Header
  108855. }
  108856. // SetInstanceTemplate: Sets the instance template to use when creating
  108857. // new instances or recreating instances in this group. Existing
  108858. // instances are not affected.
  108859. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  108860. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  108861. c.project = project
  108862. c.region = region
  108863. c.instanceGroupManager = instanceGroupManager
  108864. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  108865. return c
  108866. }
  108867. // RequestId sets the optional parameter "requestId": An optional
  108868. // request ID to identify requests. Specify a unique request ID so that
  108869. // if you must retry your request, the server will know to ignore the
  108870. // request if it has already been completed.
  108871. //
  108872. // For example, consider a situation where you make an initial request
  108873. // and the request times out. If you make the request again with the
  108874. // same request ID, the server can check if original operation with the
  108875. // same request ID was received, and if so, will ignore the second
  108876. // request. This prevents clients from accidentally creating duplicate
  108877. // commitments.
  108878. //
  108879. // The request ID must be a valid UUID with the exception that zero UUID
  108880. // is not supported (00000000-0000-0000-0000-000000000000).
  108881. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  108882. c.urlParams_.Set("requestId", requestId)
  108883. return c
  108884. }
  108885. // Fields allows partial responses to be retrieved. See
  108886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  108887. // for more information.
  108888. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  108889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  108890. return c
  108891. }
  108892. // Context sets the context to be used in this call's Do method. Any
  108893. // pending HTTP request will be aborted if the provided context is
  108894. // canceled.
  108895. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  108896. c.ctx_ = ctx
  108897. return c
  108898. }
  108899. // Header returns an http.Header that can be modified by the caller to
  108900. // add HTTP headers to the request.
  108901. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  108902. if c.header_ == nil {
  108903. c.header_ = make(http.Header)
  108904. }
  108905. return c.header_
  108906. }
  108907. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  108908. reqHeaders := make(http.Header)
  108909. for k, v := range c.header_ {
  108910. reqHeaders[k] = v
  108911. }
  108912. reqHeaders.Set("User-Agent", c.s.userAgent())
  108913. var body io.Reader = nil
  108914. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  108915. if err != nil {
  108916. return nil, err
  108917. }
  108918. reqHeaders.Set("Content-Type", "application/json")
  108919. c.urlParams_.Set("alt", alt)
  108920. c.urlParams_.Set("prettyPrint", "false")
  108921. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  108922. urls += "?" + c.urlParams_.Encode()
  108923. req, err := http.NewRequest("POST", urls, body)
  108924. if err != nil {
  108925. return nil, err
  108926. }
  108927. req.Header = reqHeaders
  108928. googleapi.Expand(req.URL, map[string]string{
  108929. "project": c.project,
  108930. "region": c.region,
  108931. "instanceGroupManager": c.instanceGroupManager,
  108932. })
  108933. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  108934. }
  108935. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  108936. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  108937. // status code is an error. Response headers are in either
  108938. // *Operation.ServerResponse.Header or (if a response was returned at
  108939. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  108940. // to check whether the returned error was because
  108941. // http.StatusNotModified was returned.
  108942. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  108943. gensupport.SetOptions(c.urlParams_, opts...)
  108944. res, err := c.doRequest("json")
  108945. if res != nil && res.StatusCode == http.StatusNotModified {
  108946. if res.Body != nil {
  108947. res.Body.Close()
  108948. }
  108949. return nil, &googleapi.Error{
  108950. Code: res.StatusCode,
  108951. Header: res.Header,
  108952. }
  108953. }
  108954. if err != nil {
  108955. return nil, err
  108956. }
  108957. defer googleapi.CloseBody(res)
  108958. if err := googleapi.CheckResponse(res); err != nil {
  108959. return nil, err
  108960. }
  108961. ret := &Operation{
  108962. ServerResponse: googleapi.ServerResponse{
  108963. Header: res.Header,
  108964. HTTPStatusCode: res.StatusCode,
  108965. },
  108966. }
  108967. target := &ret
  108968. if err := gensupport.DecodeResponse(target, res); err != nil {
  108969. return nil, err
  108970. }
  108971. return ret, nil
  108972. // {
  108973. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  108974. // "httpMethod": "POST",
  108975. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  108976. // "parameterOrder": [
  108977. // "project",
  108978. // "region",
  108979. // "instanceGroupManager"
  108980. // ],
  108981. // "parameters": {
  108982. // "instanceGroupManager": {
  108983. // "description": "The name of the managed instance group.",
  108984. // "location": "path",
  108985. // "required": true,
  108986. // "type": "string"
  108987. // },
  108988. // "project": {
  108989. // "description": "Project ID for this request.",
  108990. // "location": "path",
  108991. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  108992. // "required": true,
  108993. // "type": "string"
  108994. // },
  108995. // "region": {
  108996. // "description": "Name of the region scoping this request.",
  108997. // "location": "path",
  108998. // "required": true,
  108999. // "type": "string"
  109000. // },
  109001. // "requestId": {
  109002. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109003. // "location": "query",
  109004. // "type": "string"
  109005. // }
  109006. // },
  109007. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  109008. // "request": {
  109009. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  109010. // },
  109011. // "response": {
  109012. // "$ref": "Operation"
  109013. // },
  109014. // "scopes": [
  109015. // "https://www.googleapis.com/auth/cloud-platform",
  109016. // "https://www.googleapis.com/auth/compute"
  109017. // ]
  109018. // }
  109019. }
  109020. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  109021. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  109022. s *Service
  109023. project string
  109024. region string
  109025. instanceGroupManager string
  109026. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  109027. urlParams_ gensupport.URLParams
  109028. ctx_ context.Context
  109029. header_ http.Header
  109030. }
  109031. // SetTargetPools: Modifies the target pools to which all new instances
  109032. // in this group are assigned. Existing instances in the group are not
  109033. // affected.
  109034. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  109035. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109036. c.project = project
  109037. c.region = region
  109038. c.instanceGroupManager = instanceGroupManager
  109039. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  109040. return c
  109041. }
  109042. // RequestId sets the optional parameter "requestId": An optional
  109043. // request ID to identify requests. Specify a unique request ID so that
  109044. // if you must retry your request, the server will know to ignore the
  109045. // request if it has already been completed.
  109046. //
  109047. // For example, consider a situation where you make an initial request
  109048. // and the request times out. If you make the request again with the
  109049. // same request ID, the server can check if original operation with the
  109050. // same request ID was received, and if so, will ignore the second
  109051. // request. This prevents clients from accidentally creating duplicate
  109052. // commitments.
  109053. //
  109054. // The request ID must be a valid UUID with the exception that zero UUID
  109055. // is not supported (00000000-0000-0000-0000-000000000000).
  109056. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  109057. c.urlParams_.Set("requestId", requestId)
  109058. return c
  109059. }
  109060. // Fields allows partial responses to be retrieved. See
  109061. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109062. // for more information.
  109063. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  109064. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109065. return c
  109066. }
  109067. // Context sets the context to be used in this call's Do method. Any
  109068. // pending HTTP request will be aborted if the provided context is
  109069. // canceled.
  109070. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  109071. c.ctx_ = ctx
  109072. return c
  109073. }
  109074. // Header returns an http.Header that can be modified by the caller to
  109075. // add HTTP headers to the request.
  109076. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  109077. if c.header_ == nil {
  109078. c.header_ = make(http.Header)
  109079. }
  109080. return c.header_
  109081. }
  109082. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  109083. reqHeaders := make(http.Header)
  109084. for k, v := range c.header_ {
  109085. reqHeaders[k] = v
  109086. }
  109087. reqHeaders.Set("User-Agent", c.s.userAgent())
  109088. var body io.Reader = nil
  109089. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  109090. if err != nil {
  109091. return nil, err
  109092. }
  109093. reqHeaders.Set("Content-Type", "application/json")
  109094. c.urlParams_.Set("alt", alt)
  109095. c.urlParams_.Set("prettyPrint", "false")
  109096. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  109097. urls += "?" + c.urlParams_.Encode()
  109098. req, err := http.NewRequest("POST", urls, body)
  109099. if err != nil {
  109100. return nil, err
  109101. }
  109102. req.Header = reqHeaders
  109103. googleapi.Expand(req.URL, map[string]string{
  109104. "project": c.project,
  109105. "region": c.region,
  109106. "instanceGroupManager": c.instanceGroupManager,
  109107. })
  109108. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109109. }
  109110. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  109111. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109112. // status code is an error. Response headers are in either
  109113. // *Operation.ServerResponse.Header or (if a response was returned at
  109114. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109115. // to check whether the returned error was because
  109116. // http.StatusNotModified was returned.
  109117. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109118. gensupport.SetOptions(c.urlParams_, opts...)
  109119. res, err := c.doRequest("json")
  109120. if res != nil && res.StatusCode == http.StatusNotModified {
  109121. if res.Body != nil {
  109122. res.Body.Close()
  109123. }
  109124. return nil, &googleapi.Error{
  109125. Code: res.StatusCode,
  109126. Header: res.Header,
  109127. }
  109128. }
  109129. if err != nil {
  109130. return nil, err
  109131. }
  109132. defer googleapi.CloseBody(res)
  109133. if err := googleapi.CheckResponse(res); err != nil {
  109134. return nil, err
  109135. }
  109136. ret := &Operation{
  109137. ServerResponse: googleapi.ServerResponse{
  109138. Header: res.Header,
  109139. HTTPStatusCode: res.StatusCode,
  109140. },
  109141. }
  109142. target := &ret
  109143. if err := gensupport.DecodeResponse(target, res); err != nil {
  109144. return nil, err
  109145. }
  109146. return ret, nil
  109147. // {
  109148. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  109149. // "httpMethod": "POST",
  109150. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  109151. // "parameterOrder": [
  109152. // "project",
  109153. // "region",
  109154. // "instanceGroupManager"
  109155. // ],
  109156. // "parameters": {
  109157. // "instanceGroupManager": {
  109158. // "description": "Name of the managed instance group.",
  109159. // "location": "path",
  109160. // "required": true,
  109161. // "type": "string"
  109162. // },
  109163. // "project": {
  109164. // "description": "Project ID for this request.",
  109165. // "location": "path",
  109166. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109167. // "required": true,
  109168. // "type": "string"
  109169. // },
  109170. // "region": {
  109171. // "description": "Name of the region scoping this request.",
  109172. // "location": "path",
  109173. // "required": true,
  109174. // "type": "string"
  109175. // },
  109176. // "requestId": {
  109177. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109178. // "location": "query",
  109179. // "type": "string"
  109180. // }
  109181. // },
  109182. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  109183. // "request": {
  109184. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  109185. // },
  109186. // "response": {
  109187. // "$ref": "Operation"
  109188. // },
  109189. // "scopes": [
  109190. // "https://www.googleapis.com/auth/cloud-platform",
  109191. // "https://www.googleapis.com/auth/compute"
  109192. // ]
  109193. // }
  109194. }
  109195. // method id "compute.regionInstanceGroupManagers.testIamPermissions":
  109196. type RegionInstanceGroupManagersTestIamPermissionsCall struct {
  109197. s *Service
  109198. project string
  109199. region string
  109200. resource string
  109201. testpermissionsrequest *TestPermissionsRequest
  109202. urlParams_ gensupport.URLParams
  109203. ctx_ context.Context
  109204. header_ http.Header
  109205. }
  109206. // TestIamPermissions: Returns permissions that a caller has on the
  109207. // specified resource.
  109208. func (r *RegionInstanceGroupManagersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupManagersTestIamPermissionsCall {
  109209. c := &RegionInstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109210. c.project = project
  109211. c.region = region
  109212. c.resource = resource
  109213. c.testpermissionsrequest = testpermissionsrequest
  109214. return c
  109215. }
  109216. // Fields allows partial responses to be retrieved. See
  109217. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109218. // for more information.
  109219. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersTestIamPermissionsCall {
  109220. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109221. return c
  109222. }
  109223. // Context sets the context to be used in this call's Do method. Any
  109224. // pending HTTP request will be aborted if the provided context is
  109225. // canceled.
  109226. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupManagersTestIamPermissionsCall {
  109227. c.ctx_ = ctx
  109228. return c
  109229. }
  109230. // Header returns an http.Header that can be modified by the caller to
  109231. // add HTTP headers to the request.
  109232. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  109233. if c.header_ == nil {
  109234. c.header_ = make(http.Header)
  109235. }
  109236. return c.header_
  109237. }
  109238. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  109239. reqHeaders := make(http.Header)
  109240. for k, v := range c.header_ {
  109241. reqHeaders[k] = v
  109242. }
  109243. reqHeaders.Set("User-Agent", c.s.userAgent())
  109244. var body io.Reader = nil
  109245. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  109246. if err != nil {
  109247. return nil, err
  109248. }
  109249. reqHeaders.Set("Content-Type", "application/json")
  109250. c.urlParams_.Set("alt", alt)
  109251. c.urlParams_.Set("prettyPrint", "false")
  109252. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions")
  109253. urls += "?" + c.urlParams_.Encode()
  109254. req, err := http.NewRequest("POST", urls, body)
  109255. if err != nil {
  109256. return nil, err
  109257. }
  109258. req.Header = reqHeaders
  109259. googleapi.Expand(req.URL, map[string]string{
  109260. "project": c.project,
  109261. "region": c.region,
  109262. "resource": c.resource,
  109263. })
  109264. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109265. }
  109266. // Do executes the "compute.regionInstanceGroupManagers.testIamPermissions" call.
  109267. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  109268. // non-2xx status code is an error. Response headers are in either
  109269. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  109270. // returned at all) in error.(*googleapi.Error).Header. Use
  109271. // googleapi.IsNotModified to check whether the returned error was
  109272. // because http.StatusNotModified was returned.
  109273. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  109274. gensupport.SetOptions(c.urlParams_, opts...)
  109275. res, err := c.doRequest("json")
  109276. if res != nil && res.StatusCode == http.StatusNotModified {
  109277. if res.Body != nil {
  109278. res.Body.Close()
  109279. }
  109280. return nil, &googleapi.Error{
  109281. Code: res.StatusCode,
  109282. Header: res.Header,
  109283. }
  109284. }
  109285. if err != nil {
  109286. return nil, err
  109287. }
  109288. defer googleapi.CloseBody(res)
  109289. if err := googleapi.CheckResponse(res); err != nil {
  109290. return nil, err
  109291. }
  109292. ret := &TestPermissionsResponse{
  109293. ServerResponse: googleapi.ServerResponse{
  109294. Header: res.Header,
  109295. HTTPStatusCode: res.StatusCode,
  109296. },
  109297. }
  109298. target := &ret
  109299. if err := gensupport.DecodeResponse(target, res); err != nil {
  109300. return nil, err
  109301. }
  109302. return ret, nil
  109303. // {
  109304. // "description": "Returns permissions that a caller has on the specified resource.",
  109305. // "httpMethod": "POST",
  109306. // "id": "compute.regionInstanceGroupManagers.testIamPermissions",
  109307. // "parameterOrder": [
  109308. // "project",
  109309. // "region",
  109310. // "resource"
  109311. // ],
  109312. // "parameters": {
  109313. // "project": {
  109314. // "description": "Project ID for this request.",
  109315. // "location": "path",
  109316. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109317. // "required": true,
  109318. // "type": "string"
  109319. // },
  109320. // "region": {
  109321. // "description": "The name of the region for this request.",
  109322. // "location": "path",
  109323. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  109324. // "required": true,
  109325. // "type": "string"
  109326. // },
  109327. // "resource": {
  109328. // "description": "Name or id of the resource for this request.",
  109329. // "location": "path",
  109330. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  109331. // "required": true,
  109332. // "type": "string"
  109333. // }
  109334. // },
  109335. // "path": "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions",
  109336. // "request": {
  109337. // "$ref": "TestPermissionsRequest"
  109338. // },
  109339. // "response": {
  109340. // "$ref": "TestPermissionsResponse"
  109341. // },
  109342. // "scopes": [
  109343. // "https://www.googleapis.com/auth/cloud-platform",
  109344. // "https://www.googleapis.com/auth/compute",
  109345. // "https://www.googleapis.com/auth/compute.readonly"
  109346. // ]
  109347. // }
  109348. }
  109349. // method id "compute.regionInstanceGroupManagers.update":
  109350. type RegionInstanceGroupManagersUpdateCall struct {
  109351. s *Service
  109352. project string
  109353. region string
  109354. instanceGroupManager string
  109355. instancegroupmanager *InstanceGroupManager
  109356. urlParams_ gensupport.URLParams
  109357. ctx_ context.Context
  109358. header_ http.Header
  109359. }
  109360. // Update: Updates a managed instance group using the information that
  109361. // you specify in the request. This operation is marked as DONE when the
  109362. // group is updated even if the instances in the group have not yet been
  109363. // updated. You must separately verify the status of the individual
  109364. // instances with the listmanagedinstances method.
  109365. func (r *RegionInstanceGroupManagersService) Update(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersUpdateCall {
  109366. c := &RegionInstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109367. c.project = project
  109368. c.region = region
  109369. c.instanceGroupManager = instanceGroupManager
  109370. c.instancegroupmanager = instancegroupmanager
  109371. return c
  109372. }
  109373. // RequestId sets the optional parameter "requestId": An optional
  109374. // request ID to identify requests. Specify a unique request ID so that
  109375. // if you must retry your request, the server will know to ignore the
  109376. // request if it has already been completed.
  109377. //
  109378. // For example, consider a situation where you make an initial request
  109379. // and the request times out. If you make the request again with the
  109380. // same request ID, the server can check if original operation with the
  109381. // same request ID was received, and if so, will ignore the second
  109382. // request. This prevents clients from accidentally creating duplicate
  109383. // commitments.
  109384. //
  109385. // The request ID must be a valid UUID with the exception that zero UUID
  109386. // is not supported (00000000-0000-0000-0000-000000000000).
  109387. func (c *RegionInstanceGroupManagersUpdateCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdateCall {
  109388. c.urlParams_.Set("requestId", requestId)
  109389. return c
  109390. }
  109391. // Fields allows partial responses to be retrieved. See
  109392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109393. // for more information.
  109394. func (c *RegionInstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdateCall {
  109395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109396. return c
  109397. }
  109398. // Context sets the context to be used in this call's Do method. Any
  109399. // pending HTTP request will be aborted if the provided context is
  109400. // canceled.
  109401. func (c *RegionInstanceGroupManagersUpdateCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdateCall {
  109402. c.ctx_ = ctx
  109403. return c
  109404. }
  109405. // Header returns an http.Header that can be modified by the caller to
  109406. // add HTTP headers to the request.
  109407. func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header {
  109408. if c.header_ == nil {
  109409. c.header_ = make(http.Header)
  109410. }
  109411. return c.header_
  109412. }
  109413. func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  109414. reqHeaders := make(http.Header)
  109415. for k, v := range c.header_ {
  109416. reqHeaders[k] = v
  109417. }
  109418. reqHeaders.Set("User-Agent", c.s.userAgent())
  109419. var body io.Reader = nil
  109420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  109421. if err != nil {
  109422. return nil, err
  109423. }
  109424. reqHeaders.Set("Content-Type", "application/json")
  109425. c.urlParams_.Set("alt", alt)
  109426. c.urlParams_.Set("prettyPrint", "false")
  109427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  109428. urls += "?" + c.urlParams_.Encode()
  109429. req, err := http.NewRequest("PUT", urls, body)
  109430. if err != nil {
  109431. return nil, err
  109432. }
  109433. req.Header = reqHeaders
  109434. googleapi.Expand(req.URL, map[string]string{
  109435. "project": c.project,
  109436. "region": c.region,
  109437. "instanceGroupManager": c.instanceGroupManager,
  109438. })
  109439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109440. }
  109441. // Do executes the "compute.regionInstanceGroupManagers.update" call.
  109442. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109443. // status code is an error. Response headers are in either
  109444. // *Operation.ServerResponse.Header or (if a response was returned at
  109445. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109446. // to check whether the returned error was because
  109447. // http.StatusNotModified was returned.
  109448. func (c *RegionInstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109449. gensupport.SetOptions(c.urlParams_, opts...)
  109450. res, err := c.doRequest("json")
  109451. if res != nil && res.StatusCode == http.StatusNotModified {
  109452. if res.Body != nil {
  109453. res.Body.Close()
  109454. }
  109455. return nil, &googleapi.Error{
  109456. Code: res.StatusCode,
  109457. Header: res.Header,
  109458. }
  109459. }
  109460. if err != nil {
  109461. return nil, err
  109462. }
  109463. defer googleapi.CloseBody(res)
  109464. if err := googleapi.CheckResponse(res); err != nil {
  109465. return nil, err
  109466. }
  109467. ret := &Operation{
  109468. ServerResponse: googleapi.ServerResponse{
  109469. Header: res.Header,
  109470. HTTPStatusCode: res.StatusCode,
  109471. },
  109472. }
  109473. target := &ret
  109474. if err := gensupport.DecodeResponse(target, res); err != nil {
  109475. return nil, err
  109476. }
  109477. return ret, nil
  109478. // {
  109479. // "description": "Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is updated even if the instances in the group have not yet been updated. You must separately verify the status of the individual instances with the listmanagedinstances method.",
  109480. // "httpMethod": "PUT",
  109481. // "id": "compute.regionInstanceGroupManagers.update",
  109482. // "parameterOrder": [
  109483. // "project",
  109484. // "region",
  109485. // "instanceGroupManager"
  109486. // ],
  109487. // "parameters": {
  109488. // "instanceGroupManager": {
  109489. // "description": "The name of the instance group manager.",
  109490. // "location": "path",
  109491. // "required": true,
  109492. // "type": "string"
  109493. // },
  109494. // "project": {
  109495. // "description": "Project ID for this request.",
  109496. // "location": "path",
  109497. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109498. // "required": true,
  109499. // "type": "string"
  109500. // },
  109501. // "region": {
  109502. // "description": "Name of the region scoping this request.",
  109503. // "location": "path",
  109504. // "required": true,
  109505. // "type": "string"
  109506. // },
  109507. // "requestId": {
  109508. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109509. // "location": "query",
  109510. // "type": "string"
  109511. // }
  109512. // },
  109513. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  109514. // "request": {
  109515. // "$ref": "InstanceGroupManager"
  109516. // },
  109517. // "response": {
  109518. // "$ref": "Operation"
  109519. // },
  109520. // "scopes": [
  109521. // "https://www.googleapis.com/auth/cloud-platform",
  109522. // "https://www.googleapis.com/auth/compute"
  109523. // ]
  109524. // }
  109525. }
  109526. // method id "compute.regionInstanceGroupManagers.updatePerInstanceConfigs":
  109527. type RegionInstanceGroupManagersUpdatePerInstanceConfigsCall struct {
  109528. s *Service
  109529. project string
  109530. region string
  109531. instanceGroupManager string
  109532. regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq
  109533. urlParams_ gensupport.URLParams
  109534. ctx_ context.Context
  109535. header_ http.Header
  109536. }
  109537. // UpdatePerInstanceConfigs: Insert or update (for the ones that already
  109538. // exist) per-instance configs for the managed instance group.
  109539. // perInstanceConfig.instance serves as a key used to distinguish
  109540. // whether to perform insert or patch.
  109541. func (r *RegionInstanceGroupManagersService) UpdatePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerupdateinstanceconfigreq *RegionInstanceGroupManagerUpdateInstanceConfigReq) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  109542. c := &RegionInstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109543. c.project = project
  109544. c.region = region
  109545. c.instanceGroupManager = instanceGroupManager
  109546. c.regioninstancegroupmanagerupdateinstanceconfigreq = regioninstancegroupmanagerupdateinstanceconfigreq
  109547. return c
  109548. }
  109549. // RequestId sets the optional parameter "requestId": An optional
  109550. // request ID to identify requests. Specify a unique request ID so that
  109551. // if you must retry your request, the server will know to ignore the
  109552. // request if it has already been completed.
  109553. //
  109554. // For example, consider a situation where you make an initial request
  109555. // and the request times out. If you make the request again with the
  109556. // same request ID, the server can check if original operation with the
  109557. // same request ID was received, and if so, will ignore the second
  109558. // request. This prevents clients from accidentally creating duplicate
  109559. // commitments.
  109560. //
  109561. // The request ID must be a valid UUID with the exception that zero UUID
  109562. // is not supported (00000000-0000-0000-0000-000000000000).
  109563. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  109564. c.urlParams_.Set("requestId", requestId)
  109565. return c
  109566. }
  109567. // Fields allows partial responses to be retrieved. See
  109568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109569. // for more information.
  109570. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  109571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109572. return c
  109573. }
  109574. // Context sets the context to be used in this call's Do method. Any
  109575. // pending HTTP request will be aborted if the provided context is
  109576. // canceled.
  109577. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall {
  109578. c.ctx_ = ctx
  109579. return c
  109580. }
  109581. // Header returns an http.Header that can be modified by the caller to
  109582. // add HTTP headers to the request.
  109583. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header {
  109584. if c.header_ == nil {
  109585. c.header_ = make(http.Header)
  109586. }
  109587. return c.header_
  109588. }
  109589. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) {
  109590. reqHeaders := make(http.Header)
  109591. for k, v := range c.header_ {
  109592. reqHeaders[k] = v
  109593. }
  109594. reqHeaders.Set("User-Agent", c.s.userAgent())
  109595. var body io.Reader = nil
  109596. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerupdateinstanceconfigreq)
  109597. if err != nil {
  109598. return nil, err
  109599. }
  109600. reqHeaders.Set("Content-Type", "application/json")
  109601. c.urlParams_.Set("alt", alt)
  109602. c.urlParams_.Set("prettyPrint", "false")
  109603. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs")
  109604. urls += "?" + c.urlParams_.Encode()
  109605. req, err := http.NewRequest("POST", urls, body)
  109606. if err != nil {
  109607. return nil, err
  109608. }
  109609. req.Header = reqHeaders
  109610. googleapi.Expand(req.URL, map[string]string{
  109611. "project": c.project,
  109612. "region": c.region,
  109613. "instanceGroupManager": c.instanceGroupManager,
  109614. })
  109615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109616. }
  109617. // Do executes the "compute.regionInstanceGroupManagers.updatePerInstanceConfigs" call.
  109618. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  109619. // status code is an error. Response headers are in either
  109620. // *Operation.ServerResponse.Header or (if a response was returned at
  109621. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  109622. // to check whether the returned error was because
  109623. // http.StatusNotModified was returned.
  109624. func (c *RegionInstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  109625. gensupport.SetOptions(c.urlParams_, opts...)
  109626. res, err := c.doRequest("json")
  109627. if res != nil && res.StatusCode == http.StatusNotModified {
  109628. if res.Body != nil {
  109629. res.Body.Close()
  109630. }
  109631. return nil, &googleapi.Error{
  109632. Code: res.StatusCode,
  109633. Header: res.Header,
  109634. }
  109635. }
  109636. if err != nil {
  109637. return nil, err
  109638. }
  109639. defer googleapi.CloseBody(res)
  109640. if err := googleapi.CheckResponse(res); err != nil {
  109641. return nil, err
  109642. }
  109643. ret := &Operation{
  109644. ServerResponse: googleapi.ServerResponse{
  109645. Header: res.Header,
  109646. HTTPStatusCode: res.StatusCode,
  109647. },
  109648. }
  109649. target := &ret
  109650. if err := gensupport.DecodeResponse(target, res); err != nil {
  109651. return nil, err
  109652. }
  109653. return ret, nil
  109654. // {
  109655. // "description": "Insert or update (for the ones that already exist) per-instance configs for the managed instance group. perInstanceConfig.instance serves as a key used to distinguish whether to perform insert or patch.",
  109656. // "httpMethod": "POST",
  109657. // "id": "compute.regionInstanceGroupManagers.updatePerInstanceConfigs",
  109658. // "parameterOrder": [
  109659. // "project",
  109660. // "region",
  109661. // "instanceGroupManager"
  109662. // ],
  109663. // "parameters": {
  109664. // "instanceGroupManager": {
  109665. // "description": "The name of the managed instance group. It should conform to RFC1035.",
  109666. // "location": "path",
  109667. // "required": true,
  109668. // "type": "string"
  109669. // },
  109670. // "project": {
  109671. // "description": "Project ID for this request.",
  109672. // "location": "path",
  109673. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109674. // "required": true,
  109675. // "type": "string"
  109676. // },
  109677. // "region": {
  109678. // "description": "Name of the region scoping this request, should conform to RFC1035.",
  109679. // "location": "path",
  109680. // "required": true,
  109681. // "type": "string"
  109682. // },
  109683. // "requestId": {
  109684. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  109685. // "location": "query",
  109686. // "type": "string"
  109687. // }
  109688. // },
  109689. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs",
  109690. // "request": {
  109691. // "$ref": "RegionInstanceGroupManagerUpdateInstanceConfigReq"
  109692. // },
  109693. // "response": {
  109694. // "$ref": "Operation"
  109695. // },
  109696. // "scopes": [
  109697. // "https://www.googleapis.com/auth/cloud-platform",
  109698. // "https://www.googleapis.com/auth/compute"
  109699. // ]
  109700. // }
  109701. }
  109702. // method id "compute.regionInstanceGroups.get":
  109703. type RegionInstanceGroupsGetCall struct {
  109704. s *Service
  109705. project string
  109706. region string
  109707. instanceGroup string
  109708. urlParams_ gensupport.URLParams
  109709. ifNoneMatch_ string
  109710. ctx_ context.Context
  109711. header_ http.Header
  109712. }
  109713. // Get: Returns the specified instance group resource.
  109714. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  109715. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109716. c.project = project
  109717. c.region = region
  109718. c.instanceGroup = instanceGroup
  109719. return c
  109720. }
  109721. // Fields allows partial responses to be retrieved. See
  109722. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109723. // for more information.
  109724. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  109725. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109726. return c
  109727. }
  109728. // IfNoneMatch sets the optional parameter which makes the operation
  109729. // fail if the object's ETag matches the given value. This is useful for
  109730. // getting updates only after the object has changed since the last
  109731. // request. Use googleapi.IsNotModified to check whether the response
  109732. // error from Do is the result of In-None-Match.
  109733. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  109734. c.ifNoneMatch_ = entityTag
  109735. return c
  109736. }
  109737. // Context sets the context to be used in this call's Do method. Any
  109738. // pending HTTP request will be aborted if the provided context is
  109739. // canceled.
  109740. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  109741. c.ctx_ = ctx
  109742. return c
  109743. }
  109744. // Header returns an http.Header that can be modified by the caller to
  109745. // add HTTP headers to the request.
  109746. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  109747. if c.header_ == nil {
  109748. c.header_ = make(http.Header)
  109749. }
  109750. return c.header_
  109751. }
  109752. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  109753. reqHeaders := make(http.Header)
  109754. for k, v := range c.header_ {
  109755. reqHeaders[k] = v
  109756. }
  109757. reqHeaders.Set("User-Agent", c.s.userAgent())
  109758. if c.ifNoneMatch_ != "" {
  109759. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109760. }
  109761. var body io.Reader = nil
  109762. c.urlParams_.Set("alt", alt)
  109763. c.urlParams_.Set("prettyPrint", "false")
  109764. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  109765. urls += "?" + c.urlParams_.Encode()
  109766. req, err := http.NewRequest("GET", urls, body)
  109767. if err != nil {
  109768. return nil, err
  109769. }
  109770. req.Header = reqHeaders
  109771. googleapi.Expand(req.URL, map[string]string{
  109772. "project": c.project,
  109773. "region": c.region,
  109774. "instanceGroup": c.instanceGroup,
  109775. })
  109776. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109777. }
  109778. // Do executes the "compute.regionInstanceGroups.get" call.
  109779. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  109780. // status code is an error. Response headers are in either
  109781. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  109782. // at all) in error.(*googleapi.Error).Header. Use
  109783. // googleapi.IsNotModified to check whether the returned error was
  109784. // because http.StatusNotModified was returned.
  109785. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  109786. gensupport.SetOptions(c.urlParams_, opts...)
  109787. res, err := c.doRequest("json")
  109788. if res != nil && res.StatusCode == http.StatusNotModified {
  109789. if res.Body != nil {
  109790. res.Body.Close()
  109791. }
  109792. return nil, &googleapi.Error{
  109793. Code: res.StatusCode,
  109794. Header: res.Header,
  109795. }
  109796. }
  109797. if err != nil {
  109798. return nil, err
  109799. }
  109800. defer googleapi.CloseBody(res)
  109801. if err := googleapi.CheckResponse(res); err != nil {
  109802. return nil, err
  109803. }
  109804. ret := &InstanceGroup{
  109805. ServerResponse: googleapi.ServerResponse{
  109806. Header: res.Header,
  109807. HTTPStatusCode: res.StatusCode,
  109808. },
  109809. }
  109810. target := &ret
  109811. if err := gensupport.DecodeResponse(target, res); err != nil {
  109812. return nil, err
  109813. }
  109814. return ret, nil
  109815. // {
  109816. // "description": "Returns the specified instance group resource.",
  109817. // "httpMethod": "GET",
  109818. // "id": "compute.regionInstanceGroups.get",
  109819. // "parameterOrder": [
  109820. // "project",
  109821. // "region",
  109822. // "instanceGroup"
  109823. // ],
  109824. // "parameters": {
  109825. // "instanceGroup": {
  109826. // "description": "Name of the instance group resource to return.",
  109827. // "location": "path",
  109828. // "required": true,
  109829. // "type": "string"
  109830. // },
  109831. // "project": {
  109832. // "description": "Project ID for this request.",
  109833. // "location": "path",
  109834. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  109835. // "required": true,
  109836. // "type": "string"
  109837. // },
  109838. // "region": {
  109839. // "description": "Name of the region scoping this request.",
  109840. // "location": "path",
  109841. // "required": true,
  109842. // "type": "string"
  109843. // }
  109844. // },
  109845. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  109846. // "response": {
  109847. // "$ref": "InstanceGroup"
  109848. // },
  109849. // "scopes": [
  109850. // "https://www.googleapis.com/auth/cloud-platform",
  109851. // "https://www.googleapis.com/auth/compute",
  109852. // "https://www.googleapis.com/auth/compute.readonly"
  109853. // ]
  109854. // }
  109855. }
  109856. // method id "compute.regionInstanceGroups.list":
  109857. type RegionInstanceGroupsListCall struct {
  109858. s *Service
  109859. project string
  109860. region string
  109861. urlParams_ gensupport.URLParams
  109862. ifNoneMatch_ string
  109863. ctx_ context.Context
  109864. header_ http.Header
  109865. }
  109866. // List: Retrieves the list of instance group resources contained within
  109867. // the specified region.
  109868. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  109869. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  109870. c.project = project
  109871. c.region = region
  109872. return c
  109873. }
  109874. // Filter sets the optional parameter "filter": A filter expression that
  109875. // filters resources listed in the response. The expression must specify
  109876. // the field name, a comparison operator, and the value that you want to
  109877. // use for filtering. The value must be a string, a number, or a
  109878. // boolean. The comparison operator must be either =, !=, >, or <.
  109879. //
  109880. // For example, if you are filtering Compute Engine instances, you can
  109881. // exclude instances named example-instance by specifying name !=
  109882. // example-instance.
  109883. //
  109884. // You can also filter nested fields. For example, you could specify
  109885. // scheduling.automaticRestart = false to include instances only if they
  109886. // are not scheduled for automatic restarts. You can use filtering on
  109887. // nested fields to filter based on resource labels.
  109888. //
  109889. // To filter on multiple expressions, provide each separate expression
  109890. // within parentheses. For example, (scheduling.automaticRestart = true)
  109891. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  109892. // AND expression. However, you can include AND and OR expressions
  109893. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  109894. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  109895. // true).
  109896. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  109897. c.urlParams_.Set("filter", filter)
  109898. return c
  109899. }
  109900. // MaxResults sets the optional parameter "maxResults": The maximum
  109901. // number of results per page that should be returned. If the number of
  109902. // available results is larger than maxResults, Compute Engine returns a
  109903. // nextPageToken that can be used to get the next page of results in
  109904. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  109905. // (Default: 500)
  109906. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  109907. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  109908. return c
  109909. }
  109910. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  109911. // a certain order. By default, results are returned in alphanumerical
  109912. // order based on the resource name.
  109913. //
  109914. // You can also sort results in descending order based on the creation
  109915. // timestamp using orderBy="creationTimestamp desc". This sorts results
  109916. // based on the creationTimestamp field in reverse chronological order
  109917. // (newest result first). Use this to sort resources like operations so
  109918. // that the newest operation is returned first.
  109919. //
  109920. // Currently, only sorting by name or creationTimestamp desc is
  109921. // supported.
  109922. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  109923. c.urlParams_.Set("orderBy", orderBy)
  109924. return c
  109925. }
  109926. // PageToken sets the optional parameter "pageToken": Specifies a page
  109927. // token to use. Set pageToken to the nextPageToken returned by a
  109928. // previous list request to get the next page of results.
  109929. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  109930. c.urlParams_.Set("pageToken", pageToken)
  109931. return c
  109932. }
  109933. // Fields allows partial responses to be retrieved. See
  109934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  109935. // for more information.
  109936. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  109937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  109938. return c
  109939. }
  109940. // IfNoneMatch sets the optional parameter which makes the operation
  109941. // fail if the object's ETag matches the given value. This is useful for
  109942. // getting updates only after the object has changed since the last
  109943. // request. Use googleapi.IsNotModified to check whether the response
  109944. // error from Do is the result of In-None-Match.
  109945. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  109946. c.ifNoneMatch_ = entityTag
  109947. return c
  109948. }
  109949. // Context sets the context to be used in this call's Do method. Any
  109950. // pending HTTP request will be aborted if the provided context is
  109951. // canceled.
  109952. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  109953. c.ctx_ = ctx
  109954. return c
  109955. }
  109956. // Header returns an http.Header that can be modified by the caller to
  109957. // add HTTP headers to the request.
  109958. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  109959. if c.header_ == nil {
  109960. c.header_ = make(http.Header)
  109961. }
  109962. return c.header_
  109963. }
  109964. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  109965. reqHeaders := make(http.Header)
  109966. for k, v := range c.header_ {
  109967. reqHeaders[k] = v
  109968. }
  109969. reqHeaders.Set("User-Agent", c.s.userAgent())
  109970. if c.ifNoneMatch_ != "" {
  109971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  109972. }
  109973. var body io.Reader = nil
  109974. c.urlParams_.Set("alt", alt)
  109975. c.urlParams_.Set("prettyPrint", "false")
  109976. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  109977. urls += "?" + c.urlParams_.Encode()
  109978. req, err := http.NewRequest("GET", urls, body)
  109979. if err != nil {
  109980. return nil, err
  109981. }
  109982. req.Header = reqHeaders
  109983. googleapi.Expand(req.URL, map[string]string{
  109984. "project": c.project,
  109985. "region": c.region,
  109986. })
  109987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  109988. }
  109989. // Do executes the "compute.regionInstanceGroups.list" call.
  109990. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  109991. // non-2xx status code is an error. Response headers are in either
  109992. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  109993. // returned at all) in error.(*googleapi.Error).Header. Use
  109994. // googleapi.IsNotModified to check whether the returned error was
  109995. // because http.StatusNotModified was returned.
  109996. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  109997. gensupport.SetOptions(c.urlParams_, opts...)
  109998. res, err := c.doRequest("json")
  109999. if res != nil && res.StatusCode == http.StatusNotModified {
  110000. if res.Body != nil {
  110001. res.Body.Close()
  110002. }
  110003. return nil, &googleapi.Error{
  110004. Code: res.StatusCode,
  110005. Header: res.Header,
  110006. }
  110007. }
  110008. if err != nil {
  110009. return nil, err
  110010. }
  110011. defer googleapi.CloseBody(res)
  110012. if err := googleapi.CheckResponse(res); err != nil {
  110013. return nil, err
  110014. }
  110015. ret := &RegionInstanceGroupList{
  110016. ServerResponse: googleapi.ServerResponse{
  110017. Header: res.Header,
  110018. HTTPStatusCode: res.StatusCode,
  110019. },
  110020. }
  110021. target := &ret
  110022. if err := gensupport.DecodeResponse(target, res); err != nil {
  110023. return nil, err
  110024. }
  110025. return ret, nil
  110026. // {
  110027. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  110028. // "httpMethod": "GET",
  110029. // "id": "compute.regionInstanceGroups.list",
  110030. // "parameterOrder": [
  110031. // "project",
  110032. // "region"
  110033. // ],
  110034. // "parameters": {
  110035. // "filter": {
  110036. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  110037. // "location": "query",
  110038. // "type": "string"
  110039. // },
  110040. // "maxResults": {
  110041. // "default": "500",
  110042. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  110043. // "format": "uint32",
  110044. // "location": "query",
  110045. // "minimum": "0",
  110046. // "type": "integer"
  110047. // },
  110048. // "orderBy": {
  110049. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  110050. // "location": "query",
  110051. // "type": "string"
  110052. // },
  110053. // "pageToken": {
  110054. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  110055. // "location": "query",
  110056. // "type": "string"
  110057. // },
  110058. // "project": {
  110059. // "description": "Project ID for this request.",
  110060. // "location": "path",
  110061. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110062. // "required": true,
  110063. // "type": "string"
  110064. // },
  110065. // "region": {
  110066. // "description": "Name of the region scoping this request.",
  110067. // "location": "path",
  110068. // "required": true,
  110069. // "type": "string"
  110070. // }
  110071. // },
  110072. // "path": "{project}/regions/{region}/instanceGroups",
  110073. // "response": {
  110074. // "$ref": "RegionInstanceGroupList"
  110075. // },
  110076. // "scopes": [
  110077. // "https://www.googleapis.com/auth/cloud-platform",
  110078. // "https://www.googleapis.com/auth/compute",
  110079. // "https://www.googleapis.com/auth/compute.readonly"
  110080. // ]
  110081. // }
  110082. }
  110083. // Pages invokes f for each page of results.
  110084. // A non-nil error returned from f will halt the iteration.
  110085. // The provided context supersedes any context provided to the Context method.
  110086. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  110087. c.ctx_ = ctx
  110088. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  110089. for {
  110090. x, err := c.Do()
  110091. if err != nil {
  110092. return err
  110093. }
  110094. if err := f(x); err != nil {
  110095. return err
  110096. }
  110097. if x.NextPageToken == "" {
  110098. return nil
  110099. }
  110100. c.PageToken(x.NextPageToken)
  110101. }
  110102. }
  110103. // method id "compute.regionInstanceGroups.listInstances":
  110104. type RegionInstanceGroupsListInstancesCall struct {
  110105. s *Service
  110106. project string
  110107. region string
  110108. instanceGroup string
  110109. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  110110. urlParams_ gensupport.URLParams
  110111. ctx_ context.Context
  110112. header_ http.Header
  110113. }
  110114. // ListInstances: Lists the instances in the specified instance group
  110115. // and displays information about the named ports. Depending on the
  110116. // specified options, this method can list all instances or only the
  110117. // instances that are running.
  110118. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  110119. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110120. c.project = project
  110121. c.region = region
  110122. c.instanceGroup = instanceGroup
  110123. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  110124. return c
  110125. }
  110126. // Filter sets the optional parameter "filter": A filter expression that
  110127. // filters resources listed in the response. The expression must specify
  110128. // the field name, a comparison operator, and the value that you want to
  110129. // use for filtering. The value must be a string, a number, or a
  110130. // boolean. The comparison operator must be either =, !=, >, or <.
  110131. //
  110132. // For example, if you are filtering Compute Engine instances, you can
  110133. // exclude instances named example-instance by specifying name !=
  110134. // example-instance.
  110135. //
  110136. // You can also filter nested fields. For example, you could specify
  110137. // scheduling.automaticRestart = false to include instances only if they
  110138. // are not scheduled for automatic restarts. You can use filtering on
  110139. // nested fields to filter based on resource labels.
  110140. //
  110141. // To filter on multiple expressions, provide each separate expression
  110142. // within parentheses. For example, (scheduling.automaticRestart = true)
  110143. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  110144. // AND expression. However, you can include AND and OR expressions
  110145. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  110146. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  110147. // true).
  110148. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  110149. c.urlParams_.Set("filter", filter)
  110150. return c
  110151. }
  110152. // MaxResults sets the optional parameter "maxResults": The maximum
  110153. // number of results per page that should be returned. If the number of
  110154. // available results is larger than maxResults, Compute Engine returns a
  110155. // nextPageToken that can be used to get the next page of results in
  110156. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  110157. // (Default: 500)
  110158. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  110159. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  110160. return c
  110161. }
  110162. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  110163. // a certain order. By default, results are returned in alphanumerical
  110164. // order based on the resource name.
  110165. //
  110166. // You can also sort results in descending order based on the creation
  110167. // timestamp using orderBy="creationTimestamp desc". This sorts results
  110168. // based on the creationTimestamp field in reverse chronological order
  110169. // (newest result first). Use this to sort resources like operations so
  110170. // that the newest operation is returned first.
  110171. //
  110172. // Currently, only sorting by name or creationTimestamp desc is
  110173. // supported.
  110174. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  110175. c.urlParams_.Set("orderBy", orderBy)
  110176. return c
  110177. }
  110178. // PageToken sets the optional parameter "pageToken": Specifies a page
  110179. // token to use. Set pageToken to the nextPageToken returned by a
  110180. // previous list request to get the next page of results.
  110181. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  110182. c.urlParams_.Set("pageToken", pageToken)
  110183. return c
  110184. }
  110185. // Fields allows partial responses to be retrieved. See
  110186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110187. // for more information.
  110188. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  110189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110190. return c
  110191. }
  110192. // Context sets the context to be used in this call's Do method. Any
  110193. // pending HTTP request will be aborted if the provided context is
  110194. // canceled.
  110195. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  110196. c.ctx_ = ctx
  110197. return c
  110198. }
  110199. // Header returns an http.Header that can be modified by the caller to
  110200. // add HTTP headers to the request.
  110201. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  110202. if c.header_ == nil {
  110203. c.header_ = make(http.Header)
  110204. }
  110205. return c.header_
  110206. }
  110207. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  110208. reqHeaders := make(http.Header)
  110209. for k, v := range c.header_ {
  110210. reqHeaders[k] = v
  110211. }
  110212. reqHeaders.Set("User-Agent", c.s.userAgent())
  110213. var body io.Reader = nil
  110214. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  110215. if err != nil {
  110216. return nil, err
  110217. }
  110218. reqHeaders.Set("Content-Type", "application/json")
  110219. c.urlParams_.Set("alt", alt)
  110220. c.urlParams_.Set("prettyPrint", "false")
  110221. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  110222. urls += "?" + c.urlParams_.Encode()
  110223. req, err := http.NewRequest("POST", urls, body)
  110224. if err != nil {
  110225. return nil, err
  110226. }
  110227. req.Header = reqHeaders
  110228. googleapi.Expand(req.URL, map[string]string{
  110229. "project": c.project,
  110230. "region": c.region,
  110231. "instanceGroup": c.instanceGroup,
  110232. })
  110233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110234. }
  110235. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  110236. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  110237. // non-nil. Any non-2xx status code is an error. Response headers are in
  110238. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  110239. // (if a response was returned at all) in
  110240. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  110241. // whether the returned error was because http.StatusNotModified was
  110242. // returned.
  110243. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  110244. gensupport.SetOptions(c.urlParams_, opts...)
  110245. res, err := c.doRequest("json")
  110246. if res != nil && res.StatusCode == http.StatusNotModified {
  110247. if res.Body != nil {
  110248. res.Body.Close()
  110249. }
  110250. return nil, &googleapi.Error{
  110251. Code: res.StatusCode,
  110252. Header: res.Header,
  110253. }
  110254. }
  110255. if err != nil {
  110256. return nil, err
  110257. }
  110258. defer googleapi.CloseBody(res)
  110259. if err := googleapi.CheckResponse(res); err != nil {
  110260. return nil, err
  110261. }
  110262. ret := &RegionInstanceGroupsListInstances{
  110263. ServerResponse: googleapi.ServerResponse{
  110264. Header: res.Header,
  110265. HTTPStatusCode: res.StatusCode,
  110266. },
  110267. }
  110268. target := &ret
  110269. if err := gensupport.DecodeResponse(target, res); err != nil {
  110270. return nil, err
  110271. }
  110272. return ret, nil
  110273. // {
  110274. // "description": "Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running.",
  110275. // "httpMethod": "POST",
  110276. // "id": "compute.regionInstanceGroups.listInstances",
  110277. // "parameterOrder": [
  110278. // "project",
  110279. // "region",
  110280. // "instanceGroup"
  110281. // ],
  110282. // "parameters": {
  110283. // "filter": {
  110284. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  110285. // "location": "query",
  110286. // "type": "string"
  110287. // },
  110288. // "instanceGroup": {
  110289. // "description": "Name of the regional instance group for which we want to list the instances.",
  110290. // "location": "path",
  110291. // "required": true,
  110292. // "type": "string"
  110293. // },
  110294. // "maxResults": {
  110295. // "default": "500",
  110296. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  110297. // "format": "uint32",
  110298. // "location": "query",
  110299. // "minimum": "0",
  110300. // "type": "integer"
  110301. // },
  110302. // "orderBy": {
  110303. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  110304. // "location": "query",
  110305. // "type": "string"
  110306. // },
  110307. // "pageToken": {
  110308. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  110309. // "location": "query",
  110310. // "type": "string"
  110311. // },
  110312. // "project": {
  110313. // "description": "Project ID for this request.",
  110314. // "location": "path",
  110315. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110316. // "required": true,
  110317. // "type": "string"
  110318. // },
  110319. // "region": {
  110320. // "description": "Name of the region scoping this request.",
  110321. // "location": "path",
  110322. // "required": true,
  110323. // "type": "string"
  110324. // }
  110325. // },
  110326. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  110327. // "request": {
  110328. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  110329. // },
  110330. // "response": {
  110331. // "$ref": "RegionInstanceGroupsListInstances"
  110332. // },
  110333. // "scopes": [
  110334. // "https://www.googleapis.com/auth/cloud-platform",
  110335. // "https://www.googleapis.com/auth/compute",
  110336. // "https://www.googleapis.com/auth/compute.readonly"
  110337. // ]
  110338. // }
  110339. }
  110340. // Pages invokes f for each page of results.
  110341. // A non-nil error returned from f will halt the iteration.
  110342. // The provided context supersedes any context provided to the Context method.
  110343. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  110344. c.ctx_ = ctx
  110345. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  110346. for {
  110347. x, err := c.Do()
  110348. if err != nil {
  110349. return err
  110350. }
  110351. if err := f(x); err != nil {
  110352. return err
  110353. }
  110354. if x.NextPageToken == "" {
  110355. return nil
  110356. }
  110357. c.PageToken(x.NextPageToken)
  110358. }
  110359. }
  110360. // method id "compute.regionInstanceGroups.setNamedPorts":
  110361. type RegionInstanceGroupsSetNamedPortsCall struct {
  110362. s *Service
  110363. project string
  110364. region string
  110365. instanceGroup string
  110366. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  110367. urlParams_ gensupport.URLParams
  110368. ctx_ context.Context
  110369. header_ http.Header
  110370. }
  110371. // SetNamedPorts: Sets the named ports for the specified regional
  110372. // instance group.
  110373. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  110374. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110375. c.project = project
  110376. c.region = region
  110377. c.instanceGroup = instanceGroup
  110378. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  110379. return c
  110380. }
  110381. // RequestId sets the optional parameter "requestId": An optional
  110382. // request ID to identify requests. Specify a unique request ID so that
  110383. // if you must retry your request, the server will know to ignore the
  110384. // request if it has already been completed.
  110385. //
  110386. // For example, consider a situation where you make an initial request
  110387. // and the request times out. If you make the request again with the
  110388. // same request ID, the server can check if original operation with the
  110389. // same request ID was received, and if so, will ignore the second
  110390. // request. This prevents clients from accidentally creating duplicate
  110391. // commitments.
  110392. //
  110393. // The request ID must be a valid UUID with the exception that zero UUID
  110394. // is not supported (00000000-0000-0000-0000-000000000000).
  110395. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  110396. c.urlParams_.Set("requestId", requestId)
  110397. return c
  110398. }
  110399. // Fields allows partial responses to be retrieved. See
  110400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110401. // for more information.
  110402. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  110403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110404. return c
  110405. }
  110406. // Context sets the context to be used in this call's Do method. Any
  110407. // pending HTTP request will be aborted if the provided context is
  110408. // canceled.
  110409. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  110410. c.ctx_ = ctx
  110411. return c
  110412. }
  110413. // Header returns an http.Header that can be modified by the caller to
  110414. // add HTTP headers to the request.
  110415. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  110416. if c.header_ == nil {
  110417. c.header_ = make(http.Header)
  110418. }
  110419. return c.header_
  110420. }
  110421. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  110422. reqHeaders := make(http.Header)
  110423. for k, v := range c.header_ {
  110424. reqHeaders[k] = v
  110425. }
  110426. reqHeaders.Set("User-Agent", c.s.userAgent())
  110427. var body io.Reader = nil
  110428. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  110429. if err != nil {
  110430. return nil, err
  110431. }
  110432. reqHeaders.Set("Content-Type", "application/json")
  110433. c.urlParams_.Set("alt", alt)
  110434. c.urlParams_.Set("prettyPrint", "false")
  110435. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  110436. urls += "?" + c.urlParams_.Encode()
  110437. req, err := http.NewRequest("POST", urls, body)
  110438. if err != nil {
  110439. return nil, err
  110440. }
  110441. req.Header = reqHeaders
  110442. googleapi.Expand(req.URL, map[string]string{
  110443. "project": c.project,
  110444. "region": c.region,
  110445. "instanceGroup": c.instanceGroup,
  110446. })
  110447. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110448. }
  110449. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  110450. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110451. // status code is an error. Response headers are in either
  110452. // *Operation.ServerResponse.Header or (if a response was returned at
  110453. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110454. // to check whether the returned error was because
  110455. // http.StatusNotModified was returned.
  110456. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110457. gensupport.SetOptions(c.urlParams_, opts...)
  110458. res, err := c.doRequest("json")
  110459. if res != nil && res.StatusCode == http.StatusNotModified {
  110460. if res.Body != nil {
  110461. res.Body.Close()
  110462. }
  110463. return nil, &googleapi.Error{
  110464. Code: res.StatusCode,
  110465. Header: res.Header,
  110466. }
  110467. }
  110468. if err != nil {
  110469. return nil, err
  110470. }
  110471. defer googleapi.CloseBody(res)
  110472. if err := googleapi.CheckResponse(res); err != nil {
  110473. return nil, err
  110474. }
  110475. ret := &Operation{
  110476. ServerResponse: googleapi.ServerResponse{
  110477. Header: res.Header,
  110478. HTTPStatusCode: res.StatusCode,
  110479. },
  110480. }
  110481. target := &ret
  110482. if err := gensupport.DecodeResponse(target, res); err != nil {
  110483. return nil, err
  110484. }
  110485. return ret, nil
  110486. // {
  110487. // "description": "Sets the named ports for the specified regional instance group.",
  110488. // "httpMethod": "POST",
  110489. // "id": "compute.regionInstanceGroups.setNamedPorts",
  110490. // "parameterOrder": [
  110491. // "project",
  110492. // "region",
  110493. // "instanceGroup"
  110494. // ],
  110495. // "parameters": {
  110496. // "instanceGroup": {
  110497. // "description": "The name of the regional instance group where the named ports are updated.",
  110498. // "location": "path",
  110499. // "required": true,
  110500. // "type": "string"
  110501. // },
  110502. // "project": {
  110503. // "description": "Project ID for this request.",
  110504. // "location": "path",
  110505. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110506. // "required": true,
  110507. // "type": "string"
  110508. // },
  110509. // "region": {
  110510. // "description": "Name of the region scoping this request.",
  110511. // "location": "path",
  110512. // "required": true,
  110513. // "type": "string"
  110514. // },
  110515. // "requestId": {
  110516. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110517. // "location": "query",
  110518. // "type": "string"
  110519. // }
  110520. // },
  110521. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  110522. // "request": {
  110523. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  110524. // },
  110525. // "response": {
  110526. // "$ref": "Operation"
  110527. // },
  110528. // "scopes": [
  110529. // "https://www.googleapis.com/auth/cloud-platform",
  110530. // "https://www.googleapis.com/auth/compute"
  110531. // ]
  110532. // }
  110533. }
  110534. // method id "compute.regionInstanceGroups.testIamPermissions":
  110535. type RegionInstanceGroupsTestIamPermissionsCall struct {
  110536. s *Service
  110537. project string
  110538. region string
  110539. resource string
  110540. testpermissionsrequest *TestPermissionsRequest
  110541. urlParams_ gensupport.URLParams
  110542. ctx_ context.Context
  110543. header_ http.Header
  110544. }
  110545. // TestIamPermissions: Returns permissions that a caller has on the
  110546. // specified resource.
  110547. func (r *RegionInstanceGroupsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupsTestIamPermissionsCall {
  110548. c := &RegionInstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110549. c.project = project
  110550. c.region = region
  110551. c.resource = resource
  110552. c.testpermissionsrequest = testpermissionsrequest
  110553. return c
  110554. }
  110555. // Fields allows partial responses to be retrieved. See
  110556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110557. // for more information.
  110558. func (c *RegionInstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsTestIamPermissionsCall {
  110559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110560. return c
  110561. }
  110562. // Context sets the context to be used in this call's Do method. Any
  110563. // pending HTTP request will be aborted if the provided context is
  110564. // canceled.
  110565. func (c *RegionInstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupsTestIamPermissionsCall {
  110566. c.ctx_ = ctx
  110567. return c
  110568. }
  110569. // Header returns an http.Header that can be modified by the caller to
  110570. // add HTTP headers to the request.
  110571. func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header {
  110572. if c.header_ == nil {
  110573. c.header_ = make(http.Header)
  110574. }
  110575. return c.header_
  110576. }
  110577. func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  110578. reqHeaders := make(http.Header)
  110579. for k, v := range c.header_ {
  110580. reqHeaders[k] = v
  110581. }
  110582. reqHeaders.Set("User-Agent", c.s.userAgent())
  110583. var body io.Reader = nil
  110584. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  110585. if err != nil {
  110586. return nil, err
  110587. }
  110588. reqHeaders.Set("Content-Type", "application/json")
  110589. c.urlParams_.Set("alt", alt)
  110590. c.urlParams_.Set("prettyPrint", "false")
  110591. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions")
  110592. urls += "?" + c.urlParams_.Encode()
  110593. req, err := http.NewRequest("POST", urls, body)
  110594. if err != nil {
  110595. return nil, err
  110596. }
  110597. req.Header = reqHeaders
  110598. googleapi.Expand(req.URL, map[string]string{
  110599. "project": c.project,
  110600. "region": c.region,
  110601. "resource": c.resource,
  110602. })
  110603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110604. }
  110605. // Do executes the "compute.regionInstanceGroups.testIamPermissions" call.
  110606. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  110607. // non-2xx status code is an error. Response headers are in either
  110608. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  110609. // returned at all) in error.(*googleapi.Error).Header. Use
  110610. // googleapi.IsNotModified to check whether the returned error was
  110611. // because http.StatusNotModified was returned.
  110612. func (c *RegionInstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  110613. gensupport.SetOptions(c.urlParams_, opts...)
  110614. res, err := c.doRequest("json")
  110615. if res != nil && res.StatusCode == http.StatusNotModified {
  110616. if res.Body != nil {
  110617. res.Body.Close()
  110618. }
  110619. return nil, &googleapi.Error{
  110620. Code: res.StatusCode,
  110621. Header: res.Header,
  110622. }
  110623. }
  110624. if err != nil {
  110625. return nil, err
  110626. }
  110627. defer googleapi.CloseBody(res)
  110628. if err := googleapi.CheckResponse(res); err != nil {
  110629. return nil, err
  110630. }
  110631. ret := &TestPermissionsResponse{
  110632. ServerResponse: googleapi.ServerResponse{
  110633. Header: res.Header,
  110634. HTTPStatusCode: res.StatusCode,
  110635. },
  110636. }
  110637. target := &ret
  110638. if err := gensupport.DecodeResponse(target, res); err != nil {
  110639. return nil, err
  110640. }
  110641. return ret, nil
  110642. // {
  110643. // "description": "Returns permissions that a caller has on the specified resource.",
  110644. // "httpMethod": "POST",
  110645. // "id": "compute.regionInstanceGroups.testIamPermissions",
  110646. // "parameterOrder": [
  110647. // "project",
  110648. // "region",
  110649. // "resource"
  110650. // ],
  110651. // "parameters": {
  110652. // "project": {
  110653. // "description": "Project ID for this request.",
  110654. // "location": "path",
  110655. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110656. // "required": true,
  110657. // "type": "string"
  110658. // },
  110659. // "region": {
  110660. // "description": "The name of the region for this request.",
  110661. // "location": "path",
  110662. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110663. // "required": true,
  110664. // "type": "string"
  110665. // },
  110666. // "resource": {
  110667. // "description": "Name or id of the resource for this request.",
  110668. // "location": "path",
  110669. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110670. // "required": true,
  110671. // "type": "string"
  110672. // }
  110673. // },
  110674. // "path": "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions",
  110675. // "request": {
  110676. // "$ref": "TestPermissionsRequest"
  110677. // },
  110678. // "response": {
  110679. // "$ref": "TestPermissionsResponse"
  110680. // },
  110681. // "scopes": [
  110682. // "https://www.googleapis.com/auth/cloud-platform",
  110683. // "https://www.googleapis.com/auth/compute",
  110684. // "https://www.googleapis.com/auth/compute.readonly"
  110685. // ]
  110686. // }
  110687. }
  110688. // method id "compute.regionNotificationEndpoints.delete":
  110689. type RegionNotificationEndpointsDeleteCall struct {
  110690. s *Service
  110691. project string
  110692. region string
  110693. notificationEndpoint string
  110694. urlParams_ gensupport.URLParams
  110695. ctx_ context.Context
  110696. header_ http.Header
  110697. }
  110698. // Delete: Deletes the specified NotificationEndpoint in the given
  110699. // region
  110700. func (r *RegionNotificationEndpointsService) Delete(project string, region string, notificationEndpoint string) *RegionNotificationEndpointsDeleteCall {
  110701. c := &RegionNotificationEndpointsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110702. c.project = project
  110703. c.region = region
  110704. c.notificationEndpoint = notificationEndpoint
  110705. return c
  110706. }
  110707. // RequestId sets the optional parameter "requestId": An optional
  110708. // request ID to identify requests. Specify a unique request ID so that
  110709. // if you must retry your request, the server will know to ignore the
  110710. // request if it has already been completed.
  110711. //
  110712. // For example, consider a situation where you make an initial request
  110713. // and the request times out. If you make the request again with the
  110714. // same request ID, the server can check if original operation with the
  110715. // same request ID was received, and if so, will ignore the second
  110716. // request. This prevents clients from accidentally creating duplicate
  110717. // commitments.
  110718. //
  110719. // The request ID must be a valid UUID with the exception that zero UUID
  110720. // is not supported (00000000-0000-0000-0000-000000000000).
  110721. func (c *RegionNotificationEndpointsDeleteCall) RequestId(requestId string) *RegionNotificationEndpointsDeleteCall {
  110722. c.urlParams_.Set("requestId", requestId)
  110723. return c
  110724. }
  110725. // Fields allows partial responses to be retrieved. See
  110726. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110727. // for more information.
  110728. func (c *RegionNotificationEndpointsDeleteCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsDeleteCall {
  110729. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110730. return c
  110731. }
  110732. // Context sets the context to be used in this call's Do method. Any
  110733. // pending HTTP request will be aborted if the provided context is
  110734. // canceled.
  110735. func (c *RegionNotificationEndpointsDeleteCall) Context(ctx context.Context) *RegionNotificationEndpointsDeleteCall {
  110736. c.ctx_ = ctx
  110737. return c
  110738. }
  110739. // Header returns an http.Header that can be modified by the caller to
  110740. // add HTTP headers to the request.
  110741. func (c *RegionNotificationEndpointsDeleteCall) Header() http.Header {
  110742. if c.header_ == nil {
  110743. c.header_ = make(http.Header)
  110744. }
  110745. return c.header_
  110746. }
  110747. func (c *RegionNotificationEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) {
  110748. reqHeaders := make(http.Header)
  110749. for k, v := range c.header_ {
  110750. reqHeaders[k] = v
  110751. }
  110752. reqHeaders.Set("User-Agent", c.s.userAgent())
  110753. var body io.Reader = nil
  110754. c.urlParams_.Set("alt", alt)
  110755. c.urlParams_.Set("prettyPrint", "false")
  110756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}")
  110757. urls += "?" + c.urlParams_.Encode()
  110758. req, err := http.NewRequest("DELETE", urls, body)
  110759. if err != nil {
  110760. return nil, err
  110761. }
  110762. req.Header = reqHeaders
  110763. googleapi.Expand(req.URL, map[string]string{
  110764. "project": c.project,
  110765. "region": c.region,
  110766. "notificationEndpoint": c.notificationEndpoint,
  110767. })
  110768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110769. }
  110770. // Do executes the "compute.regionNotificationEndpoints.delete" call.
  110771. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  110772. // status code is an error. Response headers are in either
  110773. // *Operation.ServerResponse.Header or (if a response was returned at
  110774. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  110775. // to check whether the returned error was because
  110776. // http.StatusNotModified was returned.
  110777. func (c *RegionNotificationEndpointsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  110778. gensupport.SetOptions(c.urlParams_, opts...)
  110779. res, err := c.doRequest("json")
  110780. if res != nil && res.StatusCode == http.StatusNotModified {
  110781. if res.Body != nil {
  110782. res.Body.Close()
  110783. }
  110784. return nil, &googleapi.Error{
  110785. Code: res.StatusCode,
  110786. Header: res.Header,
  110787. }
  110788. }
  110789. if err != nil {
  110790. return nil, err
  110791. }
  110792. defer googleapi.CloseBody(res)
  110793. if err := googleapi.CheckResponse(res); err != nil {
  110794. return nil, err
  110795. }
  110796. ret := &Operation{
  110797. ServerResponse: googleapi.ServerResponse{
  110798. Header: res.Header,
  110799. HTTPStatusCode: res.StatusCode,
  110800. },
  110801. }
  110802. target := &ret
  110803. if err := gensupport.DecodeResponse(target, res); err != nil {
  110804. return nil, err
  110805. }
  110806. return ret, nil
  110807. // {
  110808. // "description": "Deletes the specified NotificationEndpoint in the given region",
  110809. // "httpMethod": "DELETE",
  110810. // "id": "compute.regionNotificationEndpoints.delete",
  110811. // "parameterOrder": [
  110812. // "project",
  110813. // "region",
  110814. // "notificationEndpoint"
  110815. // ],
  110816. // "parameters": {
  110817. // "notificationEndpoint": {
  110818. // "description": "Name of the NotificationEndpoint resource to delete.",
  110819. // "location": "path",
  110820. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110821. // "required": true,
  110822. // "type": "string"
  110823. // },
  110824. // "project": {
  110825. // "description": "Project ID for this request.",
  110826. // "location": "path",
  110827. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110828. // "required": true,
  110829. // "type": "string"
  110830. // },
  110831. // "region": {
  110832. // "description": "Name of the region scoping this request.",
  110833. // "location": "path",
  110834. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110835. // "required": true,
  110836. // "type": "string"
  110837. // },
  110838. // "requestId": {
  110839. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  110840. // "location": "query",
  110841. // "type": "string"
  110842. // }
  110843. // },
  110844. // "path": "{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}",
  110845. // "response": {
  110846. // "$ref": "Operation"
  110847. // },
  110848. // "scopes": [
  110849. // "https://www.googleapis.com/auth/cloud-platform",
  110850. // "https://www.googleapis.com/auth/compute"
  110851. // ]
  110852. // }
  110853. }
  110854. // method id "compute.regionNotificationEndpoints.get":
  110855. type RegionNotificationEndpointsGetCall struct {
  110856. s *Service
  110857. project string
  110858. region string
  110859. notificationEndpoint string
  110860. urlParams_ gensupport.URLParams
  110861. ifNoneMatch_ string
  110862. ctx_ context.Context
  110863. header_ http.Header
  110864. }
  110865. // Get: Returns the specified NotificationEndpoint resource in the given
  110866. // region.
  110867. func (r *RegionNotificationEndpointsService) Get(project string, region string, notificationEndpoint string) *RegionNotificationEndpointsGetCall {
  110868. c := &RegionNotificationEndpointsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  110869. c.project = project
  110870. c.region = region
  110871. c.notificationEndpoint = notificationEndpoint
  110872. return c
  110873. }
  110874. // Fields allows partial responses to be retrieved. See
  110875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  110876. // for more information.
  110877. func (c *RegionNotificationEndpointsGetCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsGetCall {
  110878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  110879. return c
  110880. }
  110881. // IfNoneMatch sets the optional parameter which makes the operation
  110882. // fail if the object's ETag matches the given value. This is useful for
  110883. // getting updates only after the object has changed since the last
  110884. // request. Use googleapi.IsNotModified to check whether the response
  110885. // error from Do is the result of In-None-Match.
  110886. func (c *RegionNotificationEndpointsGetCall) IfNoneMatch(entityTag string) *RegionNotificationEndpointsGetCall {
  110887. c.ifNoneMatch_ = entityTag
  110888. return c
  110889. }
  110890. // Context sets the context to be used in this call's Do method. Any
  110891. // pending HTTP request will be aborted if the provided context is
  110892. // canceled.
  110893. func (c *RegionNotificationEndpointsGetCall) Context(ctx context.Context) *RegionNotificationEndpointsGetCall {
  110894. c.ctx_ = ctx
  110895. return c
  110896. }
  110897. // Header returns an http.Header that can be modified by the caller to
  110898. // add HTTP headers to the request.
  110899. func (c *RegionNotificationEndpointsGetCall) Header() http.Header {
  110900. if c.header_ == nil {
  110901. c.header_ = make(http.Header)
  110902. }
  110903. return c.header_
  110904. }
  110905. func (c *RegionNotificationEndpointsGetCall) doRequest(alt string) (*http.Response, error) {
  110906. reqHeaders := make(http.Header)
  110907. for k, v := range c.header_ {
  110908. reqHeaders[k] = v
  110909. }
  110910. reqHeaders.Set("User-Agent", c.s.userAgent())
  110911. if c.ifNoneMatch_ != "" {
  110912. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  110913. }
  110914. var body io.Reader = nil
  110915. c.urlParams_.Set("alt", alt)
  110916. c.urlParams_.Set("prettyPrint", "false")
  110917. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}")
  110918. urls += "?" + c.urlParams_.Encode()
  110919. req, err := http.NewRequest("GET", urls, body)
  110920. if err != nil {
  110921. return nil, err
  110922. }
  110923. req.Header = reqHeaders
  110924. googleapi.Expand(req.URL, map[string]string{
  110925. "project": c.project,
  110926. "region": c.region,
  110927. "notificationEndpoint": c.notificationEndpoint,
  110928. })
  110929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  110930. }
  110931. // Do executes the "compute.regionNotificationEndpoints.get" call.
  110932. // Exactly one of *NotificationEndpoint or error will be non-nil. Any
  110933. // non-2xx status code is an error. Response headers are in either
  110934. // *NotificationEndpoint.ServerResponse.Header or (if a response was
  110935. // returned at all) in error.(*googleapi.Error).Header. Use
  110936. // googleapi.IsNotModified to check whether the returned error was
  110937. // because http.StatusNotModified was returned.
  110938. func (c *RegionNotificationEndpointsGetCall) Do(opts ...googleapi.CallOption) (*NotificationEndpoint, error) {
  110939. gensupport.SetOptions(c.urlParams_, opts...)
  110940. res, err := c.doRequest("json")
  110941. if res != nil && res.StatusCode == http.StatusNotModified {
  110942. if res.Body != nil {
  110943. res.Body.Close()
  110944. }
  110945. return nil, &googleapi.Error{
  110946. Code: res.StatusCode,
  110947. Header: res.Header,
  110948. }
  110949. }
  110950. if err != nil {
  110951. return nil, err
  110952. }
  110953. defer googleapi.CloseBody(res)
  110954. if err := googleapi.CheckResponse(res); err != nil {
  110955. return nil, err
  110956. }
  110957. ret := &NotificationEndpoint{
  110958. ServerResponse: googleapi.ServerResponse{
  110959. Header: res.Header,
  110960. HTTPStatusCode: res.StatusCode,
  110961. },
  110962. }
  110963. target := &ret
  110964. if err := gensupport.DecodeResponse(target, res); err != nil {
  110965. return nil, err
  110966. }
  110967. return ret, nil
  110968. // {
  110969. // "description": "Returns the specified NotificationEndpoint resource in the given region.",
  110970. // "httpMethod": "GET",
  110971. // "id": "compute.regionNotificationEndpoints.get",
  110972. // "parameterOrder": [
  110973. // "project",
  110974. // "region",
  110975. // "notificationEndpoint"
  110976. // ],
  110977. // "parameters": {
  110978. // "notificationEndpoint": {
  110979. // "description": "Name of the NotificationEndpoint resource to return.",
  110980. // "location": "path",
  110981. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  110982. // "required": true,
  110983. // "type": "string"
  110984. // },
  110985. // "project": {
  110986. // "description": "Project ID for this request.",
  110987. // "location": "path",
  110988. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  110989. // "required": true,
  110990. // "type": "string"
  110991. // },
  110992. // "region": {
  110993. // "description": "Name of the region scoping this request.",
  110994. // "location": "path",
  110995. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  110996. // "required": true,
  110997. // "type": "string"
  110998. // }
  110999. // },
  111000. // "path": "{project}/regions/{region}/notificationEndpoints/{notificationEndpoint}",
  111001. // "response": {
  111002. // "$ref": "NotificationEndpoint"
  111003. // },
  111004. // "scopes": [
  111005. // "https://www.googleapis.com/auth/cloud-platform",
  111006. // "https://www.googleapis.com/auth/compute",
  111007. // "https://www.googleapis.com/auth/compute.readonly"
  111008. // ]
  111009. // }
  111010. }
  111011. // method id "compute.regionNotificationEndpoints.insert":
  111012. type RegionNotificationEndpointsInsertCall struct {
  111013. s *Service
  111014. project string
  111015. region string
  111016. notificationendpoint *NotificationEndpoint
  111017. urlParams_ gensupport.URLParams
  111018. ctx_ context.Context
  111019. header_ http.Header
  111020. }
  111021. // Insert: Create a NotificationEndpoint in the specified project in the
  111022. // given region using the parameters that are included in the request.
  111023. func (r *RegionNotificationEndpointsService) Insert(project string, region string, notificationendpoint *NotificationEndpoint) *RegionNotificationEndpointsInsertCall {
  111024. c := &RegionNotificationEndpointsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111025. c.project = project
  111026. c.region = region
  111027. c.notificationendpoint = notificationendpoint
  111028. return c
  111029. }
  111030. // RequestId sets the optional parameter "requestId": An optional
  111031. // request ID to identify requests. Specify a unique request ID so that
  111032. // if you must retry your request, the server will know to ignore the
  111033. // request if it has already been completed.
  111034. //
  111035. // For example, consider a situation where you make an initial request
  111036. // and the request times out. If you make the request again with the
  111037. // same request ID, the server can check if original operation with the
  111038. // same request ID was received, and if so, will ignore the second
  111039. // request. This prevents clients from accidentally creating duplicate
  111040. // commitments.
  111041. //
  111042. // The request ID must be a valid UUID with the exception that zero UUID
  111043. // is not supported (00000000-0000-0000-0000-000000000000).
  111044. func (c *RegionNotificationEndpointsInsertCall) RequestId(requestId string) *RegionNotificationEndpointsInsertCall {
  111045. c.urlParams_.Set("requestId", requestId)
  111046. return c
  111047. }
  111048. // Fields allows partial responses to be retrieved. See
  111049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111050. // for more information.
  111051. func (c *RegionNotificationEndpointsInsertCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsInsertCall {
  111052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111053. return c
  111054. }
  111055. // Context sets the context to be used in this call's Do method. Any
  111056. // pending HTTP request will be aborted if the provided context is
  111057. // canceled.
  111058. func (c *RegionNotificationEndpointsInsertCall) Context(ctx context.Context) *RegionNotificationEndpointsInsertCall {
  111059. c.ctx_ = ctx
  111060. return c
  111061. }
  111062. // Header returns an http.Header that can be modified by the caller to
  111063. // add HTTP headers to the request.
  111064. func (c *RegionNotificationEndpointsInsertCall) Header() http.Header {
  111065. if c.header_ == nil {
  111066. c.header_ = make(http.Header)
  111067. }
  111068. return c.header_
  111069. }
  111070. func (c *RegionNotificationEndpointsInsertCall) doRequest(alt string) (*http.Response, error) {
  111071. reqHeaders := make(http.Header)
  111072. for k, v := range c.header_ {
  111073. reqHeaders[k] = v
  111074. }
  111075. reqHeaders.Set("User-Agent", c.s.userAgent())
  111076. var body io.Reader = nil
  111077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationendpoint)
  111078. if err != nil {
  111079. return nil, err
  111080. }
  111081. reqHeaders.Set("Content-Type", "application/json")
  111082. c.urlParams_.Set("alt", alt)
  111083. c.urlParams_.Set("prettyPrint", "false")
  111084. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints")
  111085. urls += "?" + c.urlParams_.Encode()
  111086. req, err := http.NewRequest("POST", urls, body)
  111087. if err != nil {
  111088. return nil, err
  111089. }
  111090. req.Header = reqHeaders
  111091. googleapi.Expand(req.URL, map[string]string{
  111092. "project": c.project,
  111093. "region": c.region,
  111094. })
  111095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111096. }
  111097. // Do executes the "compute.regionNotificationEndpoints.insert" call.
  111098. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111099. // status code is an error. Response headers are in either
  111100. // *Operation.ServerResponse.Header or (if a response was returned at
  111101. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111102. // to check whether the returned error was because
  111103. // http.StatusNotModified was returned.
  111104. func (c *RegionNotificationEndpointsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111105. gensupport.SetOptions(c.urlParams_, opts...)
  111106. res, err := c.doRequest("json")
  111107. if res != nil && res.StatusCode == http.StatusNotModified {
  111108. if res.Body != nil {
  111109. res.Body.Close()
  111110. }
  111111. return nil, &googleapi.Error{
  111112. Code: res.StatusCode,
  111113. Header: res.Header,
  111114. }
  111115. }
  111116. if err != nil {
  111117. return nil, err
  111118. }
  111119. defer googleapi.CloseBody(res)
  111120. if err := googleapi.CheckResponse(res); err != nil {
  111121. return nil, err
  111122. }
  111123. ret := &Operation{
  111124. ServerResponse: googleapi.ServerResponse{
  111125. Header: res.Header,
  111126. HTTPStatusCode: res.StatusCode,
  111127. },
  111128. }
  111129. target := &ret
  111130. if err := gensupport.DecodeResponse(target, res); err != nil {
  111131. return nil, err
  111132. }
  111133. return ret, nil
  111134. // {
  111135. // "description": "Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request.",
  111136. // "httpMethod": "POST",
  111137. // "id": "compute.regionNotificationEndpoints.insert",
  111138. // "parameterOrder": [
  111139. // "project",
  111140. // "region"
  111141. // ],
  111142. // "parameters": {
  111143. // "project": {
  111144. // "description": "Project ID for this request.",
  111145. // "location": "path",
  111146. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111147. // "required": true,
  111148. // "type": "string"
  111149. // },
  111150. // "region": {
  111151. // "description": "Name of the region scoping this request.",
  111152. // "location": "path",
  111153. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111154. // "required": true,
  111155. // "type": "string"
  111156. // },
  111157. // "requestId": {
  111158. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  111159. // "location": "query",
  111160. // "type": "string"
  111161. // }
  111162. // },
  111163. // "path": "{project}/regions/{region}/notificationEndpoints",
  111164. // "request": {
  111165. // "$ref": "NotificationEndpoint"
  111166. // },
  111167. // "response": {
  111168. // "$ref": "Operation"
  111169. // },
  111170. // "scopes": [
  111171. // "https://www.googleapis.com/auth/cloud-platform",
  111172. // "https://www.googleapis.com/auth/compute"
  111173. // ]
  111174. // }
  111175. }
  111176. // method id "compute.regionNotificationEndpoints.list":
  111177. type RegionNotificationEndpointsListCall struct {
  111178. s *Service
  111179. project string
  111180. region string
  111181. urlParams_ gensupport.URLParams
  111182. ifNoneMatch_ string
  111183. ctx_ context.Context
  111184. header_ http.Header
  111185. }
  111186. // List: Lists the NotificationEndpoints for a project in the given
  111187. // region.
  111188. func (r *RegionNotificationEndpointsService) List(project string, region string) *RegionNotificationEndpointsListCall {
  111189. c := &RegionNotificationEndpointsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111190. c.project = project
  111191. c.region = region
  111192. return c
  111193. }
  111194. // Filter sets the optional parameter "filter": A filter expression that
  111195. // filters resources listed in the response. The expression must specify
  111196. // the field name, a comparison operator, and the value that you want to
  111197. // use for filtering. The value must be a string, a number, or a
  111198. // boolean. The comparison operator must be either =, !=, >, or <.
  111199. //
  111200. // For example, if you are filtering Compute Engine instances, you can
  111201. // exclude instances named example-instance by specifying name !=
  111202. // example-instance.
  111203. //
  111204. // You can also filter nested fields. For example, you could specify
  111205. // scheduling.automaticRestart = false to include instances only if they
  111206. // are not scheduled for automatic restarts. You can use filtering on
  111207. // nested fields to filter based on resource labels.
  111208. //
  111209. // To filter on multiple expressions, provide each separate expression
  111210. // within parentheses. For example, (scheduling.automaticRestart = true)
  111211. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  111212. // AND expression. However, you can include AND and OR expressions
  111213. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  111214. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  111215. // true).
  111216. func (c *RegionNotificationEndpointsListCall) Filter(filter string) *RegionNotificationEndpointsListCall {
  111217. c.urlParams_.Set("filter", filter)
  111218. return c
  111219. }
  111220. // MaxResults sets the optional parameter "maxResults": The maximum
  111221. // number of results per page that should be returned. If the number of
  111222. // available results is larger than maxResults, Compute Engine returns a
  111223. // nextPageToken that can be used to get the next page of results in
  111224. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  111225. // (Default: 500)
  111226. func (c *RegionNotificationEndpointsListCall) MaxResults(maxResults int64) *RegionNotificationEndpointsListCall {
  111227. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  111228. return c
  111229. }
  111230. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  111231. // a certain order. By default, results are returned in alphanumerical
  111232. // order based on the resource name.
  111233. //
  111234. // You can also sort results in descending order based on the creation
  111235. // timestamp using orderBy="creationTimestamp desc". This sorts results
  111236. // based on the creationTimestamp field in reverse chronological order
  111237. // (newest result first). Use this to sort resources like operations so
  111238. // that the newest operation is returned first.
  111239. //
  111240. // Currently, only sorting by name or creationTimestamp desc is
  111241. // supported.
  111242. func (c *RegionNotificationEndpointsListCall) OrderBy(orderBy string) *RegionNotificationEndpointsListCall {
  111243. c.urlParams_.Set("orderBy", orderBy)
  111244. return c
  111245. }
  111246. // PageToken sets the optional parameter "pageToken": Specifies a page
  111247. // token to use. Set pageToken to the nextPageToken returned by a
  111248. // previous list request to get the next page of results.
  111249. func (c *RegionNotificationEndpointsListCall) PageToken(pageToken string) *RegionNotificationEndpointsListCall {
  111250. c.urlParams_.Set("pageToken", pageToken)
  111251. return c
  111252. }
  111253. // Fields allows partial responses to be retrieved. See
  111254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111255. // for more information.
  111256. func (c *RegionNotificationEndpointsListCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsListCall {
  111257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111258. return c
  111259. }
  111260. // IfNoneMatch sets the optional parameter which makes the operation
  111261. // fail if the object's ETag matches the given value. This is useful for
  111262. // getting updates only after the object has changed since the last
  111263. // request. Use googleapi.IsNotModified to check whether the response
  111264. // error from Do is the result of In-None-Match.
  111265. func (c *RegionNotificationEndpointsListCall) IfNoneMatch(entityTag string) *RegionNotificationEndpointsListCall {
  111266. c.ifNoneMatch_ = entityTag
  111267. return c
  111268. }
  111269. // Context sets the context to be used in this call's Do method. Any
  111270. // pending HTTP request will be aborted if the provided context is
  111271. // canceled.
  111272. func (c *RegionNotificationEndpointsListCall) Context(ctx context.Context) *RegionNotificationEndpointsListCall {
  111273. c.ctx_ = ctx
  111274. return c
  111275. }
  111276. // Header returns an http.Header that can be modified by the caller to
  111277. // add HTTP headers to the request.
  111278. func (c *RegionNotificationEndpointsListCall) Header() http.Header {
  111279. if c.header_ == nil {
  111280. c.header_ = make(http.Header)
  111281. }
  111282. return c.header_
  111283. }
  111284. func (c *RegionNotificationEndpointsListCall) doRequest(alt string) (*http.Response, error) {
  111285. reqHeaders := make(http.Header)
  111286. for k, v := range c.header_ {
  111287. reqHeaders[k] = v
  111288. }
  111289. reqHeaders.Set("User-Agent", c.s.userAgent())
  111290. if c.ifNoneMatch_ != "" {
  111291. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111292. }
  111293. var body io.Reader = nil
  111294. c.urlParams_.Set("alt", alt)
  111295. c.urlParams_.Set("prettyPrint", "false")
  111296. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints")
  111297. urls += "?" + c.urlParams_.Encode()
  111298. req, err := http.NewRequest("GET", urls, body)
  111299. if err != nil {
  111300. return nil, err
  111301. }
  111302. req.Header = reqHeaders
  111303. googleapi.Expand(req.URL, map[string]string{
  111304. "project": c.project,
  111305. "region": c.region,
  111306. })
  111307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111308. }
  111309. // Do executes the "compute.regionNotificationEndpoints.list" call.
  111310. // Exactly one of *NotificationEndpointList or error will be non-nil.
  111311. // Any non-2xx status code is an error. Response headers are in either
  111312. // *NotificationEndpointList.ServerResponse.Header or (if a response was
  111313. // returned at all) in error.(*googleapi.Error).Header. Use
  111314. // googleapi.IsNotModified to check whether the returned error was
  111315. // because http.StatusNotModified was returned.
  111316. func (c *RegionNotificationEndpointsListCall) Do(opts ...googleapi.CallOption) (*NotificationEndpointList, error) {
  111317. gensupport.SetOptions(c.urlParams_, opts...)
  111318. res, err := c.doRequest("json")
  111319. if res != nil && res.StatusCode == http.StatusNotModified {
  111320. if res.Body != nil {
  111321. res.Body.Close()
  111322. }
  111323. return nil, &googleapi.Error{
  111324. Code: res.StatusCode,
  111325. Header: res.Header,
  111326. }
  111327. }
  111328. if err != nil {
  111329. return nil, err
  111330. }
  111331. defer googleapi.CloseBody(res)
  111332. if err := googleapi.CheckResponse(res); err != nil {
  111333. return nil, err
  111334. }
  111335. ret := &NotificationEndpointList{
  111336. ServerResponse: googleapi.ServerResponse{
  111337. Header: res.Header,
  111338. HTTPStatusCode: res.StatusCode,
  111339. },
  111340. }
  111341. target := &ret
  111342. if err := gensupport.DecodeResponse(target, res); err != nil {
  111343. return nil, err
  111344. }
  111345. return ret, nil
  111346. // {
  111347. // "description": "Lists the NotificationEndpoints for a project in the given region.",
  111348. // "httpMethod": "GET",
  111349. // "id": "compute.regionNotificationEndpoints.list",
  111350. // "parameterOrder": [
  111351. // "project",
  111352. // "region"
  111353. // ],
  111354. // "parameters": {
  111355. // "filter": {
  111356. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  111357. // "location": "query",
  111358. // "type": "string"
  111359. // },
  111360. // "maxResults": {
  111361. // "default": "500",
  111362. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  111363. // "format": "uint32",
  111364. // "location": "query",
  111365. // "minimum": "0",
  111366. // "type": "integer"
  111367. // },
  111368. // "orderBy": {
  111369. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  111370. // "location": "query",
  111371. // "type": "string"
  111372. // },
  111373. // "pageToken": {
  111374. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  111375. // "location": "query",
  111376. // "type": "string"
  111377. // },
  111378. // "project": {
  111379. // "description": "Project ID for this request.",
  111380. // "location": "path",
  111381. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111382. // "required": true,
  111383. // "type": "string"
  111384. // },
  111385. // "region": {
  111386. // "description": "Name of the region scoping this request.",
  111387. // "location": "path",
  111388. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111389. // "required": true,
  111390. // "type": "string"
  111391. // }
  111392. // },
  111393. // "path": "{project}/regions/{region}/notificationEndpoints",
  111394. // "response": {
  111395. // "$ref": "NotificationEndpointList"
  111396. // },
  111397. // "scopes": [
  111398. // "https://www.googleapis.com/auth/cloud-platform",
  111399. // "https://www.googleapis.com/auth/compute",
  111400. // "https://www.googleapis.com/auth/compute.readonly"
  111401. // ]
  111402. // }
  111403. }
  111404. // Pages invokes f for each page of results.
  111405. // A non-nil error returned from f will halt the iteration.
  111406. // The provided context supersedes any context provided to the Context method.
  111407. func (c *RegionNotificationEndpointsListCall) Pages(ctx context.Context, f func(*NotificationEndpointList) error) error {
  111408. c.ctx_ = ctx
  111409. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  111410. for {
  111411. x, err := c.Do()
  111412. if err != nil {
  111413. return err
  111414. }
  111415. if err := f(x); err != nil {
  111416. return err
  111417. }
  111418. if x.NextPageToken == "" {
  111419. return nil
  111420. }
  111421. c.PageToken(x.NextPageToken)
  111422. }
  111423. }
  111424. // method id "compute.regionNotificationEndpoints.testIamPermissions":
  111425. type RegionNotificationEndpointsTestIamPermissionsCall struct {
  111426. s *Service
  111427. project string
  111428. region string
  111429. resource string
  111430. testpermissionsrequest *TestPermissionsRequest
  111431. urlParams_ gensupport.URLParams
  111432. ctx_ context.Context
  111433. header_ http.Header
  111434. }
  111435. // TestIamPermissions: Returns permissions that a caller has on the
  111436. // specified resource.
  111437. func (r *RegionNotificationEndpointsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionNotificationEndpointsTestIamPermissionsCall {
  111438. c := &RegionNotificationEndpointsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111439. c.project = project
  111440. c.region = region
  111441. c.resource = resource
  111442. c.testpermissionsrequest = testpermissionsrequest
  111443. return c
  111444. }
  111445. // Fields allows partial responses to be retrieved. See
  111446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111447. // for more information.
  111448. func (c *RegionNotificationEndpointsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionNotificationEndpointsTestIamPermissionsCall {
  111449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111450. return c
  111451. }
  111452. // Context sets the context to be used in this call's Do method. Any
  111453. // pending HTTP request will be aborted if the provided context is
  111454. // canceled.
  111455. func (c *RegionNotificationEndpointsTestIamPermissionsCall) Context(ctx context.Context) *RegionNotificationEndpointsTestIamPermissionsCall {
  111456. c.ctx_ = ctx
  111457. return c
  111458. }
  111459. // Header returns an http.Header that can be modified by the caller to
  111460. // add HTTP headers to the request.
  111461. func (c *RegionNotificationEndpointsTestIamPermissionsCall) Header() http.Header {
  111462. if c.header_ == nil {
  111463. c.header_ = make(http.Header)
  111464. }
  111465. return c.header_
  111466. }
  111467. func (c *RegionNotificationEndpointsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  111468. reqHeaders := make(http.Header)
  111469. for k, v := range c.header_ {
  111470. reqHeaders[k] = v
  111471. }
  111472. reqHeaders.Set("User-Agent", c.s.userAgent())
  111473. var body io.Reader = nil
  111474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  111475. if err != nil {
  111476. return nil, err
  111477. }
  111478. reqHeaders.Set("Content-Type", "application/json")
  111479. c.urlParams_.Set("alt", alt)
  111480. c.urlParams_.Set("prettyPrint", "false")
  111481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/notificationEndpoints/{resource}/testIamPermissions")
  111482. urls += "?" + c.urlParams_.Encode()
  111483. req, err := http.NewRequest("POST", urls, body)
  111484. if err != nil {
  111485. return nil, err
  111486. }
  111487. req.Header = reqHeaders
  111488. googleapi.Expand(req.URL, map[string]string{
  111489. "project": c.project,
  111490. "region": c.region,
  111491. "resource": c.resource,
  111492. })
  111493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111494. }
  111495. // Do executes the "compute.regionNotificationEndpoints.testIamPermissions" call.
  111496. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  111497. // non-2xx status code is an error. Response headers are in either
  111498. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  111499. // returned at all) in error.(*googleapi.Error).Header. Use
  111500. // googleapi.IsNotModified to check whether the returned error was
  111501. // because http.StatusNotModified was returned.
  111502. func (c *RegionNotificationEndpointsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  111503. gensupport.SetOptions(c.urlParams_, opts...)
  111504. res, err := c.doRequest("json")
  111505. if res != nil && res.StatusCode == http.StatusNotModified {
  111506. if res.Body != nil {
  111507. res.Body.Close()
  111508. }
  111509. return nil, &googleapi.Error{
  111510. Code: res.StatusCode,
  111511. Header: res.Header,
  111512. }
  111513. }
  111514. if err != nil {
  111515. return nil, err
  111516. }
  111517. defer googleapi.CloseBody(res)
  111518. if err := googleapi.CheckResponse(res); err != nil {
  111519. return nil, err
  111520. }
  111521. ret := &TestPermissionsResponse{
  111522. ServerResponse: googleapi.ServerResponse{
  111523. Header: res.Header,
  111524. HTTPStatusCode: res.StatusCode,
  111525. },
  111526. }
  111527. target := &ret
  111528. if err := gensupport.DecodeResponse(target, res); err != nil {
  111529. return nil, err
  111530. }
  111531. return ret, nil
  111532. // {
  111533. // "description": "Returns permissions that a caller has on the specified resource.",
  111534. // "httpMethod": "POST",
  111535. // "id": "compute.regionNotificationEndpoints.testIamPermissions",
  111536. // "parameterOrder": [
  111537. // "project",
  111538. // "region",
  111539. // "resource"
  111540. // ],
  111541. // "parameters": {
  111542. // "project": {
  111543. // "description": "Project ID for this request.",
  111544. // "location": "path",
  111545. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111546. // "required": true,
  111547. // "type": "string"
  111548. // },
  111549. // "region": {
  111550. // "description": "The name of the region for this request.",
  111551. // "location": "path",
  111552. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111553. // "required": true,
  111554. // "type": "string"
  111555. // },
  111556. // "resource": {
  111557. // "description": "Name or id of the resource for this request.",
  111558. // "location": "path",
  111559. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  111560. // "required": true,
  111561. // "type": "string"
  111562. // }
  111563. // },
  111564. // "path": "{project}/regions/{region}/notificationEndpoints/{resource}/testIamPermissions",
  111565. // "request": {
  111566. // "$ref": "TestPermissionsRequest"
  111567. // },
  111568. // "response": {
  111569. // "$ref": "TestPermissionsResponse"
  111570. // },
  111571. // "scopes": [
  111572. // "https://www.googleapis.com/auth/cloud-platform",
  111573. // "https://www.googleapis.com/auth/compute",
  111574. // "https://www.googleapis.com/auth/compute.readonly"
  111575. // ]
  111576. // }
  111577. }
  111578. // method id "compute.regionOperations.delete":
  111579. type RegionOperationsDeleteCall struct {
  111580. s *Service
  111581. project string
  111582. region string
  111583. operation string
  111584. urlParams_ gensupport.URLParams
  111585. ctx_ context.Context
  111586. header_ http.Header
  111587. }
  111588. // Delete: Deletes the specified region-specific Operations resource.
  111589. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  111590. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  111591. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111592. c.project = project
  111593. c.region = region
  111594. c.operation = operation
  111595. return c
  111596. }
  111597. // Fields allows partial responses to be retrieved. See
  111598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111599. // for more information.
  111600. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  111601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111602. return c
  111603. }
  111604. // Context sets the context to be used in this call's Do method. Any
  111605. // pending HTTP request will be aborted if the provided context is
  111606. // canceled.
  111607. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  111608. c.ctx_ = ctx
  111609. return c
  111610. }
  111611. // Header returns an http.Header that can be modified by the caller to
  111612. // add HTTP headers to the request.
  111613. func (c *RegionOperationsDeleteCall) Header() http.Header {
  111614. if c.header_ == nil {
  111615. c.header_ = make(http.Header)
  111616. }
  111617. return c.header_
  111618. }
  111619. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  111620. reqHeaders := make(http.Header)
  111621. for k, v := range c.header_ {
  111622. reqHeaders[k] = v
  111623. }
  111624. reqHeaders.Set("User-Agent", c.s.userAgent())
  111625. var body io.Reader = nil
  111626. c.urlParams_.Set("alt", alt)
  111627. c.urlParams_.Set("prettyPrint", "false")
  111628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  111629. urls += "?" + c.urlParams_.Encode()
  111630. req, err := http.NewRequest("DELETE", urls, body)
  111631. if err != nil {
  111632. return nil, err
  111633. }
  111634. req.Header = reqHeaders
  111635. googleapi.Expand(req.URL, map[string]string{
  111636. "project": c.project,
  111637. "region": c.region,
  111638. "operation": c.operation,
  111639. })
  111640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111641. }
  111642. // Do executes the "compute.regionOperations.delete" call.
  111643. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  111644. gensupport.SetOptions(c.urlParams_, opts...)
  111645. res, err := c.doRequest("json")
  111646. if err != nil {
  111647. return err
  111648. }
  111649. defer googleapi.CloseBody(res)
  111650. if err := googleapi.CheckResponse(res); err != nil {
  111651. return err
  111652. }
  111653. return nil
  111654. // {
  111655. // "description": "Deletes the specified region-specific Operations resource.",
  111656. // "httpMethod": "DELETE",
  111657. // "id": "compute.regionOperations.delete",
  111658. // "parameterOrder": [
  111659. // "project",
  111660. // "region",
  111661. // "operation"
  111662. // ],
  111663. // "parameters": {
  111664. // "operation": {
  111665. // "description": "Name of the Operations resource to delete.",
  111666. // "location": "path",
  111667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  111668. // "required": true,
  111669. // "type": "string"
  111670. // },
  111671. // "project": {
  111672. // "description": "Project ID for this request.",
  111673. // "location": "path",
  111674. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111675. // "required": true,
  111676. // "type": "string"
  111677. // },
  111678. // "region": {
  111679. // "description": "Name of the region for this request.",
  111680. // "location": "path",
  111681. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111682. // "required": true,
  111683. // "type": "string"
  111684. // }
  111685. // },
  111686. // "path": "{project}/regions/{region}/operations/{operation}",
  111687. // "scopes": [
  111688. // "https://www.googleapis.com/auth/cloud-platform",
  111689. // "https://www.googleapis.com/auth/compute"
  111690. // ]
  111691. // }
  111692. }
  111693. // method id "compute.regionOperations.get":
  111694. type RegionOperationsGetCall struct {
  111695. s *Service
  111696. project string
  111697. region string
  111698. operation string
  111699. urlParams_ gensupport.URLParams
  111700. ifNoneMatch_ string
  111701. ctx_ context.Context
  111702. header_ http.Header
  111703. }
  111704. // Get: Retrieves the specified region-specific Operations resource.
  111705. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  111706. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  111707. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111708. c.project = project
  111709. c.region = region
  111710. c.operation = operation
  111711. return c
  111712. }
  111713. // Fields allows partial responses to be retrieved. See
  111714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111715. // for more information.
  111716. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  111717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111718. return c
  111719. }
  111720. // IfNoneMatch sets the optional parameter which makes the operation
  111721. // fail if the object's ETag matches the given value. This is useful for
  111722. // getting updates only after the object has changed since the last
  111723. // request. Use googleapi.IsNotModified to check whether the response
  111724. // error from Do is the result of In-None-Match.
  111725. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  111726. c.ifNoneMatch_ = entityTag
  111727. return c
  111728. }
  111729. // Context sets the context to be used in this call's Do method. Any
  111730. // pending HTTP request will be aborted if the provided context is
  111731. // canceled.
  111732. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  111733. c.ctx_ = ctx
  111734. return c
  111735. }
  111736. // Header returns an http.Header that can be modified by the caller to
  111737. // add HTTP headers to the request.
  111738. func (c *RegionOperationsGetCall) Header() http.Header {
  111739. if c.header_ == nil {
  111740. c.header_ = make(http.Header)
  111741. }
  111742. return c.header_
  111743. }
  111744. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  111745. reqHeaders := make(http.Header)
  111746. for k, v := range c.header_ {
  111747. reqHeaders[k] = v
  111748. }
  111749. reqHeaders.Set("User-Agent", c.s.userAgent())
  111750. if c.ifNoneMatch_ != "" {
  111751. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111752. }
  111753. var body io.Reader = nil
  111754. c.urlParams_.Set("alt", alt)
  111755. c.urlParams_.Set("prettyPrint", "false")
  111756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  111757. urls += "?" + c.urlParams_.Encode()
  111758. req, err := http.NewRequest("GET", urls, body)
  111759. if err != nil {
  111760. return nil, err
  111761. }
  111762. req.Header = reqHeaders
  111763. googleapi.Expand(req.URL, map[string]string{
  111764. "project": c.project,
  111765. "region": c.region,
  111766. "operation": c.operation,
  111767. })
  111768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111769. }
  111770. // Do executes the "compute.regionOperations.get" call.
  111771. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  111772. // status code is an error. Response headers are in either
  111773. // *Operation.ServerResponse.Header or (if a response was returned at
  111774. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  111775. // to check whether the returned error was because
  111776. // http.StatusNotModified was returned.
  111777. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  111778. gensupport.SetOptions(c.urlParams_, opts...)
  111779. res, err := c.doRequest("json")
  111780. if res != nil && res.StatusCode == http.StatusNotModified {
  111781. if res.Body != nil {
  111782. res.Body.Close()
  111783. }
  111784. return nil, &googleapi.Error{
  111785. Code: res.StatusCode,
  111786. Header: res.Header,
  111787. }
  111788. }
  111789. if err != nil {
  111790. return nil, err
  111791. }
  111792. defer googleapi.CloseBody(res)
  111793. if err := googleapi.CheckResponse(res); err != nil {
  111794. return nil, err
  111795. }
  111796. ret := &Operation{
  111797. ServerResponse: googleapi.ServerResponse{
  111798. Header: res.Header,
  111799. HTTPStatusCode: res.StatusCode,
  111800. },
  111801. }
  111802. target := &ret
  111803. if err := gensupport.DecodeResponse(target, res); err != nil {
  111804. return nil, err
  111805. }
  111806. return ret, nil
  111807. // {
  111808. // "description": "Retrieves the specified region-specific Operations resource.",
  111809. // "httpMethod": "GET",
  111810. // "id": "compute.regionOperations.get",
  111811. // "parameterOrder": [
  111812. // "project",
  111813. // "region",
  111814. // "operation"
  111815. // ],
  111816. // "parameters": {
  111817. // "operation": {
  111818. // "description": "Name of the Operations resource to return.",
  111819. // "location": "path",
  111820. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  111821. // "required": true,
  111822. // "type": "string"
  111823. // },
  111824. // "project": {
  111825. // "description": "Project ID for this request.",
  111826. // "location": "path",
  111827. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  111828. // "required": true,
  111829. // "type": "string"
  111830. // },
  111831. // "region": {
  111832. // "description": "Name of the region for this request.",
  111833. // "location": "path",
  111834. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  111835. // "required": true,
  111836. // "type": "string"
  111837. // }
  111838. // },
  111839. // "path": "{project}/regions/{region}/operations/{operation}",
  111840. // "response": {
  111841. // "$ref": "Operation"
  111842. // },
  111843. // "scopes": [
  111844. // "https://www.googleapis.com/auth/cloud-platform",
  111845. // "https://www.googleapis.com/auth/compute",
  111846. // "https://www.googleapis.com/auth/compute.readonly"
  111847. // ]
  111848. // }
  111849. }
  111850. // method id "compute.regionOperations.list":
  111851. type RegionOperationsListCall struct {
  111852. s *Service
  111853. project string
  111854. region string
  111855. urlParams_ gensupport.URLParams
  111856. ifNoneMatch_ string
  111857. ctx_ context.Context
  111858. header_ http.Header
  111859. }
  111860. // List: Retrieves a list of Operation resources contained within the
  111861. // specified region.
  111862. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  111863. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  111864. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  111865. c.project = project
  111866. c.region = region
  111867. return c
  111868. }
  111869. // Filter sets the optional parameter "filter": A filter expression that
  111870. // filters resources listed in the response. The expression must specify
  111871. // the field name, a comparison operator, and the value that you want to
  111872. // use for filtering. The value must be a string, a number, or a
  111873. // boolean. The comparison operator must be either =, !=, >, or <.
  111874. //
  111875. // For example, if you are filtering Compute Engine instances, you can
  111876. // exclude instances named example-instance by specifying name !=
  111877. // example-instance.
  111878. //
  111879. // You can also filter nested fields. For example, you could specify
  111880. // scheduling.automaticRestart = false to include instances only if they
  111881. // are not scheduled for automatic restarts. You can use filtering on
  111882. // nested fields to filter based on resource labels.
  111883. //
  111884. // To filter on multiple expressions, provide each separate expression
  111885. // within parentheses. For example, (scheduling.automaticRestart = true)
  111886. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  111887. // AND expression. However, you can include AND and OR expressions
  111888. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  111889. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  111890. // true).
  111891. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  111892. c.urlParams_.Set("filter", filter)
  111893. return c
  111894. }
  111895. // MaxResults sets the optional parameter "maxResults": The maximum
  111896. // number of results per page that should be returned. If the number of
  111897. // available results is larger than maxResults, Compute Engine returns a
  111898. // nextPageToken that can be used to get the next page of results in
  111899. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  111900. // (Default: 500)
  111901. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  111902. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  111903. return c
  111904. }
  111905. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  111906. // a certain order. By default, results are returned in alphanumerical
  111907. // order based on the resource name.
  111908. //
  111909. // You can also sort results in descending order based on the creation
  111910. // timestamp using orderBy="creationTimestamp desc". This sorts results
  111911. // based on the creationTimestamp field in reverse chronological order
  111912. // (newest result first). Use this to sort resources like operations so
  111913. // that the newest operation is returned first.
  111914. //
  111915. // Currently, only sorting by name or creationTimestamp desc is
  111916. // supported.
  111917. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  111918. c.urlParams_.Set("orderBy", orderBy)
  111919. return c
  111920. }
  111921. // PageToken sets the optional parameter "pageToken": Specifies a page
  111922. // token to use. Set pageToken to the nextPageToken returned by a
  111923. // previous list request to get the next page of results.
  111924. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  111925. c.urlParams_.Set("pageToken", pageToken)
  111926. return c
  111927. }
  111928. // Fields allows partial responses to be retrieved. See
  111929. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  111930. // for more information.
  111931. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  111932. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  111933. return c
  111934. }
  111935. // IfNoneMatch sets the optional parameter which makes the operation
  111936. // fail if the object's ETag matches the given value. This is useful for
  111937. // getting updates only after the object has changed since the last
  111938. // request. Use googleapi.IsNotModified to check whether the response
  111939. // error from Do is the result of In-None-Match.
  111940. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  111941. c.ifNoneMatch_ = entityTag
  111942. return c
  111943. }
  111944. // Context sets the context to be used in this call's Do method. Any
  111945. // pending HTTP request will be aborted if the provided context is
  111946. // canceled.
  111947. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  111948. c.ctx_ = ctx
  111949. return c
  111950. }
  111951. // Header returns an http.Header that can be modified by the caller to
  111952. // add HTTP headers to the request.
  111953. func (c *RegionOperationsListCall) Header() http.Header {
  111954. if c.header_ == nil {
  111955. c.header_ = make(http.Header)
  111956. }
  111957. return c.header_
  111958. }
  111959. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  111960. reqHeaders := make(http.Header)
  111961. for k, v := range c.header_ {
  111962. reqHeaders[k] = v
  111963. }
  111964. reqHeaders.Set("User-Agent", c.s.userAgent())
  111965. if c.ifNoneMatch_ != "" {
  111966. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  111967. }
  111968. var body io.Reader = nil
  111969. c.urlParams_.Set("alt", alt)
  111970. c.urlParams_.Set("prettyPrint", "false")
  111971. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  111972. urls += "?" + c.urlParams_.Encode()
  111973. req, err := http.NewRequest("GET", urls, body)
  111974. if err != nil {
  111975. return nil, err
  111976. }
  111977. req.Header = reqHeaders
  111978. googleapi.Expand(req.URL, map[string]string{
  111979. "project": c.project,
  111980. "region": c.region,
  111981. })
  111982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  111983. }
  111984. // Do executes the "compute.regionOperations.list" call.
  111985. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  111986. // status code is an error. Response headers are in either
  111987. // *OperationList.ServerResponse.Header or (if a response was returned
  111988. // at all) in error.(*googleapi.Error).Header. Use
  111989. // googleapi.IsNotModified to check whether the returned error was
  111990. // because http.StatusNotModified was returned.
  111991. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  111992. gensupport.SetOptions(c.urlParams_, opts...)
  111993. res, err := c.doRequest("json")
  111994. if res != nil && res.StatusCode == http.StatusNotModified {
  111995. if res.Body != nil {
  111996. res.Body.Close()
  111997. }
  111998. return nil, &googleapi.Error{
  111999. Code: res.StatusCode,
  112000. Header: res.Header,
  112001. }
  112002. }
  112003. if err != nil {
  112004. return nil, err
  112005. }
  112006. defer googleapi.CloseBody(res)
  112007. if err := googleapi.CheckResponse(res); err != nil {
  112008. return nil, err
  112009. }
  112010. ret := &OperationList{
  112011. ServerResponse: googleapi.ServerResponse{
  112012. Header: res.Header,
  112013. HTTPStatusCode: res.StatusCode,
  112014. },
  112015. }
  112016. target := &ret
  112017. if err := gensupport.DecodeResponse(target, res); err != nil {
  112018. return nil, err
  112019. }
  112020. return ret, nil
  112021. // {
  112022. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  112023. // "httpMethod": "GET",
  112024. // "id": "compute.regionOperations.list",
  112025. // "parameterOrder": [
  112026. // "project",
  112027. // "region"
  112028. // ],
  112029. // "parameters": {
  112030. // "filter": {
  112031. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  112032. // "location": "query",
  112033. // "type": "string"
  112034. // },
  112035. // "maxResults": {
  112036. // "default": "500",
  112037. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  112038. // "format": "uint32",
  112039. // "location": "query",
  112040. // "minimum": "0",
  112041. // "type": "integer"
  112042. // },
  112043. // "orderBy": {
  112044. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  112045. // "location": "query",
  112046. // "type": "string"
  112047. // },
  112048. // "pageToken": {
  112049. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  112050. // "location": "query",
  112051. // "type": "string"
  112052. // },
  112053. // "project": {
  112054. // "description": "Project ID for this request.",
  112055. // "location": "path",
  112056. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112057. // "required": true,
  112058. // "type": "string"
  112059. // },
  112060. // "region": {
  112061. // "description": "Name of the region for this request.",
  112062. // "location": "path",
  112063. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112064. // "required": true,
  112065. // "type": "string"
  112066. // }
  112067. // },
  112068. // "path": "{project}/regions/{region}/operations",
  112069. // "response": {
  112070. // "$ref": "OperationList"
  112071. // },
  112072. // "scopes": [
  112073. // "https://www.googleapis.com/auth/cloud-platform",
  112074. // "https://www.googleapis.com/auth/compute",
  112075. // "https://www.googleapis.com/auth/compute.readonly"
  112076. // ]
  112077. // }
  112078. }
  112079. // Pages invokes f for each page of results.
  112080. // A non-nil error returned from f will halt the iteration.
  112081. // The provided context supersedes any context provided to the Context method.
  112082. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  112083. c.ctx_ = ctx
  112084. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  112085. for {
  112086. x, err := c.Do()
  112087. if err != nil {
  112088. return err
  112089. }
  112090. if err := f(x); err != nil {
  112091. return err
  112092. }
  112093. if x.NextPageToken == "" {
  112094. return nil
  112095. }
  112096. c.PageToken(x.NextPageToken)
  112097. }
  112098. }
  112099. // method id "compute.regionOperations.wait":
  112100. type RegionOperationsWaitCall struct {
  112101. s *Service
  112102. project string
  112103. region string
  112104. operation string
  112105. urlParams_ gensupport.URLParams
  112106. ctx_ context.Context
  112107. header_ http.Header
  112108. }
  112109. // Wait: Waits for the specified region-specific Operations resource
  112110. // until it is done or timeout, and retrieves the specified Operations
  112111. // resource. 1. Immediately returns when the operation is already done.
  112112. // 2. Waits for no more than the default deadline (2 minutes, subject to
  112113. // change) and then returns the current state of the operation, which
  112114. // may be DONE or still in progress. 3. Is best-effort: a. The server
  112115. // can wait less than the default deadline or zero seconds, in overload
  112116. // situations. b. There is no guarantee that the operation is actually
  112117. // done when returns. 4. User should be prepared to retry if the
  112118. // operation is not DONE.
  112119. func (r *RegionOperationsService) Wait(project string, region string, operation string) *RegionOperationsWaitCall {
  112120. c := &RegionOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112121. c.project = project
  112122. c.region = region
  112123. c.operation = operation
  112124. return c
  112125. }
  112126. // Fields allows partial responses to be retrieved. See
  112127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112128. // for more information.
  112129. func (c *RegionOperationsWaitCall) Fields(s ...googleapi.Field) *RegionOperationsWaitCall {
  112130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112131. return c
  112132. }
  112133. // Context sets the context to be used in this call's Do method. Any
  112134. // pending HTTP request will be aborted if the provided context is
  112135. // canceled.
  112136. func (c *RegionOperationsWaitCall) Context(ctx context.Context) *RegionOperationsWaitCall {
  112137. c.ctx_ = ctx
  112138. return c
  112139. }
  112140. // Header returns an http.Header that can be modified by the caller to
  112141. // add HTTP headers to the request.
  112142. func (c *RegionOperationsWaitCall) Header() http.Header {
  112143. if c.header_ == nil {
  112144. c.header_ = make(http.Header)
  112145. }
  112146. return c.header_
  112147. }
  112148. func (c *RegionOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  112149. reqHeaders := make(http.Header)
  112150. for k, v := range c.header_ {
  112151. reqHeaders[k] = v
  112152. }
  112153. reqHeaders.Set("User-Agent", c.s.userAgent())
  112154. var body io.Reader = nil
  112155. c.urlParams_.Set("alt", alt)
  112156. c.urlParams_.Set("prettyPrint", "false")
  112157. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}/wait")
  112158. urls += "?" + c.urlParams_.Encode()
  112159. req, err := http.NewRequest("POST", urls, body)
  112160. if err != nil {
  112161. return nil, err
  112162. }
  112163. req.Header = reqHeaders
  112164. googleapi.Expand(req.URL, map[string]string{
  112165. "project": c.project,
  112166. "region": c.region,
  112167. "operation": c.operation,
  112168. })
  112169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112170. }
  112171. // Do executes the "compute.regionOperations.wait" call.
  112172. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112173. // status code is an error. Response headers are in either
  112174. // *Operation.ServerResponse.Header or (if a response was returned at
  112175. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112176. // to check whether the returned error was because
  112177. // http.StatusNotModified was returned.
  112178. func (c *RegionOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112179. gensupport.SetOptions(c.urlParams_, opts...)
  112180. res, err := c.doRequest("json")
  112181. if res != nil && res.StatusCode == http.StatusNotModified {
  112182. if res.Body != nil {
  112183. res.Body.Close()
  112184. }
  112185. return nil, &googleapi.Error{
  112186. Code: res.StatusCode,
  112187. Header: res.Header,
  112188. }
  112189. }
  112190. if err != nil {
  112191. return nil, err
  112192. }
  112193. defer googleapi.CloseBody(res)
  112194. if err := googleapi.CheckResponse(res); err != nil {
  112195. return nil, err
  112196. }
  112197. ret := &Operation{
  112198. ServerResponse: googleapi.ServerResponse{
  112199. Header: res.Header,
  112200. HTTPStatusCode: res.StatusCode,
  112201. },
  112202. }
  112203. target := &ret
  112204. if err := gensupport.DecodeResponse(target, res); err != nil {
  112205. return nil, err
  112206. }
  112207. return ret, nil
  112208. // {
  112209. // "description": "Waits for the specified region-specific Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  112210. // "httpMethod": "POST",
  112211. // "id": "compute.regionOperations.wait",
  112212. // "parameterOrder": [
  112213. // "project",
  112214. // "region",
  112215. // "operation"
  112216. // ],
  112217. // "parameters": {
  112218. // "operation": {
  112219. // "description": "Name of the Operations resource to return.",
  112220. // "location": "path",
  112221. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112222. // "required": true,
  112223. // "type": "string"
  112224. // },
  112225. // "project": {
  112226. // "description": "Project ID for this request.",
  112227. // "location": "path",
  112228. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112229. // "required": true,
  112230. // "type": "string"
  112231. // },
  112232. // "region": {
  112233. // "description": "Name of the region for this request.",
  112234. // "location": "path",
  112235. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112236. // "required": true,
  112237. // "type": "string"
  112238. // }
  112239. // },
  112240. // "path": "{project}/regions/{region}/operations/{operation}/wait",
  112241. // "response": {
  112242. // "$ref": "Operation"
  112243. // },
  112244. // "scopes": [
  112245. // "https://www.googleapis.com/auth/cloud-platform",
  112246. // "https://www.googleapis.com/auth/compute",
  112247. // "https://www.googleapis.com/auth/compute.readonly"
  112248. // ]
  112249. // }
  112250. }
  112251. // method id "compute.regionSslCertificates.delete":
  112252. type RegionSslCertificatesDeleteCall struct {
  112253. s *Service
  112254. project string
  112255. region string
  112256. sslCertificate string
  112257. urlParams_ gensupport.URLParams
  112258. ctx_ context.Context
  112259. header_ http.Header
  112260. }
  112261. // Delete: Deletes the specified SslCertificate resource in the region.
  112262. func (r *RegionSslCertificatesService) Delete(project string, region string, sslCertificate string) *RegionSslCertificatesDeleteCall {
  112263. c := &RegionSslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112264. c.project = project
  112265. c.region = region
  112266. c.sslCertificate = sslCertificate
  112267. return c
  112268. }
  112269. // RequestId sets the optional parameter "requestId": An optional
  112270. // request ID to identify requests. Specify a unique request ID so that
  112271. // if you must retry your request, the server will know to ignore the
  112272. // request if it has already been completed.
  112273. //
  112274. // For example, consider a situation where you make an initial request
  112275. // and the request times out. If you make the request again with the
  112276. // same request ID, the server can check if original operation with the
  112277. // same request ID was received, and if so, will ignore the second
  112278. // request. This prevents clients from accidentally creating duplicate
  112279. // commitments.
  112280. //
  112281. // The request ID must be a valid UUID with the exception that zero UUID
  112282. // is not supported (00000000-0000-0000-0000-000000000000).
  112283. func (c *RegionSslCertificatesDeleteCall) RequestId(requestId string) *RegionSslCertificatesDeleteCall {
  112284. c.urlParams_.Set("requestId", requestId)
  112285. return c
  112286. }
  112287. // Fields allows partial responses to be retrieved. See
  112288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112289. // for more information.
  112290. func (c *RegionSslCertificatesDeleteCall) Fields(s ...googleapi.Field) *RegionSslCertificatesDeleteCall {
  112291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112292. return c
  112293. }
  112294. // Context sets the context to be used in this call's Do method. Any
  112295. // pending HTTP request will be aborted if the provided context is
  112296. // canceled.
  112297. func (c *RegionSslCertificatesDeleteCall) Context(ctx context.Context) *RegionSslCertificatesDeleteCall {
  112298. c.ctx_ = ctx
  112299. return c
  112300. }
  112301. // Header returns an http.Header that can be modified by the caller to
  112302. // add HTTP headers to the request.
  112303. func (c *RegionSslCertificatesDeleteCall) Header() http.Header {
  112304. if c.header_ == nil {
  112305. c.header_ = make(http.Header)
  112306. }
  112307. return c.header_
  112308. }
  112309. func (c *RegionSslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  112310. reqHeaders := make(http.Header)
  112311. for k, v := range c.header_ {
  112312. reqHeaders[k] = v
  112313. }
  112314. reqHeaders.Set("User-Agent", c.s.userAgent())
  112315. var body io.Reader = nil
  112316. c.urlParams_.Set("alt", alt)
  112317. c.urlParams_.Set("prettyPrint", "false")
  112318. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{sslCertificate}")
  112319. urls += "?" + c.urlParams_.Encode()
  112320. req, err := http.NewRequest("DELETE", urls, body)
  112321. if err != nil {
  112322. return nil, err
  112323. }
  112324. req.Header = reqHeaders
  112325. googleapi.Expand(req.URL, map[string]string{
  112326. "project": c.project,
  112327. "region": c.region,
  112328. "sslCertificate": c.sslCertificate,
  112329. })
  112330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112331. }
  112332. // Do executes the "compute.regionSslCertificates.delete" call.
  112333. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112334. // status code is an error. Response headers are in either
  112335. // *Operation.ServerResponse.Header or (if a response was returned at
  112336. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112337. // to check whether the returned error was because
  112338. // http.StatusNotModified was returned.
  112339. func (c *RegionSslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112340. gensupport.SetOptions(c.urlParams_, opts...)
  112341. res, err := c.doRequest("json")
  112342. if res != nil && res.StatusCode == http.StatusNotModified {
  112343. if res.Body != nil {
  112344. res.Body.Close()
  112345. }
  112346. return nil, &googleapi.Error{
  112347. Code: res.StatusCode,
  112348. Header: res.Header,
  112349. }
  112350. }
  112351. if err != nil {
  112352. return nil, err
  112353. }
  112354. defer googleapi.CloseBody(res)
  112355. if err := googleapi.CheckResponse(res); err != nil {
  112356. return nil, err
  112357. }
  112358. ret := &Operation{
  112359. ServerResponse: googleapi.ServerResponse{
  112360. Header: res.Header,
  112361. HTTPStatusCode: res.StatusCode,
  112362. },
  112363. }
  112364. target := &ret
  112365. if err := gensupport.DecodeResponse(target, res); err != nil {
  112366. return nil, err
  112367. }
  112368. return ret, nil
  112369. // {
  112370. // "description": "Deletes the specified SslCertificate resource in the region.",
  112371. // "httpMethod": "DELETE",
  112372. // "id": "compute.regionSslCertificates.delete",
  112373. // "parameterOrder": [
  112374. // "project",
  112375. // "region",
  112376. // "sslCertificate"
  112377. // ],
  112378. // "parameters": {
  112379. // "project": {
  112380. // "description": "Project ID for this request.",
  112381. // "location": "path",
  112382. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112383. // "required": true,
  112384. // "type": "string"
  112385. // },
  112386. // "region": {
  112387. // "description": "Name of the region scoping this request.",
  112388. // "location": "path",
  112389. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112390. // "required": true,
  112391. // "type": "string"
  112392. // },
  112393. // "requestId": {
  112394. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112395. // "location": "query",
  112396. // "type": "string"
  112397. // },
  112398. // "sslCertificate": {
  112399. // "description": "Name of the SslCertificate resource to delete.",
  112400. // "location": "path",
  112401. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112402. // "required": true,
  112403. // "type": "string"
  112404. // }
  112405. // },
  112406. // "path": "{project}/regions/{region}/sslCertificates/{sslCertificate}",
  112407. // "response": {
  112408. // "$ref": "Operation"
  112409. // },
  112410. // "scopes": [
  112411. // "https://www.googleapis.com/auth/cloud-platform",
  112412. // "https://www.googleapis.com/auth/compute"
  112413. // ]
  112414. // }
  112415. }
  112416. // method id "compute.regionSslCertificates.get":
  112417. type RegionSslCertificatesGetCall struct {
  112418. s *Service
  112419. project string
  112420. region string
  112421. sslCertificate string
  112422. urlParams_ gensupport.URLParams
  112423. ifNoneMatch_ string
  112424. ctx_ context.Context
  112425. header_ http.Header
  112426. }
  112427. // Get: Returns the specified SslCertificate resource in the specified
  112428. // region. Get a list of available SSL certificates by making a list()
  112429. // request.
  112430. func (r *RegionSslCertificatesService) Get(project string, region string, sslCertificate string) *RegionSslCertificatesGetCall {
  112431. c := &RegionSslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112432. c.project = project
  112433. c.region = region
  112434. c.sslCertificate = sslCertificate
  112435. return c
  112436. }
  112437. // Fields allows partial responses to be retrieved. See
  112438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112439. // for more information.
  112440. func (c *RegionSslCertificatesGetCall) Fields(s ...googleapi.Field) *RegionSslCertificatesGetCall {
  112441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112442. return c
  112443. }
  112444. // IfNoneMatch sets the optional parameter which makes the operation
  112445. // fail if the object's ETag matches the given value. This is useful for
  112446. // getting updates only after the object has changed since the last
  112447. // request. Use googleapi.IsNotModified to check whether the response
  112448. // error from Do is the result of In-None-Match.
  112449. func (c *RegionSslCertificatesGetCall) IfNoneMatch(entityTag string) *RegionSslCertificatesGetCall {
  112450. c.ifNoneMatch_ = entityTag
  112451. return c
  112452. }
  112453. // Context sets the context to be used in this call's Do method. Any
  112454. // pending HTTP request will be aborted if the provided context is
  112455. // canceled.
  112456. func (c *RegionSslCertificatesGetCall) Context(ctx context.Context) *RegionSslCertificatesGetCall {
  112457. c.ctx_ = ctx
  112458. return c
  112459. }
  112460. // Header returns an http.Header that can be modified by the caller to
  112461. // add HTTP headers to the request.
  112462. func (c *RegionSslCertificatesGetCall) Header() http.Header {
  112463. if c.header_ == nil {
  112464. c.header_ = make(http.Header)
  112465. }
  112466. return c.header_
  112467. }
  112468. func (c *RegionSslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  112469. reqHeaders := make(http.Header)
  112470. for k, v := range c.header_ {
  112471. reqHeaders[k] = v
  112472. }
  112473. reqHeaders.Set("User-Agent", c.s.userAgent())
  112474. if c.ifNoneMatch_ != "" {
  112475. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112476. }
  112477. var body io.Reader = nil
  112478. c.urlParams_.Set("alt", alt)
  112479. c.urlParams_.Set("prettyPrint", "false")
  112480. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{sslCertificate}")
  112481. urls += "?" + c.urlParams_.Encode()
  112482. req, err := http.NewRequest("GET", urls, body)
  112483. if err != nil {
  112484. return nil, err
  112485. }
  112486. req.Header = reqHeaders
  112487. googleapi.Expand(req.URL, map[string]string{
  112488. "project": c.project,
  112489. "region": c.region,
  112490. "sslCertificate": c.sslCertificate,
  112491. })
  112492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112493. }
  112494. // Do executes the "compute.regionSslCertificates.get" call.
  112495. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  112496. // status code is an error. Response headers are in either
  112497. // *SslCertificate.ServerResponse.Header or (if a response was returned
  112498. // at all) in error.(*googleapi.Error).Header. Use
  112499. // googleapi.IsNotModified to check whether the returned error was
  112500. // because http.StatusNotModified was returned.
  112501. func (c *RegionSslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  112502. gensupport.SetOptions(c.urlParams_, opts...)
  112503. res, err := c.doRequest("json")
  112504. if res != nil && res.StatusCode == http.StatusNotModified {
  112505. if res.Body != nil {
  112506. res.Body.Close()
  112507. }
  112508. return nil, &googleapi.Error{
  112509. Code: res.StatusCode,
  112510. Header: res.Header,
  112511. }
  112512. }
  112513. if err != nil {
  112514. return nil, err
  112515. }
  112516. defer googleapi.CloseBody(res)
  112517. if err := googleapi.CheckResponse(res); err != nil {
  112518. return nil, err
  112519. }
  112520. ret := &SslCertificate{
  112521. ServerResponse: googleapi.ServerResponse{
  112522. Header: res.Header,
  112523. HTTPStatusCode: res.StatusCode,
  112524. },
  112525. }
  112526. target := &ret
  112527. if err := gensupport.DecodeResponse(target, res); err != nil {
  112528. return nil, err
  112529. }
  112530. return ret, nil
  112531. // {
  112532. // "description": "Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request.",
  112533. // "httpMethod": "GET",
  112534. // "id": "compute.regionSslCertificates.get",
  112535. // "parameterOrder": [
  112536. // "project",
  112537. // "region",
  112538. // "sslCertificate"
  112539. // ],
  112540. // "parameters": {
  112541. // "project": {
  112542. // "description": "Project ID for this request.",
  112543. // "location": "path",
  112544. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112545. // "required": true,
  112546. // "type": "string"
  112547. // },
  112548. // "region": {
  112549. // "description": "Name of the region scoping this request.",
  112550. // "location": "path",
  112551. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112552. // "required": true,
  112553. // "type": "string"
  112554. // },
  112555. // "sslCertificate": {
  112556. // "description": "Name of the SslCertificate resource to return.",
  112557. // "location": "path",
  112558. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  112559. // "required": true,
  112560. // "type": "string"
  112561. // }
  112562. // },
  112563. // "path": "{project}/regions/{region}/sslCertificates/{sslCertificate}",
  112564. // "response": {
  112565. // "$ref": "SslCertificate"
  112566. // },
  112567. // "scopes": [
  112568. // "https://www.googleapis.com/auth/cloud-platform",
  112569. // "https://www.googleapis.com/auth/compute",
  112570. // "https://www.googleapis.com/auth/compute.readonly"
  112571. // ]
  112572. // }
  112573. }
  112574. // method id "compute.regionSslCertificates.insert":
  112575. type RegionSslCertificatesInsertCall struct {
  112576. s *Service
  112577. project string
  112578. region string
  112579. sslcertificate *SslCertificate
  112580. urlParams_ gensupport.URLParams
  112581. ctx_ context.Context
  112582. header_ http.Header
  112583. }
  112584. // Insert: Creates a SslCertificate resource in the specified project
  112585. // and region using the data included in the request
  112586. func (r *RegionSslCertificatesService) Insert(project string, region string, sslcertificate *SslCertificate) *RegionSslCertificatesInsertCall {
  112587. c := &RegionSslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112588. c.project = project
  112589. c.region = region
  112590. c.sslcertificate = sslcertificate
  112591. return c
  112592. }
  112593. // RequestId sets the optional parameter "requestId": An optional
  112594. // request ID to identify requests. Specify a unique request ID so that
  112595. // if you must retry your request, the server will know to ignore the
  112596. // request if it has already been completed.
  112597. //
  112598. // For example, consider a situation where you make an initial request
  112599. // and the request times out. If you make the request again with the
  112600. // same request ID, the server can check if original operation with the
  112601. // same request ID was received, and if so, will ignore the second
  112602. // request. This prevents clients from accidentally creating duplicate
  112603. // commitments.
  112604. //
  112605. // The request ID must be a valid UUID with the exception that zero UUID
  112606. // is not supported (00000000-0000-0000-0000-000000000000).
  112607. func (c *RegionSslCertificatesInsertCall) RequestId(requestId string) *RegionSslCertificatesInsertCall {
  112608. c.urlParams_.Set("requestId", requestId)
  112609. return c
  112610. }
  112611. // Fields allows partial responses to be retrieved. See
  112612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112613. // for more information.
  112614. func (c *RegionSslCertificatesInsertCall) Fields(s ...googleapi.Field) *RegionSslCertificatesInsertCall {
  112615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112616. return c
  112617. }
  112618. // Context sets the context to be used in this call's Do method. Any
  112619. // pending HTTP request will be aborted if the provided context is
  112620. // canceled.
  112621. func (c *RegionSslCertificatesInsertCall) Context(ctx context.Context) *RegionSslCertificatesInsertCall {
  112622. c.ctx_ = ctx
  112623. return c
  112624. }
  112625. // Header returns an http.Header that can be modified by the caller to
  112626. // add HTTP headers to the request.
  112627. func (c *RegionSslCertificatesInsertCall) Header() http.Header {
  112628. if c.header_ == nil {
  112629. c.header_ = make(http.Header)
  112630. }
  112631. return c.header_
  112632. }
  112633. func (c *RegionSslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  112634. reqHeaders := make(http.Header)
  112635. for k, v := range c.header_ {
  112636. reqHeaders[k] = v
  112637. }
  112638. reqHeaders.Set("User-Agent", c.s.userAgent())
  112639. var body io.Reader = nil
  112640. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  112641. if err != nil {
  112642. return nil, err
  112643. }
  112644. reqHeaders.Set("Content-Type", "application/json")
  112645. c.urlParams_.Set("alt", alt)
  112646. c.urlParams_.Set("prettyPrint", "false")
  112647. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates")
  112648. urls += "?" + c.urlParams_.Encode()
  112649. req, err := http.NewRequest("POST", urls, body)
  112650. if err != nil {
  112651. return nil, err
  112652. }
  112653. req.Header = reqHeaders
  112654. googleapi.Expand(req.URL, map[string]string{
  112655. "project": c.project,
  112656. "region": c.region,
  112657. })
  112658. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112659. }
  112660. // Do executes the "compute.regionSslCertificates.insert" call.
  112661. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  112662. // status code is an error. Response headers are in either
  112663. // *Operation.ServerResponse.Header or (if a response was returned at
  112664. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  112665. // to check whether the returned error was because
  112666. // http.StatusNotModified was returned.
  112667. func (c *RegionSslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  112668. gensupport.SetOptions(c.urlParams_, opts...)
  112669. res, err := c.doRequest("json")
  112670. if res != nil && res.StatusCode == http.StatusNotModified {
  112671. if res.Body != nil {
  112672. res.Body.Close()
  112673. }
  112674. return nil, &googleapi.Error{
  112675. Code: res.StatusCode,
  112676. Header: res.Header,
  112677. }
  112678. }
  112679. if err != nil {
  112680. return nil, err
  112681. }
  112682. defer googleapi.CloseBody(res)
  112683. if err := googleapi.CheckResponse(res); err != nil {
  112684. return nil, err
  112685. }
  112686. ret := &Operation{
  112687. ServerResponse: googleapi.ServerResponse{
  112688. Header: res.Header,
  112689. HTTPStatusCode: res.StatusCode,
  112690. },
  112691. }
  112692. target := &ret
  112693. if err := gensupport.DecodeResponse(target, res); err != nil {
  112694. return nil, err
  112695. }
  112696. return ret, nil
  112697. // {
  112698. // "description": "Creates a SslCertificate resource in the specified project and region using the data included in the request",
  112699. // "httpMethod": "POST",
  112700. // "id": "compute.regionSslCertificates.insert",
  112701. // "parameterOrder": [
  112702. // "project",
  112703. // "region"
  112704. // ],
  112705. // "parameters": {
  112706. // "project": {
  112707. // "description": "Project ID for this request.",
  112708. // "location": "path",
  112709. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112710. // "required": true,
  112711. // "type": "string"
  112712. // },
  112713. // "region": {
  112714. // "description": "Name of the region scoping this request.",
  112715. // "location": "path",
  112716. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112717. // "required": true,
  112718. // "type": "string"
  112719. // },
  112720. // "requestId": {
  112721. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  112722. // "location": "query",
  112723. // "type": "string"
  112724. // }
  112725. // },
  112726. // "path": "{project}/regions/{region}/sslCertificates",
  112727. // "request": {
  112728. // "$ref": "SslCertificate"
  112729. // },
  112730. // "response": {
  112731. // "$ref": "Operation"
  112732. // },
  112733. // "scopes": [
  112734. // "https://www.googleapis.com/auth/cloud-platform",
  112735. // "https://www.googleapis.com/auth/compute"
  112736. // ]
  112737. // }
  112738. }
  112739. // method id "compute.regionSslCertificates.list":
  112740. type RegionSslCertificatesListCall struct {
  112741. s *Service
  112742. project string
  112743. region string
  112744. urlParams_ gensupport.URLParams
  112745. ifNoneMatch_ string
  112746. ctx_ context.Context
  112747. header_ http.Header
  112748. }
  112749. // List: Retrieves the list of SslCertificate resources available to the
  112750. // specified project in the specified region.
  112751. func (r *RegionSslCertificatesService) List(project string, region string) *RegionSslCertificatesListCall {
  112752. c := &RegionSslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  112753. c.project = project
  112754. c.region = region
  112755. return c
  112756. }
  112757. // Filter sets the optional parameter "filter": A filter expression that
  112758. // filters resources listed in the response. The expression must specify
  112759. // the field name, a comparison operator, and the value that you want to
  112760. // use for filtering. The value must be a string, a number, or a
  112761. // boolean. The comparison operator must be either =, !=, >, or <.
  112762. //
  112763. // For example, if you are filtering Compute Engine instances, you can
  112764. // exclude instances named example-instance by specifying name !=
  112765. // example-instance.
  112766. //
  112767. // You can also filter nested fields. For example, you could specify
  112768. // scheduling.automaticRestart = false to include instances only if they
  112769. // are not scheduled for automatic restarts. You can use filtering on
  112770. // nested fields to filter based on resource labels.
  112771. //
  112772. // To filter on multiple expressions, provide each separate expression
  112773. // within parentheses. For example, (scheduling.automaticRestart = true)
  112774. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  112775. // AND expression. However, you can include AND and OR expressions
  112776. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  112777. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  112778. // true).
  112779. func (c *RegionSslCertificatesListCall) Filter(filter string) *RegionSslCertificatesListCall {
  112780. c.urlParams_.Set("filter", filter)
  112781. return c
  112782. }
  112783. // MaxResults sets the optional parameter "maxResults": The maximum
  112784. // number of results per page that should be returned. If the number of
  112785. // available results is larger than maxResults, Compute Engine returns a
  112786. // nextPageToken that can be used to get the next page of results in
  112787. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  112788. // (Default: 500)
  112789. func (c *RegionSslCertificatesListCall) MaxResults(maxResults int64) *RegionSslCertificatesListCall {
  112790. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  112791. return c
  112792. }
  112793. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  112794. // a certain order. By default, results are returned in alphanumerical
  112795. // order based on the resource name.
  112796. //
  112797. // You can also sort results in descending order based on the creation
  112798. // timestamp using orderBy="creationTimestamp desc". This sorts results
  112799. // based on the creationTimestamp field in reverse chronological order
  112800. // (newest result first). Use this to sort resources like operations so
  112801. // that the newest operation is returned first.
  112802. //
  112803. // Currently, only sorting by name or creationTimestamp desc is
  112804. // supported.
  112805. func (c *RegionSslCertificatesListCall) OrderBy(orderBy string) *RegionSslCertificatesListCall {
  112806. c.urlParams_.Set("orderBy", orderBy)
  112807. return c
  112808. }
  112809. // PageToken sets the optional parameter "pageToken": Specifies a page
  112810. // token to use. Set pageToken to the nextPageToken returned by a
  112811. // previous list request to get the next page of results.
  112812. func (c *RegionSslCertificatesListCall) PageToken(pageToken string) *RegionSslCertificatesListCall {
  112813. c.urlParams_.Set("pageToken", pageToken)
  112814. return c
  112815. }
  112816. // Fields allows partial responses to be retrieved. See
  112817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  112818. // for more information.
  112819. func (c *RegionSslCertificatesListCall) Fields(s ...googleapi.Field) *RegionSslCertificatesListCall {
  112820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  112821. return c
  112822. }
  112823. // IfNoneMatch sets the optional parameter which makes the operation
  112824. // fail if the object's ETag matches the given value. This is useful for
  112825. // getting updates only after the object has changed since the last
  112826. // request. Use googleapi.IsNotModified to check whether the response
  112827. // error from Do is the result of In-None-Match.
  112828. func (c *RegionSslCertificatesListCall) IfNoneMatch(entityTag string) *RegionSslCertificatesListCall {
  112829. c.ifNoneMatch_ = entityTag
  112830. return c
  112831. }
  112832. // Context sets the context to be used in this call's Do method. Any
  112833. // pending HTTP request will be aborted if the provided context is
  112834. // canceled.
  112835. func (c *RegionSslCertificatesListCall) Context(ctx context.Context) *RegionSslCertificatesListCall {
  112836. c.ctx_ = ctx
  112837. return c
  112838. }
  112839. // Header returns an http.Header that can be modified by the caller to
  112840. // add HTTP headers to the request.
  112841. func (c *RegionSslCertificatesListCall) Header() http.Header {
  112842. if c.header_ == nil {
  112843. c.header_ = make(http.Header)
  112844. }
  112845. return c.header_
  112846. }
  112847. func (c *RegionSslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  112848. reqHeaders := make(http.Header)
  112849. for k, v := range c.header_ {
  112850. reqHeaders[k] = v
  112851. }
  112852. reqHeaders.Set("User-Agent", c.s.userAgent())
  112853. if c.ifNoneMatch_ != "" {
  112854. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  112855. }
  112856. var body io.Reader = nil
  112857. c.urlParams_.Set("alt", alt)
  112858. c.urlParams_.Set("prettyPrint", "false")
  112859. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates")
  112860. urls += "?" + c.urlParams_.Encode()
  112861. req, err := http.NewRequest("GET", urls, body)
  112862. if err != nil {
  112863. return nil, err
  112864. }
  112865. req.Header = reqHeaders
  112866. googleapi.Expand(req.URL, map[string]string{
  112867. "project": c.project,
  112868. "region": c.region,
  112869. })
  112870. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  112871. }
  112872. // Do executes the "compute.regionSslCertificates.list" call.
  112873. // Exactly one of *SslCertificateList or error will be non-nil. Any
  112874. // non-2xx status code is an error. Response headers are in either
  112875. // *SslCertificateList.ServerResponse.Header or (if a response was
  112876. // returned at all) in error.(*googleapi.Error).Header. Use
  112877. // googleapi.IsNotModified to check whether the returned error was
  112878. // because http.StatusNotModified was returned.
  112879. func (c *RegionSslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  112880. gensupport.SetOptions(c.urlParams_, opts...)
  112881. res, err := c.doRequest("json")
  112882. if res != nil && res.StatusCode == http.StatusNotModified {
  112883. if res.Body != nil {
  112884. res.Body.Close()
  112885. }
  112886. return nil, &googleapi.Error{
  112887. Code: res.StatusCode,
  112888. Header: res.Header,
  112889. }
  112890. }
  112891. if err != nil {
  112892. return nil, err
  112893. }
  112894. defer googleapi.CloseBody(res)
  112895. if err := googleapi.CheckResponse(res); err != nil {
  112896. return nil, err
  112897. }
  112898. ret := &SslCertificateList{
  112899. ServerResponse: googleapi.ServerResponse{
  112900. Header: res.Header,
  112901. HTTPStatusCode: res.StatusCode,
  112902. },
  112903. }
  112904. target := &ret
  112905. if err := gensupport.DecodeResponse(target, res); err != nil {
  112906. return nil, err
  112907. }
  112908. return ret, nil
  112909. // {
  112910. // "description": "Retrieves the list of SslCertificate resources available to the specified project in the specified region.",
  112911. // "httpMethod": "GET",
  112912. // "id": "compute.regionSslCertificates.list",
  112913. // "parameterOrder": [
  112914. // "project",
  112915. // "region"
  112916. // ],
  112917. // "parameters": {
  112918. // "filter": {
  112919. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  112920. // "location": "query",
  112921. // "type": "string"
  112922. // },
  112923. // "maxResults": {
  112924. // "default": "500",
  112925. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  112926. // "format": "uint32",
  112927. // "location": "query",
  112928. // "minimum": "0",
  112929. // "type": "integer"
  112930. // },
  112931. // "orderBy": {
  112932. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  112933. // "location": "query",
  112934. // "type": "string"
  112935. // },
  112936. // "pageToken": {
  112937. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  112938. // "location": "query",
  112939. // "type": "string"
  112940. // },
  112941. // "project": {
  112942. // "description": "Project ID for this request.",
  112943. // "location": "path",
  112944. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  112945. // "required": true,
  112946. // "type": "string"
  112947. // },
  112948. // "region": {
  112949. // "description": "Name of the region scoping this request.",
  112950. // "location": "path",
  112951. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  112952. // "required": true,
  112953. // "type": "string"
  112954. // }
  112955. // },
  112956. // "path": "{project}/regions/{region}/sslCertificates",
  112957. // "response": {
  112958. // "$ref": "SslCertificateList"
  112959. // },
  112960. // "scopes": [
  112961. // "https://www.googleapis.com/auth/cloud-platform",
  112962. // "https://www.googleapis.com/auth/compute",
  112963. // "https://www.googleapis.com/auth/compute.readonly"
  112964. // ]
  112965. // }
  112966. }
  112967. // Pages invokes f for each page of results.
  112968. // A non-nil error returned from f will halt the iteration.
  112969. // The provided context supersedes any context provided to the Context method.
  112970. func (c *RegionSslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  112971. c.ctx_ = ctx
  112972. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  112973. for {
  112974. x, err := c.Do()
  112975. if err != nil {
  112976. return err
  112977. }
  112978. if err := f(x); err != nil {
  112979. return err
  112980. }
  112981. if x.NextPageToken == "" {
  112982. return nil
  112983. }
  112984. c.PageToken(x.NextPageToken)
  112985. }
  112986. }
  112987. // method id "compute.regionSslCertificates.testIamPermissions":
  112988. type RegionSslCertificatesTestIamPermissionsCall struct {
  112989. s *Service
  112990. project string
  112991. region string
  112992. resource string
  112993. testpermissionsrequest *TestPermissionsRequest
  112994. urlParams_ gensupport.URLParams
  112995. ctx_ context.Context
  112996. header_ http.Header
  112997. }
  112998. // TestIamPermissions: Returns permissions that a caller has on the
  112999. // specified resource and region.
  113000. func (r *RegionSslCertificatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionSslCertificatesTestIamPermissionsCall {
  113001. c := &RegionSslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113002. c.project = project
  113003. c.region = region
  113004. c.resource = resource
  113005. c.testpermissionsrequest = testpermissionsrequest
  113006. return c
  113007. }
  113008. // Fields allows partial responses to be retrieved. See
  113009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113010. // for more information.
  113011. func (c *RegionSslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionSslCertificatesTestIamPermissionsCall {
  113012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113013. return c
  113014. }
  113015. // Context sets the context to be used in this call's Do method. Any
  113016. // pending HTTP request will be aborted if the provided context is
  113017. // canceled.
  113018. func (c *RegionSslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *RegionSslCertificatesTestIamPermissionsCall {
  113019. c.ctx_ = ctx
  113020. return c
  113021. }
  113022. // Header returns an http.Header that can be modified by the caller to
  113023. // add HTTP headers to the request.
  113024. func (c *RegionSslCertificatesTestIamPermissionsCall) Header() http.Header {
  113025. if c.header_ == nil {
  113026. c.header_ = make(http.Header)
  113027. }
  113028. return c.header_
  113029. }
  113030. func (c *RegionSslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  113031. reqHeaders := make(http.Header)
  113032. for k, v := range c.header_ {
  113033. reqHeaders[k] = v
  113034. }
  113035. reqHeaders.Set("User-Agent", c.s.userAgent())
  113036. var body io.Reader = nil
  113037. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  113038. if err != nil {
  113039. return nil, err
  113040. }
  113041. reqHeaders.Set("Content-Type", "application/json")
  113042. c.urlParams_.Set("alt", alt)
  113043. c.urlParams_.Set("prettyPrint", "false")
  113044. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/sslCertificates/{resource}/testIamPermissions")
  113045. urls += "?" + c.urlParams_.Encode()
  113046. req, err := http.NewRequest("POST", urls, body)
  113047. if err != nil {
  113048. return nil, err
  113049. }
  113050. req.Header = reqHeaders
  113051. googleapi.Expand(req.URL, map[string]string{
  113052. "project": c.project,
  113053. "region": c.region,
  113054. "resource": c.resource,
  113055. })
  113056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113057. }
  113058. // Do executes the "compute.regionSslCertificates.testIamPermissions" call.
  113059. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  113060. // non-2xx status code is an error. Response headers are in either
  113061. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  113062. // returned at all) in error.(*googleapi.Error).Header. Use
  113063. // googleapi.IsNotModified to check whether the returned error was
  113064. // because http.StatusNotModified was returned.
  113065. func (c *RegionSslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  113066. gensupport.SetOptions(c.urlParams_, opts...)
  113067. res, err := c.doRequest("json")
  113068. if res != nil && res.StatusCode == http.StatusNotModified {
  113069. if res.Body != nil {
  113070. res.Body.Close()
  113071. }
  113072. return nil, &googleapi.Error{
  113073. Code: res.StatusCode,
  113074. Header: res.Header,
  113075. }
  113076. }
  113077. if err != nil {
  113078. return nil, err
  113079. }
  113080. defer googleapi.CloseBody(res)
  113081. if err := googleapi.CheckResponse(res); err != nil {
  113082. return nil, err
  113083. }
  113084. ret := &TestPermissionsResponse{
  113085. ServerResponse: googleapi.ServerResponse{
  113086. Header: res.Header,
  113087. HTTPStatusCode: res.StatusCode,
  113088. },
  113089. }
  113090. target := &ret
  113091. if err := gensupport.DecodeResponse(target, res); err != nil {
  113092. return nil, err
  113093. }
  113094. return ret, nil
  113095. // {
  113096. // "description": "Returns permissions that a caller has on the specified resource and region.",
  113097. // "httpMethod": "POST",
  113098. // "id": "compute.regionSslCertificates.testIamPermissions",
  113099. // "parameterOrder": [
  113100. // "project",
  113101. // "region",
  113102. // "resource"
  113103. // ],
  113104. // "parameters": {
  113105. // "project": {
  113106. // "description": "Project ID for this request.",
  113107. // "location": "path",
  113108. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113109. // "required": true,
  113110. // "type": "string"
  113111. // },
  113112. // "region": {
  113113. // "description": "The name of the region for this request.",
  113114. // "location": "path",
  113115. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113116. // "required": true,
  113117. // "type": "string"
  113118. // },
  113119. // "resource": {
  113120. // "description": "Name or id of the resource for this request.",
  113121. // "location": "path",
  113122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113123. // "required": true,
  113124. // "type": "string"
  113125. // }
  113126. // },
  113127. // "path": "{project}/regions/{region}/sslCertificates/{resource}/testIamPermissions",
  113128. // "request": {
  113129. // "$ref": "TestPermissionsRequest"
  113130. // },
  113131. // "response": {
  113132. // "$ref": "TestPermissionsResponse"
  113133. // },
  113134. // "scopes": [
  113135. // "https://www.googleapis.com/auth/cloud-platform",
  113136. // "https://www.googleapis.com/auth/compute",
  113137. // "https://www.googleapis.com/auth/compute.readonly"
  113138. // ]
  113139. // }
  113140. }
  113141. // method id "compute.regionTargetHttpProxies.delete":
  113142. type RegionTargetHttpProxiesDeleteCall struct {
  113143. s *Service
  113144. project string
  113145. region string
  113146. targetHttpProxy string
  113147. urlParams_ gensupport.URLParams
  113148. ctx_ context.Context
  113149. header_ http.Header
  113150. }
  113151. // Delete: Deletes the specified TargetHttpProxy resource.
  113152. func (r *RegionTargetHttpProxiesService) Delete(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesDeleteCall {
  113153. c := &RegionTargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113154. c.project = project
  113155. c.region = region
  113156. c.targetHttpProxy = targetHttpProxy
  113157. return c
  113158. }
  113159. // RequestId sets the optional parameter "requestId": An optional
  113160. // request ID to identify requests. Specify a unique request ID so that
  113161. // if you must retry your request, the server will know to ignore the
  113162. // request if it has already been completed.
  113163. //
  113164. // For example, consider a situation where you make an initial request
  113165. // and the request times out. If you make the request again with the
  113166. // same request ID, the server can check if original operation with the
  113167. // same request ID was received, and if so, will ignore the second
  113168. // request. This prevents clients from accidentally creating duplicate
  113169. // commitments.
  113170. //
  113171. // The request ID must be a valid UUID with the exception that zero UUID
  113172. // is not supported (00000000-0000-0000-0000-000000000000).
  113173. func (c *RegionTargetHttpProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpProxiesDeleteCall {
  113174. c.urlParams_.Set("requestId", requestId)
  113175. return c
  113176. }
  113177. // Fields allows partial responses to be retrieved. See
  113178. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113179. // for more information.
  113180. func (c *RegionTargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesDeleteCall {
  113181. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113182. return c
  113183. }
  113184. // Context sets the context to be used in this call's Do method. Any
  113185. // pending HTTP request will be aborted if the provided context is
  113186. // canceled.
  113187. func (c *RegionTargetHttpProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpProxiesDeleteCall {
  113188. c.ctx_ = ctx
  113189. return c
  113190. }
  113191. // Header returns an http.Header that can be modified by the caller to
  113192. // add HTTP headers to the request.
  113193. func (c *RegionTargetHttpProxiesDeleteCall) Header() http.Header {
  113194. if c.header_ == nil {
  113195. c.header_ = make(http.Header)
  113196. }
  113197. return c.header_
  113198. }
  113199. func (c *RegionTargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  113200. reqHeaders := make(http.Header)
  113201. for k, v := range c.header_ {
  113202. reqHeaders[k] = v
  113203. }
  113204. reqHeaders.Set("User-Agent", c.s.userAgent())
  113205. var body io.Reader = nil
  113206. c.urlParams_.Set("alt", alt)
  113207. c.urlParams_.Set("prettyPrint", "false")
  113208. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
  113209. urls += "?" + c.urlParams_.Encode()
  113210. req, err := http.NewRequest("DELETE", urls, body)
  113211. if err != nil {
  113212. return nil, err
  113213. }
  113214. req.Header = reqHeaders
  113215. googleapi.Expand(req.URL, map[string]string{
  113216. "project": c.project,
  113217. "region": c.region,
  113218. "targetHttpProxy": c.targetHttpProxy,
  113219. })
  113220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113221. }
  113222. // Do executes the "compute.regionTargetHttpProxies.delete" call.
  113223. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113224. // status code is an error. Response headers are in either
  113225. // *Operation.ServerResponse.Header or (if a response was returned at
  113226. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113227. // to check whether the returned error was because
  113228. // http.StatusNotModified was returned.
  113229. func (c *RegionTargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113230. gensupport.SetOptions(c.urlParams_, opts...)
  113231. res, err := c.doRequest("json")
  113232. if res != nil && res.StatusCode == http.StatusNotModified {
  113233. if res.Body != nil {
  113234. res.Body.Close()
  113235. }
  113236. return nil, &googleapi.Error{
  113237. Code: res.StatusCode,
  113238. Header: res.Header,
  113239. }
  113240. }
  113241. if err != nil {
  113242. return nil, err
  113243. }
  113244. defer googleapi.CloseBody(res)
  113245. if err := googleapi.CheckResponse(res); err != nil {
  113246. return nil, err
  113247. }
  113248. ret := &Operation{
  113249. ServerResponse: googleapi.ServerResponse{
  113250. Header: res.Header,
  113251. HTTPStatusCode: res.StatusCode,
  113252. },
  113253. }
  113254. target := &ret
  113255. if err := gensupport.DecodeResponse(target, res); err != nil {
  113256. return nil, err
  113257. }
  113258. return ret, nil
  113259. // {
  113260. // "description": "Deletes the specified TargetHttpProxy resource.",
  113261. // "httpMethod": "DELETE",
  113262. // "id": "compute.regionTargetHttpProxies.delete",
  113263. // "parameterOrder": [
  113264. // "project",
  113265. // "region",
  113266. // "targetHttpProxy"
  113267. // ],
  113268. // "parameters": {
  113269. // "project": {
  113270. // "description": "Project ID for this request.",
  113271. // "location": "path",
  113272. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113273. // "required": true,
  113274. // "type": "string"
  113275. // },
  113276. // "region": {
  113277. // "description": "Name of the region scoping this request.",
  113278. // "location": "path",
  113279. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113280. // "required": true,
  113281. // "type": "string"
  113282. // },
  113283. // "requestId": {
  113284. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113285. // "location": "query",
  113286. // "type": "string"
  113287. // },
  113288. // "targetHttpProxy": {
  113289. // "description": "Name of the TargetHttpProxy resource to delete.",
  113290. // "location": "path",
  113291. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113292. // "required": true,
  113293. // "type": "string"
  113294. // }
  113295. // },
  113296. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
  113297. // "response": {
  113298. // "$ref": "Operation"
  113299. // },
  113300. // "scopes": [
  113301. // "https://www.googleapis.com/auth/cloud-platform",
  113302. // "https://www.googleapis.com/auth/compute"
  113303. // ]
  113304. // }
  113305. }
  113306. // method id "compute.regionTargetHttpProxies.get":
  113307. type RegionTargetHttpProxiesGetCall struct {
  113308. s *Service
  113309. project string
  113310. region string
  113311. targetHttpProxy string
  113312. urlParams_ gensupport.URLParams
  113313. ifNoneMatch_ string
  113314. ctx_ context.Context
  113315. header_ http.Header
  113316. }
  113317. // Get: Returns the specified TargetHttpProxy resource in the specified
  113318. // region. Gets a list of available target HTTP proxies by making a
  113319. // list() request.
  113320. func (r *RegionTargetHttpProxiesService) Get(project string, region string, targetHttpProxy string) *RegionTargetHttpProxiesGetCall {
  113321. c := &RegionTargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113322. c.project = project
  113323. c.region = region
  113324. c.targetHttpProxy = targetHttpProxy
  113325. return c
  113326. }
  113327. // Fields allows partial responses to be retrieved. See
  113328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113329. // for more information.
  113330. func (c *RegionTargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesGetCall {
  113331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113332. return c
  113333. }
  113334. // IfNoneMatch sets the optional parameter which makes the operation
  113335. // fail if the object's ETag matches the given value. This is useful for
  113336. // getting updates only after the object has changed since the last
  113337. // request. Use googleapi.IsNotModified to check whether the response
  113338. // error from Do is the result of In-None-Match.
  113339. func (c *RegionTargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesGetCall {
  113340. c.ifNoneMatch_ = entityTag
  113341. return c
  113342. }
  113343. // Context sets the context to be used in this call's Do method. Any
  113344. // pending HTTP request will be aborted if the provided context is
  113345. // canceled.
  113346. func (c *RegionTargetHttpProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpProxiesGetCall {
  113347. c.ctx_ = ctx
  113348. return c
  113349. }
  113350. // Header returns an http.Header that can be modified by the caller to
  113351. // add HTTP headers to the request.
  113352. func (c *RegionTargetHttpProxiesGetCall) Header() http.Header {
  113353. if c.header_ == nil {
  113354. c.header_ = make(http.Header)
  113355. }
  113356. return c.header_
  113357. }
  113358. func (c *RegionTargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  113359. reqHeaders := make(http.Header)
  113360. for k, v := range c.header_ {
  113361. reqHeaders[k] = v
  113362. }
  113363. reqHeaders.Set("User-Agent", c.s.userAgent())
  113364. if c.ifNoneMatch_ != "" {
  113365. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113366. }
  113367. var body io.Reader = nil
  113368. c.urlParams_.Set("alt", alt)
  113369. c.urlParams_.Set("prettyPrint", "false")
  113370. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}")
  113371. urls += "?" + c.urlParams_.Encode()
  113372. req, err := http.NewRequest("GET", urls, body)
  113373. if err != nil {
  113374. return nil, err
  113375. }
  113376. req.Header = reqHeaders
  113377. googleapi.Expand(req.URL, map[string]string{
  113378. "project": c.project,
  113379. "region": c.region,
  113380. "targetHttpProxy": c.targetHttpProxy,
  113381. })
  113382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113383. }
  113384. // Do executes the "compute.regionTargetHttpProxies.get" call.
  113385. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  113386. // status code is an error. Response headers are in either
  113387. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  113388. // at all) in error.(*googleapi.Error).Header. Use
  113389. // googleapi.IsNotModified to check whether the returned error was
  113390. // because http.StatusNotModified was returned.
  113391. func (c *RegionTargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  113392. gensupport.SetOptions(c.urlParams_, opts...)
  113393. res, err := c.doRequest("json")
  113394. if res != nil && res.StatusCode == http.StatusNotModified {
  113395. if res.Body != nil {
  113396. res.Body.Close()
  113397. }
  113398. return nil, &googleapi.Error{
  113399. Code: res.StatusCode,
  113400. Header: res.Header,
  113401. }
  113402. }
  113403. if err != nil {
  113404. return nil, err
  113405. }
  113406. defer googleapi.CloseBody(res)
  113407. if err := googleapi.CheckResponse(res); err != nil {
  113408. return nil, err
  113409. }
  113410. ret := &TargetHttpProxy{
  113411. ServerResponse: googleapi.ServerResponse{
  113412. Header: res.Header,
  113413. HTTPStatusCode: res.StatusCode,
  113414. },
  113415. }
  113416. target := &ret
  113417. if err := gensupport.DecodeResponse(target, res); err != nil {
  113418. return nil, err
  113419. }
  113420. return ret, nil
  113421. // {
  113422. // "description": "Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request.",
  113423. // "httpMethod": "GET",
  113424. // "id": "compute.regionTargetHttpProxies.get",
  113425. // "parameterOrder": [
  113426. // "project",
  113427. // "region",
  113428. // "targetHttpProxy"
  113429. // ],
  113430. // "parameters": {
  113431. // "project": {
  113432. // "description": "Project ID for this request.",
  113433. // "location": "path",
  113434. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113435. // "required": true,
  113436. // "type": "string"
  113437. // },
  113438. // "region": {
  113439. // "description": "Name of the region scoping this request.",
  113440. // "location": "path",
  113441. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113442. // "required": true,
  113443. // "type": "string"
  113444. // },
  113445. // "targetHttpProxy": {
  113446. // "description": "Name of the TargetHttpProxy resource to return.",
  113447. // "location": "path",
  113448. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  113449. // "required": true,
  113450. // "type": "string"
  113451. // }
  113452. // },
  113453. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}",
  113454. // "response": {
  113455. // "$ref": "TargetHttpProxy"
  113456. // },
  113457. // "scopes": [
  113458. // "https://www.googleapis.com/auth/cloud-platform",
  113459. // "https://www.googleapis.com/auth/compute",
  113460. // "https://www.googleapis.com/auth/compute.readonly"
  113461. // ]
  113462. // }
  113463. }
  113464. // method id "compute.regionTargetHttpProxies.insert":
  113465. type RegionTargetHttpProxiesInsertCall struct {
  113466. s *Service
  113467. project string
  113468. region string
  113469. targethttpproxy *TargetHttpProxy
  113470. urlParams_ gensupport.URLParams
  113471. ctx_ context.Context
  113472. header_ http.Header
  113473. }
  113474. // Insert: Creates a TargetHttpProxy resource in the specified project
  113475. // and region using the data included in the request.
  113476. func (r *RegionTargetHttpProxiesService) Insert(project string, region string, targethttpproxy *TargetHttpProxy) *RegionTargetHttpProxiesInsertCall {
  113477. c := &RegionTargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113478. c.project = project
  113479. c.region = region
  113480. c.targethttpproxy = targethttpproxy
  113481. return c
  113482. }
  113483. // RequestId sets the optional parameter "requestId": An optional
  113484. // request ID to identify requests. Specify a unique request ID so that
  113485. // if you must retry your request, the server will know to ignore the
  113486. // request if it has already been completed.
  113487. //
  113488. // For example, consider a situation where you make an initial request
  113489. // and the request times out. If you make the request again with the
  113490. // same request ID, the server can check if original operation with the
  113491. // same request ID was received, and if so, will ignore the second
  113492. // request. This prevents clients from accidentally creating duplicate
  113493. // commitments.
  113494. //
  113495. // The request ID must be a valid UUID with the exception that zero UUID
  113496. // is not supported (00000000-0000-0000-0000-000000000000).
  113497. func (c *RegionTargetHttpProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpProxiesInsertCall {
  113498. c.urlParams_.Set("requestId", requestId)
  113499. return c
  113500. }
  113501. // Fields allows partial responses to be retrieved. See
  113502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113503. // for more information.
  113504. func (c *RegionTargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesInsertCall {
  113505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113506. return c
  113507. }
  113508. // Context sets the context to be used in this call's Do method. Any
  113509. // pending HTTP request will be aborted if the provided context is
  113510. // canceled.
  113511. func (c *RegionTargetHttpProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpProxiesInsertCall {
  113512. c.ctx_ = ctx
  113513. return c
  113514. }
  113515. // Header returns an http.Header that can be modified by the caller to
  113516. // add HTTP headers to the request.
  113517. func (c *RegionTargetHttpProxiesInsertCall) Header() http.Header {
  113518. if c.header_ == nil {
  113519. c.header_ = make(http.Header)
  113520. }
  113521. return c.header_
  113522. }
  113523. func (c *RegionTargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  113524. reqHeaders := make(http.Header)
  113525. for k, v := range c.header_ {
  113526. reqHeaders[k] = v
  113527. }
  113528. reqHeaders.Set("User-Agent", c.s.userAgent())
  113529. var body io.Reader = nil
  113530. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  113531. if err != nil {
  113532. return nil, err
  113533. }
  113534. reqHeaders.Set("Content-Type", "application/json")
  113535. c.urlParams_.Set("alt", alt)
  113536. c.urlParams_.Set("prettyPrint", "false")
  113537. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies")
  113538. urls += "?" + c.urlParams_.Encode()
  113539. req, err := http.NewRequest("POST", urls, body)
  113540. if err != nil {
  113541. return nil, err
  113542. }
  113543. req.Header = reqHeaders
  113544. googleapi.Expand(req.URL, map[string]string{
  113545. "project": c.project,
  113546. "region": c.region,
  113547. })
  113548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113549. }
  113550. // Do executes the "compute.regionTargetHttpProxies.insert" call.
  113551. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113552. // status code is an error. Response headers are in either
  113553. // *Operation.ServerResponse.Header or (if a response was returned at
  113554. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113555. // to check whether the returned error was because
  113556. // http.StatusNotModified was returned.
  113557. func (c *RegionTargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113558. gensupport.SetOptions(c.urlParams_, opts...)
  113559. res, err := c.doRequest("json")
  113560. if res != nil && res.StatusCode == http.StatusNotModified {
  113561. if res.Body != nil {
  113562. res.Body.Close()
  113563. }
  113564. return nil, &googleapi.Error{
  113565. Code: res.StatusCode,
  113566. Header: res.Header,
  113567. }
  113568. }
  113569. if err != nil {
  113570. return nil, err
  113571. }
  113572. defer googleapi.CloseBody(res)
  113573. if err := googleapi.CheckResponse(res); err != nil {
  113574. return nil, err
  113575. }
  113576. ret := &Operation{
  113577. ServerResponse: googleapi.ServerResponse{
  113578. Header: res.Header,
  113579. HTTPStatusCode: res.StatusCode,
  113580. },
  113581. }
  113582. target := &ret
  113583. if err := gensupport.DecodeResponse(target, res); err != nil {
  113584. return nil, err
  113585. }
  113586. return ret, nil
  113587. // {
  113588. // "description": "Creates a TargetHttpProxy resource in the specified project and region using the data included in the request.",
  113589. // "httpMethod": "POST",
  113590. // "id": "compute.regionTargetHttpProxies.insert",
  113591. // "parameterOrder": [
  113592. // "project",
  113593. // "region"
  113594. // ],
  113595. // "parameters": {
  113596. // "project": {
  113597. // "description": "Project ID for this request.",
  113598. // "location": "path",
  113599. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113600. // "required": true,
  113601. // "type": "string"
  113602. // },
  113603. // "region": {
  113604. // "description": "Name of the region scoping this request.",
  113605. // "location": "path",
  113606. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113607. // "required": true,
  113608. // "type": "string"
  113609. // },
  113610. // "requestId": {
  113611. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  113612. // "location": "query",
  113613. // "type": "string"
  113614. // }
  113615. // },
  113616. // "path": "{project}/regions/{region}/targetHttpProxies",
  113617. // "request": {
  113618. // "$ref": "TargetHttpProxy"
  113619. // },
  113620. // "response": {
  113621. // "$ref": "Operation"
  113622. // },
  113623. // "scopes": [
  113624. // "https://www.googleapis.com/auth/cloud-platform",
  113625. // "https://www.googleapis.com/auth/compute"
  113626. // ]
  113627. // }
  113628. }
  113629. // method id "compute.regionTargetHttpProxies.list":
  113630. type RegionTargetHttpProxiesListCall struct {
  113631. s *Service
  113632. project string
  113633. region string
  113634. urlParams_ gensupport.URLParams
  113635. ifNoneMatch_ string
  113636. ctx_ context.Context
  113637. header_ http.Header
  113638. }
  113639. // List: Retrieves the list of TargetHttpProxy resources available to
  113640. // the specified project in the specified region.
  113641. func (r *RegionTargetHttpProxiesService) List(project string, region string) *RegionTargetHttpProxiesListCall {
  113642. c := &RegionTargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113643. c.project = project
  113644. c.region = region
  113645. return c
  113646. }
  113647. // Filter sets the optional parameter "filter": A filter expression that
  113648. // filters resources listed in the response. The expression must specify
  113649. // the field name, a comparison operator, and the value that you want to
  113650. // use for filtering. The value must be a string, a number, or a
  113651. // boolean. The comparison operator must be either =, !=, >, or <.
  113652. //
  113653. // For example, if you are filtering Compute Engine instances, you can
  113654. // exclude instances named example-instance by specifying name !=
  113655. // example-instance.
  113656. //
  113657. // You can also filter nested fields. For example, you could specify
  113658. // scheduling.automaticRestart = false to include instances only if they
  113659. // are not scheduled for automatic restarts. You can use filtering on
  113660. // nested fields to filter based on resource labels.
  113661. //
  113662. // To filter on multiple expressions, provide each separate expression
  113663. // within parentheses. For example, (scheduling.automaticRestart = true)
  113664. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  113665. // AND expression. However, you can include AND and OR expressions
  113666. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  113667. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  113668. // true).
  113669. func (c *RegionTargetHttpProxiesListCall) Filter(filter string) *RegionTargetHttpProxiesListCall {
  113670. c.urlParams_.Set("filter", filter)
  113671. return c
  113672. }
  113673. // MaxResults sets the optional parameter "maxResults": The maximum
  113674. // number of results per page that should be returned. If the number of
  113675. // available results is larger than maxResults, Compute Engine returns a
  113676. // nextPageToken that can be used to get the next page of results in
  113677. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  113678. // (Default: 500)
  113679. func (c *RegionTargetHttpProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpProxiesListCall {
  113680. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  113681. return c
  113682. }
  113683. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  113684. // a certain order. By default, results are returned in alphanumerical
  113685. // order based on the resource name.
  113686. //
  113687. // You can also sort results in descending order based on the creation
  113688. // timestamp using orderBy="creationTimestamp desc". This sorts results
  113689. // based on the creationTimestamp field in reverse chronological order
  113690. // (newest result first). Use this to sort resources like operations so
  113691. // that the newest operation is returned first.
  113692. //
  113693. // Currently, only sorting by name or creationTimestamp desc is
  113694. // supported.
  113695. func (c *RegionTargetHttpProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpProxiesListCall {
  113696. c.urlParams_.Set("orderBy", orderBy)
  113697. return c
  113698. }
  113699. // PageToken sets the optional parameter "pageToken": Specifies a page
  113700. // token to use. Set pageToken to the nextPageToken returned by a
  113701. // previous list request to get the next page of results.
  113702. func (c *RegionTargetHttpProxiesListCall) PageToken(pageToken string) *RegionTargetHttpProxiesListCall {
  113703. c.urlParams_.Set("pageToken", pageToken)
  113704. return c
  113705. }
  113706. // Fields allows partial responses to be retrieved. See
  113707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113708. // for more information.
  113709. func (c *RegionTargetHttpProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesListCall {
  113710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113711. return c
  113712. }
  113713. // IfNoneMatch sets the optional parameter which makes the operation
  113714. // fail if the object's ETag matches the given value. This is useful for
  113715. // getting updates only after the object has changed since the last
  113716. // request. Use googleapi.IsNotModified to check whether the response
  113717. // error from Do is the result of In-None-Match.
  113718. func (c *RegionTargetHttpProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpProxiesListCall {
  113719. c.ifNoneMatch_ = entityTag
  113720. return c
  113721. }
  113722. // Context sets the context to be used in this call's Do method. Any
  113723. // pending HTTP request will be aborted if the provided context is
  113724. // canceled.
  113725. func (c *RegionTargetHttpProxiesListCall) Context(ctx context.Context) *RegionTargetHttpProxiesListCall {
  113726. c.ctx_ = ctx
  113727. return c
  113728. }
  113729. // Header returns an http.Header that can be modified by the caller to
  113730. // add HTTP headers to the request.
  113731. func (c *RegionTargetHttpProxiesListCall) Header() http.Header {
  113732. if c.header_ == nil {
  113733. c.header_ = make(http.Header)
  113734. }
  113735. return c.header_
  113736. }
  113737. func (c *RegionTargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  113738. reqHeaders := make(http.Header)
  113739. for k, v := range c.header_ {
  113740. reqHeaders[k] = v
  113741. }
  113742. reqHeaders.Set("User-Agent", c.s.userAgent())
  113743. if c.ifNoneMatch_ != "" {
  113744. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  113745. }
  113746. var body io.Reader = nil
  113747. c.urlParams_.Set("alt", alt)
  113748. c.urlParams_.Set("prettyPrint", "false")
  113749. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies")
  113750. urls += "?" + c.urlParams_.Encode()
  113751. req, err := http.NewRequest("GET", urls, body)
  113752. if err != nil {
  113753. return nil, err
  113754. }
  113755. req.Header = reqHeaders
  113756. googleapi.Expand(req.URL, map[string]string{
  113757. "project": c.project,
  113758. "region": c.region,
  113759. })
  113760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113761. }
  113762. // Do executes the "compute.regionTargetHttpProxies.list" call.
  113763. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  113764. // non-2xx status code is an error. Response headers are in either
  113765. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  113766. // returned at all) in error.(*googleapi.Error).Header. Use
  113767. // googleapi.IsNotModified to check whether the returned error was
  113768. // because http.StatusNotModified was returned.
  113769. func (c *RegionTargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  113770. gensupport.SetOptions(c.urlParams_, opts...)
  113771. res, err := c.doRequest("json")
  113772. if res != nil && res.StatusCode == http.StatusNotModified {
  113773. if res.Body != nil {
  113774. res.Body.Close()
  113775. }
  113776. return nil, &googleapi.Error{
  113777. Code: res.StatusCode,
  113778. Header: res.Header,
  113779. }
  113780. }
  113781. if err != nil {
  113782. return nil, err
  113783. }
  113784. defer googleapi.CloseBody(res)
  113785. if err := googleapi.CheckResponse(res); err != nil {
  113786. return nil, err
  113787. }
  113788. ret := &TargetHttpProxyList{
  113789. ServerResponse: googleapi.ServerResponse{
  113790. Header: res.Header,
  113791. HTTPStatusCode: res.StatusCode,
  113792. },
  113793. }
  113794. target := &ret
  113795. if err := gensupport.DecodeResponse(target, res); err != nil {
  113796. return nil, err
  113797. }
  113798. return ret, nil
  113799. // {
  113800. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region.",
  113801. // "httpMethod": "GET",
  113802. // "id": "compute.regionTargetHttpProxies.list",
  113803. // "parameterOrder": [
  113804. // "project",
  113805. // "region"
  113806. // ],
  113807. // "parameters": {
  113808. // "filter": {
  113809. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  113810. // "location": "query",
  113811. // "type": "string"
  113812. // },
  113813. // "maxResults": {
  113814. // "default": "500",
  113815. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  113816. // "format": "uint32",
  113817. // "location": "query",
  113818. // "minimum": "0",
  113819. // "type": "integer"
  113820. // },
  113821. // "orderBy": {
  113822. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  113823. // "location": "query",
  113824. // "type": "string"
  113825. // },
  113826. // "pageToken": {
  113827. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  113828. // "location": "query",
  113829. // "type": "string"
  113830. // },
  113831. // "project": {
  113832. // "description": "Project ID for this request.",
  113833. // "location": "path",
  113834. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  113835. // "required": true,
  113836. // "type": "string"
  113837. // },
  113838. // "region": {
  113839. // "description": "Name of the region scoping this request.",
  113840. // "location": "path",
  113841. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  113842. // "required": true,
  113843. // "type": "string"
  113844. // }
  113845. // },
  113846. // "path": "{project}/regions/{region}/targetHttpProxies",
  113847. // "response": {
  113848. // "$ref": "TargetHttpProxyList"
  113849. // },
  113850. // "scopes": [
  113851. // "https://www.googleapis.com/auth/cloud-platform",
  113852. // "https://www.googleapis.com/auth/compute",
  113853. // "https://www.googleapis.com/auth/compute.readonly"
  113854. // ]
  113855. // }
  113856. }
  113857. // Pages invokes f for each page of results.
  113858. // A non-nil error returned from f will halt the iteration.
  113859. // The provided context supersedes any context provided to the Context method.
  113860. func (c *RegionTargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  113861. c.ctx_ = ctx
  113862. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  113863. for {
  113864. x, err := c.Do()
  113865. if err != nil {
  113866. return err
  113867. }
  113868. if err := f(x); err != nil {
  113869. return err
  113870. }
  113871. if x.NextPageToken == "" {
  113872. return nil
  113873. }
  113874. c.PageToken(x.NextPageToken)
  113875. }
  113876. }
  113877. // method id "compute.regionTargetHttpProxies.setUrlMap":
  113878. type RegionTargetHttpProxiesSetUrlMapCall struct {
  113879. s *Service
  113880. project string
  113881. region string
  113882. targetHttpProxy string
  113883. urlmapreference *UrlMapReference
  113884. urlParams_ gensupport.URLParams
  113885. ctx_ context.Context
  113886. header_ http.Header
  113887. }
  113888. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  113889. func (r *RegionTargetHttpProxiesService) SetUrlMap(project string, region string, targetHttpProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpProxiesSetUrlMapCall {
  113890. c := &RegionTargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  113891. c.project = project
  113892. c.region = region
  113893. c.targetHttpProxy = targetHttpProxy
  113894. c.urlmapreference = urlmapreference
  113895. return c
  113896. }
  113897. // RequestId sets the optional parameter "requestId": An optional
  113898. // request ID to identify requests. Specify a unique request ID so that
  113899. // if you must retry your request, the server will know to ignore the
  113900. // request if it has already been completed.
  113901. //
  113902. // For example, consider a situation where you make an initial request
  113903. // and the request times out. If you make the request again with the
  113904. // same request ID, the server can check if original operation with the
  113905. // same request ID was received, and if so, will ignore the second
  113906. // request. This prevents clients from accidentally creating duplicate
  113907. // commitments.
  113908. //
  113909. // The request ID must be a valid UUID with the exception that zero UUID
  113910. // is not supported (00000000-0000-0000-0000-000000000000).
  113911. func (c *RegionTargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpProxiesSetUrlMapCall {
  113912. c.urlParams_.Set("requestId", requestId)
  113913. return c
  113914. }
  113915. // Fields allows partial responses to be retrieved. See
  113916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  113917. // for more information.
  113918. func (c *RegionTargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesSetUrlMapCall {
  113919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  113920. return c
  113921. }
  113922. // Context sets the context to be used in this call's Do method. Any
  113923. // pending HTTP request will be aborted if the provided context is
  113924. // canceled.
  113925. func (c *RegionTargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpProxiesSetUrlMapCall {
  113926. c.ctx_ = ctx
  113927. return c
  113928. }
  113929. // Header returns an http.Header that can be modified by the caller to
  113930. // add HTTP headers to the request.
  113931. func (c *RegionTargetHttpProxiesSetUrlMapCall) Header() http.Header {
  113932. if c.header_ == nil {
  113933. c.header_ = make(http.Header)
  113934. }
  113935. return c.header_
  113936. }
  113937. func (c *RegionTargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  113938. reqHeaders := make(http.Header)
  113939. for k, v := range c.header_ {
  113940. reqHeaders[k] = v
  113941. }
  113942. reqHeaders.Set("User-Agent", c.s.userAgent())
  113943. var body io.Reader = nil
  113944. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  113945. if err != nil {
  113946. return nil, err
  113947. }
  113948. reqHeaders.Set("Content-Type", "application/json")
  113949. c.urlParams_.Set("alt", alt)
  113950. c.urlParams_.Set("prettyPrint", "false")
  113951. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  113952. urls += "?" + c.urlParams_.Encode()
  113953. req, err := http.NewRequest("POST", urls, body)
  113954. if err != nil {
  113955. return nil, err
  113956. }
  113957. req.Header = reqHeaders
  113958. googleapi.Expand(req.URL, map[string]string{
  113959. "project": c.project,
  113960. "region": c.region,
  113961. "targetHttpProxy": c.targetHttpProxy,
  113962. })
  113963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  113964. }
  113965. // Do executes the "compute.regionTargetHttpProxies.setUrlMap" call.
  113966. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  113967. // status code is an error. Response headers are in either
  113968. // *Operation.ServerResponse.Header or (if a response was returned at
  113969. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  113970. // to check whether the returned error was because
  113971. // http.StatusNotModified was returned.
  113972. func (c *RegionTargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  113973. gensupport.SetOptions(c.urlParams_, opts...)
  113974. res, err := c.doRequest("json")
  113975. if res != nil && res.StatusCode == http.StatusNotModified {
  113976. if res.Body != nil {
  113977. res.Body.Close()
  113978. }
  113979. return nil, &googleapi.Error{
  113980. Code: res.StatusCode,
  113981. Header: res.Header,
  113982. }
  113983. }
  113984. if err != nil {
  113985. return nil, err
  113986. }
  113987. defer googleapi.CloseBody(res)
  113988. if err := googleapi.CheckResponse(res); err != nil {
  113989. return nil, err
  113990. }
  113991. ret := &Operation{
  113992. ServerResponse: googleapi.ServerResponse{
  113993. Header: res.Header,
  113994. HTTPStatusCode: res.StatusCode,
  113995. },
  113996. }
  113997. target := &ret
  113998. if err := gensupport.DecodeResponse(target, res); err != nil {
  113999. return nil, err
  114000. }
  114001. return ret, nil
  114002. // {
  114003. // "description": "Changes the URL map for TargetHttpProxy.",
  114004. // "httpMethod": "POST",
  114005. // "id": "compute.regionTargetHttpProxies.setUrlMap",
  114006. // "parameterOrder": [
  114007. // "project",
  114008. // "region",
  114009. // "targetHttpProxy"
  114010. // ],
  114011. // "parameters": {
  114012. // "project": {
  114013. // "description": "Project ID for this request.",
  114014. // "location": "path",
  114015. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114016. // "required": true,
  114017. // "type": "string"
  114018. // },
  114019. // "region": {
  114020. // "description": "Name of the region scoping this request.",
  114021. // "location": "path",
  114022. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114023. // "required": true,
  114024. // "type": "string"
  114025. // },
  114026. // "requestId": {
  114027. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114028. // "location": "query",
  114029. // "type": "string"
  114030. // },
  114031. // "targetHttpProxy": {
  114032. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  114033. // "location": "path",
  114034. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114035. // "required": true,
  114036. // "type": "string"
  114037. // }
  114038. // },
  114039. // "path": "{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  114040. // "request": {
  114041. // "$ref": "UrlMapReference"
  114042. // },
  114043. // "response": {
  114044. // "$ref": "Operation"
  114045. // },
  114046. // "scopes": [
  114047. // "https://www.googleapis.com/auth/cloud-platform",
  114048. // "https://www.googleapis.com/auth/compute"
  114049. // ]
  114050. // }
  114051. }
  114052. // method id "compute.regionTargetHttpProxies.testIamPermissions":
  114053. type RegionTargetHttpProxiesTestIamPermissionsCall struct {
  114054. s *Service
  114055. project string
  114056. region string
  114057. resource string
  114058. testpermissionsrequest *TestPermissionsRequest
  114059. urlParams_ gensupport.URLParams
  114060. ctx_ context.Context
  114061. header_ http.Header
  114062. }
  114063. // TestIamPermissions: Returns permissions that a caller has on the
  114064. // specified resource.
  114065. func (r *RegionTargetHttpProxiesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionTargetHttpProxiesTestIamPermissionsCall {
  114066. c := &RegionTargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114067. c.project = project
  114068. c.region = region
  114069. c.resource = resource
  114070. c.testpermissionsrequest = testpermissionsrequest
  114071. return c
  114072. }
  114073. // Fields allows partial responses to be retrieved. See
  114074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114075. // for more information.
  114076. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionTargetHttpProxiesTestIamPermissionsCall {
  114077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114078. return c
  114079. }
  114080. // Context sets the context to be used in this call's Do method. Any
  114081. // pending HTTP request will be aborted if the provided context is
  114082. // canceled.
  114083. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *RegionTargetHttpProxiesTestIamPermissionsCall {
  114084. c.ctx_ = ctx
  114085. return c
  114086. }
  114087. // Header returns an http.Header that can be modified by the caller to
  114088. // add HTTP headers to the request.
  114089. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  114090. if c.header_ == nil {
  114091. c.header_ = make(http.Header)
  114092. }
  114093. return c.header_
  114094. }
  114095. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  114096. reqHeaders := make(http.Header)
  114097. for k, v := range c.header_ {
  114098. reqHeaders[k] = v
  114099. }
  114100. reqHeaders.Set("User-Agent", c.s.userAgent())
  114101. var body io.Reader = nil
  114102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  114103. if err != nil {
  114104. return nil, err
  114105. }
  114106. reqHeaders.Set("Content-Type", "application/json")
  114107. c.urlParams_.Set("alt", alt)
  114108. c.urlParams_.Set("prettyPrint", "false")
  114109. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions")
  114110. urls += "?" + c.urlParams_.Encode()
  114111. req, err := http.NewRequest("POST", urls, body)
  114112. if err != nil {
  114113. return nil, err
  114114. }
  114115. req.Header = reqHeaders
  114116. googleapi.Expand(req.URL, map[string]string{
  114117. "project": c.project,
  114118. "region": c.region,
  114119. "resource": c.resource,
  114120. })
  114121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114122. }
  114123. // Do executes the "compute.regionTargetHttpProxies.testIamPermissions" call.
  114124. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  114125. // non-2xx status code is an error. Response headers are in either
  114126. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  114127. // returned at all) in error.(*googleapi.Error).Header. Use
  114128. // googleapi.IsNotModified to check whether the returned error was
  114129. // because http.StatusNotModified was returned.
  114130. func (c *RegionTargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  114131. gensupport.SetOptions(c.urlParams_, opts...)
  114132. res, err := c.doRequest("json")
  114133. if res != nil && res.StatusCode == http.StatusNotModified {
  114134. if res.Body != nil {
  114135. res.Body.Close()
  114136. }
  114137. return nil, &googleapi.Error{
  114138. Code: res.StatusCode,
  114139. Header: res.Header,
  114140. }
  114141. }
  114142. if err != nil {
  114143. return nil, err
  114144. }
  114145. defer googleapi.CloseBody(res)
  114146. if err := googleapi.CheckResponse(res); err != nil {
  114147. return nil, err
  114148. }
  114149. ret := &TestPermissionsResponse{
  114150. ServerResponse: googleapi.ServerResponse{
  114151. Header: res.Header,
  114152. HTTPStatusCode: res.StatusCode,
  114153. },
  114154. }
  114155. target := &ret
  114156. if err := gensupport.DecodeResponse(target, res); err != nil {
  114157. return nil, err
  114158. }
  114159. return ret, nil
  114160. // {
  114161. // "description": "Returns permissions that a caller has on the specified resource.",
  114162. // "httpMethod": "POST",
  114163. // "id": "compute.regionTargetHttpProxies.testIamPermissions",
  114164. // "parameterOrder": [
  114165. // "project",
  114166. // "region",
  114167. // "resource"
  114168. // ],
  114169. // "parameters": {
  114170. // "project": {
  114171. // "description": "Project ID for this request.",
  114172. // "location": "path",
  114173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114174. // "required": true,
  114175. // "type": "string"
  114176. // },
  114177. // "region": {
  114178. // "description": "The name of the region for this request.",
  114179. // "location": "path",
  114180. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114181. // "required": true,
  114182. // "type": "string"
  114183. // },
  114184. // "resource": {
  114185. // "description": "Name or id of the resource for this request.",
  114186. // "location": "path",
  114187. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114188. // "required": true,
  114189. // "type": "string"
  114190. // }
  114191. // },
  114192. // "path": "{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions",
  114193. // "request": {
  114194. // "$ref": "TestPermissionsRequest"
  114195. // },
  114196. // "response": {
  114197. // "$ref": "TestPermissionsResponse"
  114198. // },
  114199. // "scopes": [
  114200. // "https://www.googleapis.com/auth/cloud-platform",
  114201. // "https://www.googleapis.com/auth/compute",
  114202. // "https://www.googleapis.com/auth/compute.readonly"
  114203. // ]
  114204. // }
  114205. }
  114206. // method id "compute.regionTargetHttpsProxies.delete":
  114207. type RegionTargetHttpsProxiesDeleteCall struct {
  114208. s *Service
  114209. project string
  114210. region string
  114211. targetHttpsProxy string
  114212. urlParams_ gensupport.URLParams
  114213. ctx_ context.Context
  114214. header_ http.Header
  114215. }
  114216. // Delete: Deletes the specified TargetHttpsProxy resource.
  114217. func (r *RegionTargetHttpsProxiesService) Delete(project string, region string, targetHttpsProxy string) *RegionTargetHttpsProxiesDeleteCall {
  114218. c := &RegionTargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114219. c.project = project
  114220. c.region = region
  114221. c.targetHttpsProxy = targetHttpsProxy
  114222. return c
  114223. }
  114224. // RequestId sets the optional parameter "requestId": An optional
  114225. // request ID to identify requests. Specify a unique request ID so that
  114226. // if you must retry your request, the server will know to ignore the
  114227. // request if it has already been completed.
  114228. //
  114229. // For example, consider a situation where you make an initial request
  114230. // and the request times out. If you make the request again with the
  114231. // same request ID, the server can check if original operation with the
  114232. // same request ID was received, and if so, will ignore the second
  114233. // request. This prevents clients from accidentally creating duplicate
  114234. // commitments.
  114235. //
  114236. // The request ID must be a valid UUID with the exception that zero UUID
  114237. // is not supported (00000000-0000-0000-0000-000000000000).
  114238. func (c *RegionTargetHttpsProxiesDeleteCall) RequestId(requestId string) *RegionTargetHttpsProxiesDeleteCall {
  114239. c.urlParams_.Set("requestId", requestId)
  114240. return c
  114241. }
  114242. // Fields allows partial responses to be retrieved. See
  114243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114244. // for more information.
  114245. func (c *RegionTargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesDeleteCall {
  114246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114247. return c
  114248. }
  114249. // Context sets the context to be used in this call's Do method. Any
  114250. // pending HTTP request will be aborted if the provided context is
  114251. // canceled.
  114252. func (c *RegionTargetHttpsProxiesDeleteCall) Context(ctx context.Context) *RegionTargetHttpsProxiesDeleteCall {
  114253. c.ctx_ = ctx
  114254. return c
  114255. }
  114256. // Header returns an http.Header that can be modified by the caller to
  114257. // add HTTP headers to the request.
  114258. func (c *RegionTargetHttpsProxiesDeleteCall) Header() http.Header {
  114259. if c.header_ == nil {
  114260. c.header_ = make(http.Header)
  114261. }
  114262. return c.header_
  114263. }
  114264. func (c *RegionTargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  114265. reqHeaders := make(http.Header)
  114266. for k, v := range c.header_ {
  114267. reqHeaders[k] = v
  114268. }
  114269. reqHeaders.Set("User-Agent", c.s.userAgent())
  114270. var body io.Reader = nil
  114271. c.urlParams_.Set("alt", alt)
  114272. c.urlParams_.Set("prettyPrint", "false")
  114273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
  114274. urls += "?" + c.urlParams_.Encode()
  114275. req, err := http.NewRequest("DELETE", urls, body)
  114276. if err != nil {
  114277. return nil, err
  114278. }
  114279. req.Header = reqHeaders
  114280. googleapi.Expand(req.URL, map[string]string{
  114281. "project": c.project,
  114282. "region": c.region,
  114283. "targetHttpsProxy": c.targetHttpsProxy,
  114284. })
  114285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114286. }
  114287. // Do executes the "compute.regionTargetHttpsProxies.delete" call.
  114288. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114289. // status code is an error. Response headers are in either
  114290. // *Operation.ServerResponse.Header or (if a response was returned at
  114291. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114292. // to check whether the returned error was because
  114293. // http.StatusNotModified was returned.
  114294. func (c *RegionTargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114295. gensupport.SetOptions(c.urlParams_, opts...)
  114296. res, err := c.doRequest("json")
  114297. if res != nil && res.StatusCode == http.StatusNotModified {
  114298. if res.Body != nil {
  114299. res.Body.Close()
  114300. }
  114301. return nil, &googleapi.Error{
  114302. Code: res.StatusCode,
  114303. Header: res.Header,
  114304. }
  114305. }
  114306. if err != nil {
  114307. return nil, err
  114308. }
  114309. defer googleapi.CloseBody(res)
  114310. if err := googleapi.CheckResponse(res); err != nil {
  114311. return nil, err
  114312. }
  114313. ret := &Operation{
  114314. ServerResponse: googleapi.ServerResponse{
  114315. Header: res.Header,
  114316. HTTPStatusCode: res.StatusCode,
  114317. },
  114318. }
  114319. target := &ret
  114320. if err := gensupport.DecodeResponse(target, res); err != nil {
  114321. return nil, err
  114322. }
  114323. return ret, nil
  114324. // {
  114325. // "description": "Deletes the specified TargetHttpsProxy resource.",
  114326. // "httpMethod": "DELETE",
  114327. // "id": "compute.regionTargetHttpsProxies.delete",
  114328. // "parameterOrder": [
  114329. // "project",
  114330. // "region",
  114331. // "targetHttpsProxy"
  114332. // ],
  114333. // "parameters": {
  114334. // "project": {
  114335. // "description": "Project ID for this request.",
  114336. // "location": "path",
  114337. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114338. // "required": true,
  114339. // "type": "string"
  114340. // },
  114341. // "region": {
  114342. // "description": "Name of the region scoping this request.",
  114343. // "location": "path",
  114344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114345. // "required": true,
  114346. // "type": "string"
  114347. // },
  114348. // "requestId": {
  114349. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114350. // "location": "query",
  114351. // "type": "string"
  114352. // },
  114353. // "targetHttpsProxy": {
  114354. // "description": "Name of the TargetHttpsProxy resource to delete.",
  114355. // "location": "path",
  114356. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114357. // "required": true,
  114358. // "type": "string"
  114359. // }
  114360. // },
  114361. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
  114362. // "response": {
  114363. // "$ref": "Operation"
  114364. // },
  114365. // "scopes": [
  114366. // "https://www.googleapis.com/auth/cloud-platform",
  114367. // "https://www.googleapis.com/auth/compute"
  114368. // ]
  114369. // }
  114370. }
  114371. // method id "compute.regionTargetHttpsProxies.get":
  114372. type RegionTargetHttpsProxiesGetCall struct {
  114373. s *Service
  114374. project string
  114375. region string
  114376. targetHttpsProxy string
  114377. urlParams_ gensupport.URLParams
  114378. ifNoneMatch_ string
  114379. ctx_ context.Context
  114380. header_ http.Header
  114381. }
  114382. // Get: Returns the specified TargetHttpsProxy resource in the specified
  114383. // region. Gets a list of available target HTTP proxies by making a
  114384. // list() request.
  114385. func (r *RegionTargetHttpsProxiesService) Get(project string, region string, targetHttpsProxy string) *RegionTargetHttpsProxiesGetCall {
  114386. c := &RegionTargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114387. c.project = project
  114388. c.region = region
  114389. c.targetHttpsProxy = targetHttpsProxy
  114390. return c
  114391. }
  114392. // Fields allows partial responses to be retrieved. See
  114393. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114394. // for more information.
  114395. func (c *RegionTargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesGetCall {
  114396. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114397. return c
  114398. }
  114399. // IfNoneMatch sets the optional parameter which makes the operation
  114400. // fail if the object's ETag matches the given value. This is useful for
  114401. // getting updates only after the object has changed since the last
  114402. // request. Use googleapi.IsNotModified to check whether the response
  114403. // error from Do is the result of In-None-Match.
  114404. func (c *RegionTargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *RegionTargetHttpsProxiesGetCall {
  114405. c.ifNoneMatch_ = entityTag
  114406. return c
  114407. }
  114408. // Context sets the context to be used in this call's Do method. Any
  114409. // pending HTTP request will be aborted if the provided context is
  114410. // canceled.
  114411. func (c *RegionTargetHttpsProxiesGetCall) Context(ctx context.Context) *RegionTargetHttpsProxiesGetCall {
  114412. c.ctx_ = ctx
  114413. return c
  114414. }
  114415. // Header returns an http.Header that can be modified by the caller to
  114416. // add HTTP headers to the request.
  114417. func (c *RegionTargetHttpsProxiesGetCall) Header() http.Header {
  114418. if c.header_ == nil {
  114419. c.header_ = make(http.Header)
  114420. }
  114421. return c.header_
  114422. }
  114423. func (c *RegionTargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  114424. reqHeaders := make(http.Header)
  114425. for k, v := range c.header_ {
  114426. reqHeaders[k] = v
  114427. }
  114428. reqHeaders.Set("User-Agent", c.s.userAgent())
  114429. if c.ifNoneMatch_ != "" {
  114430. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114431. }
  114432. var body io.Reader = nil
  114433. c.urlParams_.Set("alt", alt)
  114434. c.urlParams_.Set("prettyPrint", "false")
  114435. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}")
  114436. urls += "?" + c.urlParams_.Encode()
  114437. req, err := http.NewRequest("GET", urls, body)
  114438. if err != nil {
  114439. return nil, err
  114440. }
  114441. req.Header = reqHeaders
  114442. googleapi.Expand(req.URL, map[string]string{
  114443. "project": c.project,
  114444. "region": c.region,
  114445. "targetHttpsProxy": c.targetHttpsProxy,
  114446. })
  114447. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114448. }
  114449. // Do executes the "compute.regionTargetHttpsProxies.get" call.
  114450. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  114451. // non-2xx status code is an error. Response headers are in either
  114452. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  114453. // returned at all) in error.(*googleapi.Error).Header. Use
  114454. // googleapi.IsNotModified to check whether the returned error was
  114455. // because http.StatusNotModified was returned.
  114456. func (c *RegionTargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  114457. gensupport.SetOptions(c.urlParams_, opts...)
  114458. res, err := c.doRequest("json")
  114459. if res != nil && res.StatusCode == http.StatusNotModified {
  114460. if res.Body != nil {
  114461. res.Body.Close()
  114462. }
  114463. return nil, &googleapi.Error{
  114464. Code: res.StatusCode,
  114465. Header: res.Header,
  114466. }
  114467. }
  114468. if err != nil {
  114469. return nil, err
  114470. }
  114471. defer googleapi.CloseBody(res)
  114472. if err := googleapi.CheckResponse(res); err != nil {
  114473. return nil, err
  114474. }
  114475. ret := &TargetHttpsProxy{
  114476. ServerResponse: googleapi.ServerResponse{
  114477. Header: res.Header,
  114478. HTTPStatusCode: res.StatusCode,
  114479. },
  114480. }
  114481. target := &ret
  114482. if err := gensupport.DecodeResponse(target, res); err != nil {
  114483. return nil, err
  114484. }
  114485. return ret, nil
  114486. // {
  114487. // "description": "Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request.",
  114488. // "httpMethod": "GET",
  114489. // "id": "compute.regionTargetHttpsProxies.get",
  114490. // "parameterOrder": [
  114491. // "project",
  114492. // "region",
  114493. // "targetHttpsProxy"
  114494. // ],
  114495. // "parameters": {
  114496. // "project": {
  114497. // "description": "Project ID for this request.",
  114498. // "location": "path",
  114499. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114500. // "required": true,
  114501. // "type": "string"
  114502. // },
  114503. // "region": {
  114504. // "description": "Name of the region scoping this request.",
  114505. // "location": "path",
  114506. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114507. // "required": true,
  114508. // "type": "string"
  114509. // },
  114510. // "targetHttpsProxy": {
  114511. // "description": "Name of the TargetHttpsProxy resource to return.",
  114512. // "location": "path",
  114513. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  114514. // "required": true,
  114515. // "type": "string"
  114516. // }
  114517. // },
  114518. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}",
  114519. // "response": {
  114520. // "$ref": "TargetHttpsProxy"
  114521. // },
  114522. // "scopes": [
  114523. // "https://www.googleapis.com/auth/cloud-platform",
  114524. // "https://www.googleapis.com/auth/compute",
  114525. // "https://www.googleapis.com/auth/compute.readonly"
  114526. // ]
  114527. // }
  114528. }
  114529. // method id "compute.regionTargetHttpsProxies.insert":
  114530. type RegionTargetHttpsProxiesInsertCall struct {
  114531. s *Service
  114532. project string
  114533. region string
  114534. targethttpsproxy *TargetHttpsProxy
  114535. urlParams_ gensupport.URLParams
  114536. ctx_ context.Context
  114537. header_ http.Header
  114538. }
  114539. // Insert: Creates a TargetHttpsProxy resource in the specified project
  114540. // and region using the data included in the request.
  114541. func (r *RegionTargetHttpsProxiesService) Insert(project string, region string, targethttpsproxy *TargetHttpsProxy) *RegionTargetHttpsProxiesInsertCall {
  114542. c := &RegionTargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114543. c.project = project
  114544. c.region = region
  114545. c.targethttpsproxy = targethttpsproxy
  114546. return c
  114547. }
  114548. // RequestId sets the optional parameter "requestId": An optional
  114549. // request ID to identify requests. Specify a unique request ID so that
  114550. // if you must retry your request, the server will know to ignore the
  114551. // request if it has already been completed.
  114552. //
  114553. // For example, consider a situation where you make an initial request
  114554. // and the request times out. If you make the request again with the
  114555. // same request ID, the server can check if original operation with the
  114556. // same request ID was received, and if so, will ignore the second
  114557. // request. This prevents clients from accidentally creating duplicate
  114558. // commitments.
  114559. //
  114560. // The request ID must be a valid UUID with the exception that zero UUID
  114561. // is not supported (00000000-0000-0000-0000-000000000000).
  114562. func (c *RegionTargetHttpsProxiesInsertCall) RequestId(requestId string) *RegionTargetHttpsProxiesInsertCall {
  114563. c.urlParams_.Set("requestId", requestId)
  114564. return c
  114565. }
  114566. // Fields allows partial responses to be retrieved. See
  114567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114568. // for more information.
  114569. func (c *RegionTargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesInsertCall {
  114570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114571. return c
  114572. }
  114573. // Context sets the context to be used in this call's Do method. Any
  114574. // pending HTTP request will be aborted if the provided context is
  114575. // canceled.
  114576. func (c *RegionTargetHttpsProxiesInsertCall) Context(ctx context.Context) *RegionTargetHttpsProxiesInsertCall {
  114577. c.ctx_ = ctx
  114578. return c
  114579. }
  114580. // Header returns an http.Header that can be modified by the caller to
  114581. // add HTTP headers to the request.
  114582. func (c *RegionTargetHttpsProxiesInsertCall) Header() http.Header {
  114583. if c.header_ == nil {
  114584. c.header_ = make(http.Header)
  114585. }
  114586. return c.header_
  114587. }
  114588. func (c *RegionTargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  114589. reqHeaders := make(http.Header)
  114590. for k, v := range c.header_ {
  114591. reqHeaders[k] = v
  114592. }
  114593. reqHeaders.Set("User-Agent", c.s.userAgent())
  114594. var body io.Reader = nil
  114595. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  114596. if err != nil {
  114597. return nil, err
  114598. }
  114599. reqHeaders.Set("Content-Type", "application/json")
  114600. c.urlParams_.Set("alt", alt)
  114601. c.urlParams_.Set("prettyPrint", "false")
  114602. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies")
  114603. urls += "?" + c.urlParams_.Encode()
  114604. req, err := http.NewRequest("POST", urls, body)
  114605. if err != nil {
  114606. return nil, err
  114607. }
  114608. req.Header = reqHeaders
  114609. googleapi.Expand(req.URL, map[string]string{
  114610. "project": c.project,
  114611. "region": c.region,
  114612. })
  114613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114614. }
  114615. // Do executes the "compute.regionTargetHttpsProxies.insert" call.
  114616. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  114617. // status code is an error. Response headers are in either
  114618. // *Operation.ServerResponse.Header or (if a response was returned at
  114619. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  114620. // to check whether the returned error was because
  114621. // http.StatusNotModified was returned.
  114622. func (c *RegionTargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  114623. gensupport.SetOptions(c.urlParams_, opts...)
  114624. res, err := c.doRequest("json")
  114625. if res != nil && res.StatusCode == http.StatusNotModified {
  114626. if res.Body != nil {
  114627. res.Body.Close()
  114628. }
  114629. return nil, &googleapi.Error{
  114630. Code: res.StatusCode,
  114631. Header: res.Header,
  114632. }
  114633. }
  114634. if err != nil {
  114635. return nil, err
  114636. }
  114637. defer googleapi.CloseBody(res)
  114638. if err := googleapi.CheckResponse(res); err != nil {
  114639. return nil, err
  114640. }
  114641. ret := &Operation{
  114642. ServerResponse: googleapi.ServerResponse{
  114643. Header: res.Header,
  114644. HTTPStatusCode: res.StatusCode,
  114645. },
  114646. }
  114647. target := &ret
  114648. if err := gensupport.DecodeResponse(target, res); err != nil {
  114649. return nil, err
  114650. }
  114651. return ret, nil
  114652. // {
  114653. // "description": "Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request.",
  114654. // "httpMethod": "POST",
  114655. // "id": "compute.regionTargetHttpsProxies.insert",
  114656. // "parameterOrder": [
  114657. // "project",
  114658. // "region"
  114659. // ],
  114660. // "parameters": {
  114661. // "project": {
  114662. // "description": "Project ID for this request.",
  114663. // "location": "path",
  114664. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114665. // "required": true,
  114666. // "type": "string"
  114667. // },
  114668. // "region": {
  114669. // "description": "Name of the region scoping this request.",
  114670. // "location": "path",
  114671. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114672. // "required": true,
  114673. // "type": "string"
  114674. // },
  114675. // "requestId": {
  114676. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  114677. // "location": "query",
  114678. // "type": "string"
  114679. // }
  114680. // },
  114681. // "path": "{project}/regions/{region}/targetHttpsProxies",
  114682. // "request": {
  114683. // "$ref": "TargetHttpsProxy"
  114684. // },
  114685. // "response": {
  114686. // "$ref": "Operation"
  114687. // },
  114688. // "scopes": [
  114689. // "https://www.googleapis.com/auth/cloud-platform",
  114690. // "https://www.googleapis.com/auth/compute"
  114691. // ]
  114692. // }
  114693. }
  114694. // method id "compute.regionTargetHttpsProxies.list":
  114695. type RegionTargetHttpsProxiesListCall struct {
  114696. s *Service
  114697. project string
  114698. region string
  114699. urlParams_ gensupport.URLParams
  114700. ifNoneMatch_ string
  114701. ctx_ context.Context
  114702. header_ http.Header
  114703. }
  114704. // List: Retrieves the list of TargetHttpsProxy resources available to
  114705. // the specified project in the specified region.
  114706. func (r *RegionTargetHttpsProxiesService) List(project string, region string) *RegionTargetHttpsProxiesListCall {
  114707. c := &RegionTargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114708. c.project = project
  114709. c.region = region
  114710. return c
  114711. }
  114712. // Filter sets the optional parameter "filter": A filter expression that
  114713. // filters resources listed in the response. The expression must specify
  114714. // the field name, a comparison operator, and the value that you want to
  114715. // use for filtering. The value must be a string, a number, or a
  114716. // boolean. The comparison operator must be either =, !=, >, or <.
  114717. //
  114718. // For example, if you are filtering Compute Engine instances, you can
  114719. // exclude instances named example-instance by specifying name !=
  114720. // example-instance.
  114721. //
  114722. // You can also filter nested fields. For example, you could specify
  114723. // scheduling.automaticRestart = false to include instances only if they
  114724. // are not scheduled for automatic restarts. You can use filtering on
  114725. // nested fields to filter based on resource labels.
  114726. //
  114727. // To filter on multiple expressions, provide each separate expression
  114728. // within parentheses. For example, (scheduling.automaticRestart = true)
  114729. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  114730. // AND expression. However, you can include AND and OR expressions
  114731. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  114732. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  114733. // true).
  114734. func (c *RegionTargetHttpsProxiesListCall) Filter(filter string) *RegionTargetHttpsProxiesListCall {
  114735. c.urlParams_.Set("filter", filter)
  114736. return c
  114737. }
  114738. // MaxResults sets the optional parameter "maxResults": The maximum
  114739. // number of results per page that should be returned. If the number of
  114740. // available results is larger than maxResults, Compute Engine returns a
  114741. // nextPageToken that can be used to get the next page of results in
  114742. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  114743. // (Default: 500)
  114744. func (c *RegionTargetHttpsProxiesListCall) MaxResults(maxResults int64) *RegionTargetHttpsProxiesListCall {
  114745. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  114746. return c
  114747. }
  114748. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  114749. // a certain order. By default, results are returned in alphanumerical
  114750. // order based on the resource name.
  114751. //
  114752. // You can also sort results in descending order based on the creation
  114753. // timestamp using orderBy="creationTimestamp desc". This sorts results
  114754. // based on the creationTimestamp field in reverse chronological order
  114755. // (newest result first). Use this to sort resources like operations so
  114756. // that the newest operation is returned first.
  114757. //
  114758. // Currently, only sorting by name or creationTimestamp desc is
  114759. // supported.
  114760. func (c *RegionTargetHttpsProxiesListCall) OrderBy(orderBy string) *RegionTargetHttpsProxiesListCall {
  114761. c.urlParams_.Set("orderBy", orderBy)
  114762. return c
  114763. }
  114764. // PageToken sets the optional parameter "pageToken": Specifies a page
  114765. // token to use. Set pageToken to the nextPageToken returned by a
  114766. // previous list request to get the next page of results.
  114767. func (c *RegionTargetHttpsProxiesListCall) PageToken(pageToken string) *RegionTargetHttpsProxiesListCall {
  114768. c.urlParams_.Set("pageToken", pageToken)
  114769. return c
  114770. }
  114771. // Fields allows partial responses to be retrieved. See
  114772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114773. // for more information.
  114774. func (c *RegionTargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesListCall {
  114775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114776. return c
  114777. }
  114778. // IfNoneMatch sets the optional parameter which makes the operation
  114779. // fail if the object's ETag matches the given value. This is useful for
  114780. // getting updates only after the object has changed since the last
  114781. // request. Use googleapi.IsNotModified to check whether the response
  114782. // error from Do is the result of In-None-Match.
  114783. func (c *RegionTargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *RegionTargetHttpsProxiesListCall {
  114784. c.ifNoneMatch_ = entityTag
  114785. return c
  114786. }
  114787. // Context sets the context to be used in this call's Do method. Any
  114788. // pending HTTP request will be aborted if the provided context is
  114789. // canceled.
  114790. func (c *RegionTargetHttpsProxiesListCall) Context(ctx context.Context) *RegionTargetHttpsProxiesListCall {
  114791. c.ctx_ = ctx
  114792. return c
  114793. }
  114794. // Header returns an http.Header that can be modified by the caller to
  114795. // add HTTP headers to the request.
  114796. func (c *RegionTargetHttpsProxiesListCall) Header() http.Header {
  114797. if c.header_ == nil {
  114798. c.header_ = make(http.Header)
  114799. }
  114800. return c.header_
  114801. }
  114802. func (c *RegionTargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  114803. reqHeaders := make(http.Header)
  114804. for k, v := range c.header_ {
  114805. reqHeaders[k] = v
  114806. }
  114807. reqHeaders.Set("User-Agent", c.s.userAgent())
  114808. if c.ifNoneMatch_ != "" {
  114809. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  114810. }
  114811. var body io.Reader = nil
  114812. c.urlParams_.Set("alt", alt)
  114813. c.urlParams_.Set("prettyPrint", "false")
  114814. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies")
  114815. urls += "?" + c.urlParams_.Encode()
  114816. req, err := http.NewRequest("GET", urls, body)
  114817. if err != nil {
  114818. return nil, err
  114819. }
  114820. req.Header = reqHeaders
  114821. googleapi.Expand(req.URL, map[string]string{
  114822. "project": c.project,
  114823. "region": c.region,
  114824. })
  114825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  114826. }
  114827. // Do executes the "compute.regionTargetHttpsProxies.list" call.
  114828. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  114829. // non-2xx status code is an error. Response headers are in either
  114830. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  114831. // returned at all) in error.(*googleapi.Error).Header. Use
  114832. // googleapi.IsNotModified to check whether the returned error was
  114833. // because http.StatusNotModified was returned.
  114834. func (c *RegionTargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  114835. gensupport.SetOptions(c.urlParams_, opts...)
  114836. res, err := c.doRequest("json")
  114837. if res != nil && res.StatusCode == http.StatusNotModified {
  114838. if res.Body != nil {
  114839. res.Body.Close()
  114840. }
  114841. return nil, &googleapi.Error{
  114842. Code: res.StatusCode,
  114843. Header: res.Header,
  114844. }
  114845. }
  114846. if err != nil {
  114847. return nil, err
  114848. }
  114849. defer googleapi.CloseBody(res)
  114850. if err := googleapi.CheckResponse(res); err != nil {
  114851. return nil, err
  114852. }
  114853. ret := &TargetHttpsProxyList{
  114854. ServerResponse: googleapi.ServerResponse{
  114855. Header: res.Header,
  114856. HTTPStatusCode: res.StatusCode,
  114857. },
  114858. }
  114859. target := &ret
  114860. if err := gensupport.DecodeResponse(target, res); err != nil {
  114861. return nil, err
  114862. }
  114863. return ret, nil
  114864. // {
  114865. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region.",
  114866. // "httpMethod": "GET",
  114867. // "id": "compute.regionTargetHttpsProxies.list",
  114868. // "parameterOrder": [
  114869. // "project",
  114870. // "region"
  114871. // ],
  114872. // "parameters": {
  114873. // "filter": {
  114874. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  114875. // "location": "query",
  114876. // "type": "string"
  114877. // },
  114878. // "maxResults": {
  114879. // "default": "500",
  114880. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  114881. // "format": "uint32",
  114882. // "location": "query",
  114883. // "minimum": "0",
  114884. // "type": "integer"
  114885. // },
  114886. // "orderBy": {
  114887. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  114888. // "location": "query",
  114889. // "type": "string"
  114890. // },
  114891. // "pageToken": {
  114892. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  114893. // "location": "query",
  114894. // "type": "string"
  114895. // },
  114896. // "project": {
  114897. // "description": "Project ID for this request.",
  114898. // "location": "path",
  114899. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  114900. // "required": true,
  114901. // "type": "string"
  114902. // },
  114903. // "region": {
  114904. // "description": "Name of the region scoping this request.",
  114905. // "location": "path",
  114906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  114907. // "required": true,
  114908. // "type": "string"
  114909. // }
  114910. // },
  114911. // "path": "{project}/regions/{region}/targetHttpsProxies",
  114912. // "response": {
  114913. // "$ref": "TargetHttpsProxyList"
  114914. // },
  114915. // "scopes": [
  114916. // "https://www.googleapis.com/auth/cloud-platform",
  114917. // "https://www.googleapis.com/auth/compute",
  114918. // "https://www.googleapis.com/auth/compute.readonly"
  114919. // ]
  114920. // }
  114921. }
  114922. // Pages invokes f for each page of results.
  114923. // A non-nil error returned from f will halt the iteration.
  114924. // The provided context supersedes any context provided to the Context method.
  114925. func (c *RegionTargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  114926. c.ctx_ = ctx
  114927. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  114928. for {
  114929. x, err := c.Do()
  114930. if err != nil {
  114931. return err
  114932. }
  114933. if err := f(x); err != nil {
  114934. return err
  114935. }
  114936. if x.NextPageToken == "" {
  114937. return nil
  114938. }
  114939. c.PageToken(x.NextPageToken)
  114940. }
  114941. }
  114942. // method id "compute.regionTargetHttpsProxies.setSslCertificates":
  114943. type RegionTargetHttpsProxiesSetSslCertificatesCall struct {
  114944. s *Service
  114945. project string
  114946. region string
  114947. targetHttpsProxy string
  114948. regiontargethttpsproxiessetsslcertificatesrequest *RegionTargetHttpsProxiesSetSslCertificatesRequest
  114949. urlParams_ gensupport.URLParams
  114950. ctx_ context.Context
  114951. header_ http.Header
  114952. }
  114953. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  114954. func (r *RegionTargetHttpsProxiesService) SetSslCertificates(project string, region string, targetHttpsProxy string, regiontargethttpsproxiessetsslcertificatesrequest *RegionTargetHttpsProxiesSetSslCertificatesRequest) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  114955. c := &RegionTargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  114956. c.project = project
  114957. c.region = region
  114958. c.targetHttpsProxy = targetHttpsProxy
  114959. c.regiontargethttpsproxiessetsslcertificatesrequest = regiontargethttpsproxiessetsslcertificatesrequest
  114960. return c
  114961. }
  114962. // RequestId sets the optional parameter "requestId": An optional
  114963. // request ID to identify requests. Specify a unique request ID so that
  114964. // if you must retry your request, the server will know to ignore the
  114965. // request if it has already been completed.
  114966. //
  114967. // For example, consider a situation where you make an initial request
  114968. // and the request times out. If you make the request again with the
  114969. // same request ID, the server can check if original operation with the
  114970. // same request ID was received, and if so, will ignore the second
  114971. // request. This prevents clients from accidentally creating duplicate
  114972. // commitments.
  114973. //
  114974. // The request ID must be a valid UUID with the exception that zero UUID
  114975. // is not supported (00000000-0000-0000-0000-000000000000).
  114976. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  114977. c.urlParams_.Set("requestId", requestId)
  114978. return c
  114979. }
  114980. // Fields allows partial responses to be retrieved. See
  114981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  114982. // for more information.
  114983. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  114984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  114985. return c
  114986. }
  114987. // Context sets the context to be used in this call's Do method. Any
  114988. // pending HTTP request will be aborted if the provided context is
  114989. // canceled.
  114990. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *RegionTargetHttpsProxiesSetSslCertificatesCall {
  114991. c.ctx_ = ctx
  114992. return c
  114993. }
  114994. // Header returns an http.Header that can be modified by the caller to
  114995. // add HTTP headers to the request.
  114996. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  114997. if c.header_ == nil {
  114998. c.header_ = make(http.Header)
  114999. }
  115000. return c.header_
  115001. }
  115002. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  115003. reqHeaders := make(http.Header)
  115004. for k, v := range c.header_ {
  115005. reqHeaders[k] = v
  115006. }
  115007. reqHeaders.Set("User-Agent", c.s.userAgent())
  115008. var body io.Reader = nil
  115009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiontargethttpsproxiessetsslcertificatesrequest)
  115010. if err != nil {
  115011. return nil, err
  115012. }
  115013. reqHeaders.Set("Content-Type", "application/json")
  115014. c.urlParams_.Set("alt", alt)
  115015. c.urlParams_.Set("prettyPrint", "false")
  115016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  115017. urls += "?" + c.urlParams_.Encode()
  115018. req, err := http.NewRequest("POST", urls, body)
  115019. if err != nil {
  115020. return nil, err
  115021. }
  115022. req.Header = reqHeaders
  115023. googleapi.Expand(req.URL, map[string]string{
  115024. "project": c.project,
  115025. "region": c.region,
  115026. "targetHttpsProxy": c.targetHttpsProxy,
  115027. })
  115028. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115029. }
  115030. // Do executes the "compute.regionTargetHttpsProxies.setSslCertificates" call.
  115031. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115032. // status code is an error. Response headers are in either
  115033. // *Operation.ServerResponse.Header or (if a response was returned at
  115034. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115035. // to check whether the returned error was because
  115036. // http.StatusNotModified was returned.
  115037. func (c *RegionTargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115038. gensupport.SetOptions(c.urlParams_, opts...)
  115039. res, err := c.doRequest("json")
  115040. if res != nil && res.StatusCode == http.StatusNotModified {
  115041. if res.Body != nil {
  115042. res.Body.Close()
  115043. }
  115044. return nil, &googleapi.Error{
  115045. Code: res.StatusCode,
  115046. Header: res.Header,
  115047. }
  115048. }
  115049. if err != nil {
  115050. return nil, err
  115051. }
  115052. defer googleapi.CloseBody(res)
  115053. if err := googleapi.CheckResponse(res); err != nil {
  115054. return nil, err
  115055. }
  115056. ret := &Operation{
  115057. ServerResponse: googleapi.ServerResponse{
  115058. Header: res.Header,
  115059. HTTPStatusCode: res.StatusCode,
  115060. },
  115061. }
  115062. target := &ret
  115063. if err := gensupport.DecodeResponse(target, res); err != nil {
  115064. return nil, err
  115065. }
  115066. return ret, nil
  115067. // {
  115068. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  115069. // "httpMethod": "POST",
  115070. // "id": "compute.regionTargetHttpsProxies.setSslCertificates",
  115071. // "parameterOrder": [
  115072. // "project",
  115073. // "region",
  115074. // "targetHttpsProxy"
  115075. // ],
  115076. // "parameters": {
  115077. // "project": {
  115078. // "description": "Project ID for this request.",
  115079. // "location": "path",
  115080. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115081. // "required": true,
  115082. // "type": "string"
  115083. // },
  115084. // "region": {
  115085. // "description": "Name of the region scoping this request.",
  115086. // "location": "path",
  115087. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115088. // "required": true,
  115089. // "type": "string"
  115090. // },
  115091. // "requestId": {
  115092. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115093. // "location": "query",
  115094. // "type": "string"
  115095. // },
  115096. // "targetHttpsProxy": {
  115097. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  115098. // "location": "path",
  115099. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115100. // "required": true,
  115101. // "type": "string"
  115102. // }
  115103. // },
  115104. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  115105. // "request": {
  115106. // "$ref": "RegionTargetHttpsProxiesSetSslCertificatesRequest"
  115107. // },
  115108. // "response": {
  115109. // "$ref": "Operation"
  115110. // },
  115111. // "scopes": [
  115112. // "https://www.googleapis.com/auth/cloud-platform",
  115113. // "https://www.googleapis.com/auth/compute"
  115114. // ]
  115115. // }
  115116. }
  115117. // method id "compute.regionTargetHttpsProxies.setUrlMap":
  115118. type RegionTargetHttpsProxiesSetUrlMapCall struct {
  115119. s *Service
  115120. project string
  115121. region string
  115122. targetHttpsProxy string
  115123. urlmapreference *UrlMapReference
  115124. urlParams_ gensupport.URLParams
  115125. ctx_ context.Context
  115126. header_ http.Header
  115127. }
  115128. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  115129. func (r *RegionTargetHttpsProxiesService) SetUrlMap(project string, region string, targetHttpsProxy string, urlmapreference *UrlMapReference) *RegionTargetHttpsProxiesSetUrlMapCall {
  115130. c := &RegionTargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115131. c.project = project
  115132. c.region = region
  115133. c.targetHttpsProxy = targetHttpsProxy
  115134. c.urlmapreference = urlmapreference
  115135. return c
  115136. }
  115137. // RequestId sets the optional parameter "requestId": An optional
  115138. // request ID to identify requests. Specify a unique request ID so that
  115139. // if you must retry your request, the server will know to ignore the
  115140. // request if it has already been completed.
  115141. //
  115142. // For example, consider a situation where you make an initial request
  115143. // and the request times out. If you make the request again with the
  115144. // same request ID, the server can check if original operation with the
  115145. // same request ID was received, and if so, will ignore the second
  115146. // request. This prevents clients from accidentally creating duplicate
  115147. // commitments.
  115148. //
  115149. // The request ID must be a valid UUID with the exception that zero UUID
  115150. // is not supported (00000000-0000-0000-0000-000000000000).
  115151. func (c *RegionTargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *RegionTargetHttpsProxiesSetUrlMapCall {
  115152. c.urlParams_.Set("requestId", requestId)
  115153. return c
  115154. }
  115155. // Fields allows partial responses to be retrieved. See
  115156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115157. // for more information.
  115158. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesSetUrlMapCall {
  115159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115160. return c
  115161. }
  115162. // Context sets the context to be used in this call's Do method. Any
  115163. // pending HTTP request will be aborted if the provided context is
  115164. // canceled.
  115165. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *RegionTargetHttpsProxiesSetUrlMapCall {
  115166. c.ctx_ = ctx
  115167. return c
  115168. }
  115169. // Header returns an http.Header that can be modified by the caller to
  115170. // add HTTP headers to the request.
  115171. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  115172. if c.header_ == nil {
  115173. c.header_ = make(http.Header)
  115174. }
  115175. return c.header_
  115176. }
  115177. func (c *RegionTargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  115178. reqHeaders := make(http.Header)
  115179. for k, v := range c.header_ {
  115180. reqHeaders[k] = v
  115181. }
  115182. reqHeaders.Set("User-Agent", c.s.userAgent())
  115183. var body io.Reader = nil
  115184. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  115185. if err != nil {
  115186. return nil, err
  115187. }
  115188. reqHeaders.Set("Content-Type", "application/json")
  115189. c.urlParams_.Set("alt", alt)
  115190. c.urlParams_.Set("prettyPrint", "false")
  115191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  115192. urls += "?" + c.urlParams_.Encode()
  115193. req, err := http.NewRequest("POST", urls, body)
  115194. if err != nil {
  115195. return nil, err
  115196. }
  115197. req.Header = reqHeaders
  115198. googleapi.Expand(req.URL, map[string]string{
  115199. "project": c.project,
  115200. "region": c.region,
  115201. "targetHttpsProxy": c.targetHttpsProxy,
  115202. })
  115203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115204. }
  115205. // Do executes the "compute.regionTargetHttpsProxies.setUrlMap" call.
  115206. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115207. // status code is an error. Response headers are in either
  115208. // *Operation.ServerResponse.Header or (if a response was returned at
  115209. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115210. // to check whether the returned error was because
  115211. // http.StatusNotModified was returned.
  115212. func (c *RegionTargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115213. gensupport.SetOptions(c.urlParams_, opts...)
  115214. res, err := c.doRequest("json")
  115215. if res != nil && res.StatusCode == http.StatusNotModified {
  115216. if res.Body != nil {
  115217. res.Body.Close()
  115218. }
  115219. return nil, &googleapi.Error{
  115220. Code: res.StatusCode,
  115221. Header: res.Header,
  115222. }
  115223. }
  115224. if err != nil {
  115225. return nil, err
  115226. }
  115227. defer googleapi.CloseBody(res)
  115228. if err := googleapi.CheckResponse(res); err != nil {
  115229. return nil, err
  115230. }
  115231. ret := &Operation{
  115232. ServerResponse: googleapi.ServerResponse{
  115233. Header: res.Header,
  115234. HTTPStatusCode: res.StatusCode,
  115235. },
  115236. }
  115237. target := &ret
  115238. if err := gensupport.DecodeResponse(target, res); err != nil {
  115239. return nil, err
  115240. }
  115241. return ret, nil
  115242. // {
  115243. // "description": "Changes the URL map for TargetHttpsProxy.",
  115244. // "httpMethod": "POST",
  115245. // "id": "compute.regionTargetHttpsProxies.setUrlMap",
  115246. // "parameterOrder": [
  115247. // "project",
  115248. // "region",
  115249. // "targetHttpsProxy"
  115250. // ],
  115251. // "parameters": {
  115252. // "project": {
  115253. // "description": "Project ID for this request.",
  115254. // "location": "path",
  115255. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115256. // "required": true,
  115257. // "type": "string"
  115258. // },
  115259. // "region": {
  115260. // "description": "Name of the region scoping this request.",
  115261. // "location": "path",
  115262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115263. // "required": true,
  115264. // "type": "string"
  115265. // },
  115266. // "requestId": {
  115267. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  115268. // "location": "query",
  115269. // "type": "string"
  115270. // },
  115271. // "targetHttpsProxy": {
  115272. // "description": "Name of the TargetHttpsProxy to set a URL map for.",
  115273. // "location": "path",
  115274. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115275. // "required": true,
  115276. // "type": "string"
  115277. // }
  115278. // },
  115279. // "path": "{project}/regions/{region}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  115280. // "request": {
  115281. // "$ref": "UrlMapReference"
  115282. // },
  115283. // "response": {
  115284. // "$ref": "Operation"
  115285. // },
  115286. // "scopes": [
  115287. // "https://www.googleapis.com/auth/cloud-platform",
  115288. // "https://www.googleapis.com/auth/compute"
  115289. // ]
  115290. // }
  115291. }
  115292. // method id "compute.regionTargetHttpsProxies.testIamPermissions":
  115293. type RegionTargetHttpsProxiesTestIamPermissionsCall struct {
  115294. s *Service
  115295. project string
  115296. region string
  115297. resource string
  115298. testpermissionsrequest *TestPermissionsRequest
  115299. urlParams_ gensupport.URLParams
  115300. ctx_ context.Context
  115301. header_ http.Header
  115302. }
  115303. // TestIamPermissions: Returns permissions that a caller has on the
  115304. // specified resource.
  115305. func (r *RegionTargetHttpsProxiesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  115306. c := &RegionTargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115307. c.project = project
  115308. c.region = region
  115309. c.resource = resource
  115310. c.testpermissionsrequest = testpermissionsrequest
  115311. return c
  115312. }
  115313. // Fields allows partial responses to be retrieved. See
  115314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115315. // for more information.
  115316. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  115317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115318. return c
  115319. }
  115320. // Context sets the context to be used in this call's Do method. Any
  115321. // pending HTTP request will be aborted if the provided context is
  115322. // canceled.
  115323. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *RegionTargetHttpsProxiesTestIamPermissionsCall {
  115324. c.ctx_ = ctx
  115325. return c
  115326. }
  115327. // Header returns an http.Header that can be modified by the caller to
  115328. // add HTTP headers to the request.
  115329. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  115330. if c.header_ == nil {
  115331. c.header_ = make(http.Header)
  115332. }
  115333. return c.header_
  115334. }
  115335. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  115336. reqHeaders := make(http.Header)
  115337. for k, v := range c.header_ {
  115338. reqHeaders[k] = v
  115339. }
  115340. reqHeaders.Set("User-Agent", c.s.userAgent())
  115341. var body io.Reader = nil
  115342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  115343. if err != nil {
  115344. return nil, err
  115345. }
  115346. reqHeaders.Set("Content-Type", "application/json")
  115347. c.urlParams_.Set("alt", alt)
  115348. c.urlParams_.Set("prettyPrint", "false")
  115349. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetHttpsProxies/{resource}/testIamPermissions")
  115350. urls += "?" + c.urlParams_.Encode()
  115351. req, err := http.NewRequest("POST", urls, body)
  115352. if err != nil {
  115353. return nil, err
  115354. }
  115355. req.Header = reqHeaders
  115356. googleapi.Expand(req.URL, map[string]string{
  115357. "project": c.project,
  115358. "region": c.region,
  115359. "resource": c.resource,
  115360. })
  115361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115362. }
  115363. // Do executes the "compute.regionTargetHttpsProxies.testIamPermissions" call.
  115364. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  115365. // non-2xx status code is an error. Response headers are in either
  115366. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  115367. // returned at all) in error.(*googleapi.Error).Header. Use
  115368. // googleapi.IsNotModified to check whether the returned error was
  115369. // because http.StatusNotModified was returned.
  115370. func (c *RegionTargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  115371. gensupport.SetOptions(c.urlParams_, opts...)
  115372. res, err := c.doRequest("json")
  115373. if res != nil && res.StatusCode == http.StatusNotModified {
  115374. if res.Body != nil {
  115375. res.Body.Close()
  115376. }
  115377. return nil, &googleapi.Error{
  115378. Code: res.StatusCode,
  115379. Header: res.Header,
  115380. }
  115381. }
  115382. if err != nil {
  115383. return nil, err
  115384. }
  115385. defer googleapi.CloseBody(res)
  115386. if err := googleapi.CheckResponse(res); err != nil {
  115387. return nil, err
  115388. }
  115389. ret := &TestPermissionsResponse{
  115390. ServerResponse: googleapi.ServerResponse{
  115391. Header: res.Header,
  115392. HTTPStatusCode: res.StatusCode,
  115393. },
  115394. }
  115395. target := &ret
  115396. if err := gensupport.DecodeResponse(target, res); err != nil {
  115397. return nil, err
  115398. }
  115399. return ret, nil
  115400. // {
  115401. // "description": "Returns permissions that a caller has on the specified resource.",
  115402. // "httpMethod": "POST",
  115403. // "id": "compute.regionTargetHttpsProxies.testIamPermissions",
  115404. // "parameterOrder": [
  115405. // "project",
  115406. // "region",
  115407. // "resource"
  115408. // ],
  115409. // "parameters": {
  115410. // "project": {
  115411. // "description": "Project ID for this request.",
  115412. // "location": "path",
  115413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115414. // "required": true,
  115415. // "type": "string"
  115416. // },
  115417. // "region": {
  115418. // "description": "The name of the region for this request.",
  115419. // "location": "path",
  115420. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115421. // "required": true,
  115422. // "type": "string"
  115423. // },
  115424. // "resource": {
  115425. // "description": "Name or id of the resource for this request.",
  115426. // "location": "path",
  115427. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115428. // "required": true,
  115429. // "type": "string"
  115430. // }
  115431. // },
  115432. // "path": "{project}/regions/{region}/targetHttpsProxies/{resource}/testIamPermissions",
  115433. // "request": {
  115434. // "$ref": "TestPermissionsRequest"
  115435. // },
  115436. // "response": {
  115437. // "$ref": "TestPermissionsResponse"
  115438. // },
  115439. // "scopes": [
  115440. // "https://www.googleapis.com/auth/cloud-platform",
  115441. // "https://www.googleapis.com/auth/compute",
  115442. // "https://www.googleapis.com/auth/compute.readonly"
  115443. // ]
  115444. // }
  115445. }
  115446. // method id "compute.regionUrlMaps.delete":
  115447. type RegionUrlMapsDeleteCall struct {
  115448. s *Service
  115449. project string
  115450. region string
  115451. urlMap string
  115452. urlParams_ gensupport.URLParams
  115453. ctx_ context.Context
  115454. header_ http.Header
  115455. }
  115456. // Delete: Deletes the specified UrlMap resource.
  115457. func (r *RegionUrlMapsService) Delete(project string, region string, urlMap string) *RegionUrlMapsDeleteCall {
  115458. c := &RegionUrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115459. c.project = project
  115460. c.region = region
  115461. c.urlMap = urlMap
  115462. return c
  115463. }
  115464. // RequestId sets the optional parameter "requestId": begin_interface:
  115465. // MixerMutationRequestBuilder Request ID to support idempotency.
  115466. func (c *RegionUrlMapsDeleteCall) RequestId(requestId string) *RegionUrlMapsDeleteCall {
  115467. c.urlParams_.Set("requestId", requestId)
  115468. return c
  115469. }
  115470. // Fields allows partial responses to be retrieved. See
  115471. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115472. // for more information.
  115473. func (c *RegionUrlMapsDeleteCall) Fields(s ...googleapi.Field) *RegionUrlMapsDeleteCall {
  115474. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115475. return c
  115476. }
  115477. // Context sets the context to be used in this call's Do method. Any
  115478. // pending HTTP request will be aborted if the provided context is
  115479. // canceled.
  115480. func (c *RegionUrlMapsDeleteCall) Context(ctx context.Context) *RegionUrlMapsDeleteCall {
  115481. c.ctx_ = ctx
  115482. return c
  115483. }
  115484. // Header returns an http.Header that can be modified by the caller to
  115485. // add HTTP headers to the request.
  115486. func (c *RegionUrlMapsDeleteCall) Header() http.Header {
  115487. if c.header_ == nil {
  115488. c.header_ = make(http.Header)
  115489. }
  115490. return c.header_
  115491. }
  115492. func (c *RegionUrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  115493. reqHeaders := make(http.Header)
  115494. for k, v := range c.header_ {
  115495. reqHeaders[k] = v
  115496. }
  115497. reqHeaders.Set("User-Agent", c.s.userAgent())
  115498. var body io.Reader = nil
  115499. c.urlParams_.Set("alt", alt)
  115500. c.urlParams_.Set("prettyPrint", "false")
  115501. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  115502. urls += "?" + c.urlParams_.Encode()
  115503. req, err := http.NewRequest("DELETE", urls, body)
  115504. if err != nil {
  115505. return nil, err
  115506. }
  115507. req.Header = reqHeaders
  115508. googleapi.Expand(req.URL, map[string]string{
  115509. "project": c.project,
  115510. "region": c.region,
  115511. "urlMap": c.urlMap,
  115512. })
  115513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115514. }
  115515. // Do executes the "compute.regionUrlMaps.delete" call.
  115516. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115517. // status code is an error. Response headers are in either
  115518. // *Operation.ServerResponse.Header or (if a response was returned at
  115519. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115520. // to check whether the returned error was because
  115521. // http.StatusNotModified was returned.
  115522. func (c *RegionUrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115523. gensupport.SetOptions(c.urlParams_, opts...)
  115524. res, err := c.doRequest("json")
  115525. if res != nil && res.StatusCode == http.StatusNotModified {
  115526. if res.Body != nil {
  115527. res.Body.Close()
  115528. }
  115529. return nil, &googleapi.Error{
  115530. Code: res.StatusCode,
  115531. Header: res.Header,
  115532. }
  115533. }
  115534. if err != nil {
  115535. return nil, err
  115536. }
  115537. defer googleapi.CloseBody(res)
  115538. if err := googleapi.CheckResponse(res); err != nil {
  115539. return nil, err
  115540. }
  115541. ret := &Operation{
  115542. ServerResponse: googleapi.ServerResponse{
  115543. Header: res.Header,
  115544. HTTPStatusCode: res.StatusCode,
  115545. },
  115546. }
  115547. target := &ret
  115548. if err := gensupport.DecodeResponse(target, res); err != nil {
  115549. return nil, err
  115550. }
  115551. return ret, nil
  115552. // {
  115553. // "description": "Deletes the specified UrlMap resource.",
  115554. // "httpMethod": "DELETE",
  115555. // "id": "compute.regionUrlMaps.delete",
  115556. // "parameterOrder": [
  115557. // "project",
  115558. // "region",
  115559. // "urlMap"
  115560. // ],
  115561. // "parameters": {
  115562. // "project": {
  115563. // "description": "Project ID for this request.",
  115564. // "location": "path",
  115565. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115566. // "required": true,
  115567. // "type": "string"
  115568. // },
  115569. // "region": {
  115570. // "description": "Name of the region scoping this request.",
  115571. // "location": "path",
  115572. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115573. // "required": true,
  115574. // "type": "string"
  115575. // },
  115576. // "requestId": {
  115577. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  115578. // "location": "query",
  115579. // "type": "string"
  115580. // },
  115581. // "urlMap": {
  115582. // "description": "Name of the UrlMap resource to delete.",
  115583. // "location": "path",
  115584. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115585. // "required": true,
  115586. // "type": "string"
  115587. // }
  115588. // },
  115589. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  115590. // "response": {
  115591. // "$ref": "Operation"
  115592. // },
  115593. // "scopes": [
  115594. // "https://www.googleapis.com/auth/cloud-platform",
  115595. // "https://www.googleapis.com/auth/compute"
  115596. // ]
  115597. // }
  115598. }
  115599. // method id "compute.regionUrlMaps.get":
  115600. type RegionUrlMapsGetCall struct {
  115601. s *Service
  115602. project string
  115603. region string
  115604. urlMap string
  115605. urlParams_ gensupport.URLParams
  115606. ifNoneMatch_ string
  115607. ctx_ context.Context
  115608. header_ http.Header
  115609. }
  115610. // Get: Returns the specified UrlMap resource. Gets a list of available
  115611. // URL maps by making a list() request.
  115612. func (r *RegionUrlMapsService) Get(project string, region string, urlMap string) *RegionUrlMapsGetCall {
  115613. c := &RegionUrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115614. c.project = project
  115615. c.region = region
  115616. c.urlMap = urlMap
  115617. return c
  115618. }
  115619. // Fields allows partial responses to be retrieved. See
  115620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115621. // for more information.
  115622. func (c *RegionUrlMapsGetCall) Fields(s ...googleapi.Field) *RegionUrlMapsGetCall {
  115623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115624. return c
  115625. }
  115626. // IfNoneMatch sets the optional parameter which makes the operation
  115627. // fail if the object's ETag matches the given value. This is useful for
  115628. // getting updates only after the object has changed since the last
  115629. // request. Use googleapi.IsNotModified to check whether the response
  115630. // error from Do is the result of In-None-Match.
  115631. func (c *RegionUrlMapsGetCall) IfNoneMatch(entityTag string) *RegionUrlMapsGetCall {
  115632. c.ifNoneMatch_ = entityTag
  115633. return c
  115634. }
  115635. // Context sets the context to be used in this call's Do method. Any
  115636. // pending HTTP request will be aborted if the provided context is
  115637. // canceled.
  115638. func (c *RegionUrlMapsGetCall) Context(ctx context.Context) *RegionUrlMapsGetCall {
  115639. c.ctx_ = ctx
  115640. return c
  115641. }
  115642. // Header returns an http.Header that can be modified by the caller to
  115643. // add HTTP headers to the request.
  115644. func (c *RegionUrlMapsGetCall) Header() http.Header {
  115645. if c.header_ == nil {
  115646. c.header_ = make(http.Header)
  115647. }
  115648. return c.header_
  115649. }
  115650. func (c *RegionUrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  115651. reqHeaders := make(http.Header)
  115652. for k, v := range c.header_ {
  115653. reqHeaders[k] = v
  115654. }
  115655. reqHeaders.Set("User-Agent", c.s.userAgent())
  115656. if c.ifNoneMatch_ != "" {
  115657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  115658. }
  115659. var body io.Reader = nil
  115660. c.urlParams_.Set("alt", alt)
  115661. c.urlParams_.Set("prettyPrint", "false")
  115662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  115663. urls += "?" + c.urlParams_.Encode()
  115664. req, err := http.NewRequest("GET", urls, body)
  115665. if err != nil {
  115666. return nil, err
  115667. }
  115668. req.Header = reqHeaders
  115669. googleapi.Expand(req.URL, map[string]string{
  115670. "project": c.project,
  115671. "region": c.region,
  115672. "urlMap": c.urlMap,
  115673. })
  115674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115675. }
  115676. // Do executes the "compute.regionUrlMaps.get" call.
  115677. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  115678. // code is an error. Response headers are in either
  115679. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  115680. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  115681. // check whether the returned error was because http.StatusNotModified
  115682. // was returned.
  115683. func (c *RegionUrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  115684. gensupport.SetOptions(c.urlParams_, opts...)
  115685. res, err := c.doRequest("json")
  115686. if res != nil && res.StatusCode == http.StatusNotModified {
  115687. if res.Body != nil {
  115688. res.Body.Close()
  115689. }
  115690. return nil, &googleapi.Error{
  115691. Code: res.StatusCode,
  115692. Header: res.Header,
  115693. }
  115694. }
  115695. if err != nil {
  115696. return nil, err
  115697. }
  115698. defer googleapi.CloseBody(res)
  115699. if err := googleapi.CheckResponse(res); err != nil {
  115700. return nil, err
  115701. }
  115702. ret := &UrlMap{
  115703. ServerResponse: googleapi.ServerResponse{
  115704. Header: res.Header,
  115705. HTTPStatusCode: res.StatusCode,
  115706. },
  115707. }
  115708. target := &ret
  115709. if err := gensupport.DecodeResponse(target, res); err != nil {
  115710. return nil, err
  115711. }
  115712. return ret, nil
  115713. // {
  115714. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  115715. // "httpMethod": "GET",
  115716. // "id": "compute.regionUrlMaps.get",
  115717. // "parameterOrder": [
  115718. // "project",
  115719. // "region",
  115720. // "urlMap"
  115721. // ],
  115722. // "parameters": {
  115723. // "project": {
  115724. // "description": "Project ID for this request.",
  115725. // "location": "path",
  115726. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115727. // "required": true,
  115728. // "type": "string"
  115729. // },
  115730. // "region": {
  115731. // "description": "Name of the region scoping this request.",
  115732. // "location": "path",
  115733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115734. // "required": true,
  115735. // "type": "string"
  115736. // },
  115737. // "urlMap": {
  115738. // "description": "Name of the UrlMap resource to return.",
  115739. // "location": "path",
  115740. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  115741. // "required": true,
  115742. // "type": "string"
  115743. // }
  115744. // },
  115745. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  115746. // "response": {
  115747. // "$ref": "UrlMap"
  115748. // },
  115749. // "scopes": [
  115750. // "https://www.googleapis.com/auth/cloud-platform",
  115751. // "https://www.googleapis.com/auth/compute",
  115752. // "https://www.googleapis.com/auth/compute.readonly"
  115753. // ]
  115754. // }
  115755. }
  115756. // method id "compute.regionUrlMaps.insert":
  115757. type RegionUrlMapsInsertCall struct {
  115758. s *Service
  115759. project string
  115760. region string
  115761. urlmap *UrlMap
  115762. urlParams_ gensupport.URLParams
  115763. ctx_ context.Context
  115764. header_ http.Header
  115765. }
  115766. // Insert: Creates a UrlMap resource in the specified project using the
  115767. // data included in the request.
  115768. func (r *RegionUrlMapsService) Insert(project string, region string, urlmap *UrlMap) *RegionUrlMapsInsertCall {
  115769. c := &RegionUrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115770. c.project = project
  115771. c.region = region
  115772. c.urlmap = urlmap
  115773. return c
  115774. }
  115775. // RequestId sets the optional parameter "requestId": begin_interface:
  115776. // MixerMutationRequestBuilder Request ID to support idempotency.
  115777. func (c *RegionUrlMapsInsertCall) RequestId(requestId string) *RegionUrlMapsInsertCall {
  115778. c.urlParams_.Set("requestId", requestId)
  115779. return c
  115780. }
  115781. // Fields allows partial responses to be retrieved. See
  115782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115783. // for more information.
  115784. func (c *RegionUrlMapsInsertCall) Fields(s ...googleapi.Field) *RegionUrlMapsInsertCall {
  115785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115786. return c
  115787. }
  115788. // Context sets the context to be used in this call's Do method. Any
  115789. // pending HTTP request will be aborted if the provided context is
  115790. // canceled.
  115791. func (c *RegionUrlMapsInsertCall) Context(ctx context.Context) *RegionUrlMapsInsertCall {
  115792. c.ctx_ = ctx
  115793. return c
  115794. }
  115795. // Header returns an http.Header that can be modified by the caller to
  115796. // add HTTP headers to the request.
  115797. func (c *RegionUrlMapsInsertCall) Header() http.Header {
  115798. if c.header_ == nil {
  115799. c.header_ = make(http.Header)
  115800. }
  115801. return c.header_
  115802. }
  115803. func (c *RegionUrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  115804. reqHeaders := make(http.Header)
  115805. for k, v := range c.header_ {
  115806. reqHeaders[k] = v
  115807. }
  115808. reqHeaders.Set("User-Agent", c.s.userAgent())
  115809. var body io.Reader = nil
  115810. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  115811. if err != nil {
  115812. return nil, err
  115813. }
  115814. reqHeaders.Set("Content-Type", "application/json")
  115815. c.urlParams_.Set("alt", alt)
  115816. c.urlParams_.Set("prettyPrint", "false")
  115817. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps")
  115818. urls += "?" + c.urlParams_.Encode()
  115819. req, err := http.NewRequest("POST", urls, body)
  115820. if err != nil {
  115821. return nil, err
  115822. }
  115823. req.Header = reqHeaders
  115824. googleapi.Expand(req.URL, map[string]string{
  115825. "project": c.project,
  115826. "region": c.region,
  115827. })
  115828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115829. }
  115830. // Do executes the "compute.regionUrlMaps.insert" call.
  115831. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115832. // status code is an error. Response headers are in either
  115833. // *Operation.ServerResponse.Header or (if a response was returned at
  115834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115835. // to check whether the returned error was because
  115836. // http.StatusNotModified was returned.
  115837. func (c *RegionUrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115838. gensupport.SetOptions(c.urlParams_, opts...)
  115839. res, err := c.doRequest("json")
  115840. if res != nil && res.StatusCode == http.StatusNotModified {
  115841. if res.Body != nil {
  115842. res.Body.Close()
  115843. }
  115844. return nil, &googleapi.Error{
  115845. Code: res.StatusCode,
  115846. Header: res.Header,
  115847. }
  115848. }
  115849. if err != nil {
  115850. return nil, err
  115851. }
  115852. defer googleapi.CloseBody(res)
  115853. if err := googleapi.CheckResponse(res); err != nil {
  115854. return nil, err
  115855. }
  115856. ret := &Operation{
  115857. ServerResponse: googleapi.ServerResponse{
  115858. Header: res.Header,
  115859. HTTPStatusCode: res.StatusCode,
  115860. },
  115861. }
  115862. target := &ret
  115863. if err := gensupport.DecodeResponse(target, res); err != nil {
  115864. return nil, err
  115865. }
  115866. return ret, nil
  115867. // {
  115868. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  115869. // "httpMethod": "POST",
  115870. // "id": "compute.regionUrlMaps.insert",
  115871. // "parameterOrder": [
  115872. // "project",
  115873. // "region"
  115874. // ],
  115875. // "parameters": {
  115876. // "project": {
  115877. // "description": "Project ID for this request.",
  115878. // "location": "path",
  115879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  115880. // "required": true,
  115881. // "type": "string"
  115882. // },
  115883. // "region": {
  115884. // "description": "Name of the region scoping this request.",
  115885. // "location": "path",
  115886. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  115887. // "required": true,
  115888. // "type": "string"
  115889. // },
  115890. // "requestId": {
  115891. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  115892. // "location": "query",
  115893. // "type": "string"
  115894. // }
  115895. // },
  115896. // "path": "{project}/regions/{region}/urlMaps",
  115897. // "request": {
  115898. // "$ref": "UrlMap"
  115899. // },
  115900. // "response": {
  115901. // "$ref": "Operation"
  115902. // },
  115903. // "scopes": [
  115904. // "https://www.googleapis.com/auth/cloud-platform",
  115905. // "https://www.googleapis.com/auth/compute"
  115906. // ]
  115907. // }
  115908. }
  115909. // method id "compute.regionUrlMaps.invalidateCache":
  115910. type RegionUrlMapsInvalidateCacheCall struct {
  115911. s *Service
  115912. project string
  115913. region string
  115914. urlMap string
  115915. cacheinvalidationrule *CacheInvalidationRule
  115916. urlParams_ gensupport.URLParams
  115917. ctx_ context.Context
  115918. header_ http.Header
  115919. }
  115920. // InvalidateCache: Initiates a cache invalidation operation,
  115921. // invalidating the specified path, scoped to the specified UrlMap.
  115922. func (r *RegionUrlMapsService) InvalidateCache(project string, region string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *RegionUrlMapsInvalidateCacheCall {
  115923. c := &RegionUrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  115924. c.project = project
  115925. c.region = region
  115926. c.urlMap = urlMap
  115927. c.cacheinvalidationrule = cacheinvalidationrule
  115928. return c
  115929. }
  115930. // RequestId sets the optional parameter "requestId": begin_interface:
  115931. // MixerMutationRequestBuilder Request ID to support idempotency.
  115932. func (c *RegionUrlMapsInvalidateCacheCall) RequestId(requestId string) *RegionUrlMapsInvalidateCacheCall {
  115933. c.urlParams_.Set("requestId", requestId)
  115934. return c
  115935. }
  115936. // Fields allows partial responses to be retrieved. See
  115937. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  115938. // for more information.
  115939. func (c *RegionUrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *RegionUrlMapsInvalidateCacheCall {
  115940. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  115941. return c
  115942. }
  115943. // Context sets the context to be used in this call's Do method. Any
  115944. // pending HTTP request will be aborted if the provided context is
  115945. // canceled.
  115946. func (c *RegionUrlMapsInvalidateCacheCall) Context(ctx context.Context) *RegionUrlMapsInvalidateCacheCall {
  115947. c.ctx_ = ctx
  115948. return c
  115949. }
  115950. // Header returns an http.Header that can be modified by the caller to
  115951. // add HTTP headers to the request.
  115952. func (c *RegionUrlMapsInvalidateCacheCall) Header() http.Header {
  115953. if c.header_ == nil {
  115954. c.header_ = make(http.Header)
  115955. }
  115956. return c.header_
  115957. }
  115958. func (c *RegionUrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  115959. reqHeaders := make(http.Header)
  115960. for k, v := range c.header_ {
  115961. reqHeaders[k] = v
  115962. }
  115963. reqHeaders.Set("User-Agent", c.s.userAgent())
  115964. var body io.Reader = nil
  115965. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  115966. if err != nil {
  115967. return nil, err
  115968. }
  115969. reqHeaders.Set("Content-Type", "application/json")
  115970. c.urlParams_.Set("alt", alt)
  115971. c.urlParams_.Set("prettyPrint", "false")
  115972. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}/invalidateCache")
  115973. urls += "?" + c.urlParams_.Encode()
  115974. req, err := http.NewRequest("POST", urls, body)
  115975. if err != nil {
  115976. return nil, err
  115977. }
  115978. req.Header = reqHeaders
  115979. googleapi.Expand(req.URL, map[string]string{
  115980. "project": c.project,
  115981. "region": c.region,
  115982. "urlMap": c.urlMap,
  115983. })
  115984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  115985. }
  115986. // Do executes the "compute.regionUrlMaps.invalidateCache" call.
  115987. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  115988. // status code is an error. Response headers are in either
  115989. // *Operation.ServerResponse.Header or (if a response was returned at
  115990. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  115991. // to check whether the returned error was because
  115992. // http.StatusNotModified was returned.
  115993. func (c *RegionUrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  115994. gensupport.SetOptions(c.urlParams_, opts...)
  115995. res, err := c.doRequest("json")
  115996. if res != nil && res.StatusCode == http.StatusNotModified {
  115997. if res.Body != nil {
  115998. res.Body.Close()
  115999. }
  116000. return nil, &googleapi.Error{
  116001. Code: res.StatusCode,
  116002. Header: res.Header,
  116003. }
  116004. }
  116005. if err != nil {
  116006. return nil, err
  116007. }
  116008. defer googleapi.CloseBody(res)
  116009. if err := googleapi.CheckResponse(res); err != nil {
  116010. return nil, err
  116011. }
  116012. ret := &Operation{
  116013. ServerResponse: googleapi.ServerResponse{
  116014. Header: res.Header,
  116015. HTTPStatusCode: res.StatusCode,
  116016. },
  116017. }
  116018. target := &ret
  116019. if err := gensupport.DecodeResponse(target, res); err != nil {
  116020. return nil, err
  116021. }
  116022. return ret, nil
  116023. // {
  116024. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  116025. // "httpMethod": "POST",
  116026. // "id": "compute.regionUrlMaps.invalidateCache",
  116027. // "parameterOrder": [
  116028. // "project",
  116029. // "region",
  116030. // "urlMap"
  116031. // ],
  116032. // "parameters": {
  116033. // "project": {
  116034. // "description": "Project ID for this request.",
  116035. // "location": "path",
  116036. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116037. // "required": true,
  116038. // "type": "string"
  116039. // },
  116040. // "region": {
  116041. // "description": "Name of the region scoping this request.",
  116042. // "location": "path",
  116043. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116044. // "required": true,
  116045. // "type": "string"
  116046. // },
  116047. // "requestId": {
  116048. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  116049. // "location": "query",
  116050. // "type": "string"
  116051. // },
  116052. // "urlMap": {
  116053. // "description": "Name of the UrlMap scoping this request.",
  116054. // "location": "path",
  116055. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116056. // "required": true,
  116057. // "type": "string"
  116058. // }
  116059. // },
  116060. // "path": "{project}/regions/{region}/urlMaps/{urlMap}/invalidateCache",
  116061. // "request": {
  116062. // "$ref": "CacheInvalidationRule"
  116063. // },
  116064. // "response": {
  116065. // "$ref": "Operation"
  116066. // },
  116067. // "scopes": [
  116068. // "https://www.googleapis.com/auth/cloud-platform",
  116069. // "https://www.googleapis.com/auth/compute"
  116070. // ]
  116071. // }
  116072. }
  116073. // method id "compute.regionUrlMaps.list":
  116074. type RegionUrlMapsListCall struct {
  116075. s *Service
  116076. project string
  116077. region string
  116078. urlParams_ gensupport.URLParams
  116079. ifNoneMatch_ string
  116080. ctx_ context.Context
  116081. header_ http.Header
  116082. }
  116083. // List: Retrieves the list of UrlMap resources available to the
  116084. // specified project in the specified region.
  116085. func (r *RegionUrlMapsService) List(project string, region string) *RegionUrlMapsListCall {
  116086. c := &RegionUrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116087. c.project = project
  116088. c.region = region
  116089. return c
  116090. }
  116091. // Filter sets the optional parameter "filter": A filter expression that
  116092. // filters resources listed in the response. The expression must specify
  116093. // the field name, a comparison operator, and the value that you want to
  116094. // use for filtering. The value must be a string, a number, or a
  116095. // boolean. The comparison operator must be either =, !=, >, or <.
  116096. //
  116097. // For example, if you are filtering Compute Engine instances, you can
  116098. // exclude instances named example-instance by specifying name !=
  116099. // example-instance.
  116100. //
  116101. // You can also filter nested fields. For example, you could specify
  116102. // scheduling.automaticRestart = false to include instances only if they
  116103. // are not scheduled for automatic restarts. You can use filtering on
  116104. // nested fields to filter based on resource labels.
  116105. //
  116106. // To filter on multiple expressions, provide each separate expression
  116107. // within parentheses. For example, (scheduling.automaticRestart = true)
  116108. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  116109. // AND expression. However, you can include AND and OR expressions
  116110. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  116111. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  116112. // true).
  116113. func (c *RegionUrlMapsListCall) Filter(filter string) *RegionUrlMapsListCall {
  116114. c.urlParams_.Set("filter", filter)
  116115. return c
  116116. }
  116117. // MaxResults sets the optional parameter "maxResults": The maximum
  116118. // number of results per page that should be returned. If the number of
  116119. // available results is larger than maxResults, Compute Engine returns a
  116120. // nextPageToken that can be used to get the next page of results in
  116121. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  116122. // (Default: 500)
  116123. func (c *RegionUrlMapsListCall) MaxResults(maxResults int64) *RegionUrlMapsListCall {
  116124. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  116125. return c
  116126. }
  116127. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  116128. // a certain order. By default, results are returned in alphanumerical
  116129. // order based on the resource name.
  116130. //
  116131. // You can also sort results in descending order based on the creation
  116132. // timestamp using orderBy="creationTimestamp desc". This sorts results
  116133. // based on the creationTimestamp field in reverse chronological order
  116134. // (newest result first). Use this to sort resources like operations so
  116135. // that the newest operation is returned first.
  116136. //
  116137. // Currently, only sorting by name or creationTimestamp desc is
  116138. // supported.
  116139. func (c *RegionUrlMapsListCall) OrderBy(orderBy string) *RegionUrlMapsListCall {
  116140. c.urlParams_.Set("orderBy", orderBy)
  116141. return c
  116142. }
  116143. // PageToken sets the optional parameter "pageToken": Specifies a page
  116144. // token to use. Set pageToken to the nextPageToken returned by a
  116145. // previous list request to get the next page of results.
  116146. func (c *RegionUrlMapsListCall) PageToken(pageToken string) *RegionUrlMapsListCall {
  116147. c.urlParams_.Set("pageToken", pageToken)
  116148. return c
  116149. }
  116150. // Fields allows partial responses to be retrieved. See
  116151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116152. // for more information.
  116153. func (c *RegionUrlMapsListCall) Fields(s ...googleapi.Field) *RegionUrlMapsListCall {
  116154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116155. return c
  116156. }
  116157. // IfNoneMatch sets the optional parameter which makes the operation
  116158. // fail if the object's ETag matches the given value. This is useful for
  116159. // getting updates only after the object has changed since the last
  116160. // request. Use googleapi.IsNotModified to check whether the response
  116161. // error from Do is the result of In-None-Match.
  116162. func (c *RegionUrlMapsListCall) IfNoneMatch(entityTag string) *RegionUrlMapsListCall {
  116163. c.ifNoneMatch_ = entityTag
  116164. return c
  116165. }
  116166. // Context sets the context to be used in this call's Do method. Any
  116167. // pending HTTP request will be aborted if the provided context is
  116168. // canceled.
  116169. func (c *RegionUrlMapsListCall) Context(ctx context.Context) *RegionUrlMapsListCall {
  116170. c.ctx_ = ctx
  116171. return c
  116172. }
  116173. // Header returns an http.Header that can be modified by the caller to
  116174. // add HTTP headers to the request.
  116175. func (c *RegionUrlMapsListCall) Header() http.Header {
  116176. if c.header_ == nil {
  116177. c.header_ = make(http.Header)
  116178. }
  116179. return c.header_
  116180. }
  116181. func (c *RegionUrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  116182. reqHeaders := make(http.Header)
  116183. for k, v := range c.header_ {
  116184. reqHeaders[k] = v
  116185. }
  116186. reqHeaders.Set("User-Agent", c.s.userAgent())
  116187. if c.ifNoneMatch_ != "" {
  116188. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  116189. }
  116190. var body io.Reader = nil
  116191. c.urlParams_.Set("alt", alt)
  116192. c.urlParams_.Set("prettyPrint", "false")
  116193. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps")
  116194. urls += "?" + c.urlParams_.Encode()
  116195. req, err := http.NewRequest("GET", urls, body)
  116196. if err != nil {
  116197. return nil, err
  116198. }
  116199. req.Header = reqHeaders
  116200. googleapi.Expand(req.URL, map[string]string{
  116201. "project": c.project,
  116202. "region": c.region,
  116203. })
  116204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116205. }
  116206. // Do executes the "compute.regionUrlMaps.list" call.
  116207. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  116208. // status code is an error. Response headers are in either
  116209. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  116210. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116211. // to check whether the returned error was because
  116212. // http.StatusNotModified was returned.
  116213. func (c *RegionUrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  116214. gensupport.SetOptions(c.urlParams_, opts...)
  116215. res, err := c.doRequest("json")
  116216. if res != nil && res.StatusCode == http.StatusNotModified {
  116217. if res.Body != nil {
  116218. res.Body.Close()
  116219. }
  116220. return nil, &googleapi.Error{
  116221. Code: res.StatusCode,
  116222. Header: res.Header,
  116223. }
  116224. }
  116225. if err != nil {
  116226. return nil, err
  116227. }
  116228. defer googleapi.CloseBody(res)
  116229. if err := googleapi.CheckResponse(res); err != nil {
  116230. return nil, err
  116231. }
  116232. ret := &UrlMapList{
  116233. ServerResponse: googleapi.ServerResponse{
  116234. Header: res.Header,
  116235. HTTPStatusCode: res.StatusCode,
  116236. },
  116237. }
  116238. target := &ret
  116239. if err := gensupport.DecodeResponse(target, res); err != nil {
  116240. return nil, err
  116241. }
  116242. return ret, nil
  116243. // {
  116244. // "description": "Retrieves the list of UrlMap resources available to the specified project in the specified region.",
  116245. // "httpMethod": "GET",
  116246. // "id": "compute.regionUrlMaps.list",
  116247. // "parameterOrder": [
  116248. // "project",
  116249. // "region"
  116250. // ],
  116251. // "parameters": {
  116252. // "filter": {
  116253. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  116254. // "location": "query",
  116255. // "type": "string"
  116256. // },
  116257. // "maxResults": {
  116258. // "default": "500",
  116259. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  116260. // "format": "uint32",
  116261. // "location": "query",
  116262. // "minimum": "0",
  116263. // "type": "integer"
  116264. // },
  116265. // "orderBy": {
  116266. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  116267. // "location": "query",
  116268. // "type": "string"
  116269. // },
  116270. // "pageToken": {
  116271. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  116272. // "location": "query",
  116273. // "type": "string"
  116274. // },
  116275. // "project": {
  116276. // "description": "Project ID for this request.",
  116277. // "location": "path",
  116278. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116279. // "required": true,
  116280. // "type": "string"
  116281. // },
  116282. // "region": {
  116283. // "description": "Name of the region scoping this request.",
  116284. // "location": "path",
  116285. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116286. // "required": true,
  116287. // "type": "string"
  116288. // }
  116289. // },
  116290. // "path": "{project}/regions/{region}/urlMaps",
  116291. // "response": {
  116292. // "$ref": "UrlMapList"
  116293. // },
  116294. // "scopes": [
  116295. // "https://www.googleapis.com/auth/cloud-platform",
  116296. // "https://www.googleapis.com/auth/compute",
  116297. // "https://www.googleapis.com/auth/compute.readonly"
  116298. // ]
  116299. // }
  116300. }
  116301. // Pages invokes f for each page of results.
  116302. // A non-nil error returned from f will halt the iteration.
  116303. // The provided context supersedes any context provided to the Context method.
  116304. func (c *RegionUrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  116305. c.ctx_ = ctx
  116306. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  116307. for {
  116308. x, err := c.Do()
  116309. if err != nil {
  116310. return err
  116311. }
  116312. if err := f(x); err != nil {
  116313. return err
  116314. }
  116315. if x.NextPageToken == "" {
  116316. return nil
  116317. }
  116318. c.PageToken(x.NextPageToken)
  116319. }
  116320. }
  116321. // method id "compute.regionUrlMaps.patch":
  116322. type RegionUrlMapsPatchCall struct {
  116323. s *Service
  116324. project string
  116325. region string
  116326. urlMap string
  116327. urlmap *UrlMap
  116328. urlParams_ gensupport.URLParams
  116329. ctx_ context.Context
  116330. header_ http.Header
  116331. }
  116332. // Patch: Patches the specified UrlMap resource with the data included
  116333. // in the request. This method supports PATCH semantics and uses JSON
  116334. // merge patch format and processing rules.
  116335. func (r *RegionUrlMapsService) Patch(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsPatchCall {
  116336. c := &RegionUrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116337. c.project = project
  116338. c.region = region
  116339. c.urlMap = urlMap
  116340. c.urlmap = urlmap
  116341. return c
  116342. }
  116343. // RequestId sets the optional parameter "requestId": begin_interface:
  116344. // MixerMutationRequestBuilder Request ID to support idempotency.
  116345. func (c *RegionUrlMapsPatchCall) RequestId(requestId string) *RegionUrlMapsPatchCall {
  116346. c.urlParams_.Set("requestId", requestId)
  116347. return c
  116348. }
  116349. // Fields allows partial responses to be retrieved. See
  116350. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116351. // for more information.
  116352. func (c *RegionUrlMapsPatchCall) Fields(s ...googleapi.Field) *RegionUrlMapsPatchCall {
  116353. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116354. return c
  116355. }
  116356. // Context sets the context to be used in this call's Do method. Any
  116357. // pending HTTP request will be aborted if the provided context is
  116358. // canceled.
  116359. func (c *RegionUrlMapsPatchCall) Context(ctx context.Context) *RegionUrlMapsPatchCall {
  116360. c.ctx_ = ctx
  116361. return c
  116362. }
  116363. // Header returns an http.Header that can be modified by the caller to
  116364. // add HTTP headers to the request.
  116365. func (c *RegionUrlMapsPatchCall) Header() http.Header {
  116366. if c.header_ == nil {
  116367. c.header_ = make(http.Header)
  116368. }
  116369. return c.header_
  116370. }
  116371. func (c *RegionUrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  116372. reqHeaders := make(http.Header)
  116373. for k, v := range c.header_ {
  116374. reqHeaders[k] = v
  116375. }
  116376. reqHeaders.Set("User-Agent", c.s.userAgent())
  116377. var body io.Reader = nil
  116378. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  116379. if err != nil {
  116380. return nil, err
  116381. }
  116382. reqHeaders.Set("Content-Type", "application/json")
  116383. c.urlParams_.Set("alt", alt)
  116384. c.urlParams_.Set("prettyPrint", "false")
  116385. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  116386. urls += "?" + c.urlParams_.Encode()
  116387. req, err := http.NewRequest("PATCH", urls, body)
  116388. if err != nil {
  116389. return nil, err
  116390. }
  116391. req.Header = reqHeaders
  116392. googleapi.Expand(req.URL, map[string]string{
  116393. "project": c.project,
  116394. "region": c.region,
  116395. "urlMap": c.urlMap,
  116396. })
  116397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116398. }
  116399. // Do executes the "compute.regionUrlMaps.patch" call.
  116400. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116401. // status code is an error. Response headers are in either
  116402. // *Operation.ServerResponse.Header or (if a response was returned at
  116403. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116404. // to check whether the returned error was because
  116405. // http.StatusNotModified was returned.
  116406. func (c *RegionUrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116407. gensupport.SetOptions(c.urlParams_, opts...)
  116408. res, err := c.doRequest("json")
  116409. if res != nil && res.StatusCode == http.StatusNotModified {
  116410. if res.Body != nil {
  116411. res.Body.Close()
  116412. }
  116413. return nil, &googleapi.Error{
  116414. Code: res.StatusCode,
  116415. Header: res.Header,
  116416. }
  116417. }
  116418. if err != nil {
  116419. return nil, err
  116420. }
  116421. defer googleapi.CloseBody(res)
  116422. if err := googleapi.CheckResponse(res); err != nil {
  116423. return nil, err
  116424. }
  116425. ret := &Operation{
  116426. ServerResponse: googleapi.ServerResponse{
  116427. Header: res.Header,
  116428. HTTPStatusCode: res.StatusCode,
  116429. },
  116430. }
  116431. target := &ret
  116432. if err := gensupport.DecodeResponse(target, res); err != nil {
  116433. return nil, err
  116434. }
  116435. return ret, nil
  116436. // {
  116437. // "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
  116438. // "httpMethod": "PATCH",
  116439. // "id": "compute.regionUrlMaps.patch",
  116440. // "parameterOrder": [
  116441. // "project",
  116442. // "region",
  116443. // "urlMap"
  116444. // ],
  116445. // "parameters": {
  116446. // "project": {
  116447. // "description": "Project ID for this request.",
  116448. // "location": "path",
  116449. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116450. // "required": true,
  116451. // "type": "string"
  116452. // },
  116453. // "region": {
  116454. // "description": "Name of the region scoping this request.",
  116455. // "location": "path",
  116456. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116457. // "required": true,
  116458. // "type": "string"
  116459. // },
  116460. // "requestId": {
  116461. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  116462. // "location": "query",
  116463. // "type": "string"
  116464. // },
  116465. // "urlMap": {
  116466. // "description": "Name of the UrlMap resource to patch.",
  116467. // "location": "path",
  116468. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116469. // "required": true,
  116470. // "type": "string"
  116471. // }
  116472. // },
  116473. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  116474. // "request": {
  116475. // "$ref": "UrlMap"
  116476. // },
  116477. // "response": {
  116478. // "$ref": "Operation"
  116479. // },
  116480. // "scopes": [
  116481. // "https://www.googleapis.com/auth/cloud-platform",
  116482. // "https://www.googleapis.com/auth/compute"
  116483. // ]
  116484. // }
  116485. }
  116486. // method id "compute.regionUrlMaps.testIamPermissions":
  116487. type RegionUrlMapsTestIamPermissionsCall struct {
  116488. s *Service
  116489. project string
  116490. region string
  116491. resource string
  116492. testpermissionsrequest *TestPermissionsRequest
  116493. urlParams_ gensupport.URLParams
  116494. ctx_ context.Context
  116495. header_ http.Header
  116496. }
  116497. // TestIamPermissions: Returns permissions that a caller has on the
  116498. // specified resource.
  116499. func (r *RegionUrlMapsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionUrlMapsTestIamPermissionsCall {
  116500. c := &RegionUrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116501. c.project = project
  116502. c.region = region
  116503. c.resource = resource
  116504. c.testpermissionsrequest = testpermissionsrequest
  116505. return c
  116506. }
  116507. // Fields allows partial responses to be retrieved. See
  116508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116509. // for more information.
  116510. func (c *RegionUrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionUrlMapsTestIamPermissionsCall {
  116511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116512. return c
  116513. }
  116514. // Context sets the context to be used in this call's Do method. Any
  116515. // pending HTTP request will be aborted if the provided context is
  116516. // canceled.
  116517. func (c *RegionUrlMapsTestIamPermissionsCall) Context(ctx context.Context) *RegionUrlMapsTestIamPermissionsCall {
  116518. c.ctx_ = ctx
  116519. return c
  116520. }
  116521. // Header returns an http.Header that can be modified by the caller to
  116522. // add HTTP headers to the request.
  116523. func (c *RegionUrlMapsTestIamPermissionsCall) Header() http.Header {
  116524. if c.header_ == nil {
  116525. c.header_ = make(http.Header)
  116526. }
  116527. return c.header_
  116528. }
  116529. func (c *RegionUrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  116530. reqHeaders := make(http.Header)
  116531. for k, v := range c.header_ {
  116532. reqHeaders[k] = v
  116533. }
  116534. reqHeaders.Set("User-Agent", c.s.userAgent())
  116535. var body io.Reader = nil
  116536. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  116537. if err != nil {
  116538. return nil, err
  116539. }
  116540. reqHeaders.Set("Content-Type", "application/json")
  116541. c.urlParams_.Set("alt", alt)
  116542. c.urlParams_.Set("prettyPrint", "false")
  116543. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{resource}/testIamPermissions")
  116544. urls += "?" + c.urlParams_.Encode()
  116545. req, err := http.NewRequest("POST", urls, body)
  116546. if err != nil {
  116547. return nil, err
  116548. }
  116549. req.Header = reqHeaders
  116550. googleapi.Expand(req.URL, map[string]string{
  116551. "project": c.project,
  116552. "region": c.region,
  116553. "resource": c.resource,
  116554. })
  116555. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116556. }
  116557. // Do executes the "compute.regionUrlMaps.testIamPermissions" call.
  116558. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  116559. // non-2xx status code is an error. Response headers are in either
  116560. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  116561. // returned at all) in error.(*googleapi.Error).Header. Use
  116562. // googleapi.IsNotModified to check whether the returned error was
  116563. // because http.StatusNotModified was returned.
  116564. func (c *RegionUrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  116565. gensupport.SetOptions(c.urlParams_, opts...)
  116566. res, err := c.doRequest("json")
  116567. if res != nil && res.StatusCode == http.StatusNotModified {
  116568. if res.Body != nil {
  116569. res.Body.Close()
  116570. }
  116571. return nil, &googleapi.Error{
  116572. Code: res.StatusCode,
  116573. Header: res.Header,
  116574. }
  116575. }
  116576. if err != nil {
  116577. return nil, err
  116578. }
  116579. defer googleapi.CloseBody(res)
  116580. if err := googleapi.CheckResponse(res); err != nil {
  116581. return nil, err
  116582. }
  116583. ret := &TestPermissionsResponse{
  116584. ServerResponse: googleapi.ServerResponse{
  116585. Header: res.Header,
  116586. HTTPStatusCode: res.StatusCode,
  116587. },
  116588. }
  116589. target := &ret
  116590. if err := gensupport.DecodeResponse(target, res); err != nil {
  116591. return nil, err
  116592. }
  116593. return ret, nil
  116594. // {
  116595. // "description": "Returns permissions that a caller has on the specified resource.",
  116596. // "httpMethod": "POST",
  116597. // "id": "compute.regionUrlMaps.testIamPermissions",
  116598. // "parameterOrder": [
  116599. // "project",
  116600. // "region",
  116601. // "resource"
  116602. // ],
  116603. // "parameters": {
  116604. // "project": {
  116605. // "description": "Project ID for this request.",
  116606. // "location": "path",
  116607. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116608. // "required": true,
  116609. // "type": "string"
  116610. // },
  116611. // "region": {
  116612. // "description": "The name of the region for this request.",
  116613. // "location": "path",
  116614. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116615. // "required": true,
  116616. // "type": "string"
  116617. // },
  116618. // "resource": {
  116619. // "description": "Name or id of the resource for this request.",
  116620. // "location": "path",
  116621. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116622. // "required": true,
  116623. // "type": "string"
  116624. // }
  116625. // },
  116626. // "path": "{project}/regions/{region}/urlMaps/{resource}/testIamPermissions",
  116627. // "request": {
  116628. // "$ref": "TestPermissionsRequest"
  116629. // },
  116630. // "response": {
  116631. // "$ref": "TestPermissionsResponse"
  116632. // },
  116633. // "scopes": [
  116634. // "https://www.googleapis.com/auth/cloud-platform",
  116635. // "https://www.googleapis.com/auth/compute",
  116636. // "https://www.googleapis.com/auth/compute.readonly"
  116637. // ]
  116638. // }
  116639. }
  116640. // method id "compute.regionUrlMaps.update":
  116641. type RegionUrlMapsUpdateCall struct {
  116642. s *Service
  116643. project string
  116644. region string
  116645. urlMap string
  116646. urlmap *UrlMap
  116647. urlParams_ gensupport.URLParams
  116648. ctx_ context.Context
  116649. header_ http.Header
  116650. }
  116651. // Update: Updates the specified UrlMap resource with the data included
  116652. // in the request.
  116653. func (r *RegionUrlMapsService) Update(project string, region string, urlMap string, urlmap *UrlMap) *RegionUrlMapsUpdateCall {
  116654. c := &RegionUrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116655. c.project = project
  116656. c.region = region
  116657. c.urlMap = urlMap
  116658. c.urlmap = urlmap
  116659. return c
  116660. }
  116661. // RequestId sets the optional parameter "requestId": begin_interface:
  116662. // MixerMutationRequestBuilder Request ID to support idempotency.
  116663. func (c *RegionUrlMapsUpdateCall) RequestId(requestId string) *RegionUrlMapsUpdateCall {
  116664. c.urlParams_.Set("requestId", requestId)
  116665. return c
  116666. }
  116667. // Fields allows partial responses to be retrieved. See
  116668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116669. // for more information.
  116670. func (c *RegionUrlMapsUpdateCall) Fields(s ...googleapi.Field) *RegionUrlMapsUpdateCall {
  116671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116672. return c
  116673. }
  116674. // Context sets the context to be used in this call's Do method. Any
  116675. // pending HTTP request will be aborted if the provided context is
  116676. // canceled.
  116677. func (c *RegionUrlMapsUpdateCall) Context(ctx context.Context) *RegionUrlMapsUpdateCall {
  116678. c.ctx_ = ctx
  116679. return c
  116680. }
  116681. // Header returns an http.Header that can be modified by the caller to
  116682. // add HTTP headers to the request.
  116683. func (c *RegionUrlMapsUpdateCall) Header() http.Header {
  116684. if c.header_ == nil {
  116685. c.header_ = make(http.Header)
  116686. }
  116687. return c.header_
  116688. }
  116689. func (c *RegionUrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  116690. reqHeaders := make(http.Header)
  116691. for k, v := range c.header_ {
  116692. reqHeaders[k] = v
  116693. }
  116694. reqHeaders.Set("User-Agent", c.s.userAgent())
  116695. var body io.Reader = nil
  116696. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  116697. if err != nil {
  116698. return nil, err
  116699. }
  116700. reqHeaders.Set("Content-Type", "application/json")
  116701. c.urlParams_.Set("alt", alt)
  116702. c.urlParams_.Set("prettyPrint", "false")
  116703. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}")
  116704. urls += "?" + c.urlParams_.Encode()
  116705. req, err := http.NewRequest("PUT", urls, body)
  116706. if err != nil {
  116707. return nil, err
  116708. }
  116709. req.Header = reqHeaders
  116710. googleapi.Expand(req.URL, map[string]string{
  116711. "project": c.project,
  116712. "region": c.region,
  116713. "urlMap": c.urlMap,
  116714. })
  116715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116716. }
  116717. // Do executes the "compute.regionUrlMaps.update" call.
  116718. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  116719. // status code is an error. Response headers are in either
  116720. // *Operation.ServerResponse.Header or (if a response was returned at
  116721. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  116722. // to check whether the returned error was because
  116723. // http.StatusNotModified was returned.
  116724. func (c *RegionUrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  116725. gensupport.SetOptions(c.urlParams_, opts...)
  116726. res, err := c.doRequest("json")
  116727. if res != nil && res.StatusCode == http.StatusNotModified {
  116728. if res.Body != nil {
  116729. res.Body.Close()
  116730. }
  116731. return nil, &googleapi.Error{
  116732. Code: res.StatusCode,
  116733. Header: res.Header,
  116734. }
  116735. }
  116736. if err != nil {
  116737. return nil, err
  116738. }
  116739. defer googleapi.CloseBody(res)
  116740. if err := googleapi.CheckResponse(res); err != nil {
  116741. return nil, err
  116742. }
  116743. ret := &Operation{
  116744. ServerResponse: googleapi.ServerResponse{
  116745. Header: res.Header,
  116746. HTTPStatusCode: res.StatusCode,
  116747. },
  116748. }
  116749. target := &ret
  116750. if err := gensupport.DecodeResponse(target, res); err != nil {
  116751. return nil, err
  116752. }
  116753. return ret, nil
  116754. // {
  116755. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  116756. // "httpMethod": "PUT",
  116757. // "id": "compute.regionUrlMaps.update",
  116758. // "parameterOrder": [
  116759. // "project",
  116760. // "region",
  116761. // "urlMap"
  116762. // ],
  116763. // "parameters": {
  116764. // "project": {
  116765. // "description": "Project ID for this request.",
  116766. // "location": "path",
  116767. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116768. // "required": true,
  116769. // "type": "string"
  116770. // },
  116771. // "region": {
  116772. // "description": "Name of the region scoping this request.",
  116773. // "location": "path",
  116774. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116775. // "required": true,
  116776. // "type": "string"
  116777. // },
  116778. // "requestId": {
  116779. // "description": "begin_interface: MixerMutationRequestBuilder Request ID to support idempotency.",
  116780. // "location": "query",
  116781. // "type": "string"
  116782. // },
  116783. // "urlMap": {
  116784. // "description": "Name of the UrlMap resource to update.",
  116785. // "location": "path",
  116786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116787. // "required": true,
  116788. // "type": "string"
  116789. // }
  116790. // },
  116791. // "path": "{project}/regions/{region}/urlMaps/{urlMap}",
  116792. // "request": {
  116793. // "$ref": "UrlMap"
  116794. // },
  116795. // "response": {
  116796. // "$ref": "Operation"
  116797. // },
  116798. // "scopes": [
  116799. // "https://www.googleapis.com/auth/cloud-platform",
  116800. // "https://www.googleapis.com/auth/compute"
  116801. // ]
  116802. // }
  116803. }
  116804. // method id "compute.regionUrlMaps.validate":
  116805. type RegionUrlMapsValidateCall struct {
  116806. s *Service
  116807. project string
  116808. region string
  116809. urlMap string
  116810. regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest
  116811. urlParams_ gensupport.URLParams
  116812. ctx_ context.Context
  116813. header_ http.Header
  116814. }
  116815. // Validate: Runs static validation for the UrlMap. In particular, the
  116816. // tests of the provided UrlMap will be run. Calling this method does
  116817. // NOT create the UrlMap.
  116818. func (r *RegionUrlMapsService) Validate(project string, region string, urlMap string, regionurlmapsvalidaterequest *RegionUrlMapsValidateRequest) *RegionUrlMapsValidateCall {
  116819. c := &RegionUrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116820. c.project = project
  116821. c.region = region
  116822. c.urlMap = urlMap
  116823. c.regionurlmapsvalidaterequest = regionurlmapsvalidaterequest
  116824. return c
  116825. }
  116826. // Fields allows partial responses to be retrieved. See
  116827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116828. // for more information.
  116829. func (c *RegionUrlMapsValidateCall) Fields(s ...googleapi.Field) *RegionUrlMapsValidateCall {
  116830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116831. return c
  116832. }
  116833. // Context sets the context to be used in this call's Do method. Any
  116834. // pending HTTP request will be aborted if the provided context is
  116835. // canceled.
  116836. func (c *RegionUrlMapsValidateCall) Context(ctx context.Context) *RegionUrlMapsValidateCall {
  116837. c.ctx_ = ctx
  116838. return c
  116839. }
  116840. // Header returns an http.Header that can be modified by the caller to
  116841. // add HTTP headers to the request.
  116842. func (c *RegionUrlMapsValidateCall) Header() http.Header {
  116843. if c.header_ == nil {
  116844. c.header_ = make(http.Header)
  116845. }
  116846. return c.header_
  116847. }
  116848. func (c *RegionUrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  116849. reqHeaders := make(http.Header)
  116850. for k, v := range c.header_ {
  116851. reqHeaders[k] = v
  116852. }
  116853. reqHeaders.Set("User-Agent", c.s.userAgent())
  116854. var body io.Reader = nil
  116855. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionurlmapsvalidaterequest)
  116856. if err != nil {
  116857. return nil, err
  116858. }
  116859. reqHeaders.Set("Content-Type", "application/json")
  116860. c.urlParams_.Set("alt", alt)
  116861. c.urlParams_.Set("prettyPrint", "false")
  116862. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/urlMaps/{urlMap}/validate")
  116863. urls += "?" + c.urlParams_.Encode()
  116864. req, err := http.NewRequest("POST", urls, body)
  116865. if err != nil {
  116866. return nil, err
  116867. }
  116868. req.Header = reqHeaders
  116869. googleapi.Expand(req.URL, map[string]string{
  116870. "project": c.project,
  116871. "region": c.region,
  116872. "urlMap": c.urlMap,
  116873. })
  116874. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  116875. }
  116876. // Do executes the "compute.regionUrlMaps.validate" call.
  116877. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  116878. // non-2xx status code is an error. Response headers are in either
  116879. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  116880. // returned at all) in error.(*googleapi.Error).Header. Use
  116881. // googleapi.IsNotModified to check whether the returned error was
  116882. // because http.StatusNotModified was returned.
  116883. func (c *RegionUrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  116884. gensupport.SetOptions(c.urlParams_, opts...)
  116885. res, err := c.doRequest("json")
  116886. if res != nil && res.StatusCode == http.StatusNotModified {
  116887. if res.Body != nil {
  116888. res.Body.Close()
  116889. }
  116890. return nil, &googleapi.Error{
  116891. Code: res.StatusCode,
  116892. Header: res.Header,
  116893. }
  116894. }
  116895. if err != nil {
  116896. return nil, err
  116897. }
  116898. defer googleapi.CloseBody(res)
  116899. if err := googleapi.CheckResponse(res); err != nil {
  116900. return nil, err
  116901. }
  116902. ret := &UrlMapsValidateResponse{
  116903. ServerResponse: googleapi.ServerResponse{
  116904. Header: res.Header,
  116905. HTTPStatusCode: res.StatusCode,
  116906. },
  116907. }
  116908. target := &ret
  116909. if err := gensupport.DecodeResponse(target, res); err != nil {
  116910. return nil, err
  116911. }
  116912. return ret, nil
  116913. // {
  116914. // "description": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.",
  116915. // "httpMethod": "POST",
  116916. // "id": "compute.regionUrlMaps.validate",
  116917. // "parameterOrder": [
  116918. // "project",
  116919. // "region",
  116920. // "urlMap"
  116921. // ],
  116922. // "parameters": {
  116923. // "project": {
  116924. // "description": "Project ID for this request.",
  116925. // "location": "path",
  116926. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  116927. // "required": true,
  116928. // "type": "string"
  116929. // },
  116930. // "region": {
  116931. // "description": "Name of the region scoping this request.",
  116932. // "location": "path",
  116933. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  116934. // "required": true,
  116935. // "type": "string"
  116936. // },
  116937. // "urlMap": {
  116938. // "description": "Name of the UrlMap resource to be validated as.",
  116939. // "location": "path",
  116940. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  116941. // "required": true,
  116942. // "type": "string"
  116943. // }
  116944. // },
  116945. // "path": "{project}/regions/{region}/urlMaps/{urlMap}/validate",
  116946. // "request": {
  116947. // "$ref": "RegionUrlMapsValidateRequest"
  116948. // },
  116949. // "response": {
  116950. // "$ref": "UrlMapsValidateResponse"
  116951. // },
  116952. // "scopes": [
  116953. // "https://www.googleapis.com/auth/cloud-platform",
  116954. // "https://www.googleapis.com/auth/compute"
  116955. // ]
  116956. // }
  116957. }
  116958. // method id "compute.regions.get":
  116959. type RegionsGetCall struct {
  116960. s *Service
  116961. project string
  116962. region string
  116963. urlParams_ gensupport.URLParams
  116964. ifNoneMatch_ string
  116965. ctx_ context.Context
  116966. header_ http.Header
  116967. }
  116968. // Get: Returns the specified Region resource. Gets a list of available
  116969. // regions by making a list() request.
  116970. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  116971. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  116972. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  116973. c.project = project
  116974. c.region = region
  116975. return c
  116976. }
  116977. // Fields allows partial responses to be retrieved. See
  116978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  116979. // for more information.
  116980. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  116981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  116982. return c
  116983. }
  116984. // IfNoneMatch sets the optional parameter which makes the operation
  116985. // fail if the object's ETag matches the given value. This is useful for
  116986. // getting updates only after the object has changed since the last
  116987. // request. Use googleapi.IsNotModified to check whether the response
  116988. // error from Do is the result of In-None-Match.
  116989. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  116990. c.ifNoneMatch_ = entityTag
  116991. return c
  116992. }
  116993. // Context sets the context to be used in this call's Do method. Any
  116994. // pending HTTP request will be aborted if the provided context is
  116995. // canceled.
  116996. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  116997. c.ctx_ = ctx
  116998. return c
  116999. }
  117000. // Header returns an http.Header that can be modified by the caller to
  117001. // add HTTP headers to the request.
  117002. func (c *RegionsGetCall) Header() http.Header {
  117003. if c.header_ == nil {
  117004. c.header_ = make(http.Header)
  117005. }
  117006. return c.header_
  117007. }
  117008. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  117009. reqHeaders := make(http.Header)
  117010. for k, v := range c.header_ {
  117011. reqHeaders[k] = v
  117012. }
  117013. reqHeaders.Set("User-Agent", c.s.userAgent())
  117014. if c.ifNoneMatch_ != "" {
  117015. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117016. }
  117017. var body io.Reader = nil
  117018. c.urlParams_.Set("alt", alt)
  117019. c.urlParams_.Set("prettyPrint", "false")
  117020. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  117021. urls += "?" + c.urlParams_.Encode()
  117022. req, err := http.NewRequest("GET", urls, body)
  117023. if err != nil {
  117024. return nil, err
  117025. }
  117026. req.Header = reqHeaders
  117027. googleapi.Expand(req.URL, map[string]string{
  117028. "project": c.project,
  117029. "region": c.region,
  117030. })
  117031. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117032. }
  117033. // Do executes the "compute.regions.get" call.
  117034. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  117035. // code is an error. Response headers are in either
  117036. // *Region.ServerResponse.Header or (if a response was returned at all)
  117037. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  117038. // check whether the returned error was because http.StatusNotModified
  117039. // was returned.
  117040. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  117041. gensupport.SetOptions(c.urlParams_, opts...)
  117042. res, err := c.doRequest("json")
  117043. if res != nil && res.StatusCode == http.StatusNotModified {
  117044. if res.Body != nil {
  117045. res.Body.Close()
  117046. }
  117047. return nil, &googleapi.Error{
  117048. Code: res.StatusCode,
  117049. Header: res.Header,
  117050. }
  117051. }
  117052. if err != nil {
  117053. return nil, err
  117054. }
  117055. defer googleapi.CloseBody(res)
  117056. if err := googleapi.CheckResponse(res); err != nil {
  117057. return nil, err
  117058. }
  117059. ret := &Region{
  117060. ServerResponse: googleapi.ServerResponse{
  117061. Header: res.Header,
  117062. HTTPStatusCode: res.StatusCode,
  117063. },
  117064. }
  117065. target := &ret
  117066. if err := gensupport.DecodeResponse(target, res); err != nil {
  117067. return nil, err
  117068. }
  117069. return ret, nil
  117070. // {
  117071. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  117072. // "httpMethod": "GET",
  117073. // "id": "compute.regions.get",
  117074. // "parameterOrder": [
  117075. // "project",
  117076. // "region"
  117077. // ],
  117078. // "parameters": {
  117079. // "project": {
  117080. // "description": "Project ID for this request.",
  117081. // "location": "path",
  117082. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117083. // "required": true,
  117084. // "type": "string"
  117085. // },
  117086. // "region": {
  117087. // "description": "Name of the region resource to return.",
  117088. // "location": "path",
  117089. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117090. // "required": true,
  117091. // "type": "string"
  117092. // }
  117093. // },
  117094. // "path": "{project}/regions/{region}",
  117095. // "response": {
  117096. // "$ref": "Region"
  117097. // },
  117098. // "scopes": [
  117099. // "https://www.googleapis.com/auth/cloud-platform",
  117100. // "https://www.googleapis.com/auth/compute",
  117101. // "https://www.googleapis.com/auth/compute.readonly"
  117102. // ]
  117103. // }
  117104. }
  117105. // method id "compute.regions.list":
  117106. type RegionsListCall struct {
  117107. s *Service
  117108. project string
  117109. urlParams_ gensupport.URLParams
  117110. ifNoneMatch_ string
  117111. ctx_ context.Context
  117112. header_ http.Header
  117113. }
  117114. // List: Retrieves the list of region resources available to the
  117115. // specified project.
  117116. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  117117. func (r *RegionsService) List(project string) *RegionsListCall {
  117118. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117119. c.project = project
  117120. return c
  117121. }
  117122. // Filter sets the optional parameter "filter": A filter expression that
  117123. // filters resources listed in the response. The expression must specify
  117124. // the field name, a comparison operator, and the value that you want to
  117125. // use for filtering. The value must be a string, a number, or a
  117126. // boolean. The comparison operator must be either =, !=, >, or <.
  117127. //
  117128. // For example, if you are filtering Compute Engine instances, you can
  117129. // exclude instances named example-instance by specifying name !=
  117130. // example-instance.
  117131. //
  117132. // You can also filter nested fields. For example, you could specify
  117133. // scheduling.automaticRestart = false to include instances only if they
  117134. // are not scheduled for automatic restarts. You can use filtering on
  117135. // nested fields to filter based on resource labels.
  117136. //
  117137. // To filter on multiple expressions, provide each separate expression
  117138. // within parentheses. For example, (scheduling.automaticRestart = true)
  117139. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  117140. // AND expression. However, you can include AND and OR expressions
  117141. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  117142. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  117143. // true).
  117144. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  117145. c.urlParams_.Set("filter", filter)
  117146. return c
  117147. }
  117148. // MaxResults sets the optional parameter "maxResults": The maximum
  117149. // number of results per page that should be returned. If the number of
  117150. // available results is larger than maxResults, Compute Engine returns a
  117151. // nextPageToken that can be used to get the next page of results in
  117152. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  117153. // (Default: 500)
  117154. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  117155. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  117156. return c
  117157. }
  117158. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  117159. // a certain order. By default, results are returned in alphanumerical
  117160. // order based on the resource name.
  117161. //
  117162. // You can also sort results in descending order based on the creation
  117163. // timestamp using orderBy="creationTimestamp desc". This sorts results
  117164. // based on the creationTimestamp field in reverse chronological order
  117165. // (newest result first). Use this to sort resources like operations so
  117166. // that the newest operation is returned first.
  117167. //
  117168. // Currently, only sorting by name or creationTimestamp desc is
  117169. // supported.
  117170. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  117171. c.urlParams_.Set("orderBy", orderBy)
  117172. return c
  117173. }
  117174. // PageToken sets the optional parameter "pageToken": Specifies a page
  117175. // token to use. Set pageToken to the nextPageToken returned by a
  117176. // previous list request to get the next page of results.
  117177. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  117178. c.urlParams_.Set("pageToken", pageToken)
  117179. return c
  117180. }
  117181. // Fields allows partial responses to be retrieved. See
  117182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117183. // for more information.
  117184. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  117185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117186. return c
  117187. }
  117188. // IfNoneMatch sets the optional parameter which makes the operation
  117189. // fail if the object's ETag matches the given value. This is useful for
  117190. // getting updates only after the object has changed since the last
  117191. // request. Use googleapi.IsNotModified to check whether the response
  117192. // error from Do is the result of In-None-Match.
  117193. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  117194. c.ifNoneMatch_ = entityTag
  117195. return c
  117196. }
  117197. // Context sets the context to be used in this call's Do method. Any
  117198. // pending HTTP request will be aborted if the provided context is
  117199. // canceled.
  117200. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  117201. c.ctx_ = ctx
  117202. return c
  117203. }
  117204. // Header returns an http.Header that can be modified by the caller to
  117205. // add HTTP headers to the request.
  117206. func (c *RegionsListCall) Header() http.Header {
  117207. if c.header_ == nil {
  117208. c.header_ = make(http.Header)
  117209. }
  117210. return c.header_
  117211. }
  117212. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  117213. reqHeaders := make(http.Header)
  117214. for k, v := range c.header_ {
  117215. reqHeaders[k] = v
  117216. }
  117217. reqHeaders.Set("User-Agent", c.s.userAgent())
  117218. if c.ifNoneMatch_ != "" {
  117219. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117220. }
  117221. var body io.Reader = nil
  117222. c.urlParams_.Set("alt", alt)
  117223. c.urlParams_.Set("prettyPrint", "false")
  117224. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  117225. urls += "?" + c.urlParams_.Encode()
  117226. req, err := http.NewRequest("GET", urls, body)
  117227. if err != nil {
  117228. return nil, err
  117229. }
  117230. req.Header = reqHeaders
  117231. googleapi.Expand(req.URL, map[string]string{
  117232. "project": c.project,
  117233. })
  117234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117235. }
  117236. // Do executes the "compute.regions.list" call.
  117237. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  117238. // status code is an error. Response headers are in either
  117239. // *RegionList.ServerResponse.Header or (if a response was returned at
  117240. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117241. // to check whether the returned error was because
  117242. // http.StatusNotModified was returned.
  117243. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  117244. gensupport.SetOptions(c.urlParams_, opts...)
  117245. res, err := c.doRequest("json")
  117246. if res != nil && res.StatusCode == http.StatusNotModified {
  117247. if res.Body != nil {
  117248. res.Body.Close()
  117249. }
  117250. return nil, &googleapi.Error{
  117251. Code: res.StatusCode,
  117252. Header: res.Header,
  117253. }
  117254. }
  117255. if err != nil {
  117256. return nil, err
  117257. }
  117258. defer googleapi.CloseBody(res)
  117259. if err := googleapi.CheckResponse(res); err != nil {
  117260. return nil, err
  117261. }
  117262. ret := &RegionList{
  117263. ServerResponse: googleapi.ServerResponse{
  117264. Header: res.Header,
  117265. HTTPStatusCode: res.StatusCode,
  117266. },
  117267. }
  117268. target := &ret
  117269. if err := gensupport.DecodeResponse(target, res); err != nil {
  117270. return nil, err
  117271. }
  117272. return ret, nil
  117273. // {
  117274. // "description": "Retrieves the list of region resources available to the specified project.",
  117275. // "httpMethod": "GET",
  117276. // "id": "compute.regions.list",
  117277. // "parameterOrder": [
  117278. // "project"
  117279. // ],
  117280. // "parameters": {
  117281. // "filter": {
  117282. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  117283. // "location": "query",
  117284. // "type": "string"
  117285. // },
  117286. // "maxResults": {
  117287. // "default": "500",
  117288. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  117289. // "format": "uint32",
  117290. // "location": "query",
  117291. // "minimum": "0",
  117292. // "type": "integer"
  117293. // },
  117294. // "orderBy": {
  117295. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  117296. // "location": "query",
  117297. // "type": "string"
  117298. // },
  117299. // "pageToken": {
  117300. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  117301. // "location": "query",
  117302. // "type": "string"
  117303. // },
  117304. // "project": {
  117305. // "description": "Project ID for this request.",
  117306. // "location": "path",
  117307. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117308. // "required": true,
  117309. // "type": "string"
  117310. // }
  117311. // },
  117312. // "path": "{project}/regions",
  117313. // "response": {
  117314. // "$ref": "RegionList"
  117315. // },
  117316. // "scopes": [
  117317. // "https://www.googleapis.com/auth/cloud-platform",
  117318. // "https://www.googleapis.com/auth/compute",
  117319. // "https://www.googleapis.com/auth/compute.readonly"
  117320. // ]
  117321. // }
  117322. }
  117323. // Pages invokes f for each page of results.
  117324. // A non-nil error returned from f will halt the iteration.
  117325. // The provided context supersedes any context provided to the Context method.
  117326. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  117327. c.ctx_ = ctx
  117328. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  117329. for {
  117330. x, err := c.Do()
  117331. if err != nil {
  117332. return err
  117333. }
  117334. if err := f(x); err != nil {
  117335. return err
  117336. }
  117337. if x.NextPageToken == "" {
  117338. return nil
  117339. }
  117340. c.PageToken(x.NextPageToken)
  117341. }
  117342. }
  117343. // method id "compute.resourcePolicies.aggregatedList":
  117344. type ResourcePoliciesAggregatedListCall struct {
  117345. s *Service
  117346. project string
  117347. urlParams_ gensupport.URLParams
  117348. ifNoneMatch_ string
  117349. ctx_ context.Context
  117350. header_ http.Header
  117351. }
  117352. // AggregatedList: Retrieves an aggregated list of resource policies.
  117353. func (r *ResourcePoliciesService) AggregatedList(project string) *ResourcePoliciesAggregatedListCall {
  117354. c := &ResourcePoliciesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117355. c.project = project
  117356. return c
  117357. }
  117358. // Filter sets the optional parameter "filter": A filter expression that
  117359. // filters resources listed in the response. The expression must specify
  117360. // the field name, a comparison operator, and the value that you want to
  117361. // use for filtering. The value must be a string, a number, or a
  117362. // boolean. The comparison operator must be either =, !=, >, or <.
  117363. //
  117364. // For example, if you are filtering Compute Engine instances, you can
  117365. // exclude instances named example-instance by specifying name !=
  117366. // example-instance.
  117367. //
  117368. // You can also filter nested fields. For example, you could specify
  117369. // scheduling.automaticRestart = false to include instances only if they
  117370. // are not scheduled for automatic restarts. You can use filtering on
  117371. // nested fields to filter based on resource labels.
  117372. //
  117373. // To filter on multiple expressions, provide each separate expression
  117374. // within parentheses. For example, (scheduling.automaticRestart = true)
  117375. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  117376. // AND expression. However, you can include AND and OR expressions
  117377. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  117378. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  117379. // true).
  117380. func (c *ResourcePoliciesAggregatedListCall) Filter(filter string) *ResourcePoliciesAggregatedListCall {
  117381. c.urlParams_.Set("filter", filter)
  117382. return c
  117383. }
  117384. // MaxResults sets the optional parameter "maxResults": The maximum
  117385. // number of results per page that should be returned. If the number of
  117386. // available results is larger than maxResults, Compute Engine returns a
  117387. // nextPageToken that can be used to get the next page of results in
  117388. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  117389. // (Default: 500)
  117390. func (c *ResourcePoliciesAggregatedListCall) MaxResults(maxResults int64) *ResourcePoliciesAggregatedListCall {
  117391. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  117392. return c
  117393. }
  117394. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  117395. // a certain order. By default, results are returned in alphanumerical
  117396. // order based on the resource name.
  117397. //
  117398. // You can also sort results in descending order based on the creation
  117399. // timestamp using orderBy="creationTimestamp desc". This sorts results
  117400. // based on the creationTimestamp field in reverse chronological order
  117401. // (newest result first). Use this to sort resources like operations so
  117402. // that the newest operation is returned first.
  117403. //
  117404. // Currently, only sorting by name or creationTimestamp desc is
  117405. // supported.
  117406. func (c *ResourcePoliciesAggregatedListCall) OrderBy(orderBy string) *ResourcePoliciesAggregatedListCall {
  117407. c.urlParams_.Set("orderBy", orderBy)
  117408. return c
  117409. }
  117410. // PageToken sets the optional parameter "pageToken": Specifies a page
  117411. // token to use. Set pageToken to the nextPageToken returned by a
  117412. // previous list request to get the next page of results.
  117413. func (c *ResourcePoliciesAggregatedListCall) PageToken(pageToken string) *ResourcePoliciesAggregatedListCall {
  117414. c.urlParams_.Set("pageToken", pageToken)
  117415. return c
  117416. }
  117417. // Fields allows partial responses to be retrieved. See
  117418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117419. // for more information.
  117420. func (c *ResourcePoliciesAggregatedListCall) Fields(s ...googleapi.Field) *ResourcePoliciesAggregatedListCall {
  117421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117422. return c
  117423. }
  117424. // IfNoneMatch sets the optional parameter which makes the operation
  117425. // fail if the object's ETag matches the given value. This is useful for
  117426. // getting updates only after the object has changed since the last
  117427. // request. Use googleapi.IsNotModified to check whether the response
  117428. // error from Do is the result of In-None-Match.
  117429. func (c *ResourcePoliciesAggregatedListCall) IfNoneMatch(entityTag string) *ResourcePoliciesAggregatedListCall {
  117430. c.ifNoneMatch_ = entityTag
  117431. return c
  117432. }
  117433. // Context sets the context to be used in this call's Do method. Any
  117434. // pending HTTP request will be aborted if the provided context is
  117435. // canceled.
  117436. func (c *ResourcePoliciesAggregatedListCall) Context(ctx context.Context) *ResourcePoliciesAggregatedListCall {
  117437. c.ctx_ = ctx
  117438. return c
  117439. }
  117440. // Header returns an http.Header that can be modified by the caller to
  117441. // add HTTP headers to the request.
  117442. func (c *ResourcePoliciesAggregatedListCall) Header() http.Header {
  117443. if c.header_ == nil {
  117444. c.header_ = make(http.Header)
  117445. }
  117446. return c.header_
  117447. }
  117448. func (c *ResourcePoliciesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  117449. reqHeaders := make(http.Header)
  117450. for k, v := range c.header_ {
  117451. reqHeaders[k] = v
  117452. }
  117453. reqHeaders.Set("User-Agent", c.s.userAgent())
  117454. if c.ifNoneMatch_ != "" {
  117455. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117456. }
  117457. var body io.Reader = nil
  117458. c.urlParams_.Set("alt", alt)
  117459. c.urlParams_.Set("prettyPrint", "false")
  117460. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/resourcePolicies")
  117461. urls += "?" + c.urlParams_.Encode()
  117462. req, err := http.NewRequest("GET", urls, body)
  117463. if err != nil {
  117464. return nil, err
  117465. }
  117466. req.Header = reqHeaders
  117467. googleapi.Expand(req.URL, map[string]string{
  117468. "project": c.project,
  117469. })
  117470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117471. }
  117472. // Do executes the "compute.resourcePolicies.aggregatedList" call.
  117473. // Exactly one of *ResourcePolicyAggregatedList or error will be
  117474. // non-nil. Any non-2xx status code is an error. Response headers are in
  117475. // either *ResourcePolicyAggregatedList.ServerResponse.Header or (if a
  117476. // response was returned at all) in error.(*googleapi.Error).Header. Use
  117477. // googleapi.IsNotModified to check whether the returned error was
  117478. // because http.StatusNotModified was returned.
  117479. func (c *ResourcePoliciesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyAggregatedList, error) {
  117480. gensupport.SetOptions(c.urlParams_, opts...)
  117481. res, err := c.doRequest("json")
  117482. if res != nil && res.StatusCode == http.StatusNotModified {
  117483. if res.Body != nil {
  117484. res.Body.Close()
  117485. }
  117486. return nil, &googleapi.Error{
  117487. Code: res.StatusCode,
  117488. Header: res.Header,
  117489. }
  117490. }
  117491. if err != nil {
  117492. return nil, err
  117493. }
  117494. defer googleapi.CloseBody(res)
  117495. if err := googleapi.CheckResponse(res); err != nil {
  117496. return nil, err
  117497. }
  117498. ret := &ResourcePolicyAggregatedList{
  117499. ServerResponse: googleapi.ServerResponse{
  117500. Header: res.Header,
  117501. HTTPStatusCode: res.StatusCode,
  117502. },
  117503. }
  117504. target := &ret
  117505. if err := gensupport.DecodeResponse(target, res); err != nil {
  117506. return nil, err
  117507. }
  117508. return ret, nil
  117509. // {
  117510. // "description": "Retrieves an aggregated list of resource policies.",
  117511. // "httpMethod": "GET",
  117512. // "id": "compute.resourcePolicies.aggregatedList",
  117513. // "parameterOrder": [
  117514. // "project"
  117515. // ],
  117516. // "parameters": {
  117517. // "filter": {
  117518. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  117519. // "location": "query",
  117520. // "type": "string"
  117521. // },
  117522. // "maxResults": {
  117523. // "default": "500",
  117524. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  117525. // "format": "uint32",
  117526. // "location": "query",
  117527. // "minimum": "0",
  117528. // "type": "integer"
  117529. // },
  117530. // "orderBy": {
  117531. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  117532. // "location": "query",
  117533. // "type": "string"
  117534. // },
  117535. // "pageToken": {
  117536. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  117537. // "location": "query",
  117538. // "type": "string"
  117539. // },
  117540. // "project": {
  117541. // "description": "Project ID for this request.",
  117542. // "location": "path",
  117543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117544. // "required": true,
  117545. // "type": "string"
  117546. // }
  117547. // },
  117548. // "path": "{project}/aggregated/resourcePolicies",
  117549. // "response": {
  117550. // "$ref": "ResourcePolicyAggregatedList"
  117551. // },
  117552. // "scopes": [
  117553. // "https://www.googleapis.com/auth/cloud-platform",
  117554. // "https://www.googleapis.com/auth/compute",
  117555. // "https://www.googleapis.com/auth/compute.readonly"
  117556. // ]
  117557. // }
  117558. }
  117559. // Pages invokes f for each page of results.
  117560. // A non-nil error returned from f will halt the iteration.
  117561. // The provided context supersedes any context provided to the Context method.
  117562. func (c *ResourcePoliciesAggregatedListCall) Pages(ctx context.Context, f func(*ResourcePolicyAggregatedList) error) error {
  117563. c.ctx_ = ctx
  117564. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  117565. for {
  117566. x, err := c.Do()
  117567. if err != nil {
  117568. return err
  117569. }
  117570. if err := f(x); err != nil {
  117571. return err
  117572. }
  117573. if x.NextPageToken == "" {
  117574. return nil
  117575. }
  117576. c.PageToken(x.NextPageToken)
  117577. }
  117578. }
  117579. // method id "compute.resourcePolicies.delete":
  117580. type ResourcePoliciesDeleteCall struct {
  117581. s *Service
  117582. project string
  117583. region string
  117584. resourcePolicy string
  117585. urlParams_ gensupport.URLParams
  117586. ctx_ context.Context
  117587. header_ http.Header
  117588. }
  117589. // Delete: Deletes the specified resource policy.
  117590. func (r *ResourcePoliciesService) Delete(project string, region string, resourcePolicy string) *ResourcePoliciesDeleteCall {
  117591. c := &ResourcePoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117592. c.project = project
  117593. c.region = region
  117594. c.resourcePolicy = resourcePolicy
  117595. return c
  117596. }
  117597. // RequestId sets the optional parameter "requestId": An optional
  117598. // request ID to identify requests. Specify a unique request ID so that
  117599. // if you must retry your request, the server will know to ignore the
  117600. // request if it has already been completed.
  117601. //
  117602. // For example, consider a situation where you make an initial request
  117603. // and the request times out. If you make the request again with the
  117604. // same request ID, the server can check if original operation with the
  117605. // same request ID was received, and if so, will ignore the second
  117606. // request. This prevents clients from accidentally creating duplicate
  117607. // commitments.
  117608. //
  117609. // The request ID must be a valid UUID with the exception that zero UUID
  117610. // is not supported (00000000-0000-0000-0000-000000000000).
  117611. func (c *ResourcePoliciesDeleteCall) RequestId(requestId string) *ResourcePoliciesDeleteCall {
  117612. c.urlParams_.Set("requestId", requestId)
  117613. return c
  117614. }
  117615. // Fields allows partial responses to be retrieved. See
  117616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117617. // for more information.
  117618. func (c *ResourcePoliciesDeleteCall) Fields(s ...googleapi.Field) *ResourcePoliciesDeleteCall {
  117619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117620. return c
  117621. }
  117622. // Context sets the context to be used in this call's Do method. Any
  117623. // pending HTTP request will be aborted if the provided context is
  117624. // canceled.
  117625. func (c *ResourcePoliciesDeleteCall) Context(ctx context.Context) *ResourcePoliciesDeleteCall {
  117626. c.ctx_ = ctx
  117627. return c
  117628. }
  117629. // Header returns an http.Header that can be modified by the caller to
  117630. // add HTTP headers to the request.
  117631. func (c *ResourcePoliciesDeleteCall) Header() http.Header {
  117632. if c.header_ == nil {
  117633. c.header_ = make(http.Header)
  117634. }
  117635. return c.header_
  117636. }
  117637. func (c *ResourcePoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  117638. reqHeaders := make(http.Header)
  117639. for k, v := range c.header_ {
  117640. reqHeaders[k] = v
  117641. }
  117642. reqHeaders.Set("User-Agent", c.s.userAgent())
  117643. var body io.Reader = nil
  117644. c.urlParams_.Set("alt", alt)
  117645. c.urlParams_.Set("prettyPrint", "false")
  117646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  117647. urls += "?" + c.urlParams_.Encode()
  117648. req, err := http.NewRequest("DELETE", urls, body)
  117649. if err != nil {
  117650. return nil, err
  117651. }
  117652. req.Header = reqHeaders
  117653. googleapi.Expand(req.URL, map[string]string{
  117654. "project": c.project,
  117655. "region": c.region,
  117656. "resourcePolicy": c.resourcePolicy,
  117657. })
  117658. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117659. }
  117660. // Do executes the "compute.resourcePolicies.delete" call.
  117661. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  117662. // status code is an error. Response headers are in either
  117663. // *Operation.ServerResponse.Header or (if a response was returned at
  117664. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  117665. // to check whether the returned error was because
  117666. // http.StatusNotModified was returned.
  117667. func (c *ResourcePoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  117668. gensupport.SetOptions(c.urlParams_, opts...)
  117669. res, err := c.doRequest("json")
  117670. if res != nil && res.StatusCode == http.StatusNotModified {
  117671. if res.Body != nil {
  117672. res.Body.Close()
  117673. }
  117674. return nil, &googleapi.Error{
  117675. Code: res.StatusCode,
  117676. Header: res.Header,
  117677. }
  117678. }
  117679. if err != nil {
  117680. return nil, err
  117681. }
  117682. defer googleapi.CloseBody(res)
  117683. if err := googleapi.CheckResponse(res); err != nil {
  117684. return nil, err
  117685. }
  117686. ret := &Operation{
  117687. ServerResponse: googleapi.ServerResponse{
  117688. Header: res.Header,
  117689. HTTPStatusCode: res.StatusCode,
  117690. },
  117691. }
  117692. target := &ret
  117693. if err := gensupport.DecodeResponse(target, res); err != nil {
  117694. return nil, err
  117695. }
  117696. return ret, nil
  117697. // {
  117698. // "description": "Deletes the specified resource policy.",
  117699. // "httpMethod": "DELETE",
  117700. // "id": "compute.resourcePolicies.delete",
  117701. // "parameterOrder": [
  117702. // "project",
  117703. // "region",
  117704. // "resourcePolicy"
  117705. // ],
  117706. // "parameters": {
  117707. // "project": {
  117708. // "description": "Project ID for this request.",
  117709. // "location": "path",
  117710. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117711. // "required": true,
  117712. // "type": "string"
  117713. // },
  117714. // "region": {
  117715. // "description": "Name of the region for this request.",
  117716. // "location": "path",
  117717. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117718. // "required": true,
  117719. // "type": "string"
  117720. // },
  117721. // "requestId": {
  117722. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  117723. // "location": "query",
  117724. // "type": "string"
  117725. // },
  117726. // "resourcePolicy": {
  117727. // "description": "Name of the resource policy to delete.",
  117728. // "location": "path",
  117729. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117730. // "required": true,
  117731. // "type": "string"
  117732. // }
  117733. // },
  117734. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  117735. // "response": {
  117736. // "$ref": "Operation"
  117737. // },
  117738. // "scopes": [
  117739. // "https://www.googleapis.com/auth/cloud-platform",
  117740. // "https://www.googleapis.com/auth/compute"
  117741. // ]
  117742. // }
  117743. }
  117744. // method id "compute.resourcePolicies.get":
  117745. type ResourcePoliciesGetCall struct {
  117746. s *Service
  117747. project string
  117748. region string
  117749. resourcePolicy string
  117750. urlParams_ gensupport.URLParams
  117751. ifNoneMatch_ string
  117752. ctx_ context.Context
  117753. header_ http.Header
  117754. }
  117755. // Get: Retrieves all information of the specified resource policy.
  117756. func (r *ResourcePoliciesService) Get(project string, region string, resourcePolicy string) *ResourcePoliciesGetCall {
  117757. c := &ResourcePoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117758. c.project = project
  117759. c.region = region
  117760. c.resourcePolicy = resourcePolicy
  117761. return c
  117762. }
  117763. // Fields allows partial responses to be retrieved. See
  117764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117765. // for more information.
  117766. func (c *ResourcePoliciesGetCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetCall {
  117767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117768. return c
  117769. }
  117770. // IfNoneMatch sets the optional parameter which makes the operation
  117771. // fail if the object's ETag matches the given value. This is useful for
  117772. // getting updates only after the object has changed since the last
  117773. // request. Use googleapi.IsNotModified to check whether the response
  117774. // error from Do is the result of In-None-Match.
  117775. func (c *ResourcePoliciesGetCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetCall {
  117776. c.ifNoneMatch_ = entityTag
  117777. return c
  117778. }
  117779. // Context sets the context to be used in this call's Do method. Any
  117780. // pending HTTP request will be aborted if the provided context is
  117781. // canceled.
  117782. func (c *ResourcePoliciesGetCall) Context(ctx context.Context) *ResourcePoliciesGetCall {
  117783. c.ctx_ = ctx
  117784. return c
  117785. }
  117786. // Header returns an http.Header that can be modified by the caller to
  117787. // add HTTP headers to the request.
  117788. func (c *ResourcePoliciesGetCall) Header() http.Header {
  117789. if c.header_ == nil {
  117790. c.header_ = make(http.Header)
  117791. }
  117792. return c.header_
  117793. }
  117794. func (c *ResourcePoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  117795. reqHeaders := make(http.Header)
  117796. for k, v := range c.header_ {
  117797. reqHeaders[k] = v
  117798. }
  117799. reqHeaders.Set("User-Agent", c.s.userAgent())
  117800. if c.ifNoneMatch_ != "" {
  117801. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117802. }
  117803. var body io.Reader = nil
  117804. c.urlParams_.Set("alt", alt)
  117805. c.urlParams_.Set("prettyPrint", "false")
  117806. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resourcePolicy}")
  117807. urls += "?" + c.urlParams_.Encode()
  117808. req, err := http.NewRequest("GET", urls, body)
  117809. if err != nil {
  117810. return nil, err
  117811. }
  117812. req.Header = reqHeaders
  117813. googleapi.Expand(req.URL, map[string]string{
  117814. "project": c.project,
  117815. "region": c.region,
  117816. "resourcePolicy": c.resourcePolicy,
  117817. })
  117818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117819. }
  117820. // Do executes the "compute.resourcePolicies.get" call.
  117821. // Exactly one of *ResourcePolicy or error will be non-nil. Any non-2xx
  117822. // status code is an error. Response headers are in either
  117823. // *ResourcePolicy.ServerResponse.Header or (if a response was returned
  117824. // at all) in error.(*googleapi.Error).Header. Use
  117825. // googleapi.IsNotModified to check whether the returned error was
  117826. // because http.StatusNotModified was returned.
  117827. func (c *ResourcePoliciesGetCall) Do(opts ...googleapi.CallOption) (*ResourcePolicy, error) {
  117828. gensupport.SetOptions(c.urlParams_, opts...)
  117829. res, err := c.doRequest("json")
  117830. if res != nil && res.StatusCode == http.StatusNotModified {
  117831. if res.Body != nil {
  117832. res.Body.Close()
  117833. }
  117834. return nil, &googleapi.Error{
  117835. Code: res.StatusCode,
  117836. Header: res.Header,
  117837. }
  117838. }
  117839. if err != nil {
  117840. return nil, err
  117841. }
  117842. defer googleapi.CloseBody(res)
  117843. if err := googleapi.CheckResponse(res); err != nil {
  117844. return nil, err
  117845. }
  117846. ret := &ResourcePolicy{
  117847. ServerResponse: googleapi.ServerResponse{
  117848. Header: res.Header,
  117849. HTTPStatusCode: res.StatusCode,
  117850. },
  117851. }
  117852. target := &ret
  117853. if err := gensupport.DecodeResponse(target, res); err != nil {
  117854. return nil, err
  117855. }
  117856. return ret, nil
  117857. // {
  117858. // "description": "Retrieves all information of the specified resource policy.",
  117859. // "httpMethod": "GET",
  117860. // "id": "compute.resourcePolicies.get",
  117861. // "parameterOrder": [
  117862. // "project",
  117863. // "region",
  117864. // "resourcePolicy"
  117865. // ],
  117866. // "parameters": {
  117867. // "project": {
  117868. // "description": "Project ID for this request.",
  117869. // "location": "path",
  117870. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  117871. // "required": true,
  117872. // "type": "string"
  117873. // },
  117874. // "region": {
  117875. // "description": "Name of the region for this request.",
  117876. // "location": "path",
  117877. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  117878. // "required": true,
  117879. // "type": "string"
  117880. // },
  117881. // "resourcePolicy": {
  117882. // "description": "Name of the resource policy to retrieve.",
  117883. // "location": "path",
  117884. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  117885. // "required": true,
  117886. // "type": "string"
  117887. // }
  117888. // },
  117889. // "path": "{project}/regions/{region}/resourcePolicies/{resourcePolicy}",
  117890. // "response": {
  117891. // "$ref": "ResourcePolicy"
  117892. // },
  117893. // "scopes": [
  117894. // "https://www.googleapis.com/auth/cloud-platform",
  117895. // "https://www.googleapis.com/auth/compute",
  117896. // "https://www.googleapis.com/auth/compute.readonly"
  117897. // ]
  117898. // }
  117899. }
  117900. // method id "compute.resourcePolicies.getIamPolicy":
  117901. type ResourcePoliciesGetIamPolicyCall struct {
  117902. s *Service
  117903. project string
  117904. region string
  117905. resource string
  117906. urlParams_ gensupport.URLParams
  117907. ifNoneMatch_ string
  117908. ctx_ context.Context
  117909. header_ http.Header
  117910. }
  117911. // GetIamPolicy: Gets the access control policy for a resource. May be
  117912. // empty if no such policy or resource exists.
  117913. func (r *ResourcePoliciesService) GetIamPolicy(project string, region string, resource string) *ResourcePoliciesGetIamPolicyCall {
  117914. c := &ResourcePoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  117915. c.project = project
  117916. c.region = region
  117917. c.resource = resource
  117918. return c
  117919. }
  117920. // Fields allows partial responses to be retrieved. See
  117921. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  117922. // for more information.
  117923. func (c *ResourcePoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesGetIamPolicyCall {
  117924. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  117925. return c
  117926. }
  117927. // IfNoneMatch sets the optional parameter which makes the operation
  117928. // fail if the object's ETag matches the given value. This is useful for
  117929. // getting updates only after the object has changed since the last
  117930. // request. Use googleapi.IsNotModified to check whether the response
  117931. // error from Do is the result of In-None-Match.
  117932. func (c *ResourcePoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ResourcePoliciesGetIamPolicyCall {
  117933. c.ifNoneMatch_ = entityTag
  117934. return c
  117935. }
  117936. // Context sets the context to be used in this call's Do method. Any
  117937. // pending HTTP request will be aborted if the provided context is
  117938. // canceled.
  117939. func (c *ResourcePoliciesGetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesGetIamPolicyCall {
  117940. c.ctx_ = ctx
  117941. return c
  117942. }
  117943. // Header returns an http.Header that can be modified by the caller to
  117944. // add HTTP headers to the request.
  117945. func (c *ResourcePoliciesGetIamPolicyCall) Header() http.Header {
  117946. if c.header_ == nil {
  117947. c.header_ = make(http.Header)
  117948. }
  117949. return c.header_
  117950. }
  117951. func (c *ResourcePoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  117952. reqHeaders := make(http.Header)
  117953. for k, v := range c.header_ {
  117954. reqHeaders[k] = v
  117955. }
  117956. reqHeaders.Set("User-Agent", c.s.userAgent())
  117957. if c.ifNoneMatch_ != "" {
  117958. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  117959. }
  117960. var body io.Reader = nil
  117961. c.urlParams_.Set("alt", alt)
  117962. c.urlParams_.Set("prettyPrint", "false")
  117963. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy")
  117964. urls += "?" + c.urlParams_.Encode()
  117965. req, err := http.NewRequest("GET", urls, body)
  117966. if err != nil {
  117967. return nil, err
  117968. }
  117969. req.Header = reqHeaders
  117970. googleapi.Expand(req.URL, map[string]string{
  117971. "project": c.project,
  117972. "region": c.region,
  117973. "resource": c.resource,
  117974. })
  117975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  117976. }
  117977. // Do executes the "compute.resourcePolicies.getIamPolicy" call.
  117978. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  117979. // code is an error. Response headers are in either
  117980. // *Policy.ServerResponse.Header or (if a response was returned at all)
  117981. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  117982. // check whether the returned error was because http.StatusNotModified
  117983. // was returned.
  117984. func (c *ResourcePoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  117985. gensupport.SetOptions(c.urlParams_, opts...)
  117986. res, err := c.doRequest("json")
  117987. if res != nil && res.StatusCode == http.StatusNotModified {
  117988. if res.Body != nil {
  117989. res.Body.Close()
  117990. }
  117991. return nil, &googleapi.Error{
  117992. Code: res.StatusCode,
  117993. Header: res.Header,
  117994. }
  117995. }
  117996. if err != nil {
  117997. return nil, err
  117998. }
  117999. defer googleapi.CloseBody(res)
  118000. if err := googleapi.CheckResponse(res); err != nil {
  118001. return nil, err
  118002. }
  118003. ret := &Policy{
  118004. ServerResponse: googleapi.ServerResponse{
  118005. Header: res.Header,
  118006. HTTPStatusCode: res.StatusCode,
  118007. },
  118008. }
  118009. target := &ret
  118010. if err := gensupport.DecodeResponse(target, res); err != nil {
  118011. return nil, err
  118012. }
  118013. return ret, nil
  118014. // {
  118015. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  118016. // "httpMethod": "GET",
  118017. // "id": "compute.resourcePolicies.getIamPolicy",
  118018. // "parameterOrder": [
  118019. // "project",
  118020. // "region",
  118021. // "resource"
  118022. // ],
  118023. // "parameters": {
  118024. // "project": {
  118025. // "description": "Project ID for this request.",
  118026. // "location": "path",
  118027. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118028. // "required": true,
  118029. // "type": "string"
  118030. // },
  118031. // "region": {
  118032. // "description": "The name of the region for this request.",
  118033. // "location": "path",
  118034. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118035. // "required": true,
  118036. // "type": "string"
  118037. // },
  118038. // "resource": {
  118039. // "description": "Name or id of the resource for this request.",
  118040. // "location": "path",
  118041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118042. // "required": true,
  118043. // "type": "string"
  118044. // }
  118045. // },
  118046. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy",
  118047. // "response": {
  118048. // "$ref": "Policy"
  118049. // },
  118050. // "scopes": [
  118051. // "https://www.googleapis.com/auth/cloud-platform",
  118052. // "https://www.googleapis.com/auth/compute",
  118053. // "https://www.googleapis.com/auth/compute.readonly"
  118054. // ]
  118055. // }
  118056. }
  118057. // method id "compute.resourcePolicies.insert":
  118058. type ResourcePoliciesInsertCall struct {
  118059. s *Service
  118060. project string
  118061. region string
  118062. resourcepolicy *ResourcePolicy
  118063. urlParams_ gensupport.URLParams
  118064. ctx_ context.Context
  118065. header_ http.Header
  118066. }
  118067. // Insert: Creates a new resource policy.
  118068. func (r *ResourcePoliciesService) Insert(project string, region string, resourcepolicy *ResourcePolicy) *ResourcePoliciesInsertCall {
  118069. c := &ResourcePoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118070. c.project = project
  118071. c.region = region
  118072. c.resourcepolicy = resourcepolicy
  118073. return c
  118074. }
  118075. // RequestId sets the optional parameter "requestId": An optional
  118076. // request ID to identify requests. Specify a unique request ID so that
  118077. // if you must retry your request, the server will know to ignore the
  118078. // request if it has already been completed.
  118079. //
  118080. // For example, consider a situation where you make an initial request
  118081. // and the request times out. If you make the request again with the
  118082. // same request ID, the server can check if original operation with the
  118083. // same request ID was received, and if so, will ignore the second
  118084. // request. This prevents clients from accidentally creating duplicate
  118085. // commitments.
  118086. //
  118087. // The request ID must be a valid UUID with the exception that zero UUID
  118088. // is not supported (00000000-0000-0000-0000-000000000000).
  118089. func (c *ResourcePoliciesInsertCall) RequestId(requestId string) *ResourcePoliciesInsertCall {
  118090. c.urlParams_.Set("requestId", requestId)
  118091. return c
  118092. }
  118093. // Fields allows partial responses to be retrieved. See
  118094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118095. // for more information.
  118096. func (c *ResourcePoliciesInsertCall) Fields(s ...googleapi.Field) *ResourcePoliciesInsertCall {
  118097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118098. return c
  118099. }
  118100. // Context sets the context to be used in this call's Do method. Any
  118101. // pending HTTP request will be aborted if the provided context is
  118102. // canceled.
  118103. func (c *ResourcePoliciesInsertCall) Context(ctx context.Context) *ResourcePoliciesInsertCall {
  118104. c.ctx_ = ctx
  118105. return c
  118106. }
  118107. // Header returns an http.Header that can be modified by the caller to
  118108. // add HTTP headers to the request.
  118109. func (c *ResourcePoliciesInsertCall) Header() http.Header {
  118110. if c.header_ == nil {
  118111. c.header_ = make(http.Header)
  118112. }
  118113. return c.header_
  118114. }
  118115. func (c *ResourcePoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  118116. reqHeaders := make(http.Header)
  118117. for k, v := range c.header_ {
  118118. reqHeaders[k] = v
  118119. }
  118120. reqHeaders.Set("User-Agent", c.s.userAgent())
  118121. var body io.Reader = nil
  118122. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcepolicy)
  118123. if err != nil {
  118124. return nil, err
  118125. }
  118126. reqHeaders.Set("Content-Type", "application/json")
  118127. c.urlParams_.Set("alt", alt)
  118128. c.urlParams_.Set("prettyPrint", "false")
  118129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  118130. urls += "?" + c.urlParams_.Encode()
  118131. req, err := http.NewRequest("POST", urls, body)
  118132. if err != nil {
  118133. return nil, err
  118134. }
  118135. req.Header = reqHeaders
  118136. googleapi.Expand(req.URL, map[string]string{
  118137. "project": c.project,
  118138. "region": c.region,
  118139. })
  118140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118141. }
  118142. // Do executes the "compute.resourcePolicies.insert" call.
  118143. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  118144. // status code is an error. Response headers are in either
  118145. // *Operation.ServerResponse.Header or (if a response was returned at
  118146. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  118147. // to check whether the returned error was because
  118148. // http.StatusNotModified was returned.
  118149. func (c *ResourcePoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  118150. gensupport.SetOptions(c.urlParams_, opts...)
  118151. res, err := c.doRequest("json")
  118152. if res != nil && res.StatusCode == http.StatusNotModified {
  118153. if res.Body != nil {
  118154. res.Body.Close()
  118155. }
  118156. return nil, &googleapi.Error{
  118157. Code: res.StatusCode,
  118158. Header: res.Header,
  118159. }
  118160. }
  118161. if err != nil {
  118162. return nil, err
  118163. }
  118164. defer googleapi.CloseBody(res)
  118165. if err := googleapi.CheckResponse(res); err != nil {
  118166. return nil, err
  118167. }
  118168. ret := &Operation{
  118169. ServerResponse: googleapi.ServerResponse{
  118170. Header: res.Header,
  118171. HTTPStatusCode: res.StatusCode,
  118172. },
  118173. }
  118174. target := &ret
  118175. if err := gensupport.DecodeResponse(target, res); err != nil {
  118176. return nil, err
  118177. }
  118178. return ret, nil
  118179. // {
  118180. // "description": "Creates a new resource policy.",
  118181. // "httpMethod": "POST",
  118182. // "id": "compute.resourcePolicies.insert",
  118183. // "parameterOrder": [
  118184. // "project",
  118185. // "region"
  118186. // ],
  118187. // "parameters": {
  118188. // "project": {
  118189. // "description": "Project ID for this request.",
  118190. // "location": "path",
  118191. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118192. // "required": true,
  118193. // "type": "string"
  118194. // },
  118195. // "region": {
  118196. // "description": "Name of the region for this request.",
  118197. // "location": "path",
  118198. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118199. // "required": true,
  118200. // "type": "string"
  118201. // },
  118202. // "requestId": {
  118203. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  118204. // "location": "query",
  118205. // "type": "string"
  118206. // }
  118207. // },
  118208. // "path": "{project}/regions/{region}/resourcePolicies",
  118209. // "request": {
  118210. // "$ref": "ResourcePolicy"
  118211. // },
  118212. // "response": {
  118213. // "$ref": "Operation"
  118214. // },
  118215. // "scopes": [
  118216. // "https://www.googleapis.com/auth/cloud-platform",
  118217. // "https://www.googleapis.com/auth/compute"
  118218. // ]
  118219. // }
  118220. }
  118221. // method id "compute.resourcePolicies.list":
  118222. type ResourcePoliciesListCall struct {
  118223. s *Service
  118224. project string
  118225. region string
  118226. urlParams_ gensupport.URLParams
  118227. ifNoneMatch_ string
  118228. ctx_ context.Context
  118229. header_ http.Header
  118230. }
  118231. // List: A list all the resource policies that have been configured for
  118232. // the specified project in specified region.
  118233. func (r *ResourcePoliciesService) List(project string, region string) *ResourcePoliciesListCall {
  118234. c := &ResourcePoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118235. c.project = project
  118236. c.region = region
  118237. return c
  118238. }
  118239. // Filter sets the optional parameter "filter": A filter expression that
  118240. // filters resources listed in the response. The expression must specify
  118241. // the field name, a comparison operator, and the value that you want to
  118242. // use for filtering. The value must be a string, a number, or a
  118243. // boolean. The comparison operator must be either =, !=, >, or <.
  118244. //
  118245. // For example, if you are filtering Compute Engine instances, you can
  118246. // exclude instances named example-instance by specifying name !=
  118247. // example-instance.
  118248. //
  118249. // You can also filter nested fields. For example, you could specify
  118250. // scheduling.automaticRestart = false to include instances only if they
  118251. // are not scheduled for automatic restarts. You can use filtering on
  118252. // nested fields to filter based on resource labels.
  118253. //
  118254. // To filter on multiple expressions, provide each separate expression
  118255. // within parentheses. For example, (scheduling.automaticRestart = true)
  118256. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118257. // AND expression. However, you can include AND and OR expressions
  118258. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118259. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118260. // true).
  118261. func (c *ResourcePoliciesListCall) Filter(filter string) *ResourcePoliciesListCall {
  118262. c.urlParams_.Set("filter", filter)
  118263. return c
  118264. }
  118265. // MaxResults sets the optional parameter "maxResults": The maximum
  118266. // number of results per page that should be returned. If the number of
  118267. // available results is larger than maxResults, Compute Engine returns a
  118268. // nextPageToken that can be used to get the next page of results in
  118269. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118270. // (Default: 500)
  118271. func (c *ResourcePoliciesListCall) MaxResults(maxResults int64) *ResourcePoliciesListCall {
  118272. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118273. return c
  118274. }
  118275. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118276. // a certain order. By default, results are returned in alphanumerical
  118277. // order based on the resource name.
  118278. //
  118279. // You can also sort results in descending order based on the creation
  118280. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118281. // based on the creationTimestamp field in reverse chronological order
  118282. // (newest result first). Use this to sort resources like operations so
  118283. // that the newest operation is returned first.
  118284. //
  118285. // Currently, only sorting by name or creationTimestamp desc is
  118286. // supported.
  118287. func (c *ResourcePoliciesListCall) OrderBy(orderBy string) *ResourcePoliciesListCall {
  118288. c.urlParams_.Set("orderBy", orderBy)
  118289. return c
  118290. }
  118291. // PageToken sets the optional parameter "pageToken": Specifies a page
  118292. // token to use. Set pageToken to the nextPageToken returned by a
  118293. // previous list request to get the next page of results.
  118294. func (c *ResourcePoliciesListCall) PageToken(pageToken string) *ResourcePoliciesListCall {
  118295. c.urlParams_.Set("pageToken", pageToken)
  118296. return c
  118297. }
  118298. // Fields allows partial responses to be retrieved. See
  118299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118300. // for more information.
  118301. func (c *ResourcePoliciesListCall) Fields(s ...googleapi.Field) *ResourcePoliciesListCall {
  118302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118303. return c
  118304. }
  118305. // IfNoneMatch sets the optional parameter which makes the operation
  118306. // fail if the object's ETag matches the given value. This is useful for
  118307. // getting updates only after the object has changed since the last
  118308. // request. Use googleapi.IsNotModified to check whether the response
  118309. // error from Do is the result of In-None-Match.
  118310. func (c *ResourcePoliciesListCall) IfNoneMatch(entityTag string) *ResourcePoliciesListCall {
  118311. c.ifNoneMatch_ = entityTag
  118312. return c
  118313. }
  118314. // Context sets the context to be used in this call's Do method. Any
  118315. // pending HTTP request will be aborted if the provided context is
  118316. // canceled.
  118317. func (c *ResourcePoliciesListCall) Context(ctx context.Context) *ResourcePoliciesListCall {
  118318. c.ctx_ = ctx
  118319. return c
  118320. }
  118321. // Header returns an http.Header that can be modified by the caller to
  118322. // add HTTP headers to the request.
  118323. func (c *ResourcePoliciesListCall) Header() http.Header {
  118324. if c.header_ == nil {
  118325. c.header_ = make(http.Header)
  118326. }
  118327. return c.header_
  118328. }
  118329. func (c *ResourcePoliciesListCall) doRequest(alt string) (*http.Response, error) {
  118330. reqHeaders := make(http.Header)
  118331. for k, v := range c.header_ {
  118332. reqHeaders[k] = v
  118333. }
  118334. reqHeaders.Set("User-Agent", c.s.userAgent())
  118335. if c.ifNoneMatch_ != "" {
  118336. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118337. }
  118338. var body io.Reader = nil
  118339. c.urlParams_.Set("alt", alt)
  118340. c.urlParams_.Set("prettyPrint", "false")
  118341. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies")
  118342. urls += "?" + c.urlParams_.Encode()
  118343. req, err := http.NewRequest("GET", urls, body)
  118344. if err != nil {
  118345. return nil, err
  118346. }
  118347. req.Header = reqHeaders
  118348. googleapi.Expand(req.URL, map[string]string{
  118349. "project": c.project,
  118350. "region": c.region,
  118351. })
  118352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118353. }
  118354. // Do executes the "compute.resourcePolicies.list" call.
  118355. // Exactly one of *ResourcePolicyList or error will be non-nil. Any
  118356. // non-2xx status code is an error. Response headers are in either
  118357. // *ResourcePolicyList.ServerResponse.Header or (if a response was
  118358. // returned at all) in error.(*googleapi.Error).Header. Use
  118359. // googleapi.IsNotModified to check whether the returned error was
  118360. // because http.StatusNotModified was returned.
  118361. func (c *ResourcePoliciesListCall) Do(opts ...googleapi.CallOption) (*ResourcePolicyList, error) {
  118362. gensupport.SetOptions(c.urlParams_, opts...)
  118363. res, err := c.doRequest("json")
  118364. if res != nil && res.StatusCode == http.StatusNotModified {
  118365. if res.Body != nil {
  118366. res.Body.Close()
  118367. }
  118368. return nil, &googleapi.Error{
  118369. Code: res.StatusCode,
  118370. Header: res.Header,
  118371. }
  118372. }
  118373. if err != nil {
  118374. return nil, err
  118375. }
  118376. defer googleapi.CloseBody(res)
  118377. if err := googleapi.CheckResponse(res); err != nil {
  118378. return nil, err
  118379. }
  118380. ret := &ResourcePolicyList{
  118381. ServerResponse: googleapi.ServerResponse{
  118382. Header: res.Header,
  118383. HTTPStatusCode: res.StatusCode,
  118384. },
  118385. }
  118386. target := &ret
  118387. if err := gensupport.DecodeResponse(target, res); err != nil {
  118388. return nil, err
  118389. }
  118390. return ret, nil
  118391. // {
  118392. // "description": "A list all the resource policies that have been configured for the specified project in specified region.",
  118393. // "httpMethod": "GET",
  118394. // "id": "compute.resourcePolicies.list",
  118395. // "parameterOrder": [
  118396. // "project",
  118397. // "region"
  118398. // ],
  118399. // "parameters": {
  118400. // "filter": {
  118401. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  118402. // "location": "query",
  118403. // "type": "string"
  118404. // },
  118405. // "maxResults": {
  118406. // "default": "500",
  118407. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  118408. // "format": "uint32",
  118409. // "location": "query",
  118410. // "minimum": "0",
  118411. // "type": "integer"
  118412. // },
  118413. // "orderBy": {
  118414. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  118415. // "location": "query",
  118416. // "type": "string"
  118417. // },
  118418. // "pageToken": {
  118419. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  118420. // "location": "query",
  118421. // "type": "string"
  118422. // },
  118423. // "project": {
  118424. // "description": "Project ID for this request.",
  118425. // "location": "path",
  118426. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118427. // "required": true,
  118428. // "type": "string"
  118429. // },
  118430. // "region": {
  118431. // "description": "Name of the region for this request.",
  118432. // "location": "path",
  118433. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118434. // "required": true,
  118435. // "type": "string"
  118436. // }
  118437. // },
  118438. // "path": "{project}/regions/{region}/resourcePolicies",
  118439. // "response": {
  118440. // "$ref": "ResourcePolicyList"
  118441. // },
  118442. // "scopes": [
  118443. // "https://www.googleapis.com/auth/cloud-platform",
  118444. // "https://www.googleapis.com/auth/compute",
  118445. // "https://www.googleapis.com/auth/compute.readonly"
  118446. // ]
  118447. // }
  118448. }
  118449. // Pages invokes f for each page of results.
  118450. // A non-nil error returned from f will halt the iteration.
  118451. // The provided context supersedes any context provided to the Context method.
  118452. func (c *ResourcePoliciesListCall) Pages(ctx context.Context, f func(*ResourcePolicyList) error) error {
  118453. c.ctx_ = ctx
  118454. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  118455. for {
  118456. x, err := c.Do()
  118457. if err != nil {
  118458. return err
  118459. }
  118460. if err := f(x); err != nil {
  118461. return err
  118462. }
  118463. if x.NextPageToken == "" {
  118464. return nil
  118465. }
  118466. c.PageToken(x.NextPageToken)
  118467. }
  118468. }
  118469. // method id "compute.resourcePolicies.setIamPolicy":
  118470. type ResourcePoliciesSetIamPolicyCall struct {
  118471. s *Service
  118472. project string
  118473. region string
  118474. resource string
  118475. regionsetpolicyrequest *RegionSetPolicyRequest
  118476. urlParams_ gensupport.URLParams
  118477. ctx_ context.Context
  118478. header_ http.Header
  118479. }
  118480. // SetIamPolicy: Sets the access control policy on the specified
  118481. // resource. Replaces any existing policy.
  118482. func (r *ResourcePoliciesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *ResourcePoliciesSetIamPolicyCall {
  118483. c := &ResourcePoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118484. c.project = project
  118485. c.region = region
  118486. c.resource = resource
  118487. c.regionsetpolicyrequest = regionsetpolicyrequest
  118488. return c
  118489. }
  118490. // Fields allows partial responses to be retrieved. See
  118491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118492. // for more information.
  118493. func (c *ResourcePoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ResourcePoliciesSetIamPolicyCall {
  118494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118495. return c
  118496. }
  118497. // Context sets the context to be used in this call's Do method. Any
  118498. // pending HTTP request will be aborted if the provided context is
  118499. // canceled.
  118500. func (c *ResourcePoliciesSetIamPolicyCall) Context(ctx context.Context) *ResourcePoliciesSetIamPolicyCall {
  118501. c.ctx_ = ctx
  118502. return c
  118503. }
  118504. // Header returns an http.Header that can be modified by the caller to
  118505. // add HTTP headers to the request.
  118506. func (c *ResourcePoliciesSetIamPolicyCall) Header() http.Header {
  118507. if c.header_ == nil {
  118508. c.header_ = make(http.Header)
  118509. }
  118510. return c.header_
  118511. }
  118512. func (c *ResourcePoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  118513. reqHeaders := make(http.Header)
  118514. for k, v := range c.header_ {
  118515. reqHeaders[k] = v
  118516. }
  118517. reqHeaders.Set("User-Agent", c.s.userAgent())
  118518. var body io.Reader = nil
  118519. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  118520. if err != nil {
  118521. return nil, err
  118522. }
  118523. reqHeaders.Set("Content-Type", "application/json")
  118524. c.urlParams_.Set("alt", alt)
  118525. c.urlParams_.Set("prettyPrint", "false")
  118526. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy")
  118527. urls += "?" + c.urlParams_.Encode()
  118528. req, err := http.NewRequest("POST", urls, body)
  118529. if err != nil {
  118530. return nil, err
  118531. }
  118532. req.Header = reqHeaders
  118533. googleapi.Expand(req.URL, map[string]string{
  118534. "project": c.project,
  118535. "region": c.region,
  118536. "resource": c.resource,
  118537. })
  118538. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118539. }
  118540. // Do executes the "compute.resourcePolicies.setIamPolicy" call.
  118541. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  118542. // code is an error. Response headers are in either
  118543. // *Policy.ServerResponse.Header or (if a response was returned at all)
  118544. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  118545. // check whether the returned error was because http.StatusNotModified
  118546. // was returned.
  118547. func (c *ResourcePoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  118548. gensupport.SetOptions(c.urlParams_, opts...)
  118549. res, err := c.doRequest("json")
  118550. if res != nil && res.StatusCode == http.StatusNotModified {
  118551. if res.Body != nil {
  118552. res.Body.Close()
  118553. }
  118554. return nil, &googleapi.Error{
  118555. Code: res.StatusCode,
  118556. Header: res.Header,
  118557. }
  118558. }
  118559. if err != nil {
  118560. return nil, err
  118561. }
  118562. defer googleapi.CloseBody(res)
  118563. if err := googleapi.CheckResponse(res); err != nil {
  118564. return nil, err
  118565. }
  118566. ret := &Policy{
  118567. ServerResponse: googleapi.ServerResponse{
  118568. Header: res.Header,
  118569. HTTPStatusCode: res.StatusCode,
  118570. },
  118571. }
  118572. target := &ret
  118573. if err := gensupport.DecodeResponse(target, res); err != nil {
  118574. return nil, err
  118575. }
  118576. return ret, nil
  118577. // {
  118578. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  118579. // "httpMethod": "POST",
  118580. // "id": "compute.resourcePolicies.setIamPolicy",
  118581. // "parameterOrder": [
  118582. // "project",
  118583. // "region",
  118584. // "resource"
  118585. // ],
  118586. // "parameters": {
  118587. // "project": {
  118588. // "description": "Project ID for this request.",
  118589. // "location": "path",
  118590. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118591. // "required": true,
  118592. // "type": "string"
  118593. // },
  118594. // "region": {
  118595. // "description": "The name of the region for this request.",
  118596. // "location": "path",
  118597. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118598. // "required": true,
  118599. // "type": "string"
  118600. // },
  118601. // "resource": {
  118602. // "description": "Name or id of the resource for this request.",
  118603. // "location": "path",
  118604. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118605. // "required": true,
  118606. // "type": "string"
  118607. // }
  118608. // },
  118609. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy",
  118610. // "request": {
  118611. // "$ref": "RegionSetPolicyRequest"
  118612. // },
  118613. // "response": {
  118614. // "$ref": "Policy"
  118615. // },
  118616. // "scopes": [
  118617. // "https://www.googleapis.com/auth/cloud-platform",
  118618. // "https://www.googleapis.com/auth/compute"
  118619. // ]
  118620. // }
  118621. }
  118622. // method id "compute.resourcePolicies.testIamPermissions":
  118623. type ResourcePoliciesTestIamPermissionsCall struct {
  118624. s *Service
  118625. project string
  118626. region string
  118627. resource string
  118628. testpermissionsrequest *TestPermissionsRequest
  118629. urlParams_ gensupport.URLParams
  118630. ctx_ context.Context
  118631. header_ http.Header
  118632. }
  118633. // TestIamPermissions: Returns permissions that a caller has on the
  118634. // specified resource.
  118635. func (r *ResourcePoliciesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ResourcePoliciesTestIamPermissionsCall {
  118636. c := &ResourcePoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118637. c.project = project
  118638. c.region = region
  118639. c.resource = resource
  118640. c.testpermissionsrequest = testpermissionsrequest
  118641. return c
  118642. }
  118643. // Fields allows partial responses to be retrieved. See
  118644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118645. // for more information.
  118646. func (c *ResourcePoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ResourcePoliciesTestIamPermissionsCall {
  118647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118648. return c
  118649. }
  118650. // Context sets the context to be used in this call's Do method. Any
  118651. // pending HTTP request will be aborted if the provided context is
  118652. // canceled.
  118653. func (c *ResourcePoliciesTestIamPermissionsCall) Context(ctx context.Context) *ResourcePoliciesTestIamPermissionsCall {
  118654. c.ctx_ = ctx
  118655. return c
  118656. }
  118657. // Header returns an http.Header that can be modified by the caller to
  118658. // add HTTP headers to the request.
  118659. func (c *ResourcePoliciesTestIamPermissionsCall) Header() http.Header {
  118660. if c.header_ == nil {
  118661. c.header_ = make(http.Header)
  118662. }
  118663. return c.header_
  118664. }
  118665. func (c *ResourcePoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  118666. reqHeaders := make(http.Header)
  118667. for k, v := range c.header_ {
  118668. reqHeaders[k] = v
  118669. }
  118670. reqHeaders.Set("User-Agent", c.s.userAgent())
  118671. var body io.Reader = nil
  118672. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  118673. if err != nil {
  118674. return nil, err
  118675. }
  118676. reqHeaders.Set("Content-Type", "application/json")
  118677. c.urlParams_.Set("alt", alt)
  118678. c.urlParams_.Set("prettyPrint", "false")
  118679. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions")
  118680. urls += "?" + c.urlParams_.Encode()
  118681. req, err := http.NewRequest("POST", urls, body)
  118682. if err != nil {
  118683. return nil, err
  118684. }
  118685. req.Header = reqHeaders
  118686. googleapi.Expand(req.URL, map[string]string{
  118687. "project": c.project,
  118688. "region": c.region,
  118689. "resource": c.resource,
  118690. })
  118691. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118692. }
  118693. // Do executes the "compute.resourcePolicies.testIamPermissions" call.
  118694. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  118695. // non-2xx status code is an error. Response headers are in either
  118696. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  118697. // returned at all) in error.(*googleapi.Error).Header. Use
  118698. // googleapi.IsNotModified to check whether the returned error was
  118699. // because http.StatusNotModified was returned.
  118700. func (c *ResourcePoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  118701. gensupport.SetOptions(c.urlParams_, opts...)
  118702. res, err := c.doRequest("json")
  118703. if res != nil && res.StatusCode == http.StatusNotModified {
  118704. if res.Body != nil {
  118705. res.Body.Close()
  118706. }
  118707. return nil, &googleapi.Error{
  118708. Code: res.StatusCode,
  118709. Header: res.Header,
  118710. }
  118711. }
  118712. if err != nil {
  118713. return nil, err
  118714. }
  118715. defer googleapi.CloseBody(res)
  118716. if err := googleapi.CheckResponse(res); err != nil {
  118717. return nil, err
  118718. }
  118719. ret := &TestPermissionsResponse{
  118720. ServerResponse: googleapi.ServerResponse{
  118721. Header: res.Header,
  118722. HTTPStatusCode: res.StatusCode,
  118723. },
  118724. }
  118725. target := &ret
  118726. if err := gensupport.DecodeResponse(target, res); err != nil {
  118727. return nil, err
  118728. }
  118729. return ret, nil
  118730. // {
  118731. // "description": "Returns permissions that a caller has on the specified resource.",
  118732. // "httpMethod": "POST",
  118733. // "id": "compute.resourcePolicies.testIamPermissions",
  118734. // "parameterOrder": [
  118735. // "project",
  118736. // "region",
  118737. // "resource"
  118738. // ],
  118739. // "parameters": {
  118740. // "project": {
  118741. // "description": "Project ID for this request.",
  118742. // "location": "path",
  118743. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118744. // "required": true,
  118745. // "type": "string"
  118746. // },
  118747. // "region": {
  118748. // "description": "The name of the region for this request.",
  118749. // "location": "path",
  118750. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  118751. // "required": true,
  118752. // "type": "string"
  118753. // },
  118754. // "resource": {
  118755. // "description": "Name or id of the resource for this request.",
  118756. // "location": "path",
  118757. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  118758. // "required": true,
  118759. // "type": "string"
  118760. // }
  118761. // },
  118762. // "path": "{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions",
  118763. // "request": {
  118764. // "$ref": "TestPermissionsRequest"
  118765. // },
  118766. // "response": {
  118767. // "$ref": "TestPermissionsResponse"
  118768. // },
  118769. // "scopes": [
  118770. // "https://www.googleapis.com/auth/cloud-platform",
  118771. // "https://www.googleapis.com/auth/compute",
  118772. // "https://www.googleapis.com/auth/compute.readonly"
  118773. // ]
  118774. // }
  118775. }
  118776. // method id "compute.routers.aggregatedList":
  118777. type RoutersAggregatedListCall struct {
  118778. s *Service
  118779. project string
  118780. urlParams_ gensupport.URLParams
  118781. ifNoneMatch_ string
  118782. ctx_ context.Context
  118783. header_ http.Header
  118784. }
  118785. // AggregatedList: Retrieves an aggregated list of routers.
  118786. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  118787. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  118788. c.project = project
  118789. return c
  118790. }
  118791. // Filter sets the optional parameter "filter": A filter expression that
  118792. // filters resources listed in the response. The expression must specify
  118793. // the field name, a comparison operator, and the value that you want to
  118794. // use for filtering. The value must be a string, a number, or a
  118795. // boolean. The comparison operator must be either =, !=, >, or <.
  118796. //
  118797. // For example, if you are filtering Compute Engine instances, you can
  118798. // exclude instances named example-instance by specifying name !=
  118799. // example-instance.
  118800. //
  118801. // You can also filter nested fields. For example, you could specify
  118802. // scheduling.automaticRestart = false to include instances only if they
  118803. // are not scheduled for automatic restarts. You can use filtering on
  118804. // nested fields to filter based on resource labels.
  118805. //
  118806. // To filter on multiple expressions, provide each separate expression
  118807. // within parentheses. For example, (scheduling.automaticRestart = true)
  118808. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  118809. // AND expression. However, you can include AND and OR expressions
  118810. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  118811. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  118812. // true).
  118813. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  118814. c.urlParams_.Set("filter", filter)
  118815. return c
  118816. }
  118817. // MaxResults sets the optional parameter "maxResults": The maximum
  118818. // number of results per page that should be returned. If the number of
  118819. // available results is larger than maxResults, Compute Engine returns a
  118820. // nextPageToken that can be used to get the next page of results in
  118821. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  118822. // (Default: 500)
  118823. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  118824. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  118825. return c
  118826. }
  118827. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  118828. // a certain order. By default, results are returned in alphanumerical
  118829. // order based on the resource name.
  118830. //
  118831. // You can also sort results in descending order based on the creation
  118832. // timestamp using orderBy="creationTimestamp desc". This sorts results
  118833. // based on the creationTimestamp field in reverse chronological order
  118834. // (newest result first). Use this to sort resources like operations so
  118835. // that the newest operation is returned first.
  118836. //
  118837. // Currently, only sorting by name or creationTimestamp desc is
  118838. // supported.
  118839. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  118840. c.urlParams_.Set("orderBy", orderBy)
  118841. return c
  118842. }
  118843. // PageToken sets the optional parameter "pageToken": Specifies a page
  118844. // token to use. Set pageToken to the nextPageToken returned by a
  118845. // previous list request to get the next page of results.
  118846. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  118847. c.urlParams_.Set("pageToken", pageToken)
  118848. return c
  118849. }
  118850. // Fields allows partial responses to be retrieved. See
  118851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  118852. // for more information.
  118853. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  118854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  118855. return c
  118856. }
  118857. // IfNoneMatch sets the optional parameter which makes the operation
  118858. // fail if the object's ETag matches the given value. This is useful for
  118859. // getting updates only after the object has changed since the last
  118860. // request. Use googleapi.IsNotModified to check whether the response
  118861. // error from Do is the result of In-None-Match.
  118862. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  118863. c.ifNoneMatch_ = entityTag
  118864. return c
  118865. }
  118866. // Context sets the context to be used in this call's Do method. Any
  118867. // pending HTTP request will be aborted if the provided context is
  118868. // canceled.
  118869. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  118870. c.ctx_ = ctx
  118871. return c
  118872. }
  118873. // Header returns an http.Header that can be modified by the caller to
  118874. // add HTTP headers to the request.
  118875. func (c *RoutersAggregatedListCall) Header() http.Header {
  118876. if c.header_ == nil {
  118877. c.header_ = make(http.Header)
  118878. }
  118879. return c.header_
  118880. }
  118881. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  118882. reqHeaders := make(http.Header)
  118883. for k, v := range c.header_ {
  118884. reqHeaders[k] = v
  118885. }
  118886. reqHeaders.Set("User-Agent", c.s.userAgent())
  118887. if c.ifNoneMatch_ != "" {
  118888. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  118889. }
  118890. var body io.Reader = nil
  118891. c.urlParams_.Set("alt", alt)
  118892. c.urlParams_.Set("prettyPrint", "false")
  118893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  118894. urls += "?" + c.urlParams_.Encode()
  118895. req, err := http.NewRequest("GET", urls, body)
  118896. if err != nil {
  118897. return nil, err
  118898. }
  118899. req.Header = reqHeaders
  118900. googleapi.Expand(req.URL, map[string]string{
  118901. "project": c.project,
  118902. })
  118903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  118904. }
  118905. // Do executes the "compute.routers.aggregatedList" call.
  118906. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  118907. // non-2xx status code is an error. Response headers are in either
  118908. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  118909. // returned at all) in error.(*googleapi.Error).Header. Use
  118910. // googleapi.IsNotModified to check whether the returned error was
  118911. // because http.StatusNotModified was returned.
  118912. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  118913. gensupport.SetOptions(c.urlParams_, opts...)
  118914. res, err := c.doRequest("json")
  118915. if res != nil && res.StatusCode == http.StatusNotModified {
  118916. if res.Body != nil {
  118917. res.Body.Close()
  118918. }
  118919. return nil, &googleapi.Error{
  118920. Code: res.StatusCode,
  118921. Header: res.Header,
  118922. }
  118923. }
  118924. if err != nil {
  118925. return nil, err
  118926. }
  118927. defer googleapi.CloseBody(res)
  118928. if err := googleapi.CheckResponse(res); err != nil {
  118929. return nil, err
  118930. }
  118931. ret := &RouterAggregatedList{
  118932. ServerResponse: googleapi.ServerResponse{
  118933. Header: res.Header,
  118934. HTTPStatusCode: res.StatusCode,
  118935. },
  118936. }
  118937. target := &ret
  118938. if err := gensupport.DecodeResponse(target, res); err != nil {
  118939. return nil, err
  118940. }
  118941. return ret, nil
  118942. // {
  118943. // "description": "Retrieves an aggregated list of routers.",
  118944. // "httpMethod": "GET",
  118945. // "id": "compute.routers.aggregatedList",
  118946. // "parameterOrder": [
  118947. // "project"
  118948. // ],
  118949. // "parameters": {
  118950. // "filter": {
  118951. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  118952. // "location": "query",
  118953. // "type": "string"
  118954. // },
  118955. // "maxResults": {
  118956. // "default": "500",
  118957. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  118958. // "format": "uint32",
  118959. // "location": "query",
  118960. // "minimum": "0",
  118961. // "type": "integer"
  118962. // },
  118963. // "orderBy": {
  118964. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  118965. // "location": "query",
  118966. // "type": "string"
  118967. // },
  118968. // "pageToken": {
  118969. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  118970. // "location": "query",
  118971. // "type": "string"
  118972. // },
  118973. // "project": {
  118974. // "description": "Project ID for this request.",
  118975. // "location": "path",
  118976. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  118977. // "required": true,
  118978. // "type": "string"
  118979. // }
  118980. // },
  118981. // "path": "{project}/aggregated/routers",
  118982. // "response": {
  118983. // "$ref": "RouterAggregatedList"
  118984. // },
  118985. // "scopes": [
  118986. // "https://www.googleapis.com/auth/cloud-platform",
  118987. // "https://www.googleapis.com/auth/compute",
  118988. // "https://www.googleapis.com/auth/compute.readonly"
  118989. // ]
  118990. // }
  118991. }
  118992. // Pages invokes f for each page of results.
  118993. // A non-nil error returned from f will halt the iteration.
  118994. // The provided context supersedes any context provided to the Context method.
  118995. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  118996. c.ctx_ = ctx
  118997. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  118998. for {
  118999. x, err := c.Do()
  119000. if err != nil {
  119001. return err
  119002. }
  119003. if err := f(x); err != nil {
  119004. return err
  119005. }
  119006. if x.NextPageToken == "" {
  119007. return nil
  119008. }
  119009. c.PageToken(x.NextPageToken)
  119010. }
  119011. }
  119012. // method id "compute.routers.delete":
  119013. type RoutersDeleteCall struct {
  119014. s *Service
  119015. project string
  119016. region string
  119017. router string
  119018. urlParams_ gensupport.URLParams
  119019. ctx_ context.Context
  119020. header_ http.Header
  119021. }
  119022. // Delete: Deletes the specified Router resource.
  119023. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  119024. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119025. c.project = project
  119026. c.region = region
  119027. c.router = router
  119028. return c
  119029. }
  119030. // RequestId sets the optional parameter "requestId": An optional
  119031. // request ID to identify requests. Specify a unique request ID so that
  119032. // if you must retry your request, the server will know to ignore the
  119033. // request if it has already been completed.
  119034. //
  119035. // For example, consider a situation where you make an initial request
  119036. // and the request times out. If you make the request again with the
  119037. // same request ID, the server can check if original operation with the
  119038. // same request ID was received, and if so, will ignore the second
  119039. // request. This prevents clients from accidentally creating duplicate
  119040. // commitments.
  119041. //
  119042. // The request ID must be a valid UUID with the exception that zero UUID
  119043. // is not supported (00000000-0000-0000-0000-000000000000).
  119044. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  119045. c.urlParams_.Set("requestId", requestId)
  119046. return c
  119047. }
  119048. // Fields allows partial responses to be retrieved. See
  119049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119050. // for more information.
  119051. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  119052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119053. return c
  119054. }
  119055. // Context sets the context to be used in this call's Do method. Any
  119056. // pending HTTP request will be aborted if the provided context is
  119057. // canceled.
  119058. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  119059. c.ctx_ = ctx
  119060. return c
  119061. }
  119062. // Header returns an http.Header that can be modified by the caller to
  119063. // add HTTP headers to the request.
  119064. func (c *RoutersDeleteCall) Header() http.Header {
  119065. if c.header_ == nil {
  119066. c.header_ = make(http.Header)
  119067. }
  119068. return c.header_
  119069. }
  119070. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  119071. reqHeaders := make(http.Header)
  119072. for k, v := range c.header_ {
  119073. reqHeaders[k] = v
  119074. }
  119075. reqHeaders.Set("User-Agent", c.s.userAgent())
  119076. var body io.Reader = nil
  119077. c.urlParams_.Set("alt", alt)
  119078. c.urlParams_.Set("prettyPrint", "false")
  119079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  119080. urls += "?" + c.urlParams_.Encode()
  119081. req, err := http.NewRequest("DELETE", urls, body)
  119082. if err != nil {
  119083. return nil, err
  119084. }
  119085. req.Header = reqHeaders
  119086. googleapi.Expand(req.URL, map[string]string{
  119087. "project": c.project,
  119088. "region": c.region,
  119089. "router": c.router,
  119090. })
  119091. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119092. }
  119093. // Do executes the "compute.routers.delete" call.
  119094. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119095. // status code is an error. Response headers are in either
  119096. // *Operation.ServerResponse.Header or (if a response was returned at
  119097. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119098. // to check whether the returned error was because
  119099. // http.StatusNotModified was returned.
  119100. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119101. gensupport.SetOptions(c.urlParams_, opts...)
  119102. res, err := c.doRequest("json")
  119103. if res != nil && res.StatusCode == http.StatusNotModified {
  119104. if res.Body != nil {
  119105. res.Body.Close()
  119106. }
  119107. return nil, &googleapi.Error{
  119108. Code: res.StatusCode,
  119109. Header: res.Header,
  119110. }
  119111. }
  119112. if err != nil {
  119113. return nil, err
  119114. }
  119115. defer googleapi.CloseBody(res)
  119116. if err := googleapi.CheckResponse(res); err != nil {
  119117. return nil, err
  119118. }
  119119. ret := &Operation{
  119120. ServerResponse: googleapi.ServerResponse{
  119121. Header: res.Header,
  119122. HTTPStatusCode: res.StatusCode,
  119123. },
  119124. }
  119125. target := &ret
  119126. if err := gensupport.DecodeResponse(target, res); err != nil {
  119127. return nil, err
  119128. }
  119129. return ret, nil
  119130. // {
  119131. // "description": "Deletes the specified Router resource.",
  119132. // "httpMethod": "DELETE",
  119133. // "id": "compute.routers.delete",
  119134. // "parameterOrder": [
  119135. // "project",
  119136. // "region",
  119137. // "router"
  119138. // ],
  119139. // "parameters": {
  119140. // "project": {
  119141. // "description": "Project ID for this request.",
  119142. // "location": "path",
  119143. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119144. // "required": true,
  119145. // "type": "string"
  119146. // },
  119147. // "region": {
  119148. // "description": "Name of the region for this request.",
  119149. // "location": "path",
  119150. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119151. // "required": true,
  119152. // "type": "string"
  119153. // },
  119154. // "requestId": {
  119155. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119156. // "location": "query",
  119157. // "type": "string"
  119158. // },
  119159. // "router": {
  119160. // "description": "Name of the Router resource to delete.",
  119161. // "location": "path",
  119162. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  119163. // "required": true,
  119164. // "type": "string"
  119165. // }
  119166. // },
  119167. // "path": "{project}/regions/{region}/routers/{router}",
  119168. // "response": {
  119169. // "$ref": "Operation"
  119170. // },
  119171. // "scopes": [
  119172. // "https://www.googleapis.com/auth/cloud-platform",
  119173. // "https://www.googleapis.com/auth/compute"
  119174. // ]
  119175. // }
  119176. }
  119177. // method id "compute.routers.get":
  119178. type RoutersGetCall struct {
  119179. s *Service
  119180. project string
  119181. region string
  119182. router string
  119183. urlParams_ gensupport.URLParams
  119184. ifNoneMatch_ string
  119185. ctx_ context.Context
  119186. header_ http.Header
  119187. }
  119188. // Get: Returns the specified Router resource. Gets a list of available
  119189. // routers by making a list() request.
  119190. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  119191. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119192. c.project = project
  119193. c.region = region
  119194. c.router = router
  119195. return c
  119196. }
  119197. // Fields allows partial responses to be retrieved. See
  119198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119199. // for more information.
  119200. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  119201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119202. return c
  119203. }
  119204. // IfNoneMatch sets the optional parameter which makes the operation
  119205. // fail if the object's ETag matches the given value. This is useful for
  119206. // getting updates only after the object has changed since the last
  119207. // request. Use googleapi.IsNotModified to check whether the response
  119208. // error from Do is the result of In-None-Match.
  119209. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  119210. c.ifNoneMatch_ = entityTag
  119211. return c
  119212. }
  119213. // Context sets the context to be used in this call's Do method. Any
  119214. // pending HTTP request will be aborted if the provided context is
  119215. // canceled.
  119216. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  119217. c.ctx_ = ctx
  119218. return c
  119219. }
  119220. // Header returns an http.Header that can be modified by the caller to
  119221. // add HTTP headers to the request.
  119222. func (c *RoutersGetCall) Header() http.Header {
  119223. if c.header_ == nil {
  119224. c.header_ = make(http.Header)
  119225. }
  119226. return c.header_
  119227. }
  119228. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  119229. reqHeaders := make(http.Header)
  119230. for k, v := range c.header_ {
  119231. reqHeaders[k] = v
  119232. }
  119233. reqHeaders.Set("User-Agent", c.s.userAgent())
  119234. if c.ifNoneMatch_ != "" {
  119235. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119236. }
  119237. var body io.Reader = nil
  119238. c.urlParams_.Set("alt", alt)
  119239. c.urlParams_.Set("prettyPrint", "false")
  119240. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  119241. urls += "?" + c.urlParams_.Encode()
  119242. req, err := http.NewRequest("GET", urls, body)
  119243. if err != nil {
  119244. return nil, err
  119245. }
  119246. req.Header = reqHeaders
  119247. googleapi.Expand(req.URL, map[string]string{
  119248. "project": c.project,
  119249. "region": c.region,
  119250. "router": c.router,
  119251. })
  119252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119253. }
  119254. // Do executes the "compute.routers.get" call.
  119255. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  119256. // code is an error. Response headers are in either
  119257. // *Router.ServerResponse.Header or (if a response was returned at all)
  119258. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  119259. // check whether the returned error was because http.StatusNotModified
  119260. // was returned.
  119261. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  119262. gensupport.SetOptions(c.urlParams_, opts...)
  119263. res, err := c.doRequest("json")
  119264. if res != nil && res.StatusCode == http.StatusNotModified {
  119265. if res.Body != nil {
  119266. res.Body.Close()
  119267. }
  119268. return nil, &googleapi.Error{
  119269. Code: res.StatusCode,
  119270. Header: res.Header,
  119271. }
  119272. }
  119273. if err != nil {
  119274. return nil, err
  119275. }
  119276. defer googleapi.CloseBody(res)
  119277. if err := googleapi.CheckResponse(res); err != nil {
  119278. return nil, err
  119279. }
  119280. ret := &Router{
  119281. ServerResponse: googleapi.ServerResponse{
  119282. Header: res.Header,
  119283. HTTPStatusCode: res.StatusCode,
  119284. },
  119285. }
  119286. target := &ret
  119287. if err := gensupport.DecodeResponse(target, res); err != nil {
  119288. return nil, err
  119289. }
  119290. return ret, nil
  119291. // {
  119292. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  119293. // "httpMethod": "GET",
  119294. // "id": "compute.routers.get",
  119295. // "parameterOrder": [
  119296. // "project",
  119297. // "region",
  119298. // "router"
  119299. // ],
  119300. // "parameters": {
  119301. // "project": {
  119302. // "description": "Project ID for this request.",
  119303. // "location": "path",
  119304. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119305. // "required": true,
  119306. // "type": "string"
  119307. // },
  119308. // "region": {
  119309. // "description": "Name of the region for this request.",
  119310. // "location": "path",
  119311. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119312. // "required": true,
  119313. // "type": "string"
  119314. // },
  119315. // "router": {
  119316. // "description": "Name of the Router resource to return.",
  119317. // "location": "path",
  119318. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  119319. // "required": true,
  119320. // "type": "string"
  119321. // }
  119322. // },
  119323. // "path": "{project}/regions/{region}/routers/{router}",
  119324. // "response": {
  119325. // "$ref": "Router"
  119326. // },
  119327. // "scopes": [
  119328. // "https://www.googleapis.com/auth/cloud-platform",
  119329. // "https://www.googleapis.com/auth/compute",
  119330. // "https://www.googleapis.com/auth/compute.readonly"
  119331. // ]
  119332. // }
  119333. }
  119334. // method id "compute.routers.getNatMappingInfo":
  119335. type RoutersGetNatMappingInfoCall struct {
  119336. s *Service
  119337. project string
  119338. region string
  119339. router string
  119340. urlParams_ gensupport.URLParams
  119341. ifNoneMatch_ string
  119342. ctx_ context.Context
  119343. header_ http.Header
  119344. }
  119345. // GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
  119346. // endpoints.
  119347. func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
  119348. c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119349. c.project = project
  119350. c.region = region
  119351. c.router = router
  119352. return c
  119353. }
  119354. // Filter sets the optional parameter "filter": A filter expression that
  119355. // filters resources listed in the response. The expression must specify
  119356. // the field name, a comparison operator, and the value that you want to
  119357. // use for filtering. The value must be a string, a number, or a
  119358. // boolean. The comparison operator must be either =, !=, >, or <.
  119359. //
  119360. // For example, if you are filtering Compute Engine instances, you can
  119361. // exclude instances named example-instance by specifying name !=
  119362. // example-instance.
  119363. //
  119364. // You can also filter nested fields. For example, you could specify
  119365. // scheduling.automaticRestart = false to include instances only if they
  119366. // are not scheduled for automatic restarts. You can use filtering on
  119367. // nested fields to filter based on resource labels.
  119368. //
  119369. // To filter on multiple expressions, provide each separate expression
  119370. // within parentheses. For example, (scheduling.automaticRestart = true)
  119371. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  119372. // AND expression. However, you can include AND and OR expressions
  119373. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  119374. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  119375. // true).
  119376. func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
  119377. c.urlParams_.Set("filter", filter)
  119378. return c
  119379. }
  119380. // MaxResults sets the optional parameter "maxResults": The maximum
  119381. // number of results per page that should be returned. If the number of
  119382. // available results is larger than maxResults, Compute Engine returns a
  119383. // nextPageToken that can be used to get the next page of results in
  119384. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  119385. // (Default: 500)
  119386. func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
  119387. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  119388. return c
  119389. }
  119390. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  119391. // a certain order. By default, results are returned in alphanumerical
  119392. // order based on the resource name.
  119393. //
  119394. // You can also sort results in descending order based on the creation
  119395. // timestamp using orderBy="creationTimestamp desc". This sorts results
  119396. // based on the creationTimestamp field in reverse chronological order
  119397. // (newest result first). Use this to sort resources like operations so
  119398. // that the newest operation is returned first.
  119399. //
  119400. // Currently, only sorting by name or creationTimestamp desc is
  119401. // supported.
  119402. func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
  119403. c.urlParams_.Set("orderBy", orderBy)
  119404. return c
  119405. }
  119406. // PageToken sets the optional parameter "pageToken": Specifies a page
  119407. // token to use. Set pageToken to the nextPageToken returned by a
  119408. // previous list request to get the next page of results.
  119409. func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
  119410. c.urlParams_.Set("pageToken", pageToken)
  119411. return c
  119412. }
  119413. // Fields allows partial responses to be retrieved. See
  119414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119415. // for more information.
  119416. func (c *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
  119417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119418. return c
  119419. }
  119420. // IfNoneMatch sets the optional parameter which makes the operation
  119421. // fail if the object's ETag matches the given value. This is useful for
  119422. // getting updates only after the object has changed since the last
  119423. // request. Use googleapi.IsNotModified to check whether the response
  119424. // error from Do is the result of In-None-Match.
  119425. func (c *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
  119426. c.ifNoneMatch_ = entityTag
  119427. return c
  119428. }
  119429. // Context sets the context to be used in this call's Do method. Any
  119430. // pending HTTP request will be aborted if the provided context is
  119431. // canceled.
  119432. func (c *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
  119433. c.ctx_ = ctx
  119434. return c
  119435. }
  119436. // Header returns an http.Header that can be modified by the caller to
  119437. // add HTTP headers to the request.
  119438. func (c *RoutersGetNatMappingInfoCall) Header() http.Header {
  119439. if c.header_ == nil {
  119440. c.header_ = make(http.Header)
  119441. }
  119442. return c.header_
  119443. }
  119444. func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
  119445. reqHeaders := make(http.Header)
  119446. for k, v := range c.header_ {
  119447. reqHeaders[k] = v
  119448. }
  119449. reqHeaders.Set("User-Agent", c.s.userAgent())
  119450. if c.ifNoneMatch_ != "" {
  119451. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119452. }
  119453. var body io.Reader = nil
  119454. c.urlParams_.Set("alt", alt)
  119455. c.urlParams_.Set("prettyPrint", "false")
  119456. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getNatMappingInfo")
  119457. urls += "?" + c.urlParams_.Encode()
  119458. req, err := http.NewRequest("GET", urls, body)
  119459. if err != nil {
  119460. return nil, err
  119461. }
  119462. req.Header = reqHeaders
  119463. googleapi.Expand(req.URL, map[string]string{
  119464. "project": c.project,
  119465. "region": c.region,
  119466. "router": c.router,
  119467. })
  119468. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119469. }
  119470. // Do executes the "compute.routers.getNatMappingInfo" call.
  119471. // Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
  119472. // Any non-2xx status code is an error. Response headers are in either
  119473. // *VmEndpointNatMappingsList.ServerResponse.Header or (if a response
  119474. // was returned at all) in error.(*googleapi.Error).Header. Use
  119475. // googleapi.IsNotModified to check whether the returned error was
  119476. // because http.StatusNotModified was returned.
  119477. func (c *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, error) {
  119478. gensupport.SetOptions(c.urlParams_, opts...)
  119479. res, err := c.doRequest("json")
  119480. if res != nil && res.StatusCode == http.StatusNotModified {
  119481. if res.Body != nil {
  119482. res.Body.Close()
  119483. }
  119484. return nil, &googleapi.Error{
  119485. Code: res.StatusCode,
  119486. Header: res.Header,
  119487. }
  119488. }
  119489. if err != nil {
  119490. return nil, err
  119491. }
  119492. defer googleapi.CloseBody(res)
  119493. if err := googleapi.CheckResponse(res); err != nil {
  119494. return nil, err
  119495. }
  119496. ret := &VmEndpointNatMappingsList{
  119497. ServerResponse: googleapi.ServerResponse{
  119498. Header: res.Header,
  119499. HTTPStatusCode: res.StatusCode,
  119500. },
  119501. }
  119502. target := &ret
  119503. if err := gensupport.DecodeResponse(target, res); err != nil {
  119504. return nil, err
  119505. }
  119506. return ret, nil
  119507. // {
  119508. // "description": "Retrieves runtime Nat mapping information of VM endpoints.",
  119509. // "httpMethod": "GET",
  119510. // "id": "compute.routers.getNatMappingInfo",
  119511. // "parameterOrder": [
  119512. // "project",
  119513. // "region",
  119514. // "router"
  119515. // ],
  119516. // "parameters": {
  119517. // "filter": {
  119518. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  119519. // "location": "query",
  119520. // "type": "string"
  119521. // },
  119522. // "maxResults": {
  119523. // "default": "500",
  119524. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  119525. // "format": "uint32",
  119526. // "location": "query",
  119527. // "minimum": "0",
  119528. // "type": "integer"
  119529. // },
  119530. // "orderBy": {
  119531. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  119532. // "location": "query",
  119533. // "type": "string"
  119534. // },
  119535. // "pageToken": {
  119536. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  119537. // "location": "query",
  119538. // "type": "string"
  119539. // },
  119540. // "project": {
  119541. // "description": "Project ID for this request.",
  119542. // "location": "path",
  119543. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119544. // "required": true,
  119545. // "type": "string"
  119546. // },
  119547. // "region": {
  119548. // "description": "Name of the region for this request.",
  119549. // "location": "path",
  119550. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119551. // "required": true,
  119552. // "type": "string"
  119553. // },
  119554. // "router": {
  119555. // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
  119556. // "location": "path",
  119557. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  119558. // "required": true,
  119559. // "type": "string"
  119560. // }
  119561. // },
  119562. // "path": "{project}/regions/{region}/routers/{router}/getNatMappingInfo",
  119563. // "response": {
  119564. // "$ref": "VmEndpointNatMappingsList"
  119565. // },
  119566. // "scopes": [
  119567. // "https://www.googleapis.com/auth/cloud-platform",
  119568. // "https://www.googleapis.com/auth/compute",
  119569. // "https://www.googleapis.com/auth/compute.readonly"
  119570. // ]
  119571. // }
  119572. }
  119573. // Pages invokes f for each page of results.
  119574. // A non-nil error returned from f will halt the iteration.
  119575. // The provided context supersedes any context provided to the Context method.
  119576. func (c *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) error) error {
  119577. c.ctx_ = ctx
  119578. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  119579. for {
  119580. x, err := c.Do()
  119581. if err != nil {
  119582. return err
  119583. }
  119584. if err := f(x); err != nil {
  119585. return err
  119586. }
  119587. if x.NextPageToken == "" {
  119588. return nil
  119589. }
  119590. c.PageToken(x.NextPageToken)
  119591. }
  119592. }
  119593. // method id "compute.routers.getRouterStatus":
  119594. type RoutersGetRouterStatusCall struct {
  119595. s *Service
  119596. project string
  119597. region string
  119598. router string
  119599. urlParams_ gensupport.URLParams
  119600. ifNoneMatch_ string
  119601. ctx_ context.Context
  119602. header_ http.Header
  119603. }
  119604. // GetRouterStatus: Retrieves runtime information of the specified
  119605. // router.
  119606. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  119607. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119608. c.project = project
  119609. c.region = region
  119610. c.router = router
  119611. return c
  119612. }
  119613. // Fields allows partial responses to be retrieved. See
  119614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119615. // for more information.
  119616. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  119617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119618. return c
  119619. }
  119620. // IfNoneMatch sets the optional parameter which makes the operation
  119621. // fail if the object's ETag matches the given value. This is useful for
  119622. // getting updates only after the object has changed since the last
  119623. // request. Use googleapi.IsNotModified to check whether the response
  119624. // error from Do is the result of In-None-Match.
  119625. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  119626. c.ifNoneMatch_ = entityTag
  119627. return c
  119628. }
  119629. // Context sets the context to be used in this call's Do method. Any
  119630. // pending HTTP request will be aborted if the provided context is
  119631. // canceled.
  119632. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  119633. c.ctx_ = ctx
  119634. return c
  119635. }
  119636. // Header returns an http.Header that can be modified by the caller to
  119637. // add HTTP headers to the request.
  119638. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  119639. if c.header_ == nil {
  119640. c.header_ = make(http.Header)
  119641. }
  119642. return c.header_
  119643. }
  119644. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  119645. reqHeaders := make(http.Header)
  119646. for k, v := range c.header_ {
  119647. reqHeaders[k] = v
  119648. }
  119649. reqHeaders.Set("User-Agent", c.s.userAgent())
  119650. if c.ifNoneMatch_ != "" {
  119651. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  119652. }
  119653. var body io.Reader = nil
  119654. c.urlParams_.Set("alt", alt)
  119655. c.urlParams_.Set("prettyPrint", "false")
  119656. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  119657. urls += "?" + c.urlParams_.Encode()
  119658. req, err := http.NewRequest("GET", urls, body)
  119659. if err != nil {
  119660. return nil, err
  119661. }
  119662. req.Header = reqHeaders
  119663. googleapi.Expand(req.URL, map[string]string{
  119664. "project": c.project,
  119665. "region": c.region,
  119666. "router": c.router,
  119667. })
  119668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119669. }
  119670. // Do executes the "compute.routers.getRouterStatus" call.
  119671. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  119672. // non-2xx status code is an error. Response headers are in either
  119673. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  119674. // returned at all) in error.(*googleapi.Error).Header. Use
  119675. // googleapi.IsNotModified to check whether the returned error was
  119676. // because http.StatusNotModified was returned.
  119677. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  119678. gensupport.SetOptions(c.urlParams_, opts...)
  119679. res, err := c.doRequest("json")
  119680. if res != nil && res.StatusCode == http.StatusNotModified {
  119681. if res.Body != nil {
  119682. res.Body.Close()
  119683. }
  119684. return nil, &googleapi.Error{
  119685. Code: res.StatusCode,
  119686. Header: res.Header,
  119687. }
  119688. }
  119689. if err != nil {
  119690. return nil, err
  119691. }
  119692. defer googleapi.CloseBody(res)
  119693. if err := googleapi.CheckResponse(res); err != nil {
  119694. return nil, err
  119695. }
  119696. ret := &RouterStatusResponse{
  119697. ServerResponse: googleapi.ServerResponse{
  119698. Header: res.Header,
  119699. HTTPStatusCode: res.StatusCode,
  119700. },
  119701. }
  119702. target := &ret
  119703. if err := gensupport.DecodeResponse(target, res); err != nil {
  119704. return nil, err
  119705. }
  119706. return ret, nil
  119707. // {
  119708. // "description": "Retrieves runtime information of the specified router.",
  119709. // "httpMethod": "GET",
  119710. // "id": "compute.routers.getRouterStatus",
  119711. // "parameterOrder": [
  119712. // "project",
  119713. // "region",
  119714. // "router"
  119715. // ],
  119716. // "parameters": {
  119717. // "project": {
  119718. // "description": "Project ID for this request.",
  119719. // "location": "path",
  119720. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119721. // "required": true,
  119722. // "type": "string"
  119723. // },
  119724. // "region": {
  119725. // "description": "Name of the region for this request.",
  119726. // "location": "path",
  119727. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119728. // "required": true,
  119729. // "type": "string"
  119730. // },
  119731. // "router": {
  119732. // "description": "Name of the Router resource to query.",
  119733. // "location": "path",
  119734. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  119735. // "required": true,
  119736. // "type": "string"
  119737. // }
  119738. // },
  119739. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  119740. // "response": {
  119741. // "$ref": "RouterStatusResponse"
  119742. // },
  119743. // "scopes": [
  119744. // "https://www.googleapis.com/auth/cloud-platform",
  119745. // "https://www.googleapis.com/auth/compute",
  119746. // "https://www.googleapis.com/auth/compute.readonly"
  119747. // ]
  119748. // }
  119749. }
  119750. // method id "compute.routers.insert":
  119751. type RoutersInsertCall struct {
  119752. s *Service
  119753. project string
  119754. region string
  119755. router *Router
  119756. urlParams_ gensupport.URLParams
  119757. ctx_ context.Context
  119758. header_ http.Header
  119759. }
  119760. // Insert: Creates a Router resource in the specified project and region
  119761. // using the data included in the request.
  119762. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  119763. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119764. c.project = project
  119765. c.region = region
  119766. c.router = router
  119767. return c
  119768. }
  119769. // RequestId sets the optional parameter "requestId": An optional
  119770. // request ID to identify requests. Specify a unique request ID so that
  119771. // if you must retry your request, the server will know to ignore the
  119772. // request if it has already been completed.
  119773. //
  119774. // For example, consider a situation where you make an initial request
  119775. // and the request times out. If you make the request again with the
  119776. // same request ID, the server can check if original operation with the
  119777. // same request ID was received, and if so, will ignore the second
  119778. // request. This prevents clients from accidentally creating duplicate
  119779. // commitments.
  119780. //
  119781. // The request ID must be a valid UUID with the exception that zero UUID
  119782. // is not supported (00000000-0000-0000-0000-000000000000).
  119783. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  119784. c.urlParams_.Set("requestId", requestId)
  119785. return c
  119786. }
  119787. // Fields allows partial responses to be retrieved. See
  119788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119789. // for more information.
  119790. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  119791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119792. return c
  119793. }
  119794. // Context sets the context to be used in this call's Do method. Any
  119795. // pending HTTP request will be aborted if the provided context is
  119796. // canceled.
  119797. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  119798. c.ctx_ = ctx
  119799. return c
  119800. }
  119801. // Header returns an http.Header that can be modified by the caller to
  119802. // add HTTP headers to the request.
  119803. func (c *RoutersInsertCall) Header() http.Header {
  119804. if c.header_ == nil {
  119805. c.header_ = make(http.Header)
  119806. }
  119807. return c.header_
  119808. }
  119809. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  119810. reqHeaders := make(http.Header)
  119811. for k, v := range c.header_ {
  119812. reqHeaders[k] = v
  119813. }
  119814. reqHeaders.Set("User-Agent", c.s.userAgent())
  119815. var body io.Reader = nil
  119816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  119817. if err != nil {
  119818. return nil, err
  119819. }
  119820. reqHeaders.Set("Content-Type", "application/json")
  119821. c.urlParams_.Set("alt", alt)
  119822. c.urlParams_.Set("prettyPrint", "false")
  119823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  119824. urls += "?" + c.urlParams_.Encode()
  119825. req, err := http.NewRequest("POST", urls, body)
  119826. if err != nil {
  119827. return nil, err
  119828. }
  119829. req.Header = reqHeaders
  119830. googleapi.Expand(req.URL, map[string]string{
  119831. "project": c.project,
  119832. "region": c.region,
  119833. })
  119834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  119835. }
  119836. // Do executes the "compute.routers.insert" call.
  119837. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  119838. // status code is an error. Response headers are in either
  119839. // *Operation.ServerResponse.Header or (if a response was returned at
  119840. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  119841. // to check whether the returned error was because
  119842. // http.StatusNotModified was returned.
  119843. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  119844. gensupport.SetOptions(c.urlParams_, opts...)
  119845. res, err := c.doRequest("json")
  119846. if res != nil && res.StatusCode == http.StatusNotModified {
  119847. if res.Body != nil {
  119848. res.Body.Close()
  119849. }
  119850. return nil, &googleapi.Error{
  119851. Code: res.StatusCode,
  119852. Header: res.Header,
  119853. }
  119854. }
  119855. if err != nil {
  119856. return nil, err
  119857. }
  119858. defer googleapi.CloseBody(res)
  119859. if err := googleapi.CheckResponse(res); err != nil {
  119860. return nil, err
  119861. }
  119862. ret := &Operation{
  119863. ServerResponse: googleapi.ServerResponse{
  119864. Header: res.Header,
  119865. HTTPStatusCode: res.StatusCode,
  119866. },
  119867. }
  119868. target := &ret
  119869. if err := gensupport.DecodeResponse(target, res); err != nil {
  119870. return nil, err
  119871. }
  119872. return ret, nil
  119873. // {
  119874. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  119875. // "httpMethod": "POST",
  119876. // "id": "compute.routers.insert",
  119877. // "parameterOrder": [
  119878. // "project",
  119879. // "region"
  119880. // ],
  119881. // "parameters": {
  119882. // "project": {
  119883. // "description": "Project ID for this request.",
  119884. // "location": "path",
  119885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  119886. // "required": true,
  119887. // "type": "string"
  119888. // },
  119889. // "region": {
  119890. // "description": "Name of the region for this request.",
  119891. // "location": "path",
  119892. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  119893. // "required": true,
  119894. // "type": "string"
  119895. // },
  119896. // "requestId": {
  119897. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  119898. // "location": "query",
  119899. // "type": "string"
  119900. // }
  119901. // },
  119902. // "path": "{project}/regions/{region}/routers",
  119903. // "request": {
  119904. // "$ref": "Router"
  119905. // },
  119906. // "response": {
  119907. // "$ref": "Operation"
  119908. // },
  119909. // "scopes": [
  119910. // "https://www.googleapis.com/auth/cloud-platform",
  119911. // "https://www.googleapis.com/auth/compute"
  119912. // ]
  119913. // }
  119914. }
  119915. // method id "compute.routers.list":
  119916. type RoutersListCall struct {
  119917. s *Service
  119918. project string
  119919. region string
  119920. urlParams_ gensupport.URLParams
  119921. ifNoneMatch_ string
  119922. ctx_ context.Context
  119923. header_ http.Header
  119924. }
  119925. // List: Retrieves a list of Router resources available to the specified
  119926. // project.
  119927. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  119928. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  119929. c.project = project
  119930. c.region = region
  119931. return c
  119932. }
  119933. // Filter sets the optional parameter "filter": A filter expression that
  119934. // filters resources listed in the response. The expression must specify
  119935. // the field name, a comparison operator, and the value that you want to
  119936. // use for filtering. The value must be a string, a number, or a
  119937. // boolean. The comparison operator must be either =, !=, >, or <.
  119938. //
  119939. // For example, if you are filtering Compute Engine instances, you can
  119940. // exclude instances named example-instance by specifying name !=
  119941. // example-instance.
  119942. //
  119943. // You can also filter nested fields. For example, you could specify
  119944. // scheduling.automaticRestart = false to include instances only if they
  119945. // are not scheduled for automatic restarts. You can use filtering on
  119946. // nested fields to filter based on resource labels.
  119947. //
  119948. // To filter on multiple expressions, provide each separate expression
  119949. // within parentheses. For example, (scheduling.automaticRestart = true)
  119950. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  119951. // AND expression. However, you can include AND and OR expressions
  119952. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  119953. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  119954. // true).
  119955. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  119956. c.urlParams_.Set("filter", filter)
  119957. return c
  119958. }
  119959. // MaxResults sets the optional parameter "maxResults": The maximum
  119960. // number of results per page that should be returned. If the number of
  119961. // available results is larger than maxResults, Compute Engine returns a
  119962. // nextPageToken that can be used to get the next page of results in
  119963. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  119964. // (Default: 500)
  119965. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  119966. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  119967. return c
  119968. }
  119969. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  119970. // a certain order. By default, results are returned in alphanumerical
  119971. // order based on the resource name.
  119972. //
  119973. // You can also sort results in descending order based on the creation
  119974. // timestamp using orderBy="creationTimestamp desc". This sorts results
  119975. // based on the creationTimestamp field in reverse chronological order
  119976. // (newest result first). Use this to sort resources like operations so
  119977. // that the newest operation is returned first.
  119978. //
  119979. // Currently, only sorting by name or creationTimestamp desc is
  119980. // supported.
  119981. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  119982. c.urlParams_.Set("orderBy", orderBy)
  119983. return c
  119984. }
  119985. // PageToken sets the optional parameter "pageToken": Specifies a page
  119986. // token to use. Set pageToken to the nextPageToken returned by a
  119987. // previous list request to get the next page of results.
  119988. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  119989. c.urlParams_.Set("pageToken", pageToken)
  119990. return c
  119991. }
  119992. // Fields allows partial responses to be retrieved. See
  119993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  119994. // for more information.
  119995. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  119996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  119997. return c
  119998. }
  119999. // IfNoneMatch sets the optional parameter which makes the operation
  120000. // fail if the object's ETag matches the given value. This is useful for
  120001. // getting updates only after the object has changed since the last
  120002. // request. Use googleapi.IsNotModified to check whether the response
  120003. // error from Do is the result of In-None-Match.
  120004. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  120005. c.ifNoneMatch_ = entityTag
  120006. return c
  120007. }
  120008. // Context sets the context to be used in this call's Do method. Any
  120009. // pending HTTP request will be aborted if the provided context is
  120010. // canceled.
  120011. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  120012. c.ctx_ = ctx
  120013. return c
  120014. }
  120015. // Header returns an http.Header that can be modified by the caller to
  120016. // add HTTP headers to the request.
  120017. func (c *RoutersListCall) Header() http.Header {
  120018. if c.header_ == nil {
  120019. c.header_ = make(http.Header)
  120020. }
  120021. return c.header_
  120022. }
  120023. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  120024. reqHeaders := make(http.Header)
  120025. for k, v := range c.header_ {
  120026. reqHeaders[k] = v
  120027. }
  120028. reqHeaders.Set("User-Agent", c.s.userAgent())
  120029. if c.ifNoneMatch_ != "" {
  120030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  120031. }
  120032. var body io.Reader = nil
  120033. c.urlParams_.Set("alt", alt)
  120034. c.urlParams_.Set("prettyPrint", "false")
  120035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  120036. urls += "?" + c.urlParams_.Encode()
  120037. req, err := http.NewRequest("GET", urls, body)
  120038. if err != nil {
  120039. return nil, err
  120040. }
  120041. req.Header = reqHeaders
  120042. googleapi.Expand(req.URL, map[string]string{
  120043. "project": c.project,
  120044. "region": c.region,
  120045. })
  120046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120047. }
  120048. // Do executes the "compute.routers.list" call.
  120049. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  120050. // status code is an error. Response headers are in either
  120051. // *RouterList.ServerResponse.Header or (if a response was returned at
  120052. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120053. // to check whether the returned error was because
  120054. // http.StatusNotModified was returned.
  120055. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  120056. gensupport.SetOptions(c.urlParams_, opts...)
  120057. res, err := c.doRequest("json")
  120058. if res != nil && res.StatusCode == http.StatusNotModified {
  120059. if res.Body != nil {
  120060. res.Body.Close()
  120061. }
  120062. return nil, &googleapi.Error{
  120063. Code: res.StatusCode,
  120064. Header: res.Header,
  120065. }
  120066. }
  120067. if err != nil {
  120068. return nil, err
  120069. }
  120070. defer googleapi.CloseBody(res)
  120071. if err := googleapi.CheckResponse(res); err != nil {
  120072. return nil, err
  120073. }
  120074. ret := &RouterList{
  120075. ServerResponse: googleapi.ServerResponse{
  120076. Header: res.Header,
  120077. HTTPStatusCode: res.StatusCode,
  120078. },
  120079. }
  120080. target := &ret
  120081. if err := gensupport.DecodeResponse(target, res); err != nil {
  120082. return nil, err
  120083. }
  120084. return ret, nil
  120085. // {
  120086. // "description": "Retrieves a list of Router resources available to the specified project.",
  120087. // "httpMethod": "GET",
  120088. // "id": "compute.routers.list",
  120089. // "parameterOrder": [
  120090. // "project",
  120091. // "region"
  120092. // ],
  120093. // "parameters": {
  120094. // "filter": {
  120095. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  120096. // "location": "query",
  120097. // "type": "string"
  120098. // },
  120099. // "maxResults": {
  120100. // "default": "500",
  120101. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  120102. // "format": "uint32",
  120103. // "location": "query",
  120104. // "minimum": "0",
  120105. // "type": "integer"
  120106. // },
  120107. // "orderBy": {
  120108. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  120109. // "location": "query",
  120110. // "type": "string"
  120111. // },
  120112. // "pageToken": {
  120113. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  120114. // "location": "query",
  120115. // "type": "string"
  120116. // },
  120117. // "project": {
  120118. // "description": "Project ID for this request.",
  120119. // "location": "path",
  120120. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120121. // "required": true,
  120122. // "type": "string"
  120123. // },
  120124. // "region": {
  120125. // "description": "Name of the region for this request.",
  120126. // "location": "path",
  120127. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120128. // "required": true,
  120129. // "type": "string"
  120130. // }
  120131. // },
  120132. // "path": "{project}/regions/{region}/routers",
  120133. // "response": {
  120134. // "$ref": "RouterList"
  120135. // },
  120136. // "scopes": [
  120137. // "https://www.googleapis.com/auth/cloud-platform",
  120138. // "https://www.googleapis.com/auth/compute",
  120139. // "https://www.googleapis.com/auth/compute.readonly"
  120140. // ]
  120141. // }
  120142. }
  120143. // Pages invokes f for each page of results.
  120144. // A non-nil error returned from f will halt the iteration.
  120145. // The provided context supersedes any context provided to the Context method.
  120146. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  120147. c.ctx_ = ctx
  120148. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  120149. for {
  120150. x, err := c.Do()
  120151. if err != nil {
  120152. return err
  120153. }
  120154. if err := f(x); err != nil {
  120155. return err
  120156. }
  120157. if x.NextPageToken == "" {
  120158. return nil
  120159. }
  120160. c.PageToken(x.NextPageToken)
  120161. }
  120162. }
  120163. // method id "compute.routers.patch":
  120164. type RoutersPatchCall struct {
  120165. s *Service
  120166. project string
  120167. region string
  120168. router string
  120169. router2 *Router
  120170. urlParams_ gensupport.URLParams
  120171. ctx_ context.Context
  120172. header_ http.Header
  120173. }
  120174. // Patch: Patches the specified Router resource with the data included
  120175. // in the request. This method supports PATCH semantics and uses JSON
  120176. // merge patch format and processing rules.
  120177. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  120178. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120179. c.project = project
  120180. c.region = region
  120181. c.router = router
  120182. c.router2 = router2
  120183. return c
  120184. }
  120185. // RequestId sets the optional parameter "requestId": An optional
  120186. // request ID to identify requests. Specify a unique request ID so that
  120187. // if you must retry your request, the server will know to ignore the
  120188. // request if it has already been completed.
  120189. //
  120190. // For example, consider a situation where you make an initial request
  120191. // and the request times out. If you make the request again with the
  120192. // same request ID, the server can check if original operation with the
  120193. // same request ID was received, and if so, will ignore the second
  120194. // request. This prevents clients from accidentally creating duplicate
  120195. // commitments.
  120196. //
  120197. // The request ID must be a valid UUID with the exception that zero UUID
  120198. // is not supported (00000000-0000-0000-0000-000000000000).
  120199. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  120200. c.urlParams_.Set("requestId", requestId)
  120201. return c
  120202. }
  120203. // Fields allows partial responses to be retrieved. See
  120204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120205. // for more information.
  120206. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  120207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120208. return c
  120209. }
  120210. // Context sets the context to be used in this call's Do method. Any
  120211. // pending HTTP request will be aborted if the provided context is
  120212. // canceled.
  120213. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  120214. c.ctx_ = ctx
  120215. return c
  120216. }
  120217. // Header returns an http.Header that can be modified by the caller to
  120218. // add HTTP headers to the request.
  120219. func (c *RoutersPatchCall) Header() http.Header {
  120220. if c.header_ == nil {
  120221. c.header_ = make(http.Header)
  120222. }
  120223. return c.header_
  120224. }
  120225. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  120226. reqHeaders := make(http.Header)
  120227. for k, v := range c.header_ {
  120228. reqHeaders[k] = v
  120229. }
  120230. reqHeaders.Set("User-Agent", c.s.userAgent())
  120231. var body io.Reader = nil
  120232. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  120233. if err != nil {
  120234. return nil, err
  120235. }
  120236. reqHeaders.Set("Content-Type", "application/json")
  120237. c.urlParams_.Set("alt", alt)
  120238. c.urlParams_.Set("prettyPrint", "false")
  120239. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  120240. urls += "?" + c.urlParams_.Encode()
  120241. req, err := http.NewRequest("PATCH", urls, body)
  120242. if err != nil {
  120243. return nil, err
  120244. }
  120245. req.Header = reqHeaders
  120246. googleapi.Expand(req.URL, map[string]string{
  120247. "project": c.project,
  120248. "region": c.region,
  120249. "router": c.router,
  120250. })
  120251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120252. }
  120253. // Do executes the "compute.routers.patch" call.
  120254. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  120255. // status code is an error. Response headers are in either
  120256. // *Operation.ServerResponse.Header or (if a response was returned at
  120257. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120258. // to check whether the returned error was because
  120259. // http.StatusNotModified was returned.
  120260. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  120261. gensupport.SetOptions(c.urlParams_, opts...)
  120262. res, err := c.doRequest("json")
  120263. if res != nil && res.StatusCode == http.StatusNotModified {
  120264. if res.Body != nil {
  120265. res.Body.Close()
  120266. }
  120267. return nil, &googleapi.Error{
  120268. Code: res.StatusCode,
  120269. Header: res.Header,
  120270. }
  120271. }
  120272. if err != nil {
  120273. return nil, err
  120274. }
  120275. defer googleapi.CloseBody(res)
  120276. if err := googleapi.CheckResponse(res); err != nil {
  120277. return nil, err
  120278. }
  120279. ret := &Operation{
  120280. ServerResponse: googleapi.ServerResponse{
  120281. Header: res.Header,
  120282. HTTPStatusCode: res.StatusCode,
  120283. },
  120284. }
  120285. target := &ret
  120286. if err := gensupport.DecodeResponse(target, res); err != nil {
  120287. return nil, err
  120288. }
  120289. return ret, nil
  120290. // {
  120291. // "description": "Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.",
  120292. // "httpMethod": "PATCH",
  120293. // "id": "compute.routers.patch",
  120294. // "parameterOrder": [
  120295. // "project",
  120296. // "region",
  120297. // "router"
  120298. // ],
  120299. // "parameters": {
  120300. // "project": {
  120301. // "description": "Project ID for this request.",
  120302. // "location": "path",
  120303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120304. // "required": true,
  120305. // "type": "string"
  120306. // },
  120307. // "region": {
  120308. // "description": "Name of the region for this request.",
  120309. // "location": "path",
  120310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120311. // "required": true,
  120312. // "type": "string"
  120313. // },
  120314. // "requestId": {
  120315. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120316. // "location": "query",
  120317. // "type": "string"
  120318. // },
  120319. // "router": {
  120320. // "description": "Name of the Router resource to patch.",
  120321. // "location": "path",
  120322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120323. // "required": true,
  120324. // "type": "string"
  120325. // }
  120326. // },
  120327. // "path": "{project}/regions/{region}/routers/{router}",
  120328. // "request": {
  120329. // "$ref": "Router"
  120330. // },
  120331. // "response": {
  120332. // "$ref": "Operation"
  120333. // },
  120334. // "scopes": [
  120335. // "https://www.googleapis.com/auth/cloud-platform",
  120336. // "https://www.googleapis.com/auth/compute"
  120337. // ]
  120338. // }
  120339. }
  120340. // method id "compute.routers.preview":
  120341. type RoutersPreviewCall struct {
  120342. s *Service
  120343. project string
  120344. region string
  120345. router string
  120346. router2 *Router
  120347. urlParams_ gensupport.URLParams
  120348. ctx_ context.Context
  120349. header_ http.Header
  120350. }
  120351. // Preview: Preview fields auto-generated during router create and
  120352. // update operations. Calling this method does NOT create or update the
  120353. // router.
  120354. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  120355. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120356. c.project = project
  120357. c.region = region
  120358. c.router = router
  120359. c.router2 = router2
  120360. return c
  120361. }
  120362. // Fields allows partial responses to be retrieved. See
  120363. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120364. // for more information.
  120365. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  120366. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120367. return c
  120368. }
  120369. // Context sets the context to be used in this call's Do method. Any
  120370. // pending HTTP request will be aborted if the provided context is
  120371. // canceled.
  120372. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  120373. c.ctx_ = ctx
  120374. return c
  120375. }
  120376. // Header returns an http.Header that can be modified by the caller to
  120377. // add HTTP headers to the request.
  120378. func (c *RoutersPreviewCall) Header() http.Header {
  120379. if c.header_ == nil {
  120380. c.header_ = make(http.Header)
  120381. }
  120382. return c.header_
  120383. }
  120384. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  120385. reqHeaders := make(http.Header)
  120386. for k, v := range c.header_ {
  120387. reqHeaders[k] = v
  120388. }
  120389. reqHeaders.Set("User-Agent", c.s.userAgent())
  120390. var body io.Reader = nil
  120391. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  120392. if err != nil {
  120393. return nil, err
  120394. }
  120395. reqHeaders.Set("Content-Type", "application/json")
  120396. c.urlParams_.Set("alt", alt)
  120397. c.urlParams_.Set("prettyPrint", "false")
  120398. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  120399. urls += "?" + c.urlParams_.Encode()
  120400. req, err := http.NewRequest("POST", urls, body)
  120401. if err != nil {
  120402. return nil, err
  120403. }
  120404. req.Header = reqHeaders
  120405. googleapi.Expand(req.URL, map[string]string{
  120406. "project": c.project,
  120407. "region": c.region,
  120408. "router": c.router,
  120409. })
  120410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120411. }
  120412. // Do executes the "compute.routers.preview" call.
  120413. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  120414. // non-2xx status code is an error. Response headers are in either
  120415. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  120416. // returned at all) in error.(*googleapi.Error).Header. Use
  120417. // googleapi.IsNotModified to check whether the returned error was
  120418. // because http.StatusNotModified was returned.
  120419. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  120420. gensupport.SetOptions(c.urlParams_, opts...)
  120421. res, err := c.doRequest("json")
  120422. if res != nil && res.StatusCode == http.StatusNotModified {
  120423. if res.Body != nil {
  120424. res.Body.Close()
  120425. }
  120426. return nil, &googleapi.Error{
  120427. Code: res.StatusCode,
  120428. Header: res.Header,
  120429. }
  120430. }
  120431. if err != nil {
  120432. return nil, err
  120433. }
  120434. defer googleapi.CloseBody(res)
  120435. if err := googleapi.CheckResponse(res); err != nil {
  120436. return nil, err
  120437. }
  120438. ret := &RoutersPreviewResponse{
  120439. ServerResponse: googleapi.ServerResponse{
  120440. Header: res.Header,
  120441. HTTPStatusCode: res.StatusCode,
  120442. },
  120443. }
  120444. target := &ret
  120445. if err := gensupport.DecodeResponse(target, res); err != nil {
  120446. return nil, err
  120447. }
  120448. return ret, nil
  120449. // {
  120450. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  120451. // "httpMethod": "POST",
  120452. // "id": "compute.routers.preview",
  120453. // "parameterOrder": [
  120454. // "project",
  120455. // "region",
  120456. // "router"
  120457. // ],
  120458. // "parameters": {
  120459. // "project": {
  120460. // "description": "Project ID for this request.",
  120461. // "location": "path",
  120462. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120463. // "required": true,
  120464. // "type": "string"
  120465. // },
  120466. // "region": {
  120467. // "description": "Name of the region for this request.",
  120468. // "location": "path",
  120469. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120470. // "required": true,
  120471. // "type": "string"
  120472. // },
  120473. // "router": {
  120474. // "description": "Name of the Router resource to query.",
  120475. // "location": "path",
  120476. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120477. // "required": true,
  120478. // "type": "string"
  120479. // }
  120480. // },
  120481. // "path": "{project}/regions/{region}/routers/{router}/preview",
  120482. // "request": {
  120483. // "$ref": "Router"
  120484. // },
  120485. // "response": {
  120486. // "$ref": "RoutersPreviewResponse"
  120487. // },
  120488. // "scopes": [
  120489. // "https://www.googleapis.com/auth/cloud-platform",
  120490. // "https://www.googleapis.com/auth/compute",
  120491. // "https://www.googleapis.com/auth/compute.readonly"
  120492. // ]
  120493. // }
  120494. }
  120495. // method id "compute.routers.testIamPermissions":
  120496. type RoutersTestIamPermissionsCall struct {
  120497. s *Service
  120498. project string
  120499. region string
  120500. resource string
  120501. testpermissionsrequest *TestPermissionsRequest
  120502. urlParams_ gensupport.URLParams
  120503. ctx_ context.Context
  120504. header_ http.Header
  120505. }
  120506. // TestIamPermissions: Returns permissions that a caller has on the
  120507. // specified resource.
  120508. func (r *RoutersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutersTestIamPermissionsCall {
  120509. c := &RoutersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120510. c.project = project
  120511. c.region = region
  120512. c.resource = resource
  120513. c.testpermissionsrequest = testpermissionsrequest
  120514. return c
  120515. }
  120516. // Fields allows partial responses to be retrieved. See
  120517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120518. // for more information.
  120519. func (c *RoutersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutersTestIamPermissionsCall {
  120520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120521. return c
  120522. }
  120523. // Context sets the context to be used in this call's Do method. Any
  120524. // pending HTTP request will be aborted if the provided context is
  120525. // canceled.
  120526. func (c *RoutersTestIamPermissionsCall) Context(ctx context.Context) *RoutersTestIamPermissionsCall {
  120527. c.ctx_ = ctx
  120528. return c
  120529. }
  120530. // Header returns an http.Header that can be modified by the caller to
  120531. // add HTTP headers to the request.
  120532. func (c *RoutersTestIamPermissionsCall) Header() http.Header {
  120533. if c.header_ == nil {
  120534. c.header_ = make(http.Header)
  120535. }
  120536. return c.header_
  120537. }
  120538. func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  120539. reqHeaders := make(http.Header)
  120540. for k, v := range c.header_ {
  120541. reqHeaders[k] = v
  120542. }
  120543. reqHeaders.Set("User-Agent", c.s.userAgent())
  120544. var body io.Reader = nil
  120545. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  120546. if err != nil {
  120547. return nil, err
  120548. }
  120549. reqHeaders.Set("Content-Type", "application/json")
  120550. c.urlParams_.Set("alt", alt)
  120551. c.urlParams_.Set("prettyPrint", "false")
  120552. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{resource}/testIamPermissions")
  120553. urls += "?" + c.urlParams_.Encode()
  120554. req, err := http.NewRequest("POST", urls, body)
  120555. if err != nil {
  120556. return nil, err
  120557. }
  120558. req.Header = reqHeaders
  120559. googleapi.Expand(req.URL, map[string]string{
  120560. "project": c.project,
  120561. "region": c.region,
  120562. "resource": c.resource,
  120563. })
  120564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120565. }
  120566. // Do executes the "compute.routers.testIamPermissions" call.
  120567. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  120568. // non-2xx status code is an error. Response headers are in either
  120569. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  120570. // returned at all) in error.(*googleapi.Error).Header. Use
  120571. // googleapi.IsNotModified to check whether the returned error was
  120572. // because http.StatusNotModified was returned.
  120573. func (c *RoutersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  120574. gensupport.SetOptions(c.urlParams_, opts...)
  120575. res, err := c.doRequest("json")
  120576. if res != nil && res.StatusCode == http.StatusNotModified {
  120577. if res.Body != nil {
  120578. res.Body.Close()
  120579. }
  120580. return nil, &googleapi.Error{
  120581. Code: res.StatusCode,
  120582. Header: res.Header,
  120583. }
  120584. }
  120585. if err != nil {
  120586. return nil, err
  120587. }
  120588. defer googleapi.CloseBody(res)
  120589. if err := googleapi.CheckResponse(res); err != nil {
  120590. return nil, err
  120591. }
  120592. ret := &TestPermissionsResponse{
  120593. ServerResponse: googleapi.ServerResponse{
  120594. Header: res.Header,
  120595. HTTPStatusCode: res.StatusCode,
  120596. },
  120597. }
  120598. target := &ret
  120599. if err := gensupport.DecodeResponse(target, res); err != nil {
  120600. return nil, err
  120601. }
  120602. return ret, nil
  120603. // {
  120604. // "description": "Returns permissions that a caller has on the specified resource.",
  120605. // "httpMethod": "POST",
  120606. // "id": "compute.routers.testIamPermissions",
  120607. // "parameterOrder": [
  120608. // "project",
  120609. // "region",
  120610. // "resource"
  120611. // ],
  120612. // "parameters": {
  120613. // "project": {
  120614. // "description": "Project ID for this request.",
  120615. // "location": "path",
  120616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120617. // "required": true,
  120618. // "type": "string"
  120619. // },
  120620. // "region": {
  120621. // "description": "The name of the region for this request.",
  120622. // "location": "path",
  120623. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120624. // "required": true,
  120625. // "type": "string"
  120626. // },
  120627. // "resource": {
  120628. // "description": "Name or id of the resource for this request.",
  120629. // "location": "path",
  120630. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120631. // "required": true,
  120632. // "type": "string"
  120633. // }
  120634. // },
  120635. // "path": "{project}/regions/{region}/routers/{resource}/testIamPermissions",
  120636. // "request": {
  120637. // "$ref": "TestPermissionsRequest"
  120638. // },
  120639. // "response": {
  120640. // "$ref": "TestPermissionsResponse"
  120641. // },
  120642. // "scopes": [
  120643. // "https://www.googleapis.com/auth/cloud-platform",
  120644. // "https://www.googleapis.com/auth/compute",
  120645. // "https://www.googleapis.com/auth/compute.readonly"
  120646. // ]
  120647. // }
  120648. }
  120649. // method id "compute.routers.update":
  120650. type RoutersUpdateCall struct {
  120651. s *Service
  120652. project string
  120653. region string
  120654. router string
  120655. router2 *Router
  120656. urlParams_ gensupport.URLParams
  120657. ctx_ context.Context
  120658. header_ http.Header
  120659. }
  120660. // Update: Updates the specified Router resource with the data included
  120661. // in the request.
  120662. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  120663. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120664. c.project = project
  120665. c.region = region
  120666. c.router = router
  120667. c.router2 = router2
  120668. return c
  120669. }
  120670. // RequestId sets the optional parameter "requestId": An optional
  120671. // request ID to identify requests. Specify a unique request ID so that
  120672. // if you must retry your request, the server will know to ignore the
  120673. // request if it has already been completed.
  120674. //
  120675. // For example, consider a situation where you make an initial request
  120676. // and the request times out. If you make the request again with the
  120677. // same request ID, the server can check if original operation with the
  120678. // same request ID was received, and if so, will ignore the second
  120679. // request. This prevents clients from accidentally creating duplicate
  120680. // commitments.
  120681. //
  120682. // The request ID must be a valid UUID with the exception that zero UUID
  120683. // is not supported (00000000-0000-0000-0000-000000000000).
  120684. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  120685. c.urlParams_.Set("requestId", requestId)
  120686. return c
  120687. }
  120688. // Fields allows partial responses to be retrieved. See
  120689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120690. // for more information.
  120691. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  120692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120693. return c
  120694. }
  120695. // Context sets the context to be used in this call's Do method. Any
  120696. // pending HTTP request will be aborted if the provided context is
  120697. // canceled.
  120698. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  120699. c.ctx_ = ctx
  120700. return c
  120701. }
  120702. // Header returns an http.Header that can be modified by the caller to
  120703. // add HTTP headers to the request.
  120704. func (c *RoutersUpdateCall) Header() http.Header {
  120705. if c.header_ == nil {
  120706. c.header_ = make(http.Header)
  120707. }
  120708. return c.header_
  120709. }
  120710. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  120711. reqHeaders := make(http.Header)
  120712. for k, v := range c.header_ {
  120713. reqHeaders[k] = v
  120714. }
  120715. reqHeaders.Set("User-Agent", c.s.userAgent())
  120716. var body io.Reader = nil
  120717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  120718. if err != nil {
  120719. return nil, err
  120720. }
  120721. reqHeaders.Set("Content-Type", "application/json")
  120722. c.urlParams_.Set("alt", alt)
  120723. c.urlParams_.Set("prettyPrint", "false")
  120724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  120725. urls += "?" + c.urlParams_.Encode()
  120726. req, err := http.NewRequest("PUT", urls, body)
  120727. if err != nil {
  120728. return nil, err
  120729. }
  120730. req.Header = reqHeaders
  120731. googleapi.Expand(req.URL, map[string]string{
  120732. "project": c.project,
  120733. "region": c.region,
  120734. "router": c.router,
  120735. })
  120736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120737. }
  120738. // Do executes the "compute.routers.update" call.
  120739. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  120740. // status code is an error. Response headers are in either
  120741. // *Operation.ServerResponse.Header or (if a response was returned at
  120742. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120743. // to check whether the returned error was because
  120744. // http.StatusNotModified was returned.
  120745. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  120746. gensupport.SetOptions(c.urlParams_, opts...)
  120747. res, err := c.doRequest("json")
  120748. if res != nil && res.StatusCode == http.StatusNotModified {
  120749. if res.Body != nil {
  120750. res.Body.Close()
  120751. }
  120752. return nil, &googleapi.Error{
  120753. Code: res.StatusCode,
  120754. Header: res.Header,
  120755. }
  120756. }
  120757. if err != nil {
  120758. return nil, err
  120759. }
  120760. defer googleapi.CloseBody(res)
  120761. if err := googleapi.CheckResponse(res); err != nil {
  120762. return nil, err
  120763. }
  120764. ret := &Operation{
  120765. ServerResponse: googleapi.ServerResponse{
  120766. Header: res.Header,
  120767. HTTPStatusCode: res.StatusCode,
  120768. },
  120769. }
  120770. target := &ret
  120771. if err := gensupport.DecodeResponse(target, res); err != nil {
  120772. return nil, err
  120773. }
  120774. return ret, nil
  120775. // {
  120776. // "description": "Updates the specified Router resource with the data included in the request.",
  120777. // "httpMethod": "PUT",
  120778. // "id": "compute.routers.update",
  120779. // "parameterOrder": [
  120780. // "project",
  120781. // "region",
  120782. // "router"
  120783. // ],
  120784. // "parameters": {
  120785. // "project": {
  120786. // "description": "Project ID for this request.",
  120787. // "location": "path",
  120788. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120789. // "required": true,
  120790. // "type": "string"
  120791. // },
  120792. // "region": {
  120793. // "description": "Name of the region for this request.",
  120794. // "location": "path",
  120795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  120796. // "required": true,
  120797. // "type": "string"
  120798. // },
  120799. // "requestId": {
  120800. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120801. // "location": "query",
  120802. // "type": "string"
  120803. // },
  120804. // "router": {
  120805. // "description": "Name of the Router resource to update.",
  120806. // "location": "path",
  120807. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120808. // "required": true,
  120809. // "type": "string"
  120810. // }
  120811. // },
  120812. // "path": "{project}/regions/{region}/routers/{router}",
  120813. // "request": {
  120814. // "$ref": "Router"
  120815. // },
  120816. // "response": {
  120817. // "$ref": "Operation"
  120818. // },
  120819. // "scopes": [
  120820. // "https://www.googleapis.com/auth/cloud-platform",
  120821. // "https://www.googleapis.com/auth/compute"
  120822. // ]
  120823. // }
  120824. }
  120825. // method id "compute.routes.delete":
  120826. type RoutesDeleteCall struct {
  120827. s *Service
  120828. project string
  120829. route string
  120830. urlParams_ gensupport.URLParams
  120831. ctx_ context.Context
  120832. header_ http.Header
  120833. }
  120834. // Delete: Deletes the specified Route resource.
  120835. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  120836. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  120837. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120838. c.project = project
  120839. c.route = route
  120840. return c
  120841. }
  120842. // RequestId sets the optional parameter "requestId": An optional
  120843. // request ID to identify requests. Specify a unique request ID so that
  120844. // if you must retry your request, the server will know to ignore the
  120845. // request if it has already been completed.
  120846. //
  120847. // For example, consider a situation where you make an initial request
  120848. // and the request times out. If you make the request again with the
  120849. // same request ID, the server can check if original operation with the
  120850. // same request ID was received, and if so, will ignore the second
  120851. // request. This prevents clients from accidentally creating duplicate
  120852. // commitments.
  120853. //
  120854. // The request ID must be a valid UUID with the exception that zero UUID
  120855. // is not supported (00000000-0000-0000-0000-000000000000).
  120856. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  120857. c.urlParams_.Set("requestId", requestId)
  120858. return c
  120859. }
  120860. // Fields allows partial responses to be retrieved. See
  120861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  120862. // for more information.
  120863. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  120864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  120865. return c
  120866. }
  120867. // Context sets the context to be used in this call's Do method. Any
  120868. // pending HTTP request will be aborted if the provided context is
  120869. // canceled.
  120870. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  120871. c.ctx_ = ctx
  120872. return c
  120873. }
  120874. // Header returns an http.Header that can be modified by the caller to
  120875. // add HTTP headers to the request.
  120876. func (c *RoutesDeleteCall) Header() http.Header {
  120877. if c.header_ == nil {
  120878. c.header_ = make(http.Header)
  120879. }
  120880. return c.header_
  120881. }
  120882. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  120883. reqHeaders := make(http.Header)
  120884. for k, v := range c.header_ {
  120885. reqHeaders[k] = v
  120886. }
  120887. reqHeaders.Set("User-Agent", c.s.userAgent())
  120888. var body io.Reader = nil
  120889. c.urlParams_.Set("alt", alt)
  120890. c.urlParams_.Set("prettyPrint", "false")
  120891. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  120892. urls += "?" + c.urlParams_.Encode()
  120893. req, err := http.NewRequest("DELETE", urls, body)
  120894. if err != nil {
  120895. return nil, err
  120896. }
  120897. req.Header = reqHeaders
  120898. googleapi.Expand(req.URL, map[string]string{
  120899. "project": c.project,
  120900. "route": c.route,
  120901. })
  120902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  120903. }
  120904. // Do executes the "compute.routes.delete" call.
  120905. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  120906. // status code is an error. Response headers are in either
  120907. // *Operation.ServerResponse.Header or (if a response was returned at
  120908. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  120909. // to check whether the returned error was because
  120910. // http.StatusNotModified was returned.
  120911. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  120912. gensupport.SetOptions(c.urlParams_, opts...)
  120913. res, err := c.doRequest("json")
  120914. if res != nil && res.StatusCode == http.StatusNotModified {
  120915. if res.Body != nil {
  120916. res.Body.Close()
  120917. }
  120918. return nil, &googleapi.Error{
  120919. Code: res.StatusCode,
  120920. Header: res.Header,
  120921. }
  120922. }
  120923. if err != nil {
  120924. return nil, err
  120925. }
  120926. defer googleapi.CloseBody(res)
  120927. if err := googleapi.CheckResponse(res); err != nil {
  120928. return nil, err
  120929. }
  120930. ret := &Operation{
  120931. ServerResponse: googleapi.ServerResponse{
  120932. Header: res.Header,
  120933. HTTPStatusCode: res.StatusCode,
  120934. },
  120935. }
  120936. target := &ret
  120937. if err := gensupport.DecodeResponse(target, res); err != nil {
  120938. return nil, err
  120939. }
  120940. return ret, nil
  120941. // {
  120942. // "description": "Deletes the specified Route resource.",
  120943. // "httpMethod": "DELETE",
  120944. // "id": "compute.routes.delete",
  120945. // "parameterOrder": [
  120946. // "project",
  120947. // "route"
  120948. // ],
  120949. // "parameters": {
  120950. // "project": {
  120951. // "description": "Project ID for this request.",
  120952. // "location": "path",
  120953. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  120954. // "required": true,
  120955. // "type": "string"
  120956. // },
  120957. // "requestId": {
  120958. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  120959. // "location": "query",
  120960. // "type": "string"
  120961. // },
  120962. // "route": {
  120963. // "description": "Name of the Route resource to delete.",
  120964. // "location": "path",
  120965. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  120966. // "required": true,
  120967. // "type": "string"
  120968. // }
  120969. // },
  120970. // "path": "{project}/global/routes/{route}",
  120971. // "response": {
  120972. // "$ref": "Operation"
  120973. // },
  120974. // "scopes": [
  120975. // "https://www.googleapis.com/auth/cloud-platform",
  120976. // "https://www.googleapis.com/auth/compute"
  120977. // ]
  120978. // }
  120979. }
  120980. // method id "compute.routes.get":
  120981. type RoutesGetCall struct {
  120982. s *Service
  120983. project string
  120984. route string
  120985. urlParams_ gensupport.URLParams
  120986. ifNoneMatch_ string
  120987. ctx_ context.Context
  120988. header_ http.Header
  120989. }
  120990. // Get: Returns the specified Route resource. Gets a list of available
  120991. // routes by making a list() request.
  120992. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  120993. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  120994. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  120995. c.project = project
  120996. c.route = route
  120997. return c
  120998. }
  120999. // Fields allows partial responses to be retrieved. See
  121000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121001. // for more information.
  121002. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  121003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121004. return c
  121005. }
  121006. // IfNoneMatch sets the optional parameter which makes the operation
  121007. // fail if the object's ETag matches the given value. This is useful for
  121008. // getting updates only after the object has changed since the last
  121009. // request. Use googleapi.IsNotModified to check whether the response
  121010. // error from Do is the result of In-None-Match.
  121011. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  121012. c.ifNoneMatch_ = entityTag
  121013. return c
  121014. }
  121015. // Context sets the context to be used in this call's Do method. Any
  121016. // pending HTTP request will be aborted if the provided context is
  121017. // canceled.
  121018. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  121019. c.ctx_ = ctx
  121020. return c
  121021. }
  121022. // Header returns an http.Header that can be modified by the caller to
  121023. // add HTTP headers to the request.
  121024. func (c *RoutesGetCall) Header() http.Header {
  121025. if c.header_ == nil {
  121026. c.header_ = make(http.Header)
  121027. }
  121028. return c.header_
  121029. }
  121030. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  121031. reqHeaders := make(http.Header)
  121032. for k, v := range c.header_ {
  121033. reqHeaders[k] = v
  121034. }
  121035. reqHeaders.Set("User-Agent", c.s.userAgent())
  121036. if c.ifNoneMatch_ != "" {
  121037. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121038. }
  121039. var body io.Reader = nil
  121040. c.urlParams_.Set("alt", alt)
  121041. c.urlParams_.Set("prettyPrint", "false")
  121042. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  121043. urls += "?" + c.urlParams_.Encode()
  121044. req, err := http.NewRequest("GET", urls, body)
  121045. if err != nil {
  121046. return nil, err
  121047. }
  121048. req.Header = reqHeaders
  121049. googleapi.Expand(req.URL, map[string]string{
  121050. "project": c.project,
  121051. "route": c.route,
  121052. })
  121053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121054. }
  121055. // Do executes the "compute.routes.get" call.
  121056. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  121057. // code is an error. Response headers are in either
  121058. // *Route.ServerResponse.Header or (if a response was returned at all)
  121059. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  121060. // check whether the returned error was because http.StatusNotModified
  121061. // was returned.
  121062. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  121063. gensupport.SetOptions(c.urlParams_, opts...)
  121064. res, err := c.doRequest("json")
  121065. if res != nil && res.StatusCode == http.StatusNotModified {
  121066. if res.Body != nil {
  121067. res.Body.Close()
  121068. }
  121069. return nil, &googleapi.Error{
  121070. Code: res.StatusCode,
  121071. Header: res.Header,
  121072. }
  121073. }
  121074. if err != nil {
  121075. return nil, err
  121076. }
  121077. defer googleapi.CloseBody(res)
  121078. if err := googleapi.CheckResponse(res); err != nil {
  121079. return nil, err
  121080. }
  121081. ret := &Route{
  121082. ServerResponse: googleapi.ServerResponse{
  121083. Header: res.Header,
  121084. HTTPStatusCode: res.StatusCode,
  121085. },
  121086. }
  121087. target := &ret
  121088. if err := gensupport.DecodeResponse(target, res); err != nil {
  121089. return nil, err
  121090. }
  121091. return ret, nil
  121092. // {
  121093. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  121094. // "httpMethod": "GET",
  121095. // "id": "compute.routes.get",
  121096. // "parameterOrder": [
  121097. // "project",
  121098. // "route"
  121099. // ],
  121100. // "parameters": {
  121101. // "project": {
  121102. // "description": "Project ID for this request.",
  121103. // "location": "path",
  121104. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121105. // "required": true,
  121106. // "type": "string"
  121107. // },
  121108. // "route": {
  121109. // "description": "Name of the Route resource to return.",
  121110. // "location": "path",
  121111. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  121112. // "required": true,
  121113. // "type": "string"
  121114. // }
  121115. // },
  121116. // "path": "{project}/global/routes/{route}",
  121117. // "response": {
  121118. // "$ref": "Route"
  121119. // },
  121120. // "scopes": [
  121121. // "https://www.googleapis.com/auth/cloud-platform",
  121122. // "https://www.googleapis.com/auth/compute",
  121123. // "https://www.googleapis.com/auth/compute.readonly"
  121124. // ]
  121125. // }
  121126. }
  121127. // method id "compute.routes.insert":
  121128. type RoutesInsertCall struct {
  121129. s *Service
  121130. project string
  121131. route *Route
  121132. urlParams_ gensupport.URLParams
  121133. ctx_ context.Context
  121134. header_ http.Header
  121135. }
  121136. // Insert: Creates a Route resource in the specified project using the
  121137. // data included in the request.
  121138. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  121139. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  121140. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121141. c.project = project
  121142. c.route = route
  121143. return c
  121144. }
  121145. // RequestId sets the optional parameter "requestId": An optional
  121146. // request ID to identify requests. Specify a unique request ID so that
  121147. // if you must retry your request, the server will know to ignore the
  121148. // request if it has already been completed.
  121149. //
  121150. // For example, consider a situation where you make an initial request
  121151. // and the request times out. If you make the request again with the
  121152. // same request ID, the server can check if original operation with the
  121153. // same request ID was received, and if so, will ignore the second
  121154. // request. This prevents clients from accidentally creating duplicate
  121155. // commitments.
  121156. //
  121157. // The request ID must be a valid UUID with the exception that zero UUID
  121158. // is not supported (00000000-0000-0000-0000-000000000000).
  121159. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  121160. c.urlParams_.Set("requestId", requestId)
  121161. return c
  121162. }
  121163. // Fields allows partial responses to be retrieved. See
  121164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121165. // for more information.
  121166. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  121167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121168. return c
  121169. }
  121170. // Context sets the context to be used in this call's Do method. Any
  121171. // pending HTTP request will be aborted if the provided context is
  121172. // canceled.
  121173. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  121174. c.ctx_ = ctx
  121175. return c
  121176. }
  121177. // Header returns an http.Header that can be modified by the caller to
  121178. // add HTTP headers to the request.
  121179. func (c *RoutesInsertCall) Header() http.Header {
  121180. if c.header_ == nil {
  121181. c.header_ = make(http.Header)
  121182. }
  121183. return c.header_
  121184. }
  121185. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  121186. reqHeaders := make(http.Header)
  121187. for k, v := range c.header_ {
  121188. reqHeaders[k] = v
  121189. }
  121190. reqHeaders.Set("User-Agent", c.s.userAgent())
  121191. var body io.Reader = nil
  121192. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  121193. if err != nil {
  121194. return nil, err
  121195. }
  121196. reqHeaders.Set("Content-Type", "application/json")
  121197. c.urlParams_.Set("alt", alt)
  121198. c.urlParams_.Set("prettyPrint", "false")
  121199. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  121200. urls += "?" + c.urlParams_.Encode()
  121201. req, err := http.NewRequest("POST", urls, body)
  121202. if err != nil {
  121203. return nil, err
  121204. }
  121205. req.Header = reqHeaders
  121206. googleapi.Expand(req.URL, map[string]string{
  121207. "project": c.project,
  121208. })
  121209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121210. }
  121211. // Do executes the "compute.routes.insert" call.
  121212. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  121213. // status code is an error. Response headers are in either
  121214. // *Operation.ServerResponse.Header or (if a response was returned at
  121215. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121216. // to check whether the returned error was because
  121217. // http.StatusNotModified was returned.
  121218. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  121219. gensupport.SetOptions(c.urlParams_, opts...)
  121220. res, err := c.doRequest("json")
  121221. if res != nil && res.StatusCode == http.StatusNotModified {
  121222. if res.Body != nil {
  121223. res.Body.Close()
  121224. }
  121225. return nil, &googleapi.Error{
  121226. Code: res.StatusCode,
  121227. Header: res.Header,
  121228. }
  121229. }
  121230. if err != nil {
  121231. return nil, err
  121232. }
  121233. defer googleapi.CloseBody(res)
  121234. if err := googleapi.CheckResponse(res); err != nil {
  121235. return nil, err
  121236. }
  121237. ret := &Operation{
  121238. ServerResponse: googleapi.ServerResponse{
  121239. Header: res.Header,
  121240. HTTPStatusCode: res.StatusCode,
  121241. },
  121242. }
  121243. target := &ret
  121244. if err := gensupport.DecodeResponse(target, res); err != nil {
  121245. return nil, err
  121246. }
  121247. return ret, nil
  121248. // {
  121249. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  121250. // "httpMethod": "POST",
  121251. // "id": "compute.routes.insert",
  121252. // "parameterOrder": [
  121253. // "project"
  121254. // ],
  121255. // "parameters": {
  121256. // "project": {
  121257. // "description": "Project ID for this request.",
  121258. // "location": "path",
  121259. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121260. // "required": true,
  121261. // "type": "string"
  121262. // },
  121263. // "requestId": {
  121264. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  121265. // "location": "query",
  121266. // "type": "string"
  121267. // }
  121268. // },
  121269. // "path": "{project}/global/routes",
  121270. // "request": {
  121271. // "$ref": "Route"
  121272. // },
  121273. // "response": {
  121274. // "$ref": "Operation"
  121275. // },
  121276. // "scopes": [
  121277. // "https://www.googleapis.com/auth/cloud-platform",
  121278. // "https://www.googleapis.com/auth/compute"
  121279. // ]
  121280. // }
  121281. }
  121282. // method id "compute.routes.list":
  121283. type RoutesListCall struct {
  121284. s *Service
  121285. project string
  121286. urlParams_ gensupport.URLParams
  121287. ifNoneMatch_ string
  121288. ctx_ context.Context
  121289. header_ http.Header
  121290. }
  121291. // List: Retrieves the list of Route resources available to the
  121292. // specified project.
  121293. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  121294. func (r *RoutesService) List(project string) *RoutesListCall {
  121295. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121296. c.project = project
  121297. return c
  121298. }
  121299. // Filter sets the optional parameter "filter": A filter expression that
  121300. // filters resources listed in the response. The expression must specify
  121301. // the field name, a comparison operator, and the value that you want to
  121302. // use for filtering. The value must be a string, a number, or a
  121303. // boolean. The comparison operator must be either =, !=, >, or <.
  121304. //
  121305. // For example, if you are filtering Compute Engine instances, you can
  121306. // exclude instances named example-instance by specifying name !=
  121307. // example-instance.
  121308. //
  121309. // You can also filter nested fields. For example, you could specify
  121310. // scheduling.automaticRestart = false to include instances only if they
  121311. // are not scheduled for automatic restarts. You can use filtering on
  121312. // nested fields to filter based on resource labels.
  121313. //
  121314. // To filter on multiple expressions, provide each separate expression
  121315. // within parentheses. For example, (scheduling.automaticRestart = true)
  121316. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  121317. // AND expression. However, you can include AND and OR expressions
  121318. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  121319. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  121320. // true).
  121321. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  121322. c.urlParams_.Set("filter", filter)
  121323. return c
  121324. }
  121325. // MaxResults sets the optional parameter "maxResults": The maximum
  121326. // number of results per page that should be returned. If the number of
  121327. // available results is larger than maxResults, Compute Engine returns a
  121328. // nextPageToken that can be used to get the next page of results in
  121329. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  121330. // (Default: 500)
  121331. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  121332. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  121333. return c
  121334. }
  121335. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  121336. // a certain order. By default, results are returned in alphanumerical
  121337. // order based on the resource name.
  121338. //
  121339. // You can also sort results in descending order based on the creation
  121340. // timestamp using orderBy="creationTimestamp desc". This sorts results
  121341. // based on the creationTimestamp field in reverse chronological order
  121342. // (newest result first). Use this to sort resources like operations so
  121343. // that the newest operation is returned first.
  121344. //
  121345. // Currently, only sorting by name or creationTimestamp desc is
  121346. // supported.
  121347. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  121348. c.urlParams_.Set("orderBy", orderBy)
  121349. return c
  121350. }
  121351. // PageToken sets the optional parameter "pageToken": Specifies a page
  121352. // token to use. Set pageToken to the nextPageToken returned by a
  121353. // previous list request to get the next page of results.
  121354. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  121355. c.urlParams_.Set("pageToken", pageToken)
  121356. return c
  121357. }
  121358. // Fields allows partial responses to be retrieved. See
  121359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121360. // for more information.
  121361. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  121362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121363. return c
  121364. }
  121365. // IfNoneMatch sets the optional parameter which makes the operation
  121366. // fail if the object's ETag matches the given value. This is useful for
  121367. // getting updates only after the object has changed since the last
  121368. // request. Use googleapi.IsNotModified to check whether the response
  121369. // error from Do is the result of In-None-Match.
  121370. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  121371. c.ifNoneMatch_ = entityTag
  121372. return c
  121373. }
  121374. // Context sets the context to be used in this call's Do method. Any
  121375. // pending HTTP request will be aborted if the provided context is
  121376. // canceled.
  121377. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  121378. c.ctx_ = ctx
  121379. return c
  121380. }
  121381. // Header returns an http.Header that can be modified by the caller to
  121382. // add HTTP headers to the request.
  121383. func (c *RoutesListCall) Header() http.Header {
  121384. if c.header_ == nil {
  121385. c.header_ = make(http.Header)
  121386. }
  121387. return c.header_
  121388. }
  121389. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  121390. reqHeaders := make(http.Header)
  121391. for k, v := range c.header_ {
  121392. reqHeaders[k] = v
  121393. }
  121394. reqHeaders.Set("User-Agent", c.s.userAgent())
  121395. if c.ifNoneMatch_ != "" {
  121396. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  121397. }
  121398. var body io.Reader = nil
  121399. c.urlParams_.Set("alt", alt)
  121400. c.urlParams_.Set("prettyPrint", "false")
  121401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  121402. urls += "?" + c.urlParams_.Encode()
  121403. req, err := http.NewRequest("GET", urls, body)
  121404. if err != nil {
  121405. return nil, err
  121406. }
  121407. req.Header = reqHeaders
  121408. googleapi.Expand(req.URL, map[string]string{
  121409. "project": c.project,
  121410. })
  121411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121412. }
  121413. // Do executes the "compute.routes.list" call.
  121414. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  121415. // status code is an error. Response headers are in either
  121416. // *RouteList.ServerResponse.Header or (if a response was returned at
  121417. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121418. // to check whether the returned error was because
  121419. // http.StatusNotModified was returned.
  121420. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  121421. gensupport.SetOptions(c.urlParams_, opts...)
  121422. res, err := c.doRequest("json")
  121423. if res != nil && res.StatusCode == http.StatusNotModified {
  121424. if res.Body != nil {
  121425. res.Body.Close()
  121426. }
  121427. return nil, &googleapi.Error{
  121428. Code: res.StatusCode,
  121429. Header: res.Header,
  121430. }
  121431. }
  121432. if err != nil {
  121433. return nil, err
  121434. }
  121435. defer googleapi.CloseBody(res)
  121436. if err := googleapi.CheckResponse(res); err != nil {
  121437. return nil, err
  121438. }
  121439. ret := &RouteList{
  121440. ServerResponse: googleapi.ServerResponse{
  121441. Header: res.Header,
  121442. HTTPStatusCode: res.StatusCode,
  121443. },
  121444. }
  121445. target := &ret
  121446. if err := gensupport.DecodeResponse(target, res); err != nil {
  121447. return nil, err
  121448. }
  121449. return ret, nil
  121450. // {
  121451. // "description": "Retrieves the list of Route resources available to the specified project.",
  121452. // "httpMethod": "GET",
  121453. // "id": "compute.routes.list",
  121454. // "parameterOrder": [
  121455. // "project"
  121456. // ],
  121457. // "parameters": {
  121458. // "filter": {
  121459. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  121460. // "location": "query",
  121461. // "type": "string"
  121462. // },
  121463. // "maxResults": {
  121464. // "default": "500",
  121465. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  121466. // "format": "uint32",
  121467. // "location": "query",
  121468. // "minimum": "0",
  121469. // "type": "integer"
  121470. // },
  121471. // "orderBy": {
  121472. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  121473. // "location": "query",
  121474. // "type": "string"
  121475. // },
  121476. // "pageToken": {
  121477. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  121478. // "location": "query",
  121479. // "type": "string"
  121480. // },
  121481. // "project": {
  121482. // "description": "Project ID for this request.",
  121483. // "location": "path",
  121484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121485. // "required": true,
  121486. // "type": "string"
  121487. // }
  121488. // },
  121489. // "path": "{project}/global/routes",
  121490. // "response": {
  121491. // "$ref": "RouteList"
  121492. // },
  121493. // "scopes": [
  121494. // "https://www.googleapis.com/auth/cloud-platform",
  121495. // "https://www.googleapis.com/auth/compute",
  121496. // "https://www.googleapis.com/auth/compute.readonly"
  121497. // ]
  121498. // }
  121499. }
  121500. // Pages invokes f for each page of results.
  121501. // A non-nil error returned from f will halt the iteration.
  121502. // The provided context supersedes any context provided to the Context method.
  121503. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  121504. c.ctx_ = ctx
  121505. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  121506. for {
  121507. x, err := c.Do()
  121508. if err != nil {
  121509. return err
  121510. }
  121511. if err := f(x); err != nil {
  121512. return err
  121513. }
  121514. if x.NextPageToken == "" {
  121515. return nil
  121516. }
  121517. c.PageToken(x.NextPageToken)
  121518. }
  121519. }
  121520. // method id "compute.routes.testIamPermissions":
  121521. type RoutesTestIamPermissionsCall struct {
  121522. s *Service
  121523. project string
  121524. resource string
  121525. testpermissionsrequest *TestPermissionsRequest
  121526. urlParams_ gensupport.URLParams
  121527. ctx_ context.Context
  121528. header_ http.Header
  121529. }
  121530. // TestIamPermissions: Returns permissions that a caller has on the
  121531. // specified resource.
  121532. func (r *RoutesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutesTestIamPermissionsCall {
  121533. c := &RoutesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121534. c.project = project
  121535. c.resource = resource
  121536. c.testpermissionsrequest = testpermissionsrequest
  121537. return c
  121538. }
  121539. // Fields allows partial responses to be retrieved. See
  121540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121541. // for more information.
  121542. func (c *RoutesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutesTestIamPermissionsCall {
  121543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121544. return c
  121545. }
  121546. // Context sets the context to be used in this call's Do method. Any
  121547. // pending HTTP request will be aborted if the provided context is
  121548. // canceled.
  121549. func (c *RoutesTestIamPermissionsCall) Context(ctx context.Context) *RoutesTestIamPermissionsCall {
  121550. c.ctx_ = ctx
  121551. return c
  121552. }
  121553. // Header returns an http.Header that can be modified by the caller to
  121554. // add HTTP headers to the request.
  121555. func (c *RoutesTestIamPermissionsCall) Header() http.Header {
  121556. if c.header_ == nil {
  121557. c.header_ = make(http.Header)
  121558. }
  121559. return c.header_
  121560. }
  121561. func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  121562. reqHeaders := make(http.Header)
  121563. for k, v := range c.header_ {
  121564. reqHeaders[k] = v
  121565. }
  121566. reqHeaders.Set("User-Agent", c.s.userAgent())
  121567. var body io.Reader = nil
  121568. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  121569. if err != nil {
  121570. return nil, err
  121571. }
  121572. reqHeaders.Set("Content-Type", "application/json")
  121573. c.urlParams_.Set("alt", alt)
  121574. c.urlParams_.Set("prettyPrint", "false")
  121575. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{resource}/testIamPermissions")
  121576. urls += "?" + c.urlParams_.Encode()
  121577. req, err := http.NewRequest("POST", urls, body)
  121578. if err != nil {
  121579. return nil, err
  121580. }
  121581. req.Header = reqHeaders
  121582. googleapi.Expand(req.URL, map[string]string{
  121583. "project": c.project,
  121584. "resource": c.resource,
  121585. })
  121586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121587. }
  121588. // Do executes the "compute.routes.testIamPermissions" call.
  121589. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  121590. // non-2xx status code is an error. Response headers are in either
  121591. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  121592. // returned at all) in error.(*googleapi.Error).Header. Use
  121593. // googleapi.IsNotModified to check whether the returned error was
  121594. // because http.StatusNotModified was returned.
  121595. func (c *RoutesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  121596. gensupport.SetOptions(c.urlParams_, opts...)
  121597. res, err := c.doRequest("json")
  121598. if res != nil && res.StatusCode == http.StatusNotModified {
  121599. if res.Body != nil {
  121600. res.Body.Close()
  121601. }
  121602. return nil, &googleapi.Error{
  121603. Code: res.StatusCode,
  121604. Header: res.Header,
  121605. }
  121606. }
  121607. if err != nil {
  121608. return nil, err
  121609. }
  121610. defer googleapi.CloseBody(res)
  121611. if err := googleapi.CheckResponse(res); err != nil {
  121612. return nil, err
  121613. }
  121614. ret := &TestPermissionsResponse{
  121615. ServerResponse: googleapi.ServerResponse{
  121616. Header: res.Header,
  121617. HTTPStatusCode: res.StatusCode,
  121618. },
  121619. }
  121620. target := &ret
  121621. if err := gensupport.DecodeResponse(target, res); err != nil {
  121622. return nil, err
  121623. }
  121624. return ret, nil
  121625. // {
  121626. // "description": "Returns permissions that a caller has on the specified resource.",
  121627. // "httpMethod": "POST",
  121628. // "id": "compute.routes.testIamPermissions",
  121629. // "parameterOrder": [
  121630. // "project",
  121631. // "resource"
  121632. // ],
  121633. // "parameters": {
  121634. // "project": {
  121635. // "description": "Project ID for this request.",
  121636. // "location": "path",
  121637. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121638. // "required": true,
  121639. // "type": "string"
  121640. // },
  121641. // "resource": {
  121642. // "description": "Name or id of the resource for this request.",
  121643. // "location": "path",
  121644. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  121645. // "required": true,
  121646. // "type": "string"
  121647. // }
  121648. // },
  121649. // "path": "{project}/global/routes/{resource}/testIamPermissions",
  121650. // "request": {
  121651. // "$ref": "TestPermissionsRequest"
  121652. // },
  121653. // "response": {
  121654. // "$ref": "TestPermissionsResponse"
  121655. // },
  121656. // "scopes": [
  121657. // "https://www.googleapis.com/auth/cloud-platform",
  121658. // "https://www.googleapis.com/auth/compute",
  121659. // "https://www.googleapis.com/auth/compute.readonly"
  121660. // ]
  121661. // }
  121662. }
  121663. // method id "compute.securityPolicies.addRule":
  121664. type SecurityPoliciesAddRuleCall struct {
  121665. s *Service
  121666. project string
  121667. securityPolicy string
  121668. securitypolicyrule *SecurityPolicyRule
  121669. urlParams_ gensupport.URLParams
  121670. ctx_ context.Context
  121671. header_ http.Header
  121672. }
  121673. // AddRule: Inserts a rule into a security policy.
  121674. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  121675. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121676. c.project = project
  121677. c.securityPolicy = securityPolicy
  121678. c.securitypolicyrule = securitypolicyrule
  121679. return c
  121680. }
  121681. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  121682. // request will not be committed.
  121683. func (c *SecurityPoliciesAddRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesAddRuleCall {
  121684. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  121685. return c
  121686. }
  121687. // Fields allows partial responses to be retrieved. See
  121688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121689. // for more information.
  121690. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  121691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121692. return c
  121693. }
  121694. // Context sets the context to be used in this call's Do method. Any
  121695. // pending HTTP request will be aborted if the provided context is
  121696. // canceled.
  121697. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  121698. c.ctx_ = ctx
  121699. return c
  121700. }
  121701. // Header returns an http.Header that can be modified by the caller to
  121702. // add HTTP headers to the request.
  121703. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  121704. if c.header_ == nil {
  121705. c.header_ = make(http.Header)
  121706. }
  121707. return c.header_
  121708. }
  121709. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  121710. reqHeaders := make(http.Header)
  121711. for k, v := range c.header_ {
  121712. reqHeaders[k] = v
  121713. }
  121714. reqHeaders.Set("User-Agent", c.s.userAgent())
  121715. var body io.Reader = nil
  121716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  121717. if err != nil {
  121718. return nil, err
  121719. }
  121720. reqHeaders.Set("Content-Type", "application/json")
  121721. c.urlParams_.Set("alt", alt)
  121722. c.urlParams_.Set("prettyPrint", "false")
  121723. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  121724. urls += "?" + c.urlParams_.Encode()
  121725. req, err := http.NewRequest("POST", urls, body)
  121726. if err != nil {
  121727. return nil, err
  121728. }
  121729. req.Header = reqHeaders
  121730. googleapi.Expand(req.URL, map[string]string{
  121731. "project": c.project,
  121732. "securityPolicy": c.securityPolicy,
  121733. })
  121734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121735. }
  121736. // Do executes the "compute.securityPolicies.addRule" call.
  121737. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  121738. // status code is an error. Response headers are in either
  121739. // *Operation.ServerResponse.Header or (if a response was returned at
  121740. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121741. // to check whether the returned error was because
  121742. // http.StatusNotModified was returned.
  121743. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  121744. gensupport.SetOptions(c.urlParams_, opts...)
  121745. res, err := c.doRequest("json")
  121746. if res != nil && res.StatusCode == http.StatusNotModified {
  121747. if res.Body != nil {
  121748. res.Body.Close()
  121749. }
  121750. return nil, &googleapi.Error{
  121751. Code: res.StatusCode,
  121752. Header: res.Header,
  121753. }
  121754. }
  121755. if err != nil {
  121756. return nil, err
  121757. }
  121758. defer googleapi.CloseBody(res)
  121759. if err := googleapi.CheckResponse(res); err != nil {
  121760. return nil, err
  121761. }
  121762. ret := &Operation{
  121763. ServerResponse: googleapi.ServerResponse{
  121764. Header: res.Header,
  121765. HTTPStatusCode: res.StatusCode,
  121766. },
  121767. }
  121768. target := &ret
  121769. if err := gensupport.DecodeResponse(target, res); err != nil {
  121770. return nil, err
  121771. }
  121772. return ret, nil
  121773. // {
  121774. // "description": "Inserts a rule into a security policy.",
  121775. // "httpMethod": "POST",
  121776. // "id": "compute.securityPolicies.addRule",
  121777. // "parameterOrder": [
  121778. // "project",
  121779. // "securityPolicy"
  121780. // ],
  121781. // "parameters": {
  121782. // "project": {
  121783. // "description": "Project ID for this request.",
  121784. // "location": "path",
  121785. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121786. // "required": true,
  121787. // "type": "string"
  121788. // },
  121789. // "securityPolicy": {
  121790. // "description": "Name of the security policy to update.",
  121791. // "location": "path",
  121792. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  121793. // "required": true,
  121794. // "type": "string"
  121795. // },
  121796. // "validateOnly": {
  121797. // "description": "If true, the request will not be committed.",
  121798. // "location": "query",
  121799. // "type": "boolean"
  121800. // }
  121801. // },
  121802. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  121803. // "request": {
  121804. // "$ref": "SecurityPolicyRule"
  121805. // },
  121806. // "response": {
  121807. // "$ref": "Operation"
  121808. // },
  121809. // "scopes": [
  121810. // "https://www.googleapis.com/auth/cloud-platform",
  121811. // "https://www.googleapis.com/auth/compute"
  121812. // ]
  121813. // }
  121814. }
  121815. // method id "compute.securityPolicies.delete":
  121816. type SecurityPoliciesDeleteCall struct {
  121817. s *Service
  121818. project string
  121819. securityPolicy string
  121820. urlParams_ gensupport.URLParams
  121821. ctx_ context.Context
  121822. header_ http.Header
  121823. }
  121824. // Delete: Deletes the specified policy.
  121825. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  121826. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121827. c.project = project
  121828. c.securityPolicy = securityPolicy
  121829. return c
  121830. }
  121831. // RequestId sets the optional parameter "requestId": An optional
  121832. // request ID to identify requests. Specify a unique request ID so that
  121833. // if you must retry your request, the server will know to ignore the
  121834. // request if it has already been completed.
  121835. //
  121836. // For example, consider a situation where you make an initial request
  121837. // and the request times out. If you make the request again with the
  121838. // same request ID, the server can check if original operation with the
  121839. // same request ID was received, and if so, will ignore the second
  121840. // request. This prevents clients from accidentally creating duplicate
  121841. // commitments.
  121842. //
  121843. // The request ID must be a valid UUID with the exception that zero UUID
  121844. // is not supported (00000000-0000-0000-0000-000000000000).
  121845. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  121846. c.urlParams_.Set("requestId", requestId)
  121847. return c
  121848. }
  121849. // Fields allows partial responses to be retrieved. See
  121850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121851. // for more information.
  121852. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  121853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121854. return c
  121855. }
  121856. // Context sets the context to be used in this call's Do method. Any
  121857. // pending HTTP request will be aborted if the provided context is
  121858. // canceled.
  121859. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  121860. c.ctx_ = ctx
  121861. return c
  121862. }
  121863. // Header returns an http.Header that can be modified by the caller to
  121864. // add HTTP headers to the request.
  121865. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  121866. if c.header_ == nil {
  121867. c.header_ = make(http.Header)
  121868. }
  121869. return c.header_
  121870. }
  121871. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  121872. reqHeaders := make(http.Header)
  121873. for k, v := range c.header_ {
  121874. reqHeaders[k] = v
  121875. }
  121876. reqHeaders.Set("User-Agent", c.s.userAgent())
  121877. var body io.Reader = nil
  121878. c.urlParams_.Set("alt", alt)
  121879. c.urlParams_.Set("prettyPrint", "false")
  121880. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  121881. urls += "?" + c.urlParams_.Encode()
  121882. req, err := http.NewRequest("DELETE", urls, body)
  121883. if err != nil {
  121884. return nil, err
  121885. }
  121886. req.Header = reqHeaders
  121887. googleapi.Expand(req.URL, map[string]string{
  121888. "project": c.project,
  121889. "securityPolicy": c.securityPolicy,
  121890. })
  121891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  121892. }
  121893. // Do executes the "compute.securityPolicies.delete" call.
  121894. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  121895. // status code is an error. Response headers are in either
  121896. // *Operation.ServerResponse.Header or (if a response was returned at
  121897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  121898. // to check whether the returned error was because
  121899. // http.StatusNotModified was returned.
  121900. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  121901. gensupport.SetOptions(c.urlParams_, opts...)
  121902. res, err := c.doRequest("json")
  121903. if res != nil && res.StatusCode == http.StatusNotModified {
  121904. if res.Body != nil {
  121905. res.Body.Close()
  121906. }
  121907. return nil, &googleapi.Error{
  121908. Code: res.StatusCode,
  121909. Header: res.Header,
  121910. }
  121911. }
  121912. if err != nil {
  121913. return nil, err
  121914. }
  121915. defer googleapi.CloseBody(res)
  121916. if err := googleapi.CheckResponse(res); err != nil {
  121917. return nil, err
  121918. }
  121919. ret := &Operation{
  121920. ServerResponse: googleapi.ServerResponse{
  121921. Header: res.Header,
  121922. HTTPStatusCode: res.StatusCode,
  121923. },
  121924. }
  121925. target := &ret
  121926. if err := gensupport.DecodeResponse(target, res); err != nil {
  121927. return nil, err
  121928. }
  121929. return ret, nil
  121930. // {
  121931. // "description": "Deletes the specified policy.",
  121932. // "httpMethod": "DELETE",
  121933. // "id": "compute.securityPolicies.delete",
  121934. // "parameterOrder": [
  121935. // "project",
  121936. // "securityPolicy"
  121937. // ],
  121938. // "parameters": {
  121939. // "project": {
  121940. // "description": "Project ID for this request.",
  121941. // "location": "path",
  121942. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  121943. // "required": true,
  121944. // "type": "string"
  121945. // },
  121946. // "requestId": {
  121947. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  121948. // "location": "query",
  121949. // "type": "string"
  121950. // },
  121951. // "securityPolicy": {
  121952. // "description": "Name of the security policy to delete.",
  121953. // "location": "path",
  121954. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  121955. // "required": true,
  121956. // "type": "string"
  121957. // }
  121958. // },
  121959. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  121960. // "response": {
  121961. // "$ref": "Operation"
  121962. // },
  121963. // "scopes": [
  121964. // "https://www.googleapis.com/auth/cloud-platform",
  121965. // "https://www.googleapis.com/auth/compute"
  121966. // ]
  121967. // }
  121968. }
  121969. // method id "compute.securityPolicies.get":
  121970. type SecurityPoliciesGetCall struct {
  121971. s *Service
  121972. project string
  121973. securityPolicy string
  121974. urlParams_ gensupport.URLParams
  121975. ifNoneMatch_ string
  121976. ctx_ context.Context
  121977. header_ http.Header
  121978. }
  121979. // Get: List all of the ordered rules present in a single specified
  121980. // policy.
  121981. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  121982. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  121983. c.project = project
  121984. c.securityPolicy = securityPolicy
  121985. return c
  121986. }
  121987. // Fields allows partial responses to be retrieved. See
  121988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  121989. // for more information.
  121990. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  121991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  121992. return c
  121993. }
  121994. // IfNoneMatch sets the optional parameter which makes the operation
  121995. // fail if the object's ETag matches the given value. This is useful for
  121996. // getting updates only after the object has changed since the last
  121997. // request. Use googleapi.IsNotModified to check whether the response
  121998. // error from Do is the result of In-None-Match.
  121999. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  122000. c.ifNoneMatch_ = entityTag
  122001. return c
  122002. }
  122003. // Context sets the context to be used in this call's Do method. Any
  122004. // pending HTTP request will be aborted if the provided context is
  122005. // canceled.
  122006. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  122007. c.ctx_ = ctx
  122008. return c
  122009. }
  122010. // Header returns an http.Header that can be modified by the caller to
  122011. // add HTTP headers to the request.
  122012. func (c *SecurityPoliciesGetCall) Header() http.Header {
  122013. if c.header_ == nil {
  122014. c.header_ = make(http.Header)
  122015. }
  122016. return c.header_
  122017. }
  122018. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  122019. reqHeaders := make(http.Header)
  122020. for k, v := range c.header_ {
  122021. reqHeaders[k] = v
  122022. }
  122023. reqHeaders.Set("User-Agent", c.s.userAgent())
  122024. if c.ifNoneMatch_ != "" {
  122025. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122026. }
  122027. var body io.Reader = nil
  122028. c.urlParams_.Set("alt", alt)
  122029. c.urlParams_.Set("prettyPrint", "false")
  122030. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  122031. urls += "?" + c.urlParams_.Encode()
  122032. req, err := http.NewRequest("GET", urls, body)
  122033. if err != nil {
  122034. return nil, err
  122035. }
  122036. req.Header = reqHeaders
  122037. googleapi.Expand(req.URL, map[string]string{
  122038. "project": c.project,
  122039. "securityPolicy": c.securityPolicy,
  122040. })
  122041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122042. }
  122043. // Do executes the "compute.securityPolicies.get" call.
  122044. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  122045. // status code is an error. Response headers are in either
  122046. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  122047. // at all) in error.(*googleapi.Error).Header. Use
  122048. // googleapi.IsNotModified to check whether the returned error was
  122049. // because http.StatusNotModified was returned.
  122050. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  122051. gensupport.SetOptions(c.urlParams_, opts...)
  122052. res, err := c.doRequest("json")
  122053. if res != nil && res.StatusCode == http.StatusNotModified {
  122054. if res.Body != nil {
  122055. res.Body.Close()
  122056. }
  122057. return nil, &googleapi.Error{
  122058. Code: res.StatusCode,
  122059. Header: res.Header,
  122060. }
  122061. }
  122062. if err != nil {
  122063. return nil, err
  122064. }
  122065. defer googleapi.CloseBody(res)
  122066. if err := googleapi.CheckResponse(res); err != nil {
  122067. return nil, err
  122068. }
  122069. ret := &SecurityPolicy{
  122070. ServerResponse: googleapi.ServerResponse{
  122071. Header: res.Header,
  122072. HTTPStatusCode: res.StatusCode,
  122073. },
  122074. }
  122075. target := &ret
  122076. if err := gensupport.DecodeResponse(target, res); err != nil {
  122077. return nil, err
  122078. }
  122079. return ret, nil
  122080. // {
  122081. // "description": "List all of the ordered rules present in a single specified policy.",
  122082. // "httpMethod": "GET",
  122083. // "id": "compute.securityPolicies.get",
  122084. // "parameterOrder": [
  122085. // "project",
  122086. // "securityPolicy"
  122087. // ],
  122088. // "parameters": {
  122089. // "project": {
  122090. // "description": "Project ID for this request.",
  122091. // "location": "path",
  122092. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122093. // "required": true,
  122094. // "type": "string"
  122095. // },
  122096. // "securityPolicy": {
  122097. // "description": "Name of the security policy to get.",
  122098. // "location": "path",
  122099. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  122100. // "required": true,
  122101. // "type": "string"
  122102. // }
  122103. // },
  122104. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  122105. // "response": {
  122106. // "$ref": "SecurityPolicy"
  122107. // },
  122108. // "scopes": [
  122109. // "https://www.googleapis.com/auth/cloud-platform",
  122110. // "https://www.googleapis.com/auth/compute",
  122111. // "https://www.googleapis.com/auth/compute.readonly"
  122112. // ]
  122113. // }
  122114. }
  122115. // method id "compute.securityPolicies.getRule":
  122116. type SecurityPoliciesGetRuleCall struct {
  122117. s *Service
  122118. project string
  122119. securityPolicy string
  122120. urlParams_ gensupport.URLParams
  122121. ifNoneMatch_ string
  122122. ctx_ context.Context
  122123. header_ http.Header
  122124. }
  122125. // GetRule: Gets a rule at the specified priority.
  122126. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  122127. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122128. c.project = project
  122129. c.securityPolicy = securityPolicy
  122130. return c
  122131. }
  122132. // Priority sets the optional parameter "priority": The priority of the
  122133. // rule to get from the security policy.
  122134. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  122135. c.urlParams_.Set("priority", fmt.Sprint(priority))
  122136. return c
  122137. }
  122138. // Fields allows partial responses to be retrieved. See
  122139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122140. // for more information.
  122141. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  122142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122143. return c
  122144. }
  122145. // IfNoneMatch sets the optional parameter which makes the operation
  122146. // fail if the object's ETag matches the given value. This is useful for
  122147. // getting updates only after the object has changed since the last
  122148. // request. Use googleapi.IsNotModified to check whether the response
  122149. // error from Do is the result of In-None-Match.
  122150. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  122151. c.ifNoneMatch_ = entityTag
  122152. return c
  122153. }
  122154. // Context sets the context to be used in this call's Do method. Any
  122155. // pending HTTP request will be aborted if the provided context is
  122156. // canceled.
  122157. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  122158. c.ctx_ = ctx
  122159. return c
  122160. }
  122161. // Header returns an http.Header that can be modified by the caller to
  122162. // add HTTP headers to the request.
  122163. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  122164. if c.header_ == nil {
  122165. c.header_ = make(http.Header)
  122166. }
  122167. return c.header_
  122168. }
  122169. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  122170. reqHeaders := make(http.Header)
  122171. for k, v := range c.header_ {
  122172. reqHeaders[k] = v
  122173. }
  122174. reqHeaders.Set("User-Agent", c.s.userAgent())
  122175. if c.ifNoneMatch_ != "" {
  122176. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122177. }
  122178. var body io.Reader = nil
  122179. c.urlParams_.Set("alt", alt)
  122180. c.urlParams_.Set("prettyPrint", "false")
  122181. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  122182. urls += "?" + c.urlParams_.Encode()
  122183. req, err := http.NewRequest("GET", urls, body)
  122184. if err != nil {
  122185. return nil, err
  122186. }
  122187. req.Header = reqHeaders
  122188. googleapi.Expand(req.URL, map[string]string{
  122189. "project": c.project,
  122190. "securityPolicy": c.securityPolicy,
  122191. })
  122192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122193. }
  122194. // Do executes the "compute.securityPolicies.getRule" call.
  122195. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  122196. // non-2xx status code is an error. Response headers are in either
  122197. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  122198. // returned at all) in error.(*googleapi.Error).Header. Use
  122199. // googleapi.IsNotModified to check whether the returned error was
  122200. // because http.StatusNotModified was returned.
  122201. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  122202. gensupport.SetOptions(c.urlParams_, opts...)
  122203. res, err := c.doRequest("json")
  122204. if res != nil && res.StatusCode == http.StatusNotModified {
  122205. if res.Body != nil {
  122206. res.Body.Close()
  122207. }
  122208. return nil, &googleapi.Error{
  122209. Code: res.StatusCode,
  122210. Header: res.Header,
  122211. }
  122212. }
  122213. if err != nil {
  122214. return nil, err
  122215. }
  122216. defer googleapi.CloseBody(res)
  122217. if err := googleapi.CheckResponse(res); err != nil {
  122218. return nil, err
  122219. }
  122220. ret := &SecurityPolicyRule{
  122221. ServerResponse: googleapi.ServerResponse{
  122222. Header: res.Header,
  122223. HTTPStatusCode: res.StatusCode,
  122224. },
  122225. }
  122226. target := &ret
  122227. if err := gensupport.DecodeResponse(target, res); err != nil {
  122228. return nil, err
  122229. }
  122230. return ret, nil
  122231. // {
  122232. // "description": "Gets a rule at the specified priority.",
  122233. // "httpMethod": "GET",
  122234. // "id": "compute.securityPolicies.getRule",
  122235. // "parameterOrder": [
  122236. // "project",
  122237. // "securityPolicy"
  122238. // ],
  122239. // "parameters": {
  122240. // "priority": {
  122241. // "description": "The priority of the rule to get from the security policy.",
  122242. // "format": "int32",
  122243. // "location": "query",
  122244. // "type": "integer"
  122245. // },
  122246. // "project": {
  122247. // "description": "Project ID for this request.",
  122248. // "location": "path",
  122249. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122250. // "required": true,
  122251. // "type": "string"
  122252. // },
  122253. // "securityPolicy": {
  122254. // "description": "Name of the security policy to which the queried rule belongs.",
  122255. // "location": "path",
  122256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  122257. // "required": true,
  122258. // "type": "string"
  122259. // }
  122260. // },
  122261. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  122262. // "response": {
  122263. // "$ref": "SecurityPolicyRule"
  122264. // },
  122265. // "scopes": [
  122266. // "https://www.googleapis.com/auth/cloud-platform",
  122267. // "https://www.googleapis.com/auth/compute",
  122268. // "https://www.googleapis.com/auth/compute.readonly"
  122269. // ]
  122270. // }
  122271. }
  122272. // method id "compute.securityPolicies.insert":
  122273. type SecurityPoliciesInsertCall struct {
  122274. s *Service
  122275. project string
  122276. securitypolicy *SecurityPolicy
  122277. urlParams_ gensupport.URLParams
  122278. ctx_ context.Context
  122279. header_ http.Header
  122280. }
  122281. // Insert: Creates a new policy in the specified project using the data
  122282. // included in the request.
  122283. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  122284. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122285. c.project = project
  122286. c.securitypolicy = securitypolicy
  122287. return c
  122288. }
  122289. // RequestId sets the optional parameter "requestId": An optional
  122290. // request ID to identify requests. Specify a unique request ID so that
  122291. // if you must retry your request, the server will know to ignore the
  122292. // request if it has already been completed.
  122293. //
  122294. // For example, consider a situation where you make an initial request
  122295. // and the request times out. If you make the request again with the
  122296. // same request ID, the server can check if original operation with the
  122297. // same request ID was received, and if so, will ignore the second
  122298. // request. This prevents clients from accidentally creating duplicate
  122299. // commitments.
  122300. //
  122301. // The request ID must be a valid UUID with the exception that zero UUID
  122302. // is not supported (00000000-0000-0000-0000-000000000000).
  122303. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  122304. c.urlParams_.Set("requestId", requestId)
  122305. return c
  122306. }
  122307. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  122308. // request will not be committed.
  122309. func (c *SecurityPoliciesInsertCall) ValidateOnly(validateOnly bool) *SecurityPoliciesInsertCall {
  122310. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  122311. return c
  122312. }
  122313. // Fields allows partial responses to be retrieved. See
  122314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122315. // for more information.
  122316. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  122317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122318. return c
  122319. }
  122320. // Context sets the context to be used in this call's Do method. Any
  122321. // pending HTTP request will be aborted if the provided context is
  122322. // canceled.
  122323. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  122324. c.ctx_ = ctx
  122325. return c
  122326. }
  122327. // Header returns an http.Header that can be modified by the caller to
  122328. // add HTTP headers to the request.
  122329. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  122330. if c.header_ == nil {
  122331. c.header_ = make(http.Header)
  122332. }
  122333. return c.header_
  122334. }
  122335. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  122336. reqHeaders := make(http.Header)
  122337. for k, v := range c.header_ {
  122338. reqHeaders[k] = v
  122339. }
  122340. reqHeaders.Set("User-Agent", c.s.userAgent())
  122341. var body io.Reader = nil
  122342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  122343. if err != nil {
  122344. return nil, err
  122345. }
  122346. reqHeaders.Set("Content-Type", "application/json")
  122347. c.urlParams_.Set("alt", alt)
  122348. c.urlParams_.Set("prettyPrint", "false")
  122349. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  122350. urls += "?" + c.urlParams_.Encode()
  122351. req, err := http.NewRequest("POST", urls, body)
  122352. if err != nil {
  122353. return nil, err
  122354. }
  122355. req.Header = reqHeaders
  122356. googleapi.Expand(req.URL, map[string]string{
  122357. "project": c.project,
  122358. })
  122359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122360. }
  122361. // Do executes the "compute.securityPolicies.insert" call.
  122362. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122363. // status code is an error. Response headers are in either
  122364. // *Operation.ServerResponse.Header or (if a response was returned at
  122365. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122366. // to check whether the returned error was because
  122367. // http.StatusNotModified was returned.
  122368. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122369. gensupport.SetOptions(c.urlParams_, opts...)
  122370. res, err := c.doRequest("json")
  122371. if res != nil && res.StatusCode == http.StatusNotModified {
  122372. if res.Body != nil {
  122373. res.Body.Close()
  122374. }
  122375. return nil, &googleapi.Error{
  122376. Code: res.StatusCode,
  122377. Header: res.Header,
  122378. }
  122379. }
  122380. if err != nil {
  122381. return nil, err
  122382. }
  122383. defer googleapi.CloseBody(res)
  122384. if err := googleapi.CheckResponse(res); err != nil {
  122385. return nil, err
  122386. }
  122387. ret := &Operation{
  122388. ServerResponse: googleapi.ServerResponse{
  122389. Header: res.Header,
  122390. HTTPStatusCode: res.StatusCode,
  122391. },
  122392. }
  122393. target := &ret
  122394. if err := gensupport.DecodeResponse(target, res); err != nil {
  122395. return nil, err
  122396. }
  122397. return ret, nil
  122398. // {
  122399. // "description": "Creates a new policy in the specified project using the data included in the request.",
  122400. // "httpMethod": "POST",
  122401. // "id": "compute.securityPolicies.insert",
  122402. // "parameterOrder": [
  122403. // "project"
  122404. // ],
  122405. // "parameters": {
  122406. // "project": {
  122407. // "description": "Project ID for this request.",
  122408. // "location": "path",
  122409. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122410. // "required": true,
  122411. // "type": "string"
  122412. // },
  122413. // "requestId": {
  122414. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  122415. // "location": "query",
  122416. // "type": "string"
  122417. // },
  122418. // "validateOnly": {
  122419. // "description": "If true, the request will not be committed.",
  122420. // "location": "query",
  122421. // "type": "boolean"
  122422. // }
  122423. // },
  122424. // "path": "{project}/global/securityPolicies",
  122425. // "request": {
  122426. // "$ref": "SecurityPolicy"
  122427. // },
  122428. // "response": {
  122429. // "$ref": "Operation"
  122430. // },
  122431. // "scopes": [
  122432. // "https://www.googleapis.com/auth/cloud-platform",
  122433. // "https://www.googleapis.com/auth/compute"
  122434. // ]
  122435. // }
  122436. }
  122437. // method id "compute.securityPolicies.list":
  122438. type SecurityPoliciesListCall struct {
  122439. s *Service
  122440. project string
  122441. urlParams_ gensupport.URLParams
  122442. ifNoneMatch_ string
  122443. ctx_ context.Context
  122444. header_ http.Header
  122445. }
  122446. // List: List all the policies that have been configured for the
  122447. // specified project.
  122448. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  122449. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122450. c.project = project
  122451. return c
  122452. }
  122453. // Filter sets the optional parameter "filter": A filter expression that
  122454. // filters resources listed in the response. The expression must specify
  122455. // the field name, a comparison operator, and the value that you want to
  122456. // use for filtering. The value must be a string, a number, or a
  122457. // boolean. The comparison operator must be either =, !=, >, or <.
  122458. //
  122459. // For example, if you are filtering Compute Engine instances, you can
  122460. // exclude instances named example-instance by specifying name !=
  122461. // example-instance.
  122462. //
  122463. // You can also filter nested fields. For example, you could specify
  122464. // scheduling.automaticRestart = false to include instances only if they
  122465. // are not scheduled for automatic restarts. You can use filtering on
  122466. // nested fields to filter based on resource labels.
  122467. //
  122468. // To filter on multiple expressions, provide each separate expression
  122469. // within parentheses. For example, (scheduling.automaticRestart = true)
  122470. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  122471. // AND expression. However, you can include AND and OR expressions
  122472. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  122473. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  122474. // true).
  122475. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  122476. c.urlParams_.Set("filter", filter)
  122477. return c
  122478. }
  122479. // MaxResults sets the optional parameter "maxResults": The maximum
  122480. // number of results per page that should be returned. If the number of
  122481. // available results is larger than maxResults, Compute Engine returns a
  122482. // nextPageToken that can be used to get the next page of results in
  122483. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  122484. // (Default: 500)
  122485. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  122486. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  122487. return c
  122488. }
  122489. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  122490. // a certain order. By default, results are returned in alphanumerical
  122491. // order based on the resource name.
  122492. //
  122493. // You can also sort results in descending order based on the creation
  122494. // timestamp using orderBy="creationTimestamp desc". This sorts results
  122495. // based on the creationTimestamp field in reverse chronological order
  122496. // (newest result first). Use this to sort resources like operations so
  122497. // that the newest operation is returned first.
  122498. //
  122499. // Currently, only sorting by name or creationTimestamp desc is
  122500. // supported.
  122501. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  122502. c.urlParams_.Set("orderBy", orderBy)
  122503. return c
  122504. }
  122505. // PageToken sets the optional parameter "pageToken": Specifies a page
  122506. // token to use. Set pageToken to the nextPageToken returned by a
  122507. // previous list request to get the next page of results.
  122508. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  122509. c.urlParams_.Set("pageToken", pageToken)
  122510. return c
  122511. }
  122512. // Fields allows partial responses to be retrieved. See
  122513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122514. // for more information.
  122515. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  122516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122517. return c
  122518. }
  122519. // IfNoneMatch sets the optional parameter which makes the operation
  122520. // fail if the object's ETag matches the given value. This is useful for
  122521. // getting updates only after the object has changed since the last
  122522. // request. Use googleapi.IsNotModified to check whether the response
  122523. // error from Do is the result of In-None-Match.
  122524. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  122525. c.ifNoneMatch_ = entityTag
  122526. return c
  122527. }
  122528. // Context sets the context to be used in this call's Do method. Any
  122529. // pending HTTP request will be aborted if the provided context is
  122530. // canceled.
  122531. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  122532. c.ctx_ = ctx
  122533. return c
  122534. }
  122535. // Header returns an http.Header that can be modified by the caller to
  122536. // add HTTP headers to the request.
  122537. func (c *SecurityPoliciesListCall) Header() http.Header {
  122538. if c.header_ == nil {
  122539. c.header_ = make(http.Header)
  122540. }
  122541. return c.header_
  122542. }
  122543. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  122544. reqHeaders := make(http.Header)
  122545. for k, v := range c.header_ {
  122546. reqHeaders[k] = v
  122547. }
  122548. reqHeaders.Set("User-Agent", c.s.userAgent())
  122549. if c.ifNoneMatch_ != "" {
  122550. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122551. }
  122552. var body io.Reader = nil
  122553. c.urlParams_.Set("alt", alt)
  122554. c.urlParams_.Set("prettyPrint", "false")
  122555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  122556. urls += "?" + c.urlParams_.Encode()
  122557. req, err := http.NewRequest("GET", urls, body)
  122558. if err != nil {
  122559. return nil, err
  122560. }
  122561. req.Header = reqHeaders
  122562. googleapi.Expand(req.URL, map[string]string{
  122563. "project": c.project,
  122564. })
  122565. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122566. }
  122567. // Do executes the "compute.securityPolicies.list" call.
  122568. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  122569. // non-2xx status code is an error. Response headers are in either
  122570. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  122571. // returned at all) in error.(*googleapi.Error).Header. Use
  122572. // googleapi.IsNotModified to check whether the returned error was
  122573. // because http.StatusNotModified was returned.
  122574. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  122575. gensupport.SetOptions(c.urlParams_, opts...)
  122576. res, err := c.doRequest("json")
  122577. if res != nil && res.StatusCode == http.StatusNotModified {
  122578. if res.Body != nil {
  122579. res.Body.Close()
  122580. }
  122581. return nil, &googleapi.Error{
  122582. Code: res.StatusCode,
  122583. Header: res.Header,
  122584. }
  122585. }
  122586. if err != nil {
  122587. return nil, err
  122588. }
  122589. defer googleapi.CloseBody(res)
  122590. if err := googleapi.CheckResponse(res); err != nil {
  122591. return nil, err
  122592. }
  122593. ret := &SecurityPolicyList{
  122594. ServerResponse: googleapi.ServerResponse{
  122595. Header: res.Header,
  122596. HTTPStatusCode: res.StatusCode,
  122597. },
  122598. }
  122599. target := &ret
  122600. if err := gensupport.DecodeResponse(target, res); err != nil {
  122601. return nil, err
  122602. }
  122603. return ret, nil
  122604. // {
  122605. // "description": "List all the policies that have been configured for the specified project.",
  122606. // "httpMethod": "GET",
  122607. // "id": "compute.securityPolicies.list",
  122608. // "parameterOrder": [
  122609. // "project"
  122610. // ],
  122611. // "parameters": {
  122612. // "filter": {
  122613. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  122614. // "location": "query",
  122615. // "type": "string"
  122616. // },
  122617. // "maxResults": {
  122618. // "default": "500",
  122619. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  122620. // "format": "uint32",
  122621. // "location": "query",
  122622. // "minimum": "0",
  122623. // "type": "integer"
  122624. // },
  122625. // "orderBy": {
  122626. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  122627. // "location": "query",
  122628. // "type": "string"
  122629. // },
  122630. // "pageToken": {
  122631. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  122632. // "location": "query",
  122633. // "type": "string"
  122634. // },
  122635. // "project": {
  122636. // "description": "Project ID for this request.",
  122637. // "location": "path",
  122638. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122639. // "required": true,
  122640. // "type": "string"
  122641. // }
  122642. // },
  122643. // "path": "{project}/global/securityPolicies",
  122644. // "response": {
  122645. // "$ref": "SecurityPolicyList"
  122646. // },
  122647. // "scopes": [
  122648. // "https://www.googleapis.com/auth/cloud-platform",
  122649. // "https://www.googleapis.com/auth/compute",
  122650. // "https://www.googleapis.com/auth/compute.readonly"
  122651. // ]
  122652. // }
  122653. }
  122654. // Pages invokes f for each page of results.
  122655. // A non-nil error returned from f will halt the iteration.
  122656. // The provided context supersedes any context provided to the Context method.
  122657. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  122658. c.ctx_ = ctx
  122659. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  122660. for {
  122661. x, err := c.Do()
  122662. if err != nil {
  122663. return err
  122664. }
  122665. if err := f(x); err != nil {
  122666. return err
  122667. }
  122668. if x.NextPageToken == "" {
  122669. return nil
  122670. }
  122671. c.PageToken(x.NextPageToken)
  122672. }
  122673. }
  122674. // method id "compute.securityPolicies.listPreconfiguredExpressionSets":
  122675. type SecurityPoliciesListPreconfiguredExpressionSetsCall struct {
  122676. s *Service
  122677. project string
  122678. urlParams_ gensupport.URLParams
  122679. ifNoneMatch_ string
  122680. ctx_ context.Context
  122681. header_ http.Header
  122682. }
  122683. // ListPreconfiguredExpressionSets: Gets the current list of
  122684. // preconfigured Web Application Firewall (WAF) expressions.
  122685. func (r *SecurityPoliciesService) ListPreconfiguredExpressionSets(project string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  122686. c := &SecurityPoliciesListPreconfiguredExpressionSetsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122687. c.project = project
  122688. return c
  122689. }
  122690. // Filter sets the optional parameter "filter": A filter expression that
  122691. // filters resources listed in the response. The expression must specify
  122692. // the field name, a comparison operator, and the value that you want to
  122693. // use for filtering. The value must be a string, a number, or a
  122694. // boolean. The comparison operator must be either =, !=, >, or <.
  122695. //
  122696. // For example, if you are filtering Compute Engine instances, you can
  122697. // exclude instances named example-instance by specifying name !=
  122698. // example-instance.
  122699. //
  122700. // You can also filter nested fields. For example, you could specify
  122701. // scheduling.automaticRestart = false to include instances only if they
  122702. // are not scheduled for automatic restarts. You can use filtering on
  122703. // nested fields to filter based on resource labels.
  122704. //
  122705. // To filter on multiple expressions, provide each separate expression
  122706. // within parentheses. For example, (scheduling.automaticRestart = true)
  122707. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  122708. // AND expression. However, you can include AND and OR expressions
  122709. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  122710. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  122711. // true).
  122712. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Filter(filter string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  122713. c.urlParams_.Set("filter", filter)
  122714. return c
  122715. }
  122716. // MaxResults sets the optional parameter "maxResults": The maximum
  122717. // number of results per page that should be returned. If the number of
  122718. // available results is larger than maxResults, Compute Engine returns a
  122719. // nextPageToken that can be used to get the next page of results in
  122720. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  122721. // (Default: 500)
  122722. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) MaxResults(maxResults int64) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  122723. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  122724. return c
  122725. }
  122726. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  122727. // a certain order. By default, results are returned in alphanumerical
  122728. // order based on the resource name.
  122729. //
  122730. // You can also sort results in descending order based on the creation
  122731. // timestamp using orderBy="creationTimestamp desc". This sorts results
  122732. // based on the creationTimestamp field in reverse chronological order
  122733. // (newest result first). Use this to sort resources like operations so
  122734. // that the newest operation is returned first.
  122735. //
  122736. // Currently, only sorting by name or creationTimestamp desc is
  122737. // supported.
  122738. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) OrderBy(orderBy string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  122739. c.urlParams_.Set("orderBy", orderBy)
  122740. return c
  122741. }
  122742. // PageToken sets the optional parameter "pageToken": Specifies a page
  122743. // token to use. Set pageToken to the nextPageToken returned by a
  122744. // previous list request to get the next page of results.
  122745. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) PageToken(pageToken string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  122746. c.urlParams_.Set("pageToken", pageToken)
  122747. return c
  122748. }
  122749. // Fields allows partial responses to be retrieved. See
  122750. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122751. // for more information.
  122752. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Fields(s ...googleapi.Field) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  122753. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122754. return c
  122755. }
  122756. // IfNoneMatch sets the optional parameter which makes the operation
  122757. // fail if the object's ETag matches the given value. This is useful for
  122758. // getting updates only after the object has changed since the last
  122759. // request. Use googleapi.IsNotModified to check whether the response
  122760. // error from Do is the result of In-None-Match.
  122761. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) IfNoneMatch(entityTag string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  122762. c.ifNoneMatch_ = entityTag
  122763. return c
  122764. }
  122765. // Context sets the context to be used in this call's Do method. Any
  122766. // pending HTTP request will be aborted if the provided context is
  122767. // canceled.
  122768. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Context(ctx context.Context) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  122769. c.ctx_ = ctx
  122770. return c
  122771. }
  122772. // Header returns an http.Header that can be modified by the caller to
  122773. // add HTTP headers to the request.
  122774. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Header() http.Header {
  122775. if c.header_ == nil {
  122776. c.header_ = make(http.Header)
  122777. }
  122778. return c.header_
  122779. }
  122780. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt string) (*http.Response, error) {
  122781. reqHeaders := make(http.Header)
  122782. for k, v := range c.header_ {
  122783. reqHeaders[k] = v
  122784. }
  122785. reqHeaders.Set("User-Agent", c.s.userAgent())
  122786. if c.ifNoneMatch_ != "" {
  122787. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  122788. }
  122789. var body io.Reader = nil
  122790. c.urlParams_.Set("alt", alt)
  122791. c.urlParams_.Set("prettyPrint", "false")
  122792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/listPreconfiguredExpressionSets")
  122793. urls += "?" + c.urlParams_.Encode()
  122794. req, err := http.NewRequest("GET", urls, body)
  122795. if err != nil {
  122796. return nil, err
  122797. }
  122798. req.Header = reqHeaders
  122799. googleapi.Expand(req.URL, map[string]string{
  122800. "project": c.project,
  122801. })
  122802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122803. }
  122804. // Do executes the "compute.securityPolicies.listPreconfiguredExpressionSets" call.
  122805. // Exactly one of
  122806. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse or error
  122807. // will be non-nil. Any non-2xx status code is an error. Response
  122808. // headers are in either
  122809. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse.ServerRespons
  122810. // e.Header or (if a response was returned at all) in
  122811. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  122812. // whether the returned error was because http.StatusNotModified was
  122813. // returned.
  122814. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) {
  122815. gensupport.SetOptions(c.urlParams_, opts...)
  122816. res, err := c.doRequest("json")
  122817. if res != nil && res.StatusCode == http.StatusNotModified {
  122818. if res.Body != nil {
  122819. res.Body.Close()
  122820. }
  122821. return nil, &googleapi.Error{
  122822. Code: res.StatusCode,
  122823. Header: res.Header,
  122824. }
  122825. }
  122826. if err != nil {
  122827. return nil, err
  122828. }
  122829. defer googleapi.CloseBody(res)
  122830. if err := googleapi.CheckResponse(res); err != nil {
  122831. return nil, err
  122832. }
  122833. ret := &SecurityPoliciesListPreconfiguredExpressionSetsResponse{
  122834. ServerResponse: googleapi.ServerResponse{
  122835. Header: res.Header,
  122836. HTTPStatusCode: res.StatusCode,
  122837. },
  122838. }
  122839. target := &ret
  122840. if err := gensupport.DecodeResponse(target, res); err != nil {
  122841. return nil, err
  122842. }
  122843. return ret, nil
  122844. // {
  122845. // "description": "Gets the current list of preconfigured Web Application Firewall (WAF) expressions.",
  122846. // "httpMethod": "GET",
  122847. // "id": "compute.securityPolicies.listPreconfiguredExpressionSets",
  122848. // "parameterOrder": [
  122849. // "project"
  122850. // ],
  122851. // "parameters": {
  122852. // "filter": {
  122853. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  122854. // "location": "query",
  122855. // "type": "string"
  122856. // },
  122857. // "maxResults": {
  122858. // "default": "500",
  122859. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  122860. // "format": "uint32",
  122861. // "location": "query",
  122862. // "minimum": "0",
  122863. // "type": "integer"
  122864. // },
  122865. // "orderBy": {
  122866. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  122867. // "location": "query",
  122868. // "type": "string"
  122869. // },
  122870. // "pageToken": {
  122871. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  122872. // "location": "query",
  122873. // "type": "string"
  122874. // },
  122875. // "project": {
  122876. // "description": "Project ID for this request.",
  122877. // "location": "path",
  122878. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  122879. // "required": true,
  122880. // "type": "string"
  122881. // }
  122882. // },
  122883. // "path": "{project}/global/securityPolicies/listPreconfiguredExpressionSets",
  122884. // "response": {
  122885. // "$ref": "SecurityPoliciesListPreconfiguredExpressionSetsResponse"
  122886. // },
  122887. // "scopes": [
  122888. // "https://www.googleapis.com/auth/cloud-platform",
  122889. // "https://www.googleapis.com/auth/compute"
  122890. // ]
  122891. // }
  122892. }
  122893. // method id "compute.securityPolicies.patch":
  122894. type SecurityPoliciesPatchCall struct {
  122895. s *Service
  122896. project string
  122897. securityPolicy string
  122898. securitypolicy *SecurityPolicy
  122899. urlParams_ gensupport.URLParams
  122900. ctx_ context.Context
  122901. header_ http.Header
  122902. }
  122903. // Patch: Patches the specified policy with the data included in the
  122904. // request.
  122905. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  122906. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  122907. c.project = project
  122908. c.securityPolicy = securityPolicy
  122909. c.securitypolicy = securitypolicy
  122910. return c
  122911. }
  122912. // RequestId sets the optional parameter "requestId": An optional
  122913. // request ID to identify requests. Specify a unique request ID so that
  122914. // if you must retry your request, the server will know to ignore the
  122915. // request if it has already been completed.
  122916. //
  122917. // For example, consider a situation where you make an initial request
  122918. // and the request times out. If you make the request again with the
  122919. // same request ID, the server can check if original operation with the
  122920. // same request ID was received, and if so, will ignore the second
  122921. // request. This prevents clients from accidentally creating duplicate
  122922. // commitments.
  122923. //
  122924. // The request ID must be a valid UUID with the exception that zero UUID
  122925. // is not supported (00000000-0000-0000-0000-000000000000).
  122926. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  122927. c.urlParams_.Set("requestId", requestId)
  122928. return c
  122929. }
  122930. // Fields allows partial responses to be retrieved. See
  122931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  122932. // for more information.
  122933. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  122934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  122935. return c
  122936. }
  122937. // Context sets the context to be used in this call's Do method. Any
  122938. // pending HTTP request will be aborted if the provided context is
  122939. // canceled.
  122940. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  122941. c.ctx_ = ctx
  122942. return c
  122943. }
  122944. // Header returns an http.Header that can be modified by the caller to
  122945. // add HTTP headers to the request.
  122946. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  122947. if c.header_ == nil {
  122948. c.header_ = make(http.Header)
  122949. }
  122950. return c.header_
  122951. }
  122952. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  122953. reqHeaders := make(http.Header)
  122954. for k, v := range c.header_ {
  122955. reqHeaders[k] = v
  122956. }
  122957. reqHeaders.Set("User-Agent", c.s.userAgent())
  122958. var body io.Reader = nil
  122959. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  122960. if err != nil {
  122961. return nil, err
  122962. }
  122963. reqHeaders.Set("Content-Type", "application/json")
  122964. c.urlParams_.Set("alt", alt)
  122965. c.urlParams_.Set("prettyPrint", "false")
  122966. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  122967. urls += "?" + c.urlParams_.Encode()
  122968. req, err := http.NewRequest("PATCH", urls, body)
  122969. if err != nil {
  122970. return nil, err
  122971. }
  122972. req.Header = reqHeaders
  122973. googleapi.Expand(req.URL, map[string]string{
  122974. "project": c.project,
  122975. "securityPolicy": c.securityPolicy,
  122976. })
  122977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  122978. }
  122979. // Do executes the "compute.securityPolicies.patch" call.
  122980. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  122981. // status code is an error. Response headers are in either
  122982. // *Operation.ServerResponse.Header or (if a response was returned at
  122983. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  122984. // to check whether the returned error was because
  122985. // http.StatusNotModified was returned.
  122986. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  122987. gensupport.SetOptions(c.urlParams_, opts...)
  122988. res, err := c.doRequest("json")
  122989. if res != nil && res.StatusCode == http.StatusNotModified {
  122990. if res.Body != nil {
  122991. res.Body.Close()
  122992. }
  122993. return nil, &googleapi.Error{
  122994. Code: res.StatusCode,
  122995. Header: res.Header,
  122996. }
  122997. }
  122998. if err != nil {
  122999. return nil, err
  123000. }
  123001. defer googleapi.CloseBody(res)
  123002. if err := googleapi.CheckResponse(res); err != nil {
  123003. return nil, err
  123004. }
  123005. ret := &Operation{
  123006. ServerResponse: googleapi.ServerResponse{
  123007. Header: res.Header,
  123008. HTTPStatusCode: res.StatusCode,
  123009. },
  123010. }
  123011. target := &ret
  123012. if err := gensupport.DecodeResponse(target, res); err != nil {
  123013. return nil, err
  123014. }
  123015. return ret, nil
  123016. // {
  123017. // "description": "Patches the specified policy with the data included in the request.",
  123018. // "httpMethod": "PATCH",
  123019. // "id": "compute.securityPolicies.patch",
  123020. // "parameterOrder": [
  123021. // "project",
  123022. // "securityPolicy"
  123023. // ],
  123024. // "parameters": {
  123025. // "project": {
  123026. // "description": "Project ID for this request.",
  123027. // "location": "path",
  123028. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123029. // "required": true,
  123030. // "type": "string"
  123031. // },
  123032. // "requestId": {
  123033. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123034. // "location": "query",
  123035. // "type": "string"
  123036. // },
  123037. // "securityPolicy": {
  123038. // "description": "Name of the security policy to update.",
  123039. // "location": "path",
  123040. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123041. // "required": true,
  123042. // "type": "string"
  123043. // }
  123044. // },
  123045. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  123046. // "request": {
  123047. // "$ref": "SecurityPolicy"
  123048. // },
  123049. // "response": {
  123050. // "$ref": "Operation"
  123051. // },
  123052. // "scopes": [
  123053. // "https://www.googleapis.com/auth/cloud-platform",
  123054. // "https://www.googleapis.com/auth/compute"
  123055. // ]
  123056. // }
  123057. }
  123058. // method id "compute.securityPolicies.patchRule":
  123059. type SecurityPoliciesPatchRuleCall struct {
  123060. s *Service
  123061. project string
  123062. securityPolicy string
  123063. securitypolicyrule *SecurityPolicyRule
  123064. urlParams_ gensupport.URLParams
  123065. ctx_ context.Context
  123066. header_ http.Header
  123067. }
  123068. // PatchRule: Patches a rule at the specified priority.
  123069. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  123070. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123071. c.project = project
  123072. c.securityPolicy = securityPolicy
  123073. c.securitypolicyrule = securitypolicyrule
  123074. return c
  123075. }
  123076. // Priority sets the optional parameter "priority": The priority of the
  123077. // rule to patch.
  123078. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  123079. c.urlParams_.Set("priority", fmt.Sprint(priority))
  123080. return c
  123081. }
  123082. // ValidateOnly sets the optional parameter "validateOnly": If true, the
  123083. // request will not be committed.
  123084. func (c *SecurityPoliciesPatchRuleCall) ValidateOnly(validateOnly bool) *SecurityPoliciesPatchRuleCall {
  123085. c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  123086. return c
  123087. }
  123088. // Fields allows partial responses to be retrieved. See
  123089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123090. // for more information.
  123091. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  123092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123093. return c
  123094. }
  123095. // Context sets the context to be used in this call's Do method. Any
  123096. // pending HTTP request will be aborted if the provided context is
  123097. // canceled.
  123098. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  123099. c.ctx_ = ctx
  123100. return c
  123101. }
  123102. // Header returns an http.Header that can be modified by the caller to
  123103. // add HTTP headers to the request.
  123104. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  123105. if c.header_ == nil {
  123106. c.header_ = make(http.Header)
  123107. }
  123108. return c.header_
  123109. }
  123110. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  123111. reqHeaders := make(http.Header)
  123112. for k, v := range c.header_ {
  123113. reqHeaders[k] = v
  123114. }
  123115. reqHeaders.Set("User-Agent", c.s.userAgent())
  123116. var body io.Reader = nil
  123117. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  123118. if err != nil {
  123119. return nil, err
  123120. }
  123121. reqHeaders.Set("Content-Type", "application/json")
  123122. c.urlParams_.Set("alt", alt)
  123123. c.urlParams_.Set("prettyPrint", "false")
  123124. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  123125. urls += "?" + c.urlParams_.Encode()
  123126. req, err := http.NewRequest("POST", urls, body)
  123127. if err != nil {
  123128. return nil, err
  123129. }
  123130. req.Header = reqHeaders
  123131. googleapi.Expand(req.URL, map[string]string{
  123132. "project": c.project,
  123133. "securityPolicy": c.securityPolicy,
  123134. })
  123135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123136. }
  123137. // Do executes the "compute.securityPolicies.patchRule" call.
  123138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123139. // status code is an error. Response headers are in either
  123140. // *Operation.ServerResponse.Header or (if a response was returned at
  123141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123142. // to check whether the returned error was because
  123143. // http.StatusNotModified was returned.
  123144. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123145. gensupport.SetOptions(c.urlParams_, opts...)
  123146. res, err := c.doRequest("json")
  123147. if res != nil && res.StatusCode == http.StatusNotModified {
  123148. if res.Body != nil {
  123149. res.Body.Close()
  123150. }
  123151. return nil, &googleapi.Error{
  123152. Code: res.StatusCode,
  123153. Header: res.Header,
  123154. }
  123155. }
  123156. if err != nil {
  123157. return nil, err
  123158. }
  123159. defer googleapi.CloseBody(res)
  123160. if err := googleapi.CheckResponse(res); err != nil {
  123161. return nil, err
  123162. }
  123163. ret := &Operation{
  123164. ServerResponse: googleapi.ServerResponse{
  123165. Header: res.Header,
  123166. HTTPStatusCode: res.StatusCode,
  123167. },
  123168. }
  123169. target := &ret
  123170. if err := gensupport.DecodeResponse(target, res); err != nil {
  123171. return nil, err
  123172. }
  123173. return ret, nil
  123174. // {
  123175. // "description": "Patches a rule at the specified priority.",
  123176. // "httpMethod": "POST",
  123177. // "id": "compute.securityPolicies.patchRule",
  123178. // "parameterOrder": [
  123179. // "project",
  123180. // "securityPolicy"
  123181. // ],
  123182. // "parameters": {
  123183. // "priority": {
  123184. // "description": "The priority of the rule to patch.",
  123185. // "format": "int32",
  123186. // "location": "query",
  123187. // "type": "integer"
  123188. // },
  123189. // "project": {
  123190. // "description": "Project ID for this request.",
  123191. // "location": "path",
  123192. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123193. // "required": true,
  123194. // "type": "string"
  123195. // },
  123196. // "securityPolicy": {
  123197. // "description": "Name of the security policy to update.",
  123198. // "location": "path",
  123199. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123200. // "required": true,
  123201. // "type": "string"
  123202. // },
  123203. // "validateOnly": {
  123204. // "description": "If true, the request will not be committed.",
  123205. // "location": "query",
  123206. // "type": "boolean"
  123207. // }
  123208. // },
  123209. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  123210. // "request": {
  123211. // "$ref": "SecurityPolicyRule"
  123212. // },
  123213. // "response": {
  123214. // "$ref": "Operation"
  123215. // },
  123216. // "scopes": [
  123217. // "https://www.googleapis.com/auth/cloud-platform",
  123218. // "https://www.googleapis.com/auth/compute"
  123219. // ]
  123220. // }
  123221. }
  123222. // method id "compute.securityPolicies.removeRule":
  123223. type SecurityPoliciesRemoveRuleCall struct {
  123224. s *Service
  123225. project string
  123226. securityPolicy string
  123227. urlParams_ gensupport.URLParams
  123228. ctx_ context.Context
  123229. header_ http.Header
  123230. }
  123231. // RemoveRule: Deletes a rule at the specified priority.
  123232. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  123233. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123234. c.project = project
  123235. c.securityPolicy = securityPolicy
  123236. return c
  123237. }
  123238. // Priority sets the optional parameter "priority": The priority of the
  123239. // rule to remove from the security policy.
  123240. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  123241. c.urlParams_.Set("priority", fmt.Sprint(priority))
  123242. return c
  123243. }
  123244. // Fields allows partial responses to be retrieved. See
  123245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123246. // for more information.
  123247. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  123248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123249. return c
  123250. }
  123251. // Context sets the context to be used in this call's Do method. Any
  123252. // pending HTTP request will be aborted if the provided context is
  123253. // canceled.
  123254. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  123255. c.ctx_ = ctx
  123256. return c
  123257. }
  123258. // Header returns an http.Header that can be modified by the caller to
  123259. // add HTTP headers to the request.
  123260. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  123261. if c.header_ == nil {
  123262. c.header_ = make(http.Header)
  123263. }
  123264. return c.header_
  123265. }
  123266. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  123267. reqHeaders := make(http.Header)
  123268. for k, v := range c.header_ {
  123269. reqHeaders[k] = v
  123270. }
  123271. reqHeaders.Set("User-Agent", c.s.userAgent())
  123272. var body io.Reader = nil
  123273. c.urlParams_.Set("alt", alt)
  123274. c.urlParams_.Set("prettyPrint", "false")
  123275. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  123276. urls += "?" + c.urlParams_.Encode()
  123277. req, err := http.NewRequest("POST", urls, body)
  123278. if err != nil {
  123279. return nil, err
  123280. }
  123281. req.Header = reqHeaders
  123282. googleapi.Expand(req.URL, map[string]string{
  123283. "project": c.project,
  123284. "securityPolicy": c.securityPolicy,
  123285. })
  123286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123287. }
  123288. // Do executes the "compute.securityPolicies.removeRule" call.
  123289. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123290. // status code is an error. Response headers are in either
  123291. // *Operation.ServerResponse.Header or (if a response was returned at
  123292. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123293. // to check whether the returned error was because
  123294. // http.StatusNotModified was returned.
  123295. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123296. gensupport.SetOptions(c.urlParams_, opts...)
  123297. res, err := c.doRequest("json")
  123298. if res != nil && res.StatusCode == http.StatusNotModified {
  123299. if res.Body != nil {
  123300. res.Body.Close()
  123301. }
  123302. return nil, &googleapi.Error{
  123303. Code: res.StatusCode,
  123304. Header: res.Header,
  123305. }
  123306. }
  123307. if err != nil {
  123308. return nil, err
  123309. }
  123310. defer googleapi.CloseBody(res)
  123311. if err := googleapi.CheckResponse(res); err != nil {
  123312. return nil, err
  123313. }
  123314. ret := &Operation{
  123315. ServerResponse: googleapi.ServerResponse{
  123316. Header: res.Header,
  123317. HTTPStatusCode: res.StatusCode,
  123318. },
  123319. }
  123320. target := &ret
  123321. if err := gensupport.DecodeResponse(target, res); err != nil {
  123322. return nil, err
  123323. }
  123324. return ret, nil
  123325. // {
  123326. // "description": "Deletes a rule at the specified priority.",
  123327. // "httpMethod": "POST",
  123328. // "id": "compute.securityPolicies.removeRule",
  123329. // "parameterOrder": [
  123330. // "project",
  123331. // "securityPolicy"
  123332. // ],
  123333. // "parameters": {
  123334. // "priority": {
  123335. // "description": "The priority of the rule to remove from the security policy.",
  123336. // "format": "int32",
  123337. // "location": "query",
  123338. // "type": "integer"
  123339. // },
  123340. // "project": {
  123341. // "description": "Project ID for this request.",
  123342. // "location": "path",
  123343. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123344. // "required": true,
  123345. // "type": "string"
  123346. // },
  123347. // "securityPolicy": {
  123348. // "description": "Name of the security policy to update.",
  123349. // "location": "path",
  123350. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123351. // "required": true,
  123352. // "type": "string"
  123353. // }
  123354. // },
  123355. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  123356. // "response": {
  123357. // "$ref": "Operation"
  123358. // },
  123359. // "scopes": [
  123360. // "https://www.googleapis.com/auth/cloud-platform",
  123361. // "https://www.googleapis.com/auth/compute"
  123362. // ]
  123363. // }
  123364. }
  123365. // method id "compute.securityPolicies.setLabels":
  123366. type SecurityPoliciesSetLabelsCall struct {
  123367. s *Service
  123368. project string
  123369. resource string
  123370. globalsetlabelsrequest *GlobalSetLabelsRequest
  123371. urlParams_ gensupport.URLParams
  123372. ctx_ context.Context
  123373. header_ http.Header
  123374. }
  123375. // SetLabels: Sets the labels on a security policy. To learn more about
  123376. // labels, read the Labeling Resources documentation.
  123377. func (r *SecurityPoliciesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SecurityPoliciesSetLabelsCall {
  123378. c := &SecurityPoliciesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123379. c.project = project
  123380. c.resource = resource
  123381. c.globalsetlabelsrequest = globalsetlabelsrequest
  123382. return c
  123383. }
  123384. // Fields allows partial responses to be retrieved. See
  123385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123386. // for more information.
  123387. func (c *SecurityPoliciesSetLabelsCall) Fields(s ...googleapi.Field) *SecurityPoliciesSetLabelsCall {
  123388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123389. return c
  123390. }
  123391. // Context sets the context to be used in this call's Do method. Any
  123392. // pending HTTP request will be aborted if the provided context is
  123393. // canceled.
  123394. func (c *SecurityPoliciesSetLabelsCall) Context(ctx context.Context) *SecurityPoliciesSetLabelsCall {
  123395. c.ctx_ = ctx
  123396. return c
  123397. }
  123398. // Header returns an http.Header that can be modified by the caller to
  123399. // add HTTP headers to the request.
  123400. func (c *SecurityPoliciesSetLabelsCall) Header() http.Header {
  123401. if c.header_ == nil {
  123402. c.header_ = make(http.Header)
  123403. }
  123404. return c.header_
  123405. }
  123406. func (c *SecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  123407. reqHeaders := make(http.Header)
  123408. for k, v := range c.header_ {
  123409. reqHeaders[k] = v
  123410. }
  123411. reqHeaders.Set("User-Agent", c.s.userAgent())
  123412. var body io.Reader = nil
  123413. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  123414. if err != nil {
  123415. return nil, err
  123416. }
  123417. reqHeaders.Set("Content-Type", "application/json")
  123418. c.urlParams_.Set("alt", alt)
  123419. c.urlParams_.Set("prettyPrint", "false")
  123420. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/setLabels")
  123421. urls += "?" + c.urlParams_.Encode()
  123422. req, err := http.NewRequest("POST", urls, body)
  123423. if err != nil {
  123424. return nil, err
  123425. }
  123426. req.Header = reqHeaders
  123427. googleapi.Expand(req.URL, map[string]string{
  123428. "project": c.project,
  123429. "resource": c.resource,
  123430. })
  123431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123432. }
  123433. // Do executes the "compute.securityPolicies.setLabels" call.
  123434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123435. // status code is an error. Response headers are in either
  123436. // *Operation.ServerResponse.Header or (if a response was returned at
  123437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123438. // to check whether the returned error was because
  123439. // http.StatusNotModified was returned.
  123440. func (c *SecurityPoliciesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123441. gensupport.SetOptions(c.urlParams_, opts...)
  123442. res, err := c.doRequest("json")
  123443. if res != nil && res.StatusCode == http.StatusNotModified {
  123444. if res.Body != nil {
  123445. res.Body.Close()
  123446. }
  123447. return nil, &googleapi.Error{
  123448. Code: res.StatusCode,
  123449. Header: res.Header,
  123450. }
  123451. }
  123452. if err != nil {
  123453. return nil, err
  123454. }
  123455. defer googleapi.CloseBody(res)
  123456. if err := googleapi.CheckResponse(res); err != nil {
  123457. return nil, err
  123458. }
  123459. ret := &Operation{
  123460. ServerResponse: googleapi.ServerResponse{
  123461. Header: res.Header,
  123462. HTTPStatusCode: res.StatusCode,
  123463. },
  123464. }
  123465. target := &ret
  123466. if err := gensupport.DecodeResponse(target, res); err != nil {
  123467. return nil, err
  123468. }
  123469. return ret, nil
  123470. // {
  123471. // "description": "Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.",
  123472. // "httpMethod": "POST",
  123473. // "id": "compute.securityPolicies.setLabels",
  123474. // "parameterOrder": [
  123475. // "project",
  123476. // "resource"
  123477. // ],
  123478. // "parameters": {
  123479. // "project": {
  123480. // "description": "Project ID for this request.",
  123481. // "location": "path",
  123482. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123483. // "required": true,
  123484. // "type": "string"
  123485. // },
  123486. // "resource": {
  123487. // "description": "Name or id of the resource for this request.",
  123488. // "location": "path",
  123489. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123490. // "required": true,
  123491. // "type": "string"
  123492. // }
  123493. // },
  123494. // "path": "{project}/global/securityPolicies/{resource}/setLabels",
  123495. // "request": {
  123496. // "$ref": "GlobalSetLabelsRequest"
  123497. // },
  123498. // "response": {
  123499. // "$ref": "Operation"
  123500. // },
  123501. // "scopes": [
  123502. // "https://www.googleapis.com/auth/cloud-platform",
  123503. // "https://www.googleapis.com/auth/compute"
  123504. // ]
  123505. // }
  123506. }
  123507. // method id "compute.securityPolicies.testIamPermissions":
  123508. type SecurityPoliciesTestIamPermissionsCall struct {
  123509. s *Service
  123510. project string
  123511. resource string
  123512. testpermissionsrequest *TestPermissionsRequest
  123513. urlParams_ gensupport.URLParams
  123514. ctx_ context.Context
  123515. header_ http.Header
  123516. }
  123517. // TestIamPermissions: Returns permissions that a caller has on the
  123518. // specified resource.
  123519. func (r *SecurityPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SecurityPoliciesTestIamPermissionsCall {
  123520. c := &SecurityPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123521. c.project = project
  123522. c.resource = resource
  123523. c.testpermissionsrequest = testpermissionsrequest
  123524. return c
  123525. }
  123526. // Fields allows partial responses to be retrieved. See
  123527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123528. // for more information.
  123529. func (c *SecurityPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SecurityPoliciesTestIamPermissionsCall {
  123530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123531. return c
  123532. }
  123533. // Context sets the context to be used in this call's Do method. Any
  123534. // pending HTTP request will be aborted if the provided context is
  123535. // canceled.
  123536. func (c *SecurityPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SecurityPoliciesTestIamPermissionsCall {
  123537. c.ctx_ = ctx
  123538. return c
  123539. }
  123540. // Header returns an http.Header that can be modified by the caller to
  123541. // add HTTP headers to the request.
  123542. func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header {
  123543. if c.header_ == nil {
  123544. c.header_ = make(http.Header)
  123545. }
  123546. return c.header_
  123547. }
  123548. func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  123549. reqHeaders := make(http.Header)
  123550. for k, v := range c.header_ {
  123551. reqHeaders[k] = v
  123552. }
  123553. reqHeaders.Set("User-Agent", c.s.userAgent())
  123554. var body io.Reader = nil
  123555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  123556. if err != nil {
  123557. return nil, err
  123558. }
  123559. reqHeaders.Set("Content-Type", "application/json")
  123560. c.urlParams_.Set("alt", alt)
  123561. c.urlParams_.Set("prettyPrint", "false")
  123562. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/testIamPermissions")
  123563. urls += "?" + c.urlParams_.Encode()
  123564. req, err := http.NewRequest("POST", urls, body)
  123565. if err != nil {
  123566. return nil, err
  123567. }
  123568. req.Header = reqHeaders
  123569. googleapi.Expand(req.URL, map[string]string{
  123570. "project": c.project,
  123571. "resource": c.resource,
  123572. })
  123573. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123574. }
  123575. // Do executes the "compute.securityPolicies.testIamPermissions" call.
  123576. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  123577. // non-2xx status code is an error. Response headers are in either
  123578. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  123579. // returned at all) in error.(*googleapi.Error).Header. Use
  123580. // googleapi.IsNotModified to check whether the returned error was
  123581. // because http.StatusNotModified was returned.
  123582. func (c *SecurityPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  123583. gensupport.SetOptions(c.urlParams_, opts...)
  123584. res, err := c.doRequest("json")
  123585. if res != nil && res.StatusCode == http.StatusNotModified {
  123586. if res.Body != nil {
  123587. res.Body.Close()
  123588. }
  123589. return nil, &googleapi.Error{
  123590. Code: res.StatusCode,
  123591. Header: res.Header,
  123592. }
  123593. }
  123594. if err != nil {
  123595. return nil, err
  123596. }
  123597. defer googleapi.CloseBody(res)
  123598. if err := googleapi.CheckResponse(res); err != nil {
  123599. return nil, err
  123600. }
  123601. ret := &TestPermissionsResponse{
  123602. ServerResponse: googleapi.ServerResponse{
  123603. Header: res.Header,
  123604. HTTPStatusCode: res.StatusCode,
  123605. },
  123606. }
  123607. target := &ret
  123608. if err := gensupport.DecodeResponse(target, res); err != nil {
  123609. return nil, err
  123610. }
  123611. return ret, nil
  123612. // {
  123613. // "description": "Returns permissions that a caller has on the specified resource.",
  123614. // "httpMethod": "POST",
  123615. // "id": "compute.securityPolicies.testIamPermissions",
  123616. // "parameterOrder": [
  123617. // "project",
  123618. // "resource"
  123619. // ],
  123620. // "parameters": {
  123621. // "project": {
  123622. // "description": "Project ID for this request.",
  123623. // "location": "path",
  123624. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123625. // "required": true,
  123626. // "type": "string"
  123627. // },
  123628. // "resource": {
  123629. // "description": "Name or id of the resource for this request.",
  123630. // "location": "path",
  123631. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123632. // "required": true,
  123633. // "type": "string"
  123634. // }
  123635. // },
  123636. // "path": "{project}/global/securityPolicies/{resource}/testIamPermissions",
  123637. // "request": {
  123638. // "$ref": "TestPermissionsRequest"
  123639. // },
  123640. // "response": {
  123641. // "$ref": "TestPermissionsResponse"
  123642. // },
  123643. // "scopes": [
  123644. // "https://www.googleapis.com/auth/cloud-platform",
  123645. // "https://www.googleapis.com/auth/compute",
  123646. // "https://www.googleapis.com/auth/compute.readonly"
  123647. // ]
  123648. // }
  123649. }
  123650. // method id "compute.snapshots.delete":
  123651. type SnapshotsDeleteCall struct {
  123652. s *Service
  123653. project string
  123654. snapshot string
  123655. urlParams_ gensupport.URLParams
  123656. ctx_ context.Context
  123657. header_ http.Header
  123658. }
  123659. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  123660. // deleting a single snapshot might not necessarily delete all the data
  123661. // on that snapshot. If any data on the snapshot that is marked for
  123662. // deletion is needed for subsequent snapshots, the data will be moved
  123663. // to the next corresponding snapshot.
  123664. //
  123665. // For more information, see Deleting snapshots.
  123666. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  123667. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  123668. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123669. c.project = project
  123670. c.snapshot = snapshot
  123671. return c
  123672. }
  123673. // RequestId sets the optional parameter "requestId": An optional
  123674. // request ID to identify requests. Specify a unique request ID so that
  123675. // if you must retry your request, the server will know to ignore the
  123676. // request if it has already been completed.
  123677. //
  123678. // For example, consider a situation where you make an initial request
  123679. // and the request times out. If you make the request again with the
  123680. // same request ID, the server can check if original operation with the
  123681. // same request ID was received, and if so, will ignore the second
  123682. // request. This prevents clients from accidentally creating duplicate
  123683. // commitments.
  123684. //
  123685. // The request ID must be a valid UUID with the exception that zero UUID
  123686. // is not supported (00000000-0000-0000-0000-000000000000).
  123687. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  123688. c.urlParams_.Set("requestId", requestId)
  123689. return c
  123690. }
  123691. // Fields allows partial responses to be retrieved. See
  123692. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123693. // for more information.
  123694. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  123695. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123696. return c
  123697. }
  123698. // Context sets the context to be used in this call's Do method. Any
  123699. // pending HTTP request will be aborted if the provided context is
  123700. // canceled.
  123701. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  123702. c.ctx_ = ctx
  123703. return c
  123704. }
  123705. // Header returns an http.Header that can be modified by the caller to
  123706. // add HTTP headers to the request.
  123707. func (c *SnapshotsDeleteCall) Header() http.Header {
  123708. if c.header_ == nil {
  123709. c.header_ = make(http.Header)
  123710. }
  123711. return c.header_
  123712. }
  123713. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  123714. reqHeaders := make(http.Header)
  123715. for k, v := range c.header_ {
  123716. reqHeaders[k] = v
  123717. }
  123718. reqHeaders.Set("User-Agent", c.s.userAgent())
  123719. var body io.Reader = nil
  123720. c.urlParams_.Set("alt", alt)
  123721. c.urlParams_.Set("prettyPrint", "false")
  123722. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  123723. urls += "?" + c.urlParams_.Encode()
  123724. req, err := http.NewRequest("DELETE", urls, body)
  123725. if err != nil {
  123726. return nil, err
  123727. }
  123728. req.Header = reqHeaders
  123729. googleapi.Expand(req.URL, map[string]string{
  123730. "project": c.project,
  123731. "snapshot": c.snapshot,
  123732. })
  123733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123734. }
  123735. // Do executes the "compute.snapshots.delete" call.
  123736. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  123737. // status code is an error. Response headers are in either
  123738. // *Operation.ServerResponse.Header or (if a response was returned at
  123739. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123740. // to check whether the returned error was because
  123741. // http.StatusNotModified was returned.
  123742. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  123743. gensupport.SetOptions(c.urlParams_, opts...)
  123744. res, err := c.doRequest("json")
  123745. if res != nil && res.StatusCode == http.StatusNotModified {
  123746. if res.Body != nil {
  123747. res.Body.Close()
  123748. }
  123749. return nil, &googleapi.Error{
  123750. Code: res.StatusCode,
  123751. Header: res.Header,
  123752. }
  123753. }
  123754. if err != nil {
  123755. return nil, err
  123756. }
  123757. defer googleapi.CloseBody(res)
  123758. if err := googleapi.CheckResponse(res); err != nil {
  123759. return nil, err
  123760. }
  123761. ret := &Operation{
  123762. ServerResponse: googleapi.ServerResponse{
  123763. Header: res.Header,
  123764. HTTPStatusCode: res.StatusCode,
  123765. },
  123766. }
  123767. target := &ret
  123768. if err := gensupport.DecodeResponse(target, res); err != nil {
  123769. return nil, err
  123770. }
  123771. return ret, nil
  123772. // {
  123773. // "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 snapshots.",
  123774. // "httpMethod": "DELETE",
  123775. // "id": "compute.snapshots.delete",
  123776. // "parameterOrder": [
  123777. // "project",
  123778. // "snapshot"
  123779. // ],
  123780. // "parameters": {
  123781. // "project": {
  123782. // "description": "Project ID for this request.",
  123783. // "location": "path",
  123784. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123785. // "required": true,
  123786. // "type": "string"
  123787. // },
  123788. // "requestId": {
  123789. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  123790. // "location": "query",
  123791. // "type": "string"
  123792. // },
  123793. // "snapshot": {
  123794. // "description": "Name of the Snapshot resource to delete.",
  123795. // "location": "path",
  123796. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123797. // "required": true,
  123798. // "type": "string"
  123799. // }
  123800. // },
  123801. // "path": "{project}/global/snapshots/{snapshot}",
  123802. // "response": {
  123803. // "$ref": "Operation"
  123804. // },
  123805. // "scopes": [
  123806. // "https://www.googleapis.com/auth/cloud-platform",
  123807. // "https://www.googleapis.com/auth/compute"
  123808. // ]
  123809. // }
  123810. }
  123811. // method id "compute.snapshots.get":
  123812. type SnapshotsGetCall struct {
  123813. s *Service
  123814. project string
  123815. snapshot string
  123816. urlParams_ gensupport.URLParams
  123817. ifNoneMatch_ string
  123818. ctx_ context.Context
  123819. header_ http.Header
  123820. }
  123821. // Get: Returns the specified Snapshot resource. Gets a list of
  123822. // available snapshots by making a list() request.
  123823. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  123824. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  123825. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123826. c.project = project
  123827. c.snapshot = snapshot
  123828. return c
  123829. }
  123830. // Fields allows partial responses to be retrieved. See
  123831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123832. // for more information.
  123833. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  123834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123835. return c
  123836. }
  123837. // IfNoneMatch sets the optional parameter which makes the operation
  123838. // fail if the object's ETag matches the given value. This is useful for
  123839. // getting updates only after the object has changed since the last
  123840. // request. Use googleapi.IsNotModified to check whether the response
  123841. // error from Do is the result of In-None-Match.
  123842. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  123843. c.ifNoneMatch_ = entityTag
  123844. return c
  123845. }
  123846. // Context sets the context to be used in this call's Do method. Any
  123847. // pending HTTP request will be aborted if the provided context is
  123848. // canceled.
  123849. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  123850. c.ctx_ = ctx
  123851. return c
  123852. }
  123853. // Header returns an http.Header that can be modified by the caller to
  123854. // add HTTP headers to the request.
  123855. func (c *SnapshotsGetCall) Header() http.Header {
  123856. if c.header_ == nil {
  123857. c.header_ = make(http.Header)
  123858. }
  123859. return c.header_
  123860. }
  123861. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  123862. reqHeaders := make(http.Header)
  123863. for k, v := range c.header_ {
  123864. reqHeaders[k] = v
  123865. }
  123866. reqHeaders.Set("User-Agent", c.s.userAgent())
  123867. if c.ifNoneMatch_ != "" {
  123868. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  123869. }
  123870. var body io.Reader = nil
  123871. c.urlParams_.Set("alt", alt)
  123872. c.urlParams_.Set("prettyPrint", "false")
  123873. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  123874. urls += "?" + c.urlParams_.Encode()
  123875. req, err := http.NewRequest("GET", urls, body)
  123876. if err != nil {
  123877. return nil, err
  123878. }
  123879. req.Header = reqHeaders
  123880. googleapi.Expand(req.URL, map[string]string{
  123881. "project": c.project,
  123882. "snapshot": c.snapshot,
  123883. })
  123884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  123885. }
  123886. // Do executes the "compute.snapshots.get" call.
  123887. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  123888. // code is an error. Response headers are in either
  123889. // *Snapshot.ServerResponse.Header or (if a response was returned at
  123890. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  123891. // to check whether the returned error was because
  123892. // http.StatusNotModified was returned.
  123893. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  123894. gensupport.SetOptions(c.urlParams_, opts...)
  123895. res, err := c.doRequest("json")
  123896. if res != nil && res.StatusCode == http.StatusNotModified {
  123897. if res.Body != nil {
  123898. res.Body.Close()
  123899. }
  123900. return nil, &googleapi.Error{
  123901. Code: res.StatusCode,
  123902. Header: res.Header,
  123903. }
  123904. }
  123905. if err != nil {
  123906. return nil, err
  123907. }
  123908. defer googleapi.CloseBody(res)
  123909. if err := googleapi.CheckResponse(res); err != nil {
  123910. return nil, err
  123911. }
  123912. ret := &Snapshot{
  123913. ServerResponse: googleapi.ServerResponse{
  123914. Header: res.Header,
  123915. HTTPStatusCode: res.StatusCode,
  123916. },
  123917. }
  123918. target := &ret
  123919. if err := gensupport.DecodeResponse(target, res); err != nil {
  123920. return nil, err
  123921. }
  123922. return ret, nil
  123923. // {
  123924. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  123925. // "httpMethod": "GET",
  123926. // "id": "compute.snapshots.get",
  123927. // "parameterOrder": [
  123928. // "project",
  123929. // "snapshot"
  123930. // ],
  123931. // "parameters": {
  123932. // "project": {
  123933. // "description": "Project ID for this request.",
  123934. // "location": "path",
  123935. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  123936. // "required": true,
  123937. // "type": "string"
  123938. // },
  123939. // "snapshot": {
  123940. // "description": "Name of the Snapshot resource to return.",
  123941. // "location": "path",
  123942. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  123943. // "required": true,
  123944. // "type": "string"
  123945. // }
  123946. // },
  123947. // "path": "{project}/global/snapshots/{snapshot}",
  123948. // "response": {
  123949. // "$ref": "Snapshot"
  123950. // },
  123951. // "scopes": [
  123952. // "https://www.googleapis.com/auth/cloud-platform",
  123953. // "https://www.googleapis.com/auth/compute",
  123954. // "https://www.googleapis.com/auth/compute.readonly"
  123955. // ]
  123956. // }
  123957. }
  123958. // method id "compute.snapshots.getIamPolicy":
  123959. type SnapshotsGetIamPolicyCall struct {
  123960. s *Service
  123961. project string
  123962. resource string
  123963. urlParams_ gensupport.URLParams
  123964. ifNoneMatch_ string
  123965. ctx_ context.Context
  123966. header_ http.Header
  123967. }
  123968. // GetIamPolicy: Gets the access control policy for a resource. May be
  123969. // empty if no such policy or resource exists.
  123970. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  123971. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  123972. c.project = project
  123973. c.resource = resource
  123974. return c
  123975. }
  123976. // Fields allows partial responses to be retrieved. See
  123977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  123978. // for more information.
  123979. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  123980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  123981. return c
  123982. }
  123983. // IfNoneMatch sets the optional parameter which makes the operation
  123984. // fail if the object's ETag matches the given value. This is useful for
  123985. // getting updates only after the object has changed since the last
  123986. // request. Use googleapi.IsNotModified to check whether the response
  123987. // error from Do is the result of In-None-Match.
  123988. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  123989. c.ifNoneMatch_ = entityTag
  123990. return c
  123991. }
  123992. // Context sets the context to be used in this call's Do method. Any
  123993. // pending HTTP request will be aborted if the provided context is
  123994. // canceled.
  123995. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  123996. c.ctx_ = ctx
  123997. return c
  123998. }
  123999. // Header returns an http.Header that can be modified by the caller to
  124000. // add HTTP headers to the request.
  124001. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  124002. if c.header_ == nil {
  124003. c.header_ = make(http.Header)
  124004. }
  124005. return c.header_
  124006. }
  124007. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  124008. reqHeaders := make(http.Header)
  124009. for k, v := range c.header_ {
  124010. reqHeaders[k] = v
  124011. }
  124012. reqHeaders.Set("User-Agent", c.s.userAgent())
  124013. if c.ifNoneMatch_ != "" {
  124014. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  124015. }
  124016. var body io.Reader = nil
  124017. c.urlParams_.Set("alt", alt)
  124018. c.urlParams_.Set("prettyPrint", "false")
  124019. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  124020. urls += "?" + c.urlParams_.Encode()
  124021. req, err := http.NewRequest("GET", urls, body)
  124022. if err != nil {
  124023. return nil, err
  124024. }
  124025. req.Header = reqHeaders
  124026. googleapi.Expand(req.URL, map[string]string{
  124027. "project": c.project,
  124028. "resource": c.resource,
  124029. })
  124030. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124031. }
  124032. // Do executes the "compute.snapshots.getIamPolicy" call.
  124033. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  124034. // code is an error. Response headers are in either
  124035. // *Policy.ServerResponse.Header or (if a response was returned at all)
  124036. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  124037. // check whether the returned error was because http.StatusNotModified
  124038. // was returned.
  124039. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  124040. gensupport.SetOptions(c.urlParams_, opts...)
  124041. res, err := c.doRequest("json")
  124042. if res != nil && res.StatusCode == http.StatusNotModified {
  124043. if res.Body != nil {
  124044. res.Body.Close()
  124045. }
  124046. return nil, &googleapi.Error{
  124047. Code: res.StatusCode,
  124048. Header: res.Header,
  124049. }
  124050. }
  124051. if err != nil {
  124052. return nil, err
  124053. }
  124054. defer googleapi.CloseBody(res)
  124055. if err := googleapi.CheckResponse(res); err != nil {
  124056. return nil, err
  124057. }
  124058. ret := &Policy{
  124059. ServerResponse: googleapi.ServerResponse{
  124060. Header: res.Header,
  124061. HTTPStatusCode: res.StatusCode,
  124062. },
  124063. }
  124064. target := &ret
  124065. if err := gensupport.DecodeResponse(target, res); err != nil {
  124066. return nil, err
  124067. }
  124068. return ret, nil
  124069. // {
  124070. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  124071. // "httpMethod": "GET",
  124072. // "id": "compute.snapshots.getIamPolicy",
  124073. // "parameterOrder": [
  124074. // "project",
  124075. // "resource"
  124076. // ],
  124077. // "parameters": {
  124078. // "project": {
  124079. // "description": "Project ID for this request.",
  124080. // "location": "path",
  124081. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124082. // "required": true,
  124083. // "type": "string"
  124084. // },
  124085. // "resource": {
  124086. // "description": "Name or id of the resource for this request.",
  124087. // "location": "path",
  124088. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124089. // "required": true,
  124090. // "type": "string"
  124091. // }
  124092. // },
  124093. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  124094. // "response": {
  124095. // "$ref": "Policy"
  124096. // },
  124097. // "scopes": [
  124098. // "https://www.googleapis.com/auth/cloud-platform",
  124099. // "https://www.googleapis.com/auth/compute",
  124100. // "https://www.googleapis.com/auth/compute.readonly"
  124101. // ]
  124102. // }
  124103. }
  124104. // method id "compute.snapshots.list":
  124105. type SnapshotsListCall struct {
  124106. s *Service
  124107. project string
  124108. urlParams_ gensupport.URLParams
  124109. ifNoneMatch_ string
  124110. ctx_ context.Context
  124111. header_ http.Header
  124112. }
  124113. // List: Retrieves the list of Snapshot resources contained within the
  124114. // specified project.
  124115. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  124116. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  124117. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124118. c.project = project
  124119. return c
  124120. }
  124121. // Filter sets the optional parameter "filter": A filter expression that
  124122. // filters resources listed in the response. The expression must specify
  124123. // the field name, a comparison operator, and the value that you want to
  124124. // use for filtering. The value must be a string, a number, or a
  124125. // boolean. The comparison operator must be either =, !=, >, or <.
  124126. //
  124127. // For example, if you are filtering Compute Engine instances, you can
  124128. // exclude instances named example-instance by specifying name !=
  124129. // example-instance.
  124130. //
  124131. // You can also filter nested fields. For example, you could specify
  124132. // scheduling.automaticRestart = false to include instances only if they
  124133. // are not scheduled for automatic restarts. You can use filtering on
  124134. // nested fields to filter based on resource labels.
  124135. //
  124136. // To filter on multiple expressions, provide each separate expression
  124137. // within parentheses. For example, (scheduling.automaticRestart = true)
  124138. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  124139. // AND expression. However, you can include AND and OR expressions
  124140. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  124141. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  124142. // true).
  124143. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  124144. c.urlParams_.Set("filter", filter)
  124145. return c
  124146. }
  124147. // MaxResults sets the optional parameter "maxResults": The maximum
  124148. // number of results per page that should be returned. If the number of
  124149. // available results is larger than maxResults, Compute Engine returns a
  124150. // nextPageToken that can be used to get the next page of results in
  124151. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  124152. // (Default: 500)
  124153. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  124154. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  124155. return c
  124156. }
  124157. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  124158. // a certain order. By default, results are returned in alphanumerical
  124159. // order based on the resource name.
  124160. //
  124161. // You can also sort results in descending order based on the creation
  124162. // timestamp using orderBy="creationTimestamp desc". This sorts results
  124163. // based on the creationTimestamp field in reverse chronological order
  124164. // (newest result first). Use this to sort resources like operations so
  124165. // that the newest operation is returned first.
  124166. //
  124167. // Currently, only sorting by name or creationTimestamp desc is
  124168. // supported.
  124169. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  124170. c.urlParams_.Set("orderBy", orderBy)
  124171. return c
  124172. }
  124173. // PageToken sets the optional parameter "pageToken": Specifies a page
  124174. // token to use. Set pageToken to the nextPageToken returned by a
  124175. // previous list request to get the next page of results.
  124176. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  124177. c.urlParams_.Set("pageToken", pageToken)
  124178. return c
  124179. }
  124180. // Fields allows partial responses to be retrieved. See
  124181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124182. // for more information.
  124183. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  124184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124185. return c
  124186. }
  124187. // IfNoneMatch sets the optional parameter which makes the operation
  124188. // fail if the object's ETag matches the given value. This is useful for
  124189. // getting updates only after the object has changed since the last
  124190. // request. Use googleapi.IsNotModified to check whether the response
  124191. // error from Do is the result of In-None-Match.
  124192. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  124193. c.ifNoneMatch_ = entityTag
  124194. return c
  124195. }
  124196. // Context sets the context to be used in this call's Do method. Any
  124197. // pending HTTP request will be aborted if the provided context is
  124198. // canceled.
  124199. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  124200. c.ctx_ = ctx
  124201. return c
  124202. }
  124203. // Header returns an http.Header that can be modified by the caller to
  124204. // add HTTP headers to the request.
  124205. func (c *SnapshotsListCall) Header() http.Header {
  124206. if c.header_ == nil {
  124207. c.header_ = make(http.Header)
  124208. }
  124209. return c.header_
  124210. }
  124211. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  124212. reqHeaders := make(http.Header)
  124213. for k, v := range c.header_ {
  124214. reqHeaders[k] = v
  124215. }
  124216. reqHeaders.Set("User-Agent", c.s.userAgent())
  124217. if c.ifNoneMatch_ != "" {
  124218. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  124219. }
  124220. var body io.Reader = nil
  124221. c.urlParams_.Set("alt", alt)
  124222. c.urlParams_.Set("prettyPrint", "false")
  124223. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  124224. urls += "?" + c.urlParams_.Encode()
  124225. req, err := http.NewRequest("GET", urls, body)
  124226. if err != nil {
  124227. return nil, err
  124228. }
  124229. req.Header = reqHeaders
  124230. googleapi.Expand(req.URL, map[string]string{
  124231. "project": c.project,
  124232. })
  124233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124234. }
  124235. // Do executes the "compute.snapshots.list" call.
  124236. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  124237. // status code is an error. Response headers are in either
  124238. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  124239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  124240. // to check whether the returned error was because
  124241. // http.StatusNotModified was returned.
  124242. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  124243. gensupport.SetOptions(c.urlParams_, opts...)
  124244. res, err := c.doRequest("json")
  124245. if res != nil && res.StatusCode == http.StatusNotModified {
  124246. if res.Body != nil {
  124247. res.Body.Close()
  124248. }
  124249. return nil, &googleapi.Error{
  124250. Code: res.StatusCode,
  124251. Header: res.Header,
  124252. }
  124253. }
  124254. if err != nil {
  124255. return nil, err
  124256. }
  124257. defer googleapi.CloseBody(res)
  124258. if err := googleapi.CheckResponse(res); err != nil {
  124259. return nil, err
  124260. }
  124261. ret := &SnapshotList{
  124262. ServerResponse: googleapi.ServerResponse{
  124263. Header: res.Header,
  124264. HTTPStatusCode: res.StatusCode,
  124265. },
  124266. }
  124267. target := &ret
  124268. if err := gensupport.DecodeResponse(target, res); err != nil {
  124269. return nil, err
  124270. }
  124271. return ret, nil
  124272. // {
  124273. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  124274. // "httpMethod": "GET",
  124275. // "id": "compute.snapshots.list",
  124276. // "parameterOrder": [
  124277. // "project"
  124278. // ],
  124279. // "parameters": {
  124280. // "filter": {
  124281. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  124282. // "location": "query",
  124283. // "type": "string"
  124284. // },
  124285. // "maxResults": {
  124286. // "default": "500",
  124287. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  124288. // "format": "uint32",
  124289. // "location": "query",
  124290. // "minimum": "0",
  124291. // "type": "integer"
  124292. // },
  124293. // "orderBy": {
  124294. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  124295. // "location": "query",
  124296. // "type": "string"
  124297. // },
  124298. // "pageToken": {
  124299. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  124300. // "location": "query",
  124301. // "type": "string"
  124302. // },
  124303. // "project": {
  124304. // "description": "Project ID for this request.",
  124305. // "location": "path",
  124306. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124307. // "required": true,
  124308. // "type": "string"
  124309. // }
  124310. // },
  124311. // "path": "{project}/global/snapshots",
  124312. // "response": {
  124313. // "$ref": "SnapshotList"
  124314. // },
  124315. // "scopes": [
  124316. // "https://www.googleapis.com/auth/cloud-platform",
  124317. // "https://www.googleapis.com/auth/compute",
  124318. // "https://www.googleapis.com/auth/compute.readonly"
  124319. // ]
  124320. // }
  124321. }
  124322. // Pages invokes f for each page of results.
  124323. // A non-nil error returned from f will halt the iteration.
  124324. // The provided context supersedes any context provided to the Context method.
  124325. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  124326. c.ctx_ = ctx
  124327. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  124328. for {
  124329. x, err := c.Do()
  124330. if err != nil {
  124331. return err
  124332. }
  124333. if err := f(x); err != nil {
  124334. return err
  124335. }
  124336. if x.NextPageToken == "" {
  124337. return nil
  124338. }
  124339. c.PageToken(x.NextPageToken)
  124340. }
  124341. }
  124342. // method id "compute.snapshots.setIamPolicy":
  124343. type SnapshotsSetIamPolicyCall struct {
  124344. s *Service
  124345. project string
  124346. resource string
  124347. globalsetpolicyrequest *GlobalSetPolicyRequest
  124348. urlParams_ gensupport.URLParams
  124349. ctx_ context.Context
  124350. header_ http.Header
  124351. }
  124352. // SetIamPolicy: Sets the access control policy on the specified
  124353. // resource. Replaces any existing policy.
  124354. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  124355. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124356. c.project = project
  124357. c.resource = resource
  124358. c.globalsetpolicyrequest = globalsetpolicyrequest
  124359. return c
  124360. }
  124361. // Fields allows partial responses to be retrieved. See
  124362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124363. // for more information.
  124364. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  124365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124366. return c
  124367. }
  124368. // Context sets the context to be used in this call's Do method. Any
  124369. // pending HTTP request will be aborted if the provided context is
  124370. // canceled.
  124371. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  124372. c.ctx_ = ctx
  124373. return c
  124374. }
  124375. // Header returns an http.Header that can be modified by the caller to
  124376. // add HTTP headers to the request.
  124377. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  124378. if c.header_ == nil {
  124379. c.header_ = make(http.Header)
  124380. }
  124381. return c.header_
  124382. }
  124383. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  124384. reqHeaders := make(http.Header)
  124385. for k, v := range c.header_ {
  124386. reqHeaders[k] = v
  124387. }
  124388. reqHeaders.Set("User-Agent", c.s.userAgent())
  124389. var body io.Reader = nil
  124390. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  124391. if err != nil {
  124392. return nil, err
  124393. }
  124394. reqHeaders.Set("Content-Type", "application/json")
  124395. c.urlParams_.Set("alt", alt)
  124396. c.urlParams_.Set("prettyPrint", "false")
  124397. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  124398. urls += "?" + c.urlParams_.Encode()
  124399. req, err := http.NewRequest("POST", urls, body)
  124400. if err != nil {
  124401. return nil, err
  124402. }
  124403. req.Header = reqHeaders
  124404. googleapi.Expand(req.URL, map[string]string{
  124405. "project": c.project,
  124406. "resource": c.resource,
  124407. })
  124408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124409. }
  124410. // Do executes the "compute.snapshots.setIamPolicy" call.
  124411. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  124412. // code is an error. Response headers are in either
  124413. // *Policy.ServerResponse.Header or (if a response was returned at all)
  124414. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  124415. // check whether the returned error was because http.StatusNotModified
  124416. // was returned.
  124417. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  124418. gensupport.SetOptions(c.urlParams_, opts...)
  124419. res, err := c.doRequest("json")
  124420. if res != nil && res.StatusCode == http.StatusNotModified {
  124421. if res.Body != nil {
  124422. res.Body.Close()
  124423. }
  124424. return nil, &googleapi.Error{
  124425. Code: res.StatusCode,
  124426. Header: res.Header,
  124427. }
  124428. }
  124429. if err != nil {
  124430. return nil, err
  124431. }
  124432. defer googleapi.CloseBody(res)
  124433. if err := googleapi.CheckResponse(res); err != nil {
  124434. return nil, err
  124435. }
  124436. ret := &Policy{
  124437. ServerResponse: googleapi.ServerResponse{
  124438. Header: res.Header,
  124439. HTTPStatusCode: res.StatusCode,
  124440. },
  124441. }
  124442. target := &ret
  124443. if err := gensupport.DecodeResponse(target, res); err != nil {
  124444. return nil, err
  124445. }
  124446. return ret, nil
  124447. // {
  124448. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  124449. // "httpMethod": "POST",
  124450. // "id": "compute.snapshots.setIamPolicy",
  124451. // "parameterOrder": [
  124452. // "project",
  124453. // "resource"
  124454. // ],
  124455. // "parameters": {
  124456. // "project": {
  124457. // "description": "Project ID for this request.",
  124458. // "location": "path",
  124459. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124460. // "required": true,
  124461. // "type": "string"
  124462. // },
  124463. // "resource": {
  124464. // "description": "Name or id of the resource for this request.",
  124465. // "location": "path",
  124466. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124467. // "required": true,
  124468. // "type": "string"
  124469. // }
  124470. // },
  124471. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  124472. // "request": {
  124473. // "$ref": "GlobalSetPolicyRequest"
  124474. // },
  124475. // "response": {
  124476. // "$ref": "Policy"
  124477. // },
  124478. // "scopes": [
  124479. // "https://www.googleapis.com/auth/cloud-platform",
  124480. // "https://www.googleapis.com/auth/compute"
  124481. // ]
  124482. // }
  124483. }
  124484. // method id "compute.snapshots.setLabels":
  124485. type SnapshotsSetLabelsCall struct {
  124486. s *Service
  124487. project string
  124488. resource string
  124489. globalsetlabelsrequest *GlobalSetLabelsRequest
  124490. urlParams_ gensupport.URLParams
  124491. ctx_ context.Context
  124492. header_ http.Header
  124493. }
  124494. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  124495. // read the Labeling Resources documentation.
  124496. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  124497. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124498. c.project = project
  124499. c.resource = resource
  124500. c.globalsetlabelsrequest = globalsetlabelsrequest
  124501. return c
  124502. }
  124503. // Fields allows partial responses to be retrieved. See
  124504. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124505. // for more information.
  124506. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  124507. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124508. return c
  124509. }
  124510. // Context sets the context to be used in this call's Do method. Any
  124511. // pending HTTP request will be aborted if the provided context is
  124512. // canceled.
  124513. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  124514. c.ctx_ = ctx
  124515. return c
  124516. }
  124517. // Header returns an http.Header that can be modified by the caller to
  124518. // add HTTP headers to the request.
  124519. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  124520. if c.header_ == nil {
  124521. c.header_ = make(http.Header)
  124522. }
  124523. return c.header_
  124524. }
  124525. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  124526. reqHeaders := make(http.Header)
  124527. for k, v := range c.header_ {
  124528. reqHeaders[k] = v
  124529. }
  124530. reqHeaders.Set("User-Agent", c.s.userAgent())
  124531. var body io.Reader = nil
  124532. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  124533. if err != nil {
  124534. return nil, err
  124535. }
  124536. reqHeaders.Set("Content-Type", "application/json")
  124537. c.urlParams_.Set("alt", alt)
  124538. c.urlParams_.Set("prettyPrint", "false")
  124539. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  124540. urls += "?" + c.urlParams_.Encode()
  124541. req, err := http.NewRequest("POST", urls, body)
  124542. if err != nil {
  124543. return nil, err
  124544. }
  124545. req.Header = reqHeaders
  124546. googleapi.Expand(req.URL, map[string]string{
  124547. "project": c.project,
  124548. "resource": c.resource,
  124549. })
  124550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124551. }
  124552. // Do executes the "compute.snapshots.setLabels" call.
  124553. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  124554. // status code is an error. Response headers are in either
  124555. // *Operation.ServerResponse.Header or (if a response was returned at
  124556. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  124557. // to check whether the returned error was because
  124558. // http.StatusNotModified was returned.
  124559. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  124560. gensupport.SetOptions(c.urlParams_, opts...)
  124561. res, err := c.doRequest("json")
  124562. if res != nil && res.StatusCode == http.StatusNotModified {
  124563. if res.Body != nil {
  124564. res.Body.Close()
  124565. }
  124566. return nil, &googleapi.Error{
  124567. Code: res.StatusCode,
  124568. Header: res.Header,
  124569. }
  124570. }
  124571. if err != nil {
  124572. return nil, err
  124573. }
  124574. defer googleapi.CloseBody(res)
  124575. if err := googleapi.CheckResponse(res); err != nil {
  124576. return nil, err
  124577. }
  124578. ret := &Operation{
  124579. ServerResponse: googleapi.ServerResponse{
  124580. Header: res.Header,
  124581. HTTPStatusCode: res.StatusCode,
  124582. },
  124583. }
  124584. target := &ret
  124585. if err := gensupport.DecodeResponse(target, res); err != nil {
  124586. return nil, err
  124587. }
  124588. return ret, nil
  124589. // {
  124590. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  124591. // "httpMethod": "POST",
  124592. // "id": "compute.snapshots.setLabels",
  124593. // "parameterOrder": [
  124594. // "project",
  124595. // "resource"
  124596. // ],
  124597. // "parameters": {
  124598. // "project": {
  124599. // "description": "Project ID for this request.",
  124600. // "location": "path",
  124601. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124602. // "required": true,
  124603. // "type": "string"
  124604. // },
  124605. // "resource": {
  124606. // "description": "Name or id of the resource for this request.",
  124607. // "location": "path",
  124608. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124609. // "required": true,
  124610. // "type": "string"
  124611. // }
  124612. // },
  124613. // "path": "{project}/global/snapshots/{resource}/setLabels",
  124614. // "request": {
  124615. // "$ref": "GlobalSetLabelsRequest"
  124616. // },
  124617. // "response": {
  124618. // "$ref": "Operation"
  124619. // },
  124620. // "scopes": [
  124621. // "https://www.googleapis.com/auth/cloud-platform",
  124622. // "https://www.googleapis.com/auth/compute"
  124623. // ]
  124624. // }
  124625. }
  124626. // method id "compute.snapshots.testIamPermissions":
  124627. type SnapshotsTestIamPermissionsCall struct {
  124628. s *Service
  124629. project string
  124630. resource string
  124631. testpermissionsrequest *TestPermissionsRequest
  124632. urlParams_ gensupport.URLParams
  124633. ctx_ context.Context
  124634. header_ http.Header
  124635. }
  124636. // TestIamPermissions: Returns permissions that a caller has on the
  124637. // specified resource.
  124638. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  124639. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124640. c.project = project
  124641. c.resource = resource
  124642. c.testpermissionsrequest = testpermissionsrequest
  124643. return c
  124644. }
  124645. // Fields allows partial responses to be retrieved. See
  124646. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124647. // for more information.
  124648. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  124649. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124650. return c
  124651. }
  124652. // Context sets the context to be used in this call's Do method. Any
  124653. // pending HTTP request will be aborted if the provided context is
  124654. // canceled.
  124655. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  124656. c.ctx_ = ctx
  124657. return c
  124658. }
  124659. // Header returns an http.Header that can be modified by the caller to
  124660. // add HTTP headers to the request.
  124661. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  124662. if c.header_ == nil {
  124663. c.header_ = make(http.Header)
  124664. }
  124665. return c.header_
  124666. }
  124667. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  124668. reqHeaders := make(http.Header)
  124669. for k, v := range c.header_ {
  124670. reqHeaders[k] = v
  124671. }
  124672. reqHeaders.Set("User-Agent", c.s.userAgent())
  124673. var body io.Reader = nil
  124674. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  124675. if err != nil {
  124676. return nil, err
  124677. }
  124678. reqHeaders.Set("Content-Type", "application/json")
  124679. c.urlParams_.Set("alt", alt)
  124680. c.urlParams_.Set("prettyPrint", "false")
  124681. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  124682. urls += "?" + c.urlParams_.Encode()
  124683. req, err := http.NewRequest("POST", urls, body)
  124684. if err != nil {
  124685. return nil, err
  124686. }
  124687. req.Header = reqHeaders
  124688. googleapi.Expand(req.URL, map[string]string{
  124689. "project": c.project,
  124690. "resource": c.resource,
  124691. })
  124692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124693. }
  124694. // Do executes the "compute.snapshots.testIamPermissions" call.
  124695. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  124696. // non-2xx status code is an error. Response headers are in either
  124697. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  124698. // returned at all) in error.(*googleapi.Error).Header. Use
  124699. // googleapi.IsNotModified to check whether the returned error was
  124700. // because http.StatusNotModified was returned.
  124701. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  124702. gensupport.SetOptions(c.urlParams_, opts...)
  124703. res, err := c.doRequest("json")
  124704. if res != nil && res.StatusCode == http.StatusNotModified {
  124705. if res.Body != nil {
  124706. res.Body.Close()
  124707. }
  124708. return nil, &googleapi.Error{
  124709. Code: res.StatusCode,
  124710. Header: res.Header,
  124711. }
  124712. }
  124713. if err != nil {
  124714. return nil, err
  124715. }
  124716. defer googleapi.CloseBody(res)
  124717. if err := googleapi.CheckResponse(res); err != nil {
  124718. return nil, err
  124719. }
  124720. ret := &TestPermissionsResponse{
  124721. ServerResponse: googleapi.ServerResponse{
  124722. Header: res.Header,
  124723. HTTPStatusCode: res.StatusCode,
  124724. },
  124725. }
  124726. target := &ret
  124727. if err := gensupport.DecodeResponse(target, res); err != nil {
  124728. return nil, err
  124729. }
  124730. return ret, nil
  124731. // {
  124732. // "description": "Returns permissions that a caller has on the specified resource.",
  124733. // "httpMethod": "POST",
  124734. // "id": "compute.snapshots.testIamPermissions",
  124735. // "parameterOrder": [
  124736. // "project",
  124737. // "resource"
  124738. // ],
  124739. // "parameters": {
  124740. // "project": {
  124741. // "description": "Project ID for this request.",
  124742. // "location": "path",
  124743. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124744. // "required": true,
  124745. // "type": "string"
  124746. // },
  124747. // "resource": {
  124748. // "description": "Name or id of the resource for this request.",
  124749. // "location": "path",
  124750. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  124751. // "required": true,
  124752. // "type": "string"
  124753. // }
  124754. // },
  124755. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  124756. // "request": {
  124757. // "$ref": "TestPermissionsRequest"
  124758. // },
  124759. // "response": {
  124760. // "$ref": "TestPermissionsResponse"
  124761. // },
  124762. // "scopes": [
  124763. // "https://www.googleapis.com/auth/cloud-platform",
  124764. // "https://www.googleapis.com/auth/compute",
  124765. // "https://www.googleapis.com/auth/compute.readonly"
  124766. // ]
  124767. // }
  124768. }
  124769. // method id "compute.sslCertificates.aggregatedList":
  124770. type SslCertificatesAggregatedListCall struct {
  124771. s *Service
  124772. project string
  124773. urlParams_ gensupport.URLParams
  124774. ifNoneMatch_ string
  124775. ctx_ context.Context
  124776. header_ http.Header
  124777. }
  124778. // AggregatedList: Retrieves the list of all SslCertificate resources,
  124779. // regional and global, available to the specified project.
  124780. func (r *SslCertificatesService) AggregatedList(project string) *SslCertificatesAggregatedListCall {
  124781. c := &SslCertificatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  124782. c.project = project
  124783. return c
  124784. }
  124785. // Filter sets the optional parameter "filter": A filter expression that
  124786. // filters resources listed in the response. The expression must specify
  124787. // the field name, a comparison operator, and the value that you want to
  124788. // use for filtering. The value must be a string, a number, or a
  124789. // boolean. The comparison operator must be either =, !=, >, or <.
  124790. //
  124791. // For example, if you are filtering Compute Engine instances, you can
  124792. // exclude instances named example-instance by specifying name !=
  124793. // example-instance.
  124794. //
  124795. // You can also filter nested fields. For example, you could specify
  124796. // scheduling.automaticRestart = false to include instances only if they
  124797. // are not scheduled for automatic restarts. You can use filtering on
  124798. // nested fields to filter based on resource labels.
  124799. //
  124800. // To filter on multiple expressions, provide each separate expression
  124801. // within parentheses. For example, (scheduling.automaticRestart = true)
  124802. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  124803. // AND expression. However, you can include AND and OR expressions
  124804. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  124805. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  124806. // true).
  124807. func (c *SslCertificatesAggregatedListCall) Filter(filter string) *SslCertificatesAggregatedListCall {
  124808. c.urlParams_.Set("filter", filter)
  124809. return c
  124810. }
  124811. // MaxResults sets the optional parameter "maxResults": The maximum
  124812. // number of results per page that should be returned. If the number of
  124813. // available results is larger than maxResults, Compute Engine returns a
  124814. // nextPageToken that can be used to get the next page of results in
  124815. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  124816. // (Default: 500)
  124817. func (c *SslCertificatesAggregatedListCall) MaxResults(maxResults int64) *SslCertificatesAggregatedListCall {
  124818. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  124819. return c
  124820. }
  124821. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  124822. // a certain order. By default, results are returned in alphanumerical
  124823. // order based on the resource name.
  124824. //
  124825. // You can also sort results in descending order based on the creation
  124826. // timestamp using orderBy="creationTimestamp desc". This sorts results
  124827. // based on the creationTimestamp field in reverse chronological order
  124828. // (newest result first). Use this to sort resources like operations so
  124829. // that the newest operation is returned first.
  124830. //
  124831. // Currently, only sorting by name or creationTimestamp desc is
  124832. // supported.
  124833. func (c *SslCertificatesAggregatedListCall) OrderBy(orderBy string) *SslCertificatesAggregatedListCall {
  124834. c.urlParams_.Set("orderBy", orderBy)
  124835. return c
  124836. }
  124837. // PageToken sets the optional parameter "pageToken": Specifies a page
  124838. // token to use. Set pageToken to the nextPageToken returned by a
  124839. // previous list request to get the next page of results.
  124840. func (c *SslCertificatesAggregatedListCall) PageToken(pageToken string) *SslCertificatesAggregatedListCall {
  124841. c.urlParams_.Set("pageToken", pageToken)
  124842. return c
  124843. }
  124844. // Fields allows partial responses to be retrieved. See
  124845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  124846. // for more information.
  124847. func (c *SslCertificatesAggregatedListCall) Fields(s ...googleapi.Field) *SslCertificatesAggregatedListCall {
  124848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  124849. return c
  124850. }
  124851. // IfNoneMatch sets the optional parameter which makes the operation
  124852. // fail if the object's ETag matches the given value. This is useful for
  124853. // getting updates only after the object has changed since the last
  124854. // request. Use googleapi.IsNotModified to check whether the response
  124855. // error from Do is the result of In-None-Match.
  124856. func (c *SslCertificatesAggregatedListCall) IfNoneMatch(entityTag string) *SslCertificatesAggregatedListCall {
  124857. c.ifNoneMatch_ = entityTag
  124858. return c
  124859. }
  124860. // Context sets the context to be used in this call's Do method. Any
  124861. // pending HTTP request will be aborted if the provided context is
  124862. // canceled.
  124863. func (c *SslCertificatesAggregatedListCall) Context(ctx context.Context) *SslCertificatesAggregatedListCall {
  124864. c.ctx_ = ctx
  124865. return c
  124866. }
  124867. // Header returns an http.Header that can be modified by the caller to
  124868. // add HTTP headers to the request.
  124869. func (c *SslCertificatesAggregatedListCall) Header() http.Header {
  124870. if c.header_ == nil {
  124871. c.header_ = make(http.Header)
  124872. }
  124873. return c.header_
  124874. }
  124875. func (c *SslCertificatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  124876. reqHeaders := make(http.Header)
  124877. for k, v := range c.header_ {
  124878. reqHeaders[k] = v
  124879. }
  124880. reqHeaders.Set("User-Agent", c.s.userAgent())
  124881. if c.ifNoneMatch_ != "" {
  124882. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  124883. }
  124884. var body io.Reader = nil
  124885. c.urlParams_.Set("alt", alt)
  124886. c.urlParams_.Set("prettyPrint", "false")
  124887. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/sslCertificates")
  124888. urls += "?" + c.urlParams_.Encode()
  124889. req, err := http.NewRequest("GET", urls, body)
  124890. if err != nil {
  124891. return nil, err
  124892. }
  124893. req.Header = reqHeaders
  124894. googleapi.Expand(req.URL, map[string]string{
  124895. "project": c.project,
  124896. })
  124897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  124898. }
  124899. // Do executes the "compute.sslCertificates.aggregatedList" call.
  124900. // Exactly one of *SslCertificateAggregatedList or error will be
  124901. // non-nil. Any non-2xx status code is an error. Response headers are in
  124902. // either *SslCertificateAggregatedList.ServerResponse.Header or (if a
  124903. // response was returned at all) in error.(*googleapi.Error).Header. Use
  124904. // googleapi.IsNotModified to check whether the returned error was
  124905. // because http.StatusNotModified was returned.
  124906. func (c *SslCertificatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*SslCertificateAggregatedList, error) {
  124907. gensupport.SetOptions(c.urlParams_, opts...)
  124908. res, err := c.doRequest("json")
  124909. if res != nil && res.StatusCode == http.StatusNotModified {
  124910. if res.Body != nil {
  124911. res.Body.Close()
  124912. }
  124913. return nil, &googleapi.Error{
  124914. Code: res.StatusCode,
  124915. Header: res.Header,
  124916. }
  124917. }
  124918. if err != nil {
  124919. return nil, err
  124920. }
  124921. defer googleapi.CloseBody(res)
  124922. if err := googleapi.CheckResponse(res); err != nil {
  124923. return nil, err
  124924. }
  124925. ret := &SslCertificateAggregatedList{
  124926. ServerResponse: googleapi.ServerResponse{
  124927. Header: res.Header,
  124928. HTTPStatusCode: res.StatusCode,
  124929. },
  124930. }
  124931. target := &ret
  124932. if err := gensupport.DecodeResponse(target, res); err != nil {
  124933. return nil, err
  124934. }
  124935. return ret, nil
  124936. // {
  124937. // "description": "Retrieves the list of all SslCertificate resources, regional and global, available to the specified project.",
  124938. // "httpMethod": "GET",
  124939. // "id": "compute.sslCertificates.aggregatedList",
  124940. // "parameterOrder": [
  124941. // "project"
  124942. // ],
  124943. // "parameters": {
  124944. // "filter": {
  124945. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  124946. // "location": "query",
  124947. // "type": "string"
  124948. // },
  124949. // "maxResults": {
  124950. // "default": "500",
  124951. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  124952. // "format": "uint32",
  124953. // "location": "query",
  124954. // "minimum": "0",
  124955. // "type": "integer"
  124956. // },
  124957. // "orderBy": {
  124958. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  124959. // "location": "query",
  124960. // "type": "string"
  124961. // },
  124962. // "pageToken": {
  124963. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  124964. // "location": "query",
  124965. // "type": "string"
  124966. // },
  124967. // "project": {
  124968. // "description": "Name of the project scoping this request.",
  124969. // "location": "path",
  124970. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  124971. // "required": true,
  124972. // "type": "string"
  124973. // }
  124974. // },
  124975. // "path": "{project}/aggregated/sslCertificates",
  124976. // "response": {
  124977. // "$ref": "SslCertificateAggregatedList"
  124978. // },
  124979. // "scopes": [
  124980. // "https://www.googleapis.com/auth/cloud-platform",
  124981. // "https://www.googleapis.com/auth/compute",
  124982. // "https://www.googleapis.com/auth/compute.readonly"
  124983. // ]
  124984. // }
  124985. }
  124986. // Pages invokes f for each page of results.
  124987. // A non-nil error returned from f will halt the iteration.
  124988. // The provided context supersedes any context provided to the Context method.
  124989. func (c *SslCertificatesAggregatedListCall) Pages(ctx context.Context, f func(*SslCertificateAggregatedList) error) error {
  124990. c.ctx_ = ctx
  124991. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  124992. for {
  124993. x, err := c.Do()
  124994. if err != nil {
  124995. return err
  124996. }
  124997. if err := f(x); err != nil {
  124998. return err
  124999. }
  125000. if x.NextPageToken == "" {
  125001. return nil
  125002. }
  125003. c.PageToken(x.NextPageToken)
  125004. }
  125005. }
  125006. // method id "compute.sslCertificates.delete":
  125007. type SslCertificatesDeleteCall struct {
  125008. s *Service
  125009. project string
  125010. sslCertificate string
  125011. urlParams_ gensupport.URLParams
  125012. ctx_ context.Context
  125013. header_ http.Header
  125014. }
  125015. // Delete: Deletes the specified SslCertificate resource.
  125016. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  125017. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125018. c.project = project
  125019. c.sslCertificate = sslCertificate
  125020. return c
  125021. }
  125022. // RequestId sets the optional parameter "requestId": An optional
  125023. // request ID to identify requests. Specify a unique request ID so that
  125024. // if you must retry your request, the server will know to ignore the
  125025. // request if it has already been completed.
  125026. //
  125027. // For example, consider a situation where you make an initial request
  125028. // and the request times out. If you make the request again with the
  125029. // same request ID, the server can check if original operation with the
  125030. // same request ID was received, and if so, will ignore the second
  125031. // request. This prevents clients from accidentally creating duplicate
  125032. // commitments.
  125033. //
  125034. // The request ID must be a valid UUID with the exception that zero UUID
  125035. // is not supported (00000000-0000-0000-0000-000000000000).
  125036. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  125037. c.urlParams_.Set("requestId", requestId)
  125038. return c
  125039. }
  125040. // Fields allows partial responses to be retrieved. See
  125041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125042. // for more information.
  125043. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  125044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125045. return c
  125046. }
  125047. // Context sets the context to be used in this call's Do method. Any
  125048. // pending HTTP request will be aborted if the provided context is
  125049. // canceled.
  125050. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  125051. c.ctx_ = ctx
  125052. return c
  125053. }
  125054. // Header returns an http.Header that can be modified by the caller to
  125055. // add HTTP headers to the request.
  125056. func (c *SslCertificatesDeleteCall) Header() http.Header {
  125057. if c.header_ == nil {
  125058. c.header_ = make(http.Header)
  125059. }
  125060. return c.header_
  125061. }
  125062. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  125063. reqHeaders := make(http.Header)
  125064. for k, v := range c.header_ {
  125065. reqHeaders[k] = v
  125066. }
  125067. reqHeaders.Set("User-Agent", c.s.userAgent())
  125068. var body io.Reader = nil
  125069. c.urlParams_.Set("alt", alt)
  125070. c.urlParams_.Set("prettyPrint", "false")
  125071. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  125072. urls += "?" + c.urlParams_.Encode()
  125073. req, err := http.NewRequest("DELETE", urls, body)
  125074. if err != nil {
  125075. return nil, err
  125076. }
  125077. req.Header = reqHeaders
  125078. googleapi.Expand(req.URL, map[string]string{
  125079. "project": c.project,
  125080. "sslCertificate": c.sslCertificate,
  125081. })
  125082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125083. }
  125084. // Do executes the "compute.sslCertificates.delete" call.
  125085. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  125086. // status code is an error. Response headers are in either
  125087. // *Operation.ServerResponse.Header or (if a response was returned at
  125088. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  125089. // to check whether the returned error was because
  125090. // http.StatusNotModified was returned.
  125091. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  125092. gensupport.SetOptions(c.urlParams_, opts...)
  125093. res, err := c.doRequest("json")
  125094. if res != nil && res.StatusCode == http.StatusNotModified {
  125095. if res.Body != nil {
  125096. res.Body.Close()
  125097. }
  125098. return nil, &googleapi.Error{
  125099. Code: res.StatusCode,
  125100. Header: res.Header,
  125101. }
  125102. }
  125103. if err != nil {
  125104. return nil, err
  125105. }
  125106. defer googleapi.CloseBody(res)
  125107. if err := googleapi.CheckResponse(res); err != nil {
  125108. return nil, err
  125109. }
  125110. ret := &Operation{
  125111. ServerResponse: googleapi.ServerResponse{
  125112. Header: res.Header,
  125113. HTTPStatusCode: res.StatusCode,
  125114. },
  125115. }
  125116. target := &ret
  125117. if err := gensupport.DecodeResponse(target, res); err != nil {
  125118. return nil, err
  125119. }
  125120. return ret, nil
  125121. // {
  125122. // "description": "Deletes the specified SslCertificate resource.",
  125123. // "httpMethod": "DELETE",
  125124. // "id": "compute.sslCertificates.delete",
  125125. // "parameterOrder": [
  125126. // "project",
  125127. // "sslCertificate"
  125128. // ],
  125129. // "parameters": {
  125130. // "project": {
  125131. // "description": "Project ID for this request.",
  125132. // "location": "path",
  125133. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125134. // "required": true,
  125135. // "type": "string"
  125136. // },
  125137. // "requestId": {
  125138. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  125139. // "location": "query",
  125140. // "type": "string"
  125141. // },
  125142. // "sslCertificate": {
  125143. // "description": "Name of the SslCertificate resource to delete.",
  125144. // "location": "path",
  125145. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  125146. // "required": true,
  125147. // "type": "string"
  125148. // }
  125149. // },
  125150. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  125151. // "response": {
  125152. // "$ref": "Operation"
  125153. // },
  125154. // "scopes": [
  125155. // "https://www.googleapis.com/auth/cloud-platform",
  125156. // "https://www.googleapis.com/auth/compute"
  125157. // ]
  125158. // }
  125159. }
  125160. // method id "compute.sslCertificates.get":
  125161. type SslCertificatesGetCall struct {
  125162. s *Service
  125163. project string
  125164. sslCertificate string
  125165. urlParams_ gensupport.URLParams
  125166. ifNoneMatch_ string
  125167. ctx_ context.Context
  125168. header_ http.Header
  125169. }
  125170. // Get: Returns the specified SslCertificate resource. Gets a list of
  125171. // available SSL certificates by making a list() request.
  125172. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  125173. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125174. c.project = project
  125175. c.sslCertificate = sslCertificate
  125176. return c
  125177. }
  125178. // Fields allows partial responses to be retrieved. See
  125179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125180. // for more information.
  125181. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  125182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125183. return c
  125184. }
  125185. // IfNoneMatch sets the optional parameter which makes the operation
  125186. // fail if the object's ETag matches the given value. This is useful for
  125187. // getting updates only after the object has changed since the last
  125188. // request. Use googleapi.IsNotModified to check whether the response
  125189. // error from Do is the result of In-None-Match.
  125190. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  125191. c.ifNoneMatch_ = entityTag
  125192. return c
  125193. }
  125194. // Context sets the context to be used in this call's Do method. Any
  125195. // pending HTTP request will be aborted if the provided context is
  125196. // canceled.
  125197. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  125198. c.ctx_ = ctx
  125199. return c
  125200. }
  125201. // Header returns an http.Header that can be modified by the caller to
  125202. // add HTTP headers to the request.
  125203. func (c *SslCertificatesGetCall) Header() http.Header {
  125204. if c.header_ == nil {
  125205. c.header_ = make(http.Header)
  125206. }
  125207. return c.header_
  125208. }
  125209. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  125210. reqHeaders := make(http.Header)
  125211. for k, v := range c.header_ {
  125212. reqHeaders[k] = v
  125213. }
  125214. reqHeaders.Set("User-Agent", c.s.userAgent())
  125215. if c.ifNoneMatch_ != "" {
  125216. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  125217. }
  125218. var body io.Reader = nil
  125219. c.urlParams_.Set("alt", alt)
  125220. c.urlParams_.Set("prettyPrint", "false")
  125221. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  125222. urls += "?" + c.urlParams_.Encode()
  125223. req, err := http.NewRequest("GET", urls, body)
  125224. if err != nil {
  125225. return nil, err
  125226. }
  125227. req.Header = reqHeaders
  125228. googleapi.Expand(req.URL, map[string]string{
  125229. "project": c.project,
  125230. "sslCertificate": c.sslCertificate,
  125231. })
  125232. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125233. }
  125234. // Do executes the "compute.sslCertificates.get" call.
  125235. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  125236. // status code is an error. Response headers are in either
  125237. // *SslCertificate.ServerResponse.Header or (if a response was returned
  125238. // at all) in error.(*googleapi.Error).Header. Use
  125239. // googleapi.IsNotModified to check whether the returned error was
  125240. // because http.StatusNotModified was returned.
  125241. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  125242. gensupport.SetOptions(c.urlParams_, opts...)
  125243. res, err := c.doRequest("json")
  125244. if res != nil && res.StatusCode == http.StatusNotModified {
  125245. if res.Body != nil {
  125246. res.Body.Close()
  125247. }
  125248. return nil, &googleapi.Error{
  125249. Code: res.StatusCode,
  125250. Header: res.Header,
  125251. }
  125252. }
  125253. if err != nil {
  125254. return nil, err
  125255. }
  125256. defer googleapi.CloseBody(res)
  125257. if err := googleapi.CheckResponse(res); err != nil {
  125258. return nil, err
  125259. }
  125260. ret := &SslCertificate{
  125261. ServerResponse: googleapi.ServerResponse{
  125262. Header: res.Header,
  125263. HTTPStatusCode: res.StatusCode,
  125264. },
  125265. }
  125266. target := &ret
  125267. if err := gensupport.DecodeResponse(target, res); err != nil {
  125268. return nil, err
  125269. }
  125270. return ret, nil
  125271. // {
  125272. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  125273. // "httpMethod": "GET",
  125274. // "id": "compute.sslCertificates.get",
  125275. // "parameterOrder": [
  125276. // "project",
  125277. // "sslCertificate"
  125278. // ],
  125279. // "parameters": {
  125280. // "project": {
  125281. // "description": "Project ID for this request.",
  125282. // "location": "path",
  125283. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125284. // "required": true,
  125285. // "type": "string"
  125286. // },
  125287. // "sslCertificate": {
  125288. // "description": "Name of the SslCertificate resource to return.",
  125289. // "location": "path",
  125290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  125291. // "required": true,
  125292. // "type": "string"
  125293. // }
  125294. // },
  125295. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  125296. // "response": {
  125297. // "$ref": "SslCertificate"
  125298. // },
  125299. // "scopes": [
  125300. // "https://www.googleapis.com/auth/cloud-platform",
  125301. // "https://www.googleapis.com/auth/compute",
  125302. // "https://www.googleapis.com/auth/compute.readonly"
  125303. // ]
  125304. // }
  125305. }
  125306. // method id "compute.sslCertificates.insert":
  125307. type SslCertificatesInsertCall struct {
  125308. s *Service
  125309. project string
  125310. sslcertificate *SslCertificate
  125311. urlParams_ gensupport.URLParams
  125312. ctx_ context.Context
  125313. header_ http.Header
  125314. }
  125315. // Insert: Creates a SslCertificate resource in the specified project
  125316. // using the data included in the request.
  125317. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  125318. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125319. c.project = project
  125320. c.sslcertificate = sslcertificate
  125321. return c
  125322. }
  125323. // RequestId sets the optional parameter "requestId": An optional
  125324. // request ID to identify requests. Specify a unique request ID so that
  125325. // if you must retry your request, the server will know to ignore the
  125326. // request if it has already been completed.
  125327. //
  125328. // For example, consider a situation where you make an initial request
  125329. // and the request times out. If you make the request again with the
  125330. // same request ID, the server can check if original operation with the
  125331. // same request ID was received, and if so, will ignore the second
  125332. // request. This prevents clients from accidentally creating duplicate
  125333. // commitments.
  125334. //
  125335. // The request ID must be a valid UUID with the exception that zero UUID
  125336. // is not supported (00000000-0000-0000-0000-000000000000).
  125337. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  125338. c.urlParams_.Set("requestId", requestId)
  125339. return c
  125340. }
  125341. // Fields allows partial responses to be retrieved. See
  125342. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125343. // for more information.
  125344. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  125345. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125346. return c
  125347. }
  125348. // Context sets the context to be used in this call's Do method. Any
  125349. // pending HTTP request will be aborted if the provided context is
  125350. // canceled.
  125351. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  125352. c.ctx_ = ctx
  125353. return c
  125354. }
  125355. // Header returns an http.Header that can be modified by the caller to
  125356. // add HTTP headers to the request.
  125357. func (c *SslCertificatesInsertCall) Header() http.Header {
  125358. if c.header_ == nil {
  125359. c.header_ = make(http.Header)
  125360. }
  125361. return c.header_
  125362. }
  125363. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  125364. reqHeaders := make(http.Header)
  125365. for k, v := range c.header_ {
  125366. reqHeaders[k] = v
  125367. }
  125368. reqHeaders.Set("User-Agent", c.s.userAgent())
  125369. var body io.Reader = nil
  125370. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  125371. if err != nil {
  125372. return nil, err
  125373. }
  125374. reqHeaders.Set("Content-Type", "application/json")
  125375. c.urlParams_.Set("alt", alt)
  125376. c.urlParams_.Set("prettyPrint", "false")
  125377. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  125378. urls += "?" + c.urlParams_.Encode()
  125379. req, err := http.NewRequest("POST", urls, body)
  125380. if err != nil {
  125381. return nil, err
  125382. }
  125383. req.Header = reqHeaders
  125384. googleapi.Expand(req.URL, map[string]string{
  125385. "project": c.project,
  125386. })
  125387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125388. }
  125389. // Do executes the "compute.sslCertificates.insert" call.
  125390. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  125391. // status code is an error. Response headers are in either
  125392. // *Operation.ServerResponse.Header or (if a response was returned at
  125393. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  125394. // to check whether the returned error was because
  125395. // http.StatusNotModified was returned.
  125396. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  125397. gensupport.SetOptions(c.urlParams_, opts...)
  125398. res, err := c.doRequest("json")
  125399. if res != nil && res.StatusCode == http.StatusNotModified {
  125400. if res.Body != nil {
  125401. res.Body.Close()
  125402. }
  125403. return nil, &googleapi.Error{
  125404. Code: res.StatusCode,
  125405. Header: res.Header,
  125406. }
  125407. }
  125408. if err != nil {
  125409. return nil, err
  125410. }
  125411. defer googleapi.CloseBody(res)
  125412. if err := googleapi.CheckResponse(res); err != nil {
  125413. return nil, err
  125414. }
  125415. ret := &Operation{
  125416. ServerResponse: googleapi.ServerResponse{
  125417. Header: res.Header,
  125418. HTTPStatusCode: res.StatusCode,
  125419. },
  125420. }
  125421. target := &ret
  125422. if err := gensupport.DecodeResponse(target, res); err != nil {
  125423. return nil, err
  125424. }
  125425. return ret, nil
  125426. // {
  125427. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  125428. // "httpMethod": "POST",
  125429. // "id": "compute.sslCertificates.insert",
  125430. // "parameterOrder": [
  125431. // "project"
  125432. // ],
  125433. // "parameters": {
  125434. // "project": {
  125435. // "description": "Project ID for this request.",
  125436. // "location": "path",
  125437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125438. // "required": true,
  125439. // "type": "string"
  125440. // },
  125441. // "requestId": {
  125442. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  125443. // "location": "query",
  125444. // "type": "string"
  125445. // }
  125446. // },
  125447. // "path": "{project}/global/sslCertificates",
  125448. // "request": {
  125449. // "$ref": "SslCertificate"
  125450. // },
  125451. // "response": {
  125452. // "$ref": "Operation"
  125453. // },
  125454. // "scopes": [
  125455. // "https://www.googleapis.com/auth/cloud-platform",
  125456. // "https://www.googleapis.com/auth/compute"
  125457. // ]
  125458. // }
  125459. }
  125460. // method id "compute.sslCertificates.list":
  125461. type SslCertificatesListCall struct {
  125462. s *Service
  125463. project string
  125464. urlParams_ gensupport.URLParams
  125465. ifNoneMatch_ string
  125466. ctx_ context.Context
  125467. header_ http.Header
  125468. }
  125469. // List: Retrieves the list of SslCertificate resources available to the
  125470. // specified project.
  125471. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  125472. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125473. c.project = project
  125474. return c
  125475. }
  125476. // Filter sets the optional parameter "filter": A filter expression that
  125477. // filters resources listed in the response. The expression must specify
  125478. // the field name, a comparison operator, and the value that you want to
  125479. // use for filtering. The value must be a string, a number, or a
  125480. // boolean. The comparison operator must be either =, !=, >, or <.
  125481. //
  125482. // For example, if you are filtering Compute Engine instances, you can
  125483. // exclude instances named example-instance by specifying name !=
  125484. // example-instance.
  125485. //
  125486. // You can also filter nested fields. For example, you could specify
  125487. // scheduling.automaticRestart = false to include instances only if they
  125488. // are not scheduled for automatic restarts. You can use filtering on
  125489. // nested fields to filter based on resource labels.
  125490. //
  125491. // To filter on multiple expressions, provide each separate expression
  125492. // within parentheses. For example, (scheduling.automaticRestart = true)
  125493. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  125494. // AND expression. However, you can include AND and OR expressions
  125495. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  125496. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  125497. // true).
  125498. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  125499. c.urlParams_.Set("filter", filter)
  125500. return c
  125501. }
  125502. // MaxResults sets the optional parameter "maxResults": The maximum
  125503. // number of results per page that should be returned. If the number of
  125504. // available results is larger than maxResults, Compute Engine returns a
  125505. // nextPageToken that can be used to get the next page of results in
  125506. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  125507. // (Default: 500)
  125508. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  125509. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  125510. return c
  125511. }
  125512. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  125513. // a certain order. By default, results are returned in alphanumerical
  125514. // order based on the resource name.
  125515. //
  125516. // You can also sort results in descending order based on the creation
  125517. // timestamp using orderBy="creationTimestamp desc". This sorts results
  125518. // based on the creationTimestamp field in reverse chronological order
  125519. // (newest result first). Use this to sort resources like operations so
  125520. // that the newest operation is returned first.
  125521. //
  125522. // Currently, only sorting by name or creationTimestamp desc is
  125523. // supported.
  125524. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  125525. c.urlParams_.Set("orderBy", orderBy)
  125526. return c
  125527. }
  125528. // PageToken sets the optional parameter "pageToken": Specifies a page
  125529. // token to use. Set pageToken to the nextPageToken returned by a
  125530. // previous list request to get the next page of results.
  125531. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  125532. c.urlParams_.Set("pageToken", pageToken)
  125533. return c
  125534. }
  125535. // Fields allows partial responses to be retrieved. See
  125536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125537. // for more information.
  125538. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  125539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125540. return c
  125541. }
  125542. // IfNoneMatch sets the optional parameter which makes the operation
  125543. // fail if the object's ETag matches the given value. This is useful for
  125544. // getting updates only after the object has changed since the last
  125545. // request. Use googleapi.IsNotModified to check whether the response
  125546. // error from Do is the result of In-None-Match.
  125547. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  125548. c.ifNoneMatch_ = entityTag
  125549. return c
  125550. }
  125551. // Context sets the context to be used in this call's Do method. Any
  125552. // pending HTTP request will be aborted if the provided context is
  125553. // canceled.
  125554. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  125555. c.ctx_ = ctx
  125556. return c
  125557. }
  125558. // Header returns an http.Header that can be modified by the caller to
  125559. // add HTTP headers to the request.
  125560. func (c *SslCertificatesListCall) Header() http.Header {
  125561. if c.header_ == nil {
  125562. c.header_ = make(http.Header)
  125563. }
  125564. return c.header_
  125565. }
  125566. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  125567. reqHeaders := make(http.Header)
  125568. for k, v := range c.header_ {
  125569. reqHeaders[k] = v
  125570. }
  125571. reqHeaders.Set("User-Agent", c.s.userAgent())
  125572. if c.ifNoneMatch_ != "" {
  125573. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  125574. }
  125575. var body io.Reader = nil
  125576. c.urlParams_.Set("alt", alt)
  125577. c.urlParams_.Set("prettyPrint", "false")
  125578. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  125579. urls += "?" + c.urlParams_.Encode()
  125580. req, err := http.NewRequest("GET", urls, body)
  125581. if err != nil {
  125582. return nil, err
  125583. }
  125584. req.Header = reqHeaders
  125585. googleapi.Expand(req.URL, map[string]string{
  125586. "project": c.project,
  125587. })
  125588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125589. }
  125590. // Do executes the "compute.sslCertificates.list" call.
  125591. // Exactly one of *SslCertificateList or error will be non-nil. Any
  125592. // non-2xx status code is an error. Response headers are in either
  125593. // *SslCertificateList.ServerResponse.Header or (if a response was
  125594. // returned at all) in error.(*googleapi.Error).Header. Use
  125595. // googleapi.IsNotModified to check whether the returned error was
  125596. // because http.StatusNotModified was returned.
  125597. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  125598. gensupport.SetOptions(c.urlParams_, opts...)
  125599. res, err := c.doRequest("json")
  125600. if res != nil && res.StatusCode == http.StatusNotModified {
  125601. if res.Body != nil {
  125602. res.Body.Close()
  125603. }
  125604. return nil, &googleapi.Error{
  125605. Code: res.StatusCode,
  125606. Header: res.Header,
  125607. }
  125608. }
  125609. if err != nil {
  125610. return nil, err
  125611. }
  125612. defer googleapi.CloseBody(res)
  125613. if err := googleapi.CheckResponse(res); err != nil {
  125614. return nil, err
  125615. }
  125616. ret := &SslCertificateList{
  125617. ServerResponse: googleapi.ServerResponse{
  125618. Header: res.Header,
  125619. HTTPStatusCode: res.StatusCode,
  125620. },
  125621. }
  125622. target := &ret
  125623. if err := gensupport.DecodeResponse(target, res); err != nil {
  125624. return nil, err
  125625. }
  125626. return ret, nil
  125627. // {
  125628. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  125629. // "httpMethod": "GET",
  125630. // "id": "compute.sslCertificates.list",
  125631. // "parameterOrder": [
  125632. // "project"
  125633. // ],
  125634. // "parameters": {
  125635. // "filter": {
  125636. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  125637. // "location": "query",
  125638. // "type": "string"
  125639. // },
  125640. // "maxResults": {
  125641. // "default": "500",
  125642. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  125643. // "format": "uint32",
  125644. // "location": "query",
  125645. // "minimum": "0",
  125646. // "type": "integer"
  125647. // },
  125648. // "orderBy": {
  125649. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  125650. // "location": "query",
  125651. // "type": "string"
  125652. // },
  125653. // "pageToken": {
  125654. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  125655. // "location": "query",
  125656. // "type": "string"
  125657. // },
  125658. // "project": {
  125659. // "description": "Project ID for this request.",
  125660. // "location": "path",
  125661. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125662. // "required": true,
  125663. // "type": "string"
  125664. // }
  125665. // },
  125666. // "path": "{project}/global/sslCertificates",
  125667. // "response": {
  125668. // "$ref": "SslCertificateList"
  125669. // },
  125670. // "scopes": [
  125671. // "https://www.googleapis.com/auth/cloud-platform",
  125672. // "https://www.googleapis.com/auth/compute",
  125673. // "https://www.googleapis.com/auth/compute.readonly"
  125674. // ]
  125675. // }
  125676. }
  125677. // Pages invokes f for each page of results.
  125678. // A non-nil error returned from f will halt the iteration.
  125679. // The provided context supersedes any context provided to the Context method.
  125680. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  125681. c.ctx_ = ctx
  125682. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  125683. for {
  125684. x, err := c.Do()
  125685. if err != nil {
  125686. return err
  125687. }
  125688. if err := f(x); err != nil {
  125689. return err
  125690. }
  125691. if x.NextPageToken == "" {
  125692. return nil
  125693. }
  125694. c.PageToken(x.NextPageToken)
  125695. }
  125696. }
  125697. // method id "compute.sslCertificates.testIamPermissions":
  125698. type SslCertificatesTestIamPermissionsCall struct {
  125699. s *Service
  125700. project string
  125701. resource string
  125702. testpermissionsrequest *TestPermissionsRequest
  125703. urlParams_ gensupport.URLParams
  125704. ctx_ context.Context
  125705. header_ http.Header
  125706. }
  125707. // TestIamPermissions: Returns permissions that a caller has on the
  125708. // specified resource.
  125709. func (r *SslCertificatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslCertificatesTestIamPermissionsCall {
  125710. c := &SslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125711. c.project = project
  125712. c.resource = resource
  125713. c.testpermissionsrequest = testpermissionsrequest
  125714. return c
  125715. }
  125716. // Fields allows partial responses to be retrieved. See
  125717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125718. // for more information.
  125719. func (c *SslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslCertificatesTestIamPermissionsCall {
  125720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125721. return c
  125722. }
  125723. // Context sets the context to be used in this call's Do method. Any
  125724. // pending HTTP request will be aborted if the provided context is
  125725. // canceled.
  125726. func (c *SslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *SslCertificatesTestIamPermissionsCall {
  125727. c.ctx_ = ctx
  125728. return c
  125729. }
  125730. // Header returns an http.Header that can be modified by the caller to
  125731. // add HTTP headers to the request.
  125732. func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header {
  125733. if c.header_ == nil {
  125734. c.header_ = make(http.Header)
  125735. }
  125736. return c.header_
  125737. }
  125738. func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  125739. reqHeaders := make(http.Header)
  125740. for k, v := range c.header_ {
  125741. reqHeaders[k] = v
  125742. }
  125743. reqHeaders.Set("User-Agent", c.s.userAgent())
  125744. var body io.Reader = nil
  125745. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  125746. if err != nil {
  125747. return nil, err
  125748. }
  125749. reqHeaders.Set("Content-Type", "application/json")
  125750. c.urlParams_.Set("alt", alt)
  125751. c.urlParams_.Set("prettyPrint", "false")
  125752. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{resource}/testIamPermissions")
  125753. urls += "?" + c.urlParams_.Encode()
  125754. req, err := http.NewRequest("POST", urls, body)
  125755. if err != nil {
  125756. return nil, err
  125757. }
  125758. req.Header = reqHeaders
  125759. googleapi.Expand(req.URL, map[string]string{
  125760. "project": c.project,
  125761. "resource": c.resource,
  125762. })
  125763. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125764. }
  125765. // Do executes the "compute.sslCertificates.testIamPermissions" call.
  125766. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  125767. // non-2xx status code is an error. Response headers are in either
  125768. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  125769. // returned at all) in error.(*googleapi.Error).Header. Use
  125770. // googleapi.IsNotModified to check whether the returned error was
  125771. // because http.StatusNotModified was returned.
  125772. func (c *SslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  125773. gensupport.SetOptions(c.urlParams_, opts...)
  125774. res, err := c.doRequest("json")
  125775. if res != nil && res.StatusCode == http.StatusNotModified {
  125776. if res.Body != nil {
  125777. res.Body.Close()
  125778. }
  125779. return nil, &googleapi.Error{
  125780. Code: res.StatusCode,
  125781. Header: res.Header,
  125782. }
  125783. }
  125784. if err != nil {
  125785. return nil, err
  125786. }
  125787. defer googleapi.CloseBody(res)
  125788. if err := googleapi.CheckResponse(res); err != nil {
  125789. return nil, err
  125790. }
  125791. ret := &TestPermissionsResponse{
  125792. ServerResponse: googleapi.ServerResponse{
  125793. Header: res.Header,
  125794. HTTPStatusCode: res.StatusCode,
  125795. },
  125796. }
  125797. target := &ret
  125798. if err := gensupport.DecodeResponse(target, res); err != nil {
  125799. return nil, err
  125800. }
  125801. return ret, nil
  125802. // {
  125803. // "description": "Returns permissions that a caller has on the specified resource.",
  125804. // "httpMethod": "POST",
  125805. // "id": "compute.sslCertificates.testIamPermissions",
  125806. // "parameterOrder": [
  125807. // "project",
  125808. // "resource"
  125809. // ],
  125810. // "parameters": {
  125811. // "project": {
  125812. // "description": "Project ID for this request.",
  125813. // "location": "path",
  125814. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125815. // "required": true,
  125816. // "type": "string"
  125817. // },
  125818. // "resource": {
  125819. // "description": "Name or id of the resource for this request.",
  125820. // "location": "path",
  125821. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  125822. // "required": true,
  125823. // "type": "string"
  125824. // }
  125825. // },
  125826. // "path": "{project}/global/sslCertificates/{resource}/testIamPermissions",
  125827. // "request": {
  125828. // "$ref": "TestPermissionsRequest"
  125829. // },
  125830. // "response": {
  125831. // "$ref": "TestPermissionsResponse"
  125832. // },
  125833. // "scopes": [
  125834. // "https://www.googleapis.com/auth/cloud-platform",
  125835. // "https://www.googleapis.com/auth/compute",
  125836. // "https://www.googleapis.com/auth/compute.readonly"
  125837. // ]
  125838. // }
  125839. }
  125840. // method id "compute.sslPolicies.delete":
  125841. type SslPoliciesDeleteCall struct {
  125842. s *Service
  125843. project string
  125844. sslPolicy string
  125845. urlParams_ gensupport.URLParams
  125846. ctx_ context.Context
  125847. header_ http.Header
  125848. }
  125849. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  125850. // be deleted only if it is not in use by any TargetHttpsProxy or
  125851. // TargetSslProxy resources.
  125852. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  125853. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  125854. c.project = project
  125855. c.sslPolicy = sslPolicy
  125856. return c
  125857. }
  125858. // RequestId sets the optional parameter "requestId": An optional
  125859. // request ID to identify requests. Specify a unique request ID so that
  125860. // if you must retry your request, the server will know to ignore the
  125861. // request if it has already been completed.
  125862. //
  125863. // For example, consider a situation where you make an initial request
  125864. // and the request times out. If you make the request again with the
  125865. // same request ID, the server can check if original operation with the
  125866. // same request ID was received, and if so, will ignore the second
  125867. // request. This prevents clients from accidentally creating duplicate
  125868. // commitments.
  125869. //
  125870. // The request ID must be a valid UUID with the exception that zero UUID
  125871. // is not supported (00000000-0000-0000-0000-000000000000).
  125872. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  125873. c.urlParams_.Set("requestId", requestId)
  125874. return c
  125875. }
  125876. // Fields allows partial responses to be retrieved. See
  125877. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  125878. // for more information.
  125879. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  125880. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  125881. return c
  125882. }
  125883. // Context sets the context to be used in this call's Do method. Any
  125884. // pending HTTP request will be aborted if the provided context is
  125885. // canceled.
  125886. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  125887. c.ctx_ = ctx
  125888. return c
  125889. }
  125890. // Header returns an http.Header that can be modified by the caller to
  125891. // add HTTP headers to the request.
  125892. func (c *SslPoliciesDeleteCall) Header() http.Header {
  125893. if c.header_ == nil {
  125894. c.header_ = make(http.Header)
  125895. }
  125896. return c.header_
  125897. }
  125898. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  125899. reqHeaders := make(http.Header)
  125900. for k, v := range c.header_ {
  125901. reqHeaders[k] = v
  125902. }
  125903. reqHeaders.Set("User-Agent", c.s.userAgent())
  125904. var body io.Reader = nil
  125905. c.urlParams_.Set("alt", alt)
  125906. c.urlParams_.Set("prettyPrint", "false")
  125907. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  125908. urls += "?" + c.urlParams_.Encode()
  125909. req, err := http.NewRequest("DELETE", urls, body)
  125910. if err != nil {
  125911. return nil, err
  125912. }
  125913. req.Header = reqHeaders
  125914. googleapi.Expand(req.URL, map[string]string{
  125915. "project": c.project,
  125916. "sslPolicy": c.sslPolicy,
  125917. })
  125918. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  125919. }
  125920. // Do executes the "compute.sslPolicies.delete" call.
  125921. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  125922. // status code is an error. Response headers are in either
  125923. // *Operation.ServerResponse.Header or (if a response was returned at
  125924. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  125925. // to check whether the returned error was because
  125926. // http.StatusNotModified was returned.
  125927. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  125928. gensupport.SetOptions(c.urlParams_, opts...)
  125929. res, err := c.doRequest("json")
  125930. if res != nil && res.StatusCode == http.StatusNotModified {
  125931. if res.Body != nil {
  125932. res.Body.Close()
  125933. }
  125934. return nil, &googleapi.Error{
  125935. Code: res.StatusCode,
  125936. Header: res.Header,
  125937. }
  125938. }
  125939. if err != nil {
  125940. return nil, err
  125941. }
  125942. defer googleapi.CloseBody(res)
  125943. if err := googleapi.CheckResponse(res); err != nil {
  125944. return nil, err
  125945. }
  125946. ret := &Operation{
  125947. ServerResponse: googleapi.ServerResponse{
  125948. Header: res.Header,
  125949. HTTPStatusCode: res.StatusCode,
  125950. },
  125951. }
  125952. target := &ret
  125953. if err := gensupport.DecodeResponse(target, res); err != nil {
  125954. return nil, err
  125955. }
  125956. return ret, nil
  125957. // {
  125958. // "description": "Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.",
  125959. // "httpMethod": "DELETE",
  125960. // "id": "compute.sslPolicies.delete",
  125961. // "parameterOrder": [
  125962. // "project",
  125963. // "sslPolicy"
  125964. // ],
  125965. // "parameters": {
  125966. // "project": {
  125967. // "description": "Project ID for this request.",
  125968. // "location": "path",
  125969. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  125970. // "required": true,
  125971. // "type": "string"
  125972. // },
  125973. // "requestId": {
  125974. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  125975. // "location": "query",
  125976. // "type": "string"
  125977. // },
  125978. // "sslPolicy": {
  125979. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  125980. // "location": "path",
  125981. // "required": true,
  125982. // "type": "string"
  125983. // }
  125984. // },
  125985. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  125986. // "response": {
  125987. // "$ref": "Operation"
  125988. // },
  125989. // "scopes": [
  125990. // "https://www.googleapis.com/auth/cloud-platform",
  125991. // "https://www.googleapis.com/auth/compute"
  125992. // ]
  125993. // }
  125994. }
  125995. // method id "compute.sslPolicies.get":
  125996. type SslPoliciesGetCall struct {
  125997. s *Service
  125998. project string
  125999. sslPolicy string
  126000. urlParams_ gensupport.URLParams
  126001. ifNoneMatch_ string
  126002. ctx_ context.Context
  126003. header_ http.Header
  126004. }
  126005. // Get: Lists all of the ordered rules present in a single specified
  126006. // policy.
  126007. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  126008. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126009. c.project = project
  126010. c.sslPolicy = sslPolicy
  126011. return c
  126012. }
  126013. // Fields allows partial responses to be retrieved. See
  126014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126015. // for more information.
  126016. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  126017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126018. return c
  126019. }
  126020. // IfNoneMatch sets the optional parameter which makes the operation
  126021. // fail if the object's ETag matches the given value. This is useful for
  126022. // getting updates only after the object has changed since the last
  126023. // request. Use googleapi.IsNotModified to check whether the response
  126024. // error from Do is the result of In-None-Match.
  126025. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  126026. c.ifNoneMatch_ = entityTag
  126027. return c
  126028. }
  126029. // Context sets the context to be used in this call's Do method. Any
  126030. // pending HTTP request will be aborted if the provided context is
  126031. // canceled.
  126032. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  126033. c.ctx_ = ctx
  126034. return c
  126035. }
  126036. // Header returns an http.Header that can be modified by the caller to
  126037. // add HTTP headers to the request.
  126038. func (c *SslPoliciesGetCall) Header() http.Header {
  126039. if c.header_ == nil {
  126040. c.header_ = make(http.Header)
  126041. }
  126042. return c.header_
  126043. }
  126044. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  126045. reqHeaders := make(http.Header)
  126046. for k, v := range c.header_ {
  126047. reqHeaders[k] = v
  126048. }
  126049. reqHeaders.Set("User-Agent", c.s.userAgent())
  126050. if c.ifNoneMatch_ != "" {
  126051. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  126052. }
  126053. var body io.Reader = nil
  126054. c.urlParams_.Set("alt", alt)
  126055. c.urlParams_.Set("prettyPrint", "false")
  126056. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  126057. urls += "?" + c.urlParams_.Encode()
  126058. req, err := http.NewRequest("GET", urls, body)
  126059. if err != nil {
  126060. return nil, err
  126061. }
  126062. req.Header = reqHeaders
  126063. googleapi.Expand(req.URL, map[string]string{
  126064. "project": c.project,
  126065. "sslPolicy": c.sslPolicy,
  126066. })
  126067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126068. }
  126069. // Do executes the "compute.sslPolicies.get" call.
  126070. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  126071. // status code is an error. Response headers are in either
  126072. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  126073. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126074. // to check whether the returned error was because
  126075. // http.StatusNotModified was returned.
  126076. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  126077. gensupport.SetOptions(c.urlParams_, opts...)
  126078. res, err := c.doRequest("json")
  126079. if res != nil && res.StatusCode == http.StatusNotModified {
  126080. if res.Body != nil {
  126081. res.Body.Close()
  126082. }
  126083. return nil, &googleapi.Error{
  126084. Code: res.StatusCode,
  126085. Header: res.Header,
  126086. }
  126087. }
  126088. if err != nil {
  126089. return nil, err
  126090. }
  126091. defer googleapi.CloseBody(res)
  126092. if err := googleapi.CheckResponse(res); err != nil {
  126093. return nil, err
  126094. }
  126095. ret := &SslPolicy{
  126096. ServerResponse: googleapi.ServerResponse{
  126097. Header: res.Header,
  126098. HTTPStatusCode: res.StatusCode,
  126099. },
  126100. }
  126101. target := &ret
  126102. if err := gensupport.DecodeResponse(target, res); err != nil {
  126103. return nil, err
  126104. }
  126105. return ret, nil
  126106. // {
  126107. // "description": "Lists all of the ordered rules present in a single specified policy.",
  126108. // "httpMethod": "GET",
  126109. // "id": "compute.sslPolicies.get",
  126110. // "parameterOrder": [
  126111. // "project",
  126112. // "sslPolicy"
  126113. // ],
  126114. // "parameters": {
  126115. // "project": {
  126116. // "description": "Project ID for this request.",
  126117. // "location": "path",
  126118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126119. // "required": true,
  126120. // "type": "string"
  126121. // },
  126122. // "sslPolicy": {
  126123. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  126124. // "location": "path",
  126125. // "required": true,
  126126. // "type": "string"
  126127. // }
  126128. // },
  126129. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  126130. // "response": {
  126131. // "$ref": "SslPolicy"
  126132. // },
  126133. // "scopes": [
  126134. // "https://www.googleapis.com/auth/cloud-platform",
  126135. // "https://www.googleapis.com/auth/compute",
  126136. // "https://www.googleapis.com/auth/compute.readonly"
  126137. // ]
  126138. // }
  126139. }
  126140. // method id "compute.sslPolicies.insert":
  126141. type SslPoliciesInsertCall struct {
  126142. s *Service
  126143. project string
  126144. sslpolicy *SslPolicy
  126145. urlParams_ gensupport.URLParams
  126146. ctx_ context.Context
  126147. header_ http.Header
  126148. }
  126149. // Insert: Returns the specified SSL policy resource. Gets a list of
  126150. // available SSL policies by making a list() request.
  126151. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  126152. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126153. c.project = project
  126154. c.sslpolicy = sslpolicy
  126155. return c
  126156. }
  126157. // RequestId sets the optional parameter "requestId": An optional
  126158. // request ID to identify requests. Specify a unique request ID so that
  126159. // if you must retry your request, the server will know to ignore the
  126160. // request if it has already been completed.
  126161. //
  126162. // For example, consider a situation where you make an initial request
  126163. // and the request times out. If you make the request again with the
  126164. // same request ID, the server can check if original operation with the
  126165. // same request ID was received, and if so, will ignore the second
  126166. // request. This prevents clients from accidentally creating duplicate
  126167. // commitments.
  126168. //
  126169. // The request ID must be a valid UUID with the exception that zero UUID
  126170. // is not supported (00000000-0000-0000-0000-000000000000).
  126171. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  126172. c.urlParams_.Set("requestId", requestId)
  126173. return c
  126174. }
  126175. // Fields allows partial responses to be retrieved. See
  126176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126177. // for more information.
  126178. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  126179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126180. return c
  126181. }
  126182. // Context sets the context to be used in this call's Do method. Any
  126183. // pending HTTP request will be aborted if the provided context is
  126184. // canceled.
  126185. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  126186. c.ctx_ = ctx
  126187. return c
  126188. }
  126189. // Header returns an http.Header that can be modified by the caller to
  126190. // add HTTP headers to the request.
  126191. func (c *SslPoliciesInsertCall) Header() http.Header {
  126192. if c.header_ == nil {
  126193. c.header_ = make(http.Header)
  126194. }
  126195. return c.header_
  126196. }
  126197. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  126198. reqHeaders := make(http.Header)
  126199. for k, v := range c.header_ {
  126200. reqHeaders[k] = v
  126201. }
  126202. reqHeaders.Set("User-Agent", c.s.userAgent())
  126203. var body io.Reader = nil
  126204. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  126205. if err != nil {
  126206. return nil, err
  126207. }
  126208. reqHeaders.Set("Content-Type", "application/json")
  126209. c.urlParams_.Set("alt", alt)
  126210. c.urlParams_.Set("prettyPrint", "false")
  126211. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  126212. urls += "?" + c.urlParams_.Encode()
  126213. req, err := http.NewRequest("POST", urls, body)
  126214. if err != nil {
  126215. return nil, err
  126216. }
  126217. req.Header = reqHeaders
  126218. googleapi.Expand(req.URL, map[string]string{
  126219. "project": c.project,
  126220. })
  126221. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126222. }
  126223. // Do executes the "compute.sslPolicies.insert" call.
  126224. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126225. // status code is an error. Response headers are in either
  126226. // *Operation.ServerResponse.Header or (if a response was returned at
  126227. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126228. // to check whether the returned error was because
  126229. // http.StatusNotModified was returned.
  126230. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126231. gensupport.SetOptions(c.urlParams_, opts...)
  126232. res, err := c.doRequest("json")
  126233. if res != nil && res.StatusCode == http.StatusNotModified {
  126234. if res.Body != nil {
  126235. res.Body.Close()
  126236. }
  126237. return nil, &googleapi.Error{
  126238. Code: res.StatusCode,
  126239. Header: res.Header,
  126240. }
  126241. }
  126242. if err != nil {
  126243. return nil, err
  126244. }
  126245. defer googleapi.CloseBody(res)
  126246. if err := googleapi.CheckResponse(res); err != nil {
  126247. return nil, err
  126248. }
  126249. ret := &Operation{
  126250. ServerResponse: googleapi.ServerResponse{
  126251. Header: res.Header,
  126252. HTTPStatusCode: res.StatusCode,
  126253. },
  126254. }
  126255. target := &ret
  126256. if err := gensupport.DecodeResponse(target, res); err != nil {
  126257. return nil, err
  126258. }
  126259. return ret, nil
  126260. // {
  126261. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  126262. // "httpMethod": "POST",
  126263. // "id": "compute.sslPolicies.insert",
  126264. // "parameterOrder": [
  126265. // "project"
  126266. // ],
  126267. // "parameters": {
  126268. // "project": {
  126269. // "description": "Project ID for this request.",
  126270. // "location": "path",
  126271. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126272. // "required": true,
  126273. // "type": "string"
  126274. // },
  126275. // "requestId": {
  126276. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  126277. // "location": "query",
  126278. // "type": "string"
  126279. // }
  126280. // },
  126281. // "path": "{project}/global/sslPolicies",
  126282. // "request": {
  126283. // "$ref": "SslPolicy"
  126284. // },
  126285. // "response": {
  126286. // "$ref": "Operation"
  126287. // },
  126288. // "scopes": [
  126289. // "https://www.googleapis.com/auth/cloud-platform",
  126290. // "https://www.googleapis.com/auth/compute"
  126291. // ]
  126292. // }
  126293. }
  126294. // method id "compute.sslPolicies.list":
  126295. type SslPoliciesListCall struct {
  126296. s *Service
  126297. project string
  126298. urlParams_ gensupport.URLParams
  126299. ifNoneMatch_ string
  126300. ctx_ context.Context
  126301. header_ http.Header
  126302. }
  126303. // List: Lists all the SSL policies that have been configured for the
  126304. // specified project.
  126305. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  126306. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126307. c.project = project
  126308. return c
  126309. }
  126310. // Filter sets the optional parameter "filter": A filter expression that
  126311. // filters resources listed in the response. The expression must specify
  126312. // the field name, a comparison operator, and the value that you want to
  126313. // use for filtering. The value must be a string, a number, or a
  126314. // boolean. The comparison operator must be either =, !=, >, or <.
  126315. //
  126316. // For example, if you are filtering Compute Engine instances, you can
  126317. // exclude instances named example-instance by specifying name !=
  126318. // example-instance.
  126319. //
  126320. // You can also filter nested fields. For example, you could specify
  126321. // scheduling.automaticRestart = false to include instances only if they
  126322. // are not scheduled for automatic restarts. You can use filtering on
  126323. // nested fields to filter based on resource labels.
  126324. //
  126325. // To filter on multiple expressions, provide each separate expression
  126326. // within parentheses. For example, (scheduling.automaticRestart = true)
  126327. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  126328. // AND expression. However, you can include AND and OR expressions
  126329. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  126330. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  126331. // true).
  126332. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  126333. c.urlParams_.Set("filter", filter)
  126334. return c
  126335. }
  126336. // MaxResults sets the optional parameter "maxResults": The maximum
  126337. // number of results per page that should be returned. If the number of
  126338. // available results is larger than maxResults, Compute Engine returns a
  126339. // nextPageToken that can be used to get the next page of results in
  126340. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  126341. // (Default: 500)
  126342. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  126343. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  126344. return c
  126345. }
  126346. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  126347. // a certain order. By default, results are returned in alphanumerical
  126348. // order based on the resource name.
  126349. //
  126350. // You can also sort results in descending order based on the creation
  126351. // timestamp using orderBy="creationTimestamp desc". This sorts results
  126352. // based on the creationTimestamp field in reverse chronological order
  126353. // (newest result first). Use this to sort resources like operations so
  126354. // that the newest operation is returned first.
  126355. //
  126356. // Currently, only sorting by name or creationTimestamp desc is
  126357. // supported.
  126358. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  126359. c.urlParams_.Set("orderBy", orderBy)
  126360. return c
  126361. }
  126362. // PageToken sets the optional parameter "pageToken": Specifies a page
  126363. // token to use. Set pageToken to the nextPageToken returned by a
  126364. // previous list request to get the next page of results.
  126365. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  126366. c.urlParams_.Set("pageToken", pageToken)
  126367. return c
  126368. }
  126369. // Fields allows partial responses to be retrieved. See
  126370. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126371. // for more information.
  126372. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  126373. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126374. return c
  126375. }
  126376. // IfNoneMatch sets the optional parameter which makes the operation
  126377. // fail if the object's ETag matches the given value. This is useful for
  126378. // getting updates only after the object has changed since the last
  126379. // request. Use googleapi.IsNotModified to check whether the response
  126380. // error from Do is the result of In-None-Match.
  126381. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  126382. c.ifNoneMatch_ = entityTag
  126383. return c
  126384. }
  126385. // Context sets the context to be used in this call's Do method. Any
  126386. // pending HTTP request will be aborted if the provided context is
  126387. // canceled.
  126388. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  126389. c.ctx_ = ctx
  126390. return c
  126391. }
  126392. // Header returns an http.Header that can be modified by the caller to
  126393. // add HTTP headers to the request.
  126394. func (c *SslPoliciesListCall) Header() http.Header {
  126395. if c.header_ == nil {
  126396. c.header_ = make(http.Header)
  126397. }
  126398. return c.header_
  126399. }
  126400. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  126401. reqHeaders := make(http.Header)
  126402. for k, v := range c.header_ {
  126403. reqHeaders[k] = v
  126404. }
  126405. reqHeaders.Set("User-Agent", c.s.userAgent())
  126406. if c.ifNoneMatch_ != "" {
  126407. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  126408. }
  126409. var body io.Reader = nil
  126410. c.urlParams_.Set("alt", alt)
  126411. c.urlParams_.Set("prettyPrint", "false")
  126412. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  126413. urls += "?" + c.urlParams_.Encode()
  126414. req, err := http.NewRequest("GET", urls, body)
  126415. if err != nil {
  126416. return nil, err
  126417. }
  126418. req.Header = reqHeaders
  126419. googleapi.Expand(req.URL, map[string]string{
  126420. "project": c.project,
  126421. })
  126422. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126423. }
  126424. // Do executes the "compute.sslPolicies.list" call.
  126425. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  126426. // status code is an error. Response headers are in either
  126427. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  126428. // at all) in error.(*googleapi.Error).Header. Use
  126429. // googleapi.IsNotModified to check whether the returned error was
  126430. // because http.StatusNotModified was returned.
  126431. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  126432. gensupport.SetOptions(c.urlParams_, opts...)
  126433. res, err := c.doRequest("json")
  126434. if res != nil && res.StatusCode == http.StatusNotModified {
  126435. if res.Body != nil {
  126436. res.Body.Close()
  126437. }
  126438. return nil, &googleapi.Error{
  126439. Code: res.StatusCode,
  126440. Header: res.Header,
  126441. }
  126442. }
  126443. if err != nil {
  126444. return nil, err
  126445. }
  126446. defer googleapi.CloseBody(res)
  126447. if err := googleapi.CheckResponse(res); err != nil {
  126448. return nil, err
  126449. }
  126450. ret := &SslPoliciesList{
  126451. ServerResponse: googleapi.ServerResponse{
  126452. Header: res.Header,
  126453. HTTPStatusCode: res.StatusCode,
  126454. },
  126455. }
  126456. target := &ret
  126457. if err := gensupport.DecodeResponse(target, res); err != nil {
  126458. return nil, err
  126459. }
  126460. return ret, nil
  126461. // {
  126462. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  126463. // "httpMethod": "GET",
  126464. // "id": "compute.sslPolicies.list",
  126465. // "parameterOrder": [
  126466. // "project"
  126467. // ],
  126468. // "parameters": {
  126469. // "filter": {
  126470. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  126471. // "location": "query",
  126472. // "type": "string"
  126473. // },
  126474. // "maxResults": {
  126475. // "default": "500",
  126476. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  126477. // "format": "uint32",
  126478. // "location": "query",
  126479. // "minimum": "0",
  126480. // "type": "integer"
  126481. // },
  126482. // "orderBy": {
  126483. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  126484. // "location": "query",
  126485. // "type": "string"
  126486. // },
  126487. // "pageToken": {
  126488. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  126489. // "location": "query",
  126490. // "type": "string"
  126491. // },
  126492. // "project": {
  126493. // "description": "Project ID for this request.",
  126494. // "location": "path",
  126495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126496. // "required": true,
  126497. // "type": "string"
  126498. // }
  126499. // },
  126500. // "path": "{project}/global/sslPolicies",
  126501. // "response": {
  126502. // "$ref": "SslPoliciesList"
  126503. // },
  126504. // "scopes": [
  126505. // "https://www.googleapis.com/auth/cloud-platform",
  126506. // "https://www.googleapis.com/auth/compute",
  126507. // "https://www.googleapis.com/auth/compute.readonly"
  126508. // ]
  126509. // }
  126510. }
  126511. // Pages invokes f for each page of results.
  126512. // A non-nil error returned from f will halt the iteration.
  126513. // The provided context supersedes any context provided to the Context method.
  126514. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  126515. c.ctx_ = ctx
  126516. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  126517. for {
  126518. x, err := c.Do()
  126519. if err != nil {
  126520. return err
  126521. }
  126522. if err := f(x); err != nil {
  126523. return err
  126524. }
  126525. if x.NextPageToken == "" {
  126526. return nil
  126527. }
  126528. c.PageToken(x.NextPageToken)
  126529. }
  126530. }
  126531. // method id "compute.sslPolicies.listAvailableFeatures":
  126532. type SslPoliciesListAvailableFeaturesCall struct {
  126533. s *Service
  126534. project string
  126535. urlParams_ gensupport.URLParams
  126536. ifNoneMatch_ string
  126537. ctx_ context.Context
  126538. header_ http.Header
  126539. }
  126540. // ListAvailableFeatures: Lists all features that can be specified in
  126541. // the SSL policy when using custom profile.
  126542. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  126543. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126544. c.project = project
  126545. return c
  126546. }
  126547. // Filter sets the optional parameter "filter": A filter expression that
  126548. // filters resources listed in the response. The expression must specify
  126549. // the field name, a comparison operator, and the value that you want to
  126550. // use for filtering. The value must be a string, a number, or a
  126551. // boolean. The comparison operator must be either =, !=, >, or <.
  126552. //
  126553. // For example, if you are filtering Compute Engine instances, you can
  126554. // exclude instances named example-instance by specifying name !=
  126555. // example-instance.
  126556. //
  126557. // You can also filter nested fields. For example, you could specify
  126558. // scheduling.automaticRestart = false to include instances only if they
  126559. // are not scheduled for automatic restarts. You can use filtering on
  126560. // nested fields to filter based on resource labels.
  126561. //
  126562. // To filter on multiple expressions, provide each separate expression
  126563. // within parentheses. For example, (scheduling.automaticRestart = true)
  126564. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  126565. // AND expression. However, you can include AND and OR expressions
  126566. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  126567. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  126568. // true).
  126569. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  126570. c.urlParams_.Set("filter", filter)
  126571. return c
  126572. }
  126573. // MaxResults sets the optional parameter "maxResults": The maximum
  126574. // number of results per page that should be returned. If the number of
  126575. // available results is larger than maxResults, Compute Engine returns a
  126576. // nextPageToken that can be used to get the next page of results in
  126577. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  126578. // (Default: 500)
  126579. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  126580. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  126581. return c
  126582. }
  126583. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  126584. // a certain order. By default, results are returned in alphanumerical
  126585. // order based on the resource name.
  126586. //
  126587. // You can also sort results in descending order based on the creation
  126588. // timestamp using orderBy="creationTimestamp desc". This sorts results
  126589. // based on the creationTimestamp field in reverse chronological order
  126590. // (newest result first). Use this to sort resources like operations so
  126591. // that the newest operation is returned first.
  126592. //
  126593. // Currently, only sorting by name or creationTimestamp desc is
  126594. // supported.
  126595. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  126596. c.urlParams_.Set("orderBy", orderBy)
  126597. return c
  126598. }
  126599. // PageToken sets the optional parameter "pageToken": Specifies a page
  126600. // token to use. Set pageToken to the nextPageToken returned by a
  126601. // previous list request to get the next page of results.
  126602. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  126603. c.urlParams_.Set("pageToken", pageToken)
  126604. return c
  126605. }
  126606. // Fields allows partial responses to be retrieved. See
  126607. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126608. // for more information.
  126609. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  126610. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126611. return c
  126612. }
  126613. // IfNoneMatch sets the optional parameter which makes the operation
  126614. // fail if the object's ETag matches the given value. This is useful for
  126615. // getting updates only after the object has changed since the last
  126616. // request. Use googleapi.IsNotModified to check whether the response
  126617. // error from Do is the result of In-None-Match.
  126618. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  126619. c.ifNoneMatch_ = entityTag
  126620. return c
  126621. }
  126622. // Context sets the context to be used in this call's Do method. Any
  126623. // pending HTTP request will be aborted if the provided context is
  126624. // canceled.
  126625. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  126626. c.ctx_ = ctx
  126627. return c
  126628. }
  126629. // Header returns an http.Header that can be modified by the caller to
  126630. // add HTTP headers to the request.
  126631. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  126632. if c.header_ == nil {
  126633. c.header_ = make(http.Header)
  126634. }
  126635. return c.header_
  126636. }
  126637. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  126638. reqHeaders := make(http.Header)
  126639. for k, v := range c.header_ {
  126640. reqHeaders[k] = v
  126641. }
  126642. reqHeaders.Set("User-Agent", c.s.userAgent())
  126643. if c.ifNoneMatch_ != "" {
  126644. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  126645. }
  126646. var body io.Reader = nil
  126647. c.urlParams_.Set("alt", alt)
  126648. c.urlParams_.Set("prettyPrint", "false")
  126649. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  126650. urls += "?" + c.urlParams_.Encode()
  126651. req, err := http.NewRequest("GET", urls, body)
  126652. if err != nil {
  126653. return nil, err
  126654. }
  126655. req.Header = reqHeaders
  126656. googleapi.Expand(req.URL, map[string]string{
  126657. "project": c.project,
  126658. })
  126659. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126660. }
  126661. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  126662. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  126663. // will be non-nil. Any non-2xx status code is an error. Response
  126664. // headers are in either
  126665. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  126666. // (if a response was returned at all) in
  126667. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  126668. // whether the returned error was because http.StatusNotModified was
  126669. // returned.
  126670. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  126671. gensupport.SetOptions(c.urlParams_, opts...)
  126672. res, err := c.doRequest("json")
  126673. if res != nil && res.StatusCode == http.StatusNotModified {
  126674. if res.Body != nil {
  126675. res.Body.Close()
  126676. }
  126677. return nil, &googleapi.Error{
  126678. Code: res.StatusCode,
  126679. Header: res.Header,
  126680. }
  126681. }
  126682. if err != nil {
  126683. return nil, err
  126684. }
  126685. defer googleapi.CloseBody(res)
  126686. if err := googleapi.CheckResponse(res); err != nil {
  126687. return nil, err
  126688. }
  126689. ret := &SslPoliciesListAvailableFeaturesResponse{
  126690. ServerResponse: googleapi.ServerResponse{
  126691. Header: res.Header,
  126692. HTTPStatusCode: res.StatusCode,
  126693. },
  126694. }
  126695. target := &ret
  126696. if err := gensupport.DecodeResponse(target, res); err != nil {
  126697. return nil, err
  126698. }
  126699. return ret, nil
  126700. // {
  126701. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  126702. // "httpMethod": "GET",
  126703. // "id": "compute.sslPolicies.listAvailableFeatures",
  126704. // "parameterOrder": [
  126705. // "project"
  126706. // ],
  126707. // "parameters": {
  126708. // "filter": {
  126709. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  126710. // "location": "query",
  126711. // "type": "string"
  126712. // },
  126713. // "maxResults": {
  126714. // "default": "500",
  126715. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  126716. // "format": "uint32",
  126717. // "location": "query",
  126718. // "minimum": "0",
  126719. // "type": "integer"
  126720. // },
  126721. // "orderBy": {
  126722. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  126723. // "location": "query",
  126724. // "type": "string"
  126725. // },
  126726. // "pageToken": {
  126727. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  126728. // "location": "query",
  126729. // "type": "string"
  126730. // },
  126731. // "project": {
  126732. // "description": "Project ID for this request.",
  126733. // "location": "path",
  126734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126735. // "required": true,
  126736. // "type": "string"
  126737. // }
  126738. // },
  126739. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  126740. // "response": {
  126741. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  126742. // },
  126743. // "scopes": [
  126744. // "https://www.googleapis.com/auth/cloud-platform",
  126745. // "https://www.googleapis.com/auth/compute",
  126746. // "https://www.googleapis.com/auth/compute.readonly"
  126747. // ]
  126748. // }
  126749. }
  126750. // method id "compute.sslPolicies.patch":
  126751. type SslPoliciesPatchCall struct {
  126752. s *Service
  126753. project string
  126754. sslPolicy string
  126755. sslpolicy *SslPolicy
  126756. urlParams_ gensupport.URLParams
  126757. ctx_ context.Context
  126758. header_ http.Header
  126759. }
  126760. // Patch: Patches the specified SSL policy with the data included in the
  126761. // request.
  126762. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  126763. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126764. c.project = project
  126765. c.sslPolicy = sslPolicy
  126766. c.sslpolicy = sslpolicy
  126767. return c
  126768. }
  126769. // RequestId sets the optional parameter "requestId": An optional
  126770. // request ID to identify requests. Specify a unique request ID so that
  126771. // if you must retry your request, the server will know to ignore the
  126772. // request if it has already been completed.
  126773. //
  126774. // For example, consider a situation where you make an initial request
  126775. // and the request times out. If you make the request again with the
  126776. // same request ID, the server can check if original operation with the
  126777. // same request ID was received, and if so, will ignore the second
  126778. // request. This prevents clients from accidentally creating duplicate
  126779. // commitments.
  126780. //
  126781. // The request ID must be a valid UUID with the exception that zero UUID
  126782. // is not supported (00000000-0000-0000-0000-000000000000).
  126783. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  126784. c.urlParams_.Set("requestId", requestId)
  126785. return c
  126786. }
  126787. // Fields allows partial responses to be retrieved. See
  126788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126789. // for more information.
  126790. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  126791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126792. return c
  126793. }
  126794. // Context sets the context to be used in this call's Do method. Any
  126795. // pending HTTP request will be aborted if the provided context is
  126796. // canceled.
  126797. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  126798. c.ctx_ = ctx
  126799. return c
  126800. }
  126801. // Header returns an http.Header that can be modified by the caller to
  126802. // add HTTP headers to the request.
  126803. func (c *SslPoliciesPatchCall) Header() http.Header {
  126804. if c.header_ == nil {
  126805. c.header_ = make(http.Header)
  126806. }
  126807. return c.header_
  126808. }
  126809. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  126810. reqHeaders := make(http.Header)
  126811. for k, v := range c.header_ {
  126812. reqHeaders[k] = v
  126813. }
  126814. reqHeaders.Set("User-Agent", c.s.userAgent())
  126815. var body io.Reader = nil
  126816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  126817. if err != nil {
  126818. return nil, err
  126819. }
  126820. reqHeaders.Set("Content-Type", "application/json")
  126821. c.urlParams_.Set("alt", alt)
  126822. c.urlParams_.Set("prettyPrint", "false")
  126823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  126824. urls += "?" + c.urlParams_.Encode()
  126825. req, err := http.NewRequest("PATCH", urls, body)
  126826. if err != nil {
  126827. return nil, err
  126828. }
  126829. req.Header = reqHeaders
  126830. googleapi.Expand(req.URL, map[string]string{
  126831. "project": c.project,
  126832. "sslPolicy": c.sslPolicy,
  126833. })
  126834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126835. }
  126836. // Do executes the "compute.sslPolicies.patch" call.
  126837. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  126838. // status code is an error. Response headers are in either
  126839. // *Operation.ServerResponse.Header or (if a response was returned at
  126840. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  126841. // to check whether the returned error was because
  126842. // http.StatusNotModified was returned.
  126843. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  126844. gensupport.SetOptions(c.urlParams_, opts...)
  126845. res, err := c.doRequest("json")
  126846. if res != nil && res.StatusCode == http.StatusNotModified {
  126847. if res.Body != nil {
  126848. res.Body.Close()
  126849. }
  126850. return nil, &googleapi.Error{
  126851. Code: res.StatusCode,
  126852. Header: res.Header,
  126853. }
  126854. }
  126855. if err != nil {
  126856. return nil, err
  126857. }
  126858. defer googleapi.CloseBody(res)
  126859. if err := googleapi.CheckResponse(res); err != nil {
  126860. return nil, err
  126861. }
  126862. ret := &Operation{
  126863. ServerResponse: googleapi.ServerResponse{
  126864. Header: res.Header,
  126865. HTTPStatusCode: res.StatusCode,
  126866. },
  126867. }
  126868. target := &ret
  126869. if err := gensupport.DecodeResponse(target, res); err != nil {
  126870. return nil, err
  126871. }
  126872. return ret, nil
  126873. // {
  126874. // "description": "Patches the specified SSL policy with the data included in the request.",
  126875. // "httpMethod": "PATCH",
  126876. // "id": "compute.sslPolicies.patch",
  126877. // "parameterOrder": [
  126878. // "project",
  126879. // "sslPolicy"
  126880. // ],
  126881. // "parameters": {
  126882. // "project": {
  126883. // "description": "Project ID for this request.",
  126884. // "location": "path",
  126885. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  126886. // "required": true,
  126887. // "type": "string"
  126888. // },
  126889. // "requestId": {
  126890. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  126891. // "location": "query",
  126892. // "type": "string"
  126893. // },
  126894. // "sslPolicy": {
  126895. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  126896. // "location": "path",
  126897. // "required": true,
  126898. // "type": "string"
  126899. // }
  126900. // },
  126901. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  126902. // "request": {
  126903. // "$ref": "SslPolicy"
  126904. // },
  126905. // "response": {
  126906. // "$ref": "Operation"
  126907. // },
  126908. // "scopes": [
  126909. // "https://www.googleapis.com/auth/cloud-platform",
  126910. // "https://www.googleapis.com/auth/compute"
  126911. // ]
  126912. // }
  126913. }
  126914. // method id "compute.sslPolicies.testIamPermissions":
  126915. type SslPoliciesTestIamPermissionsCall struct {
  126916. s *Service
  126917. project string
  126918. resource string
  126919. testpermissionsrequest *TestPermissionsRequest
  126920. urlParams_ gensupport.URLParams
  126921. ctx_ context.Context
  126922. header_ http.Header
  126923. }
  126924. // TestIamPermissions: Returns permissions that a caller has on the
  126925. // specified resource.
  126926. func (r *SslPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslPoliciesTestIamPermissionsCall {
  126927. c := &SslPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  126928. c.project = project
  126929. c.resource = resource
  126930. c.testpermissionsrequest = testpermissionsrequest
  126931. return c
  126932. }
  126933. // Fields allows partial responses to be retrieved. See
  126934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  126935. // for more information.
  126936. func (c *SslPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslPoliciesTestIamPermissionsCall {
  126937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  126938. return c
  126939. }
  126940. // Context sets the context to be used in this call's Do method. Any
  126941. // pending HTTP request will be aborted if the provided context is
  126942. // canceled.
  126943. func (c *SslPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SslPoliciesTestIamPermissionsCall {
  126944. c.ctx_ = ctx
  126945. return c
  126946. }
  126947. // Header returns an http.Header that can be modified by the caller to
  126948. // add HTTP headers to the request.
  126949. func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header {
  126950. if c.header_ == nil {
  126951. c.header_ = make(http.Header)
  126952. }
  126953. return c.header_
  126954. }
  126955. func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  126956. reqHeaders := make(http.Header)
  126957. for k, v := range c.header_ {
  126958. reqHeaders[k] = v
  126959. }
  126960. reqHeaders.Set("User-Agent", c.s.userAgent())
  126961. var body io.Reader = nil
  126962. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  126963. if err != nil {
  126964. return nil, err
  126965. }
  126966. reqHeaders.Set("Content-Type", "application/json")
  126967. c.urlParams_.Set("alt", alt)
  126968. c.urlParams_.Set("prettyPrint", "false")
  126969. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{resource}/testIamPermissions")
  126970. urls += "?" + c.urlParams_.Encode()
  126971. req, err := http.NewRequest("POST", urls, body)
  126972. if err != nil {
  126973. return nil, err
  126974. }
  126975. req.Header = reqHeaders
  126976. googleapi.Expand(req.URL, map[string]string{
  126977. "project": c.project,
  126978. "resource": c.resource,
  126979. })
  126980. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  126981. }
  126982. // Do executes the "compute.sslPolicies.testIamPermissions" call.
  126983. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  126984. // non-2xx status code is an error. Response headers are in either
  126985. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  126986. // returned at all) in error.(*googleapi.Error).Header. Use
  126987. // googleapi.IsNotModified to check whether the returned error was
  126988. // because http.StatusNotModified was returned.
  126989. func (c *SslPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  126990. gensupport.SetOptions(c.urlParams_, opts...)
  126991. res, err := c.doRequest("json")
  126992. if res != nil && res.StatusCode == http.StatusNotModified {
  126993. if res.Body != nil {
  126994. res.Body.Close()
  126995. }
  126996. return nil, &googleapi.Error{
  126997. Code: res.StatusCode,
  126998. Header: res.Header,
  126999. }
  127000. }
  127001. if err != nil {
  127002. return nil, err
  127003. }
  127004. defer googleapi.CloseBody(res)
  127005. if err := googleapi.CheckResponse(res); err != nil {
  127006. return nil, err
  127007. }
  127008. ret := &TestPermissionsResponse{
  127009. ServerResponse: googleapi.ServerResponse{
  127010. Header: res.Header,
  127011. HTTPStatusCode: res.StatusCode,
  127012. },
  127013. }
  127014. target := &ret
  127015. if err := gensupport.DecodeResponse(target, res); err != nil {
  127016. return nil, err
  127017. }
  127018. return ret, nil
  127019. // {
  127020. // "description": "Returns permissions that a caller has on the specified resource.",
  127021. // "httpMethod": "POST",
  127022. // "id": "compute.sslPolicies.testIamPermissions",
  127023. // "parameterOrder": [
  127024. // "project",
  127025. // "resource"
  127026. // ],
  127027. // "parameters": {
  127028. // "project": {
  127029. // "description": "Project ID for this request.",
  127030. // "location": "path",
  127031. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127032. // "required": true,
  127033. // "type": "string"
  127034. // },
  127035. // "resource": {
  127036. // "description": "Name or id of the resource for this request.",
  127037. // "location": "path",
  127038. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127039. // "required": true,
  127040. // "type": "string"
  127041. // }
  127042. // },
  127043. // "path": "{project}/global/sslPolicies/{resource}/testIamPermissions",
  127044. // "request": {
  127045. // "$ref": "TestPermissionsRequest"
  127046. // },
  127047. // "response": {
  127048. // "$ref": "TestPermissionsResponse"
  127049. // },
  127050. // "scopes": [
  127051. // "https://www.googleapis.com/auth/cloud-platform",
  127052. // "https://www.googleapis.com/auth/compute",
  127053. // "https://www.googleapis.com/auth/compute.readonly"
  127054. // ]
  127055. // }
  127056. }
  127057. // method id "compute.subnetworks.aggregatedList":
  127058. type SubnetworksAggregatedListCall struct {
  127059. s *Service
  127060. project string
  127061. urlParams_ gensupport.URLParams
  127062. ifNoneMatch_ string
  127063. ctx_ context.Context
  127064. header_ http.Header
  127065. }
  127066. // AggregatedList: Retrieves an aggregated list of subnetworks.
  127067. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  127068. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127069. c.project = project
  127070. return c
  127071. }
  127072. // Filter sets the optional parameter "filter": A filter expression that
  127073. // filters resources listed in the response. The expression must specify
  127074. // the field name, a comparison operator, and the value that you want to
  127075. // use for filtering. The value must be a string, a number, or a
  127076. // boolean. The comparison operator must be either =, !=, >, or <.
  127077. //
  127078. // For example, if you are filtering Compute Engine instances, you can
  127079. // exclude instances named example-instance by specifying name !=
  127080. // example-instance.
  127081. //
  127082. // You can also filter nested fields. For example, you could specify
  127083. // scheduling.automaticRestart = false to include instances only if they
  127084. // are not scheduled for automatic restarts. You can use filtering on
  127085. // nested fields to filter based on resource labels.
  127086. //
  127087. // To filter on multiple expressions, provide each separate expression
  127088. // within parentheses. For example, (scheduling.automaticRestart = true)
  127089. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  127090. // AND expression. However, you can include AND and OR expressions
  127091. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  127092. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  127093. // true).
  127094. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  127095. c.urlParams_.Set("filter", filter)
  127096. return c
  127097. }
  127098. // MaxResults sets the optional parameter "maxResults": The maximum
  127099. // number of results per page that should be returned. If the number of
  127100. // available results is larger than maxResults, Compute Engine returns a
  127101. // nextPageToken that can be used to get the next page of results in
  127102. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  127103. // (Default: 500)
  127104. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  127105. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  127106. return c
  127107. }
  127108. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  127109. // a certain order. By default, results are returned in alphanumerical
  127110. // order based on the resource name.
  127111. //
  127112. // You can also sort results in descending order based on the creation
  127113. // timestamp using orderBy="creationTimestamp desc". This sorts results
  127114. // based on the creationTimestamp field in reverse chronological order
  127115. // (newest result first). Use this to sort resources like operations so
  127116. // that the newest operation is returned first.
  127117. //
  127118. // Currently, only sorting by name or creationTimestamp desc is
  127119. // supported.
  127120. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  127121. c.urlParams_.Set("orderBy", orderBy)
  127122. return c
  127123. }
  127124. // PageToken sets the optional parameter "pageToken": Specifies a page
  127125. // token to use. Set pageToken to the nextPageToken returned by a
  127126. // previous list request to get the next page of results.
  127127. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  127128. c.urlParams_.Set("pageToken", pageToken)
  127129. return c
  127130. }
  127131. // Fields allows partial responses to be retrieved. See
  127132. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127133. // for more information.
  127134. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  127135. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127136. return c
  127137. }
  127138. // IfNoneMatch sets the optional parameter which makes the operation
  127139. // fail if the object's ETag matches the given value. This is useful for
  127140. // getting updates only after the object has changed since the last
  127141. // request. Use googleapi.IsNotModified to check whether the response
  127142. // error from Do is the result of In-None-Match.
  127143. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  127144. c.ifNoneMatch_ = entityTag
  127145. return c
  127146. }
  127147. // Context sets the context to be used in this call's Do method. Any
  127148. // pending HTTP request will be aborted if the provided context is
  127149. // canceled.
  127150. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  127151. c.ctx_ = ctx
  127152. return c
  127153. }
  127154. // Header returns an http.Header that can be modified by the caller to
  127155. // add HTTP headers to the request.
  127156. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  127157. if c.header_ == nil {
  127158. c.header_ = make(http.Header)
  127159. }
  127160. return c.header_
  127161. }
  127162. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  127163. reqHeaders := make(http.Header)
  127164. for k, v := range c.header_ {
  127165. reqHeaders[k] = v
  127166. }
  127167. reqHeaders.Set("User-Agent", c.s.userAgent())
  127168. if c.ifNoneMatch_ != "" {
  127169. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  127170. }
  127171. var body io.Reader = nil
  127172. c.urlParams_.Set("alt", alt)
  127173. c.urlParams_.Set("prettyPrint", "false")
  127174. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  127175. urls += "?" + c.urlParams_.Encode()
  127176. req, err := http.NewRequest("GET", urls, body)
  127177. if err != nil {
  127178. return nil, err
  127179. }
  127180. req.Header = reqHeaders
  127181. googleapi.Expand(req.URL, map[string]string{
  127182. "project": c.project,
  127183. })
  127184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127185. }
  127186. // Do executes the "compute.subnetworks.aggregatedList" call.
  127187. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  127188. // Any non-2xx status code is an error. Response headers are in either
  127189. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  127190. // returned at all) in error.(*googleapi.Error).Header. Use
  127191. // googleapi.IsNotModified to check whether the returned error was
  127192. // because http.StatusNotModified was returned.
  127193. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  127194. gensupport.SetOptions(c.urlParams_, opts...)
  127195. res, err := c.doRequest("json")
  127196. if res != nil && res.StatusCode == http.StatusNotModified {
  127197. if res.Body != nil {
  127198. res.Body.Close()
  127199. }
  127200. return nil, &googleapi.Error{
  127201. Code: res.StatusCode,
  127202. Header: res.Header,
  127203. }
  127204. }
  127205. if err != nil {
  127206. return nil, err
  127207. }
  127208. defer googleapi.CloseBody(res)
  127209. if err := googleapi.CheckResponse(res); err != nil {
  127210. return nil, err
  127211. }
  127212. ret := &SubnetworkAggregatedList{
  127213. ServerResponse: googleapi.ServerResponse{
  127214. Header: res.Header,
  127215. HTTPStatusCode: res.StatusCode,
  127216. },
  127217. }
  127218. target := &ret
  127219. if err := gensupport.DecodeResponse(target, res); err != nil {
  127220. return nil, err
  127221. }
  127222. return ret, nil
  127223. // {
  127224. // "description": "Retrieves an aggregated list of subnetworks.",
  127225. // "httpMethod": "GET",
  127226. // "id": "compute.subnetworks.aggregatedList",
  127227. // "parameterOrder": [
  127228. // "project"
  127229. // ],
  127230. // "parameters": {
  127231. // "filter": {
  127232. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  127233. // "location": "query",
  127234. // "type": "string"
  127235. // },
  127236. // "maxResults": {
  127237. // "default": "500",
  127238. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  127239. // "format": "uint32",
  127240. // "location": "query",
  127241. // "minimum": "0",
  127242. // "type": "integer"
  127243. // },
  127244. // "orderBy": {
  127245. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  127246. // "location": "query",
  127247. // "type": "string"
  127248. // },
  127249. // "pageToken": {
  127250. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  127251. // "location": "query",
  127252. // "type": "string"
  127253. // },
  127254. // "project": {
  127255. // "description": "Project ID for this request.",
  127256. // "location": "path",
  127257. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127258. // "required": true,
  127259. // "type": "string"
  127260. // }
  127261. // },
  127262. // "path": "{project}/aggregated/subnetworks",
  127263. // "response": {
  127264. // "$ref": "SubnetworkAggregatedList"
  127265. // },
  127266. // "scopes": [
  127267. // "https://www.googleapis.com/auth/cloud-platform",
  127268. // "https://www.googleapis.com/auth/compute",
  127269. // "https://www.googleapis.com/auth/compute.readonly"
  127270. // ]
  127271. // }
  127272. }
  127273. // Pages invokes f for each page of results.
  127274. // A non-nil error returned from f will halt the iteration.
  127275. // The provided context supersedes any context provided to the Context method.
  127276. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  127277. c.ctx_ = ctx
  127278. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  127279. for {
  127280. x, err := c.Do()
  127281. if err != nil {
  127282. return err
  127283. }
  127284. if err := f(x); err != nil {
  127285. return err
  127286. }
  127287. if x.NextPageToken == "" {
  127288. return nil
  127289. }
  127290. c.PageToken(x.NextPageToken)
  127291. }
  127292. }
  127293. // method id "compute.subnetworks.delete":
  127294. type SubnetworksDeleteCall struct {
  127295. s *Service
  127296. project string
  127297. region string
  127298. subnetwork string
  127299. urlParams_ gensupport.URLParams
  127300. ctx_ context.Context
  127301. header_ http.Header
  127302. }
  127303. // Delete: Deletes the specified subnetwork.
  127304. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  127305. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127306. c.project = project
  127307. c.region = region
  127308. c.subnetwork = subnetwork
  127309. return c
  127310. }
  127311. // RequestId sets the optional parameter "requestId": An optional
  127312. // request ID to identify requests. Specify a unique request ID so that
  127313. // if you must retry your request, the server will know to ignore the
  127314. // request if it has already been completed.
  127315. //
  127316. // For example, consider a situation where you make an initial request
  127317. // and the request times out. If you make the request again with the
  127318. // same request ID, the server can check if original operation with the
  127319. // same request ID was received, and if so, will ignore the second
  127320. // request. This prevents clients from accidentally creating duplicate
  127321. // commitments.
  127322. //
  127323. // The request ID must be a valid UUID with the exception that zero UUID
  127324. // is not supported (00000000-0000-0000-0000-000000000000).
  127325. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  127326. c.urlParams_.Set("requestId", requestId)
  127327. return c
  127328. }
  127329. // Fields allows partial responses to be retrieved. See
  127330. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127331. // for more information.
  127332. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  127333. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127334. return c
  127335. }
  127336. // Context sets the context to be used in this call's Do method. Any
  127337. // pending HTTP request will be aborted if the provided context is
  127338. // canceled.
  127339. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  127340. c.ctx_ = ctx
  127341. return c
  127342. }
  127343. // Header returns an http.Header that can be modified by the caller to
  127344. // add HTTP headers to the request.
  127345. func (c *SubnetworksDeleteCall) Header() http.Header {
  127346. if c.header_ == nil {
  127347. c.header_ = make(http.Header)
  127348. }
  127349. return c.header_
  127350. }
  127351. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  127352. reqHeaders := make(http.Header)
  127353. for k, v := range c.header_ {
  127354. reqHeaders[k] = v
  127355. }
  127356. reqHeaders.Set("User-Agent", c.s.userAgent())
  127357. var body io.Reader = nil
  127358. c.urlParams_.Set("alt", alt)
  127359. c.urlParams_.Set("prettyPrint", "false")
  127360. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  127361. urls += "?" + c.urlParams_.Encode()
  127362. req, err := http.NewRequest("DELETE", urls, body)
  127363. if err != nil {
  127364. return nil, err
  127365. }
  127366. req.Header = reqHeaders
  127367. googleapi.Expand(req.URL, map[string]string{
  127368. "project": c.project,
  127369. "region": c.region,
  127370. "subnetwork": c.subnetwork,
  127371. })
  127372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127373. }
  127374. // Do executes the "compute.subnetworks.delete" call.
  127375. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  127376. // status code is an error. Response headers are in either
  127377. // *Operation.ServerResponse.Header or (if a response was returned at
  127378. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  127379. // to check whether the returned error was because
  127380. // http.StatusNotModified was returned.
  127381. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  127382. gensupport.SetOptions(c.urlParams_, opts...)
  127383. res, err := c.doRequest("json")
  127384. if res != nil && res.StatusCode == http.StatusNotModified {
  127385. if res.Body != nil {
  127386. res.Body.Close()
  127387. }
  127388. return nil, &googleapi.Error{
  127389. Code: res.StatusCode,
  127390. Header: res.Header,
  127391. }
  127392. }
  127393. if err != nil {
  127394. return nil, err
  127395. }
  127396. defer googleapi.CloseBody(res)
  127397. if err := googleapi.CheckResponse(res); err != nil {
  127398. return nil, err
  127399. }
  127400. ret := &Operation{
  127401. ServerResponse: googleapi.ServerResponse{
  127402. Header: res.Header,
  127403. HTTPStatusCode: res.StatusCode,
  127404. },
  127405. }
  127406. target := &ret
  127407. if err := gensupport.DecodeResponse(target, res); err != nil {
  127408. return nil, err
  127409. }
  127410. return ret, nil
  127411. // {
  127412. // "description": "Deletes the specified subnetwork.",
  127413. // "httpMethod": "DELETE",
  127414. // "id": "compute.subnetworks.delete",
  127415. // "parameterOrder": [
  127416. // "project",
  127417. // "region",
  127418. // "subnetwork"
  127419. // ],
  127420. // "parameters": {
  127421. // "project": {
  127422. // "description": "Project ID for this request.",
  127423. // "location": "path",
  127424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127425. // "required": true,
  127426. // "type": "string"
  127427. // },
  127428. // "region": {
  127429. // "description": "Name of the region scoping this request.",
  127430. // "location": "path",
  127431. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127432. // "required": true,
  127433. // "type": "string"
  127434. // },
  127435. // "requestId": {
  127436. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  127437. // "location": "query",
  127438. // "type": "string"
  127439. // },
  127440. // "subnetwork": {
  127441. // "description": "Name of the Subnetwork resource to delete.",
  127442. // "location": "path",
  127443. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127444. // "required": true,
  127445. // "type": "string"
  127446. // }
  127447. // },
  127448. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  127449. // "response": {
  127450. // "$ref": "Operation"
  127451. // },
  127452. // "scopes": [
  127453. // "https://www.googleapis.com/auth/cloud-platform",
  127454. // "https://www.googleapis.com/auth/compute"
  127455. // ]
  127456. // }
  127457. }
  127458. // method id "compute.subnetworks.expandIpCidrRange":
  127459. type SubnetworksExpandIpCidrRangeCall struct {
  127460. s *Service
  127461. project string
  127462. region string
  127463. subnetwork string
  127464. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  127465. urlParams_ gensupport.URLParams
  127466. ctx_ context.Context
  127467. header_ http.Header
  127468. }
  127469. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  127470. // specified value.
  127471. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  127472. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127473. c.project = project
  127474. c.region = region
  127475. c.subnetwork = subnetwork
  127476. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  127477. return c
  127478. }
  127479. // RequestId sets the optional parameter "requestId": An optional
  127480. // request ID to identify requests. Specify a unique request ID so that
  127481. // if you must retry your request, the server will know to ignore the
  127482. // request if it has already been completed.
  127483. //
  127484. // For example, consider a situation where you make an initial request
  127485. // and the request times out. If you make the request again with the
  127486. // same request ID, the server can check if original operation with the
  127487. // same request ID was received, and if so, will ignore the second
  127488. // request. This prevents clients from accidentally creating duplicate
  127489. // commitments.
  127490. //
  127491. // The request ID must be a valid UUID with the exception that zero UUID
  127492. // is not supported (00000000-0000-0000-0000-000000000000).
  127493. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  127494. c.urlParams_.Set("requestId", requestId)
  127495. return c
  127496. }
  127497. // Fields allows partial responses to be retrieved. See
  127498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127499. // for more information.
  127500. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  127501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127502. return c
  127503. }
  127504. // Context sets the context to be used in this call's Do method. Any
  127505. // pending HTTP request will be aborted if the provided context is
  127506. // canceled.
  127507. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  127508. c.ctx_ = ctx
  127509. return c
  127510. }
  127511. // Header returns an http.Header that can be modified by the caller to
  127512. // add HTTP headers to the request.
  127513. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  127514. if c.header_ == nil {
  127515. c.header_ = make(http.Header)
  127516. }
  127517. return c.header_
  127518. }
  127519. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  127520. reqHeaders := make(http.Header)
  127521. for k, v := range c.header_ {
  127522. reqHeaders[k] = v
  127523. }
  127524. reqHeaders.Set("User-Agent", c.s.userAgent())
  127525. var body io.Reader = nil
  127526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  127527. if err != nil {
  127528. return nil, err
  127529. }
  127530. reqHeaders.Set("Content-Type", "application/json")
  127531. c.urlParams_.Set("alt", alt)
  127532. c.urlParams_.Set("prettyPrint", "false")
  127533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  127534. urls += "?" + c.urlParams_.Encode()
  127535. req, err := http.NewRequest("POST", urls, body)
  127536. if err != nil {
  127537. return nil, err
  127538. }
  127539. req.Header = reqHeaders
  127540. googleapi.Expand(req.URL, map[string]string{
  127541. "project": c.project,
  127542. "region": c.region,
  127543. "subnetwork": c.subnetwork,
  127544. })
  127545. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127546. }
  127547. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  127548. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  127549. // status code is an error. Response headers are in either
  127550. // *Operation.ServerResponse.Header or (if a response was returned at
  127551. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  127552. // to check whether the returned error was because
  127553. // http.StatusNotModified was returned.
  127554. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  127555. gensupport.SetOptions(c.urlParams_, opts...)
  127556. res, err := c.doRequest("json")
  127557. if res != nil && res.StatusCode == http.StatusNotModified {
  127558. if res.Body != nil {
  127559. res.Body.Close()
  127560. }
  127561. return nil, &googleapi.Error{
  127562. Code: res.StatusCode,
  127563. Header: res.Header,
  127564. }
  127565. }
  127566. if err != nil {
  127567. return nil, err
  127568. }
  127569. defer googleapi.CloseBody(res)
  127570. if err := googleapi.CheckResponse(res); err != nil {
  127571. return nil, err
  127572. }
  127573. ret := &Operation{
  127574. ServerResponse: googleapi.ServerResponse{
  127575. Header: res.Header,
  127576. HTTPStatusCode: res.StatusCode,
  127577. },
  127578. }
  127579. target := &ret
  127580. if err := gensupport.DecodeResponse(target, res); err != nil {
  127581. return nil, err
  127582. }
  127583. return ret, nil
  127584. // {
  127585. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  127586. // "httpMethod": "POST",
  127587. // "id": "compute.subnetworks.expandIpCidrRange",
  127588. // "parameterOrder": [
  127589. // "project",
  127590. // "region",
  127591. // "subnetwork"
  127592. // ],
  127593. // "parameters": {
  127594. // "project": {
  127595. // "description": "Project ID for this request.",
  127596. // "location": "path",
  127597. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127598. // "required": true,
  127599. // "type": "string"
  127600. // },
  127601. // "region": {
  127602. // "description": "Name of the region scoping this request.",
  127603. // "location": "path",
  127604. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127605. // "required": true,
  127606. // "type": "string"
  127607. // },
  127608. // "requestId": {
  127609. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  127610. // "location": "query",
  127611. // "type": "string"
  127612. // },
  127613. // "subnetwork": {
  127614. // "description": "Name of the Subnetwork resource to update.",
  127615. // "location": "path",
  127616. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127617. // "required": true,
  127618. // "type": "string"
  127619. // }
  127620. // },
  127621. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  127622. // "request": {
  127623. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  127624. // },
  127625. // "response": {
  127626. // "$ref": "Operation"
  127627. // },
  127628. // "scopes": [
  127629. // "https://www.googleapis.com/auth/cloud-platform",
  127630. // "https://www.googleapis.com/auth/compute"
  127631. // ]
  127632. // }
  127633. }
  127634. // method id "compute.subnetworks.get":
  127635. type SubnetworksGetCall struct {
  127636. s *Service
  127637. project string
  127638. region string
  127639. subnetwork string
  127640. urlParams_ gensupport.URLParams
  127641. ifNoneMatch_ string
  127642. ctx_ context.Context
  127643. header_ http.Header
  127644. }
  127645. // Get: Returns the specified subnetwork. Gets a list of available
  127646. // subnetworks list() request.
  127647. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  127648. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127649. c.project = project
  127650. c.region = region
  127651. c.subnetwork = subnetwork
  127652. return c
  127653. }
  127654. // Fields allows partial responses to be retrieved. See
  127655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127656. // for more information.
  127657. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  127658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127659. return c
  127660. }
  127661. // IfNoneMatch sets the optional parameter which makes the operation
  127662. // fail if the object's ETag matches the given value. This is useful for
  127663. // getting updates only after the object has changed since the last
  127664. // request. Use googleapi.IsNotModified to check whether the response
  127665. // error from Do is the result of In-None-Match.
  127666. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  127667. c.ifNoneMatch_ = entityTag
  127668. return c
  127669. }
  127670. // Context sets the context to be used in this call's Do method. Any
  127671. // pending HTTP request will be aborted if the provided context is
  127672. // canceled.
  127673. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  127674. c.ctx_ = ctx
  127675. return c
  127676. }
  127677. // Header returns an http.Header that can be modified by the caller to
  127678. // add HTTP headers to the request.
  127679. func (c *SubnetworksGetCall) Header() http.Header {
  127680. if c.header_ == nil {
  127681. c.header_ = make(http.Header)
  127682. }
  127683. return c.header_
  127684. }
  127685. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  127686. reqHeaders := make(http.Header)
  127687. for k, v := range c.header_ {
  127688. reqHeaders[k] = v
  127689. }
  127690. reqHeaders.Set("User-Agent", c.s.userAgent())
  127691. if c.ifNoneMatch_ != "" {
  127692. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  127693. }
  127694. var body io.Reader = nil
  127695. c.urlParams_.Set("alt", alt)
  127696. c.urlParams_.Set("prettyPrint", "false")
  127697. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  127698. urls += "?" + c.urlParams_.Encode()
  127699. req, err := http.NewRequest("GET", urls, body)
  127700. if err != nil {
  127701. return nil, err
  127702. }
  127703. req.Header = reqHeaders
  127704. googleapi.Expand(req.URL, map[string]string{
  127705. "project": c.project,
  127706. "region": c.region,
  127707. "subnetwork": c.subnetwork,
  127708. })
  127709. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127710. }
  127711. // Do executes the "compute.subnetworks.get" call.
  127712. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  127713. // status code is an error. Response headers are in either
  127714. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  127715. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  127716. // to check whether the returned error was because
  127717. // http.StatusNotModified was returned.
  127718. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  127719. gensupport.SetOptions(c.urlParams_, opts...)
  127720. res, err := c.doRequest("json")
  127721. if res != nil && res.StatusCode == http.StatusNotModified {
  127722. if res.Body != nil {
  127723. res.Body.Close()
  127724. }
  127725. return nil, &googleapi.Error{
  127726. Code: res.StatusCode,
  127727. Header: res.Header,
  127728. }
  127729. }
  127730. if err != nil {
  127731. return nil, err
  127732. }
  127733. defer googleapi.CloseBody(res)
  127734. if err := googleapi.CheckResponse(res); err != nil {
  127735. return nil, err
  127736. }
  127737. ret := &Subnetwork{
  127738. ServerResponse: googleapi.ServerResponse{
  127739. Header: res.Header,
  127740. HTTPStatusCode: res.StatusCode,
  127741. },
  127742. }
  127743. target := &ret
  127744. if err := gensupport.DecodeResponse(target, res); err != nil {
  127745. return nil, err
  127746. }
  127747. return ret, nil
  127748. // {
  127749. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  127750. // "httpMethod": "GET",
  127751. // "id": "compute.subnetworks.get",
  127752. // "parameterOrder": [
  127753. // "project",
  127754. // "region",
  127755. // "subnetwork"
  127756. // ],
  127757. // "parameters": {
  127758. // "project": {
  127759. // "description": "Project ID for this request.",
  127760. // "location": "path",
  127761. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127762. // "required": true,
  127763. // "type": "string"
  127764. // },
  127765. // "region": {
  127766. // "description": "Name of the region scoping this request.",
  127767. // "location": "path",
  127768. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127769. // "required": true,
  127770. // "type": "string"
  127771. // },
  127772. // "subnetwork": {
  127773. // "description": "Name of the Subnetwork resource to return.",
  127774. // "location": "path",
  127775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127776. // "required": true,
  127777. // "type": "string"
  127778. // }
  127779. // },
  127780. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  127781. // "response": {
  127782. // "$ref": "Subnetwork"
  127783. // },
  127784. // "scopes": [
  127785. // "https://www.googleapis.com/auth/cloud-platform",
  127786. // "https://www.googleapis.com/auth/compute",
  127787. // "https://www.googleapis.com/auth/compute.readonly"
  127788. // ]
  127789. // }
  127790. }
  127791. // method id "compute.subnetworks.getIamPolicy":
  127792. type SubnetworksGetIamPolicyCall struct {
  127793. s *Service
  127794. project string
  127795. region string
  127796. resource string
  127797. urlParams_ gensupport.URLParams
  127798. ifNoneMatch_ string
  127799. ctx_ context.Context
  127800. header_ http.Header
  127801. }
  127802. // GetIamPolicy: Gets the access control policy for a resource. May be
  127803. // empty if no such policy or resource exists.
  127804. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  127805. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127806. c.project = project
  127807. c.region = region
  127808. c.resource = resource
  127809. return c
  127810. }
  127811. // Fields allows partial responses to be retrieved. See
  127812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127813. // for more information.
  127814. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  127815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127816. return c
  127817. }
  127818. // IfNoneMatch sets the optional parameter which makes the operation
  127819. // fail if the object's ETag matches the given value. This is useful for
  127820. // getting updates only after the object has changed since the last
  127821. // request. Use googleapi.IsNotModified to check whether the response
  127822. // error from Do is the result of In-None-Match.
  127823. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  127824. c.ifNoneMatch_ = entityTag
  127825. return c
  127826. }
  127827. // Context sets the context to be used in this call's Do method. Any
  127828. // pending HTTP request will be aborted if the provided context is
  127829. // canceled.
  127830. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  127831. c.ctx_ = ctx
  127832. return c
  127833. }
  127834. // Header returns an http.Header that can be modified by the caller to
  127835. // add HTTP headers to the request.
  127836. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  127837. if c.header_ == nil {
  127838. c.header_ = make(http.Header)
  127839. }
  127840. return c.header_
  127841. }
  127842. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  127843. reqHeaders := make(http.Header)
  127844. for k, v := range c.header_ {
  127845. reqHeaders[k] = v
  127846. }
  127847. reqHeaders.Set("User-Agent", c.s.userAgent())
  127848. if c.ifNoneMatch_ != "" {
  127849. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  127850. }
  127851. var body io.Reader = nil
  127852. c.urlParams_.Set("alt", alt)
  127853. c.urlParams_.Set("prettyPrint", "false")
  127854. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  127855. urls += "?" + c.urlParams_.Encode()
  127856. req, err := http.NewRequest("GET", urls, body)
  127857. if err != nil {
  127858. return nil, err
  127859. }
  127860. req.Header = reqHeaders
  127861. googleapi.Expand(req.URL, map[string]string{
  127862. "project": c.project,
  127863. "region": c.region,
  127864. "resource": c.resource,
  127865. })
  127866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  127867. }
  127868. // Do executes the "compute.subnetworks.getIamPolicy" call.
  127869. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  127870. // code is an error. Response headers are in either
  127871. // *Policy.ServerResponse.Header or (if a response was returned at all)
  127872. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  127873. // check whether the returned error was because http.StatusNotModified
  127874. // was returned.
  127875. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  127876. gensupport.SetOptions(c.urlParams_, opts...)
  127877. res, err := c.doRequest("json")
  127878. if res != nil && res.StatusCode == http.StatusNotModified {
  127879. if res.Body != nil {
  127880. res.Body.Close()
  127881. }
  127882. return nil, &googleapi.Error{
  127883. Code: res.StatusCode,
  127884. Header: res.Header,
  127885. }
  127886. }
  127887. if err != nil {
  127888. return nil, err
  127889. }
  127890. defer googleapi.CloseBody(res)
  127891. if err := googleapi.CheckResponse(res); err != nil {
  127892. return nil, err
  127893. }
  127894. ret := &Policy{
  127895. ServerResponse: googleapi.ServerResponse{
  127896. Header: res.Header,
  127897. HTTPStatusCode: res.StatusCode,
  127898. },
  127899. }
  127900. target := &ret
  127901. if err := gensupport.DecodeResponse(target, res); err != nil {
  127902. return nil, err
  127903. }
  127904. return ret, nil
  127905. // {
  127906. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  127907. // "httpMethod": "GET",
  127908. // "id": "compute.subnetworks.getIamPolicy",
  127909. // "parameterOrder": [
  127910. // "project",
  127911. // "region",
  127912. // "resource"
  127913. // ],
  127914. // "parameters": {
  127915. // "project": {
  127916. // "description": "Project ID for this request.",
  127917. // "location": "path",
  127918. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  127919. // "required": true,
  127920. // "type": "string"
  127921. // },
  127922. // "region": {
  127923. // "description": "The name of the region for this request.",
  127924. // "location": "path",
  127925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  127926. // "required": true,
  127927. // "type": "string"
  127928. // },
  127929. // "resource": {
  127930. // "description": "Name or id of the resource for this request.",
  127931. // "location": "path",
  127932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  127933. // "required": true,
  127934. // "type": "string"
  127935. // }
  127936. // },
  127937. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  127938. // "response": {
  127939. // "$ref": "Policy"
  127940. // },
  127941. // "scopes": [
  127942. // "https://www.googleapis.com/auth/cloud-platform",
  127943. // "https://www.googleapis.com/auth/compute",
  127944. // "https://www.googleapis.com/auth/compute.readonly"
  127945. // ]
  127946. // }
  127947. }
  127948. // method id "compute.subnetworks.insert":
  127949. type SubnetworksInsertCall struct {
  127950. s *Service
  127951. project string
  127952. region string
  127953. subnetwork *Subnetwork
  127954. urlParams_ gensupport.URLParams
  127955. ctx_ context.Context
  127956. header_ http.Header
  127957. }
  127958. // Insert: Creates a subnetwork in the specified project using the data
  127959. // included in the request.
  127960. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  127961. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  127962. c.project = project
  127963. c.region = region
  127964. c.subnetwork = subnetwork
  127965. return c
  127966. }
  127967. // RequestId sets the optional parameter "requestId": An optional
  127968. // request ID to identify requests. Specify a unique request ID so that
  127969. // if you must retry your request, the server will know to ignore the
  127970. // request if it has already been completed.
  127971. //
  127972. // For example, consider a situation where you make an initial request
  127973. // and the request times out. If you make the request again with the
  127974. // same request ID, the server can check if original operation with the
  127975. // same request ID was received, and if so, will ignore the second
  127976. // request. This prevents clients from accidentally creating duplicate
  127977. // commitments.
  127978. //
  127979. // The request ID must be a valid UUID with the exception that zero UUID
  127980. // is not supported (00000000-0000-0000-0000-000000000000).
  127981. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  127982. c.urlParams_.Set("requestId", requestId)
  127983. return c
  127984. }
  127985. // Fields allows partial responses to be retrieved. See
  127986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  127987. // for more information.
  127988. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  127989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  127990. return c
  127991. }
  127992. // Context sets the context to be used in this call's Do method. Any
  127993. // pending HTTP request will be aborted if the provided context is
  127994. // canceled.
  127995. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  127996. c.ctx_ = ctx
  127997. return c
  127998. }
  127999. // Header returns an http.Header that can be modified by the caller to
  128000. // add HTTP headers to the request.
  128001. func (c *SubnetworksInsertCall) Header() http.Header {
  128002. if c.header_ == nil {
  128003. c.header_ = make(http.Header)
  128004. }
  128005. return c.header_
  128006. }
  128007. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  128008. reqHeaders := make(http.Header)
  128009. for k, v := range c.header_ {
  128010. reqHeaders[k] = v
  128011. }
  128012. reqHeaders.Set("User-Agent", c.s.userAgent())
  128013. var body io.Reader = nil
  128014. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  128015. if err != nil {
  128016. return nil, err
  128017. }
  128018. reqHeaders.Set("Content-Type", "application/json")
  128019. c.urlParams_.Set("alt", alt)
  128020. c.urlParams_.Set("prettyPrint", "false")
  128021. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  128022. urls += "?" + c.urlParams_.Encode()
  128023. req, err := http.NewRequest("POST", urls, body)
  128024. if err != nil {
  128025. return nil, err
  128026. }
  128027. req.Header = reqHeaders
  128028. googleapi.Expand(req.URL, map[string]string{
  128029. "project": c.project,
  128030. "region": c.region,
  128031. })
  128032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128033. }
  128034. // Do executes the "compute.subnetworks.insert" call.
  128035. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128036. // status code is an error. Response headers are in either
  128037. // *Operation.ServerResponse.Header or (if a response was returned at
  128038. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128039. // to check whether the returned error was because
  128040. // http.StatusNotModified was returned.
  128041. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128042. gensupport.SetOptions(c.urlParams_, opts...)
  128043. res, err := c.doRequest("json")
  128044. if res != nil && res.StatusCode == http.StatusNotModified {
  128045. if res.Body != nil {
  128046. res.Body.Close()
  128047. }
  128048. return nil, &googleapi.Error{
  128049. Code: res.StatusCode,
  128050. Header: res.Header,
  128051. }
  128052. }
  128053. if err != nil {
  128054. return nil, err
  128055. }
  128056. defer googleapi.CloseBody(res)
  128057. if err := googleapi.CheckResponse(res); err != nil {
  128058. return nil, err
  128059. }
  128060. ret := &Operation{
  128061. ServerResponse: googleapi.ServerResponse{
  128062. Header: res.Header,
  128063. HTTPStatusCode: res.StatusCode,
  128064. },
  128065. }
  128066. target := &ret
  128067. if err := gensupport.DecodeResponse(target, res); err != nil {
  128068. return nil, err
  128069. }
  128070. return ret, nil
  128071. // {
  128072. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  128073. // "httpMethod": "POST",
  128074. // "id": "compute.subnetworks.insert",
  128075. // "parameterOrder": [
  128076. // "project",
  128077. // "region"
  128078. // ],
  128079. // "parameters": {
  128080. // "project": {
  128081. // "description": "Project ID for this request.",
  128082. // "location": "path",
  128083. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128084. // "required": true,
  128085. // "type": "string"
  128086. // },
  128087. // "region": {
  128088. // "description": "Name of the region scoping this request.",
  128089. // "location": "path",
  128090. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  128091. // "required": true,
  128092. // "type": "string"
  128093. // },
  128094. // "requestId": {
  128095. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128096. // "location": "query",
  128097. // "type": "string"
  128098. // }
  128099. // },
  128100. // "path": "{project}/regions/{region}/subnetworks",
  128101. // "request": {
  128102. // "$ref": "Subnetwork"
  128103. // },
  128104. // "response": {
  128105. // "$ref": "Operation"
  128106. // },
  128107. // "scopes": [
  128108. // "https://www.googleapis.com/auth/cloud-platform",
  128109. // "https://www.googleapis.com/auth/compute"
  128110. // ]
  128111. // }
  128112. }
  128113. // method id "compute.subnetworks.list":
  128114. type SubnetworksListCall struct {
  128115. s *Service
  128116. project string
  128117. region string
  128118. urlParams_ gensupport.URLParams
  128119. ifNoneMatch_ string
  128120. ctx_ context.Context
  128121. header_ http.Header
  128122. }
  128123. // List: Retrieves a list of subnetworks available to the specified
  128124. // project.
  128125. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  128126. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128127. c.project = project
  128128. c.region = region
  128129. return c
  128130. }
  128131. // Filter sets the optional parameter "filter": A filter expression that
  128132. // filters resources listed in the response. The expression must specify
  128133. // the field name, a comparison operator, and the value that you want to
  128134. // use for filtering. The value must be a string, a number, or a
  128135. // boolean. The comparison operator must be either =, !=, >, or <.
  128136. //
  128137. // For example, if you are filtering Compute Engine instances, you can
  128138. // exclude instances named example-instance by specifying name !=
  128139. // example-instance.
  128140. //
  128141. // You can also filter nested fields. For example, you could specify
  128142. // scheduling.automaticRestart = false to include instances only if they
  128143. // are not scheduled for automatic restarts. You can use filtering on
  128144. // nested fields to filter based on resource labels.
  128145. //
  128146. // To filter on multiple expressions, provide each separate expression
  128147. // within parentheses. For example, (scheduling.automaticRestart = true)
  128148. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  128149. // AND expression. However, you can include AND and OR expressions
  128150. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  128151. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  128152. // true).
  128153. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  128154. c.urlParams_.Set("filter", filter)
  128155. return c
  128156. }
  128157. // MaxResults sets the optional parameter "maxResults": The maximum
  128158. // number of results per page that should be returned. If the number of
  128159. // available results is larger than maxResults, Compute Engine returns a
  128160. // nextPageToken that can be used to get the next page of results in
  128161. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  128162. // (Default: 500)
  128163. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  128164. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  128165. return c
  128166. }
  128167. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  128168. // a certain order. By default, results are returned in alphanumerical
  128169. // order based on the resource name.
  128170. //
  128171. // You can also sort results in descending order based on the creation
  128172. // timestamp using orderBy="creationTimestamp desc". This sorts results
  128173. // based on the creationTimestamp field in reverse chronological order
  128174. // (newest result first). Use this to sort resources like operations so
  128175. // that the newest operation is returned first.
  128176. //
  128177. // Currently, only sorting by name or creationTimestamp desc is
  128178. // supported.
  128179. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  128180. c.urlParams_.Set("orderBy", orderBy)
  128181. return c
  128182. }
  128183. // PageToken sets the optional parameter "pageToken": Specifies a page
  128184. // token to use. Set pageToken to the nextPageToken returned by a
  128185. // previous list request to get the next page of results.
  128186. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  128187. c.urlParams_.Set("pageToken", pageToken)
  128188. return c
  128189. }
  128190. // Fields allows partial responses to be retrieved. See
  128191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128192. // for more information.
  128193. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  128194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128195. return c
  128196. }
  128197. // IfNoneMatch sets the optional parameter which makes the operation
  128198. // fail if the object's ETag matches the given value. This is useful for
  128199. // getting updates only after the object has changed since the last
  128200. // request. Use googleapi.IsNotModified to check whether the response
  128201. // error from Do is the result of In-None-Match.
  128202. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  128203. c.ifNoneMatch_ = entityTag
  128204. return c
  128205. }
  128206. // Context sets the context to be used in this call's Do method. Any
  128207. // pending HTTP request will be aborted if the provided context is
  128208. // canceled.
  128209. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  128210. c.ctx_ = ctx
  128211. return c
  128212. }
  128213. // Header returns an http.Header that can be modified by the caller to
  128214. // add HTTP headers to the request.
  128215. func (c *SubnetworksListCall) Header() http.Header {
  128216. if c.header_ == nil {
  128217. c.header_ = make(http.Header)
  128218. }
  128219. return c.header_
  128220. }
  128221. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  128222. reqHeaders := make(http.Header)
  128223. for k, v := range c.header_ {
  128224. reqHeaders[k] = v
  128225. }
  128226. reqHeaders.Set("User-Agent", c.s.userAgent())
  128227. if c.ifNoneMatch_ != "" {
  128228. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  128229. }
  128230. var body io.Reader = nil
  128231. c.urlParams_.Set("alt", alt)
  128232. c.urlParams_.Set("prettyPrint", "false")
  128233. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  128234. urls += "?" + c.urlParams_.Encode()
  128235. req, err := http.NewRequest("GET", urls, body)
  128236. if err != nil {
  128237. return nil, err
  128238. }
  128239. req.Header = reqHeaders
  128240. googleapi.Expand(req.URL, map[string]string{
  128241. "project": c.project,
  128242. "region": c.region,
  128243. })
  128244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128245. }
  128246. // Do executes the "compute.subnetworks.list" call.
  128247. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  128248. // status code is an error. Response headers are in either
  128249. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  128250. // at all) in error.(*googleapi.Error).Header. Use
  128251. // googleapi.IsNotModified to check whether the returned error was
  128252. // because http.StatusNotModified was returned.
  128253. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  128254. gensupport.SetOptions(c.urlParams_, opts...)
  128255. res, err := c.doRequest("json")
  128256. if res != nil && res.StatusCode == http.StatusNotModified {
  128257. if res.Body != nil {
  128258. res.Body.Close()
  128259. }
  128260. return nil, &googleapi.Error{
  128261. Code: res.StatusCode,
  128262. Header: res.Header,
  128263. }
  128264. }
  128265. if err != nil {
  128266. return nil, err
  128267. }
  128268. defer googleapi.CloseBody(res)
  128269. if err := googleapi.CheckResponse(res); err != nil {
  128270. return nil, err
  128271. }
  128272. ret := &SubnetworkList{
  128273. ServerResponse: googleapi.ServerResponse{
  128274. Header: res.Header,
  128275. HTTPStatusCode: res.StatusCode,
  128276. },
  128277. }
  128278. target := &ret
  128279. if err := gensupport.DecodeResponse(target, res); err != nil {
  128280. return nil, err
  128281. }
  128282. return ret, nil
  128283. // {
  128284. // "description": "Retrieves a list of subnetworks available to the specified project.",
  128285. // "httpMethod": "GET",
  128286. // "id": "compute.subnetworks.list",
  128287. // "parameterOrder": [
  128288. // "project",
  128289. // "region"
  128290. // ],
  128291. // "parameters": {
  128292. // "filter": {
  128293. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  128294. // "location": "query",
  128295. // "type": "string"
  128296. // },
  128297. // "maxResults": {
  128298. // "default": "500",
  128299. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  128300. // "format": "uint32",
  128301. // "location": "query",
  128302. // "minimum": "0",
  128303. // "type": "integer"
  128304. // },
  128305. // "orderBy": {
  128306. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  128307. // "location": "query",
  128308. // "type": "string"
  128309. // },
  128310. // "pageToken": {
  128311. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  128312. // "location": "query",
  128313. // "type": "string"
  128314. // },
  128315. // "project": {
  128316. // "description": "Project ID for this request.",
  128317. // "location": "path",
  128318. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128319. // "required": true,
  128320. // "type": "string"
  128321. // },
  128322. // "region": {
  128323. // "description": "Name of the region scoping this request.",
  128324. // "location": "path",
  128325. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  128326. // "required": true,
  128327. // "type": "string"
  128328. // }
  128329. // },
  128330. // "path": "{project}/regions/{region}/subnetworks",
  128331. // "response": {
  128332. // "$ref": "SubnetworkList"
  128333. // },
  128334. // "scopes": [
  128335. // "https://www.googleapis.com/auth/cloud-platform",
  128336. // "https://www.googleapis.com/auth/compute",
  128337. // "https://www.googleapis.com/auth/compute.readonly"
  128338. // ]
  128339. // }
  128340. }
  128341. // Pages invokes f for each page of results.
  128342. // A non-nil error returned from f will halt the iteration.
  128343. // The provided context supersedes any context provided to the Context method.
  128344. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  128345. c.ctx_ = ctx
  128346. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  128347. for {
  128348. x, err := c.Do()
  128349. if err != nil {
  128350. return err
  128351. }
  128352. if err := f(x); err != nil {
  128353. return err
  128354. }
  128355. if x.NextPageToken == "" {
  128356. return nil
  128357. }
  128358. c.PageToken(x.NextPageToken)
  128359. }
  128360. }
  128361. // method id "compute.subnetworks.listUsable":
  128362. type SubnetworksListUsableCall struct {
  128363. s *Service
  128364. project string
  128365. urlParams_ gensupport.URLParams
  128366. ifNoneMatch_ string
  128367. ctx_ context.Context
  128368. header_ http.Header
  128369. }
  128370. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  128371. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  128372. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128373. c.project = project
  128374. return c
  128375. }
  128376. // Filter sets the optional parameter "filter": A filter expression that
  128377. // filters resources listed in the response. The expression must specify
  128378. // the field name, a comparison operator, and the value that you want to
  128379. // use for filtering. The value must be a string, a number, or a
  128380. // boolean. The comparison operator must be either =, !=, >, or <.
  128381. //
  128382. // For example, if you are filtering Compute Engine instances, you can
  128383. // exclude instances named example-instance by specifying name !=
  128384. // example-instance.
  128385. //
  128386. // You can also filter nested fields. For example, you could specify
  128387. // scheduling.automaticRestart = false to include instances only if they
  128388. // are not scheduled for automatic restarts. You can use filtering on
  128389. // nested fields to filter based on resource labels.
  128390. //
  128391. // To filter on multiple expressions, provide each separate expression
  128392. // within parentheses. For example, (scheduling.automaticRestart = true)
  128393. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  128394. // AND expression. However, you can include AND and OR expressions
  128395. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  128396. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  128397. // true).
  128398. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  128399. c.urlParams_.Set("filter", filter)
  128400. return c
  128401. }
  128402. // MaxResults sets the optional parameter "maxResults": The maximum
  128403. // number of results per page that should be returned. If the number of
  128404. // available results is larger than maxResults, Compute Engine returns a
  128405. // nextPageToken that can be used to get the next page of results in
  128406. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  128407. // (Default: 500)
  128408. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  128409. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  128410. return c
  128411. }
  128412. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  128413. // a certain order. By default, results are returned in alphanumerical
  128414. // order based on the resource name.
  128415. //
  128416. // You can also sort results in descending order based on the creation
  128417. // timestamp using orderBy="creationTimestamp desc". This sorts results
  128418. // based on the creationTimestamp field in reverse chronological order
  128419. // (newest result first). Use this to sort resources like operations so
  128420. // that the newest operation is returned first.
  128421. //
  128422. // Currently, only sorting by name or creationTimestamp desc is
  128423. // supported.
  128424. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  128425. c.urlParams_.Set("orderBy", orderBy)
  128426. return c
  128427. }
  128428. // PageToken sets the optional parameter "pageToken": Specifies a page
  128429. // token to use. Set pageToken to the nextPageToken returned by a
  128430. // previous list request to get the next page of results.
  128431. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  128432. c.urlParams_.Set("pageToken", pageToken)
  128433. return c
  128434. }
  128435. // Fields allows partial responses to be retrieved. See
  128436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128437. // for more information.
  128438. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  128439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128440. return c
  128441. }
  128442. // IfNoneMatch sets the optional parameter which makes the operation
  128443. // fail if the object's ETag matches the given value. This is useful for
  128444. // getting updates only after the object has changed since the last
  128445. // request. Use googleapi.IsNotModified to check whether the response
  128446. // error from Do is the result of In-None-Match.
  128447. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  128448. c.ifNoneMatch_ = entityTag
  128449. return c
  128450. }
  128451. // Context sets the context to be used in this call's Do method. Any
  128452. // pending HTTP request will be aborted if the provided context is
  128453. // canceled.
  128454. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  128455. c.ctx_ = ctx
  128456. return c
  128457. }
  128458. // Header returns an http.Header that can be modified by the caller to
  128459. // add HTTP headers to the request.
  128460. func (c *SubnetworksListUsableCall) Header() http.Header {
  128461. if c.header_ == nil {
  128462. c.header_ = make(http.Header)
  128463. }
  128464. return c.header_
  128465. }
  128466. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  128467. reqHeaders := make(http.Header)
  128468. for k, v := range c.header_ {
  128469. reqHeaders[k] = v
  128470. }
  128471. reqHeaders.Set("User-Agent", c.s.userAgent())
  128472. if c.ifNoneMatch_ != "" {
  128473. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  128474. }
  128475. var body io.Reader = nil
  128476. c.urlParams_.Set("alt", alt)
  128477. c.urlParams_.Set("prettyPrint", "false")
  128478. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  128479. urls += "?" + c.urlParams_.Encode()
  128480. req, err := http.NewRequest("GET", urls, body)
  128481. if err != nil {
  128482. return nil, err
  128483. }
  128484. req.Header = reqHeaders
  128485. googleapi.Expand(req.URL, map[string]string{
  128486. "project": c.project,
  128487. })
  128488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128489. }
  128490. // Do executes the "compute.subnetworks.listUsable" call.
  128491. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  128492. // non-nil. Any non-2xx status code is an error. Response headers are in
  128493. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  128494. // a response was returned at all) in error.(*googleapi.Error).Header.
  128495. // Use googleapi.IsNotModified to check whether the returned error was
  128496. // because http.StatusNotModified was returned.
  128497. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  128498. gensupport.SetOptions(c.urlParams_, opts...)
  128499. res, err := c.doRequest("json")
  128500. if res != nil && res.StatusCode == http.StatusNotModified {
  128501. if res.Body != nil {
  128502. res.Body.Close()
  128503. }
  128504. return nil, &googleapi.Error{
  128505. Code: res.StatusCode,
  128506. Header: res.Header,
  128507. }
  128508. }
  128509. if err != nil {
  128510. return nil, err
  128511. }
  128512. defer googleapi.CloseBody(res)
  128513. if err := googleapi.CheckResponse(res); err != nil {
  128514. return nil, err
  128515. }
  128516. ret := &UsableSubnetworksAggregatedList{
  128517. ServerResponse: googleapi.ServerResponse{
  128518. Header: res.Header,
  128519. HTTPStatusCode: res.StatusCode,
  128520. },
  128521. }
  128522. target := &ret
  128523. if err := gensupport.DecodeResponse(target, res); err != nil {
  128524. return nil, err
  128525. }
  128526. return ret, nil
  128527. // {
  128528. // "description": "Retrieves an aggregated list of usable subnetworks.",
  128529. // "httpMethod": "GET",
  128530. // "id": "compute.subnetworks.listUsable",
  128531. // "parameterOrder": [
  128532. // "project"
  128533. // ],
  128534. // "parameters": {
  128535. // "filter": {
  128536. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  128537. // "location": "query",
  128538. // "type": "string"
  128539. // },
  128540. // "maxResults": {
  128541. // "default": "500",
  128542. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  128543. // "format": "uint32",
  128544. // "location": "query",
  128545. // "minimum": "0",
  128546. // "type": "integer"
  128547. // },
  128548. // "orderBy": {
  128549. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  128550. // "location": "query",
  128551. // "type": "string"
  128552. // },
  128553. // "pageToken": {
  128554. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  128555. // "location": "query",
  128556. // "type": "string"
  128557. // },
  128558. // "project": {
  128559. // "description": "Project ID for this request.",
  128560. // "location": "path",
  128561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128562. // "required": true,
  128563. // "type": "string"
  128564. // }
  128565. // },
  128566. // "path": "{project}/aggregated/subnetworks/listUsable",
  128567. // "response": {
  128568. // "$ref": "UsableSubnetworksAggregatedList"
  128569. // },
  128570. // "scopes": [
  128571. // "https://www.googleapis.com/auth/cloud-platform",
  128572. // "https://www.googleapis.com/auth/compute",
  128573. // "https://www.googleapis.com/auth/compute.readonly"
  128574. // ]
  128575. // }
  128576. }
  128577. // Pages invokes f for each page of results.
  128578. // A non-nil error returned from f will halt the iteration.
  128579. // The provided context supersedes any context provided to the Context method.
  128580. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  128581. c.ctx_ = ctx
  128582. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  128583. for {
  128584. x, err := c.Do()
  128585. if err != nil {
  128586. return err
  128587. }
  128588. if err := f(x); err != nil {
  128589. return err
  128590. }
  128591. if x.NextPageToken == "" {
  128592. return nil
  128593. }
  128594. c.PageToken(x.NextPageToken)
  128595. }
  128596. }
  128597. // method id "compute.subnetworks.patch":
  128598. type SubnetworksPatchCall struct {
  128599. s *Service
  128600. project string
  128601. region string
  128602. subnetwork string
  128603. subnetwork2 *Subnetwork
  128604. urlParams_ gensupport.URLParams
  128605. ctx_ context.Context
  128606. header_ http.Header
  128607. }
  128608. // Patch: Patches the specified subnetwork with the data included in the
  128609. // request. Only certain fields can up updated with a patch request as
  128610. // indicated in the field descriptions. You must specify the current
  128611. // fingeprint of the subnetwork resource being patched.
  128612. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  128613. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128614. c.project = project
  128615. c.region = region
  128616. c.subnetwork = subnetwork
  128617. c.subnetwork2 = subnetwork2
  128618. return c
  128619. }
  128620. // DrainTimeoutSeconds sets the optional parameter
  128621. // "drainTimeoutSeconds": The drain timeout specifies the upper bound in
  128622. // seconds on the amount of time allowed to drain connections from the
  128623. // current ACTIVE subnetwork to the current BACKUP subnetwork. The drain
  128624. // timeout is only applicable when the following conditions are true: -
  128625. // the subnetwork being patched has purpose =
  128626. // INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role
  128627. // = BACKUP - the patch request is setting the role to ACTIVE. Note that
  128628. // after this patch operation the roles of the ACTIVE and BACKUP
  128629. // subnetworks will be swapped.
  128630. func (c *SubnetworksPatchCall) DrainTimeoutSeconds(drainTimeoutSeconds int64) *SubnetworksPatchCall {
  128631. c.urlParams_.Set("drainTimeoutSeconds", fmt.Sprint(drainTimeoutSeconds))
  128632. return c
  128633. }
  128634. // RequestId sets the optional parameter "requestId": An optional
  128635. // request ID to identify requests. Specify a unique request ID so that
  128636. // if you must retry your request, the server will know to ignore the
  128637. // request if it has already been completed.
  128638. //
  128639. // For example, consider a situation where you make an initial request
  128640. // and the request times out. If you make the request again with the
  128641. // same request ID, the server can check if original operation with the
  128642. // same request ID was received, and if so, will ignore the second
  128643. // request. This prevents clients from accidentally creating duplicate
  128644. // commitments.
  128645. //
  128646. // The request ID must be a valid UUID with the exception that zero UUID
  128647. // is not supported (00000000-0000-0000-0000-000000000000).
  128648. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  128649. c.urlParams_.Set("requestId", requestId)
  128650. return c
  128651. }
  128652. // Fields allows partial responses to be retrieved. See
  128653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128654. // for more information.
  128655. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  128656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128657. return c
  128658. }
  128659. // Context sets the context to be used in this call's Do method. Any
  128660. // pending HTTP request will be aborted if the provided context is
  128661. // canceled.
  128662. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  128663. c.ctx_ = ctx
  128664. return c
  128665. }
  128666. // Header returns an http.Header that can be modified by the caller to
  128667. // add HTTP headers to the request.
  128668. func (c *SubnetworksPatchCall) Header() http.Header {
  128669. if c.header_ == nil {
  128670. c.header_ = make(http.Header)
  128671. }
  128672. return c.header_
  128673. }
  128674. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  128675. reqHeaders := make(http.Header)
  128676. for k, v := range c.header_ {
  128677. reqHeaders[k] = v
  128678. }
  128679. reqHeaders.Set("User-Agent", c.s.userAgent())
  128680. var body io.Reader = nil
  128681. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  128682. if err != nil {
  128683. return nil, err
  128684. }
  128685. reqHeaders.Set("Content-Type", "application/json")
  128686. c.urlParams_.Set("alt", alt)
  128687. c.urlParams_.Set("prettyPrint", "false")
  128688. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  128689. urls += "?" + c.urlParams_.Encode()
  128690. req, err := http.NewRequest("PATCH", urls, body)
  128691. if err != nil {
  128692. return nil, err
  128693. }
  128694. req.Header = reqHeaders
  128695. googleapi.Expand(req.URL, map[string]string{
  128696. "project": c.project,
  128697. "region": c.region,
  128698. "subnetwork": c.subnetwork,
  128699. })
  128700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128701. }
  128702. // Do executes the "compute.subnetworks.patch" call.
  128703. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  128704. // status code is an error. Response headers are in either
  128705. // *Operation.ServerResponse.Header or (if a response was returned at
  128706. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  128707. // to check whether the returned error was because
  128708. // http.StatusNotModified was returned.
  128709. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  128710. gensupport.SetOptions(c.urlParams_, opts...)
  128711. res, err := c.doRequest("json")
  128712. if res != nil && res.StatusCode == http.StatusNotModified {
  128713. if res.Body != nil {
  128714. res.Body.Close()
  128715. }
  128716. return nil, &googleapi.Error{
  128717. Code: res.StatusCode,
  128718. Header: res.Header,
  128719. }
  128720. }
  128721. if err != nil {
  128722. return nil, err
  128723. }
  128724. defer googleapi.CloseBody(res)
  128725. if err := googleapi.CheckResponse(res); err != nil {
  128726. return nil, err
  128727. }
  128728. ret := &Operation{
  128729. ServerResponse: googleapi.ServerResponse{
  128730. Header: res.Header,
  128731. HTTPStatusCode: res.StatusCode,
  128732. },
  128733. }
  128734. target := &ret
  128735. if err := gensupport.DecodeResponse(target, res); err != nil {
  128736. return nil, err
  128737. }
  128738. return ret, nil
  128739. // {
  128740. // "description": "Patches the specified subnetwork with the data included in the request. Only certain fields can up updated with a patch request as indicated in the field descriptions. You must specify the current fingeprint of the subnetwork resource being patched.",
  128741. // "httpMethod": "PATCH",
  128742. // "id": "compute.subnetworks.patch",
  128743. // "parameterOrder": [
  128744. // "project",
  128745. // "region",
  128746. // "subnetwork"
  128747. // ],
  128748. // "parameters": {
  128749. // "drainTimeoutSeconds": {
  128750. // "description": "The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped.",
  128751. // "format": "int32",
  128752. // "location": "query",
  128753. // "type": "integer"
  128754. // },
  128755. // "project": {
  128756. // "description": "Project ID for this request.",
  128757. // "location": "path",
  128758. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128759. // "required": true,
  128760. // "type": "string"
  128761. // },
  128762. // "region": {
  128763. // "description": "Name of the region scoping this request.",
  128764. // "location": "path",
  128765. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  128766. // "required": true,
  128767. // "type": "string"
  128768. // },
  128769. // "requestId": {
  128770. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  128771. // "location": "query",
  128772. // "type": "string"
  128773. // },
  128774. // "subnetwork": {
  128775. // "description": "Name of the Subnetwork resource to patch.",
  128776. // "location": "path",
  128777. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  128778. // "required": true,
  128779. // "type": "string"
  128780. // }
  128781. // },
  128782. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  128783. // "request": {
  128784. // "$ref": "Subnetwork"
  128785. // },
  128786. // "response": {
  128787. // "$ref": "Operation"
  128788. // },
  128789. // "scopes": [
  128790. // "https://www.googleapis.com/auth/cloud-platform",
  128791. // "https://www.googleapis.com/auth/compute"
  128792. // ]
  128793. // }
  128794. }
  128795. // method id "compute.subnetworks.setIamPolicy":
  128796. type SubnetworksSetIamPolicyCall struct {
  128797. s *Service
  128798. project string
  128799. region string
  128800. resource string
  128801. regionsetpolicyrequest *RegionSetPolicyRequest
  128802. urlParams_ gensupport.URLParams
  128803. ctx_ context.Context
  128804. header_ http.Header
  128805. }
  128806. // SetIamPolicy: Sets the access control policy on the specified
  128807. // resource. Replaces any existing policy.
  128808. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  128809. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128810. c.project = project
  128811. c.region = region
  128812. c.resource = resource
  128813. c.regionsetpolicyrequest = regionsetpolicyrequest
  128814. return c
  128815. }
  128816. // Fields allows partial responses to be retrieved. See
  128817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128818. // for more information.
  128819. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  128820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128821. return c
  128822. }
  128823. // Context sets the context to be used in this call's Do method. Any
  128824. // pending HTTP request will be aborted if the provided context is
  128825. // canceled.
  128826. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  128827. c.ctx_ = ctx
  128828. return c
  128829. }
  128830. // Header returns an http.Header that can be modified by the caller to
  128831. // add HTTP headers to the request.
  128832. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  128833. if c.header_ == nil {
  128834. c.header_ = make(http.Header)
  128835. }
  128836. return c.header_
  128837. }
  128838. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  128839. reqHeaders := make(http.Header)
  128840. for k, v := range c.header_ {
  128841. reqHeaders[k] = v
  128842. }
  128843. reqHeaders.Set("User-Agent", c.s.userAgent())
  128844. var body io.Reader = nil
  128845. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  128846. if err != nil {
  128847. return nil, err
  128848. }
  128849. reqHeaders.Set("Content-Type", "application/json")
  128850. c.urlParams_.Set("alt", alt)
  128851. c.urlParams_.Set("prettyPrint", "false")
  128852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  128853. urls += "?" + c.urlParams_.Encode()
  128854. req, err := http.NewRequest("POST", urls, body)
  128855. if err != nil {
  128856. return nil, err
  128857. }
  128858. req.Header = reqHeaders
  128859. googleapi.Expand(req.URL, map[string]string{
  128860. "project": c.project,
  128861. "region": c.region,
  128862. "resource": c.resource,
  128863. })
  128864. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  128865. }
  128866. // Do executes the "compute.subnetworks.setIamPolicy" call.
  128867. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  128868. // code is an error. Response headers are in either
  128869. // *Policy.ServerResponse.Header or (if a response was returned at all)
  128870. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  128871. // check whether the returned error was because http.StatusNotModified
  128872. // was returned.
  128873. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  128874. gensupport.SetOptions(c.urlParams_, opts...)
  128875. res, err := c.doRequest("json")
  128876. if res != nil && res.StatusCode == http.StatusNotModified {
  128877. if res.Body != nil {
  128878. res.Body.Close()
  128879. }
  128880. return nil, &googleapi.Error{
  128881. Code: res.StatusCode,
  128882. Header: res.Header,
  128883. }
  128884. }
  128885. if err != nil {
  128886. return nil, err
  128887. }
  128888. defer googleapi.CloseBody(res)
  128889. if err := googleapi.CheckResponse(res); err != nil {
  128890. return nil, err
  128891. }
  128892. ret := &Policy{
  128893. ServerResponse: googleapi.ServerResponse{
  128894. Header: res.Header,
  128895. HTTPStatusCode: res.StatusCode,
  128896. },
  128897. }
  128898. target := &ret
  128899. if err := gensupport.DecodeResponse(target, res); err != nil {
  128900. return nil, err
  128901. }
  128902. return ret, nil
  128903. // {
  128904. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  128905. // "httpMethod": "POST",
  128906. // "id": "compute.subnetworks.setIamPolicy",
  128907. // "parameterOrder": [
  128908. // "project",
  128909. // "region",
  128910. // "resource"
  128911. // ],
  128912. // "parameters": {
  128913. // "project": {
  128914. // "description": "Project ID for this request.",
  128915. // "location": "path",
  128916. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  128917. // "required": true,
  128918. // "type": "string"
  128919. // },
  128920. // "region": {
  128921. // "description": "The name of the region for this request.",
  128922. // "location": "path",
  128923. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  128924. // "required": true,
  128925. // "type": "string"
  128926. // },
  128927. // "resource": {
  128928. // "description": "Name or id of the resource for this request.",
  128929. // "location": "path",
  128930. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  128931. // "required": true,
  128932. // "type": "string"
  128933. // }
  128934. // },
  128935. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  128936. // "request": {
  128937. // "$ref": "RegionSetPolicyRequest"
  128938. // },
  128939. // "response": {
  128940. // "$ref": "Policy"
  128941. // },
  128942. // "scopes": [
  128943. // "https://www.googleapis.com/auth/cloud-platform",
  128944. // "https://www.googleapis.com/auth/compute"
  128945. // ]
  128946. // }
  128947. }
  128948. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  128949. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  128950. s *Service
  128951. project string
  128952. region string
  128953. subnetwork string
  128954. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  128955. urlParams_ gensupport.URLParams
  128956. ctx_ context.Context
  128957. header_ http.Header
  128958. }
  128959. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  128960. // Google services without assigning external IP addresses through
  128961. // Private Google Access.
  128962. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  128963. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  128964. c.project = project
  128965. c.region = region
  128966. c.subnetwork = subnetwork
  128967. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  128968. return c
  128969. }
  128970. // RequestId sets the optional parameter "requestId": An optional
  128971. // request ID to identify requests. Specify a unique request ID so that
  128972. // if you must retry your request, the server will know to ignore the
  128973. // request if it has already been completed.
  128974. //
  128975. // For example, consider a situation where you make an initial request
  128976. // and the request times out. If you make the request again with the
  128977. // same request ID, the server can check if original operation with the
  128978. // same request ID was received, and if so, will ignore the second
  128979. // request. This prevents clients from accidentally creating duplicate
  128980. // commitments.
  128981. //
  128982. // The request ID must be a valid UUID with the exception that zero UUID
  128983. // is not supported (00000000-0000-0000-0000-000000000000).
  128984. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  128985. c.urlParams_.Set("requestId", requestId)
  128986. return c
  128987. }
  128988. // Fields allows partial responses to be retrieved. See
  128989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  128990. // for more information.
  128991. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  128992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  128993. return c
  128994. }
  128995. // Context sets the context to be used in this call's Do method. Any
  128996. // pending HTTP request will be aborted if the provided context is
  128997. // canceled.
  128998. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  128999. c.ctx_ = ctx
  129000. return c
  129001. }
  129002. // Header returns an http.Header that can be modified by the caller to
  129003. // add HTTP headers to the request.
  129004. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  129005. if c.header_ == nil {
  129006. c.header_ = make(http.Header)
  129007. }
  129008. return c.header_
  129009. }
  129010. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  129011. reqHeaders := make(http.Header)
  129012. for k, v := range c.header_ {
  129013. reqHeaders[k] = v
  129014. }
  129015. reqHeaders.Set("User-Agent", c.s.userAgent())
  129016. var body io.Reader = nil
  129017. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  129018. if err != nil {
  129019. return nil, err
  129020. }
  129021. reqHeaders.Set("Content-Type", "application/json")
  129022. c.urlParams_.Set("alt", alt)
  129023. c.urlParams_.Set("prettyPrint", "false")
  129024. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  129025. urls += "?" + c.urlParams_.Encode()
  129026. req, err := http.NewRequest("POST", urls, body)
  129027. if err != nil {
  129028. return nil, err
  129029. }
  129030. req.Header = reqHeaders
  129031. googleapi.Expand(req.URL, map[string]string{
  129032. "project": c.project,
  129033. "region": c.region,
  129034. "subnetwork": c.subnetwork,
  129035. })
  129036. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129037. }
  129038. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  129039. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  129040. // status code is an error. Response headers are in either
  129041. // *Operation.ServerResponse.Header or (if a response was returned at
  129042. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129043. // to check whether the returned error was because
  129044. // http.StatusNotModified was returned.
  129045. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  129046. gensupport.SetOptions(c.urlParams_, opts...)
  129047. res, err := c.doRequest("json")
  129048. if res != nil && res.StatusCode == http.StatusNotModified {
  129049. if res.Body != nil {
  129050. res.Body.Close()
  129051. }
  129052. return nil, &googleapi.Error{
  129053. Code: res.StatusCode,
  129054. Header: res.Header,
  129055. }
  129056. }
  129057. if err != nil {
  129058. return nil, err
  129059. }
  129060. defer googleapi.CloseBody(res)
  129061. if err := googleapi.CheckResponse(res); err != nil {
  129062. return nil, err
  129063. }
  129064. ret := &Operation{
  129065. ServerResponse: googleapi.ServerResponse{
  129066. Header: res.Header,
  129067. HTTPStatusCode: res.StatusCode,
  129068. },
  129069. }
  129070. target := &ret
  129071. if err := gensupport.DecodeResponse(target, res); err != nil {
  129072. return nil, err
  129073. }
  129074. return ret, nil
  129075. // {
  129076. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  129077. // "httpMethod": "POST",
  129078. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  129079. // "parameterOrder": [
  129080. // "project",
  129081. // "region",
  129082. // "subnetwork"
  129083. // ],
  129084. // "parameters": {
  129085. // "project": {
  129086. // "description": "Project ID for this request.",
  129087. // "location": "path",
  129088. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129089. // "required": true,
  129090. // "type": "string"
  129091. // },
  129092. // "region": {
  129093. // "description": "Name of the region scoping this request.",
  129094. // "location": "path",
  129095. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  129096. // "required": true,
  129097. // "type": "string"
  129098. // },
  129099. // "requestId": {
  129100. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129101. // "location": "query",
  129102. // "type": "string"
  129103. // },
  129104. // "subnetwork": {
  129105. // "description": "Name of the Subnetwork resource.",
  129106. // "location": "path",
  129107. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  129108. // "required": true,
  129109. // "type": "string"
  129110. // }
  129111. // },
  129112. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  129113. // "request": {
  129114. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  129115. // },
  129116. // "response": {
  129117. // "$ref": "Operation"
  129118. // },
  129119. // "scopes": [
  129120. // "https://www.googleapis.com/auth/cloud-platform",
  129121. // "https://www.googleapis.com/auth/compute"
  129122. // ]
  129123. // }
  129124. }
  129125. // method id "compute.subnetworks.testIamPermissions":
  129126. type SubnetworksTestIamPermissionsCall struct {
  129127. s *Service
  129128. project string
  129129. region string
  129130. resource string
  129131. testpermissionsrequest *TestPermissionsRequest
  129132. urlParams_ gensupport.URLParams
  129133. ctx_ context.Context
  129134. header_ http.Header
  129135. }
  129136. // TestIamPermissions: Returns permissions that a caller has on the
  129137. // specified resource.
  129138. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  129139. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129140. c.project = project
  129141. c.region = region
  129142. c.resource = resource
  129143. c.testpermissionsrequest = testpermissionsrequest
  129144. return c
  129145. }
  129146. // Fields allows partial responses to be retrieved. See
  129147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129148. // for more information.
  129149. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  129150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129151. return c
  129152. }
  129153. // Context sets the context to be used in this call's Do method. Any
  129154. // pending HTTP request will be aborted if the provided context is
  129155. // canceled.
  129156. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  129157. c.ctx_ = ctx
  129158. return c
  129159. }
  129160. // Header returns an http.Header that can be modified by the caller to
  129161. // add HTTP headers to the request.
  129162. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  129163. if c.header_ == nil {
  129164. c.header_ = make(http.Header)
  129165. }
  129166. return c.header_
  129167. }
  129168. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  129169. reqHeaders := make(http.Header)
  129170. for k, v := range c.header_ {
  129171. reqHeaders[k] = v
  129172. }
  129173. reqHeaders.Set("User-Agent", c.s.userAgent())
  129174. var body io.Reader = nil
  129175. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  129176. if err != nil {
  129177. return nil, err
  129178. }
  129179. reqHeaders.Set("Content-Type", "application/json")
  129180. c.urlParams_.Set("alt", alt)
  129181. c.urlParams_.Set("prettyPrint", "false")
  129182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  129183. urls += "?" + c.urlParams_.Encode()
  129184. req, err := http.NewRequest("POST", urls, body)
  129185. if err != nil {
  129186. return nil, err
  129187. }
  129188. req.Header = reqHeaders
  129189. googleapi.Expand(req.URL, map[string]string{
  129190. "project": c.project,
  129191. "region": c.region,
  129192. "resource": c.resource,
  129193. })
  129194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129195. }
  129196. // Do executes the "compute.subnetworks.testIamPermissions" call.
  129197. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  129198. // non-2xx status code is an error. Response headers are in either
  129199. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  129200. // returned at all) in error.(*googleapi.Error).Header. Use
  129201. // googleapi.IsNotModified to check whether the returned error was
  129202. // because http.StatusNotModified was returned.
  129203. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  129204. gensupport.SetOptions(c.urlParams_, opts...)
  129205. res, err := c.doRequest("json")
  129206. if res != nil && res.StatusCode == http.StatusNotModified {
  129207. if res.Body != nil {
  129208. res.Body.Close()
  129209. }
  129210. return nil, &googleapi.Error{
  129211. Code: res.StatusCode,
  129212. Header: res.Header,
  129213. }
  129214. }
  129215. if err != nil {
  129216. return nil, err
  129217. }
  129218. defer googleapi.CloseBody(res)
  129219. if err := googleapi.CheckResponse(res); err != nil {
  129220. return nil, err
  129221. }
  129222. ret := &TestPermissionsResponse{
  129223. ServerResponse: googleapi.ServerResponse{
  129224. Header: res.Header,
  129225. HTTPStatusCode: res.StatusCode,
  129226. },
  129227. }
  129228. target := &ret
  129229. if err := gensupport.DecodeResponse(target, res); err != nil {
  129230. return nil, err
  129231. }
  129232. return ret, nil
  129233. // {
  129234. // "description": "Returns permissions that a caller has on the specified resource.",
  129235. // "httpMethod": "POST",
  129236. // "id": "compute.subnetworks.testIamPermissions",
  129237. // "parameterOrder": [
  129238. // "project",
  129239. // "region",
  129240. // "resource"
  129241. // ],
  129242. // "parameters": {
  129243. // "project": {
  129244. // "description": "Project ID for this request.",
  129245. // "location": "path",
  129246. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129247. // "required": true,
  129248. // "type": "string"
  129249. // },
  129250. // "region": {
  129251. // "description": "The name of the region for this request.",
  129252. // "location": "path",
  129253. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  129254. // "required": true,
  129255. // "type": "string"
  129256. // },
  129257. // "resource": {
  129258. // "description": "Name or id of the resource for this request.",
  129259. // "location": "path",
  129260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  129261. // "required": true,
  129262. // "type": "string"
  129263. // }
  129264. // },
  129265. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  129266. // "request": {
  129267. // "$ref": "TestPermissionsRequest"
  129268. // },
  129269. // "response": {
  129270. // "$ref": "TestPermissionsResponse"
  129271. // },
  129272. // "scopes": [
  129273. // "https://www.googleapis.com/auth/cloud-platform",
  129274. // "https://www.googleapis.com/auth/compute",
  129275. // "https://www.googleapis.com/auth/compute.readonly"
  129276. // ]
  129277. // }
  129278. }
  129279. // method id "compute.targetHttpProxies.aggregatedList":
  129280. type TargetHttpProxiesAggregatedListCall struct {
  129281. s *Service
  129282. project string
  129283. urlParams_ gensupport.URLParams
  129284. ifNoneMatch_ string
  129285. ctx_ context.Context
  129286. header_ http.Header
  129287. }
  129288. // AggregatedList: Retrieves the list of all TargetHttpProxy resources,
  129289. // regional and global, available to the specified project.
  129290. func (r *TargetHttpProxiesService) AggregatedList(project string) *TargetHttpProxiesAggregatedListCall {
  129291. c := &TargetHttpProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129292. c.project = project
  129293. return c
  129294. }
  129295. // Filter sets the optional parameter "filter": A filter expression that
  129296. // filters resources listed in the response. The expression must specify
  129297. // the field name, a comparison operator, and the value that you want to
  129298. // use for filtering. The value must be a string, a number, or a
  129299. // boolean. The comparison operator must be either =, !=, >, or <.
  129300. //
  129301. // For example, if you are filtering Compute Engine instances, you can
  129302. // exclude instances named example-instance by specifying name !=
  129303. // example-instance.
  129304. //
  129305. // You can also filter nested fields. For example, you could specify
  129306. // scheduling.automaticRestart = false to include instances only if they
  129307. // are not scheduled for automatic restarts. You can use filtering on
  129308. // nested fields to filter based on resource labels.
  129309. //
  129310. // To filter on multiple expressions, provide each separate expression
  129311. // within parentheses. For example, (scheduling.automaticRestart = true)
  129312. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  129313. // AND expression. However, you can include AND and OR expressions
  129314. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  129315. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  129316. // true).
  129317. func (c *TargetHttpProxiesAggregatedListCall) Filter(filter string) *TargetHttpProxiesAggregatedListCall {
  129318. c.urlParams_.Set("filter", filter)
  129319. return c
  129320. }
  129321. // MaxResults sets the optional parameter "maxResults": The maximum
  129322. // number of results per page that should be returned. If the number of
  129323. // available results is larger than maxResults, Compute Engine returns a
  129324. // nextPageToken that can be used to get the next page of results in
  129325. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  129326. // (Default: 500)
  129327. func (c *TargetHttpProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpProxiesAggregatedListCall {
  129328. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  129329. return c
  129330. }
  129331. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  129332. // a certain order. By default, results are returned in alphanumerical
  129333. // order based on the resource name.
  129334. //
  129335. // You can also sort results in descending order based on the creation
  129336. // timestamp using orderBy="creationTimestamp desc". This sorts results
  129337. // based on the creationTimestamp field in reverse chronological order
  129338. // (newest result first). Use this to sort resources like operations so
  129339. // that the newest operation is returned first.
  129340. //
  129341. // Currently, only sorting by name or creationTimestamp desc is
  129342. // supported.
  129343. func (c *TargetHttpProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpProxiesAggregatedListCall {
  129344. c.urlParams_.Set("orderBy", orderBy)
  129345. return c
  129346. }
  129347. // PageToken sets the optional parameter "pageToken": Specifies a page
  129348. // token to use. Set pageToken to the nextPageToken returned by a
  129349. // previous list request to get the next page of results.
  129350. func (c *TargetHttpProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpProxiesAggregatedListCall {
  129351. c.urlParams_.Set("pageToken", pageToken)
  129352. return c
  129353. }
  129354. // Fields allows partial responses to be retrieved. See
  129355. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129356. // for more information.
  129357. func (c *TargetHttpProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesAggregatedListCall {
  129358. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129359. return c
  129360. }
  129361. // IfNoneMatch sets the optional parameter which makes the operation
  129362. // fail if the object's ETag matches the given value. This is useful for
  129363. // getting updates only after the object has changed since the last
  129364. // request. Use googleapi.IsNotModified to check whether the response
  129365. // error from Do is the result of In-None-Match.
  129366. func (c *TargetHttpProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesAggregatedListCall {
  129367. c.ifNoneMatch_ = entityTag
  129368. return c
  129369. }
  129370. // Context sets the context to be used in this call's Do method. Any
  129371. // pending HTTP request will be aborted if the provided context is
  129372. // canceled.
  129373. func (c *TargetHttpProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpProxiesAggregatedListCall {
  129374. c.ctx_ = ctx
  129375. return c
  129376. }
  129377. // Header returns an http.Header that can be modified by the caller to
  129378. // add HTTP headers to the request.
  129379. func (c *TargetHttpProxiesAggregatedListCall) Header() http.Header {
  129380. if c.header_ == nil {
  129381. c.header_ = make(http.Header)
  129382. }
  129383. return c.header_
  129384. }
  129385. func (c *TargetHttpProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  129386. reqHeaders := make(http.Header)
  129387. for k, v := range c.header_ {
  129388. reqHeaders[k] = v
  129389. }
  129390. reqHeaders.Set("User-Agent", c.s.userAgent())
  129391. if c.ifNoneMatch_ != "" {
  129392. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  129393. }
  129394. var body io.Reader = nil
  129395. c.urlParams_.Set("alt", alt)
  129396. c.urlParams_.Set("prettyPrint", "false")
  129397. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetHttpProxies")
  129398. urls += "?" + c.urlParams_.Encode()
  129399. req, err := http.NewRequest("GET", urls, body)
  129400. if err != nil {
  129401. return nil, err
  129402. }
  129403. req.Header = reqHeaders
  129404. googleapi.Expand(req.URL, map[string]string{
  129405. "project": c.project,
  129406. })
  129407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129408. }
  129409. // Do executes the "compute.targetHttpProxies.aggregatedList" call.
  129410. // Exactly one of *TargetHttpProxyAggregatedList or error will be
  129411. // non-nil. Any non-2xx status code is an error. Response headers are in
  129412. // either *TargetHttpProxyAggregatedList.ServerResponse.Header or (if a
  129413. // response was returned at all) in error.(*googleapi.Error).Header. Use
  129414. // googleapi.IsNotModified to check whether the returned error was
  129415. // because http.StatusNotModified was returned.
  129416. func (c *TargetHttpProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyAggregatedList, error) {
  129417. gensupport.SetOptions(c.urlParams_, opts...)
  129418. res, err := c.doRequest("json")
  129419. if res != nil && res.StatusCode == http.StatusNotModified {
  129420. if res.Body != nil {
  129421. res.Body.Close()
  129422. }
  129423. return nil, &googleapi.Error{
  129424. Code: res.StatusCode,
  129425. Header: res.Header,
  129426. }
  129427. }
  129428. if err != nil {
  129429. return nil, err
  129430. }
  129431. defer googleapi.CloseBody(res)
  129432. if err := googleapi.CheckResponse(res); err != nil {
  129433. return nil, err
  129434. }
  129435. ret := &TargetHttpProxyAggregatedList{
  129436. ServerResponse: googleapi.ServerResponse{
  129437. Header: res.Header,
  129438. HTTPStatusCode: res.StatusCode,
  129439. },
  129440. }
  129441. target := &ret
  129442. if err := gensupport.DecodeResponse(target, res); err != nil {
  129443. return nil, err
  129444. }
  129445. return ret, nil
  129446. // {
  129447. // "description": "Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project.",
  129448. // "httpMethod": "GET",
  129449. // "id": "compute.targetHttpProxies.aggregatedList",
  129450. // "parameterOrder": [
  129451. // "project"
  129452. // ],
  129453. // "parameters": {
  129454. // "filter": {
  129455. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  129456. // "location": "query",
  129457. // "type": "string"
  129458. // },
  129459. // "maxResults": {
  129460. // "default": "500",
  129461. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  129462. // "format": "uint32",
  129463. // "location": "query",
  129464. // "minimum": "0",
  129465. // "type": "integer"
  129466. // },
  129467. // "orderBy": {
  129468. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  129469. // "location": "query",
  129470. // "type": "string"
  129471. // },
  129472. // "pageToken": {
  129473. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  129474. // "location": "query",
  129475. // "type": "string"
  129476. // },
  129477. // "project": {
  129478. // "description": "Name of the project scoping this request.",
  129479. // "location": "path",
  129480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129481. // "required": true,
  129482. // "type": "string"
  129483. // }
  129484. // },
  129485. // "path": "{project}/aggregated/targetHttpProxies",
  129486. // "response": {
  129487. // "$ref": "TargetHttpProxyAggregatedList"
  129488. // },
  129489. // "scopes": [
  129490. // "https://www.googleapis.com/auth/cloud-platform",
  129491. // "https://www.googleapis.com/auth/compute",
  129492. // "https://www.googleapis.com/auth/compute.readonly"
  129493. // ]
  129494. // }
  129495. }
  129496. // Pages invokes f for each page of results.
  129497. // A non-nil error returned from f will halt the iteration.
  129498. // The provided context supersedes any context provided to the Context method.
  129499. func (c *TargetHttpProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpProxyAggregatedList) error) error {
  129500. c.ctx_ = ctx
  129501. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  129502. for {
  129503. x, err := c.Do()
  129504. if err != nil {
  129505. return err
  129506. }
  129507. if err := f(x); err != nil {
  129508. return err
  129509. }
  129510. if x.NextPageToken == "" {
  129511. return nil
  129512. }
  129513. c.PageToken(x.NextPageToken)
  129514. }
  129515. }
  129516. // method id "compute.targetHttpProxies.delete":
  129517. type TargetHttpProxiesDeleteCall struct {
  129518. s *Service
  129519. project string
  129520. targetHttpProxy string
  129521. urlParams_ gensupport.URLParams
  129522. ctx_ context.Context
  129523. header_ http.Header
  129524. }
  129525. // Delete: Deletes the specified TargetHttpProxy resource.
  129526. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  129527. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  129528. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129529. c.project = project
  129530. c.targetHttpProxy = targetHttpProxy
  129531. return c
  129532. }
  129533. // RequestId sets the optional parameter "requestId": An optional
  129534. // request ID to identify requests. Specify a unique request ID so that
  129535. // if you must retry your request, the server will know to ignore the
  129536. // request if it has already been completed.
  129537. //
  129538. // For example, consider a situation where you make an initial request
  129539. // and the request times out. If you make the request again with the
  129540. // same request ID, the server can check if original operation with the
  129541. // same request ID was received, and if so, will ignore the second
  129542. // request. This prevents clients from accidentally creating duplicate
  129543. // commitments.
  129544. //
  129545. // The request ID must be a valid UUID with the exception that zero UUID
  129546. // is not supported (00000000-0000-0000-0000-000000000000).
  129547. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  129548. c.urlParams_.Set("requestId", requestId)
  129549. return c
  129550. }
  129551. // Fields allows partial responses to be retrieved. See
  129552. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129553. // for more information.
  129554. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  129555. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129556. return c
  129557. }
  129558. // Context sets the context to be used in this call's Do method. Any
  129559. // pending HTTP request will be aborted if the provided context is
  129560. // canceled.
  129561. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  129562. c.ctx_ = ctx
  129563. return c
  129564. }
  129565. // Header returns an http.Header that can be modified by the caller to
  129566. // add HTTP headers to the request.
  129567. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  129568. if c.header_ == nil {
  129569. c.header_ = make(http.Header)
  129570. }
  129571. return c.header_
  129572. }
  129573. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  129574. reqHeaders := make(http.Header)
  129575. for k, v := range c.header_ {
  129576. reqHeaders[k] = v
  129577. }
  129578. reqHeaders.Set("User-Agent", c.s.userAgent())
  129579. var body io.Reader = nil
  129580. c.urlParams_.Set("alt", alt)
  129581. c.urlParams_.Set("prettyPrint", "false")
  129582. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  129583. urls += "?" + c.urlParams_.Encode()
  129584. req, err := http.NewRequest("DELETE", urls, body)
  129585. if err != nil {
  129586. return nil, err
  129587. }
  129588. req.Header = reqHeaders
  129589. googleapi.Expand(req.URL, map[string]string{
  129590. "project": c.project,
  129591. "targetHttpProxy": c.targetHttpProxy,
  129592. })
  129593. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129594. }
  129595. // Do executes the "compute.targetHttpProxies.delete" call.
  129596. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  129597. // status code is an error. Response headers are in either
  129598. // *Operation.ServerResponse.Header or (if a response was returned at
  129599. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129600. // to check whether the returned error was because
  129601. // http.StatusNotModified was returned.
  129602. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  129603. gensupport.SetOptions(c.urlParams_, opts...)
  129604. res, err := c.doRequest("json")
  129605. if res != nil && res.StatusCode == http.StatusNotModified {
  129606. if res.Body != nil {
  129607. res.Body.Close()
  129608. }
  129609. return nil, &googleapi.Error{
  129610. Code: res.StatusCode,
  129611. Header: res.Header,
  129612. }
  129613. }
  129614. if err != nil {
  129615. return nil, err
  129616. }
  129617. defer googleapi.CloseBody(res)
  129618. if err := googleapi.CheckResponse(res); err != nil {
  129619. return nil, err
  129620. }
  129621. ret := &Operation{
  129622. ServerResponse: googleapi.ServerResponse{
  129623. Header: res.Header,
  129624. HTTPStatusCode: res.StatusCode,
  129625. },
  129626. }
  129627. target := &ret
  129628. if err := gensupport.DecodeResponse(target, res); err != nil {
  129629. return nil, err
  129630. }
  129631. return ret, nil
  129632. // {
  129633. // "description": "Deletes the specified TargetHttpProxy resource.",
  129634. // "httpMethod": "DELETE",
  129635. // "id": "compute.targetHttpProxies.delete",
  129636. // "parameterOrder": [
  129637. // "project",
  129638. // "targetHttpProxy"
  129639. // ],
  129640. // "parameters": {
  129641. // "project": {
  129642. // "description": "Project ID for this request.",
  129643. // "location": "path",
  129644. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129645. // "required": true,
  129646. // "type": "string"
  129647. // },
  129648. // "requestId": {
  129649. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129650. // "location": "query",
  129651. // "type": "string"
  129652. // },
  129653. // "targetHttpProxy": {
  129654. // "description": "Name of the TargetHttpProxy resource to delete.",
  129655. // "location": "path",
  129656. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  129657. // "required": true,
  129658. // "type": "string"
  129659. // }
  129660. // },
  129661. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  129662. // "response": {
  129663. // "$ref": "Operation"
  129664. // },
  129665. // "scopes": [
  129666. // "https://www.googleapis.com/auth/cloud-platform",
  129667. // "https://www.googleapis.com/auth/compute"
  129668. // ]
  129669. // }
  129670. }
  129671. // method id "compute.targetHttpProxies.get":
  129672. type TargetHttpProxiesGetCall struct {
  129673. s *Service
  129674. project string
  129675. targetHttpProxy string
  129676. urlParams_ gensupport.URLParams
  129677. ifNoneMatch_ string
  129678. ctx_ context.Context
  129679. header_ http.Header
  129680. }
  129681. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  129682. // available target HTTP proxies by making a list() request.
  129683. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  129684. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  129685. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129686. c.project = project
  129687. c.targetHttpProxy = targetHttpProxy
  129688. return c
  129689. }
  129690. // Fields allows partial responses to be retrieved. See
  129691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129692. // for more information.
  129693. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  129694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129695. return c
  129696. }
  129697. // IfNoneMatch sets the optional parameter which makes the operation
  129698. // fail if the object's ETag matches the given value. This is useful for
  129699. // getting updates only after the object has changed since the last
  129700. // request. Use googleapi.IsNotModified to check whether the response
  129701. // error from Do is the result of In-None-Match.
  129702. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  129703. c.ifNoneMatch_ = entityTag
  129704. return c
  129705. }
  129706. // Context sets the context to be used in this call's Do method. Any
  129707. // pending HTTP request will be aborted if the provided context is
  129708. // canceled.
  129709. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  129710. c.ctx_ = ctx
  129711. return c
  129712. }
  129713. // Header returns an http.Header that can be modified by the caller to
  129714. // add HTTP headers to the request.
  129715. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  129716. if c.header_ == nil {
  129717. c.header_ = make(http.Header)
  129718. }
  129719. return c.header_
  129720. }
  129721. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  129722. reqHeaders := make(http.Header)
  129723. for k, v := range c.header_ {
  129724. reqHeaders[k] = v
  129725. }
  129726. reqHeaders.Set("User-Agent", c.s.userAgent())
  129727. if c.ifNoneMatch_ != "" {
  129728. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  129729. }
  129730. var body io.Reader = nil
  129731. c.urlParams_.Set("alt", alt)
  129732. c.urlParams_.Set("prettyPrint", "false")
  129733. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  129734. urls += "?" + c.urlParams_.Encode()
  129735. req, err := http.NewRequest("GET", urls, body)
  129736. if err != nil {
  129737. return nil, err
  129738. }
  129739. req.Header = reqHeaders
  129740. googleapi.Expand(req.URL, map[string]string{
  129741. "project": c.project,
  129742. "targetHttpProxy": c.targetHttpProxy,
  129743. })
  129744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129745. }
  129746. // Do executes the "compute.targetHttpProxies.get" call.
  129747. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  129748. // status code is an error. Response headers are in either
  129749. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  129750. // at all) in error.(*googleapi.Error).Header. Use
  129751. // googleapi.IsNotModified to check whether the returned error was
  129752. // because http.StatusNotModified was returned.
  129753. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  129754. gensupport.SetOptions(c.urlParams_, opts...)
  129755. res, err := c.doRequest("json")
  129756. if res != nil && res.StatusCode == http.StatusNotModified {
  129757. if res.Body != nil {
  129758. res.Body.Close()
  129759. }
  129760. return nil, &googleapi.Error{
  129761. Code: res.StatusCode,
  129762. Header: res.Header,
  129763. }
  129764. }
  129765. if err != nil {
  129766. return nil, err
  129767. }
  129768. defer googleapi.CloseBody(res)
  129769. if err := googleapi.CheckResponse(res); err != nil {
  129770. return nil, err
  129771. }
  129772. ret := &TargetHttpProxy{
  129773. ServerResponse: googleapi.ServerResponse{
  129774. Header: res.Header,
  129775. HTTPStatusCode: res.StatusCode,
  129776. },
  129777. }
  129778. target := &ret
  129779. if err := gensupport.DecodeResponse(target, res); err != nil {
  129780. return nil, err
  129781. }
  129782. return ret, nil
  129783. // {
  129784. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  129785. // "httpMethod": "GET",
  129786. // "id": "compute.targetHttpProxies.get",
  129787. // "parameterOrder": [
  129788. // "project",
  129789. // "targetHttpProxy"
  129790. // ],
  129791. // "parameters": {
  129792. // "project": {
  129793. // "description": "Project ID for this request.",
  129794. // "location": "path",
  129795. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129796. // "required": true,
  129797. // "type": "string"
  129798. // },
  129799. // "targetHttpProxy": {
  129800. // "description": "Name of the TargetHttpProxy resource to return.",
  129801. // "location": "path",
  129802. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  129803. // "required": true,
  129804. // "type": "string"
  129805. // }
  129806. // },
  129807. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  129808. // "response": {
  129809. // "$ref": "TargetHttpProxy"
  129810. // },
  129811. // "scopes": [
  129812. // "https://www.googleapis.com/auth/cloud-platform",
  129813. // "https://www.googleapis.com/auth/compute",
  129814. // "https://www.googleapis.com/auth/compute.readonly"
  129815. // ]
  129816. // }
  129817. }
  129818. // method id "compute.targetHttpProxies.insert":
  129819. type TargetHttpProxiesInsertCall struct {
  129820. s *Service
  129821. project string
  129822. targethttpproxy *TargetHttpProxy
  129823. urlParams_ gensupport.URLParams
  129824. ctx_ context.Context
  129825. header_ http.Header
  129826. }
  129827. // Insert: Creates a TargetHttpProxy resource in the specified project
  129828. // using the data included in the request.
  129829. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  129830. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  129831. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129832. c.project = project
  129833. c.targethttpproxy = targethttpproxy
  129834. return c
  129835. }
  129836. // RequestId sets the optional parameter "requestId": An optional
  129837. // request ID to identify requests. Specify a unique request ID so that
  129838. // if you must retry your request, the server will know to ignore the
  129839. // request if it has already been completed.
  129840. //
  129841. // For example, consider a situation where you make an initial request
  129842. // and the request times out. If you make the request again with the
  129843. // same request ID, the server can check if original operation with the
  129844. // same request ID was received, and if so, will ignore the second
  129845. // request. This prevents clients from accidentally creating duplicate
  129846. // commitments.
  129847. //
  129848. // The request ID must be a valid UUID with the exception that zero UUID
  129849. // is not supported (00000000-0000-0000-0000-000000000000).
  129850. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  129851. c.urlParams_.Set("requestId", requestId)
  129852. return c
  129853. }
  129854. // Fields allows partial responses to be retrieved. See
  129855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  129856. // for more information.
  129857. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  129858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  129859. return c
  129860. }
  129861. // Context sets the context to be used in this call's Do method. Any
  129862. // pending HTTP request will be aborted if the provided context is
  129863. // canceled.
  129864. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  129865. c.ctx_ = ctx
  129866. return c
  129867. }
  129868. // Header returns an http.Header that can be modified by the caller to
  129869. // add HTTP headers to the request.
  129870. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  129871. if c.header_ == nil {
  129872. c.header_ = make(http.Header)
  129873. }
  129874. return c.header_
  129875. }
  129876. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  129877. reqHeaders := make(http.Header)
  129878. for k, v := range c.header_ {
  129879. reqHeaders[k] = v
  129880. }
  129881. reqHeaders.Set("User-Agent", c.s.userAgent())
  129882. var body io.Reader = nil
  129883. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  129884. if err != nil {
  129885. return nil, err
  129886. }
  129887. reqHeaders.Set("Content-Type", "application/json")
  129888. c.urlParams_.Set("alt", alt)
  129889. c.urlParams_.Set("prettyPrint", "false")
  129890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  129891. urls += "?" + c.urlParams_.Encode()
  129892. req, err := http.NewRequest("POST", urls, body)
  129893. if err != nil {
  129894. return nil, err
  129895. }
  129896. req.Header = reqHeaders
  129897. googleapi.Expand(req.URL, map[string]string{
  129898. "project": c.project,
  129899. })
  129900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  129901. }
  129902. // Do executes the "compute.targetHttpProxies.insert" call.
  129903. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  129904. // status code is an error. Response headers are in either
  129905. // *Operation.ServerResponse.Header or (if a response was returned at
  129906. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  129907. // to check whether the returned error was because
  129908. // http.StatusNotModified was returned.
  129909. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  129910. gensupport.SetOptions(c.urlParams_, opts...)
  129911. res, err := c.doRequest("json")
  129912. if res != nil && res.StatusCode == http.StatusNotModified {
  129913. if res.Body != nil {
  129914. res.Body.Close()
  129915. }
  129916. return nil, &googleapi.Error{
  129917. Code: res.StatusCode,
  129918. Header: res.Header,
  129919. }
  129920. }
  129921. if err != nil {
  129922. return nil, err
  129923. }
  129924. defer googleapi.CloseBody(res)
  129925. if err := googleapi.CheckResponse(res); err != nil {
  129926. return nil, err
  129927. }
  129928. ret := &Operation{
  129929. ServerResponse: googleapi.ServerResponse{
  129930. Header: res.Header,
  129931. HTTPStatusCode: res.StatusCode,
  129932. },
  129933. }
  129934. target := &ret
  129935. if err := gensupport.DecodeResponse(target, res); err != nil {
  129936. return nil, err
  129937. }
  129938. return ret, nil
  129939. // {
  129940. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  129941. // "httpMethod": "POST",
  129942. // "id": "compute.targetHttpProxies.insert",
  129943. // "parameterOrder": [
  129944. // "project"
  129945. // ],
  129946. // "parameters": {
  129947. // "project": {
  129948. // "description": "Project ID for this request.",
  129949. // "location": "path",
  129950. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  129951. // "required": true,
  129952. // "type": "string"
  129953. // },
  129954. // "requestId": {
  129955. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  129956. // "location": "query",
  129957. // "type": "string"
  129958. // }
  129959. // },
  129960. // "path": "{project}/global/targetHttpProxies",
  129961. // "request": {
  129962. // "$ref": "TargetHttpProxy"
  129963. // },
  129964. // "response": {
  129965. // "$ref": "Operation"
  129966. // },
  129967. // "scopes": [
  129968. // "https://www.googleapis.com/auth/cloud-platform",
  129969. // "https://www.googleapis.com/auth/compute"
  129970. // ]
  129971. // }
  129972. }
  129973. // method id "compute.targetHttpProxies.list":
  129974. type TargetHttpProxiesListCall struct {
  129975. s *Service
  129976. project string
  129977. urlParams_ gensupport.URLParams
  129978. ifNoneMatch_ string
  129979. ctx_ context.Context
  129980. header_ http.Header
  129981. }
  129982. // List: Retrieves the list of TargetHttpProxy resources available to
  129983. // the specified project.
  129984. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  129985. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  129986. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  129987. c.project = project
  129988. return c
  129989. }
  129990. // Filter sets the optional parameter "filter": A filter expression that
  129991. // filters resources listed in the response. The expression must specify
  129992. // the field name, a comparison operator, and the value that you want to
  129993. // use for filtering. The value must be a string, a number, or a
  129994. // boolean. The comparison operator must be either =, !=, >, or <.
  129995. //
  129996. // For example, if you are filtering Compute Engine instances, you can
  129997. // exclude instances named example-instance by specifying name !=
  129998. // example-instance.
  129999. //
  130000. // You can also filter nested fields. For example, you could specify
  130001. // scheduling.automaticRestart = false to include instances only if they
  130002. // are not scheduled for automatic restarts. You can use filtering on
  130003. // nested fields to filter based on resource labels.
  130004. //
  130005. // To filter on multiple expressions, provide each separate expression
  130006. // within parentheses. For example, (scheduling.automaticRestart = true)
  130007. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  130008. // AND expression. However, you can include AND and OR expressions
  130009. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  130010. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  130011. // true).
  130012. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  130013. c.urlParams_.Set("filter", filter)
  130014. return c
  130015. }
  130016. // MaxResults sets the optional parameter "maxResults": The maximum
  130017. // number of results per page that should be returned. If the number of
  130018. // available results is larger than maxResults, Compute Engine returns a
  130019. // nextPageToken that can be used to get the next page of results in
  130020. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  130021. // (Default: 500)
  130022. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  130023. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  130024. return c
  130025. }
  130026. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  130027. // a certain order. By default, results are returned in alphanumerical
  130028. // order based on the resource name.
  130029. //
  130030. // You can also sort results in descending order based on the creation
  130031. // timestamp using orderBy="creationTimestamp desc". This sorts results
  130032. // based on the creationTimestamp field in reverse chronological order
  130033. // (newest result first). Use this to sort resources like operations so
  130034. // that the newest operation is returned first.
  130035. //
  130036. // Currently, only sorting by name or creationTimestamp desc is
  130037. // supported.
  130038. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  130039. c.urlParams_.Set("orderBy", orderBy)
  130040. return c
  130041. }
  130042. // PageToken sets the optional parameter "pageToken": Specifies a page
  130043. // token to use. Set pageToken to the nextPageToken returned by a
  130044. // previous list request to get the next page of results.
  130045. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  130046. c.urlParams_.Set("pageToken", pageToken)
  130047. return c
  130048. }
  130049. // Fields allows partial responses to be retrieved. See
  130050. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130051. // for more information.
  130052. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  130053. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130054. return c
  130055. }
  130056. // IfNoneMatch sets the optional parameter which makes the operation
  130057. // fail if the object's ETag matches the given value. This is useful for
  130058. // getting updates only after the object has changed since the last
  130059. // request. Use googleapi.IsNotModified to check whether the response
  130060. // error from Do is the result of In-None-Match.
  130061. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  130062. c.ifNoneMatch_ = entityTag
  130063. return c
  130064. }
  130065. // Context sets the context to be used in this call's Do method. Any
  130066. // pending HTTP request will be aborted if the provided context is
  130067. // canceled.
  130068. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  130069. c.ctx_ = ctx
  130070. return c
  130071. }
  130072. // Header returns an http.Header that can be modified by the caller to
  130073. // add HTTP headers to the request.
  130074. func (c *TargetHttpProxiesListCall) Header() http.Header {
  130075. if c.header_ == nil {
  130076. c.header_ = make(http.Header)
  130077. }
  130078. return c.header_
  130079. }
  130080. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  130081. reqHeaders := make(http.Header)
  130082. for k, v := range c.header_ {
  130083. reqHeaders[k] = v
  130084. }
  130085. reqHeaders.Set("User-Agent", c.s.userAgent())
  130086. if c.ifNoneMatch_ != "" {
  130087. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130088. }
  130089. var body io.Reader = nil
  130090. c.urlParams_.Set("alt", alt)
  130091. c.urlParams_.Set("prettyPrint", "false")
  130092. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  130093. urls += "?" + c.urlParams_.Encode()
  130094. req, err := http.NewRequest("GET", urls, body)
  130095. if err != nil {
  130096. return nil, err
  130097. }
  130098. req.Header = reqHeaders
  130099. googleapi.Expand(req.URL, map[string]string{
  130100. "project": c.project,
  130101. })
  130102. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130103. }
  130104. // Do executes the "compute.targetHttpProxies.list" call.
  130105. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  130106. // non-2xx status code is an error. Response headers are in either
  130107. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  130108. // returned at all) in error.(*googleapi.Error).Header. Use
  130109. // googleapi.IsNotModified to check whether the returned error was
  130110. // because http.StatusNotModified was returned.
  130111. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  130112. gensupport.SetOptions(c.urlParams_, opts...)
  130113. res, err := c.doRequest("json")
  130114. if res != nil && res.StatusCode == http.StatusNotModified {
  130115. if res.Body != nil {
  130116. res.Body.Close()
  130117. }
  130118. return nil, &googleapi.Error{
  130119. Code: res.StatusCode,
  130120. Header: res.Header,
  130121. }
  130122. }
  130123. if err != nil {
  130124. return nil, err
  130125. }
  130126. defer googleapi.CloseBody(res)
  130127. if err := googleapi.CheckResponse(res); err != nil {
  130128. return nil, err
  130129. }
  130130. ret := &TargetHttpProxyList{
  130131. ServerResponse: googleapi.ServerResponse{
  130132. Header: res.Header,
  130133. HTTPStatusCode: res.StatusCode,
  130134. },
  130135. }
  130136. target := &ret
  130137. if err := gensupport.DecodeResponse(target, res); err != nil {
  130138. return nil, err
  130139. }
  130140. return ret, nil
  130141. // {
  130142. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  130143. // "httpMethod": "GET",
  130144. // "id": "compute.targetHttpProxies.list",
  130145. // "parameterOrder": [
  130146. // "project"
  130147. // ],
  130148. // "parameters": {
  130149. // "filter": {
  130150. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  130151. // "location": "query",
  130152. // "type": "string"
  130153. // },
  130154. // "maxResults": {
  130155. // "default": "500",
  130156. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  130157. // "format": "uint32",
  130158. // "location": "query",
  130159. // "minimum": "0",
  130160. // "type": "integer"
  130161. // },
  130162. // "orderBy": {
  130163. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  130164. // "location": "query",
  130165. // "type": "string"
  130166. // },
  130167. // "pageToken": {
  130168. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  130169. // "location": "query",
  130170. // "type": "string"
  130171. // },
  130172. // "project": {
  130173. // "description": "Project ID for this request.",
  130174. // "location": "path",
  130175. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130176. // "required": true,
  130177. // "type": "string"
  130178. // }
  130179. // },
  130180. // "path": "{project}/global/targetHttpProxies",
  130181. // "response": {
  130182. // "$ref": "TargetHttpProxyList"
  130183. // },
  130184. // "scopes": [
  130185. // "https://www.googleapis.com/auth/cloud-platform",
  130186. // "https://www.googleapis.com/auth/compute",
  130187. // "https://www.googleapis.com/auth/compute.readonly"
  130188. // ]
  130189. // }
  130190. }
  130191. // Pages invokes f for each page of results.
  130192. // A non-nil error returned from f will halt the iteration.
  130193. // The provided context supersedes any context provided to the Context method.
  130194. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  130195. c.ctx_ = ctx
  130196. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  130197. for {
  130198. x, err := c.Do()
  130199. if err != nil {
  130200. return err
  130201. }
  130202. if err := f(x); err != nil {
  130203. return err
  130204. }
  130205. if x.NextPageToken == "" {
  130206. return nil
  130207. }
  130208. c.PageToken(x.NextPageToken)
  130209. }
  130210. }
  130211. // method id "compute.targetHttpProxies.setUrlMap":
  130212. type TargetHttpProxiesSetUrlMapCall struct {
  130213. s *Service
  130214. project string
  130215. targetHttpProxy string
  130216. urlmapreference *UrlMapReference
  130217. urlParams_ gensupport.URLParams
  130218. ctx_ context.Context
  130219. header_ http.Header
  130220. }
  130221. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  130222. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  130223. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  130224. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130225. c.project = project
  130226. c.targetHttpProxy = targetHttpProxy
  130227. c.urlmapreference = urlmapreference
  130228. return c
  130229. }
  130230. // RequestId sets the optional parameter "requestId": An optional
  130231. // request ID to identify requests. Specify a unique request ID so that
  130232. // if you must retry your request, the server will know to ignore the
  130233. // request if it has already been completed.
  130234. //
  130235. // For example, consider a situation where you make an initial request
  130236. // and the request times out. If you make the request again with the
  130237. // same request ID, the server can check if original operation with the
  130238. // same request ID was received, and if so, will ignore the second
  130239. // request. This prevents clients from accidentally creating duplicate
  130240. // commitments.
  130241. //
  130242. // The request ID must be a valid UUID with the exception that zero UUID
  130243. // is not supported (00000000-0000-0000-0000-000000000000).
  130244. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  130245. c.urlParams_.Set("requestId", requestId)
  130246. return c
  130247. }
  130248. // Fields allows partial responses to be retrieved. See
  130249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130250. // for more information.
  130251. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  130252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130253. return c
  130254. }
  130255. // Context sets the context to be used in this call's Do method. Any
  130256. // pending HTTP request will be aborted if the provided context is
  130257. // canceled.
  130258. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  130259. c.ctx_ = ctx
  130260. return c
  130261. }
  130262. // Header returns an http.Header that can be modified by the caller to
  130263. // add HTTP headers to the request.
  130264. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  130265. if c.header_ == nil {
  130266. c.header_ = make(http.Header)
  130267. }
  130268. return c.header_
  130269. }
  130270. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  130271. reqHeaders := make(http.Header)
  130272. for k, v := range c.header_ {
  130273. reqHeaders[k] = v
  130274. }
  130275. reqHeaders.Set("User-Agent", c.s.userAgent())
  130276. var body io.Reader = nil
  130277. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  130278. if err != nil {
  130279. return nil, err
  130280. }
  130281. reqHeaders.Set("Content-Type", "application/json")
  130282. c.urlParams_.Set("alt", alt)
  130283. c.urlParams_.Set("prettyPrint", "false")
  130284. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  130285. urls += "?" + c.urlParams_.Encode()
  130286. req, err := http.NewRequest("POST", urls, body)
  130287. if err != nil {
  130288. return nil, err
  130289. }
  130290. req.Header = reqHeaders
  130291. googleapi.Expand(req.URL, map[string]string{
  130292. "project": c.project,
  130293. "targetHttpProxy": c.targetHttpProxy,
  130294. })
  130295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130296. }
  130297. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  130298. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  130299. // status code is an error. Response headers are in either
  130300. // *Operation.ServerResponse.Header or (if a response was returned at
  130301. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  130302. // to check whether the returned error was because
  130303. // http.StatusNotModified was returned.
  130304. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  130305. gensupport.SetOptions(c.urlParams_, opts...)
  130306. res, err := c.doRequest("json")
  130307. if res != nil && res.StatusCode == http.StatusNotModified {
  130308. if res.Body != nil {
  130309. res.Body.Close()
  130310. }
  130311. return nil, &googleapi.Error{
  130312. Code: res.StatusCode,
  130313. Header: res.Header,
  130314. }
  130315. }
  130316. if err != nil {
  130317. return nil, err
  130318. }
  130319. defer googleapi.CloseBody(res)
  130320. if err := googleapi.CheckResponse(res); err != nil {
  130321. return nil, err
  130322. }
  130323. ret := &Operation{
  130324. ServerResponse: googleapi.ServerResponse{
  130325. Header: res.Header,
  130326. HTTPStatusCode: res.StatusCode,
  130327. },
  130328. }
  130329. target := &ret
  130330. if err := gensupport.DecodeResponse(target, res); err != nil {
  130331. return nil, err
  130332. }
  130333. return ret, nil
  130334. // {
  130335. // "description": "Changes the URL map for TargetHttpProxy.",
  130336. // "httpMethod": "POST",
  130337. // "id": "compute.targetHttpProxies.setUrlMap",
  130338. // "parameterOrder": [
  130339. // "project",
  130340. // "targetHttpProxy"
  130341. // ],
  130342. // "parameters": {
  130343. // "project": {
  130344. // "description": "Project ID for this request.",
  130345. // "location": "path",
  130346. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130347. // "required": true,
  130348. // "type": "string"
  130349. // },
  130350. // "requestId": {
  130351. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  130352. // "location": "query",
  130353. // "type": "string"
  130354. // },
  130355. // "targetHttpProxy": {
  130356. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  130357. // "location": "path",
  130358. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130359. // "required": true,
  130360. // "type": "string"
  130361. // }
  130362. // },
  130363. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  130364. // "request": {
  130365. // "$ref": "UrlMapReference"
  130366. // },
  130367. // "response": {
  130368. // "$ref": "Operation"
  130369. // },
  130370. // "scopes": [
  130371. // "https://www.googleapis.com/auth/cloud-platform",
  130372. // "https://www.googleapis.com/auth/compute"
  130373. // ]
  130374. // }
  130375. }
  130376. // method id "compute.targetHttpProxies.testIamPermissions":
  130377. type TargetHttpProxiesTestIamPermissionsCall struct {
  130378. s *Service
  130379. project string
  130380. resource string
  130381. testpermissionsrequest *TestPermissionsRequest
  130382. urlParams_ gensupport.URLParams
  130383. ctx_ context.Context
  130384. header_ http.Header
  130385. }
  130386. // TestIamPermissions: Returns permissions that a caller has on the
  130387. // specified resource.
  130388. func (r *TargetHttpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpProxiesTestIamPermissionsCall {
  130389. c := &TargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130390. c.project = project
  130391. c.resource = resource
  130392. c.testpermissionsrequest = testpermissionsrequest
  130393. return c
  130394. }
  130395. // Fields allows partial responses to be retrieved. See
  130396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130397. // for more information.
  130398. func (c *TargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpProxiesTestIamPermissionsCall {
  130399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130400. return c
  130401. }
  130402. // Context sets the context to be used in this call's Do method. Any
  130403. // pending HTTP request will be aborted if the provided context is
  130404. // canceled.
  130405. func (c *TargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpProxiesTestIamPermissionsCall {
  130406. c.ctx_ = ctx
  130407. return c
  130408. }
  130409. // Header returns an http.Header that can be modified by the caller to
  130410. // add HTTP headers to the request.
  130411. func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  130412. if c.header_ == nil {
  130413. c.header_ = make(http.Header)
  130414. }
  130415. return c.header_
  130416. }
  130417. func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  130418. reqHeaders := make(http.Header)
  130419. for k, v := range c.header_ {
  130420. reqHeaders[k] = v
  130421. }
  130422. reqHeaders.Set("User-Agent", c.s.userAgent())
  130423. var body io.Reader = nil
  130424. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  130425. if err != nil {
  130426. return nil, err
  130427. }
  130428. reqHeaders.Set("Content-Type", "application/json")
  130429. c.urlParams_.Set("alt", alt)
  130430. c.urlParams_.Set("prettyPrint", "false")
  130431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{resource}/testIamPermissions")
  130432. urls += "?" + c.urlParams_.Encode()
  130433. req, err := http.NewRequest("POST", urls, body)
  130434. if err != nil {
  130435. return nil, err
  130436. }
  130437. req.Header = reqHeaders
  130438. googleapi.Expand(req.URL, map[string]string{
  130439. "project": c.project,
  130440. "resource": c.resource,
  130441. })
  130442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130443. }
  130444. // Do executes the "compute.targetHttpProxies.testIamPermissions" call.
  130445. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  130446. // non-2xx status code is an error. Response headers are in either
  130447. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  130448. // returned at all) in error.(*googleapi.Error).Header. Use
  130449. // googleapi.IsNotModified to check whether the returned error was
  130450. // because http.StatusNotModified was returned.
  130451. func (c *TargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  130452. gensupport.SetOptions(c.urlParams_, opts...)
  130453. res, err := c.doRequest("json")
  130454. if res != nil && res.StatusCode == http.StatusNotModified {
  130455. if res.Body != nil {
  130456. res.Body.Close()
  130457. }
  130458. return nil, &googleapi.Error{
  130459. Code: res.StatusCode,
  130460. Header: res.Header,
  130461. }
  130462. }
  130463. if err != nil {
  130464. return nil, err
  130465. }
  130466. defer googleapi.CloseBody(res)
  130467. if err := googleapi.CheckResponse(res); err != nil {
  130468. return nil, err
  130469. }
  130470. ret := &TestPermissionsResponse{
  130471. ServerResponse: googleapi.ServerResponse{
  130472. Header: res.Header,
  130473. HTTPStatusCode: res.StatusCode,
  130474. },
  130475. }
  130476. target := &ret
  130477. if err := gensupport.DecodeResponse(target, res); err != nil {
  130478. return nil, err
  130479. }
  130480. return ret, nil
  130481. // {
  130482. // "description": "Returns permissions that a caller has on the specified resource.",
  130483. // "httpMethod": "POST",
  130484. // "id": "compute.targetHttpProxies.testIamPermissions",
  130485. // "parameterOrder": [
  130486. // "project",
  130487. // "resource"
  130488. // ],
  130489. // "parameters": {
  130490. // "project": {
  130491. // "description": "Project ID for this request.",
  130492. // "location": "path",
  130493. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130494. // "required": true,
  130495. // "type": "string"
  130496. // },
  130497. // "resource": {
  130498. // "description": "Name or id of the resource for this request.",
  130499. // "location": "path",
  130500. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130501. // "required": true,
  130502. // "type": "string"
  130503. // }
  130504. // },
  130505. // "path": "{project}/global/targetHttpProxies/{resource}/testIamPermissions",
  130506. // "request": {
  130507. // "$ref": "TestPermissionsRequest"
  130508. // },
  130509. // "response": {
  130510. // "$ref": "TestPermissionsResponse"
  130511. // },
  130512. // "scopes": [
  130513. // "https://www.googleapis.com/auth/cloud-platform",
  130514. // "https://www.googleapis.com/auth/compute",
  130515. // "https://www.googleapis.com/auth/compute.readonly"
  130516. // ]
  130517. // }
  130518. }
  130519. // method id "compute.targetHttpsProxies.aggregatedList":
  130520. type TargetHttpsProxiesAggregatedListCall struct {
  130521. s *Service
  130522. project string
  130523. urlParams_ gensupport.URLParams
  130524. ifNoneMatch_ string
  130525. ctx_ context.Context
  130526. header_ http.Header
  130527. }
  130528. // AggregatedList: Retrieves the list of all TargetHttpsProxy resources,
  130529. // regional and global, available to the specified project.
  130530. func (r *TargetHttpsProxiesService) AggregatedList(project string) *TargetHttpsProxiesAggregatedListCall {
  130531. c := &TargetHttpsProxiesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130532. c.project = project
  130533. return c
  130534. }
  130535. // Filter sets the optional parameter "filter": A filter expression that
  130536. // filters resources listed in the response. The expression must specify
  130537. // the field name, a comparison operator, and the value that you want to
  130538. // use for filtering. The value must be a string, a number, or a
  130539. // boolean. The comparison operator must be either =, !=, >, or <.
  130540. //
  130541. // For example, if you are filtering Compute Engine instances, you can
  130542. // exclude instances named example-instance by specifying name !=
  130543. // example-instance.
  130544. //
  130545. // You can also filter nested fields. For example, you could specify
  130546. // scheduling.automaticRestart = false to include instances only if they
  130547. // are not scheduled for automatic restarts. You can use filtering on
  130548. // nested fields to filter based on resource labels.
  130549. //
  130550. // To filter on multiple expressions, provide each separate expression
  130551. // within parentheses. For example, (scheduling.automaticRestart = true)
  130552. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  130553. // AND expression. However, you can include AND and OR expressions
  130554. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  130555. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  130556. // true).
  130557. func (c *TargetHttpsProxiesAggregatedListCall) Filter(filter string) *TargetHttpsProxiesAggregatedListCall {
  130558. c.urlParams_.Set("filter", filter)
  130559. return c
  130560. }
  130561. // MaxResults sets the optional parameter "maxResults": The maximum
  130562. // number of results per page that should be returned. If the number of
  130563. // available results is larger than maxResults, Compute Engine returns a
  130564. // nextPageToken that can be used to get the next page of results in
  130565. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  130566. // (Default: 500)
  130567. func (c *TargetHttpsProxiesAggregatedListCall) MaxResults(maxResults int64) *TargetHttpsProxiesAggregatedListCall {
  130568. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  130569. return c
  130570. }
  130571. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  130572. // a certain order. By default, results are returned in alphanumerical
  130573. // order based on the resource name.
  130574. //
  130575. // You can also sort results in descending order based on the creation
  130576. // timestamp using orderBy="creationTimestamp desc". This sorts results
  130577. // based on the creationTimestamp field in reverse chronological order
  130578. // (newest result first). Use this to sort resources like operations so
  130579. // that the newest operation is returned first.
  130580. //
  130581. // Currently, only sorting by name or creationTimestamp desc is
  130582. // supported.
  130583. func (c *TargetHttpsProxiesAggregatedListCall) OrderBy(orderBy string) *TargetHttpsProxiesAggregatedListCall {
  130584. c.urlParams_.Set("orderBy", orderBy)
  130585. return c
  130586. }
  130587. // PageToken sets the optional parameter "pageToken": Specifies a page
  130588. // token to use. Set pageToken to the nextPageToken returned by a
  130589. // previous list request to get the next page of results.
  130590. func (c *TargetHttpsProxiesAggregatedListCall) PageToken(pageToken string) *TargetHttpsProxiesAggregatedListCall {
  130591. c.urlParams_.Set("pageToken", pageToken)
  130592. return c
  130593. }
  130594. // Fields allows partial responses to be retrieved. See
  130595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130596. // for more information.
  130597. func (c *TargetHttpsProxiesAggregatedListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesAggregatedListCall {
  130598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130599. return c
  130600. }
  130601. // IfNoneMatch sets the optional parameter which makes the operation
  130602. // fail if the object's ETag matches the given value. This is useful for
  130603. // getting updates only after the object has changed since the last
  130604. // request. Use googleapi.IsNotModified to check whether the response
  130605. // error from Do is the result of In-None-Match.
  130606. func (c *TargetHttpsProxiesAggregatedListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesAggregatedListCall {
  130607. c.ifNoneMatch_ = entityTag
  130608. return c
  130609. }
  130610. // Context sets the context to be used in this call's Do method. Any
  130611. // pending HTTP request will be aborted if the provided context is
  130612. // canceled.
  130613. func (c *TargetHttpsProxiesAggregatedListCall) Context(ctx context.Context) *TargetHttpsProxiesAggregatedListCall {
  130614. c.ctx_ = ctx
  130615. return c
  130616. }
  130617. // Header returns an http.Header that can be modified by the caller to
  130618. // add HTTP headers to the request.
  130619. func (c *TargetHttpsProxiesAggregatedListCall) Header() http.Header {
  130620. if c.header_ == nil {
  130621. c.header_ = make(http.Header)
  130622. }
  130623. return c.header_
  130624. }
  130625. func (c *TargetHttpsProxiesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  130626. reqHeaders := make(http.Header)
  130627. for k, v := range c.header_ {
  130628. reqHeaders[k] = v
  130629. }
  130630. reqHeaders.Set("User-Agent", c.s.userAgent())
  130631. if c.ifNoneMatch_ != "" {
  130632. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130633. }
  130634. var body io.Reader = nil
  130635. c.urlParams_.Set("alt", alt)
  130636. c.urlParams_.Set("prettyPrint", "false")
  130637. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetHttpsProxies")
  130638. urls += "?" + c.urlParams_.Encode()
  130639. req, err := http.NewRequest("GET", urls, body)
  130640. if err != nil {
  130641. return nil, err
  130642. }
  130643. req.Header = reqHeaders
  130644. googleapi.Expand(req.URL, map[string]string{
  130645. "project": c.project,
  130646. })
  130647. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130648. }
  130649. // Do executes the "compute.targetHttpsProxies.aggregatedList" call.
  130650. // Exactly one of *TargetHttpsProxyAggregatedList or error will be
  130651. // non-nil. Any non-2xx status code is an error. Response headers are in
  130652. // either *TargetHttpsProxyAggregatedList.ServerResponse.Header or (if a
  130653. // response was returned at all) in error.(*googleapi.Error).Header. Use
  130654. // googleapi.IsNotModified to check whether the returned error was
  130655. // because http.StatusNotModified was returned.
  130656. func (c *TargetHttpsProxiesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyAggregatedList, error) {
  130657. gensupport.SetOptions(c.urlParams_, opts...)
  130658. res, err := c.doRequest("json")
  130659. if res != nil && res.StatusCode == http.StatusNotModified {
  130660. if res.Body != nil {
  130661. res.Body.Close()
  130662. }
  130663. return nil, &googleapi.Error{
  130664. Code: res.StatusCode,
  130665. Header: res.Header,
  130666. }
  130667. }
  130668. if err != nil {
  130669. return nil, err
  130670. }
  130671. defer googleapi.CloseBody(res)
  130672. if err := googleapi.CheckResponse(res); err != nil {
  130673. return nil, err
  130674. }
  130675. ret := &TargetHttpsProxyAggregatedList{
  130676. ServerResponse: googleapi.ServerResponse{
  130677. Header: res.Header,
  130678. HTTPStatusCode: res.StatusCode,
  130679. },
  130680. }
  130681. target := &ret
  130682. if err := gensupport.DecodeResponse(target, res); err != nil {
  130683. return nil, err
  130684. }
  130685. return ret, nil
  130686. // {
  130687. // "description": "Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project.",
  130688. // "httpMethod": "GET",
  130689. // "id": "compute.targetHttpsProxies.aggregatedList",
  130690. // "parameterOrder": [
  130691. // "project"
  130692. // ],
  130693. // "parameters": {
  130694. // "filter": {
  130695. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  130696. // "location": "query",
  130697. // "type": "string"
  130698. // },
  130699. // "maxResults": {
  130700. // "default": "500",
  130701. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  130702. // "format": "uint32",
  130703. // "location": "query",
  130704. // "minimum": "0",
  130705. // "type": "integer"
  130706. // },
  130707. // "orderBy": {
  130708. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  130709. // "location": "query",
  130710. // "type": "string"
  130711. // },
  130712. // "pageToken": {
  130713. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  130714. // "location": "query",
  130715. // "type": "string"
  130716. // },
  130717. // "project": {
  130718. // "description": "Name of the project scoping this request.",
  130719. // "location": "path",
  130720. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130721. // "required": true,
  130722. // "type": "string"
  130723. // }
  130724. // },
  130725. // "path": "{project}/aggregated/targetHttpsProxies",
  130726. // "response": {
  130727. // "$ref": "TargetHttpsProxyAggregatedList"
  130728. // },
  130729. // "scopes": [
  130730. // "https://www.googleapis.com/auth/cloud-platform",
  130731. // "https://www.googleapis.com/auth/compute",
  130732. // "https://www.googleapis.com/auth/compute.readonly"
  130733. // ]
  130734. // }
  130735. }
  130736. // Pages invokes f for each page of results.
  130737. // A non-nil error returned from f will halt the iteration.
  130738. // The provided context supersedes any context provided to the Context method.
  130739. func (c *TargetHttpsProxiesAggregatedListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyAggregatedList) error) error {
  130740. c.ctx_ = ctx
  130741. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  130742. for {
  130743. x, err := c.Do()
  130744. if err != nil {
  130745. return err
  130746. }
  130747. if err := f(x); err != nil {
  130748. return err
  130749. }
  130750. if x.NextPageToken == "" {
  130751. return nil
  130752. }
  130753. c.PageToken(x.NextPageToken)
  130754. }
  130755. }
  130756. // method id "compute.targetHttpsProxies.delete":
  130757. type TargetHttpsProxiesDeleteCall struct {
  130758. s *Service
  130759. project string
  130760. targetHttpsProxy string
  130761. urlParams_ gensupport.URLParams
  130762. ctx_ context.Context
  130763. header_ http.Header
  130764. }
  130765. // Delete: Deletes the specified TargetHttpsProxy resource.
  130766. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  130767. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130768. c.project = project
  130769. c.targetHttpsProxy = targetHttpsProxy
  130770. return c
  130771. }
  130772. // RequestId sets the optional parameter "requestId": An optional
  130773. // request ID to identify requests. Specify a unique request ID so that
  130774. // if you must retry your request, the server will know to ignore the
  130775. // request if it has already been completed.
  130776. //
  130777. // For example, consider a situation where you make an initial request
  130778. // and the request times out. If you make the request again with the
  130779. // same request ID, the server can check if original operation with the
  130780. // same request ID was received, and if so, will ignore the second
  130781. // request. This prevents clients from accidentally creating duplicate
  130782. // commitments.
  130783. //
  130784. // The request ID must be a valid UUID with the exception that zero UUID
  130785. // is not supported (00000000-0000-0000-0000-000000000000).
  130786. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  130787. c.urlParams_.Set("requestId", requestId)
  130788. return c
  130789. }
  130790. // Fields allows partial responses to be retrieved. See
  130791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130792. // for more information.
  130793. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  130794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130795. return c
  130796. }
  130797. // Context sets the context to be used in this call's Do method. Any
  130798. // pending HTTP request will be aborted if the provided context is
  130799. // canceled.
  130800. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  130801. c.ctx_ = ctx
  130802. return c
  130803. }
  130804. // Header returns an http.Header that can be modified by the caller to
  130805. // add HTTP headers to the request.
  130806. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  130807. if c.header_ == nil {
  130808. c.header_ = make(http.Header)
  130809. }
  130810. return c.header_
  130811. }
  130812. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  130813. reqHeaders := make(http.Header)
  130814. for k, v := range c.header_ {
  130815. reqHeaders[k] = v
  130816. }
  130817. reqHeaders.Set("User-Agent", c.s.userAgent())
  130818. var body io.Reader = nil
  130819. c.urlParams_.Set("alt", alt)
  130820. c.urlParams_.Set("prettyPrint", "false")
  130821. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  130822. urls += "?" + c.urlParams_.Encode()
  130823. req, err := http.NewRequest("DELETE", urls, body)
  130824. if err != nil {
  130825. return nil, err
  130826. }
  130827. req.Header = reqHeaders
  130828. googleapi.Expand(req.URL, map[string]string{
  130829. "project": c.project,
  130830. "targetHttpsProxy": c.targetHttpsProxy,
  130831. })
  130832. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130833. }
  130834. // Do executes the "compute.targetHttpsProxies.delete" call.
  130835. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  130836. // status code is an error. Response headers are in either
  130837. // *Operation.ServerResponse.Header or (if a response was returned at
  130838. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  130839. // to check whether the returned error was because
  130840. // http.StatusNotModified was returned.
  130841. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  130842. gensupport.SetOptions(c.urlParams_, opts...)
  130843. res, err := c.doRequest("json")
  130844. if res != nil && res.StatusCode == http.StatusNotModified {
  130845. if res.Body != nil {
  130846. res.Body.Close()
  130847. }
  130848. return nil, &googleapi.Error{
  130849. Code: res.StatusCode,
  130850. Header: res.Header,
  130851. }
  130852. }
  130853. if err != nil {
  130854. return nil, err
  130855. }
  130856. defer googleapi.CloseBody(res)
  130857. if err := googleapi.CheckResponse(res); err != nil {
  130858. return nil, err
  130859. }
  130860. ret := &Operation{
  130861. ServerResponse: googleapi.ServerResponse{
  130862. Header: res.Header,
  130863. HTTPStatusCode: res.StatusCode,
  130864. },
  130865. }
  130866. target := &ret
  130867. if err := gensupport.DecodeResponse(target, res); err != nil {
  130868. return nil, err
  130869. }
  130870. return ret, nil
  130871. // {
  130872. // "description": "Deletes the specified TargetHttpsProxy resource.",
  130873. // "httpMethod": "DELETE",
  130874. // "id": "compute.targetHttpsProxies.delete",
  130875. // "parameterOrder": [
  130876. // "project",
  130877. // "targetHttpsProxy"
  130878. // ],
  130879. // "parameters": {
  130880. // "project": {
  130881. // "description": "Project ID for this request.",
  130882. // "location": "path",
  130883. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  130884. // "required": true,
  130885. // "type": "string"
  130886. // },
  130887. // "requestId": {
  130888. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  130889. // "location": "query",
  130890. // "type": "string"
  130891. // },
  130892. // "targetHttpsProxy": {
  130893. // "description": "Name of the TargetHttpsProxy resource to delete.",
  130894. // "location": "path",
  130895. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  130896. // "required": true,
  130897. // "type": "string"
  130898. // }
  130899. // },
  130900. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  130901. // "response": {
  130902. // "$ref": "Operation"
  130903. // },
  130904. // "scopes": [
  130905. // "https://www.googleapis.com/auth/cloud-platform",
  130906. // "https://www.googleapis.com/auth/compute"
  130907. // ]
  130908. // }
  130909. }
  130910. // method id "compute.targetHttpsProxies.get":
  130911. type TargetHttpsProxiesGetCall struct {
  130912. s *Service
  130913. project string
  130914. targetHttpsProxy string
  130915. urlParams_ gensupport.URLParams
  130916. ifNoneMatch_ string
  130917. ctx_ context.Context
  130918. header_ http.Header
  130919. }
  130920. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  130921. // available target HTTPS proxies by making a list() request.
  130922. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  130923. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  130924. c.project = project
  130925. c.targetHttpsProxy = targetHttpsProxy
  130926. return c
  130927. }
  130928. // Fields allows partial responses to be retrieved. See
  130929. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  130930. // for more information.
  130931. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  130932. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  130933. return c
  130934. }
  130935. // IfNoneMatch sets the optional parameter which makes the operation
  130936. // fail if the object's ETag matches the given value. This is useful for
  130937. // getting updates only after the object has changed since the last
  130938. // request. Use googleapi.IsNotModified to check whether the response
  130939. // error from Do is the result of In-None-Match.
  130940. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  130941. c.ifNoneMatch_ = entityTag
  130942. return c
  130943. }
  130944. // Context sets the context to be used in this call's Do method. Any
  130945. // pending HTTP request will be aborted if the provided context is
  130946. // canceled.
  130947. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  130948. c.ctx_ = ctx
  130949. return c
  130950. }
  130951. // Header returns an http.Header that can be modified by the caller to
  130952. // add HTTP headers to the request.
  130953. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  130954. if c.header_ == nil {
  130955. c.header_ = make(http.Header)
  130956. }
  130957. return c.header_
  130958. }
  130959. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  130960. reqHeaders := make(http.Header)
  130961. for k, v := range c.header_ {
  130962. reqHeaders[k] = v
  130963. }
  130964. reqHeaders.Set("User-Agent", c.s.userAgent())
  130965. if c.ifNoneMatch_ != "" {
  130966. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  130967. }
  130968. var body io.Reader = nil
  130969. c.urlParams_.Set("alt", alt)
  130970. c.urlParams_.Set("prettyPrint", "false")
  130971. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  130972. urls += "?" + c.urlParams_.Encode()
  130973. req, err := http.NewRequest("GET", urls, body)
  130974. if err != nil {
  130975. return nil, err
  130976. }
  130977. req.Header = reqHeaders
  130978. googleapi.Expand(req.URL, map[string]string{
  130979. "project": c.project,
  130980. "targetHttpsProxy": c.targetHttpsProxy,
  130981. })
  130982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  130983. }
  130984. // Do executes the "compute.targetHttpsProxies.get" call.
  130985. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  130986. // non-2xx status code is an error. Response headers are in either
  130987. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  130988. // returned at all) in error.(*googleapi.Error).Header. Use
  130989. // googleapi.IsNotModified to check whether the returned error was
  130990. // because http.StatusNotModified was returned.
  130991. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  130992. gensupport.SetOptions(c.urlParams_, opts...)
  130993. res, err := c.doRequest("json")
  130994. if res != nil && res.StatusCode == http.StatusNotModified {
  130995. if res.Body != nil {
  130996. res.Body.Close()
  130997. }
  130998. return nil, &googleapi.Error{
  130999. Code: res.StatusCode,
  131000. Header: res.Header,
  131001. }
  131002. }
  131003. if err != nil {
  131004. return nil, err
  131005. }
  131006. defer googleapi.CloseBody(res)
  131007. if err := googleapi.CheckResponse(res); err != nil {
  131008. return nil, err
  131009. }
  131010. ret := &TargetHttpsProxy{
  131011. ServerResponse: googleapi.ServerResponse{
  131012. Header: res.Header,
  131013. HTTPStatusCode: res.StatusCode,
  131014. },
  131015. }
  131016. target := &ret
  131017. if err := gensupport.DecodeResponse(target, res); err != nil {
  131018. return nil, err
  131019. }
  131020. return ret, nil
  131021. // {
  131022. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  131023. // "httpMethod": "GET",
  131024. // "id": "compute.targetHttpsProxies.get",
  131025. // "parameterOrder": [
  131026. // "project",
  131027. // "targetHttpsProxy"
  131028. // ],
  131029. // "parameters": {
  131030. // "project": {
  131031. // "description": "Project ID for this request.",
  131032. // "location": "path",
  131033. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131034. // "required": true,
  131035. // "type": "string"
  131036. // },
  131037. // "targetHttpsProxy": {
  131038. // "description": "Name of the TargetHttpsProxy resource to return.",
  131039. // "location": "path",
  131040. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  131041. // "required": true,
  131042. // "type": "string"
  131043. // }
  131044. // },
  131045. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  131046. // "response": {
  131047. // "$ref": "TargetHttpsProxy"
  131048. // },
  131049. // "scopes": [
  131050. // "https://www.googleapis.com/auth/cloud-platform",
  131051. // "https://www.googleapis.com/auth/compute",
  131052. // "https://www.googleapis.com/auth/compute.readonly"
  131053. // ]
  131054. // }
  131055. }
  131056. // method id "compute.targetHttpsProxies.insert":
  131057. type TargetHttpsProxiesInsertCall struct {
  131058. s *Service
  131059. project string
  131060. targethttpsproxy *TargetHttpsProxy
  131061. urlParams_ gensupport.URLParams
  131062. ctx_ context.Context
  131063. header_ http.Header
  131064. }
  131065. // Insert: Creates a TargetHttpsProxy resource in the specified project
  131066. // using the data included in the request.
  131067. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  131068. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131069. c.project = project
  131070. c.targethttpsproxy = targethttpsproxy
  131071. return c
  131072. }
  131073. // RequestId sets the optional parameter "requestId": An optional
  131074. // request ID to identify requests. Specify a unique request ID so that
  131075. // if you must retry your request, the server will know to ignore the
  131076. // request if it has already been completed.
  131077. //
  131078. // For example, consider a situation where you make an initial request
  131079. // and the request times out. If you make the request again with the
  131080. // same request ID, the server can check if original operation with the
  131081. // same request ID was received, and if so, will ignore the second
  131082. // request. This prevents clients from accidentally creating duplicate
  131083. // commitments.
  131084. //
  131085. // The request ID must be a valid UUID with the exception that zero UUID
  131086. // is not supported (00000000-0000-0000-0000-000000000000).
  131087. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  131088. c.urlParams_.Set("requestId", requestId)
  131089. return c
  131090. }
  131091. // Fields allows partial responses to be retrieved. See
  131092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131093. // for more information.
  131094. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  131095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131096. return c
  131097. }
  131098. // Context sets the context to be used in this call's Do method. Any
  131099. // pending HTTP request will be aborted if the provided context is
  131100. // canceled.
  131101. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  131102. c.ctx_ = ctx
  131103. return c
  131104. }
  131105. // Header returns an http.Header that can be modified by the caller to
  131106. // add HTTP headers to the request.
  131107. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  131108. if c.header_ == nil {
  131109. c.header_ = make(http.Header)
  131110. }
  131111. return c.header_
  131112. }
  131113. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  131114. reqHeaders := make(http.Header)
  131115. for k, v := range c.header_ {
  131116. reqHeaders[k] = v
  131117. }
  131118. reqHeaders.Set("User-Agent", c.s.userAgent())
  131119. var body io.Reader = nil
  131120. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  131121. if err != nil {
  131122. return nil, err
  131123. }
  131124. reqHeaders.Set("Content-Type", "application/json")
  131125. c.urlParams_.Set("alt", alt)
  131126. c.urlParams_.Set("prettyPrint", "false")
  131127. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  131128. urls += "?" + c.urlParams_.Encode()
  131129. req, err := http.NewRequest("POST", urls, body)
  131130. if err != nil {
  131131. return nil, err
  131132. }
  131133. req.Header = reqHeaders
  131134. googleapi.Expand(req.URL, map[string]string{
  131135. "project": c.project,
  131136. })
  131137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131138. }
  131139. // Do executes the "compute.targetHttpsProxies.insert" call.
  131140. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131141. // status code is an error. Response headers are in either
  131142. // *Operation.ServerResponse.Header or (if a response was returned at
  131143. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131144. // to check whether the returned error was because
  131145. // http.StatusNotModified was returned.
  131146. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131147. gensupport.SetOptions(c.urlParams_, opts...)
  131148. res, err := c.doRequest("json")
  131149. if res != nil && res.StatusCode == http.StatusNotModified {
  131150. if res.Body != nil {
  131151. res.Body.Close()
  131152. }
  131153. return nil, &googleapi.Error{
  131154. Code: res.StatusCode,
  131155. Header: res.Header,
  131156. }
  131157. }
  131158. if err != nil {
  131159. return nil, err
  131160. }
  131161. defer googleapi.CloseBody(res)
  131162. if err := googleapi.CheckResponse(res); err != nil {
  131163. return nil, err
  131164. }
  131165. ret := &Operation{
  131166. ServerResponse: googleapi.ServerResponse{
  131167. Header: res.Header,
  131168. HTTPStatusCode: res.StatusCode,
  131169. },
  131170. }
  131171. target := &ret
  131172. if err := gensupport.DecodeResponse(target, res); err != nil {
  131173. return nil, err
  131174. }
  131175. return ret, nil
  131176. // {
  131177. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  131178. // "httpMethod": "POST",
  131179. // "id": "compute.targetHttpsProxies.insert",
  131180. // "parameterOrder": [
  131181. // "project"
  131182. // ],
  131183. // "parameters": {
  131184. // "project": {
  131185. // "description": "Project ID for this request.",
  131186. // "location": "path",
  131187. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131188. // "required": true,
  131189. // "type": "string"
  131190. // },
  131191. // "requestId": {
  131192. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  131193. // "location": "query",
  131194. // "type": "string"
  131195. // }
  131196. // },
  131197. // "path": "{project}/global/targetHttpsProxies",
  131198. // "request": {
  131199. // "$ref": "TargetHttpsProxy"
  131200. // },
  131201. // "response": {
  131202. // "$ref": "Operation"
  131203. // },
  131204. // "scopes": [
  131205. // "https://www.googleapis.com/auth/cloud-platform",
  131206. // "https://www.googleapis.com/auth/compute"
  131207. // ]
  131208. // }
  131209. }
  131210. // method id "compute.targetHttpsProxies.list":
  131211. type TargetHttpsProxiesListCall struct {
  131212. s *Service
  131213. project string
  131214. urlParams_ gensupport.URLParams
  131215. ifNoneMatch_ string
  131216. ctx_ context.Context
  131217. header_ http.Header
  131218. }
  131219. // List: Retrieves the list of TargetHttpsProxy resources available to
  131220. // the specified project.
  131221. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  131222. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131223. c.project = project
  131224. return c
  131225. }
  131226. // Filter sets the optional parameter "filter": A filter expression that
  131227. // filters resources listed in the response. The expression must specify
  131228. // the field name, a comparison operator, and the value that you want to
  131229. // use for filtering. The value must be a string, a number, or a
  131230. // boolean. The comparison operator must be either =, !=, >, or <.
  131231. //
  131232. // For example, if you are filtering Compute Engine instances, you can
  131233. // exclude instances named example-instance by specifying name !=
  131234. // example-instance.
  131235. //
  131236. // You can also filter nested fields. For example, you could specify
  131237. // scheduling.automaticRestart = false to include instances only if they
  131238. // are not scheduled for automatic restarts. You can use filtering on
  131239. // nested fields to filter based on resource labels.
  131240. //
  131241. // To filter on multiple expressions, provide each separate expression
  131242. // within parentheses. For example, (scheduling.automaticRestart = true)
  131243. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  131244. // AND expression. However, you can include AND and OR expressions
  131245. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  131246. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  131247. // true).
  131248. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  131249. c.urlParams_.Set("filter", filter)
  131250. return c
  131251. }
  131252. // MaxResults sets the optional parameter "maxResults": The maximum
  131253. // number of results per page that should be returned. If the number of
  131254. // available results is larger than maxResults, Compute Engine returns a
  131255. // nextPageToken that can be used to get the next page of results in
  131256. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  131257. // (Default: 500)
  131258. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  131259. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  131260. return c
  131261. }
  131262. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  131263. // a certain order. By default, results are returned in alphanumerical
  131264. // order based on the resource name.
  131265. //
  131266. // You can also sort results in descending order based on the creation
  131267. // timestamp using orderBy="creationTimestamp desc". This sorts results
  131268. // based on the creationTimestamp field in reverse chronological order
  131269. // (newest result first). Use this to sort resources like operations so
  131270. // that the newest operation is returned first.
  131271. //
  131272. // Currently, only sorting by name or creationTimestamp desc is
  131273. // supported.
  131274. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  131275. c.urlParams_.Set("orderBy", orderBy)
  131276. return c
  131277. }
  131278. // PageToken sets the optional parameter "pageToken": Specifies a page
  131279. // token to use. Set pageToken to the nextPageToken returned by a
  131280. // previous list request to get the next page of results.
  131281. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  131282. c.urlParams_.Set("pageToken", pageToken)
  131283. return c
  131284. }
  131285. // Fields allows partial responses to be retrieved. See
  131286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131287. // for more information.
  131288. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  131289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131290. return c
  131291. }
  131292. // IfNoneMatch sets the optional parameter which makes the operation
  131293. // fail if the object's ETag matches the given value. This is useful for
  131294. // getting updates only after the object has changed since the last
  131295. // request. Use googleapi.IsNotModified to check whether the response
  131296. // error from Do is the result of In-None-Match.
  131297. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  131298. c.ifNoneMatch_ = entityTag
  131299. return c
  131300. }
  131301. // Context sets the context to be used in this call's Do method. Any
  131302. // pending HTTP request will be aborted if the provided context is
  131303. // canceled.
  131304. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  131305. c.ctx_ = ctx
  131306. return c
  131307. }
  131308. // Header returns an http.Header that can be modified by the caller to
  131309. // add HTTP headers to the request.
  131310. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  131311. if c.header_ == nil {
  131312. c.header_ = make(http.Header)
  131313. }
  131314. return c.header_
  131315. }
  131316. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  131317. reqHeaders := make(http.Header)
  131318. for k, v := range c.header_ {
  131319. reqHeaders[k] = v
  131320. }
  131321. reqHeaders.Set("User-Agent", c.s.userAgent())
  131322. if c.ifNoneMatch_ != "" {
  131323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  131324. }
  131325. var body io.Reader = nil
  131326. c.urlParams_.Set("alt", alt)
  131327. c.urlParams_.Set("prettyPrint", "false")
  131328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  131329. urls += "?" + c.urlParams_.Encode()
  131330. req, err := http.NewRequest("GET", urls, body)
  131331. if err != nil {
  131332. return nil, err
  131333. }
  131334. req.Header = reqHeaders
  131335. googleapi.Expand(req.URL, map[string]string{
  131336. "project": c.project,
  131337. })
  131338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131339. }
  131340. // Do executes the "compute.targetHttpsProxies.list" call.
  131341. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  131342. // non-2xx status code is an error. Response headers are in either
  131343. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  131344. // returned at all) in error.(*googleapi.Error).Header. Use
  131345. // googleapi.IsNotModified to check whether the returned error was
  131346. // because http.StatusNotModified was returned.
  131347. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  131348. gensupport.SetOptions(c.urlParams_, opts...)
  131349. res, err := c.doRequest("json")
  131350. if res != nil && res.StatusCode == http.StatusNotModified {
  131351. if res.Body != nil {
  131352. res.Body.Close()
  131353. }
  131354. return nil, &googleapi.Error{
  131355. Code: res.StatusCode,
  131356. Header: res.Header,
  131357. }
  131358. }
  131359. if err != nil {
  131360. return nil, err
  131361. }
  131362. defer googleapi.CloseBody(res)
  131363. if err := googleapi.CheckResponse(res); err != nil {
  131364. return nil, err
  131365. }
  131366. ret := &TargetHttpsProxyList{
  131367. ServerResponse: googleapi.ServerResponse{
  131368. Header: res.Header,
  131369. HTTPStatusCode: res.StatusCode,
  131370. },
  131371. }
  131372. target := &ret
  131373. if err := gensupport.DecodeResponse(target, res); err != nil {
  131374. return nil, err
  131375. }
  131376. return ret, nil
  131377. // {
  131378. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  131379. // "httpMethod": "GET",
  131380. // "id": "compute.targetHttpsProxies.list",
  131381. // "parameterOrder": [
  131382. // "project"
  131383. // ],
  131384. // "parameters": {
  131385. // "filter": {
  131386. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  131387. // "location": "query",
  131388. // "type": "string"
  131389. // },
  131390. // "maxResults": {
  131391. // "default": "500",
  131392. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  131393. // "format": "uint32",
  131394. // "location": "query",
  131395. // "minimum": "0",
  131396. // "type": "integer"
  131397. // },
  131398. // "orderBy": {
  131399. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  131400. // "location": "query",
  131401. // "type": "string"
  131402. // },
  131403. // "pageToken": {
  131404. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  131405. // "location": "query",
  131406. // "type": "string"
  131407. // },
  131408. // "project": {
  131409. // "description": "Project ID for this request.",
  131410. // "location": "path",
  131411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131412. // "required": true,
  131413. // "type": "string"
  131414. // }
  131415. // },
  131416. // "path": "{project}/global/targetHttpsProxies",
  131417. // "response": {
  131418. // "$ref": "TargetHttpsProxyList"
  131419. // },
  131420. // "scopes": [
  131421. // "https://www.googleapis.com/auth/cloud-platform",
  131422. // "https://www.googleapis.com/auth/compute",
  131423. // "https://www.googleapis.com/auth/compute.readonly"
  131424. // ]
  131425. // }
  131426. }
  131427. // Pages invokes f for each page of results.
  131428. // A non-nil error returned from f will halt the iteration.
  131429. // The provided context supersedes any context provided to the Context method.
  131430. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  131431. c.ctx_ = ctx
  131432. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  131433. for {
  131434. x, err := c.Do()
  131435. if err != nil {
  131436. return err
  131437. }
  131438. if err := f(x); err != nil {
  131439. return err
  131440. }
  131441. if x.NextPageToken == "" {
  131442. return nil
  131443. }
  131444. c.PageToken(x.NextPageToken)
  131445. }
  131446. }
  131447. // method id "compute.targetHttpsProxies.setQuicOverride":
  131448. type TargetHttpsProxiesSetQuicOverrideCall struct {
  131449. s *Service
  131450. project string
  131451. targetHttpsProxy string
  131452. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  131453. urlParams_ gensupport.URLParams
  131454. ctx_ context.Context
  131455. header_ http.Header
  131456. }
  131457. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  131458. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  131459. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131460. c.project = project
  131461. c.targetHttpsProxy = targetHttpsProxy
  131462. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  131463. return c
  131464. }
  131465. // RequestId sets the optional parameter "requestId": An optional
  131466. // request ID to identify requests. Specify a unique request ID so that
  131467. // if you must retry your request, the server will know to ignore the
  131468. // request if it has already been completed.
  131469. //
  131470. // For example, consider a situation where you make an initial request
  131471. // and the request times out. If you make the request again with the
  131472. // same request ID, the server can check if original operation with the
  131473. // same request ID was received, and if so, will ignore the second
  131474. // request. This prevents clients from accidentally creating duplicate
  131475. // commitments.
  131476. //
  131477. // The request ID must be a valid UUID with the exception that zero UUID
  131478. // is not supported (00000000-0000-0000-0000-000000000000).
  131479. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  131480. c.urlParams_.Set("requestId", requestId)
  131481. return c
  131482. }
  131483. // Fields allows partial responses to be retrieved. See
  131484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131485. // for more information.
  131486. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  131487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131488. return c
  131489. }
  131490. // Context sets the context to be used in this call's Do method. Any
  131491. // pending HTTP request will be aborted if the provided context is
  131492. // canceled.
  131493. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  131494. c.ctx_ = ctx
  131495. return c
  131496. }
  131497. // Header returns an http.Header that can be modified by the caller to
  131498. // add HTTP headers to the request.
  131499. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  131500. if c.header_ == nil {
  131501. c.header_ = make(http.Header)
  131502. }
  131503. return c.header_
  131504. }
  131505. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  131506. reqHeaders := make(http.Header)
  131507. for k, v := range c.header_ {
  131508. reqHeaders[k] = v
  131509. }
  131510. reqHeaders.Set("User-Agent", c.s.userAgent())
  131511. var body io.Reader = nil
  131512. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  131513. if err != nil {
  131514. return nil, err
  131515. }
  131516. reqHeaders.Set("Content-Type", "application/json")
  131517. c.urlParams_.Set("alt", alt)
  131518. c.urlParams_.Set("prettyPrint", "false")
  131519. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  131520. urls += "?" + c.urlParams_.Encode()
  131521. req, err := http.NewRequest("POST", urls, body)
  131522. if err != nil {
  131523. return nil, err
  131524. }
  131525. req.Header = reqHeaders
  131526. googleapi.Expand(req.URL, map[string]string{
  131527. "project": c.project,
  131528. "targetHttpsProxy": c.targetHttpsProxy,
  131529. })
  131530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131531. }
  131532. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  131533. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131534. // status code is an error. Response headers are in either
  131535. // *Operation.ServerResponse.Header or (if a response was returned at
  131536. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131537. // to check whether the returned error was because
  131538. // http.StatusNotModified was returned.
  131539. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131540. gensupport.SetOptions(c.urlParams_, opts...)
  131541. res, err := c.doRequest("json")
  131542. if res != nil && res.StatusCode == http.StatusNotModified {
  131543. if res.Body != nil {
  131544. res.Body.Close()
  131545. }
  131546. return nil, &googleapi.Error{
  131547. Code: res.StatusCode,
  131548. Header: res.Header,
  131549. }
  131550. }
  131551. if err != nil {
  131552. return nil, err
  131553. }
  131554. defer googleapi.CloseBody(res)
  131555. if err := googleapi.CheckResponse(res); err != nil {
  131556. return nil, err
  131557. }
  131558. ret := &Operation{
  131559. ServerResponse: googleapi.ServerResponse{
  131560. Header: res.Header,
  131561. HTTPStatusCode: res.StatusCode,
  131562. },
  131563. }
  131564. target := &ret
  131565. if err := gensupport.DecodeResponse(target, res); err != nil {
  131566. return nil, err
  131567. }
  131568. return ret, nil
  131569. // {
  131570. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  131571. // "httpMethod": "POST",
  131572. // "id": "compute.targetHttpsProxies.setQuicOverride",
  131573. // "parameterOrder": [
  131574. // "project",
  131575. // "targetHttpsProxy"
  131576. // ],
  131577. // "parameters": {
  131578. // "project": {
  131579. // "description": "Project ID for this request.",
  131580. // "location": "path",
  131581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131582. // "required": true,
  131583. // "type": "string"
  131584. // },
  131585. // "requestId": {
  131586. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  131587. // "location": "query",
  131588. // "type": "string"
  131589. // },
  131590. // "targetHttpsProxy": {
  131591. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  131592. // "location": "path",
  131593. // "required": true,
  131594. // "type": "string"
  131595. // }
  131596. // },
  131597. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  131598. // "request": {
  131599. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  131600. // },
  131601. // "response": {
  131602. // "$ref": "Operation"
  131603. // },
  131604. // "scopes": [
  131605. // "https://www.googleapis.com/auth/cloud-platform",
  131606. // "https://www.googleapis.com/auth/compute"
  131607. // ]
  131608. // }
  131609. }
  131610. // method id "compute.targetHttpsProxies.setSslCertificates":
  131611. type TargetHttpsProxiesSetSslCertificatesCall struct {
  131612. s *Service
  131613. project string
  131614. targetHttpsProxy string
  131615. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  131616. urlParams_ gensupport.URLParams
  131617. ctx_ context.Context
  131618. header_ http.Header
  131619. }
  131620. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  131621. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  131622. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131623. c.project = project
  131624. c.targetHttpsProxy = targetHttpsProxy
  131625. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  131626. return c
  131627. }
  131628. // RequestId sets the optional parameter "requestId": An optional
  131629. // request ID to identify requests. Specify a unique request ID so that
  131630. // if you must retry your request, the server will know to ignore the
  131631. // request if it has already been completed.
  131632. //
  131633. // For example, consider a situation where you make an initial request
  131634. // and the request times out. If you make the request again with the
  131635. // same request ID, the server can check if original operation with the
  131636. // same request ID was received, and if so, will ignore the second
  131637. // request. This prevents clients from accidentally creating duplicate
  131638. // commitments.
  131639. //
  131640. // The request ID must be a valid UUID with the exception that zero UUID
  131641. // is not supported (00000000-0000-0000-0000-000000000000).
  131642. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  131643. c.urlParams_.Set("requestId", requestId)
  131644. return c
  131645. }
  131646. // Fields allows partial responses to be retrieved. See
  131647. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131648. // for more information.
  131649. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  131650. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131651. return c
  131652. }
  131653. // Context sets the context to be used in this call's Do method. Any
  131654. // pending HTTP request will be aborted if the provided context is
  131655. // canceled.
  131656. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  131657. c.ctx_ = ctx
  131658. return c
  131659. }
  131660. // Header returns an http.Header that can be modified by the caller to
  131661. // add HTTP headers to the request.
  131662. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  131663. if c.header_ == nil {
  131664. c.header_ = make(http.Header)
  131665. }
  131666. return c.header_
  131667. }
  131668. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  131669. reqHeaders := make(http.Header)
  131670. for k, v := range c.header_ {
  131671. reqHeaders[k] = v
  131672. }
  131673. reqHeaders.Set("User-Agent", c.s.userAgent())
  131674. var body io.Reader = nil
  131675. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  131676. if err != nil {
  131677. return nil, err
  131678. }
  131679. reqHeaders.Set("Content-Type", "application/json")
  131680. c.urlParams_.Set("alt", alt)
  131681. c.urlParams_.Set("prettyPrint", "false")
  131682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  131683. urls += "?" + c.urlParams_.Encode()
  131684. req, err := http.NewRequest("POST", urls, body)
  131685. if err != nil {
  131686. return nil, err
  131687. }
  131688. req.Header = reqHeaders
  131689. googleapi.Expand(req.URL, map[string]string{
  131690. "project": c.project,
  131691. "targetHttpsProxy": c.targetHttpsProxy,
  131692. })
  131693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131694. }
  131695. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  131696. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131697. // status code is an error. Response headers are in either
  131698. // *Operation.ServerResponse.Header or (if a response was returned at
  131699. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131700. // to check whether the returned error was because
  131701. // http.StatusNotModified was returned.
  131702. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131703. gensupport.SetOptions(c.urlParams_, opts...)
  131704. res, err := c.doRequest("json")
  131705. if res != nil && res.StatusCode == http.StatusNotModified {
  131706. if res.Body != nil {
  131707. res.Body.Close()
  131708. }
  131709. return nil, &googleapi.Error{
  131710. Code: res.StatusCode,
  131711. Header: res.Header,
  131712. }
  131713. }
  131714. if err != nil {
  131715. return nil, err
  131716. }
  131717. defer googleapi.CloseBody(res)
  131718. if err := googleapi.CheckResponse(res); err != nil {
  131719. return nil, err
  131720. }
  131721. ret := &Operation{
  131722. ServerResponse: googleapi.ServerResponse{
  131723. Header: res.Header,
  131724. HTTPStatusCode: res.StatusCode,
  131725. },
  131726. }
  131727. target := &ret
  131728. if err := gensupport.DecodeResponse(target, res); err != nil {
  131729. return nil, err
  131730. }
  131731. return ret, nil
  131732. // {
  131733. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  131734. // "httpMethod": "POST",
  131735. // "id": "compute.targetHttpsProxies.setSslCertificates",
  131736. // "parameterOrder": [
  131737. // "project",
  131738. // "targetHttpsProxy"
  131739. // ],
  131740. // "parameters": {
  131741. // "project": {
  131742. // "description": "Project ID for this request.",
  131743. // "location": "path",
  131744. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131745. // "required": true,
  131746. // "type": "string"
  131747. // },
  131748. // "requestId": {
  131749. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  131750. // "location": "query",
  131751. // "type": "string"
  131752. // },
  131753. // "targetHttpsProxy": {
  131754. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  131755. // "location": "path",
  131756. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  131757. // "required": true,
  131758. // "type": "string"
  131759. // }
  131760. // },
  131761. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  131762. // "request": {
  131763. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  131764. // },
  131765. // "response": {
  131766. // "$ref": "Operation"
  131767. // },
  131768. // "scopes": [
  131769. // "https://www.googleapis.com/auth/cloud-platform",
  131770. // "https://www.googleapis.com/auth/compute"
  131771. // ]
  131772. // }
  131773. }
  131774. // method id "compute.targetHttpsProxies.setSslPolicy":
  131775. type TargetHttpsProxiesSetSslPolicyCall struct {
  131776. s *Service
  131777. project string
  131778. targetHttpsProxy string
  131779. sslpolicyreference *SslPolicyReference
  131780. urlParams_ gensupport.URLParams
  131781. ctx_ context.Context
  131782. header_ http.Header
  131783. }
  131784. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  131785. // policy specifies the server-side support for SSL features. This
  131786. // affects connections between clients and the HTTPS proxy load
  131787. // balancer. They do not affect the connection between the load balancer
  131788. // and the backends.
  131789. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  131790. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131791. c.project = project
  131792. c.targetHttpsProxy = targetHttpsProxy
  131793. c.sslpolicyreference = sslpolicyreference
  131794. return c
  131795. }
  131796. // RequestId sets the optional parameter "requestId": An optional
  131797. // request ID to identify requests. Specify a unique request ID so that
  131798. // if you must retry your request, the server will know to ignore the
  131799. // request if it has already been completed.
  131800. //
  131801. // For example, consider a situation where you make an initial request
  131802. // and the request times out. If you make the request again with the
  131803. // same request ID, the server can check if original operation with the
  131804. // same request ID was received, and if so, will ignore the second
  131805. // request. This prevents clients from accidentally creating duplicate
  131806. // commitments.
  131807. //
  131808. // The request ID must be a valid UUID with the exception that zero UUID
  131809. // is not supported (00000000-0000-0000-0000-000000000000).
  131810. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  131811. c.urlParams_.Set("requestId", requestId)
  131812. return c
  131813. }
  131814. // Fields allows partial responses to be retrieved. See
  131815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131816. // for more information.
  131817. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  131818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131819. return c
  131820. }
  131821. // Context sets the context to be used in this call's Do method. Any
  131822. // pending HTTP request will be aborted if the provided context is
  131823. // canceled.
  131824. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  131825. c.ctx_ = ctx
  131826. return c
  131827. }
  131828. // Header returns an http.Header that can be modified by the caller to
  131829. // add HTTP headers to the request.
  131830. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  131831. if c.header_ == nil {
  131832. c.header_ = make(http.Header)
  131833. }
  131834. return c.header_
  131835. }
  131836. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  131837. reqHeaders := make(http.Header)
  131838. for k, v := range c.header_ {
  131839. reqHeaders[k] = v
  131840. }
  131841. reqHeaders.Set("User-Agent", c.s.userAgent())
  131842. var body io.Reader = nil
  131843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  131844. if err != nil {
  131845. return nil, err
  131846. }
  131847. reqHeaders.Set("Content-Type", "application/json")
  131848. c.urlParams_.Set("alt", alt)
  131849. c.urlParams_.Set("prettyPrint", "false")
  131850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  131851. urls += "?" + c.urlParams_.Encode()
  131852. req, err := http.NewRequest("POST", urls, body)
  131853. if err != nil {
  131854. return nil, err
  131855. }
  131856. req.Header = reqHeaders
  131857. googleapi.Expand(req.URL, map[string]string{
  131858. "project": c.project,
  131859. "targetHttpsProxy": c.targetHttpsProxy,
  131860. })
  131861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  131862. }
  131863. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  131864. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  131865. // status code is an error. Response headers are in either
  131866. // *Operation.ServerResponse.Header or (if a response was returned at
  131867. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  131868. // to check whether the returned error was because
  131869. // http.StatusNotModified was returned.
  131870. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  131871. gensupport.SetOptions(c.urlParams_, opts...)
  131872. res, err := c.doRequest("json")
  131873. if res != nil && res.StatusCode == http.StatusNotModified {
  131874. if res.Body != nil {
  131875. res.Body.Close()
  131876. }
  131877. return nil, &googleapi.Error{
  131878. Code: res.StatusCode,
  131879. Header: res.Header,
  131880. }
  131881. }
  131882. if err != nil {
  131883. return nil, err
  131884. }
  131885. defer googleapi.CloseBody(res)
  131886. if err := googleapi.CheckResponse(res); err != nil {
  131887. return nil, err
  131888. }
  131889. ret := &Operation{
  131890. ServerResponse: googleapi.ServerResponse{
  131891. Header: res.Header,
  131892. HTTPStatusCode: res.StatusCode,
  131893. },
  131894. }
  131895. target := &ret
  131896. if err := gensupport.DecodeResponse(target, res); err != nil {
  131897. return nil, err
  131898. }
  131899. return ret, nil
  131900. // {
  131901. // "description": "Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends.",
  131902. // "httpMethod": "POST",
  131903. // "id": "compute.targetHttpsProxies.setSslPolicy",
  131904. // "parameterOrder": [
  131905. // "project",
  131906. // "targetHttpsProxy"
  131907. // ],
  131908. // "parameters": {
  131909. // "project": {
  131910. // "description": "Project ID for this request.",
  131911. // "location": "path",
  131912. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  131913. // "required": true,
  131914. // "type": "string"
  131915. // },
  131916. // "requestId": {
  131917. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  131918. // "location": "query",
  131919. // "type": "string"
  131920. // },
  131921. // "targetHttpsProxy": {
  131922. // "description": "Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
  131923. // "location": "path",
  131924. // "required": true,
  131925. // "type": "string"
  131926. // }
  131927. // },
  131928. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  131929. // "request": {
  131930. // "$ref": "SslPolicyReference"
  131931. // },
  131932. // "response": {
  131933. // "$ref": "Operation"
  131934. // },
  131935. // "scopes": [
  131936. // "https://www.googleapis.com/auth/cloud-platform",
  131937. // "https://www.googleapis.com/auth/compute"
  131938. // ]
  131939. // }
  131940. }
  131941. // method id "compute.targetHttpsProxies.setUrlMap":
  131942. type TargetHttpsProxiesSetUrlMapCall struct {
  131943. s *Service
  131944. project string
  131945. targetHttpsProxy string
  131946. urlmapreference *UrlMapReference
  131947. urlParams_ gensupport.URLParams
  131948. ctx_ context.Context
  131949. header_ http.Header
  131950. }
  131951. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  131952. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  131953. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  131954. c.project = project
  131955. c.targetHttpsProxy = targetHttpsProxy
  131956. c.urlmapreference = urlmapreference
  131957. return c
  131958. }
  131959. // RequestId sets the optional parameter "requestId": An optional
  131960. // request ID to identify requests. Specify a unique request ID so that
  131961. // if you must retry your request, the server will know to ignore the
  131962. // request if it has already been completed.
  131963. //
  131964. // For example, consider a situation where you make an initial request
  131965. // and the request times out. If you make the request again with the
  131966. // same request ID, the server can check if original operation with the
  131967. // same request ID was received, and if so, will ignore the second
  131968. // request. This prevents clients from accidentally creating duplicate
  131969. // commitments.
  131970. //
  131971. // The request ID must be a valid UUID with the exception that zero UUID
  131972. // is not supported (00000000-0000-0000-0000-000000000000).
  131973. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  131974. c.urlParams_.Set("requestId", requestId)
  131975. return c
  131976. }
  131977. // Fields allows partial responses to be retrieved. See
  131978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  131979. // for more information.
  131980. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  131981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  131982. return c
  131983. }
  131984. // Context sets the context to be used in this call's Do method. Any
  131985. // pending HTTP request will be aborted if the provided context is
  131986. // canceled.
  131987. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  131988. c.ctx_ = ctx
  131989. return c
  131990. }
  131991. // Header returns an http.Header that can be modified by the caller to
  131992. // add HTTP headers to the request.
  131993. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  131994. if c.header_ == nil {
  131995. c.header_ = make(http.Header)
  131996. }
  131997. return c.header_
  131998. }
  131999. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  132000. reqHeaders := make(http.Header)
  132001. for k, v := range c.header_ {
  132002. reqHeaders[k] = v
  132003. }
  132004. reqHeaders.Set("User-Agent", c.s.userAgent())
  132005. var body io.Reader = nil
  132006. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  132007. if err != nil {
  132008. return nil, err
  132009. }
  132010. reqHeaders.Set("Content-Type", "application/json")
  132011. c.urlParams_.Set("alt", alt)
  132012. c.urlParams_.Set("prettyPrint", "false")
  132013. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  132014. urls += "?" + c.urlParams_.Encode()
  132015. req, err := http.NewRequest("POST", urls, body)
  132016. if err != nil {
  132017. return nil, err
  132018. }
  132019. req.Header = reqHeaders
  132020. googleapi.Expand(req.URL, map[string]string{
  132021. "project": c.project,
  132022. "targetHttpsProxy": c.targetHttpsProxy,
  132023. })
  132024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132025. }
  132026. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  132027. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132028. // status code is an error. Response headers are in either
  132029. // *Operation.ServerResponse.Header or (if a response was returned at
  132030. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132031. // to check whether the returned error was because
  132032. // http.StatusNotModified was returned.
  132033. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132034. gensupport.SetOptions(c.urlParams_, opts...)
  132035. res, err := c.doRequest("json")
  132036. if res != nil && res.StatusCode == http.StatusNotModified {
  132037. if res.Body != nil {
  132038. res.Body.Close()
  132039. }
  132040. return nil, &googleapi.Error{
  132041. Code: res.StatusCode,
  132042. Header: res.Header,
  132043. }
  132044. }
  132045. if err != nil {
  132046. return nil, err
  132047. }
  132048. defer googleapi.CloseBody(res)
  132049. if err := googleapi.CheckResponse(res); err != nil {
  132050. return nil, err
  132051. }
  132052. ret := &Operation{
  132053. ServerResponse: googleapi.ServerResponse{
  132054. Header: res.Header,
  132055. HTTPStatusCode: res.StatusCode,
  132056. },
  132057. }
  132058. target := &ret
  132059. if err := gensupport.DecodeResponse(target, res); err != nil {
  132060. return nil, err
  132061. }
  132062. return ret, nil
  132063. // {
  132064. // "description": "Changes the URL map for TargetHttpsProxy.",
  132065. // "httpMethod": "POST",
  132066. // "id": "compute.targetHttpsProxies.setUrlMap",
  132067. // "parameterOrder": [
  132068. // "project",
  132069. // "targetHttpsProxy"
  132070. // ],
  132071. // "parameters": {
  132072. // "project": {
  132073. // "description": "Project ID for this request.",
  132074. // "location": "path",
  132075. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132076. // "required": true,
  132077. // "type": "string"
  132078. // },
  132079. // "requestId": {
  132080. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132081. // "location": "query",
  132082. // "type": "string"
  132083. // },
  132084. // "targetHttpsProxy": {
  132085. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  132086. // "location": "path",
  132087. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132088. // "required": true,
  132089. // "type": "string"
  132090. // }
  132091. // },
  132092. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  132093. // "request": {
  132094. // "$ref": "UrlMapReference"
  132095. // },
  132096. // "response": {
  132097. // "$ref": "Operation"
  132098. // },
  132099. // "scopes": [
  132100. // "https://www.googleapis.com/auth/cloud-platform",
  132101. // "https://www.googleapis.com/auth/compute"
  132102. // ]
  132103. // }
  132104. }
  132105. // method id "compute.targetHttpsProxies.testIamPermissions":
  132106. type TargetHttpsProxiesTestIamPermissionsCall struct {
  132107. s *Service
  132108. project string
  132109. resource string
  132110. testpermissionsrequest *TestPermissionsRequest
  132111. urlParams_ gensupport.URLParams
  132112. ctx_ context.Context
  132113. header_ http.Header
  132114. }
  132115. // TestIamPermissions: Returns permissions that a caller has on the
  132116. // specified resource.
  132117. func (r *TargetHttpsProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpsProxiesTestIamPermissionsCall {
  132118. c := &TargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132119. c.project = project
  132120. c.resource = resource
  132121. c.testpermissionsrequest = testpermissionsrequest
  132122. return c
  132123. }
  132124. // Fields allows partial responses to be retrieved. See
  132125. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132126. // for more information.
  132127. func (c *TargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesTestIamPermissionsCall {
  132128. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132129. return c
  132130. }
  132131. // Context sets the context to be used in this call's Do method. Any
  132132. // pending HTTP request will be aborted if the provided context is
  132133. // canceled.
  132134. func (c *TargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpsProxiesTestIamPermissionsCall {
  132135. c.ctx_ = ctx
  132136. return c
  132137. }
  132138. // Header returns an http.Header that can be modified by the caller to
  132139. // add HTTP headers to the request.
  132140. func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  132141. if c.header_ == nil {
  132142. c.header_ = make(http.Header)
  132143. }
  132144. return c.header_
  132145. }
  132146. func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  132147. reqHeaders := make(http.Header)
  132148. for k, v := range c.header_ {
  132149. reqHeaders[k] = v
  132150. }
  132151. reqHeaders.Set("User-Agent", c.s.userAgent())
  132152. var body io.Reader = nil
  132153. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  132154. if err != nil {
  132155. return nil, err
  132156. }
  132157. reqHeaders.Set("Content-Type", "application/json")
  132158. c.urlParams_.Set("alt", alt)
  132159. c.urlParams_.Set("prettyPrint", "false")
  132160. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{resource}/testIamPermissions")
  132161. urls += "?" + c.urlParams_.Encode()
  132162. req, err := http.NewRequest("POST", urls, body)
  132163. if err != nil {
  132164. return nil, err
  132165. }
  132166. req.Header = reqHeaders
  132167. googleapi.Expand(req.URL, map[string]string{
  132168. "project": c.project,
  132169. "resource": c.resource,
  132170. })
  132171. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132172. }
  132173. // Do executes the "compute.targetHttpsProxies.testIamPermissions" call.
  132174. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  132175. // non-2xx status code is an error. Response headers are in either
  132176. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  132177. // returned at all) in error.(*googleapi.Error).Header. Use
  132178. // googleapi.IsNotModified to check whether the returned error was
  132179. // because http.StatusNotModified was returned.
  132180. func (c *TargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  132181. gensupport.SetOptions(c.urlParams_, opts...)
  132182. res, err := c.doRequest("json")
  132183. if res != nil && res.StatusCode == http.StatusNotModified {
  132184. if res.Body != nil {
  132185. res.Body.Close()
  132186. }
  132187. return nil, &googleapi.Error{
  132188. Code: res.StatusCode,
  132189. Header: res.Header,
  132190. }
  132191. }
  132192. if err != nil {
  132193. return nil, err
  132194. }
  132195. defer googleapi.CloseBody(res)
  132196. if err := googleapi.CheckResponse(res); err != nil {
  132197. return nil, err
  132198. }
  132199. ret := &TestPermissionsResponse{
  132200. ServerResponse: googleapi.ServerResponse{
  132201. Header: res.Header,
  132202. HTTPStatusCode: res.StatusCode,
  132203. },
  132204. }
  132205. target := &ret
  132206. if err := gensupport.DecodeResponse(target, res); err != nil {
  132207. return nil, err
  132208. }
  132209. return ret, nil
  132210. // {
  132211. // "description": "Returns permissions that a caller has on the specified resource.",
  132212. // "httpMethod": "POST",
  132213. // "id": "compute.targetHttpsProxies.testIamPermissions",
  132214. // "parameterOrder": [
  132215. // "project",
  132216. // "resource"
  132217. // ],
  132218. // "parameters": {
  132219. // "project": {
  132220. // "description": "Project ID for this request.",
  132221. // "location": "path",
  132222. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132223. // "required": true,
  132224. // "type": "string"
  132225. // },
  132226. // "resource": {
  132227. // "description": "Name or id of the resource for this request.",
  132228. // "location": "path",
  132229. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132230. // "required": true,
  132231. // "type": "string"
  132232. // }
  132233. // },
  132234. // "path": "{project}/global/targetHttpsProxies/{resource}/testIamPermissions",
  132235. // "request": {
  132236. // "$ref": "TestPermissionsRequest"
  132237. // },
  132238. // "response": {
  132239. // "$ref": "TestPermissionsResponse"
  132240. // },
  132241. // "scopes": [
  132242. // "https://www.googleapis.com/auth/cloud-platform",
  132243. // "https://www.googleapis.com/auth/compute",
  132244. // "https://www.googleapis.com/auth/compute.readonly"
  132245. // ]
  132246. // }
  132247. }
  132248. // method id "compute.targetInstances.aggregatedList":
  132249. type TargetInstancesAggregatedListCall struct {
  132250. s *Service
  132251. project string
  132252. urlParams_ gensupport.URLParams
  132253. ifNoneMatch_ string
  132254. ctx_ context.Context
  132255. header_ http.Header
  132256. }
  132257. // AggregatedList: Retrieves an aggregated list of target instances.
  132258. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  132259. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  132260. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132261. c.project = project
  132262. return c
  132263. }
  132264. // Filter sets the optional parameter "filter": A filter expression that
  132265. // filters resources listed in the response. The expression must specify
  132266. // the field name, a comparison operator, and the value that you want to
  132267. // use for filtering. The value must be a string, a number, or a
  132268. // boolean. The comparison operator must be either =, !=, >, or <.
  132269. //
  132270. // For example, if you are filtering Compute Engine instances, you can
  132271. // exclude instances named example-instance by specifying name !=
  132272. // example-instance.
  132273. //
  132274. // You can also filter nested fields. For example, you could specify
  132275. // scheduling.automaticRestart = false to include instances only if they
  132276. // are not scheduled for automatic restarts. You can use filtering on
  132277. // nested fields to filter based on resource labels.
  132278. //
  132279. // To filter on multiple expressions, provide each separate expression
  132280. // within parentheses. For example, (scheduling.automaticRestart = true)
  132281. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  132282. // AND expression. However, you can include AND and OR expressions
  132283. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  132284. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  132285. // true).
  132286. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  132287. c.urlParams_.Set("filter", filter)
  132288. return c
  132289. }
  132290. // MaxResults sets the optional parameter "maxResults": The maximum
  132291. // number of results per page that should be returned. If the number of
  132292. // available results is larger than maxResults, Compute Engine returns a
  132293. // nextPageToken that can be used to get the next page of results in
  132294. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  132295. // (Default: 500)
  132296. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  132297. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  132298. return c
  132299. }
  132300. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  132301. // a certain order. By default, results are returned in alphanumerical
  132302. // order based on the resource name.
  132303. //
  132304. // You can also sort results in descending order based on the creation
  132305. // timestamp using orderBy="creationTimestamp desc". This sorts results
  132306. // based on the creationTimestamp field in reverse chronological order
  132307. // (newest result first). Use this to sort resources like operations so
  132308. // that the newest operation is returned first.
  132309. //
  132310. // Currently, only sorting by name or creationTimestamp desc is
  132311. // supported.
  132312. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  132313. c.urlParams_.Set("orderBy", orderBy)
  132314. return c
  132315. }
  132316. // PageToken sets the optional parameter "pageToken": Specifies a page
  132317. // token to use. Set pageToken to the nextPageToken returned by a
  132318. // previous list request to get the next page of results.
  132319. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  132320. c.urlParams_.Set("pageToken", pageToken)
  132321. return c
  132322. }
  132323. // Fields allows partial responses to be retrieved. See
  132324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132325. // for more information.
  132326. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  132327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132328. return c
  132329. }
  132330. // IfNoneMatch sets the optional parameter which makes the operation
  132331. // fail if the object's ETag matches the given value. This is useful for
  132332. // getting updates only after the object has changed since the last
  132333. // request. Use googleapi.IsNotModified to check whether the response
  132334. // error from Do is the result of In-None-Match.
  132335. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  132336. c.ifNoneMatch_ = entityTag
  132337. return c
  132338. }
  132339. // Context sets the context to be used in this call's Do method. Any
  132340. // pending HTTP request will be aborted if the provided context is
  132341. // canceled.
  132342. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  132343. c.ctx_ = ctx
  132344. return c
  132345. }
  132346. // Header returns an http.Header that can be modified by the caller to
  132347. // add HTTP headers to the request.
  132348. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  132349. if c.header_ == nil {
  132350. c.header_ = make(http.Header)
  132351. }
  132352. return c.header_
  132353. }
  132354. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  132355. reqHeaders := make(http.Header)
  132356. for k, v := range c.header_ {
  132357. reqHeaders[k] = v
  132358. }
  132359. reqHeaders.Set("User-Agent", c.s.userAgent())
  132360. if c.ifNoneMatch_ != "" {
  132361. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  132362. }
  132363. var body io.Reader = nil
  132364. c.urlParams_.Set("alt", alt)
  132365. c.urlParams_.Set("prettyPrint", "false")
  132366. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  132367. urls += "?" + c.urlParams_.Encode()
  132368. req, err := http.NewRequest("GET", urls, body)
  132369. if err != nil {
  132370. return nil, err
  132371. }
  132372. req.Header = reqHeaders
  132373. googleapi.Expand(req.URL, map[string]string{
  132374. "project": c.project,
  132375. })
  132376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132377. }
  132378. // Do executes the "compute.targetInstances.aggregatedList" call.
  132379. // Exactly one of *TargetInstanceAggregatedList or error will be
  132380. // non-nil. Any non-2xx status code is an error. Response headers are in
  132381. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  132382. // response was returned at all) in error.(*googleapi.Error).Header. Use
  132383. // googleapi.IsNotModified to check whether the returned error was
  132384. // because http.StatusNotModified was returned.
  132385. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  132386. gensupport.SetOptions(c.urlParams_, opts...)
  132387. res, err := c.doRequest("json")
  132388. if res != nil && res.StatusCode == http.StatusNotModified {
  132389. if res.Body != nil {
  132390. res.Body.Close()
  132391. }
  132392. return nil, &googleapi.Error{
  132393. Code: res.StatusCode,
  132394. Header: res.Header,
  132395. }
  132396. }
  132397. if err != nil {
  132398. return nil, err
  132399. }
  132400. defer googleapi.CloseBody(res)
  132401. if err := googleapi.CheckResponse(res); err != nil {
  132402. return nil, err
  132403. }
  132404. ret := &TargetInstanceAggregatedList{
  132405. ServerResponse: googleapi.ServerResponse{
  132406. Header: res.Header,
  132407. HTTPStatusCode: res.StatusCode,
  132408. },
  132409. }
  132410. target := &ret
  132411. if err := gensupport.DecodeResponse(target, res); err != nil {
  132412. return nil, err
  132413. }
  132414. return ret, nil
  132415. // {
  132416. // "description": "Retrieves an aggregated list of target instances.",
  132417. // "httpMethod": "GET",
  132418. // "id": "compute.targetInstances.aggregatedList",
  132419. // "parameterOrder": [
  132420. // "project"
  132421. // ],
  132422. // "parameters": {
  132423. // "filter": {
  132424. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  132425. // "location": "query",
  132426. // "type": "string"
  132427. // },
  132428. // "maxResults": {
  132429. // "default": "500",
  132430. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  132431. // "format": "uint32",
  132432. // "location": "query",
  132433. // "minimum": "0",
  132434. // "type": "integer"
  132435. // },
  132436. // "orderBy": {
  132437. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  132438. // "location": "query",
  132439. // "type": "string"
  132440. // },
  132441. // "pageToken": {
  132442. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  132443. // "location": "query",
  132444. // "type": "string"
  132445. // },
  132446. // "project": {
  132447. // "description": "Project ID for this request.",
  132448. // "location": "path",
  132449. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132450. // "required": true,
  132451. // "type": "string"
  132452. // }
  132453. // },
  132454. // "path": "{project}/aggregated/targetInstances",
  132455. // "response": {
  132456. // "$ref": "TargetInstanceAggregatedList"
  132457. // },
  132458. // "scopes": [
  132459. // "https://www.googleapis.com/auth/cloud-platform",
  132460. // "https://www.googleapis.com/auth/compute",
  132461. // "https://www.googleapis.com/auth/compute.readonly"
  132462. // ]
  132463. // }
  132464. }
  132465. // Pages invokes f for each page of results.
  132466. // A non-nil error returned from f will halt the iteration.
  132467. // The provided context supersedes any context provided to the Context method.
  132468. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  132469. c.ctx_ = ctx
  132470. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  132471. for {
  132472. x, err := c.Do()
  132473. if err != nil {
  132474. return err
  132475. }
  132476. if err := f(x); err != nil {
  132477. return err
  132478. }
  132479. if x.NextPageToken == "" {
  132480. return nil
  132481. }
  132482. c.PageToken(x.NextPageToken)
  132483. }
  132484. }
  132485. // method id "compute.targetInstances.delete":
  132486. type TargetInstancesDeleteCall struct {
  132487. s *Service
  132488. project string
  132489. zone string
  132490. targetInstance string
  132491. urlParams_ gensupport.URLParams
  132492. ctx_ context.Context
  132493. header_ http.Header
  132494. }
  132495. // Delete: Deletes the specified TargetInstance resource.
  132496. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  132497. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  132498. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132499. c.project = project
  132500. c.zone = zone
  132501. c.targetInstance = targetInstance
  132502. return c
  132503. }
  132504. // RequestId sets the optional parameter "requestId": An optional
  132505. // request ID to identify requests. Specify a unique request ID so that
  132506. // if you must retry your request, the server will know to ignore the
  132507. // request if it has already been completed.
  132508. //
  132509. // For example, consider a situation where you make an initial request
  132510. // and the request times out. If you make the request again with the
  132511. // same request ID, the server can check if original operation with the
  132512. // same request ID was received, and if so, will ignore the second
  132513. // request. This prevents clients from accidentally creating duplicate
  132514. // commitments.
  132515. //
  132516. // The request ID must be a valid UUID with the exception that zero UUID
  132517. // is not supported (00000000-0000-0000-0000-000000000000).
  132518. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  132519. c.urlParams_.Set("requestId", requestId)
  132520. return c
  132521. }
  132522. // Fields allows partial responses to be retrieved. See
  132523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132524. // for more information.
  132525. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  132526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132527. return c
  132528. }
  132529. // Context sets the context to be used in this call's Do method. Any
  132530. // pending HTTP request will be aborted if the provided context is
  132531. // canceled.
  132532. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  132533. c.ctx_ = ctx
  132534. return c
  132535. }
  132536. // Header returns an http.Header that can be modified by the caller to
  132537. // add HTTP headers to the request.
  132538. func (c *TargetInstancesDeleteCall) Header() http.Header {
  132539. if c.header_ == nil {
  132540. c.header_ = make(http.Header)
  132541. }
  132542. return c.header_
  132543. }
  132544. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  132545. reqHeaders := make(http.Header)
  132546. for k, v := range c.header_ {
  132547. reqHeaders[k] = v
  132548. }
  132549. reqHeaders.Set("User-Agent", c.s.userAgent())
  132550. var body io.Reader = nil
  132551. c.urlParams_.Set("alt", alt)
  132552. c.urlParams_.Set("prettyPrint", "false")
  132553. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  132554. urls += "?" + c.urlParams_.Encode()
  132555. req, err := http.NewRequest("DELETE", urls, body)
  132556. if err != nil {
  132557. return nil, err
  132558. }
  132559. req.Header = reqHeaders
  132560. googleapi.Expand(req.URL, map[string]string{
  132561. "project": c.project,
  132562. "zone": c.zone,
  132563. "targetInstance": c.targetInstance,
  132564. })
  132565. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132566. }
  132567. // Do executes the "compute.targetInstances.delete" call.
  132568. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132569. // status code is an error. Response headers are in either
  132570. // *Operation.ServerResponse.Header or (if a response was returned at
  132571. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132572. // to check whether the returned error was because
  132573. // http.StatusNotModified was returned.
  132574. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132575. gensupport.SetOptions(c.urlParams_, opts...)
  132576. res, err := c.doRequest("json")
  132577. if res != nil && res.StatusCode == http.StatusNotModified {
  132578. if res.Body != nil {
  132579. res.Body.Close()
  132580. }
  132581. return nil, &googleapi.Error{
  132582. Code: res.StatusCode,
  132583. Header: res.Header,
  132584. }
  132585. }
  132586. if err != nil {
  132587. return nil, err
  132588. }
  132589. defer googleapi.CloseBody(res)
  132590. if err := googleapi.CheckResponse(res); err != nil {
  132591. return nil, err
  132592. }
  132593. ret := &Operation{
  132594. ServerResponse: googleapi.ServerResponse{
  132595. Header: res.Header,
  132596. HTTPStatusCode: res.StatusCode,
  132597. },
  132598. }
  132599. target := &ret
  132600. if err := gensupport.DecodeResponse(target, res); err != nil {
  132601. return nil, err
  132602. }
  132603. return ret, nil
  132604. // {
  132605. // "description": "Deletes the specified TargetInstance resource.",
  132606. // "httpMethod": "DELETE",
  132607. // "id": "compute.targetInstances.delete",
  132608. // "parameterOrder": [
  132609. // "project",
  132610. // "zone",
  132611. // "targetInstance"
  132612. // ],
  132613. // "parameters": {
  132614. // "project": {
  132615. // "description": "Project ID for this request.",
  132616. // "location": "path",
  132617. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132618. // "required": true,
  132619. // "type": "string"
  132620. // },
  132621. // "requestId": {
  132622. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132623. // "location": "query",
  132624. // "type": "string"
  132625. // },
  132626. // "targetInstance": {
  132627. // "description": "Name of the TargetInstance resource to delete.",
  132628. // "location": "path",
  132629. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132630. // "required": true,
  132631. // "type": "string"
  132632. // },
  132633. // "zone": {
  132634. // "description": "Name of the zone scoping this request.",
  132635. // "location": "path",
  132636. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  132637. // "required": true,
  132638. // "type": "string"
  132639. // }
  132640. // },
  132641. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  132642. // "response": {
  132643. // "$ref": "Operation"
  132644. // },
  132645. // "scopes": [
  132646. // "https://www.googleapis.com/auth/cloud-platform",
  132647. // "https://www.googleapis.com/auth/compute"
  132648. // ]
  132649. // }
  132650. }
  132651. // method id "compute.targetInstances.get":
  132652. type TargetInstancesGetCall struct {
  132653. s *Service
  132654. project string
  132655. zone string
  132656. targetInstance string
  132657. urlParams_ gensupport.URLParams
  132658. ifNoneMatch_ string
  132659. ctx_ context.Context
  132660. header_ http.Header
  132661. }
  132662. // Get: Returns the specified TargetInstance resource. Gets a list of
  132663. // available target instances by making a list() request.
  132664. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  132665. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  132666. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132667. c.project = project
  132668. c.zone = zone
  132669. c.targetInstance = targetInstance
  132670. return c
  132671. }
  132672. // Fields allows partial responses to be retrieved. See
  132673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132674. // for more information.
  132675. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  132676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132677. return c
  132678. }
  132679. // IfNoneMatch sets the optional parameter which makes the operation
  132680. // fail if the object's ETag matches the given value. This is useful for
  132681. // getting updates only after the object has changed since the last
  132682. // request. Use googleapi.IsNotModified to check whether the response
  132683. // error from Do is the result of In-None-Match.
  132684. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  132685. c.ifNoneMatch_ = entityTag
  132686. return c
  132687. }
  132688. // Context sets the context to be used in this call's Do method. Any
  132689. // pending HTTP request will be aborted if the provided context is
  132690. // canceled.
  132691. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  132692. c.ctx_ = ctx
  132693. return c
  132694. }
  132695. // Header returns an http.Header that can be modified by the caller to
  132696. // add HTTP headers to the request.
  132697. func (c *TargetInstancesGetCall) Header() http.Header {
  132698. if c.header_ == nil {
  132699. c.header_ = make(http.Header)
  132700. }
  132701. return c.header_
  132702. }
  132703. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  132704. reqHeaders := make(http.Header)
  132705. for k, v := range c.header_ {
  132706. reqHeaders[k] = v
  132707. }
  132708. reqHeaders.Set("User-Agent", c.s.userAgent())
  132709. if c.ifNoneMatch_ != "" {
  132710. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  132711. }
  132712. var body io.Reader = nil
  132713. c.urlParams_.Set("alt", alt)
  132714. c.urlParams_.Set("prettyPrint", "false")
  132715. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  132716. urls += "?" + c.urlParams_.Encode()
  132717. req, err := http.NewRequest("GET", urls, body)
  132718. if err != nil {
  132719. return nil, err
  132720. }
  132721. req.Header = reqHeaders
  132722. googleapi.Expand(req.URL, map[string]string{
  132723. "project": c.project,
  132724. "zone": c.zone,
  132725. "targetInstance": c.targetInstance,
  132726. })
  132727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132728. }
  132729. // Do executes the "compute.targetInstances.get" call.
  132730. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  132731. // status code is an error. Response headers are in either
  132732. // *TargetInstance.ServerResponse.Header or (if a response was returned
  132733. // at all) in error.(*googleapi.Error).Header. Use
  132734. // googleapi.IsNotModified to check whether the returned error was
  132735. // because http.StatusNotModified was returned.
  132736. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  132737. gensupport.SetOptions(c.urlParams_, opts...)
  132738. res, err := c.doRequest("json")
  132739. if res != nil && res.StatusCode == http.StatusNotModified {
  132740. if res.Body != nil {
  132741. res.Body.Close()
  132742. }
  132743. return nil, &googleapi.Error{
  132744. Code: res.StatusCode,
  132745. Header: res.Header,
  132746. }
  132747. }
  132748. if err != nil {
  132749. return nil, err
  132750. }
  132751. defer googleapi.CloseBody(res)
  132752. if err := googleapi.CheckResponse(res); err != nil {
  132753. return nil, err
  132754. }
  132755. ret := &TargetInstance{
  132756. ServerResponse: googleapi.ServerResponse{
  132757. Header: res.Header,
  132758. HTTPStatusCode: res.StatusCode,
  132759. },
  132760. }
  132761. target := &ret
  132762. if err := gensupport.DecodeResponse(target, res); err != nil {
  132763. return nil, err
  132764. }
  132765. return ret, nil
  132766. // {
  132767. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  132768. // "httpMethod": "GET",
  132769. // "id": "compute.targetInstances.get",
  132770. // "parameterOrder": [
  132771. // "project",
  132772. // "zone",
  132773. // "targetInstance"
  132774. // ],
  132775. // "parameters": {
  132776. // "project": {
  132777. // "description": "Project ID for this request.",
  132778. // "location": "path",
  132779. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132780. // "required": true,
  132781. // "type": "string"
  132782. // },
  132783. // "targetInstance": {
  132784. // "description": "Name of the TargetInstance resource to return.",
  132785. // "location": "path",
  132786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  132787. // "required": true,
  132788. // "type": "string"
  132789. // },
  132790. // "zone": {
  132791. // "description": "Name of the zone scoping this request.",
  132792. // "location": "path",
  132793. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  132794. // "required": true,
  132795. // "type": "string"
  132796. // }
  132797. // },
  132798. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  132799. // "response": {
  132800. // "$ref": "TargetInstance"
  132801. // },
  132802. // "scopes": [
  132803. // "https://www.googleapis.com/auth/cloud-platform",
  132804. // "https://www.googleapis.com/auth/compute",
  132805. // "https://www.googleapis.com/auth/compute.readonly"
  132806. // ]
  132807. // }
  132808. }
  132809. // method id "compute.targetInstances.insert":
  132810. type TargetInstancesInsertCall struct {
  132811. s *Service
  132812. project string
  132813. zone string
  132814. targetinstance *TargetInstance
  132815. urlParams_ gensupport.URLParams
  132816. ctx_ context.Context
  132817. header_ http.Header
  132818. }
  132819. // Insert: Creates a TargetInstance resource in the specified project
  132820. // and zone using the data included in the request.
  132821. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  132822. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  132823. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132824. c.project = project
  132825. c.zone = zone
  132826. c.targetinstance = targetinstance
  132827. return c
  132828. }
  132829. // RequestId sets the optional parameter "requestId": An optional
  132830. // request ID to identify requests. Specify a unique request ID so that
  132831. // if you must retry your request, the server will know to ignore the
  132832. // request if it has already been completed.
  132833. //
  132834. // For example, consider a situation where you make an initial request
  132835. // and the request times out. If you make the request again with the
  132836. // same request ID, the server can check if original operation with the
  132837. // same request ID was received, and if so, will ignore the second
  132838. // request. This prevents clients from accidentally creating duplicate
  132839. // commitments.
  132840. //
  132841. // The request ID must be a valid UUID with the exception that zero UUID
  132842. // is not supported (00000000-0000-0000-0000-000000000000).
  132843. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  132844. c.urlParams_.Set("requestId", requestId)
  132845. return c
  132846. }
  132847. // Fields allows partial responses to be retrieved. See
  132848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  132849. // for more information.
  132850. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  132851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  132852. return c
  132853. }
  132854. // Context sets the context to be used in this call's Do method. Any
  132855. // pending HTTP request will be aborted if the provided context is
  132856. // canceled.
  132857. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  132858. c.ctx_ = ctx
  132859. return c
  132860. }
  132861. // Header returns an http.Header that can be modified by the caller to
  132862. // add HTTP headers to the request.
  132863. func (c *TargetInstancesInsertCall) Header() http.Header {
  132864. if c.header_ == nil {
  132865. c.header_ = make(http.Header)
  132866. }
  132867. return c.header_
  132868. }
  132869. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  132870. reqHeaders := make(http.Header)
  132871. for k, v := range c.header_ {
  132872. reqHeaders[k] = v
  132873. }
  132874. reqHeaders.Set("User-Agent", c.s.userAgent())
  132875. var body io.Reader = nil
  132876. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  132877. if err != nil {
  132878. return nil, err
  132879. }
  132880. reqHeaders.Set("Content-Type", "application/json")
  132881. c.urlParams_.Set("alt", alt)
  132882. c.urlParams_.Set("prettyPrint", "false")
  132883. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  132884. urls += "?" + c.urlParams_.Encode()
  132885. req, err := http.NewRequest("POST", urls, body)
  132886. if err != nil {
  132887. return nil, err
  132888. }
  132889. req.Header = reqHeaders
  132890. googleapi.Expand(req.URL, map[string]string{
  132891. "project": c.project,
  132892. "zone": c.zone,
  132893. })
  132894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  132895. }
  132896. // Do executes the "compute.targetInstances.insert" call.
  132897. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  132898. // status code is an error. Response headers are in either
  132899. // *Operation.ServerResponse.Header or (if a response was returned at
  132900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  132901. // to check whether the returned error was because
  132902. // http.StatusNotModified was returned.
  132903. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  132904. gensupport.SetOptions(c.urlParams_, opts...)
  132905. res, err := c.doRequest("json")
  132906. if res != nil && res.StatusCode == http.StatusNotModified {
  132907. if res.Body != nil {
  132908. res.Body.Close()
  132909. }
  132910. return nil, &googleapi.Error{
  132911. Code: res.StatusCode,
  132912. Header: res.Header,
  132913. }
  132914. }
  132915. if err != nil {
  132916. return nil, err
  132917. }
  132918. defer googleapi.CloseBody(res)
  132919. if err := googleapi.CheckResponse(res); err != nil {
  132920. return nil, err
  132921. }
  132922. ret := &Operation{
  132923. ServerResponse: googleapi.ServerResponse{
  132924. Header: res.Header,
  132925. HTTPStatusCode: res.StatusCode,
  132926. },
  132927. }
  132928. target := &ret
  132929. if err := gensupport.DecodeResponse(target, res); err != nil {
  132930. return nil, err
  132931. }
  132932. return ret, nil
  132933. // {
  132934. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  132935. // "httpMethod": "POST",
  132936. // "id": "compute.targetInstances.insert",
  132937. // "parameterOrder": [
  132938. // "project",
  132939. // "zone"
  132940. // ],
  132941. // "parameters": {
  132942. // "project": {
  132943. // "description": "Project ID for this request.",
  132944. // "location": "path",
  132945. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  132946. // "required": true,
  132947. // "type": "string"
  132948. // },
  132949. // "requestId": {
  132950. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  132951. // "location": "query",
  132952. // "type": "string"
  132953. // },
  132954. // "zone": {
  132955. // "description": "Name of the zone scoping this request.",
  132956. // "location": "path",
  132957. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  132958. // "required": true,
  132959. // "type": "string"
  132960. // }
  132961. // },
  132962. // "path": "{project}/zones/{zone}/targetInstances",
  132963. // "request": {
  132964. // "$ref": "TargetInstance"
  132965. // },
  132966. // "response": {
  132967. // "$ref": "Operation"
  132968. // },
  132969. // "scopes": [
  132970. // "https://www.googleapis.com/auth/cloud-platform",
  132971. // "https://www.googleapis.com/auth/compute"
  132972. // ]
  132973. // }
  132974. }
  132975. // method id "compute.targetInstances.list":
  132976. type TargetInstancesListCall struct {
  132977. s *Service
  132978. project string
  132979. zone string
  132980. urlParams_ gensupport.URLParams
  132981. ifNoneMatch_ string
  132982. ctx_ context.Context
  132983. header_ http.Header
  132984. }
  132985. // List: Retrieves a list of TargetInstance resources available to the
  132986. // specified project and zone.
  132987. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  132988. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  132989. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  132990. c.project = project
  132991. c.zone = zone
  132992. return c
  132993. }
  132994. // Filter sets the optional parameter "filter": A filter expression that
  132995. // filters resources listed in the response. The expression must specify
  132996. // the field name, a comparison operator, and the value that you want to
  132997. // use for filtering. The value must be a string, a number, or a
  132998. // boolean. The comparison operator must be either =, !=, >, or <.
  132999. //
  133000. // For example, if you are filtering Compute Engine instances, you can
  133001. // exclude instances named example-instance by specifying name !=
  133002. // example-instance.
  133003. //
  133004. // You can also filter nested fields. For example, you could specify
  133005. // scheduling.automaticRestart = false to include instances only if they
  133006. // are not scheduled for automatic restarts. You can use filtering on
  133007. // nested fields to filter based on resource labels.
  133008. //
  133009. // To filter on multiple expressions, provide each separate expression
  133010. // within parentheses. For example, (scheduling.automaticRestart = true)
  133011. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  133012. // AND expression. However, you can include AND and OR expressions
  133013. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  133014. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  133015. // true).
  133016. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  133017. c.urlParams_.Set("filter", filter)
  133018. return c
  133019. }
  133020. // MaxResults sets the optional parameter "maxResults": The maximum
  133021. // number of results per page that should be returned. If the number of
  133022. // available results is larger than maxResults, Compute Engine returns a
  133023. // nextPageToken that can be used to get the next page of results in
  133024. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  133025. // (Default: 500)
  133026. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  133027. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  133028. return c
  133029. }
  133030. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  133031. // a certain order. By default, results are returned in alphanumerical
  133032. // order based on the resource name.
  133033. //
  133034. // You can also sort results in descending order based on the creation
  133035. // timestamp using orderBy="creationTimestamp desc". This sorts results
  133036. // based on the creationTimestamp field in reverse chronological order
  133037. // (newest result first). Use this to sort resources like operations so
  133038. // that the newest operation is returned first.
  133039. //
  133040. // Currently, only sorting by name or creationTimestamp desc is
  133041. // supported.
  133042. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  133043. c.urlParams_.Set("orderBy", orderBy)
  133044. return c
  133045. }
  133046. // PageToken sets the optional parameter "pageToken": Specifies a page
  133047. // token to use. Set pageToken to the nextPageToken returned by a
  133048. // previous list request to get the next page of results.
  133049. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  133050. c.urlParams_.Set("pageToken", pageToken)
  133051. return c
  133052. }
  133053. // Fields allows partial responses to be retrieved. See
  133054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133055. // for more information.
  133056. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  133057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133058. return c
  133059. }
  133060. // IfNoneMatch sets the optional parameter which makes the operation
  133061. // fail if the object's ETag matches the given value. This is useful for
  133062. // getting updates only after the object has changed since the last
  133063. // request. Use googleapi.IsNotModified to check whether the response
  133064. // error from Do is the result of In-None-Match.
  133065. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  133066. c.ifNoneMatch_ = entityTag
  133067. return c
  133068. }
  133069. // Context sets the context to be used in this call's Do method. Any
  133070. // pending HTTP request will be aborted if the provided context is
  133071. // canceled.
  133072. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  133073. c.ctx_ = ctx
  133074. return c
  133075. }
  133076. // Header returns an http.Header that can be modified by the caller to
  133077. // add HTTP headers to the request.
  133078. func (c *TargetInstancesListCall) Header() http.Header {
  133079. if c.header_ == nil {
  133080. c.header_ = make(http.Header)
  133081. }
  133082. return c.header_
  133083. }
  133084. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  133085. reqHeaders := make(http.Header)
  133086. for k, v := range c.header_ {
  133087. reqHeaders[k] = v
  133088. }
  133089. reqHeaders.Set("User-Agent", c.s.userAgent())
  133090. if c.ifNoneMatch_ != "" {
  133091. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  133092. }
  133093. var body io.Reader = nil
  133094. c.urlParams_.Set("alt", alt)
  133095. c.urlParams_.Set("prettyPrint", "false")
  133096. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  133097. urls += "?" + c.urlParams_.Encode()
  133098. req, err := http.NewRequest("GET", urls, body)
  133099. if err != nil {
  133100. return nil, err
  133101. }
  133102. req.Header = reqHeaders
  133103. googleapi.Expand(req.URL, map[string]string{
  133104. "project": c.project,
  133105. "zone": c.zone,
  133106. })
  133107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133108. }
  133109. // Do executes the "compute.targetInstances.list" call.
  133110. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  133111. // non-2xx status code is an error. Response headers are in either
  133112. // *TargetInstanceList.ServerResponse.Header or (if a response was
  133113. // returned at all) in error.(*googleapi.Error).Header. Use
  133114. // googleapi.IsNotModified to check whether the returned error was
  133115. // because http.StatusNotModified was returned.
  133116. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  133117. gensupport.SetOptions(c.urlParams_, opts...)
  133118. res, err := c.doRequest("json")
  133119. if res != nil && res.StatusCode == http.StatusNotModified {
  133120. if res.Body != nil {
  133121. res.Body.Close()
  133122. }
  133123. return nil, &googleapi.Error{
  133124. Code: res.StatusCode,
  133125. Header: res.Header,
  133126. }
  133127. }
  133128. if err != nil {
  133129. return nil, err
  133130. }
  133131. defer googleapi.CloseBody(res)
  133132. if err := googleapi.CheckResponse(res); err != nil {
  133133. return nil, err
  133134. }
  133135. ret := &TargetInstanceList{
  133136. ServerResponse: googleapi.ServerResponse{
  133137. Header: res.Header,
  133138. HTTPStatusCode: res.StatusCode,
  133139. },
  133140. }
  133141. target := &ret
  133142. if err := gensupport.DecodeResponse(target, res); err != nil {
  133143. return nil, err
  133144. }
  133145. return ret, nil
  133146. // {
  133147. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  133148. // "httpMethod": "GET",
  133149. // "id": "compute.targetInstances.list",
  133150. // "parameterOrder": [
  133151. // "project",
  133152. // "zone"
  133153. // ],
  133154. // "parameters": {
  133155. // "filter": {
  133156. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  133157. // "location": "query",
  133158. // "type": "string"
  133159. // },
  133160. // "maxResults": {
  133161. // "default": "500",
  133162. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  133163. // "format": "uint32",
  133164. // "location": "query",
  133165. // "minimum": "0",
  133166. // "type": "integer"
  133167. // },
  133168. // "orderBy": {
  133169. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  133170. // "location": "query",
  133171. // "type": "string"
  133172. // },
  133173. // "pageToken": {
  133174. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  133175. // "location": "query",
  133176. // "type": "string"
  133177. // },
  133178. // "project": {
  133179. // "description": "Project ID for this request.",
  133180. // "location": "path",
  133181. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133182. // "required": true,
  133183. // "type": "string"
  133184. // },
  133185. // "zone": {
  133186. // "description": "Name of the zone scoping this request.",
  133187. // "location": "path",
  133188. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133189. // "required": true,
  133190. // "type": "string"
  133191. // }
  133192. // },
  133193. // "path": "{project}/zones/{zone}/targetInstances",
  133194. // "response": {
  133195. // "$ref": "TargetInstanceList"
  133196. // },
  133197. // "scopes": [
  133198. // "https://www.googleapis.com/auth/cloud-platform",
  133199. // "https://www.googleapis.com/auth/compute",
  133200. // "https://www.googleapis.com/auth/compute.readonly"
  133201. // ]
  133202. // }
  133203. }
  133204. // Pages invokes f for each page of results.
  133205. // A non-nil error returned from f will halt the iteration.
  133206. // The provided context supersedes any context provided to the Context method.
  133207. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  133208. c.ctx_ = ctx
  133209. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  133210. for {
  133211. x, err := c.Do()
  133212. if err != nil {
  133213. return err
  133214. }
  133215. if err := f(x); err != nil {
  133216. return err
  133217. }
  133218. if x.NextPageToken == "" {
  133219. return nil
  133220. }
  133221. c.PageToken(x.NextPageToken)
  133222. }
  133223. }
  133224. // method id "compute.targetInstances.testIamPermissions":
  133225. type TargetInstancesTestIamPermissionsCall struct {
  133226. s *Service
  133227. project string
  133228. zone string
  133229. resource string
  133230. testpermissionsrequest *TestPermissionsRequest
  133231. urlParams_ gensupport.URLParams
  133232. ctx_ context.Context
  133233. header_ http.Header
  133234. }
  133235. // TestIamPermissions: Returns permissions that a caller has on the
  133236. // specified resource.
  133237. func (r *TargetInstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetInstancesTestIamPermissionsCall {
  133238. c := &TargetInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133239. c.project = project
  133240. c.zone = zone
  133241. c.resource = resource
  133242. c.testpermissionsrequest = testpermissionsrequest
  133243. return c
  133244. }
  133245. // Fields allows partial responses to be retrieved. See
  133246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133247. // for more information.
  133248. func (c *TargetInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetInstancesTestIamPermissionsCall {
  133249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133250. return c
  133251. }
  133252. // Context sets the context to be used in this call's Do method. Any
  133253. // pending HTTP request will be aborted if the provided context is
  133254. // canceled.
  133255. func (c *TargetInstancesTestIamPermissionsCall) Context(ctx context.Context) *TargetInstancesTestIamPermissionsCall {
  133256. c.ctx_ = ctx
  133257. return c
  133258. }
  133259. // Header returns an http.Header that can be modified by the caller to
  133260. // add HTTP headers to the request.
  133261. func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header {
  133262. if c.header_ == nil {
  133263. c.header_ = make(http.Header)
  133264. }
  133265. return c.header_
  133266. }
  133267. func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  133268. reqHeaders := make(http.Header)
  133269. for k, v := range c.header_ {
  133270. reqHeaders[k] = v
  133271. }
  133272. reqHeaders.Set("User-Agent", c.s.userAgent())
  133273. var body io.Reader = nil
  133274. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  133275. if err != nil {
  133276. return nil, err
  133277. }
  133278. reqHeaders.Set("Content-Type", "application/json")
  133279. c.urlParams_.Set("alt", alt)
  133280. c.urlParams_.Set("prettyPrint", "false")
  133281. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions")
  133282. urls += "?" + c.urlParams_.Encode()
  133283. req, err := http.NewRequest("POST", urls, body)
  133284. if err != nil {
  133285. return nil, err
  133286. }
  133287. req.Header = reqHeaders
  133288. googleapi.Expand(req.URL, map[string]string{
  133289. "project": c.project,
  133290. "zone": c.zone,
  133291. "resource": c.resource,
  133292. })
  133293. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133294. }
  133295. // Do executes the "compute.targetInstances.testIamPermissions" call.
  133296. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  133297. // non-2xx status code is an error. Response headers are in either
  133298. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  133299. // returned at all) in error.(*googleapi.Error).Header. Use
  133300. // googleapi.IsNotModified to check whether the returned error was
  133301. // because http.StatusNotModified was returned.
  133302. func (c *TargetInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  133303. gensupport.SetOptions(c.urlParams_, opts...)
  133304. res, err := c.doRequest("json")
  133305. if res != nil && res.StatusCode == http.StatusNotModified {
  133306. if res.Body != nil {
  133307. res.Body.Close()
  133308. }
  133309. return nil, &googleapi.Error{
  133310. Code: res.StatusCode,
  133311. Header: res.Header,
  133312. }
  133313. }
  133314. if err != nil {
  133315. return nil, err
  133316. }
  133317. defer googleapi.CloseBody(res)
  133318. if err := googleapi.CheckResponse(res); err != nil {
  133319. return nil, err
  133320. }
  133321. ret := &TestPermissionsResponse{
  133322. ServerResponse: googleapi.ServerResponse{
  133323. Header: res.Header,
  133324. HTTPStatusCode: res.StatusCode,
  133325. },
  133326. }
  133327. target := &ret
  133328. if err := gensupport.DecodeResponse(target, res); err != nil {
  133329. return nil, err
  133330. }
  133331. return ret, nil
  133332. // {
  133333. // "description": "Returns permissions that a caller has on the specified resource.",
  133334. // "httpMethod": "POST",
  133335. // "id": "compute.targetInstances.testIamPermissions",
  133336. // "parameterOrder": [
  133337. // "project",
  133338. // "zone",
  133339. // "resource"
  133340. // ],
  133341. // "parameters": {
  133342. // "project": {
  133343. // "description": "Project ID for this request.",
  133344. // "location": "path",
  133345. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133346. // "required": true,
  133347. // "type": "string"
  133348. // },
  133349. // "resource": {
  133350. // "description": "Name or id of the resource for this request.",
  133351. // "location": "path",
  133352. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  133353. // "required": true,
  133354. // "type": "string"
  133355. // },
  133356. // "zone": {
  133357. // "description": "The name of the zone for this request.",
  133358. // "location": "path",
  133359. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133360. // "required": true,
  133361. // "type": "string"
  133362. // }
  133363. // },
  133364. // "path": "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions",
  133365. // "request": {
  133366. // "$ref": "TestPermissionsRequest"
  133367. // },
  133368. // "response": {
  133369. // "$ref": "TestPermissionsResponse"
  133370. // },
  133371. // "scopes": [
  133372. // "https://www.googleapis.com/auth/cloud-platform",
  133373. // "https://www.googleapis.com/auth/compute",
  133374. // "https://www.googleapis.com/auth/compute.readonly"
  133375. // ]
  133376. // }
  133377. }
  133378. // method id "compute.targetPools.addHealthCheck":
  133379. type TargetPoolsAddHealthCheckCall struct {
  133380. s *Service
  133381. project string
  133382. region string
  133383. targetPool string
  133384. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  133385. urlParams_ gensupport.URLParams
  133386. ctx_ context.Context
  133387. header_ http.Header
  133388. }
  133389. // AddHealthCheck: Adds health check URLs to a target pool.
  133390. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  133391. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  133392. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133393. c.project = project
  133394. c.region = region
  133395. c.targetPool = targetPool
  133396. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  133397. return c
  133398. }
  133399. // RequestId sets the optional parameter "requestId": An optional
  133400. // request ID to identify requests. Specify a unique request ID so that
  133401. // if you must retry your request, the server will know to ignore the
  133402. // request if it has already been completed.
  133403. //
  133404. // For example, consider a situation where you make an initial request
  133405. // and the request times out. If you make the request again with the
  133406. // same request ID, the server can check if original operation with the
  133407. // same request ID was received, and if so, will ignore the second
  133408. // request. This prevents clients from accidentally creating duplicate
  133409. // commitments.
  133410. //
  133411. // The request ID must be a valid UUID with the exception that zero UUID
  133412. // is not supported (00000000-0000-0000-0000-000000000000).
  133413. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  133414. c.urlParams_.Set("requestId", requestId)
  133415. return c
  133416. }
  133417. // Fields allows partial responses to be retrieved. See
  133418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133419. // for more information.
  133420. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  133421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133422. return c
  133423. }
  133424. // Context sets the context to be used in this call's Do method. Any
  133425. // pending HTTP request will be aborted if the provided context is
  133426. // canceled.
  133427. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  133428. c.ctx_ = ctx
  133429. return c
  133430. }
  133431. // Header returns an http.Header that can be modified by the caller to
  133432. // add HTTP headers to the request.
  133433. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  133434. if c.header_ == nil {
  133435. c.header_ = make(http.Header)
  133436. }
  133437. return c.header_
  133438. }
  133439. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  133440. reqHeaders := make(http.Header)
  133441. for k, v := range c.header_ {
  133442. reqHeaders[k] = v
  133443. }
  133444. reqHeaders.Set("User-Agent", c.s.userAgent())
  133445. var body io.Reader = nil
  133446. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  133447. if err != nil {
  133448. return nil, err
  133449. }
  133450. reqHeaders.Set("Content-Type", "application/json")
  133451. c.urlParams_.Set("alt", alt)
  133452. c.urlParams_.Set("prettyPrint", "false")
  133453. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  133454. urls += "?" + c.urlParams_.Encode()
  133455. req, err := http.NewRequest("POST", urls, body)
  133456. if err != nil {
  133457. return nil, err
  133458. }
  133459. req.Header = reqHeaders
  133460. googleapi.Expand(req.URL, map[string]string{
  133461. "project": c.project,
  133462. "region": c.region,
  133463. "targetPool": c.targetPool,
  133464. })
  133465. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133466. }
  133467. // Do executes the "compute.targetPools.addHealthCheck" call.
  133468. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  133469. // status code is an error. Response headers are in either
  133470. // *Operation.ServerResponse.Header or (if a response was returned at
  133471. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  133472. // to check whether the returned error was because
  133473. // http.StatusNotModified was returned.
  133474. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  133475. gensupport.SetOptions(c.urlParams_, opts...)
  133476. res, err := c.doRequest("json")
  133477. if res != nil && res.StatusCode == http.StatusNotModified {
  133478. if res.Body != nil {
  133479. res.Body.Close()
  133480. }
  133481. return nil, &googleapi.Error{
  133482. Code: res.StatusCode,
  133483. Header: res.Header,
  133484. }
  133485. }
  133486. if err != nil {
  133487. return nil, err
  133488. }
  133489. defer googleapi.CloseBody(res)
  133490. if err := googleapi.CheckResponse(res); err != nil {
  133491. return nil, err
  133492. }
  133493. ret := &Operation{
  133494. ServerResponse: googleapi.ServerResponse{
  133495. Header: res.Header,
  133496. HTTPStatusCode: res.StatusCode,
  133497. },
  133498. }
  133499. target := &ret
  133500. if err := gensupport.DecodeResponse(target, res); err != nil {
  133501. return nil, err
  133502. }
  133503. return ret, nil
  133504. // {
  133505. // "description": "Adds health check URLs to a target pool.",
  133506. // "httpMethod": "POST",
  133507. // "id": "compute.targetPools.addHealthCheck",
  133508. // "parameterOrder": [
  133509. // "project",
  133510. // "region",
  133511. // "targetPool"
  133512. // ],
  133513. // "parameters": {
  133514. // "project": {
  133515. // "description": "Project ID for this request.",
  133516. // "location": "path",
  133517. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133518. // "required": true,
  133519. // "type": "string"
  133520. // },
  133521. // "region": {
  133522. // "description": "Name of the region scoping this request.",
  133523. // "location": "path",
  133524. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133525. // "required": true,
  133526. // "type": "string"
  133527. // },
  133528. // "requestId": {
  133529. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  133530. // "location": "query",
  133531. // "type": "string"
  133532. // },
  133533. // "targetPool": {
  133534. // "description": "Name of the target pool to add a health check to.",
  133535. // "location": "path",
  133536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  133537. // "required": true,
  133538. // "type": "string"
  133539. // }
  133540. // },
  133541. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  133542. // "request": {
  133543. // "$ref": "TargetPoolsAddHealthCheckRequest"
  133544. // },
  133545. // "response": {
  133546. // "$ref": "Operation"
  133547. // },
  133548. // "scopes": [
  133549. // "https://www.googleapis.com/auth/cloud-platform",
  133550. // "https://www.googleapis.com/auth/compute"
  133551. // ]
  133552. // }
  133553. }
  133554. // method id "compute.targetPools.addInstance":
  133555. type TargetPoolsAddInstanceCall struct {
  133556. s *Service
  133557. project string
  133558. region string
  133559. targetPool string
  133560. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  133561. urlParams_ gensupport.URLParams
  133562. ctx_ context.Context
  133563. header_ http.Header
  133564. }
  133565. // AddInstance: Adds an instance to a target pool.
  133566. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  133567. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  133568. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133569. c.project = project
  133570. c.region = region
  133571. c.targetPool = targetPool
  133572. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  133573. return c
  133574. }
  133575. // RequestId sets the optional parameter "requestId": An optional
  133576. // request ID to identify requests. Specify a unique request ID so that
  133577. // if you must retry your request, the server will know to ignore the
  133578. // request if it has already been completed.
  133579. //
  133580. // For example, consider a situation where you make an initial request
  133581. // and the request times out. If you make the request again with the
  133582. // same request ID, the server can check if original operation with the
  133583. // same request ID was received, and if so, will ignore the second
  133584. // request. This prevents clients from accidentally creating duplicate
  133585. // commitments.
  133586. //
  133587. // The request ID must be a valid UUID with the exception that zero UUID
  133588. // is not supported (00000000-0000-0000-0000-000000000000).
  133589. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  133590. c.urlParams_.Set("requestId", requestId)
  133591. return c
  133592. }
  133593. // Fields allows partial responses to be retrieved. See
  133594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133595. // for more information.
  133596. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  133597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133598. return c
  133599. }
  133600. // Context sets the context to be used in this call's Do method. Any
  133601. // pending HTTP request will be aborted if the provided context is
  133602. // canceled.
  133603. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  133604. c.ctx_ = ctx
  133605. return c
  133606. }
  133607. // Header returns an http.Header that can be modified by the caller to
  133608. // add HTTP headers to the request.
  133609. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  133610. if c.header_ == nil {
  133611. c.header_ = make(http.Header)
  133612. }
  133613. return c.header_
  133614. }
  133615. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  133616. reqHeaders := make(http.Header)
  133617. for k, v := range c.header_ {
  133618. reqHeaders[k] = v
  133619. }
  133620. reqHeaders.Set("User-Agent", c.s.userAgent())
  133621. var body io.Reader = nil
  133622. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  133623. if err != nil {
  133624. return nil, err
  133625. }
  133626. reqHeaders.Set("Content-Type", "application/json")
  133627. c.urlParams_.Set("alt", alt)
  133628. c.urlParams_.Set("prettyPrint", "false")
  133629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  133630. urls += "?" + c.urlParams_.Encode()
  133631. req, err := http.NewRequest("POST", urls, body)
  133632. if err != nil {
  133633. return nil, err
  133634. }
  133635. req.Header = reqHeaders
  133636. googleapi.Expand(req.URL, map[string]string{
  133637. "project": c.project,
  133638. "region": c.region,
  133639. "targetPool": c.targetPool,
  133640. })
  133641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133642. }
  133643. // Do executes the "compute.targetPools.addInstance" call.
  133644. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  133645. // status code is an error. Response headers are in either
  133646. // *Operation.ServerResponse.Header or (if a response was returned at
  133647. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  133648. // to check whether the returned error was because
  133649. // http.StatusNotModified was returned.
  133650. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  133651. gensupport.SetOptions(c.urlParams_, opts...)
  133652. res, err := c.doRequest("json")
  133653. if res != nil && res.StatusCode == http.StatusNotModified {
  133654. if res.Body != nil {
  133655. res.Body.Close()
  133656. }
  133657. return nil, &googleapi.Error{
  133658. Code: res.StatusCode,
  133659. Header: res.Header,
  133660. }
  133661. }
  133662. if err != nil {
  133663. return nil, err
  133664. }
  133665. defer googleapi.CloseBody(res)
  133666. if err := googleapi.CheckResponse(res); err != nil {
  133667. return nil, err
  133668. }
  133669. ret := &Operation{
  133670. ServerResponse: googleapi.ServerResponse{
  133671. Header: res.Header,
  133672. HTTPStatusCode: res.StatusCode,
  133673. },
  133674. }
  133675. target := &ret
  133676. if err := gensupport.DecodeResponse(target, res); err != nil {
  133677. return nil, err
  133678. }
  133679. return ret, nil
  133680. // {
  133681. // "description": "Adds an instance to a target pool.",
  133682. // "httpMethod": "POST",
  133683. // "id": "compute.targetPools.addInstance",
  133684. // "parameterOrder": [
  133685. // "project",
  133686. // "region",
  133687. // "targetPool"
  133688. // ],
  133689. // "parameters": {
  133690. // "project": {
  133691. // "description": "Project ID for this request.",
  133692. // "location": "path",
  133693. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133694. // "required": true,
  133695. // "type": "string"
  133696. // },
  133697. // "region": {
  133698. // "description": "Name of the region scoping this request.",
  133699. // "location": "path",
  133700. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  133701. // "required": true,
  133702. // "type": "string"
  133703. // },
  133704. // "requestId": {
  133705. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  133706. // "location": "query",
  133707. // "type": "string"
  133708. // },
  133709. // "targetPool": {
  133710. // "description": "Name of the TargetPool resource to add instances to.",
  133711. // "location": "path",
  133712. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  133713. // "required": true,
  133714. // "type": "string"
  133715. // }
  133716. // },
  133717. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  133718. // "request": {
  133719. // "$ref": "TargetPoolsAddInstanceRequest"
  133720. // },
  133721. // "response": {
  133722. // "$ref": "Operation"
  133723. // },
  133724. // "scopes": [
  133725. // "https://www.googleapis.com/auth/cloud-platform",
  133726. // "https://www.googleapis.com/auth/compute"
  133727. // ]
  133728. // }
  133729. }
  133730. // method id "compute.targetPools.aggregatedList":
  133731. type TargetPoolsAggregatedListCall struct {
  133732. s *Service
  133733. project string
  133734. urlParams_ gensupport.URLParams
  133735. ifNoneMatch_ string
  133736. ctx_ context.Context
  133737. header_ http.Header
  133738. }
  133739. // AggregatedList: Retrieves an aggregated list of target pools.
  133740. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  133741. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  133742. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133743. c.project = project
  133744. return c
  133745. }
  133746. // Filter sets the optional parameter "filter": A filter expression that
  133747. // filters resources listed in the response. The expression must specify
  133748. // the field name, a comparison operator, and the value that you want to
  133749. // use for filtering. The value must be a string, a number, or a
  133750. // boolean. The comparison operator must be either =, !=, >, or <.
  133751. //
  133752. // For example, if you are filtering Compute Engine instances, you can
  133753. // exclude instances named example-instance by specifying name !=
  133754. // example-instance.
  133755. //
  133756. // You can also filter nested fields. For example, you could specify
  133757. // scheduling.automaticRestart = false to include instances only if they
  133758. // are not scheduled for automatic restarts. You can use filtering on
  133759. // nested fields to filter based on resource labels.
  133760. //
  133761. // To filter on multiple expressions, provide each separate expression
  133762. // within parentheses. For example, (scheduling.automaticRestart = true)
  133763. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  133764. // AND expression. However, you can include AND and OR expressions
  133765. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  133766. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  133767. // true).
  133768. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  133769. c.urlParams_.Set("filter", filter)
  133770. return c
  133771. }
  133772. // MaxResults sets the optional parameter "maxResults": The maximum
  133773. // number of results per page that should be returned. If the number of
  133774. // available results is larger than maxResults, Compute Engine returns a
  133775. // nextPageToken that can be used to get the next page of results in
  133776. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  133777. // (Default: 500)
  133778. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  133779. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  133780. return c
  133781. }
  133782. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  133783. // a certain order. By default, results are returned in alphanumerical
  133784. // order based on the resource name.
  133785. //
  133786. // You can also sort results in descending order based on the creation
  133787. // timestamp using orderBy="creationTimestamp desc". This sorts results
  133788. // based on the creationTimestamp field in reverse chronological order
  133789. // (newest result first). Use this to sort resources like operations so
  133790. // that the newest operation is returned first.
  133791. //
  133792. // Currently, only sorting by name or creationTimestamp desc is
  133793. // supported.
  133794. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  133795. c.urlParams_.Set("orderBy", orderBy)
  133796. return c
  133797. }
  133798. // PageToken sets the optional parameter "pageToken": Specifies a page
  133799. // token to use. Set pageToken to the nextPageToken returned by a
  133800. // previous list request to get the next page of results.
  133801. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  133802. c.urlParams_.Set("pageToken", pageToken)
  133803. return c
  133804. }
  133805. // Fields allows partial responses to be retrieved. See
  133806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  133807. // for more information.
  133808. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  133809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  133810. return c
  133811. }
  133812. // IfNoneMatch sets the optional parameter which makes the operation
  133813. // fail if the object's ETag matches the given value. This is useful for
  133814. // getting updates only after the object has changed since the last
  133815. // request. Use googleapi.IsNotModified to check whether the response
  133816. // error from Do is the result of In-None-Match.
  133817. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  133818. c.ifNoneMatch_ = entityTag
  133819. return c
  133820. }
  133821. // Context sets the context to be used in this call's Do method. Any
  133822. // pending HTTP request will be aborted if the provided context is
  133823. // canceled.
  133824. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  133825. c.ctx_ = ctx
  133826. return c
  133827. }
  133828. // Header returns an http.Header that can be modified by the caller to
  133829. // add HTTP headers to the request.
  133830. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  133831. if c.header_ == nil {
  133832. c.header_ = make(http.Header)
  133833. }
  133834. return c.header_
  133835. }
  133836. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  133837. reqHeaders := make(http.Header)
  133838. for k, v := range c.header_ {
  133839. reqHeaders[k] = v
  133840. }
  133841. reqHeaders.Set("User-Agent", c.s.userAgent())
  133842. if c.ifNoneMatch_ != "" {
  133843. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  133844. }
  133845. var body io.Reader = nil
  133846. c.urlParams_.Set("alt", alt)
  133847. c.urlParams_.Set("prettyPrint", "false")
  133848. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  133849. urls += "?" + c.urlParams_.Encode()
  133850. req, err := http.NewRequest("GET", urls, body)
  133851. if err != nil {
  133852. return nil, err
  133853. }
  133854. req.Header = reqHeaders
  133855. googleapi.Expand(req.URL, map[string]string{
  133856. "project": c.project,
  133857. })
  133858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  133859. }
  133860. // Do executes the "compute.targetPools.aggregatedList" call.
  133861. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  133862. // Any non-2xx status code is an error. Response headers are in either
  133863. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  133864. // returned at all) in error.(*googleapi.Error).Header. Use
  133865. // googleapi.IsNotModified to check whether the returned error was
  133866. // because http.StatusNotModified was returned.
  133867. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  133868. gensupport.SetOptions(c.urlParams_, opts...)
  133869. res, err := c.doRequest("json")
  133870. if res != nil && res.StatusCode == http.StatusNotModified {
  133871. if res.Body != nil {
  133872. res.Body.Close()
  133873. }
  133874. return nil, &googleapi.Error{
  133875. Code: res.StatusCode,
  133876. Header: res.Header,
  133877. }
  133878. }
  133879. if err != nil {
  133880. return nil, err
  133881. }
  133882. defer googleapi.CloseBody(res)
  133883. if err := googleapi.CheckResponse(res); err != nil {
  133884. return nil, err
  133885. }
  133886. ret := &TargetPoolAggregatedList{
  133887. ServerResponse: googleapi.ServerResponse{
  133888. Header: res.Header,
  133889. HTTPStatusCode: res.StatusCode,
  133890. },
  133891. }
  133892. target := &ret
  133893. if err := gensupport.DecodeResponse(target, res); err != nil {
  133894. return nil, err
  133895. }
  133896. return ret, nil
  133897. // {
  133898. // "description": "Retrieves an aggregated list of target pools.",
  133899. // "httpMethod": "GET",
  133900. // "id": "compute.targetPools.aggregatedList",
  133901. // "parameterOrder": [
  133902. // "project"
  133903. // ],
  133904. // "parameters": {
  133905. // "filter": {
  133906. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  133907. // "location": "query",
  133908. // "type": "string"
  133909. // },
  133910. // "maxResults": {
  133911. // "default": "500",
  133912. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  133913. // "format": "uint32",
  133914. // "location": "query",
  133915. // "minimum": "0",
  133916. // "type": "integer"
  133917. // },
  133918. // "orderBy": {
  133919. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  133920. // "location": "query",
  133921. // "type": "string"
  133922. // },
  133923. // "pageToken": {
  133924. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  133925. // "location": "query",
  133926. // "type": "string"
  133927. // },
  133928. // "project": {
  133929. // "description": "Project ID for this request.",
  133930. // "location": "path",
  133931. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  133932. // "required": true,
  133933. // "type": "string"
  133934. // }
  133935. // },
  133936. // "path": "{project}/aggregated/targetPools",
  133937. // "response": {
  133938. // "$ref": "TargetPoolAggregatedList"
  133939. // },
  133940. // "scopes": [
  133941. // "https://www.googleapis.com/auth/cloud-platform",
  133942. // "https://www.googleapis.com/auth/compute",
  133943. // "https://www.googleapis.com/auth/compute.readonly"
  133944. // ]
  133945. // }
  133946. }
  133947. // Pages invokes f for each page of results.
  133948. // A non-nil error returned from f will halt the iteration.
  133949. // The provided context supersedes any context provided to the Context method.
  133950. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  133951. c.ctx_ = ctx
  133952. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  133953. for {
  133954. x, err := c.Do()
  133955. if err != nil {
  133956. return err
  133957. }
  133958. if err := f(x); err != nil {
  133959. return err
  133960. }
  133961. if x.NextPageToken == "" {
  133962. return nil
  133963. }
  133964. c.PageToken(x.NextPageToken)
  133965. }
  133966. }
  133967. // method id "compute.targetPools.delete":
  133968. type TargetPoolsDeleteCall struct {
  133969. s *Service
  133970. project string
  133971. region string
  133972. targetPool string
  133973. urlParams_ gensupport.URLParams
  133974. ctx_ context.Context
  133975. header_ http.Header
  133976. }
  133977. // Delete: Deletes the specified target pool.
  133978. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  133979. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  133980. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  133981. c.project = project
  133982. c.region = region
  133983. c.targetPool = targetPool
  133984. return c
  133985. }
  133986. // RequestId sets the optional parameter "requestId": An optional
  133987. // request ID to identify requests. Specify a unique request ID so that
  133988. // if you must retry your request, the server will know to ignore the
  133989. // request if it has already been completed.
  133990. //
  133991. // For example, consider a situation where you make an initial request
  133992. // and the request times out. If you make the request again with the
  133993. // same request ID, the server can check if original operation with the
  133994. // same request ID was received, and if so, will ignore the second
  133995. // request. This prevents clients from accidentally creating duplicate
  133996. // commitments.
  133997. //
  133998. // The request ID must be a valid UUID with the exception that zero UUID
  133999. // is not supported (00000000-0000-0000-0000-000000000000).
  134000. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  134001. c.urlParams_.Set("requestId", requestId)
  134002. return c
  134003. }
  134004. // Fields allows partial responses to be retrieved. See
  134005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134006. // for more information.
  134007. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  134008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134009. return c
  134010. }
  134011. // Context sets the context to be used in this call's Do method. Any
  134012. // pending HTTP request will be aborted if the provided context is
  134013. // canceled.
  134014. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  134015. c.ctx_ = ctx
  134016. return c
  134017. }
  134018. // Header returns an http.Header that can be modified by the caller to
  134019. // add HTTP headers to the request.
  134020. func (c *TargetPoolsDeleteCall) Header() http.Header {
  134021. if c.header_ == nil {
  134022. c.header_ = make(http.Header)
  134023. }
  134024. return c.header_
  134025. }
  134026. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  134027. reqHeaders := make(http.Header)
  134028. for k, v := range c.header_ {
  134029. reqHeaders[k] = v
  134030. }
  134031. reqHeaders.Set("User-Agent", c.s.userAgent())
  134032. var body io.Reader = nil
  134033. c.urlParams_.Set("alt", alt)
  134034. c.urlParams_.Set("prettyPrint", "false")
  134035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  134036. urls += "?" + c.urlParams_.Encode()
  134037. req, err := http.NewRequest("DELETE", urls, body)
  134038. if err != nil {
  134039. return nil, err
  134040. }
  134041. req.Header = reqHeaders
  134042. googleapi.Expand(req.URL, map[string]string{
  134043. "project": c.project,
  134044. "region": c.region,
  134045. "targetPool": c.targetPool,
  134046. })
  134047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134048. }
  134049. // Do executes the "compute.targetPools.delete" call.
  134050. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134051. // status code is an error. Response headers are in either
  134052. // *Operation.ServerResponse.Header or (if a response was returned at
  134053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134054. // to check whether the returned error was because
  134055. // http.StatusNotModified was returned.
  134056. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134057. gensupport.SetOptions(c.urlParams_, opts...)
  134058. res, err := c.doRequest("json")
  134059. if res != nil && res.StatusCode == http.StatusNotModified {
  134060. if res.Body != nil {
  134061. res.Body.Close()
  134062. }
  134063. return nil, &googleapi.Error{
  134064. Code: res.StatusCode,
  134065. Header: res.Header,
  134066. }
  134067. }
  134068. if err != nil {
  134069. return nil, err
  134070. }
  134071. defer googleapi.CloseBody(res)
  134072. if err := googleapi.CheckResponse(res); err != nil {
  134073. return nil, err
  134074. }
  134075. ret := &Operation{
  134076. ServerResponse: googleapi.ServerResponse{
  134077. Header: res.Header,
  134078. HTTPStatusCode: res.StatusCode,
  134079. },
  134080. }
  134081. target := &ret
  134082. if err := gensupport.DecodeResponse(target, res); err != nil {
  134083. return nil, err
  134084. }
  134085. return ret, nil
  134086. // {
  134087. // "description": "Deletes the specified target pool.",
  134088. // "httpMethod": "DELETE",
  134089. // "id": "compute.targetPools.delete",
  134090. // "parameterOrder": [
  134091. // "project",
  134092. // "region",
  134093. // "targetPool"
  134094. // ],
  134095. // "parameters": {
  134096. // "project": {
  134097. // "description": "Project ID for this request.",
  134098. // "location": "path",
  134099. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134100. // "required": true,
  134101. // "type": "string"
  134102. // },
  134103. // "region": {
  134104. // "description": "Name of the region scoping this request.",
  134105. // "location": "path",
  134106. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134107. // "required": true,
  134108. // "type": "string"
  134109. // },
  134110. // "requestId": {
  134111. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  134112. // "location": "query",
  134113. // "type": "string"
  134114. // },
  134115. // "targetPool": {
  134116. // "description": "Name of the TargetPool resource to delete.",
  134117. // "location": "path",
  134118. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  134119. // "required": true,
  134120. // "type": "string"
  134121. // }
  134122. // },
  134123. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  134124. // "response": {
  134125. // "$ref": "Operation"
  134126. // },
  134127. // "scopes": [
  134128. // "https://www.googleapis.com/auth/cloud-platform",
  134129. // "https://www.googleapis.com/auth/compute"
  134130. // ]
  134131. // }
  134132. }
  134133. // method id "compute.targetPools.get":
  134134. type TargetPoolsGetCall struct {
  134135. s *Service
  134136. project string
  134137. region string
  134138. targetPool string
  134139. urlParams_ gensupport.URLParams
  134140. ifNoneMatch_ string
  134141. ctx_ context.Context
  134142. header_ http.Header
  134143. }
  134144. // Get: Returns the specified target pool. Gets a list of available
  134145. // target pools by making a list() request.
  134146. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  134147. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  134148. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134149. c.project = project
  134150. c.region = region
  134151. c.targetPool = targetPool
  134152. return c
  134153. }
  134154. // Fields allows partial responses to be retrieved. See
  134155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134156. // for more information.
  134157. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  134158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134159. return c
  134160. }
  134161. // IfNoneMatch sets the optional parameter which makes the operation
  134162. // fail if the object's ETag matches the given value. This is useful for
  134163. // getting updates only after the object has changed since the last
  134164. // request. Use googleapi.IsNotModified to check whether the response
  134165. // error from Do is the result of In-None-Match.
  134166. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  134167. c.ifNoneMatch_ = entityTag
  134168. return c
  134169. }
  134170. // Context sets the context to be used in this call's Do method. Any
  134171. // pending HTTP request will be aborted if the provided context is
  134172. // canceled.
  134173. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  134174. c.ctx_ = ctx
  134175. return c
  134176. }
  134177. // Header returns an http.Header that can be modified by the caller to
  134178. // add HTTP headers to the request.
  134179. func (c *TargetPoolsGetCall) Header() http.Header {
  134180. if c.header_ == nil {
  134181. c.header_ = make(http.Header)
  134182. }
  134183. return c.header_
  134184. }
  134185. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  134186. reqHeaders := make(http.Header)
  134187. for k, v := range c.header_ {
  134188. reqHeaders[k] = v
  134189. }
  134190. reqHeaders.Set("User-Agent", c.s.userAgent())
  134191. if c.ifNoneMatch_ != "" {
  134192. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  134193. }
  134194. var body io.Reader = nil
  134195. c.urlParams_.Set("alt", alt)
  134196. c.urlParams_.Set("prettyPrint", "false")
  134197. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  134198. urls += "?" + c.urlParams_.Encode()
  134199. req, err := http.NewRequest("GET", urls, body)
  134200. if err != nil {
  134201. return nil, err
  134202. }
  134203. req.Header = reqHeaders
  134204. googleapi.Expand(req.URL, map[string]string{
  134205. "project": c.project,
  134206. "region": c.region,
  134207. "targetPool": c.targetPool,
  134208. })
  134209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134210. }
  134211. // Do executes the "compute.targetPools.get" call.
  134212. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  134213. // status code is an error. Response headers are in either
  134214. // *TargetPool.ServerResponse.Header or (if a response was returned at
  134215. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134216. // to check whether the returned error was because
  134217. // http.StatusNotModified was returned.
  134218. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  134219. gensupport.SetOptions(c.urlParams_, opts...)
  134220. res, err := c.doRequest("json")
  134221. if res != nil && res.StatusCode == http.StatusNotModified {
  134222. if res.Body != nil {
  134223. res.Body.Close()
  134224. }
  134225. return nil, &googleapi.Error{
  134226. Code: res.StatusCode,
  134227. Header: res.Header,
  134228. }
  134229. }
  134230. if err != nil {
  134231. return nil, err
  134232. }
  134233. defer googleapi.CloseBody(res)
  134234. if err := googleapi.CheckResponse(res); err != nil {
  134235. return nil, err
  134236. }
  134237. ret := &TargetPool{
  134238. ServerResponse: googleapi.ServerResponse{
  134239. Header: res.Header,
  134240. HTTPStatusCode: res.StatusCode,
  134241. },
  134242. }
  134243. target := &ret
  134244. if err := gensupport.DecodeResponse(target, res); err != nil {
  134245. return nil, err
  134246. }
  134247. return ret, nil
  134248. // {
  134249. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  134250. // "httpMethod": "GET",
  134251. // "id": "compute.targetPools.get",
  134252. // "parameterOrder": [
  134253. // "project",
  134254. // "region",
  134255. // "targetPool"
  134256. // ],
  134257. // "parameters": {
  134258. // "project": {
  134259. // "description": "Project ID for this request.",
  134260. // "location": "path",
  134261. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134262. // "required": true,
  134263. // "type": "string"
  134264. // },
  134265. // "region": {
  134266. // "description": "Name of the region scoping this request.",
  134267. // "location": "path",
  134268. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134269. // "required": true,
  134270. // "type": "string"
  134271. // },
  134272. // "targetPool": {
  134273. // "description": "Name of the TargetPool resource to return.",
  134274. // "location": "path",
  134275. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  134276. // "required": true,
  134277. // "type": "string"
  134278. // }
  134279. // },
  134280. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  134281. // "response": {
  134282. // "$ref": "TargetPool"
  134283. // },
  134284. // "scopes": [
  134285. // "https://www.googleapis.com/auth/cloud-platform",
  134286. // "https://www.googleapis.com/auth/compute",
  134287. // "https://www.googleapis.com/auth/compute.readonly"
  134288. // ]
  134289. // }
  134290. }
  134291. // method id "compute.targetPools.getHealth":
  134292. type TargetPoolsGetHealthCall struct {
  134293. s *Service
  134294. project string
  134295. region string
  134296. targetPool string
  134297. instancereference *InstanceReference
  134298. urlParams_ gensupport.URLParams
  134299. ctx_ context.Context
  134300. header_ http.Header
  134301. }
  134302. // GetHealth: Gets the most recent health check results for each IP for
  134303. // the instance that is referenced by the given target pool.
  134304. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  134305. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  134306. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134307. c.project = project
  134308. c.region = region
  134309. c.targetPool = targetPool
  134310. c.instancereference = instancereference
  134311. return c
  134312. }
  134313. // Fields allows partial responses to be retrieved. See
  134314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134315. // for more information.
  134316. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  134317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134318. return c
  134319. }
  134320. // Context sets the context to be used in this call's Do method. Any
  134321. // pending HTTP request will be aborted if the provided context is
  134322. // canceled.
  134323. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  134324. c.ctx_ = ctx
  134325. return c
  134326. }
  134327. // Header returns an http.Header that can be modified by the caller to
  134328. // add HTTP headers to the request.
  134329. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  134330. if c.header_ == nil {
  134331. c.header_ = make(http.Header)
  134332. }
  134333. return c.header_
  134334. }
  134335. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  134336. reqHeaders := make(http.Header)
  134337. for k, v := range c.header_ {
  134338. reqHeaders[k] = v
  134339. }
  134340. reqHeaders.Set("User-Agent", c.s.userAgent())
  134341. var body io.Reader = nil
  134342. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  134343. if err != nil {
  134344. return nil, err
  134345. }
  134346. reqHeaders.Set("Content-Type", "application/json")
  134347. c.urlParams_.Set("alt", alt)
  134348. c.urlParams_.Set("prettyPrint", "false")
  134349. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  134350. urls += "?" + c.urlParams_.Encode()
  134351. req, err := http.NewRequest("POST", urls, body)
  134352. if err != nil {
  134353. return nil, err
  134354. }
  134355. req.Header = reqHeaders
  134356. googleapi.Expand(req.URL, map[string]string{
  134357. "project": c.project,
  134358. "region": c.region,
  134359. "targetPool": c.targetPool,
  134360. })
  134361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134362. }
  134363. // Do executes the "compute.targetPools.getHealth" call.
  134364. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  134365. // Any non-2xx status code is an error. Response headers are in either
  134366. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  134367. // returned at all) in error.(*googleapi.Error).Header. Use
  134368. // googleapi.IsNotModified to check whether the returned error was
  134369. // because http.StatusNotModified was returned.
  134370. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  134371. gensupport.SetOptions(c.urlParams_, opts...)
  134372. res, err := c.doRequest("json")
  134373. if res != nil && res.StatusCode == http.StatusNotModified {
  134374. if res.Body != nil {
  134375. res.Body.Close()
  134376. }
  134377. return nil, &googleapi.Error{
  134378. Code: res.StatusCode,
  134379. Header: res.Header,
  134380. }
  134381. }
  134382. if err != nil {
  134383. return nil, err
  134384. }
  134385. defer googleapi.CloseBody(res)
  134386. if err := googleapi.CheckResponse(res); err != nil {
  134387. return nil, err
  134388. }
  134389. ret := &TargetPoolInstanceHealth{
  134390. ServerResponse: googleapi.ServerResponse{
  134391. Header: res.Header,
  134392. HTTPStatusCode: res.StatusCode,
  134393. },
  134394. }
  134395. target := &ret
  134396. if err := gensupport.DecodeResponse(target, res); err != nil {
  134397. return nil, err
  134398. }
  134399. return ret, nil
  134400. // {
  134401. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  134402. // "httpMethod": "POST",
  134403. // "id": "compute.targetPools.getHealth",
  134404. // "parameterOrder": [
  134405. // "project",
  134406. // "region",
  134407. // "targetPool"
  134408. // ],
  134409. // "parameters": {
  134410. // "project": {
  134411. // "description": "Project ID for this request.",
  134412. // "location": "path",
  134413. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134414. // "required": true,
  134415. // "type": "string"
  134416. // },
  134417. // "region": {
  134418. // "description": "Name of the region scoping this request.",
  134419. // "location": "path",
  134420. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134421. // "required": true,
  134422. // "type": "string"
  134423. // },
  134424. // "targetPool": {
  134425. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  134426. // "location": "path",
  134427. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  134428. // "required": true,
  134429. // "type": "string"
  134430. // }
  134431. // },
  134432. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  134433. // "request": {
  134434. // "$ref": "InstanceReference"
  134435. // },
  134436. // "response": {
  134437. // "$ref": "TargetPoolInstanceHealth"
  134438. // },
  134439. // "scopes": [
  134440. // "https://www.googleapis.com/auth/cloud-platform",
  134441. // "https://www.googleapis.com/auth/compute",
  134442. // "https://www.googleapis.com/auth/compute.readonly"
  134443. // ]
  134444. // }
  134445. }
  134446. // method id "compute.targetPools.insert":
  134447. type TargetPoolsInsertCall struct {
  134448. s *Service
  134449. project string
  134450. region string
  134451. targetpool *TargetPool
  134452. urlParams_ gensupport.URLParams
  134453. ctx_ context.Context
  134454. header_ http.Header
  134455. }
  134456. // Insert: Creates a target pool in the specified project and region
  134457. // using the data included in the request.
  134458. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  134459. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  134460. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134461. c.project = project
  134462. c.region = region
  134463. c.targetpool = targetpool
  134464. return c
  134465. }
  134466. // RequestId sets the optional parameter "requestId": An optional
  134467. // request ID to identify requests. Specify a unique request ID so that
  134468. // if you must retry your request, the server will know to ignore the
  134469. // request if it has already been completed.
  134470. //
  134471. // For example, consider a situation where you make an initial request
  134472. // and the request times out. If you make the request again with the
  134473. // same request ID, the server can check if original operation with the
  134474. // same request ID was received, and if so, will ignore the second
  134475. // request. This prevents clients from accidentally creating duplicate
  134476. // commitments.
  134477. //
  134478. // The request ID must be a valid UUID with the exception that zero UUID
  134479. // is not supported (00000000-0000-0000-0000-000000000000).
  134480. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  134481. c.urlParams_.Set("requestId", requestId)
  134482. return c
  134483. }
  134484. // Fields allows partial responses to be retrieved. See
  134485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134486. // for more information.
  134487. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  134488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134489. return c
  134490. }
  134491. // Context sets the context to be used in this call's Do method. Any
  134492. // pending HTTP request will be aborted if the provided context is
  134493. // canceled.
  134494. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  134495. c.ctx_ = ctx
  134496. return c
  134497. }
  134498. // Header returns an http.Header that can be modified by the caller to
  134499. // add HTTP headers to the request.
  134500. func (c *TargetPoolsInsertCall) Header() http.Header {
  134501. if c.header_ == nil {
  134502. c.header_ = make(http.Header)
  134503. }
  134504. return c.header_
  134505. }
  134506. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  134507. reqHeaders := make(http.Header)
  134508. for k, v := range c.header_ {
  134509. reqHeaders[k] = v
  134510. }
  134511. reqHeaders.Set("User-Agent", c.s.userAgent())
  134512. var body io.Reader = nil
  134513. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  134514. if err != nil {
  134515. return nil, err
  134516. }
  134517. reqHeaders.Set("Content-Type", "application/json")
  134518. c.urlParams_.Set("alt", alt)
  134519. c.urlParams_.Set("prettyPrint", "false")
  134520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  134521. urls += "?" + c.urlParams_.Encode()
  134522. req, err := http.NewRequest("POST", urls, body)
  134523. if err != nil {
  134524. return nil, err
  134525. }
  134526. req.Header = reqHeaders
  134527. googleapi.Expand(req.URL, map[string]string{
  134528. "project": c.project,
  134529. "region": c.region,
  134530. })
  134531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134532. }
  134533. // Do executes the "compute.targetPools.insert" call.
  134534. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134535. // status code is an error. Response headers are in either
  134536. // *Operation.ServerResponse.Header or (if a response was returned at
  134537. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134538. // to check whether the returned error was because
  134539. // http.StatusNotModified was returned.
  134540. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134541. gensupport.SetOptions(c.urlParams_, opts...)
  134542. res, err := c.doRequest("json")
  134543. if res != nil && res.StatusCode == http.StatusNotModified {
  134544. if res.Body != nil {
  134545. res.Body.Close()
  134546. }
  134547. return nil, &googleapi.Error{
  134548. Code: res.StatusCode,
  134549. Header: res.Header,
  134550. }
  134551. }
  134552. if err != nil {
  134553. return nil, err
  134554. }
  134555. defer googleapi.CloseBody(res)
  134556. if err := googleapi.CheckResponse(res); err != nil {
  134557. return nil, err
  134558. }
  134559. ret := &Operation{
  134560. ServerResponse: googleapi.ServerResponse{
  134561. Header: res.Header,
  134562. HTTPStatusCode: res.StatusCode,
  134563. },
  134564. }
  134565. target := &ret
  134566. if err := gensupport.DecodeResponse(target, res); err != nil {
  134567. return nil, err
  134568. }
  134569. return ret, nil
  134570. // {
  134571. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  134572. // "httpMethod": "POST",
  134573. // "id": "compute.targetPools.insert",
  134574. // "parameterOrder": [
  134575. // "project",
  134576. // "region"
  134577. // ],
  134578. // "parameters": {
  134579. // "project": {
  134580. // "description": "Project ID for this request.",
  134581. // "location": "path",
  134582. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134583. // "required": true,
  134584. // "type": "string"
  134585. // },
  134586. // "region": {
  134587. // "description": "Name of the region scoping this request.",
  134588. // "location": "path",
  134589. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134590. // "required": true,
  134591. // "type": "string"
  134592. // },
  134593. // "requestId": {
  134594. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  134595. // "location": "query",
  134596. // "type": "string"
  134597. // }
  134598. // },
  134599. // "path": "{project}/regions/{region}/targetPools",
  134600. // "request": {
  134601. // "$ref": "TargetPool"
  134602. // },
  134603. // "response": {
  134604. // "$ref": "Operation"
  134605. // },
  134606. // "scopes": [
  134607. // "https://www.googleapis.com/auth/cloud-platform",
  134608. // "https://www.googleapis.com/auth/compute"
  134609. // ]
  134610. // }
  134611. }
  134612. // method id "compute.targetPools.list":
  134613. type TargetPoolsListCall struct {
  134614. s *Service
  134615. project string
  134616. region string
  134617. urlParams_ gensupport.URLParams
  134618. ifNoneMatch_ string
  134619. ctx_ context.Context
  134620. header_ http.Header
  134621. }
  134622. // List: Retrieves a list of target pools available to the specified
  134623. // project and region.
  134624. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  134625. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  134626. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134627. c.project = project
  134628. c.region = region
  134629. return c
  134630. }
  134631. // Filter sets the optional parameter "filter": A filter expression that
  134632. // filters resources listed in the response. The expression must specify
  134633. // the field name, a comparison operator, and the value that you want to
  134634. // use for filtering. The value must be a string, a number, or a
  134635. // boolean. The comparison operator must be either =, !=, >, or <.
  134636. //
  134637. // For example, if you are filtering Compute Engine instances, you can
  134638. // exclude instances named example-instance by specifying name !=
  134639. // example-instance.
  134640. //
  134641. // You can also filter nested fields. For example, you could specify
  134642. // scheduling.automaticRestart = false to include instances only if they
  134643. // are not scheduled for automatic restarts. You can use filtering on
  134644. // nested fields to filter based on resource labels.
  134645. //
  134646. // To filter on multiple expressions, provide each separate expression
  134647. // within parentheses. For example, (scheduling.automaticRestart = true)
  134648. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  134649. // AND expression. However, you can include AND and OR expressions
  134650. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  134651. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  134652. // true).
  134653. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  134654. c.urlParams_.Set("filter", filter)
  134655. return c
  134656. }
  134657. // MaxResults sets the optional parameter "maxResults": The maximum
  134658. // number of results per page that should be returned. If the number of
  134659. // available results is larger than maxResults, Compute Engine returns a
  134660. // nextPageToken that can be used to get the next page of results in
  134661. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  134662. // (Default: 500)
  134663. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  134664. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  134665. return c
  134666. }
  134667. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  134668. // a certain order. By default, results are returned in alphanumerical
  134669. // order based on the resource name.
  134670. //
  134671. // You can also sort results in descending order based on the creation
  134672. // timestamp using orderBy="creationTimestamp desc". This sorts results
  134673. // based on the creationTimestamp field in reverse chronological order
  134674. // (newest result first). Use this to sort resources like operations so
  134675. // that the newest operation is returned first.
  134676. //
  134677. // Currently, only sorting by name or creationTimestamp desc is
  134678. // supported.
  134679. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  134680. c.urlParams_.Set("orderBy", orderBy)
  134681. return c
  134682. }
  134683. // PageToken sets the optional parameter "pageToken": Specifies a page
  134684. // token to use. Set pageToken to the nextPageToken returned by a
  134685. // previous list request to get the next page of results.
  134686. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  134687. c.urlParams_.Set("pageToken", pageToken)
  134688. return c
  134689. }
  134690. // Fields allows partial responses to be retrieved. See
  134691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134692. // for more information.
  134693. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  134694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134695. return c
  134696. }
  134697. // IfNoneMatch sets the optional parameter which makes the operation
  134698. // fail if the object's ETag matches the given value. This is useful for
  134699. // getting updates only after the object has changed since the last
  134700. // request. Use googleapi.IsNotModified to check whether the response
  134701. // error from Do is the result of In-None-Match.
  134702. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  134703. c.ifNoneMatch_ = entityTag
  134704. return c
  134705. }
  134706. // Context sets the context to be used in this call's Do method. Any
  134707. // pending HTTP request will be aborted if the provided context is
  134708. // canceled.
  134709. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  134710. c.ctx_ = ctx
  134711. return c
  134712. }
  134713. // Header returns an http.Header that can be modified by the caller to
  134714. // add HTTP headers to the request.
  134715. func (c *TargetPoolsListCall) Header() http.Header {
  134716. if c.header_ == nil {
  134717. c.header_ = make(http.Header)
  134718. }
  134719. return c.header_
  134720. }
  134721. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  134722. reqHeaders := make(http.Header)
  134723. for k, v := range c.header_ {
  134724. reqHeaders[k] = v
  134725. }
  134726. reqHeaders.Set("User-Agent", c.s.userAgent())
  134727. if c.ifNoneMatch_ != "" {
  134728. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  134729. }
  134730. var body io.Reader = nil
  134731. c.urlParams_.Set("alt", alt)
  134732. c.urlParams_.Set("prettyPrint", "false")
  134733. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  134734. urls += "?" + c.urlParams_.Encode()
  134735. req, err := http.NewRequest("GET", urls, body)
  134736. if err != nil {
  134737. return nil, err
  134738. }
  134739. req.Header = reqHeaders
  134740. googleapi.Expand(req.URL, map[string]string{
  134741. "project": c.project,
  134742. "region": c.region,
  134743. })
  134744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134745. }
  134746. // Do executes the "compute.targetPools.list" call.
  134747. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  134748. // status code is an error. Response headers are in either
  134749. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  134750. // at all) in error.(*googleapi.Error).Header. Use
  134751. // googleapi.IsNotModified to check whether the returned error was
  134752. // because http.StatusNotModified was returned.
  134753. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  134754. gensupport.SetOptions(c.urlParams_, opts...)
  134755. res, err := c.doRequest("json")
  134756. if res != nil && res.StatusCode == http.StatusNotModified {
  134757. if res.Body != nil {
  134758. res.Body.Close()
  134759. }
  134760. return nil, &googleapi.Error{
  134761. Code: res.StatusCode,
  134762. Header: res.Header,
  134763. }
  134764. }
  134765. if err != nil {
  134766. return nil, err
  134767. }
  134768. defer googleapi.CloseBody(res)
  134769. if err := googleapi.CheckResponse(res); err != nil {
  134770. return nil, err
  134771. }
  134772. ret := &TargetPoolList{
  134773. ServerResponse: googleapi.ServerResponse{
  134774. Header: res.Header,
  134775. HTTPStatusCode: res.StatusCode,
  134776. },
  134777. }
  134778. target := &ret
  134779. if err := gensupport.DecodeResponse(target, res); err != nil {
  134780. return nil, err
  134781. }
  134782. return ret, nil
  134783. // {
  134784. // "description": "Retrieves a list of target pools available to the specified project and region.",
  134785. // "httpMethod": "GET",
  134786. // "id": "compute.targetPools.list",
  134787. // "parameterOrder": [
  134788. // "project",
  134789. // "region"
  134790. // ],
  134791. // "parameters": {
  134792. // "filter": {
  134793. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  134794. // "location": "query",
  134795. // "type": "string"
  134796. // },
  134797. // "maxResults": {
  134798. // "default": "500",
  134799. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  134800. // "format": "uint32",
  134801. // "location": "query",
  134802. // "minimum": "0",
  134803. // "type": "integer"
  134804. // },
  134805. // "orderBy": {
  134806. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  134807. // "location": "query",
  134808. // "type": "string"
  134809. // },
  134810. // "pageToken": {
  134811. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  134812. // "location": "query",
  134813. // "type": "string"
  134814. // },
  134815. // "project": {
  134816. // "description": "Project ID for this request.",
  134817. // "location": "path",
  134818. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  134819. // "required": true,
  134820. // "type": "string"
  134821. // },
  134822. // "region": {
  134823. // "description": "Name of the region scoping this request.",
  134824. // "location": "path",
  134825. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  134826. // "required": true,
  134827. // "type": "string"
  134828. // }
  134829. // },
  134830. // "path": "{project}/regions/{region}/targetPools",
  134831. // "response": {
  134832. // "$ref": "TargetPoolList"
  134833. // },
  134834. // "scopes": [
  134835. // "https://www.googleapis.com/auth/cloud-platform",
  134836. // "https://www.googleapis.com/auth/compute",
  134837. // "https://www.googleapis.com/auth/compute.readonly"
  134838. // ]
  134839. // }
  134840. }
  134841. // Pages invokes f for each page of results.
  134842. // A non-nil error returned from f will halt the iteration.
  134843. // The provided context supersedes any context provided to the Context method.
  134844. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  134845. c.ctx_ = ctx
  134846. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  134847. for {
  134848. x, err := c.Do()
  134849. if err != nil {
  134850. return err
  134851. }
  134852. if err := f(x); err != nil {
  134853. return err
  134854. }
  134855. if x.NextPageToken == "" {
  134856. return nil
  134857. }
  134858. c.PageToken(x.NextPageToken)
  134859. }
  134860. }
  134861. // method id "compute.targetPools.removeHealthCheck":
  134862. type TargetPoolsRemoveHealthCheckCall struct {
  134863. s *Service
  134864. project string
  134865. region string
  134866. targetPool string
  134867. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  134868. urlParams_ gensupport.URLParams
  134869. ctx_ context.Context
  134870. header_ http.Header
  134871. }
  134872. // RemoveHealthCheck: Removes health check URL from a target pool.
  134873. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  134874. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  134875. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  134876. c.project = project
  134877. c.region = region
  134878. c.targetPool = targetPool
  134879. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  134880. return c
  134881. }
  134882. // RequestId sets the optional parameter "requestId": An optional
  134883. // request ID to identify requests. Specify a unique request ID so that
  134884. // if you must retry your request, the server will know to ignore the
  134885. // request if it has already been completed.
  134886. //
  134887. // For example, consider a situation where you make an initial request
  134888. // and the request times out. If you make the request again with the
  134889. // same request ID, the server can check if original operation with the
  134890. // same request ID was received, and if so, will ignore the second
  134891. // request. This prevents clients from accidentally creating duplicate
  134892. // commitments.
  134893. //
  134894. // The request ID must be a valid UUID with the exception that zero UUID
  134895. // is not supported (00000000-0000-0000-0000-000000000000).
  134896. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  134897. c.urlParams_.Set("requestId", requestId)
  134898. return c
  134899. }
  134900. // Fields allows partial responses to be retrieved. See
  134901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  134902. // for more information.
  134903. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  134904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  134905. return c
  134906. }
  134907. // Context sets the context to be used in this call's Do method. Any
  134908. // pending HTTP request will be aborted if the provided context is
  134909. // canceled.
  134910. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  134911. c.ctx_ = ctx
  134912. return c
  134913. }
  134914. // Header returns an http.Header that can be modified by the caller to
  134915. // add HTTP headers to the request.
  134916. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  134917. if c.header_ == nil {
  134918. c.header_ = make(http.Header)
  134919. }
  134920. return c.header_
  134921. }
  134922. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  134923. reqHeaders := make(http.Header)
  134924. for k, v := range c.header_ {
  134925. reqHeaders[k] = v
  134926. }
  134927. reqHeaders.Set("User-Agent", c.s.userAgent())
  134928. var body io.Reader = nil
  134929. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  134930. if err != nil {
  134931. return nil, err
  134932. }
  134933. reqHeaders.Set("Content-Type", "application/json")
  134934. c.urlParams_.Set("alt", alt)
  134935. c.urlParams_.Set("prettyPrint", "false")
  134936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  134937. urls += "?" + c.urlParams_.Encode()
  134938. req, err := http.NewRequest("POST", urls, body)
  134939. if err != nil {
  134940. return nil, err
  134941. }
  134942. req.Header = reqHeaders
  134943. googleapi.Expand(req.URL, map[string]string{
  134944. "project": c.project,
  134945. "region": c.region,
  134946. "targetPool": c.targetPool,
  134947. })
  134948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  134949. }
  134950. // Do executes the "compute.targetPools.removeHealthCheck" call.
  134951. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  134952. // status code is an error. Response headers are in either
  134953. // *Operation.ServerResponse.Header or (if a response was returned at
  134954. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  134955. // to check whether the returned error was because
  134956. // http.StatusNotModified was returned.
  134957. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  134958. gensupport.SetOptions(c.urlParams_, opts...)
  134959. res, err := c.doRequest("json")
  134960. if res != nil && res.StatusCode == http.StatusNotModified {
  134961. if res.Body != nil {
  134962. res.Body.Close()
  134963. }
  134964. return nil, &googleapi.Error{
  134965. Code: res.StatusCode,
  134966. Header: res.Header,
  134967. }
  134968. }
  134969. if err != nil {
  134970. return nil, err
  134971. }
  134972. defer googleapi.CloseBody(res)
  134973. if err := googleapi.CheckResponse(res); err != nil {
  134974. return nil, err
  134975. }
  134976. ret := &Operation{
  134977. ServerResponse: googleapi.ServerResponse{
  134978. Header: res.Header,
  134979. HTTPStatusCode: res.StatusCode,
  134980. },
  134981. }
  134982. target := &ret
  134983. if err := gensupport.DecodeResponse(target, res); err != nil {
  134984. return nil, err
  134985. }
  134986. return ret, nil
  134987. // {
  134988. // "description": "Removes health check URL from a target pool.",
  134989. // "httpMethod": "POST",
  134990. // "id": "compute.targetPools.removeHealthCheck",
  134991. // "parameterOrder": [
  134992. // "project",
  134993. // "region",
  134994. // "targetPool"
  134995. // ],
  134996. // "parameters": {
  134997. // "project": {
  134998. // "description": "Project ID for this request.",
  134999. // "location": "path",
  135000. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135001. // "required": true,
  135002. // "type": "string"
  135003. // },
  135004. // "region": {
  135005. // "description": "Name of the region for this request.",
  135006. // "location": "path",
  135007. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135008. // "required": true,
  135009. // "type": "string"
  135010. // },
  135011. // "requestId": {
  135012. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135013. // "location": "query",
  135014. // "type": "string"
  135015. // },
  135016. // "targetPool": {
  135017. // "description": "Name of the target pool to remove health checks from.",
  135018. // "location": "path",
  135019. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135020. // "required": true,
  135021. // "type": "string"
  135022. // }
  135023. // },
  135024. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  135025. // "request": {
  135026. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  135027. // },
  135028. // "response": {
  135029. // "$ref": "Operation"
  135030. // },
  135031. // "scopes": [
  135032. // "https://www.googleapis.com/auth/cloud-platform",
  135033. // "https://www.googleapis.com/auth/compute"
  135034. // ]
  135035. // }
  135036. }
  135037. // method id "compute.targetPools.removeInstance":
  135038. type TargetPoolsRemoveInstanceCall struct {
  135039. s *Service
  135040. project string
  135041. region string
  135042. targetPool string
  135043. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  135044. urlParams_ gensupport.URLParams
  135045. ctx_ context.Context
  135046. header_ http.Header
  135047. }
  135048. // RemoveInstance: Removes instance URL from a target pool.
  135049. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  135050. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  135051. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135052. c.project = project
  135053. c.region = region
  135054. c.targetPool = targetPool
  135055. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  135056. return c
  135057. }
  135058. // RequestId sets the optional parameter "requestId": An optional
  135059. // request ID to identify requests. Specify a unique request ID so that
  135060. // if you must retry your request, the server will know to ignore the
  135061. // request if it has already been completed.
  135062. //
  135063. // For example, consider a situation where you make an initial request
  135064. // and the request times out. If you make the request again with the
  135065. // same request ID, the server can check if original operation with the
  135066. // same request ID was received, and if so, will ignore the second
  135067. // request. This prevents clients from accidentally creating duplicate
  135068. // commitments.
  135069. //
  135070. // The request ID must be a valid UUID with the exception that zero UUID
  135071. // is not supported (00000000-0000-0000-0000-000000000000).
  135072. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  135073. c.urlParams_.Set("requestId", requestId)
  135074. return c
  135075. }
  135076. // Fields allows partial responses to be retrieved. See
  135077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135078. // for more information.
  135079. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  135080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135081. return c
  135082. }
  135083. // Context sets the context to be used in this call's Do method. Any
  135084. // pending HTTP request will be aborted if the provided context is
  135085. // canceled.
  135086. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  135087. c.ctx_ = ctx
  135088. return c
  135089. }
  135090. // Header returns an http.Header that can be modified by the caller to
  135091. // add HTTP headers to the request.
  135092. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  135093. if c.header_ == nil {
  135094. c.header_ = make(http.Header)
  135095. }
  135096. return c.header_
  135097. }
  135098. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  135099. reqHeaders := make(http.Header)
  135100. for k, v := range c.header_ {
  135101. reqHeaders[k] = v
  135102. }
  135103. reqHeaders.Set("User-Agent", c.s.userAgent())
  135104. var body io.Reader = nil
  135105. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  135106. if err != nil {
  135107. return nil, err
  135108. }
  135109. reqHeaders.Set("Content-Type", "application/json")
  135110. c.urlParams_.Set("alt", alt)
  135111. c.urlParams_.Set("prettyPrint", "false")
  135112. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  135113. urls += "?" + c.urlParams_.Encode()
  135114. req, err := http.NewRequest("POST", urls, body)
  135115. if err != nil {
  135116. return nil, err
  135117. }
  135118. req.Header = reqHeaders
  135119. googleapi.Expand(req.URL, map[string]string{
  135120. "project": c.project,
  135121. "region": c.region,
  135122. "targetPool": c.targetPool,
  135123. })
  135124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135125. }
  135126. // Do executes the "compute.targetPools.removeInstance" call.
  135127. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135128. // status code is an error. Response headers are in either
  135129. // *Operation.ServerResponse.Header or (if a response was returned at
  135130. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135131. // to check whether the returned error was because
  135132. // http.StatusNotModified was returned.
  135133. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135134. gensupport.SetOptions(c.urlParams_, opts...)
  135135. res, err := c.doRequest("json")
  135136. if res != nil && res.StatusCode == http.StatusNotModified {
  135137. if res.Body != nil {
  135138. res.Body.Close()
  135139. }
  135140. return nil, &googleapi.Error{
  135141. Code: res.StatusCode,
  135142. Header: res.Header,
  135143. }
  135144. }
  135145. if err != nil {
  135146. return nil, err
  135147. }
  135148. defer googleapi.CloseBody(res)
  135149. if err := googleapi.CheckResponse(res); err != nil {
  135150. return nil, err
  135151. }
  135152. ret := &Operation{
  135153. ServerResponse: googleapi.ServerResponse{
  135154. Header: res.Header,
  135155. HTTPStatusCode: res.StatusCode,
  135156. },
  135157. }
  135158. target := &ret
  135159. if err := gensupport.DecodeResponse(target, res); err != nil {
  135160. return nil, err
  135161. }
  135162. return ret, nil
  135163. // {
  135164. // "description": "Removes instance URL from a target pool.",
  135165. // "httpMethod": "POST",
  135166. // "id": "compute.targetPools.removeInstance",
  135167. // "parameterOrder": [
  135168. // "project",
  135169. // "region",
  135170. // "targetPool"
  135171. // ],
  135172. // "parameters": {
  135173. // "project": {
  135174. // "description": "Project ID for this request.",
  135175. // "location": "path",
  135176. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135177. // "required": true,
  135178. // "type": "string"
  135179. // },
  135180. // "region": {
  135181. // "description": "Name of the region scoping this request.",
  135182. // "location": "path",
  135183. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135184. // "required": true,
  135185. // "type": "string"
  135186. // },
  135187. // "requestId": {
  135188. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135189. // "location": "query",
  135190. // "type": "string"
  135191. // },
  135192. // "targetPool": {
  135193. // "description": "Name of the TargetPool resource to remove instances from.",
  135194. // "location": "path",
  135195. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135196. // "required": true,
  135197. // "type": "string"
  135198. // }
  135199. // },
  135200. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  135201. // "request": {
  135202. // "$ref": "TargetPoolsRemoveInstanceRequest"
  135203. // },
  135204. // "response": {
  135205. // "$ref": "Operation"
  135206. // },
  135207. // "scopes": [
  135208. // "https://www.googleapis.com/auth/cloud-platform",
  135209. // "https://www.googleapis.com/auth/compute"
  135210. // ]
  135211. // }
  135212. }
  135213. // method id "compute.targetPools.setBackup":
  135214. type TargetPoolsSetBackupCall struct {
  135215. s *Service
  135216. project string
  135217. region string
  135218. targetPool string
  135219. targetreference *TargetReference
  135220. urlParams_ gensupport.URLParams
  135221. ctx_ context.Context
  135222. header_ http.Header
  135223. }
  135224. // SetBackup: Changes a backup target pool's configurations.
  135225. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  135226. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  135227. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135228. c.project = project
  135229. c.region = region
  135230. c.targetPool = targetPool
  135231. c.targetreference = targetreference
  135232. return c
  135233. }
  135234. // FailoverRatio sets the optional parameter "failoverRatio": New
  135235. // failoverRatio value for the target pool.
  135236. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  135237. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  135238. return c
  135239. }
  135240. // RequestId sets the optional parameter "requestId": An optional
  135241. // request ID to identify requests. Specify a unique request ID so that
  135242. // if you must retry your request, the server will know to ignore the
  135243. // request if it has already been completed.
  135244. //
  135245. // For example, consider a situation where you make an initial request
  135246. // and the request times out. If you make the request again with the
  135247. // same request ID, the server can check if original operation with the
  135248. // same request ID was received, and if so, will ignore the second
  135249. // request. This prevents clients from accidentally creating duplicate
  135250. // commitments.
  135251. //
  135252. // The request ID must be a valid UUID with the exception that zero UUID
  135253. // is not supported (00000000-0000-0000-0000-000000000000).
  135254. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  135255. c.urlParams_.Set("requestId", requestId)
  135256. return c
  135257. }
  135258. // Fields allows partial responses to be retrieved. See
  135259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135260. // for more information.
  135261. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  135262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135263. return c
  135264. }
  135265. // Context sets the context to be used in this call's Do method. Any
  135266. // pending HTTP request will be aborted if the provided context is
  135267. // canceled.
  135268. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  135269. c.ctx_ = ctx
  135270. return c
  135271. }
  135272. // Header returns an http.Header that can be modified by the caller to
  135273. // add HTTP headers to the request.
  135274. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  135275. if c.header_ == nil {
  135276. c.header_ = make(http.Header)
  135277. }
  135278. return c.header_
  135279. }
  135280. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  135281. reqHeaders := make(http.Header)
  135282. for k, v := range c.header_ {
  135283. reqHeaders[k] = v
  135284. }
  135285. reqHeaders.Set("User-Agent", c.s.userAgent())
  135286. var body io.Reader = nil
  135287. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  135288. if err != nil {
  135289. return nil, err
  135290. }
  135291. reqHeaders.Set("Content-Type", "application/json")
  135292. c.urlParams_.Set("alt", alt)
  135293. c.urlParams_.Set("prettyPrint", "false")
  135294. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  135295. urls += "?" + c.urlParams_.Encode()
  135296. req, err := http.NewRequest("POST", urls, body)
  135297. if err != nil {
  135298. return nil, err
  135299. }
  135300. req.Header = reqHeaders
  135301. googleapi.Expand(req.URL, map[string]string{
  135302. "project": c.project,
  135303. "region": c.region,
  135304. "targetPool": c.targetPool,
  135305. })
  135306. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135307. }
  135308. // Do executes the "compute.targetPools.setBackup" call.
  135309. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135310. // status code is an error. Response headers are in either
  135311. // *Operation.ServerResponse.Header or (if a response was returned at
  135312. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135313. // to check whether the returned error was because
  135314. // http.StatusNotModified was returned.
  135315. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135316. gensupport.SetOptions(c.urlParams_, opts...)
  135317. res, err := c.doRequest("json")
  135318. if res != nil && res.StatusCode == http.StatusNotModified {
  135319. if res.Body != nil {
  135320. res.Body.Close()
  135321. }
  135322. return nil, &googleapi.Error{
  135323. Code: res.StatusCode,
  135324. Header: res.Header,
  135325. }
  135326. }
  135327. if err != nil {
  135328. return nil, err
  135329. }
  135330. defer googleapi.CloseBody(res)
  135331. if err := googleapi.CheckResponse(res); err != nil {
  135332. return nil, err
  135333. }
  135334. ret := &Operation{
  135335. ServerResponse: googleapi.ServerResponse{
  135336. Header: res.Header,
  135337. HTTPStatusCode: res.StatusCode,
  135338. },
  135339. }
  135340. target := &ret
  135341. if err := gensupport.DecodeResponse(target, res); err != nil {
  135342. return nil, err
  135343. }
  135344. return ret, nil
  135345. // {
  135346. // "description": "Changes a backup target pool's configurations.",
  135347. // "httpMethod": "POST",
  135348. // "id": "compute.targetPools.setBackup",
  135349. // "parameterOrder": [
  135350. // "project",
  135351. // "region",
  135352. // "targetPool"
  135353. // ],
  135354. // "parameters": {
  135355. // "failoverRatio": {
  135356. // "description": "New failoverRatio value for the target pool.",
  135357. // "format": "float",
  135358. // "location": "query",
  135359. // "type": "number"
  135360. // },
  135361. // "project": {
  135362. // "description": "Project ID for this request.",
  135363. // "location": "path",
  135364. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135365. // "required": true,
  135366. // "type": "string"
  135367. // },
  135368. // "region": {
  135369. // "description": "Name of the region scoping this request.",
  135370. // "location": "path",
  135371. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135372. // "required": true,
  135373. // "type": "string"
  135374. // },
  135375. // "requestId": {
  135376. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135377. // "location": "query",
  135378. // "type": "string"
  135379. // },
  135380. // "targetPool": {
  135381. // "description": "Name of the TargetPool resource to set a backup pool for.",
  135382. // "location": "path",
  135383. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135384. // "required": true,
  135385. // "type": "string"
  135386. // }
  135387. // },
  135388. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  135389. // "request": {
  135390. // "$ref": "TargetReference"
  135391. // },
  135392. // "response": {
  135393. // "$ref": "Operation"
  135394. // },
  135395. // "scopes": [
  135396. // "https://www.googleapis.com/auth/cloud-platform",
  135397. // "https://www.googleapis.com/auth/compute"
  135398. // ]
  135399. // }
  135400. }
  135401. // method id "compute.targetPools.testIamPermissions":
  135402. type TargetPoolsTestIamPermissionsCall struct {
  135403. s *Service
  135404. project string
  135405. region string
  135406. resource string
  135407. testpermissionsrequest *TestPermissionsRequest
  135408. urlParams_ gensupport.URLParams
  135409. ctx_ context.Context
  135410. header_ http.Header
  135411. }
  135412. // TestIamPermissions: Returns permissions that a caller has on the
  135413. // specified resource.
  135414. func (r *TargetPoolsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetPoolsTestIamPermissionsCall {
  135415. c := &TargetPoolsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135416. c.project = project
  135417. c.region = region
  135418. c.resource = resource
  135419. c.testpermissionsrequest = testpermissionsrequest
  135420. return c
  135421. }
  135422. // Fields allows partial responses to be retrieved. See
  135423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135424. // for more information.
  135425. func (c *TargetPoolsTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetPoolsTestIamPermissionsCall {
  135426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135427. return c
  135428. }
  135429. // Context sets the context to be used in this call's Do method. Any
  135430. // pending HTTP request will be aborted if the provided context is
  135431. // canceled.
  135432. func (c *TargetPoolsTestIamPermissionsCall) Context(ctx context.Context) *TargetPoolsTestIamPermissionsCall {
  135433. c.ctx_ = ctx
  135434. return c
  135435. }
  135436. // Header returns an http.Header that can be modified by the caller to
  135437. // add HTTP headers to the request.
  135438. func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header {
  135439. if c.header_ == nil {
  135440. c.header_ = make(http.Header)
  135441. }
  135442. return c.header_
  135443. }
  135444. func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  135445. reqHeaders := make(http.Header)
  135446. for k, v := range c.header_ {
  135447. reqHeaders[k] = v
  135448. }
  135449. reqHeaders.Set("User-Agent", c.s.userAgent())
  135450. var body io.Reader = nil
  135451. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  135452. if err != nil {
  135453. return nil, err
  135454. }
  135455. reqHeaders.Set("Content-Type", "application/json")
  135456. c.urlParams_.Set("alt", alt)
  135457. c.urlParams_.Set("prettyPrint", "false")
  135458. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{resource}/testIamPermissions")
  135459. urls += "?" + c.urlParams_.Encode()
  135460. req, err := http.NewRequest("POST", urls, body)
  135461. if err != nil {
  135462. return nil, err
  135463. }
  135464. req.Header = reqHeaders
  135465. googleapi.Expand(req.URL, map[string]string{
  135466. "project": c.project,
  135467. "region": c.region,
  135468. "resource": c.resource,
  135469. })
  135470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135471. }
  135472. // Do executes the "compute.targetPools.testIamPermissions" call.
  135473. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  135474. // non-2xx status code is an error. Response headers are in either
  135475. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  135476. // returned at all) in error.(*googleapi.Error).Header. Use
  135477. // googleapi.IsNotModified to check whether the returned error was
  135478. // because http.StatusNotModified was returned.
  135479. func (c *TargetPoolsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  135480. gensupport.SetOptions(c.urlParams_, opts...)
  135481. res, err := c.doRequest("json")
  135482. if res != nil && res.StatusCode == http.StatusNotModified {
  135483. if res.Body != nil {
  135484. res.Body.Close()
  135485. }
  135486. return nil, &googleapi.Error{
  135487. Code: res.StatusCode,
  135488. Header: res.Header,
  135489. }
  135490. }
  135491. if err != nil {
  135492. return nil, err
  135493. }
  135494. defer googleapi.CloseBody(res)
  135495. if err := googleapi.CheckResponse(res); err != nil {
  135496. return nil, err
  135497. }
  135498. ret := &TestPermissionsResponse{
  135499. ServerResponse: googleapi.ServerResponse{
  135500. Header: res.Header,
  135501. HTTPStatusCode: res.StatusCode,
  135502. },
  135503. }
  135504. target := &ret
  135505. if err := gensupport.DecodeResponse(target, res); err != nil {
  135506. return nil, err
  135507. }
  135508. return ret, nil
  135509. // {
  135510. // "description": "Returns permissions that a caller has on the specified resource.",
  135511. // "httpMethod": "POST",
  135512. // "id": "compute.targetPools.testIamPermissions",
  135513. // "parameterOrder": [
  135514. // "project",
  135515. // "region",
  135516. // "resource"
  135517. // ],
  135518. // "parameters": {
  135519. // "project": {
  135520. // "description": "Project ID for this request.",
  135521. // "location": "path",
  135522. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135523. // "required": true,
  135524. // "type": "string"
  135525. // },
  135526. // "region": {
  135527. // "description": "The name of the region for this request.",
  135528. // "location": "path",
  135529. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  135530. // "required": true,
  135531. // "type": "string"
  135532. // },
  135533. // "resource": {
  135534. // "description": "Name or id of the resource for this request.",
  135535. // "location": "path",
  135536. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135537. // "required": true,
  135538. // "type": "string"
  135539. // }
  135540. // },
  135541. // "path": "{project}/regions/{region}/targetPools/{resource}/testIamPermissions",
  135542. // "request": {
  135543. // "$ref": "TestPermissionsRequest"
  135544. // },
  135545. // "response": {
  135546. // "$ref": "TestPermissionsResponse"
  135547. // },
  135548. // "scopes": [
  135549. // "https://www.googleapis.com/auth/cloud-platform",
  135550. // "https://www.googleapis.com/auth/compute",
  135551. // "https://www.googleapis.com/auth/compute.readonly"
  135552. // ]
  135553. // }
  135554. }
  135555. // method id "compute.targetSslProxies.delete":
  135556. type TargetSslProxiesDeleteCall struct {
  135557. s *Service
  135558. project string
  135559. targetSslProxy string
  135560. urlParams_ gensupport.URLParams
  135561. ctx_ context.Context
  135562. header_ http.Header
  135563. }
  135564. // Delete: Deletes the specified TargetSslProxy resource.
  135565. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  135566. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135567. c.project = project
  135568. c.targetSslProxy = targetSslProxy
  135569. return c
  135570. }
  135571. // RequestId sets the optional parameter "requestId": An optional
  135572. // request ID to identify requests. Specify a unique request ID so that
  135573. // if you must retry your request, the server will know to ignore the
  135574. // request if it has already been completed.
  135575. //
  135576. // For example, consider a situation where you make an initial request
  135577. // and the request times out. If you make the request again with the
  135578. // same request ID, the server can check if original operation with the
  135579. // same request ID was received, and if so, will ignore the second
  135580. // request. This prevents clients from accidentally creating duplicate
  135581. // commitments.
  135582. //
  135583. // The request ID must be a valid UUID with the exception that zero UUID
  135584. // is not supported (00000000-0000-0000-0000-000000000000).
  135585. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  135586. c.urlParams_.Set("requestId", requestId)
  135587. return c
  135588. }
  135589. // Fields allows partial responses to be retrieved. See
  135590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135591. // for more information.
  135592. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  135593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135594. return c
  135595. }
  135596. // Context sets the context to be used in this call's Do method. Any
  135597. // pending HTTP request will be aborted if the provided context is
  135598. // canceled.
  135599. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  135600. c.ctx_ = ctx
  135601. return c
  135602. }
  135603. // Header returns an http.Header that can be modified by the caller to
  135604. // add HTTP headers to the request.
  135605. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  135606. if c.header_ == nil {
  135607. c.header_ = make(http.Header)
  135608. }
  135609. return c.header_
  135610. }
  135611. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  135612. reqHeaders := make(http.Header)
  135613. for k, v := range c.header_ {
  135614. reqHeaders[k] = v
  135615. }
  135616. reqHeaders.Set("User-Agent", c.s.userAgent())
  135617. var body io.Reader = nil
  135618. c.urlParams_.Set("alt", alt)
  135619. c.urlParams_.Set("prettyPrint", "false")
  135620. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  135621. urls += "?" + c.urlParams_.Encode()
  135622. req, err := http.NewRequest("DELETE", urls, body)
  135623. if err != nil {
  135624. return nil, err
  135625. }
  135626. req.Header = reqHeaders
  135627. googleapi.Expand(req.URL, map[string]string{
  135628. "project": c.project,
  135629. "targetSslProxy": c.targetSslProxy,
  135630. })
  135631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135632. }
  135633. // Do executes the "compute.targetSslProxies.delete" call.
  135634. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135635. // status code is an error. Response headers are in either
  135636. // *Operation.ServerResponse.Header or (if a response was returned at
  135637. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135638. // to check whether the returned error was because
  135639. // http.StatusNotModified was returned.
  135640. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135641. gensupport.SetOptions(c.urlParams_, opts...)
  135642. res, err := c.doRequest("json")
  135643. if res != nil && res.StatusCode == http.StatusNotModified {
  135644. if res.Body != nil {
  135645. res.Body.Close()
  135646. }
  135647. return nil, &googleapi.Error{
  135648. Code: res.StatusCode,
  135649. Header: res.Header,
  135650. }
  135651. }
  135652. if err != nil {
  135653. return nil, err
  135654. }
  135655. defer googleapi.CloseBody(res)
  135656. if err := googleapi.CheckResponse(res); err != nil {
  135657. return nil, err
  135658. }
  135659. ret := &Operation{
  135660. ServerResponse: googleapi.ServerResponse{
  135661. Header: res.Header,
  135662. HTTPStatusCode: res.StatusCode,
  135663. },
  135664. }
  135665. target := &ret
  135666. if err := gensupport.DecodeResponse(target, res); err != nil {
  135667. return nil, err
  135668. }
  135669. return ret, nil
  135670. // {
  135671. // "description": "Deletes the specified TargetSslProxy resource.",
  135672. // "httpMethod": "DELETE",
  135673. // "id": "compute.targetSslProxies.delete",
  135674. // "parameterOrder": [
  135675. // "project",
  135676. // "targetSslProxy"
  135677. // ],
  135678. // "parameters": {
  135679. // "project": {
  135680. // "description": "Project ID for this request.",
  135681. // "location": "path",
  135682. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135683. // "required": true,
  135684. // "type": "string"
  135685. // },
  135686. // "requestId": {
  135687. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135688. // "location": "query",
  135689. // "type": "string"
  135690. // },
  135691. // "targetSslProxy": {
  135692. // "description": "Name of the TargetSslProxy resource to delete.",
  135693. // "location": "path",
  135694. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135695. // "required": true,
  135696. // "type": "string"
  135697. // }
  135698. // },
  135699. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  135700. // "response": {
  135701. // "$ref": "Operation"
  135702. // },
  135703. // "scopes": [
  135704. // "https://www.googleapis.com/auth/cloud-platform",
  135705. // "https://www.googleapis.com/auth/compute"
  135706. // ]
  135707. // }
  135708. }
  135709. // method id "compute.targetSslProxies.get":
  135710. type TargetSslProxiesGetCall struct {
  135711. s *Service
  135712. project string
  135713. targetSslProxy string
  135714. urlParams_ gensupport.URLParams
  135715. ifNoneMatch_ string
  135716. ctx_ context.Context
  135717. header_ http.Header
  135718. }
  135719. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  135720. // available target SSL proxies by making a list() request.
  135721. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  135722. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135723. c.project = project
  135724. c.targetSslProxy = targetSslProxy
  135725. return c
  135726. }
  135727. // Fields allows partial responses to be retrieved. See
  135728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135729. // for more information.
  135730. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  135731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135732. return c
  135733. }
  135734. // IfNoneMatch sets the optional parameter which makes the operation
  135735. // fail if the object's ETag matches the given value. This is useful for
  135736. // getting updates only after the object has changed since the last
  135737. // request. Use googleapi.IsNotModified to check whether the response
  135738. // error from Do is the result of In-None-Match.
  135739. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  135740. c.ifNoneMatch_ = entityTag
  135741. return c
  135742. }
  135743. // Context sets the context to be used in this call's Do method. Any
  135744. // pending HTTP request will be aborted if the provided context is
  135745. // canceled.
  135746. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  135747. c.ctx_ = ctx
  135748. return c
  135749. }
  135750. // Header returns an http.Header that can be modified by the caller to
  135751. // add HTTP headers to the request.
  135752. func (c *TargetSslProxiesGetCall) Header() http.Header {
  135753. if c.header_ == nil {
  135754. c.header_ = make(http.Header)
  135755. }
  135756. return c.header_
  135757. }
  135758. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  135759. reqHeaders := make(http.Header)
  135760. for k, v := range c.header_ {
  135761. reqHeaders[k] = v
  135762. }
  135763. reqHeaders.Set("User-Agent", c.s.userAgent())
  135764. if c.ifNoneMatch_ != "" {
  135765. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  135766. }
  135767. var body io.Reader = nil
  135768. c.urlParams_.Set("alt", alt)
  135769. c.urlParams_.Set("prettyPrint", "false")
  135770. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  135771. urls += "?" + c.urlParams_.Encode()
  135772. req, err := http.NewRequest("GET", urls, body)
  135773. if err != nil {
  135774. return nil, err
  135775. }
  135776. req.Header = reqHeaders
  135777. googleapi.Expand(req.URL, map[string]string{
  135778. "project": c.project,
  135779. "targetSslProxy": c.targetSslProxy,
  135780. })
  135781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135782. }
  135783. // Do executes the "compute.targetSslProxies.get" call.
  135784. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  135785. // status code is an error. Response headers are in either
  135786. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  135787. // at all) in error.(*googleapi.Error).Header. Use
  135788. // googleapi.IsNotModified to check whether the returned error was
  135789. // because http.StatusNotModified was returned.
  135790. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  135791. gensupport.SetOptions(c.urlParams_, opts...)
  135792. res, err := c.doRequest("json")
  135793. if res != nil && res.StatusCode == http.StatusNotModified {
  135794. if res.Body != nil {
  135795. res.Body.Close()
  135796. }
  135797. return nil, &googleapi.Error{
  135798. Code: res.StatusCode,
  135799. Header: res.Header,
  135800. }
  135801. }
  135802. if err != nil {
  135803. return nil, err
  135804. }
  135805. defer googleapi.CloseBody(res)
  135806. if err := googleapi.CheckResponse(res); err != nil {
  135807. return nil, err
  135808. }
  135809. ret := &TargetSslProxy{
  135810. ServerResponse: googleapi.ServerResponse{
  135811. Header: res.Header,
  135812. HTTPStatusCode: res.StatusCode,
  135813. },
  135814. }
  135815. target := &ret
  135816. if err := gensupport.DecodeResponse(target, res); err != nil {
  135817. return nil, err
  135818. }
  135819. return ret, nil
  135820. // {
  135821. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  135822. // "httpMethod": "GET",
  135823. // "id": "compute.targetSslProxies.get",
  135824. // "parameterOrder": [
  135825. // "project",
  135826. // "targetSslProxy"
  135827. // ],
  135828. // "parameters": {
  135829. // "project": {
  135830. // "description": "Project ID for this request.",
  135831. // "location": "path",
  135832. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135833. // "required": true,
  135834. // "type": "string"
  135835. // },
  135836. // "targetSslProxy": {
  135837. // "description": "Name of the TargetSslProxy resource to return.",
  135838. // "location": "path",
  135839. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  135840. // "required": true,
  135841. // "type": "string"
  135842. // }
  135843. // },
  135844. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  135845. // "response": {
  135846. // "$ref": "TargetSslProxy"
  135847. // },
  135848. // "scopes": [
  135849. // "https://www.googleapis.com/auth/cloud-platform",
  135850. // "https://www.googleapis.com/auth/compute",
  135851. // "https://www.googleapis.com/auth/compute.readonly"
  135852. // ]
  135853. // }
  135854. }
  135855. // method id "compute.targetSslProxies.insert":
  135856. type TargetSslProxiesInsertCall struct {
  135857. s *Service
  135858. project string
  135859. targetsslproxy *TargetSslProxy
  135860. urlParams_ gensupport.URLParams
  135861. ctx_ context.Context
  135862. header_ http.Header
  135863. }
  135864. // Insert: Creates a TargetSslProxy resource in the specified project
  135865. // using the data included in the request.
  135866. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  135867. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  135868. c.project = project
  135869. c.targetsslproxy = targetsslproxy
  135870. return c
  135871. }
  135872. // RequestId sets the optional parameter "requestId": An optional
  135873. // request ID to identify requests. Specify a unique request ID so that
  135874. // if you must retry your request, the server will know to ignore the
  135875. // request if it has already been completed.
  135876. //
  135877. // For example, consider a situation where you make an initial request
  135878. // and the request times out. If you make the request again with the
  135879. // same request ID, the server can check if original operation with the
  135880. // same request ID was received, and if so, will ignore the second
  135881. // request. This prevents clients from accidentally creating duplicate
  135882. // commitments.
  135883. //
  135884. // The request ID must be a valid UUID with the exception that zero UUID
  135885. // is not supported (00000000-0000-0000-0000-000000000000).
  135886. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  135887. c.urlParams_.Set("requestId", requestId)
  135888. return c
  135889. }
  135890. // Fields allows partial responses to be retrieved. See
  135891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  135892. // for more information.
  135893. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  135894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  135895. return c
  135896. }
  135897. // Context sets the context to be used in this call's Do method. Any
  135898. // pending HTTP request will be aborted if the provided context is
  135899. // canceled.
  135900. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  135901. c.ctx_ = ctx
  135902. return c
  135903. }
  135904. // Header returns an http.Header that can be modified by the caller to
  135905. // add HTTP headers to the request.
  135906. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  135907. if c.header_ == nil {
  135908. c.header_ = make(http.Header)
  135909. }
  135910. return c.header_
  135911. }
  135912. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  135913. reqHeaders := make(http.Header)
  135914. for k, v := range c.header_ {
  135915. reqHeaders[k] = v
  135916. }
  135917. reqHeaders.Set("User-Agent", c.s.userAgent())
  135918. var body io.Reader = nil
  135919. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  135920. if err != nil {
  135921. return nil, err
  135922. }
  135923. reqHeaders.Set("Content-Type", "application/json")
  135924. c.urlParams_.Set("alt", alt)
  135925. c.urlParams_.Set("prettyPrint", "false")
  135926. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  135927. urls += "?" + c.urlParams_.Encode()
  135928. req, err := http.NewRequest("POST", urls, body)
  135929. if err != nil {
  135930. return nil, err
  135931. }
  135932. req.Header = reqHeaders
  135933. googleapi.Expand(req.URL, map[string]string{
  135934. "project": c.project,
  135935. })
  135936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  135937. }
  135938. // Do executes the "compute.targetSslProxies.insert" call.
  135939. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  135940. // status code is an error. Response headers are in either
  135941. // *Operation.ServerResponse.Header or (if a response was returned at
  135942. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  135943. // to check whether the returned error was because
  135944. // http.StatusNotModified was returned.
  135945. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  135946. gensupport.SetOptions(c.urlParams_, opts...)
  135947. res, err := c.doRequest("json")
  135948. if res != nil && res.StatusCode == http.StatusNotModified {
  135949. if res.Body != nil {
  135950. res.Body.Close()
  135951. }
  135952. return nil, &googleapi.Error{
  135953. Code: res.StatusCode,
  135954. Header: res.Header,
  135955. }
  135956. }
  135957. if err != nil {
  135958. return nil, err
  135959. }
  135960. defer googleapi.CloseBody(res)
  135961. if err := googleapi.CheckResponse(res); err != nil {
  135962. return nil, err
  135963. }
  135964. ret := &Operation{
  135965. ServerResponse: googleapi.ServerResponse{
  135966. Header: res.Header,
  135967. HTTPStatusCode: res.StatusCode,
  135968. },
  135969. }
  135970. target := &ret
  135971. if err := gensupport.DecodeResponse(target, res); err != nil {
  135972. return nil, err
  135973. }
  135974. return ret, nil
  135975. // {
  135976. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  135977. // "httpMethod": "POST",
  135978. // "id": "compute.targetSslProxies.insert",
  135979. // "parameterOrder": [
  135980. // "project"
  135981. // ],
  135982. // "parameters": {
  135983. // "project": {
  135984. // "description": "Project ID for this request.",
  135985. // "location": "path",
  135986. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  135987. // "required": true,
  135988. // "type": "string"
  135989. // },
  135990. // "requestId": {
  135991. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  135992. // "location": "query",
  135993. // "type": "string"
  135994. // }
  135995. // },
  135996. // "path": "{project}/global/targetSslProxies",
  135997. // "request": {
  135998. // "$ref": "TargetSslProxy"
  135999. // },
  136000. // "response": {
  136001. // "$ref": "Operation"
  136002. // },
  136003. // "scopes": [
  136004. // "https://www.googleapis.com/auth/cloud-platform",
  136005. // "https://www.googleapis.com/auth/compute"
  136006. // ]
  136007. // }
  136008. }
  136009. // method id "compute.targetSslProxies.list":
  136010. type TargetSslProxiesListCall struct {
  136011. s *Service
  136012. project string
  136013. urlParams_ gensupport.URLParams
  136014. ifNoneMatch_ string
  136015. ctx_ context.Context
  136016. header_ http.Header
  136017. }
  136018. // List: Retrieves the list of TargetSslProxy resources available to the
  136019. // specified project.
  136020. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  136021. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136022. c.project = project
  136023. return c
  136024. }
  136025. // Filter sets the optional parameter "filter": A filter expression that
  136026. // filters resources listed in the response. The expression must specify
  136027. // the field name, a comparison operator, and the value that you want to
  136028. // use for filtering. The value must be a string, a number, or a
  136029. // boolean. The comparison operator must be either =, !=, >, or <.
  136030. //
  136031. // For example, if you are filtering Compute Engine instances, you can
  136032. // exclude instances named example-instance by specifying name !=
  136033. // example-instance.
  136034. //
  136035. // You can also filter nested fields. For example, you could specify
  136036. // scheduling.automaticRestart = false to include instances only if they
  136037. // are not scheduled for automatic restarts. You can use filtering on
  136038. // nested fields to filter based on resource labels.
  136039. //
  136040. // To filter on multiple expressions, provide each separate expression
  136041. // within parentheses. For example, (scheduling.automaticRestart = true)
  136042. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  136043. // AND expression. However, you can include AND and OR expressions
  136044. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  136045. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  136046. // true).
  136047. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  136048. c.urlParams_.Set("filter", filter)
  136049. return c
  136050. }
  136051. // MaxResults sets the optional parameter "maxResults": The maximum
  136052. // number of results per page that should be returned. If the number of
  136053. // available results is larger than maxResults, Compute Engine returns a
  136054. // nextPageToken that can be used to get the next page of results in
  136055. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  136056. // (Default: 500)
  136057. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  136058. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  136059. return c
  136060. }
  136061. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  136062. // a certain order. By default, results are returned in alphanumerical
  136063. // order based on the resource name.
  136064. //
  136065. // You can also sort results in descending order based on the creation
  136066. // timestamp using orderBy="creationTimestamp desc". This sorts results
  136067. // based on the creationTimestamp field in reverse chronological order
  136068. // (newest result first). Use this to sort resources like operations so
  136069. // that the newest operation is returned first.
  136070. //
  136071. // Currently, only sorting by name or creationTimestamp desc is
  136072. // supported.
  136073. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  136074. c.urlParams_.Set("orderBy", orderBy)
  136075. return c
  136076. }
  136077. // PageToken sets the optional parameter "pageToken": Specifies a page
  136078. // token to use. Set pageToken to the nextPageToken returned by a
  136079. // previous list request to get the next page of results.
  136080. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  136081. c.urlParams_.Set("pageToken", pageToken)
  136082. return c
  136083. }
  136084. // Fields allows partial responses to be retrieved. See
  136085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136086. // for more information.
  136087. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  136088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136089. return c
  136090. }
  136091. // IfNoneMatch sets the optional parameter which makes the operation
  136092. // fail if the object's ETag matches the given value. This is useful for
  136093. // getting updates only after the object has changed since the last
  136094. // request. Use googleapi.IsNotModified to check whether the response
  136095. // error from Do is the result of In-None-Match.
  136096. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  136097. c.ifNoneMatch_ = entityTag
  136098. return c
  136099. }
  136100. // Context sets the context to be used in this call's Do method. Any
  136101. // pending HTTP request will be aborted if the provided context is
  136102. // canceled.
  136103. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  136104. c.ctx_ = ctx
  136105. return c
  136106. }
  136107. // Header returns an http.Header that can be modified by the caller to
  136108. // add HTTP headers to the request.
  136109. func (c *TargetSslProxiesListCall) Header() http.Header {
  136110. if c.header_ == nil {
  136111. c.header_ = make(http.Header)
  136112. }
  136113. return c.header_
  136114. }
  136115. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  136116. reqHeaders := make(http.Header)
  136117. for k, v := range c.header_ {
  136118. reqHeaders[k] = v
  136119. }
  136120. reqHeaders.Set("User-Agent", c.s.userAgent())
  136121. if c.ifNoneMatch_ != "" {
  136122. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  136123. }
  136124. var body io.Reader = nil
  136125. c.urlParams_.Set("alt", alt)
  136126. c.urlParams_.Set("prettyPrint", "false")
  136127. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  136128. urls += "?" + c.urlParams_.Encode()
  136129. req, err := http.NewRequest("GET", urls, body)
  136130. if err != nil {
  136131. return nil, err
  136132. }
  136133. req.Header = reqHeaders
  136134. googleapi.Expand(req.URL, map[string]string{
  136135. "project": c.project,
  136136. })
  136137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136138. }
  136139. // Do executes the "compute.targetSslProxies.list" call.
  136140. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  136141. // non-2xx status code is an error. Response headers are in either
  136142. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  136143. // returned at all) in error.(*googleapi.Error).Header. Use
  136144. // googleapi.IsNotModified to check whether the returned error was
  136145. // because http.StatusNotModified was returned.
  136146. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  136147. gensupport.SetOptions(c.urlParams_, opts...)
  136148. res, err := c.doRequest("json")
  136149. if res != nil && res.StatusCode == http.StatusNotModified {
  136150. if res.Body != nil {
  136151. res.Body.Close()
  136152. }
  136153. return nil, &googleapi.Error{
  136154. Code: res.StatusCode,
  136155. Header: res.Header,
  136156. }
  136157. }
  136158. if err != nil {
  136159. return nil, err
  136160. }
  136161. defer googleapi.CloseBody(res)
  136162. if err := googleapi.CheckResponse(res); err != nil {
  136163. return nil, err
  136164. }
  136165. ret := &TargetSslProxyList{
  136166. ServerResponse: googleapi.ServerResponse{
  136167. Header: res.Header,
  136168. HTTPStatusCode: res.StatusCode,
  136169. },
  136170. }
  136171. target := &ret
  136172. if err := gensupport.DecodeResponse(target, res); err != nil {
  136173. return nil, err
  136174. }
  136175. return ret, nil
  136176. // {
  136177. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  136178. // "httpMethod": "GET",
  136179. // "id": "compute.targetSslProxies.list",
  136180. // "parameterOrder": [
  136181. // "project"
  136182. // ],
  136183. // "parameters": {
  136184. // "filter": {
  136185. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  136186. // "location": "query",
  136187. // "type": "string"
  136188. // },
  136189. // "maxResults": {
  136190. // "default": "500",
  136191. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  136192. // "format": "uint32",
  136193. // "location": "query",
  136194. // "minimum": "0",
  136195. // "type": "integer"
  136196. // },
  136197. // "orderBy": {
  136198. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  136199. // "location": "query",
  136200. // "type": "string"
  136201. // },
  136202. // "pageToken": {
  136203. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  136204. // "location": "query",
  136205. // "type": "string"
  136206. // },
  136207. // "project": {
  136208. // "description": "Project ID for this request.",
  136209. // "location": "path",
  136210. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136211. // "required": true,
  136212. // "type": "string"
  136213. // }
  136214. // },
  136215. // "path": "{project}/global/targetSslProxies",
  136216. // "response": {
  136217. // "$ref": "TargetSslProxyList"
  136218. // },
  136219. // "scopes": [
  136220. // "https://www.googleapis.com/auth/cloud-platform",
  136221. // "https://www.googleapis.com/auth/compute",
  136222. // "https://www.googleapis.com/auth/compute.readonly"
  136223. // ]
  136224. // }
  136225. }
  136226. // Pages invokes f for each page of results.
  136227. // A non-nil error returned from f will halt the iteration.
  136228. // The provided context supersedes any context provided to the Context method.
  136229. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  136230. c.ctx_ = ctx
  136231. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  136232. for {
  136233. x, err := c.Do()
  136234. if err != nil {
  136235. return err
  136236. }
  136237. if err := f(x); err != nil {
  136238. return err
  136239. }
  136240. if x.NextPageToken == "" {
  136241. return nil
  136242. }
  136243. c.PageToken(x.NextPageToken)
  136244. }
  136245. }
  136246. // method id "compute.targetSslProxies.setBackendService":
  136247. type TargetSslProxiesSetBackendServiceCall struct {
  136248. s *Service
  136249. project string
  136250. targetSslProxy string
  136251. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  136252. urlParams_ gensupport.URLParams
  136253. ctx_ context.Context
  136254. header_ http.Header
  136255. }
  136256. // SetBackendService: Changes the BackendService for TargetSslProxy.
  136257. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  136258. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136259. c.project = project
  136260. c.targetSslProxy = targetSslProxy
  136261. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  136262. return c
  136263. }
  136264. // RequestId sets the optional parameter "requestId": An optional
  136265. // request ID to identify requests. Specify a unique request ID so that
  136266. // if you must retry your request, the server will know to ignore the
  136267. // request if it has already been completed.
  136268. //
  136269. // For example, consider a situation where you make an initial request
  136270. // and the request times out. If you make the request again with the
  136271. // same request ID, the server can check if original operation with the
  136272. // same request ID was received, and if so, will ignore the second
  136273. // request. This prevents clients from accidentally creating duplicate
  136274. // commitments.
  136275. //
  136276. // The request ID must be a valid UUID with the exception that zero UUID
  136277. // is not supported (00000000-0000-0000-0000-000000000000).
  136278. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  136279. c.urlParams_.Set("requestId", requestId)
  136280. return c
  136281. }
  136282. // Fields allows partial responses to be retrieved. See
  136283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136284. // for more information.
  136285. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  136286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136287. return c
  136288. }
  136289. // Context sets the context to be used in this call's Do method. Any
  136290. // pending HTTP request will be aborted if the provided context is
  136291. // canceled.
  136292. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  136293. c.ctx_ = ctx
  136294. return c
  136295. }
  136296. // Header returns an http.Header that can be modified by the caller to
  136297. // add HTTP headers to the request.
  136298. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  136299. if c.header_ == nil {
  136300. c.header_ = make(http.Header)
  136301. }
  136302. return c.header_
  136303. }
  136304. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  136305. reqHeaders := make(http.Header)
  136306. for k, v := range c.header_ {
  136307. reqHeaders[k] = v
  136308. }
  136309. reqHeaders.Set("User-Agent", c.s.userAgent())
  136310. var body io.Reader = nil
  136311. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  136312. if err != nil {
  136313. return nil, err
  136314. }
  136315. reqHeaders.Set("Content-Type", "application/json")
  136316. c.urlParams_.Set("alt", alt)
  136317. c.urlParams_.Set("prettyPrint", "false")
  136318. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  136319. urls += "?" + c.urlParams_.Encode()
  136320. req, err := http.NewRequest("POST", urls, body)
  136321. if err != nil {
  136322. return nil, err
  136323. }
  136324. req.Header = reqHeaders
  136325. googleapi.Expand(req.URL, map[string]string{
  136326. "project": c.project,
  136327. "targetSslProxy": c.targetSslProxy,
  136328. })
  136329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136330. }
  136331. // Do executes the "compute.targetSslProxies.setBackendService" call.
  136332. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  136333. // status code is an error. Response headers are in either
  136334. // *Operation.ServerResponse.Header or (if a response was returned at
  136335. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  136336. // to check whether the returned error was because
  136337. // http.StatusNotModified was returned.
  136338. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  136339. gensupport.SetOptions(c.urlParams_, opts...)
  136340. res, err := c.doRequest("json")
  136341. if res != nil && res.StatusCode == http.StatusNotModified {
  136342. if res.Body != nil {
  136343. res.Body.Close()
  136344. }
  136345. return nil, &googleapi.Error{
  136346. Code: res.StatusCode,
  136347. Header: res.Header,
  136348. }
  136349. }
  136350. if err != nil {
  136351. return nil, err
  136352. }
  136353. defer googleapi.CloseBody(res)
  136354. if err := googleapi.CheckResponse(res); err != nil {
  136355. return nil, err
  136356. }
  136357. ret := &Operation{
  136358. ServerResponse: googleapi.ServerResponse{
  136359. Header: res.Header,
  136360. HTTPStatusCode: res.StatusCode,
  136361. },
  136362. }
  136363. target := &ret
  136364. if err := gensupport.DecodeResponse(target, res); err != nil {
  136365. return nil, err
  136366. }
  136367. return ret, nil
  136368. // {
  136369. // "description": "Changes the BackendService for TargetSslProxy.",
  136370. // "httpMethod": "POST",
  136371. // "id": "compute.targetSslProxies.setBackendService",
  136372. // "parameterOrder": [
  136373. // "project",
  136374. // "targetSslProxy"
  136375. // ],
  136376. // "parameters": {
  136377. // "project": {
  136378. // "description": "Project ID for this request.",
  136379. // "location": "path",
  136380. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136381. // "required": true,
  136382. // "type": "string"
  136383. // },
  136384. // "requestId": {
  136385. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  136386. // "location": "query",
  136387. // "type": "string"
  136388. // },
  136389. // "targetSslProxy": {
  136390. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  136391. // "location": "path",
  136392. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  136393. // "required": true,
  136394. // "type": "string"
  136395. // }
  136396. // },
  136397. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  136398. // "request": {
  136399. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  136400. // },
  136401. // "response": {
  136402. // "$ref": "Operation"
  136403. // },
  136404. // "scopes": [
  136405. // "https://www.googleapis.com/auth/cloud-platform",
  136406. // "https://www.googleapis.com/auth/compute"
  136407. // ]
  136408. // }
  136409. }
  136410. // method id "compute.targetSslProxies.setProxyHeader":
  136411. type TargetSslProxiesSetProxyHeaderCall struct {
  136412. s *Service
  136413. project string
  136414. targetSslProxy string
  136415. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  136416. urlParams_ gensupport.URLParams
  136417. ctx_ context.Context
  136418. header_ http.Header
  136419. }
  136420. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  136421. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  136422. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136423. c.project = project
  136424. c.targetSslProxy = targetSslProxy
  136425. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  136426. return c
  136427. }
  136428. // RequestId sets the optional parameter "requestId": An optional
  136429. // request ID to identify requests. Specify a unique request ID so that
  136430. // if you must retry your request, the server will know to ignore the
  136431. // request if it has already been completed.
  136432. //
  136433. // For example, consider a situation where you make an initial request
  136434. // and the request times out. If you make the request again with the
  136435. // same request ID, the server can check if original operation with the
  136436. // same request ID was received, and if so, will ignore the second
  136437. // request. This prevents clients from accidentally creating duplicate
  136438. // commitments.
  136439. //
  136440. // The request ID must be a valid UUID with the exception that zero UUID
  136441. // is not supported (00000000-0000-0000-0000-000000000000).
  136442. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  136443. c.urlParams_.Set("requestId", requestId)
  136444. return c
  136445. }
  136446. // Fields allows partial responses to be retrieved. See
  136447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136448. // for more information.
  136449. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  136450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136451. return c
  136452. }
  136453. // Context sets the context to be used in this call's Do method. Any
  136454. // pending HTTP request will be aborted if the provided context is
  136455. // canceled.
  136456. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  136457. c.ctx_ = ctx
  136458. return c
  136459. }
  136460. // Header returns an http.Header that can be modified by the caller to
  136461. // add HTTP headers to the request.
  136462. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  136463. if c.header_ == nil {
  136464. c.header_ = make(http.Header)
  136465. }
  136466. return c.header_
  136467. }
  136468. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  136469. reqHeaders := make(http.Header)
  136470. for k, v := range c.header_ {
  136471. reqHeaders[k] = v
  136472. }
  136473. reqHeaders.Set("User-Agent", c.s.userAgent())
  136474. var body io.Reader = nil
  136475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  136476. if err != nil {
  136477. return nil, err
  136478. }
  136479. reqHeaders.Set("Content-Type", "application/json")
  136480. c.urlParams_.Set("alt", alt)
  136481. c.urlParams_.Set("prettyPrint", "false")
  136482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  136483. urls += "?" + c.urlParams_.Encode()
  136484. req, err := http.NewRequest("POST", urls, body)
  136485. if err != nil {
  136486. return nil, err
  136487. }
  136488. req.Header = reqHeaders
  136489. googleapi.Expand(req.URL, map[string]string{
  136490. "project": c.project,
  136491. "targetSslProxy": c.targetSslProxy,
  136492. })
  136493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136494. }
  136495. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  136496. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  136497. // status code is an error. Response headers are in either
  136498. // *Operation.ServerResponse.Header or (if a response was returned at
  136499. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  136500. // to check whether the returned error was because
  136501. // http.StatusNotModified was returned.
  136502. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  136503. gensupport.SetOptions(c.urlParams_, opts...)
  136504. res, err := c.doRequest("json")
  136505. if res != nil && res.StatusCode == http.StatusNotModified {
  136506. if res.Body != nil {
  136507. res.Body.Close()
  136508. }
  136509. return nil, &googleapi.Error{
  136510. Code: res.StatusCode,
  136511. Header: res.Header,
  136512. }
  136513. }
  136514. if err != nil {
  136515. return nil, err
  136516. }
  136517. defer googleapi.CloseBody(res)
  136518. if err := googleapi.CheckResponse(res); err != nil {
  136519. return nil, err
  136520. }
  136521. ret := &Operation{
  136522. ServerResponse: googleapi.ServerResponse{
  136523. Header: res.Header,
  136524. HTTPStatusCode: res.StatusCode,
  136525. },
  136526. }
  136527. target := &ret
  136528. if err := gensupport.DecodeResponse(target, res); err != nil {
  136529. return nil, err
  136530. }
  136531. return ret, nil
  136532. // {
  136533. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  136534. // "httpMethod": "POST",
  136535. // "id": "compute.targetSslProxies.setProxyHeader",
  136536. // "parameterOrder": [
  136537. // "project",
  136538. // "targetSslProxy"
  136539. // ],
  136540. // "parameters": {
  136541. // "project": {
  136542. // "description": "Project ID for this request.",
  136543. // "location": "path",
  136544. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136545. // "required": true,
  136546. // "type": "string"
  136547. // },
  136548. // "requestId": {
  136549. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  136550. // "location": "query",
  136551. // "type": "string"
  136552. // },
  136553. // "targetSslProxy": {
  136554. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  136555. // "location": "path",
  136556. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  136557. // "required": true,
  136558. // "type": "string"
  136559. // }
  136560. // },
  136561. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  136562. // "request": {
  136563. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  136564. // },
  136565. // "response": {
  136566. // "$ref": "Operation"
  136567. // },
  136568. // "scopes": [
  136569. // "https://www.googleapis.com/auth/cloud-platform",
  136570. // "https://www.googleapis.com/auth/compute"
  136571. // ]
  136572. // }
  136573. }
  136574. // method id "compute.targetSslProxies.setSslCertificates":
  136575. type TargetSslProxiesSetSslCertificatesCall struct {
  136576. s *Service
  136577. project string
  136578. targetSslProxy string
  136579. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  136580. urlParams_ gensupport.URLParams
  136581. ctx_ context.Context
  136582. header_ http.Header
  136583. }
  136584. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  136585. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  136586. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136587. c.project = project
  136588. c.targetSslProxy = targetSslProxy
  136589. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  136590. return c
  136591. }
  136592. // RequestId sets the optional parameter "requestId": An optional
  136593. // request ID to identify requests. Specify a unique request ID so that
  136594. // if you must retry your request, the server will know to ignore the
  136595. // request if it has already been completed.
  136596. //
  136597. // For example, consider a situation where you make an initial request
  136598. // and the request times out. If you make the request again with the
  136599. // same request ID, the server can check if original operation with the
  136600. // same request ID was received, and if so, will ignore the second
  136601. // request. This prevents clients from accidentally creating duplicate
  136602. // commitments.
  136603. //
  136604. // The request ID must be a valid UUID with the exception that zero UUID
  136605. // is not supported (00000000-0000-0000-0000-000000000000).
  136606. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  136607. c.urlParams_.Set("requestId", requestId)
  136608. return c
  136609. }
  136610. // Fields allows partial responses to be retrieved. See
  136611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136612. // for more information.
  136613. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  136614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136615. return c
  136616. }
  136617. // Context sets the context to be used in this call's Do method. Any
  136618. // pending HTTP request will be aborted if the provided context is
  136619. // canceled.
  136620. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  136621. c.ctx_ = ctx
  136622. return c
  136623. }
  136624. // Header returns an http.Header that can be modified by the caller to
  136625. // add HTTP headers to the request.
  136626. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  136627. if c.header_ == nil {
  136628. c.header_ = make(http.Header)
  136629. }
  136630. return c.header_
  136631. }
  136632. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  136633. reqHeaders := make(http.Header)
  136634. for k, v := range c.header_ {
  136635. reqHeaders[k] = v
  136636. }
  136637. reqHeaders.Set("User-Agent", c.s.userAgent())
  136638. var body io.Reader = nil
  136639. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  136640. if err != nil {
  136641. return nil, err
  136642. }
  136643. reqHeaders.Set("Content-Type", "application/json")
  136644. c.urlParams_.Set("alt", alt)
  136645. c.urlParams_.Set("prettyPrint", "false")
  136646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  136647. urls += "?" + c.urlParams_.Encode()
  136648. req, err := http.NewRequest("POST", urls, body)
  136649. if err != nil {
  136650. return nil, err
  136651. }
  136652. req.Header = reqHeaders
  136653. googleapi.Expand(req.URL, map[string]string{
  136654. "project": c.project,
  136655. "targetSslProxy": c.targetSslProxy,
  136656. })
  136657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136658. }
  136659. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  136660. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  136661. // status code is an error. Response headers are in either
  136662. // *Operation.ServerResponse.Header or (if a response was returned at
  136663. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  136664. // to check whether the returned error was because
  136665. // http.StatusNotModified was returned.
  136666. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  136667. gensupport.SetOptions(c.urlParams_, opts...)
  136668. res, err := c.doRequest("json")
  136669. if res != nil && res.StatusCode == http.StatusNotModified {
  136670. if res.Body != nil {
  136671. res.Body.Close()
  136672. }
  136673. return nil, &googleapi.Error{
  136674. Code: res.StatusCode,
  136675. Header: res.Header,
  136676. }
  136677. }
  136678. if err != nil {
  136679. return nil, err
  136680. }
  136681. defer googleapi.CloseBody(res)
  136682. if err := googleapi.CheckResponse(res); err != nil {
  136683. return nil, err
  136684. }
  136685. ret := &Operation{
  136686. ServerResponse: googleapi.ServerResponse{
  136687. Header: res.Header,
  136688. HTTPStatusCode: res.StatusCode,
  136689. },
  136690. }
  136691. target := &ret
  136692. if err := gensupport.DecodeResponse(target, res); err != nil {
  136693. return nil, err
  136694. }
  136695. return ret, nil
  136696. // {
  136697. // "description": "Changes SslCertificates for TargetSslProxy.",
  136698. // "httpMethod": "POST",
  136699. // "id": "compute.targetSslProxies.setSslCertificates",
  136700. // "parameterOrder": [
  136701. // "project",
  136702. // "targetSslProxy"
  136703. // ],
  136704. // "parameters": {
  136705. // "project": {
  136706. // "description": "Project ID for this request.",
  136707. // "location": "path",
  136708. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136709. // "required": true,
  136710. // "type": "string"
  136711. // },
  136712. // "requestId": {
  136713. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  136714. // "location": "query",
  136715. // "type": "string"
  136716. // },
  136717. // "targetSslProxy": {
  136718. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  136719. // "location": "path",
  136720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  136721. // "required": true,
  136722. // "type": "string"
  136723. // }
  136724. // },
  136725. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  136726. // "request": {
  136727. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  136728. // },
  136729. // "response": {
  136730. // "$ref": "Operation"
  136731. // },
  136732. // "scopes": [
  136733. // "https://www.googleapis.com/auth/cloud-platform",
  136734. // "https://www.googleapis.com/auth/compute"
  136735. // ]
  136736. // }
  136737. }
  136738. // method id "compute.targetSslProxies.setSslPolicy":
  136739. type TargetSslProxiesSetSslPolicyCall struct {
  136740. s *Service
  136741. project string
  136742. targetSslProxy string
  136743. sslpolicyreference *SslPolicyReference
  136744. urlParams_ gensupport.URLParams
  136745. ctx_ context.Context
  136746. header_ http.Header
  136747. }
  136748. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  136749. // specifies the server-side support for SSL features. This affects
  136750. // connections between clients and the SSL proxy load balancer. They do
  136751. // not affect the connection between the load balancer and the backends.
  136752. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  136753. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136754. c.project = project
  136755. c.targetSslProxy = targetSslProxy
  136756. c.sslpolicyreference = sslpolicyreference
  136757. return c
  136758. }
  136759. // RequestId sets the optional parameter "requestId": An optional
  136760. // request ID to identify requests. Specify a unique request ID so that
  136761. // if you must retry your request, the server will know to ignore the
  136762. // request if it has already been completed.
  136763. //
  136764. // For example, consider a situation where you make an initial request
  136765. // and the request times out. If you make the request again with the
  136766. // same request ID, the server can check if original operation with the
  136767. // same request ID was received, and if so, will ignore the second
  136768. // request. This prevents clients from accidentally creating duplicate
  136769. // commitments.
  136770. //
  136771. // The request ID must be a valid UUID with the exception that zero UUID
  136772. // is not supported (00000000-0000-0000-0000-000000000000).
  136773. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  136774. c.urlParams_.Set("requestId", requestId)
  136775. return c
  136776. }
  136777. // Fields allows partial responses to be retrieved. See
  136778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136779. // for more information.
  136780. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  136781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136782. return c
  136783. }
  136784. // Context sets the context to be used in this call's Do method. Any
  136785. // pending HTTP request will be aborted if the provided context is
  136786. // canceled.
  136787. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  136788. c.ctx_ = ctx
  136789. return c
  136790. }
  136791. // Header returns an http.Header that can be modified by the caller to
  136792. // add HTTP headers to the request.
  136793. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  136794. if c.header_ == nil {
  136795. c.header_ = make(http.Header)
  136796. }
  136797. return c.header_
  136798. }
  136799. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  136800. reqHeaders := make(http.Header)
  136801. for k, v := range c.header_ {
  136802. reqHeaders[k] = v
  136803. }
  136804. reqHeaders.Set("User-Agent", c.s.userAgent())
  136805. var body io.Reader = nil
  136806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  136807. if err != nil {
  136808. return nil, err
  136809. }
  136810. reqHeaders.Set("Content-Type", "application/json")
  136811. c.urlParams_.Set("alt", alt)
  136812. c.urlParams_.Set("prettyPrint", "false")
  136813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  136814. urls += "?" + c.urlParams_.Encode()
  136815. req, err := http.NewRequest("POST", urls, body)
  136816. if err != nil {
  136817. return nil, err
  136818. }
  136819. req.Header = reqHeaders
  136820. googleapi.Expand(req.URL, map[string]string{
  136821. "project": c.project,
  136822. "targetSslProxy": c.targetSslProxy,
  136823. })
  136824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136825. }
  136826. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  136827. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  136828. // status code is an error. Response headers are in either
  136829. // *Operation.ServerResponse.Header or (if a response was returned at
  136830. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  136831. // to check whether the returned error was because
  136832. // http.StatusNotModified was returned.
  136833. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  136834. gensupport.SetOptions(c.urlParams_, opts...)
  136835. res, err := c.doRequest("json")
  136836. if res != nil && res.StatusCode == http.StatusNotModified {
  136837. if res.Body != nil {
  136838. res.Body.Close()
  136839. }
  136840. return nil, &googleapi.Error{
  136841. Code: res.StatusCode,
  136842. Header: res.Header,
  136843. }
  136844. }
  136845. if err != nil {
  136846. return nil, err
  136847. }
  136848. defer googleapi.CloseBody(res)
  136849. if err := googleapi.CheckResponse(res); err != nil {
  136850. return nil, err
  136851. }
  136852. ret := &Operation{
  136853. ServerResponse: googleapi.ServerResponse{
  136854. Header: res.Header,
  136855. HTTPStatusCode: res.StatusCode,
  136856. },
  136857. }
  136858. target := &ret
  136859. if err := gensupport.DecodeResponse(target, res); err != nil {
  136860. return nil, err
  136861. }
  136862. return ret, nil
  136863. // {
  136864. // "description": "Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.",
  136865. // "httpMethod": "POST",
  136866. // "id": "compute.targetSslProxies.setSslPolicy",
  136867. // "parameterOrder": [
  136868. // "project",
  136869. // "targetSslProxy"
  136870. // ],
  136871. // "parameters": {
  136872. // "project": {
  136873. // "description": "Project ID for this request.",
  136874. // "location": "path",
  136875. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  136876. // "required": true,
  136877. // "type": "string"
  136878. // },
  136879. // "requestId": {
  136880. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  136881. // "location": "query",
  136882. // "type": "string"
  136883. // },
  136884. // "targetSslProxy": {
  136885. // "description": "Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035.",
  136886. // "location": "path",
  136887. // "required": true,
  136888. // "type": "string"
  136889. // }
  136890. // },
  136891. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  136892. // "request": {
  136893. // "$ref": "SslPolicyReference"
  136894. // },
  136895. // "response": {
  136896. // "$ref": "Operation"
  136897. // },
  136898. // "scopes": [
  136899. // "https://www.googleapis.com/auth/cloud-platform",
  136900. // "https://www.googleapis.com/auth/compute"
  136901. // ]
  136902. // }
  136903. }
  136904. // method id "compute.targetSslProxies.testIamPermissions":
  136905. type TargetSslProxiesTestIamPermissionsCall struct {
  136906. s *Service
  136907. project string
  136908. resource string
  136909. testpermissionsrequest *TestPermissionsRequest
  136910. urlParams_ gensupport.URLParams
  136911. ctx_ context.Context
  136912. header_ http.Header
  136913. }
  136914. // TestIamPermissions: Returns permissions that a caller has on the
  136915. // specified resource.
  136916. func (r *TargetSslProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetSslProxiesTestIamPermissionsCall {
  136917. c := &TargetSslProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  136918. c.project = project
  136919. c.resource = resource
  136920. c.testpermissionsrequest = testpermissionsrequest
  136921. return c
  136922. }
  136923. // Fields allows partial responses to be retrieved. See
  136924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  136925. // for more information.
  136926. func (c *TargetSslProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetSslProxiesTestIamPermissionsCall {
  136927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  136928. return c
  136929. }
  136930. // Context sets the context to be used in this call's Do method. Any
  136931. // pending HTTP request will be aborted if the provided context is
  136932. // canceled.
  136933. func (c *TargetSslProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetSslProxiesTestIamPermissionsCall {
  136934. c.ctx_ = ctx
  136935. return c
  136936. }
  136937. // Header returns an http.Header that can be modified by the caller to
  136938. // add HTTP headers to the request.
  136939. func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header {
  136940. if c.header_ == nil {
  136941. c.header_ = make(http.Header)
  136942. }
  136943. return c.header_
  136944. }
  136945. func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  136946. reqHeaders := make(http.Header)
  136947. for k, v := range c.header_ {
  136948. reqHeaders[k] = v
  136949. }
  136950. reqHeaders.Set("User-Agent", c.s.userAgent())
  136951. var body io.Reader = nil
  136952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  136953. if err != nil {
  136954. return nil, err
  136955. }
  136956. reqHeaders.Set("Content-Type", "application/json")
  136957. c.urlParams_.Set("alt", alt)
  136958. c.urlParams_.Set("prettyPrint", "false")
  136959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{resource}/testIamPermissions")
  136960. urls += "?" + c.urlParams_.Encode()
  136961. req, err := http.NewRequest("POST", urls, body)
  136962. if err != nil {
  136963. return nil, err
  136964. }
  136965. req.Header = reqHeaders
  136966. googleapi.Expand(req.URL, map[string]string{
  136967. "project": c.project,
  136968. "resource": c.resource,
  136969. })
  136970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  136971. }
  136972. // Do executes the "compute.targetSslProxies.testIamPermissions" call.
  136973. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  136974. // non-2xx status code is an error. Response headers are in either
  136975. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  136976. // returned at all) in error.(*googleapi.Error).Header. Use
  136977. // googleapi.IsNotModified to check whether the returned error was
  136978. // because http.StatusNotModified was returned.
  136979. func (c *TargetSslProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  136980. gensupport.SetOptions(c.urlParams_, opts...)
  136981. res, err := c.doRequest("json")
  136982. if res != nil && res.StatusCode == http.StatusNotModified {
  136983. if res.Body != nil {
  136984. res.Body.Close()
  136985. }
  136986. return nil, &googleapi.Error{
  136987. Code: res.StatusCode,
  136988. Header: res.Header,
  136989. }
  136990. }
  136991. if err != nil {
  136992. return nil, err
  136993. }
  136994. defer googleapi.CloseBody(res)
  136995. if err := googleapi.CheckResponse(res); err != nil {
  136996. return nil, err
  136997. }
  136998. ret := &TestPermissionsResponse{
  136999. ServerResponse: googleapi.ServerResponse{
  137000. Header: res.Header,
  137001. HTTPStatusCode: res.StatusCode,
  137002. },
  137003. }
  137004. target := &ret
  137005. if err := gensupport.DecodeResponse(target, res); err != nil {
  137006. return nil, err
  137007. }
  137008. return ret, nil
  137009. // {
  137010. // "description": "Returns permissions that a caller has on the specified resource.",
  137011. // "httpMethod": "POST",
  137012. // "id": "compute.targetSslProxies.testIamPermissions",
  137013. // "parameterOrder": [
  137014. // "project",
  137015. // "resource"
  137016. // ],
  137017. // "parameters": {
  137018. // "project": {
  137019. // "description": "Project ID for this request.",
  137020. // "location": "path",
  137021. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137022. // "required": true,
  137023. // "type": "string"
  137024. // },
  137025. // "resource": {
  137026. // "description": "Name or id of the resource for this request.",
  137027. // "location": "path",
  137028. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  137029. // "required": true,
  137030. // "type": "string"
  137031. // }
  137032. // },
  137033. // "path": "{project}/global/targetSslProxies/{resource}/testIamPermissions",
  137034. // "request": {
  137035. // "$ref": "TestPermissionsRequest"
  137036. // },
  137037. // "response": {
  137038. // "$ref": "TestPermissionsResponse"
  137039. // },
  137040. // "scopes": [
  137041. // "https://www.googleapis.com/auth/cloud-platform",
  137042. // "https://www.googleapis.com/auth/compute",
  137043. // "https://www.googleapis.com/auth/compute.readonly"
  137044. // ]
  137045. // }
  137046. }
  137047. // method id "compute.targetTcpProxies.delete":
  137048. type TargetTcpProxiesDeleteCall struct {
  137049. s *Service
  137050. project string
  137051. targetTcpProxy string
  137052. urlParams_ gensupport.URLParams
  137053. ctx_ context.Context
  137054. header_ http.Header
  137055. }
  137056. // Delete: Deletes the specified TargetTcpProxy resource.
  137057. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  137058. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137059. c.project = project
  137060. c.targetTcpProxy = targetTcpProxy
  137061. return c
  137062. }
  137063. // RequestId sets the optional parameter "requestId": An optional
  137064. // request ID to identify requests. Specify a unique request ID so that
  137065. // if you must retry your request, the server will know to ignore the
  137066. // request if it has already been completed.
  137067. //
  137068. // For example, consider a situation where you make an initial request
  137069. // and the request times out. If you make the request again with the
  137070. // same request ID, the server can check if original operation with the
  137071. // same request ID was received, and if so, will ignore the second
  137072. // request. This prevents clients from accidentally creating duplicate
  137073. // commitments.
  137074. //
  137075. // The request ID must be a valid UUID with the exception that zero UUID
  137076. // is not supported (00000000-0000-0000-0000-000000000000).
  137077. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  137078. c.urlParams_.Set("requestId", requestId)
  137079. return c
  137080. }
  137081. // Fields allows partial responses to be retrieved. See
  137082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137083. // for more information.
  137084. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  137085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137086. return c
  137087. }
  137088. // Context sets the context to be used in this call's Do method. Any
  137089. // pending HTTP request will be aborted if the provided context is
  137090. // canceled.
  137091. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  137092. c.ctx_ = ctx
  137093. return c
  137094. }
  137095. // Header returns an http.Header that can be modified by the caller to
  137096. // add HTTP headers to the request.
  137097. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  137098. if c.header_ == nil {
  137099. c.header_ = make(http.Header)
  137100. }
  137101. return c.header_
  137102. }
  137103. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  137104. reqHeaders := make(http.Header)
  137105. for k, v := range c.header_ {
  137106. reqHeaders[k] = v
  137107. }
  137108. reqHeaders.Set("User-Agent", c.s.userAgent())
  137109. var body io.Reader = nil
  137110. c.urlParams_.Set("alt", alt)
  137111. c.urlParams_.Set("prettyPrint", "false")
  137112. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  137113. urls += "?" + c.urlParams_.Encode()
  137114. req, err := http.NewRequest("DELETE", urls, body)
  137115. if err != nil {
  137116. return nil, err
  137117. }
  137118. req.Header = reqHeaders
  137119. googleapi.Expand(req.URL, map[string]string{
  137120. "project": c.project,
  137121. "targetTcpProxy": c.targetTcpProxy,
  137122. })
  137123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137124. }
  137125. // Do executes the "compute.targetTcpProxies.delete" call.
  137126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  137127. // status code is an error. Response headers are in either
  137128. // *Operation.ServerResponse.Header or (if a response was returned at
  137129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  137130. // to check whether the returned error was because
  137131. // http.StatusNotModified was returned.
  137132. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  137133. gensupport.SetOptions(c.urlParams_, opts...)
  137134. res, err := c.doRequest("json")
  137135. if res != nil && res.StatusCode == http.StatusNotModified {
  137136. if res.Body != nil {
  137137. res.Body.Close()
  137138. }
  137139. return nil, &googleapi.Error{
  137140. Code: res.StatusCode,
  137141. Header: res.Header,
  137142. }
  137143. }
  137144. if err != nil {
  137145. return nil, err
  137146. }
  137147. defer googleapi.CloseBody(res)
  137148. if err := googleapi.CheckResponse(res); err != nil {
  137149. return nil, err
  137150. }
  137151. ret := &Operation{
  137152. ServerResponse: googleapi.ServerResponse{
  137153. Header: res.Header,
  137154. HTTPStatusCode: res.StatusCode,
  137155. },
  137156. }
  137157. target := &ret
  137158. if err := gensupport.DecodeResponse(target, res); err != nil {
  137159. return nil, err
  137160. }
  137161. return ret, nil
  137162. // {
  137163. // "description": "Deletes the specified TargetTcpProxy resource.",
  137164. // "httpMethod": "DELETE",
  137165. // "id": "compute.targetTcpProxies.delete",
  137166. // "parameterOrder": [
  137167. // "project",
  137168. // "targetTcpProxy"
  137169. // ],
  137170. // "parameters": {
  137171. // "project": {
  137172. // "description": "Project ID for this request.",
  137173. // "location": "path",
  137174. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137175. // "required": true,
  137176. // "type": "string"
  137177. // },
  137178. // "requestId": {
  137179. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  137180. // "location": "query",
  137181. // "type": "string"
  137182. // },
  137183. // "targetTcpProxy": {
  137184. // "description": "Name of the TargetTcpProxy resource to delete.",
  137185. // "location": "path",
  137186. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  137187. // "required": true,
  137188. // "type": "string"
  137189. // }
  137190. // },
  137191. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  137192. // "response": {
  137193. // "$ref": "Operation"
  137194. // },
  137195. // "scopes": [
  137196. // "https://www.googleapis.com/auth/cloud-platform",
  137197. // "https://www.googleapis.com/auth/compute"
  137198. // ]
  137199. // }
  137200. }
  137201. // method id "compute.targetTcpProxies.get":
  137202. type TargetTcpProxiesGetCall struct {
  137203. s *Service
  137204. project string
  137205. targetTcpProxy string
  137206. urlParams_ gensupport.URLParams
  137207. ifNoneMatch_ string
  137208. ctx_ context.Context
  137209. header_ http.Header
  137210. }
  137211. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  137212. // available target TCP proxies by making a list() request.
  137213. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  137214. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137215. c.project = project
  137216. c.targetTcpProxy = targetTcpProxy
  137217. return c
  137218. }
  137219. // Fields allows partial responses to be retrieved. See
  137220. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137221. // for more information.
  137222. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  137223. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137224. return c
  137225. }
  137226. // IfNoneMatch sets the optional parameter which makes the operation
  137227. // fail if the object's ETag matches the given value. This is useful for
  137228. // getting updates only after the object has changed since the last
  137229. // request. Use googleapi.IsNotModified to check whether the response
  137230. // error from Do is the result of In-None-Match.
  137231. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  137232. c.ifNoneMatch_ = entityTag
  137233. return c
  137234. }
  137235. // Context sets the context to be used in this call's Do method. Any
  137236. // pending HTTP request will be aborted if the provided context is
  137237. // canceled.
  137238. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  137239. c.ctx_ = ctx
  137240. return c
  137241. }
  137242. // Header returns an http.Header that can be modified by the caller to
  137243. // add HTTP headers to the request.
  137244. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  137245. if c.header_ == nil {
  137246. c.header_ = make(http.Header)
  137247. }
  137248. return c.header_
  137249. }
  137250. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  137251. reqHeaders := make(http.Header)
  137252. for k, v := range c.header_ {
  137253. reqHeaders[k] = v
  137254. }
  137255. reqHeaders.Set("User-Agent", c.s.userAgent())
  137256. if c.ifNoneMatch_ != "" {
  137257. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  137258. }
  137259. var body io.Reader = nil
  137260. c.urlParams_.Set("alt", alt)
  137261. c.urlParams_.Set("prettyPrint", "false")
  137262. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  137263. urls += "?" + c.urlParams_.Encode()
  137264. req, err := http.NewRequest("GET", urls, body)
  137265. if err != nil {
  137266. return nil, err
  137267. }
  137268. req.Header = reqHeaders
  137269. googleapi.Expand(req.URL, map[string]string{
  137270. "project": c.project,
  137271. "targetTcpProxy": c.targetTcpProxy,
  137272. })
  137273. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137274. }
  137275. // Do executes the "compute.targetTcpProxies.get" call.
  137276. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  137277. // status code is an error. Response headers are in either
  137278. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  137279. // at all) in error.(*googleapi.Error).Header. Use
  137280. // googleapi.IsNotModified to check whether the returned error was
  137281. // because http.StatusNotModified was returned.
  137282. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  137283. gensupport.SetOptions(c.urlParams_, opts...)
  137284. res, err := c.doRequest("json")
  137285. if res != nil && res.StatusCode == http.StatusNotModified {
  137286. if res.Body != nil {
  137287. res.Body.Close()
  137288. }
  137289. return nil, &googleapi.Error{
  137290. Code: res.StatusCode,
  137291. Header: res.Header,
  137292. }
  137293. }
  137294. if err != nil {
  137295. return nil, err
  137296. }
  137297. defer googleapi.CloseBody(res)
  137298. if err := googleapi.CheckResponse(res); err != nil {
  137299. return nil, err
  137300. }
  137301. ret := &TargetTcpProxy{
  137302. ServerResponse: googleapi.ServerResponse{
  137303. Header: res.Header,
  137304. HTTPStatusCode: res.StatusCode,
  137305. },
  137306. }
  137307. target := &ret
  137308. if err := gensupport.DecodeResponse(target, res); err != nil {
  137309. return nil, err
  137310. }
  137311. return ret, nil
  137312. // {
  137313. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  137314. // "httpMethod": "GET",
  137315. // "id": "compute.targetTcpProxies.get",
  137316. // "parameterOrder": [
  137317. // "project",
  137318. // "targetTcpProxy"
  137319. // ],
  137320. // "parameters": {
  137321. // "project": {
  137322. // "description": "Project ID for this request.",
  137323. // "location": "path",
  137324. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137325. // "required": true,
  137326. // "type": "string"
  137327. // },
  137328. // "targetTcpProxy": {
  137329. // "description": "Name of the TargetTcpProxy resource to return.",
  137330. // "location": "path",
  137331. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  137332. // "required": true,
  137333. // "type": "string"
  137334. // }
  137335. // },
  137336. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  137337. // "response": {
  137338. // "$ref": "TargetTcpProxy"
  137339. // },
  137340. // "scopes": [
  137341. // "https://www.googleapis.com/auth/cloud-platform",
  137342. // "https://www.googleapis.com/auth/compute",
  137343. // "https://www.googleapis.com/auth/compute.readonly"
  137344. // ]
  137345. // }
  137346. }
  137347. // method id "compute.targetTcpProxies.insert":
  137348. type TargetTcpProxiesInsertCall struct {
  137349. s *Service
  137350. project string
  137351. targettcpproxy *TargetTcpProxy
  137352. urlParams_ gensupport.URLParams
  137353. ctx_ context.Context
  137354. header_ http.Header
  137355. }
  137356. // Insert: Creates a TargetTcpProxy resource in the specified project
  137357. // using the data included in the request.
  137358. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  137359. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137360. c.project = project
  137361. c.targettcpproxy = targettcpproxy
  137362. return c
  137363. }
  137364. // RequestId sets the optional parameter "requestId": An optional
  137365. // request ID to identify requests. Specify a unique request ID so that
  137366. // if you must retry your request, the server will know to ignore the
  137367. // request if it has already been completed.
  137368. //
  137369. // For example, consider a situation where you make an initial request
  137370. // and the request times out. If you make the request again with the
  137371. // same request ID, the server can check if original operation with the
  137372. // same request ID was received, and if so, will ignore the second
  137373. // request. This prevents clients from accidentally creating duplicate
  137374. // commitments.
  137375. //
  137376. // The request ID must be a valid UUID with the exception that zero UUID
  137377. // is not supported (00000000-0000-0000-0000-000000000000).
  137378. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  137379. c.urlParams_.Set("requestId", requestId)
  137380. return c
  137381. }
  137382. // Fields allows partial responses to be retrieved. See
  137383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137384. // for more information.
  137385. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  137386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137387. return c
  137388. }
  137389. // Context sets the context to be used in this call's Do method. Any
  137390. // pending HTTP request will be aborted if the provided context is
  137391. // canceled.
  137392. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  137393. c.ctx_ = ctx
  137394. return c
  137395. }
  137396. // Header returns an http.Header that can be modified by the caller to
  137397. // add HTTP headers to the request.
  137398. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  137399. if c.header_ == nil {
  137400. c.header_ = make(http.Header)
  137401. }
  137402. return c.header_
  137403. }
  137404. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  137405. reqHeaders := make(http.Header)
  137406. for k, v := range c.header_ {
  137407. reqHeaders[k] = v
  137408. }
  137409. reqHeaders.Set("User-Agent", c.s.userAgent())
  137410. var body io.Reader = nil
  137411. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  137412. if err != nil {
  137413. return nil, err
  137414. }
  137415. reqHeaders.Set("Content-Type", "application/json")
  137416. c.urlParams_.Set("alt", alt)
  137417. c.urlParams_.Set("prettyPrint", "false")
  137418. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  137419. urls += "?" + c.urlParams_.Encode()
  137420. req, err := http.NewRequest("POST", urls, body)
  137421. if err != nil {
  137422. return nil, err
  137423. }
  137424. req.Header = reqHeaders
  137425. googleapi.Expand(req.URL, map[string]string{
  137426. "project": c.project,
  137427. })
  137428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137429. }
  137430. // Do executes the "compute.targetTcpProxies.insert" call.
  137431. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  137432. // status code is an error. Response headers are in either
  137433. // *Operation.ServerResponse.Header or (if a response was returned at
  137434. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  137435. // to check whether the returned error was because
  137436. // http.StatusNotModified was returned.
  137437. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  137438. gensupport.SetOptions(c.urlParams_, opts...)
  137439. res, err := c.doRequest("json")
  137440. if res != nil && res.StatusCode == http.StatusNotModified {
  137441. if res.Body != nil {
  137442. res.Body.Close()
  137443. }
  137444. return nil, &googleapi.Error{
  137445. Code: res.StatusCode,
  137446. Header: res.Header,
  137447. }
  137448. }
  137449. if err != nil {
  137450. return nil, err
  137451. }
  137452. defer googleapi.CloseBody(res)
  137453. if err := googleapi.CheckResponse(res); err != nil {
  137454. return nil, err
  137455. }
  137456. ret := &Operation{
  137457. ServerResponse: googleapi.ServerResponse{
  137458. Header: res.Header,
  137459. HTTPStatusCode: res.StatusCode,
  137460. },
  137461. }
  137462. target := &ret
  137463. if err := gensupport.DecodeResponse(target, res); err != nil {
  137464. return nil, err
  137465. }
  137466. return ret, nil
  137467. // {
  137468. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  137469. // "httpMethod": "POST",
  137470. // "id": "compute.targetTcpProxies.insert",
  137471. // "parameterOrder": [
  137472. // "project"
  137473. // ],
  137474. // "parameters": {
  137475. // "project": {
  137476. // "description": "Project ID for this request.",
  137477. // "location": "path",
  137478. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137479. // "required": true,
  137480. // "type": "string"
  137481. // },
  137482. // "requestId": {
  137483. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  137484. // "location": "query",
  137485. // "type": "string"
  137486. // }
  137487. // },
  137488. // "path": "{project}/global/targetTcpProxies",
  137489. // "request": {
  137490. // "$ref": "TargetTcpProxy"
  137491. // },
  137492. // "response": {
  137493. // "$ref": "Operation"
  137494. // },
  137495. // "scopes": [
  137496. // "https://www.googleapis.com/auth/cloud-platform",
  137497. // "https://www.googleapis.com/auth/compute"
  137498. // ]
  137499. // }
  137500. }
  137501. // method id "compute.targetTcpProxies.list":
  137502. type TargetTcpProxiesListCall struct {
  137503. s *Service
  137504. project string
  137505. urlParams_ gensupport.URLParams
  137506. ifNoneMatch_ string
  137507. ctx_ context.Context
  137508. header_ http.Header
  137509. }
  137510. // List: Retrieves the list of TargetTcpProxy resources available to the
  137511. // specified project.
  137512. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  137513. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137514. c.project = project
  137515. return c
  137516. }
  137517. // Filter sets the optional parameter "filter": A filter expression that
  137518. // filters resources listed in the response. The expression must specify
  137519. // the field name, a comparison operator, and the value that you want to
  137520. // use for filtering. The value must be a string, a number, or a
  137521. // boolean. The comparison operator must be either =, !=, >, or <.
  137522. //
  137523. // For example, if you are filtering Compute Engine instances, you can
  137524. // exclude instances named example-instance by specifying name !=
  137525. // example-instance.
  137526. //
  137527. // You can also filter nested fields. For example, you could specify
  137528. // scheduling.automaticRestart = false to include instances only if they
  137529. // are not scheduled for automatic restarts. You can use filtering on
  137530. // nested fields to filter based on resource labels.
  137531. //
  137532. // To filter on multiple expressions, provide each separate expression
  137533. // within parentheses. For example, (scheduling.automaticRestart = true)
  137534. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  137535. // AND expression. However, you can include AND and OR expressions
  137536. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  137537. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  137538. // true).
  137539. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  137540. c.urlParams_.Set("filter", filter)
  137541. return c
  137542. }
  137543. // MaxResults sets the optional parameter "maxResults": The maximum
  137544. // number of results per page that should be returned. If the number of
  137545. // available results is larger than maxResults, Compute Engine returns a
  137546. // nextPageToken that can be used to get the next page of results in
  137547. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  137548. // (Default: 500)
  137549. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  137550. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  137551. return c
  137552. }
  137553. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  137554. // a certain order. By default, results are returned in alphanumerical
  137555. // order based on the resource name.
  137556. //
  137557. // You can also sort results in descending order based on the creation
  137558. // timestamp using orderBy="creationTimestamp desc". This sorts results
  137559. // based on the creationTimestamp field in reverse chronological order
  137560. // (newest result first). Use this to sort resources like operations so
  137561. // that the newest operation is returned first.
  137562. //
  137563. // Currently, only sorting by name or creationTimestamp desc is
  137564. // supported.
  137565. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  137566. c.urlParams_.Set("orderBy", orderBy)
  137567. return c
  137568. }
  137569. // PageToken sets the optional parameter "pageToken": Specifies a page
  137570. // token to use. Set pageToken to the nextPageToken returned by a
  137571. // previous list request to get the next page of results.
  137572. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  137573. c.urlParams_.Set("pageToken", pageToken)
  137574. return c
  137575. }
  137576. // Fields allows partial responses to be retrieved. See
  137577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137578. // for more information.
  137579. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  137580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137581. return c
  137582. }
  137583. // IfNoneMatch sets the optional parameter which makes the operation
  137584. // fail if the object's ETag matches the given value. This is useful for
  137585. // getting updates only after the object has changed since the last
  137586. // request. Use googleapi.IsNotModified to check whether the response
  137587. // error from Do is the result of In-None-Match.
  137588. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  137589. c.ifNoneMatch_ = entityTag
  137590. return c
  137591. }
  137592. // Context sets the context to be used in this call's Do method. Any
  137593. // pending HTTP request will be aborted if the provided context is
  137594. // canceled.
  137595. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  137596. c.ctx_ = ctx
  137597. return c
  137598. }
  137599. // Header returns an http.Header that can be modified by the caller to
  137600. // add HTTP headers to the request.
  137601. func (c *TargetTcpProxiesListCall) Header() http.Header {
  137602. if c.header_ == nil {
  137603. c.header_ = make(http.Header)
  137604. }
  137605. return c.header_
  137606. }
  137607. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  137608. reqHeaders := make(http.Header)
  137609. for k, v := range c.header_ {
  137610. reqHeaders[k] = v
  137611. }
  137612. reqHeaders.Set("User-Agent", c.s.userAgent())
  137613. if c.ifNoneMatch_ != "" {
  137614. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  137615. }
  137616. var body io.Reader = nil
  137617. c.urlParams_.Set("alt", alt)
  137618. c.urlParams_.Set("prettyPrint", "false")
  137619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  137620. urls += "?" + c.urlParams_.Encode()
  137621. req, err := http.NewRequest("GET", urls, body)
  137622. if err != nil {
  137623. return nil, err
  137624. }
  137625. req.Header = reqHeaders
  137626. googleapi.Expand(req.URL, map[string]string{
  137627. "project": c.project,
  137628. })
  137629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137630. }
  137631. // Do executes the "compute.targetTcpProxies.list" call.
  137632. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  137633. // non-2xx status code is an error. Response headers are in either
  137634. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  137635. // returned at all) in error.(*googleapi.Error).Header. Use
  137636. // googleapi.IsNotModified to check whether the returned error was
  137637. // because http.StatusNotModified was returned.
  137638. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  137639. gensupport.SetOptions(c.urlParams_, opts...)
  137640. res, err := c.doRequest("json")
  137641. if res != nil && res.StatusCode == http.StatusNotModified {
  137642. if res.Body != nil {
  137643. res.Body.Close()
  137644. }
  137645. return nil, &googleapi.Error{
  137646. Code: res.StatusCode,
  137647. Header: res.Header,
  137648. }
  137649. }
  137650. if err != nil {
  137651. return nil, err
  137652. }
  137653. defer googleapi.CloseBody(res)
  137654. if err := googleapi.CheckResponse(res); err != nil {
  137655. return nil, err
  137656. }
  137657. ret := &TargetTcpProxyList{
  137658. ServerResponse: googleapi.ServerResponse{
  137659. Header: res.Header,
  137660. HTTPStatusCode: res.StatusCode,
  137661. },
  137662. }
  137663. target := &ret
  137664. if err := gensupport.DecodeResponse(target, res); err != nil {
  137665. return nil, err
  137666. }
  137667. return ret, nil
  137668. // {
  137669. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  137670. // "httpMethod": "GET",
  137671. // "id": "compute.targetTcpProxies.list",
  137672. // "parameterOrder": [
  137673. // "project"
  137674. // ],
  137675. // "parameters": {
  137676. // "filter": {
  137677. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  137678. // "location": "query",
  137679. // "type": "string"
  137680. // },
  137681. // "maxResults": {
  137682. // "default": "500",
  137683. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  137684. // "format": "uint32",
  137685. // "location": "query",
  137686. // "minimum": "0",
  137687. // "type": "integer"
  137688. // },
  137689. // "orderBy": {
  137690. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  137691. // "location": "query",
  137692. // "type": "string"
  137693. // },
  137694. // "pageToken": {
  137695. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  137696. // "location": "query",
  137697. // "type": "string"
  137698. // },
  137699. // "project": {
  137700. // "description": "Project ID for this request.",
  137701. // "location": "path",
  137702. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137703. // "required": true,
  137704. // "type": "string"
  137705. // }
  137706. // },
  137707. // "path": "{project}/global/targetTcpProxies",
  137708. // "response": {
  137709. // "$ref": "TargetTcpProxyList"
  137710. // },
  137711. // "scopes": [
  137712. // "https://www.googleapis.com/auth/cloud-platform",
  137713. // "https://www.googleapis.com/auth/compute",
  137714. // "https://www.googleapis.com/auth/compute.readonly"
  137715. // ]
  137716. // }
  137717. }
  137718. // Pages invokes f for each page of results.
  137719. // A non-nil error returned from f will halt the iteration.
  137720. // The provided context supersedes any context provided to the Context method.
  137721. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  137722. c.ctx_ = ctx
  137723. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  137724. for {
  137725. x, err := c.Do()
  137726. if err != nil {
  137727. return err
  137728. }
  137729. if err := f(x); err != nil {
  137730. return err
  137731. }
  137732. if x.NextPageToken == "" {
  137733. return nil
  137734. }
  137735. c.PageToken(x.NextPageToken)
  137736. }
  137737. }
  137738. // method id "compute.targetTcpProxies.setBackendService":
  137739. type TargetTcpProxiesSetBackendServiceCall struct {
  137740. s *Service
  137741. project string
  137742. targetTcpProxy string
  137743. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  137744. urlParams_ gensupport.URLParams
  137745. ctx_ context.Context
  137746. header_ http.Header
  137747. }
  137748. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  137749. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  137750. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137751. c.project = project
  137752. c.targetTcpProxy = targetTcpProxy
  137753. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  137754. return c
  137755. }
  137756. // RequestId sets the optional parameter "requestId": An optional
  137757. // request ID to identify requests. Specify a unique request ID so that
  137758. // if you must retry your request, the server will know to ignore the
  137759. // request if it has already been completed.
  137760. //
  137761. // For example, consider a situation where you make an initial request
  137762. // and the request times out. If you make the request again with the
  137763. // same request ID, the server can check if original operation with the
  137764. // same request ID was received, and if so, will ignore the second
  137765. // request. This prevents clients from accidentally creating duplicate
  137766. // commitments.
  137767. //
  137768. // The request ID must be a valid UUID with the exception that zero UUID
  137769. // is not supported (00000000-0000-0000-0000-000000000000).
  137770. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  137771. c.urlParams_.Set("requestId", requestId)
  137772. return c
  137773. }
  137774. // Fields allows partial responses to be retrieved. See
  137775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137776. // for more information.
  137777. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  137778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137779. return c
  137780. }
  137781. // Context sets the context to be used in this call's Do method. Any
  137782. // pending HTTP request will be aborted if the provided context is
  137783. // canceled.
  137784. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  137785. c.ctx_ = ctx
  137786. return c
  137787. }
  137788. // Header returns an http.Header that can be modified by the caller to
  137789. // add HTTP headers to the request.
  137790. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  137791. if c.header_ == nil {
  137792. c.header_ = make(http.Header)
  137793. }
  137794. return c.header_
  137795. }
  137796. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  137797. reqHeaders := make(http.Header)
  137798. for k, v := range c.header_ {
  137799. reqHeaders[k] = v
  137800. }
  137801. reqHeaders.Set("User-Agent", c.s.userAgent())
  137802. var body io.Reader = nil
  137803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  137804. if err != nil {
  137805. return nil, err
  137806. }
  137807. reqHeaders.Set("Content-Type", "application/json")
  137808. c.urlParams_.Set("alt", alt)
  137809. c.urlParams_.Set("prettyPrint", "false")
  137810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  137811. urls += "?" + c.urlParams_.Encode()
  137812. req, err := http.NewRequest("POST", urls, body)
  137813. if err != nil {
  137814. return nil, err
  137815. }
  137816. req.Header = reqHeaders
  137817. googleapi.Expand(req.URL, map[string]string{
  137818. "project": c.project,
  137819. "targetTcpProxy": c.targetTcpProxy,
  137820. })
  137821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137822. }
  137823. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  137824. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  137825. // status code is an error. Response headers are in either
  137826. // *Operation.ServerResponse.Header or (if a response was returned at
  137827. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  137828. // to check whether the returned error was because
  137829. // http.StatusNotModified was returned.
  137830. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  137831. gensupport.SetOptions(c.urlParams_, opts...)
  137832. res, err := c.doRequest("json")
  137833. if res != nil && res.StatusCode == http.StatusNotModified {
  137834. if res.Body != nil {
  137835. res.Body.Close()
  137836. }
  137837. return nil, &googleapi.Error{
  137838. Code: res.StatusCode,
  137839. Header: res.Header,
  137840. }
  137841. }
  137842. if err != nil {
  137843. return nil, err
  137844. }
  137845. defer googleapi.CloseBody(res)
  137846. if err := googleapi.CheckResponse(res); err != nil {
  137847. return nil, err
  137848. }
  137849. ret := &Operation{
  137850. ServerResponse: googleapi.ServerResponse{
  137851. Header: res.Header,
  137852. HTTPStatusCode: res.StatusCode,
  137853. },
  137854. }
  137855. target := &ret
  137856. if err := gensupport.DecodeResponse(target, res); err != nil {
  137857. return nil, err
  137858. }
  137859. return ret, nil
  137860. // {
  137861. // "description": "Changes the BackendService for TargetTcpProxy.",
  137862. // "httpMethod": "POST",
  137863. // "id": "compute.targetTcpProxies.setBackendService",
  137864. // "parameterOrder": [
  137865. // "project",
  137866. // "targetTcpProxy"
  137867. // ],
  137868. // "parameters": {
  137869. // "project": {
  137870. // "description": "Project ID for this request.",
  137871. // "location": "path",
  137872. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  137873. // "required": true,
  137874. // "type": "string"
  137875. // },
  137876. // "requestId": {
  137877. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  137878. // "location": "query",
  137879. // "type": "string"
  137880. // },
  137881. // "targetTcpProxy": {
  137882. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  137883. // "location": "path",
  137884. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  137885. // "required": true,
  137886. // "type": "string"
  137887. // }
  137888. // },
  137889. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  137890. // "request": {
  137891. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  137892. // },
  137893. // "response": {
  137894. // "$ref": "Operation"
  137895. // },
  137896. // "scopes": [
  137897. // "https://www.googleapis.com/auth/cloud-platform",
  137898. // "https://www.googleapis.com/auth/compute"
  137899. // ]
  137900. // }
  137901. }
  137902. // method id "compute.targetTcpProxies.setProxyHeader":
  137903. type TargetTcpProxiesSetProxyHeaderCall struct {
  137904. s *Service
  137905. project string
  137906. targetTcpProxy string
  137907. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  137908. urlParams_ gensupport.URLParams
  137909. ctx_ context.Context
  137910. header_ http.Header
  137911. }
  137912. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  137913. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  137914. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  137915. c.project = project
  137916. c.targetTcpProxy = targetTcpProxy
  137917. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  137918. return c
  137919. }
  137920. // RequestId sets the optional parameter "requestId": An optional
  137921. // request ID to identify requests. Specify a unique request ID so that
  137922. // if you must retry your request, the server will know to ignore the
  137923. // request if it has already been completed.
  137924. //
  137925. // For example, consider a situation where you make an initial request
  137926. // and the request times out. If you make the request again with the
  137927. // same request ID, the server can check if original operation with the
  137928. // same request ID was received, and if so, will ignore the second
  137929. // request. This prevents clients from accidentally creating duplicate
  137930. // commitments.
  137931. //
  137932. // The request ID must be a valid UUID with the exception that zero UUID
  137933. // is not supported (00000000-0000-0000-0000-000000000000).
  137934. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  137935. c.urlParams_.Set("requestId", requestId)
  137936. return c
  137937. }
  137938. // Fields allows partial responses to be retrieved. See
  137939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  137940. // for more information.
  137941. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  137942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  137943. return c
  137944. }
  137945. // Context sets the context to be used in this call's Do method. Any
  137946. // pending HTTP request will be aborted if the provided context is
  137947. // canceled.
  137948. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  137949. c.ctx_ = ctx
  137950. return c
  137951. }
  137952. // Header returns an http.Header that can be modified by the caller to
  137953. // add HTTP headers to the request.
  137954. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  137955. if c.header_ == nil {
  137956. c.header_ = make(http.Header)
  137957. }
  137958. return c.header_
  137959. }
  137960. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  137961. reqHeaders := make(http.Header)
  137962. for k, v := range c.header_ {
  137963. reqHeaders[k] = v
  137964. }
  137965. reqHeaders.Set("User-Agent", c.s.userAgent())
  137966. var body io.Reader = nil
  137967. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  137968. if err != nil {
  137969. return nil, err
  137970. }
  137971. reqHeaders.Set("Content-Type", "application/json")
  137972. c.urlParams_.Set("alt", alt)
  137973. c.urlParams_.Set("prettyPrint", "false")
  137974. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  137975. urls += "?" + c.urlParams_.Encode()
  137976. req, err := http.NewRequest("POST", urls, body)
  137977. if err != nil {
  137978. return nil, err
  137979. }
  137980. req.Header = reqHeaders
  137981. googleapi.Expand(req.URL, map[string]string{
  137982. "project": c.project,
  137983. "targetTcpProxy": c.targetTcpProxy,
  137984. })
  137985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  137986. }
  137987. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  137988. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  137989. // status code is an error. Response headers are in either
  137990. // *Operation.ServerResponse.Header or (if a response was returned at
  137991. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  137992. // to check whether the returned error was because
  137993. // http.StatusNotModified was returned.
  137994. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  137995. gensupport.SetOptions(c.urlParams_, opts...)
  137996. res, err := c.doRequest("json")
  137997. if res != nil && res.StatusCode == http.StatusNotModified {
  137998. if res.Body != nil {
  137999. res.Body.Close()
  138000. }
  138001. return nil, &googleapi.Error{
  138002. Code: res.StatusCode,
  138003. Header: res.Header,
  138004. }
  138005. }
  138006. if err != nil {
  138007. return nil, err
  138008. }
  138009. defer googleapi.CloseBody(res)
  138010. if err := googleapi.CheckResponse(res); err != nil {
  138011. return nil, err
  138012. }
  138013. ret := &Operation{
  138014. ServerResponse: googleapi.ServerResponse{
  138015. Header: res.Header,
  138016. HTTPStatusCode: res.StatusCode,
  138017. },
  138018. }
  138019. target := &ret
  138020. if err := gensupport.DecodeResponse(target, res); err != nil {
  138021. return nil, err
  138022. }
  138023. return ret, nil
  138024. // {
  138025. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  138026. // "httpMethod": "POST",
  138027. // "id": "compute.targetTcpProxies.setProxyHeader",
  138028. // "parameterOrder": [
  138029. // "project",
  138030. // "targetTcpProxy"
  138031. // ],
  138032. // "parameters": {
  138033. // "project": {
  138034. // "description": "Project ID for this request.",
  138035. // "location": "path",
  138036. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138037. // "required": true,
  138038. // "type": "string"
  138039. // },
  138040. // "requestId": {
  138041. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  138042. // "location": "query",
  138043. // "type": "string"
  138044. // },
  138045. // "targetTcpProxy": {
  138046. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  138047. // "location": "path",
  138048. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138049. // "required": true,
  138050. // "type": "string"
  138051. // }
  138052. // },
  138053. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  138054. // "request": {
  138055. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  138056. // },
  138057. // "response": {
  138058. // "$ref": "Operation"
  138059. // },
  138060. // "scopes": [
  138061. // "https://www.googleapis.com/auth/cloud-platform",
  138062. // "https://www.googleapis.com/auth/compute"
  138063. // ]
  138064. // }
  138065. }
  138066. // method id "compute.targetTcpProxies.testIamPermissions":
  138067. type TargetTcpProxiesTestIamPermissionsCall struct {
  138068. s *Service
  138069. project string
  138070. resource string
  138071. testpermissionsrequest *TestPermissionsRequest
  138072. urlParams_ gensupport.URLParams
  138073. ctx_ context.Context
  138074. header_ http.Header
  138075. }
  138076. // TestIamPermissions: Returns permissions that a caller has on the
  138077. // specified resource.
  138078. func (r *TargetTcpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetTcpProxiesTestIamPermissionsCall {
  138079. c := &TargetTcpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138080. c.project = project
  138081. c.resource = resource
  138082. c.testpermissionsrequest = testpermissionsrequest
  138083. return c
  138084. }
  138085. // Fields allows partial responses to be retrieved. See
  138086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138087. // for more information.
  138088. func (c *TargetTcpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetTcpProxiesTestIamPermissionsCall {
  138089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138090. return c
  138091. }
  138092. // Context sets the context to be used in this call's Do method. Any
  138093. // pending HTTP request will be aborted if the provided context is
  138094. // canceled.
  138095. func (c *TargetTcpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetTcpProxiesTestIamPermissionsCall {
  138096. c.ctx_ = ctx
  138097. return c
  138098. }
  138099. // Header returns an http.Header that can be modified by the caller to
  138100. // add HTTP headers to the request.
  138101. func (c *TargetTcpProxiesTestIamPermissionsCall) Header() http.Header {
  138102. if c.header_ == nil {
  138103. c.header_ = make(http.Header)
  138104. }
  138105. return c.header_
  138106. }
  138107. func (c *TargetTcpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  138108. reqHeaders := make(http.Header)
  138109. for k, v := range c.header_ {
  138110. reqHeaders[k] = v
  138111. }
  138112. reqHeaders.Set("User-Agent", c.s.userAgent())
  138113. var body io.Reader = nil
  138114. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  138115. if err != nil {
  138116. return nil, err
  138117. }
  138118. reqHeaders.Set("Content-Type", "application/json")
  138119. c.urlParams_.Set("alt", alt)
  138120. c.urlParams_.Set("prettyPrint", "false")
  138121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{resource}/testIamPermissions")
  138122. urls += "?" + c.urlParams_.Encode()
  138123. req, err := http.NewRequest("POST", urls, body)
  138124. if err != nil {
  138125. return nil, err
  138126. }
  138127. req.Header = reqHeaders
  138128. googleapi.Expand(req.URL, map[string]string{
  138129. "project": c.project,
  138130. "resource": c.resource,
  138131. })
  138132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138133. }
  138134. // Do executes the "compute.targetTcpProxies.testIamPermissions" call.
  138135. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  138136. // non-2xx status code is an error. Response headers are in either
  138137. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  138138. // returned at all) in error.(*googleapi.Error).Header. Use
  138139. // googleapi.IsNotModified to check whether the returned error was
  138140. // because http.StatusNotModified was returned.
  138141. func (c *TargetTcpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  138142. gensupport.SetOptions(c.urlParams_, opts...)
  138143. res, err := c.doRequest("json")
  138144. if res != nil && res.StatusCode == http.StatusNotModified {
  138145. if res.Body != nil {
  138146. res.Body.Close()
  138147. }
  138148. return nil, &googleapi.Error{
  138149. Code: res.StatusCode,
  138150. Header: res.Header,
  138151. }
  138152. }
  138153. if err != nil {
  138154. return nil, err
  138155. }
  138156. defer googleapi.CloseBody(res)
  138157. if err := googleapi.CheckResponse(res); err != nil {
  138158. return nil, err
  138159. }
  138160. ret := &TestPermissionsResponse{
  138161. ServerResponse: googleapi.ServerResponse{
  138162. Header: res.Header,
  138163. HTTPStatusCode: res.StatusCode,
  138164. },
  138165. }
  138166. target := &ret
  138167. if err := gensupport.DecodeResponse(target, res); err != nil {
  138168. return nil, err
  138169. }
  138170. return ret, nil
  138171. // {
  138172. // "description": "Returns permissions that a caller has on the specified resource.",
  138173. // "httpMethod": "POST",
  138174. // "id": "compute.targetTcpProxies.testIamPermissions",
  138175. // "parameterOrder": [
  138176. // "project",
  138177. // "resource"
  138178. // ],
  138179. // "parameters": {
  138180. // "project": {
  138181. // "description": "Project ID for this request.",
  138182. // "location": "path",
  138183. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138184. // "required": true,
  138185. // "type": "string"
  138186. // },
  138187. // "resource": {
  138188. // "description": "Name or id of the resource for this request.",
  138189. // "location": "path",
  138190. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138191. // "required": true,
  138192. // "type": "string"
  138193. // }
  138194. // },
  138195. // "path": "{project}/global/targetTcpProxies/{resource}/testIamPermissions",
  138196. // "request": {
  138197. // "$ref": "TestPermissionsRequest"
  138198. // },
  138199. // "response": {
  138200. // "$ref": "TestPermissionsResponse"
  138201. // },
  138202. // "scopes": [
  138203. // "https://www.googleapis.com/auth/cloud-platform",
  138204. // "https://www.googleapis.com/auth/compute",
  138205. // "https://www.googleapis.com/auth/compute.readonly"
  138206. // ]
  138207. // }
  138208. }
  138209. // method id "compute.targetVpnGateways.aggregatedList":
  138210. type TargetVpnGatewaysAggregatedListCall struct {
  138211. s *Service
  138212. project string
  138213. urlParams_ gensupport.URLParams
  138214. ifNoneMatch_ string
  138215. ctx_ context.Context
  138216. header_ http.Header
  138217. }
  138218. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  138219. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  138220. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138221. c.project = project
  138222. return c
  138223. }
  138224. // Filter sets the optional parameter "filter": A filter expression that
  138225. // filters resources listed in the response. The expression must specify
  138226. // the field name, a comparison operator, and the value that you want to
  138227. // use for filtering. The value must be a string, a number, or a
  138228. // boolean. The comparison operator must be either =, !=, >, or <.
  138229. //
  138230. // For example, if you are filtering Compute Engine instances, you can
  138231. // exclude instances named example-instance by specifying name !=
  138232. // example-instance.
  138233. //
  138234. // You can also filter nested fields. For example, you could specify
  138235. // scheduling.automaticRestart = false to include instances only if they
  138236. // are not scheduled for automatic restarts. You can use filtering on
  138237. // nested fields to filter based on resource labels.
  138238. //
  138239. // To filter on multiple expressions, provide each separate expression
  138240. // within parentheses. For example, (scheduling.automaticRestart = true)
  138241. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  138242. // AND expression. However, you can include AND and OR expressions
  138243. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  138244. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  138245. // true).
  138246. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  138247. c.urlParams_.Set("filter", filter)
  138248. return c
  138249. }
  138250. // MaxResults sets the optional parameter "maxResults": The maximum
  138251. // number of results per page that should be returned. If the number of
  138252. // available results is larger than maxResults, Compute Engine returns a
  138253. // nextPageToken that can be used to get the next page of results in
  138254. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  138255. // (Default: 500)
  138256. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  138257. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  138258. return c
  138259. }
  138260. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  138261. // a certain order. By default, results are returned in alphanumerical
  138262. // order based on the resource name.
  138263. //
  138264. // You can also sort results in descending order based on the creation
  138265. // timestamp using orderBy="creationTimestamp desc". This sorts results
  138266. // based on the creationTimestamp field in reverse chronological order
  138267. // (newest result first). Use this to sort resources like operations so
  138268. // that the newest operation is returned first.
  138269. //
  138270. // Currently, only sorting by name or creationTimestamp desc is
  138271. // supported.
  138272. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  138273. c.urlParams_.Set("orderBy", orderBy)
  138274. return c
  138275. }
  138276. // PageToken sets the optional parameter "pageToken": Specifies a page
  138277. // token to use. Set pageToken to the nextPageToken returned by a
  138278. // previous list request to get the next page of results.
  138279. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  138280. c.urlParams_.Set("pageToken", pageToken)
  138281. return c
  138282. }
  138283. // Fields allows partial responses to be retrieved. See
  138284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138285. // for more information.
  138286. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  138287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138288. return c
  138289. }
  138290. // IfNoneMatch sets the optional parameter which makes the operation
  138291. // fail if the object's ETag matches the given value. This is useful for
  138292. // getting updates only after the object has changed since the last
  138293. // request. Use googleapi.IsNotModified to check whether the response
  138294. // error from Do is the result of In-None-Match.
  138295. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  138296. c.ifNoneMatch_ = entityTag
  138297. return c
  138298. }
  138299. // Context sets the context to be used in this call's Do method. Any
  138300. // pending HTTP request will be aborted if the provided context is
  138301. // canceled.
  138302. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  138303. c.ctx_ = ctx
  138304. return c
  138305. }
  138306. // Header returns an http.Header that can be modified by the caller to
  138307. // add HTTP headers to the request.
  138308. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  138309. if c.header_ == nil {
  138310. c.header_ = make(http.Header)
  138311. }
  138312. return c.header_
  138313. }
  138314. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  138315. reqHeaders := make(http.Header)
  138316. for k, v := range c.header_ {
  138317. reqHeaders[k] = v
  138318. }
  138319. reqHeaders.Set("User-Agent", c.s.userAgent())
  138320. if c.ifNoneMatch_ != "" {
  138321. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  138322. }
  138323. var body io.Reader = nil
  138324. c.urlParams_.Set("alt", alt)
  138325. c.urlParams_.Set("prettyPrint", "false")
  138326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  138327. urls += "?" + c.urlParams_.Encode()
  138328. req, err := http.NewRequest("GET", urls, body)
  138329. if err != nil {
  138330. return nil, err
  138331. }
  138332. req.Header = reqHeaders
  138333. googleapi.Expand(req.URL, map[string]string{
  138334. "project": c.project,
  138335. })
  138336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138337. }
  138338. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  138339. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  138340. // non-nil. Any non-2xx status code is an error. Response headers are in
  138341. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  138342. // response was returned at all) in error.(*googleapi.Error).Header. Use
  138343. // googleapi.IsNotModified to check whether the returned error was
  138344. // because http.StatusNotModified was returned.
  138345. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  138346. gensupport.SetOptions(c.urlParams_, opts...)
  138347. res, err := c.doRequest("json")
  138348. if res != nil && res.StatusCode == http.StatusNotModified {
  138349. if res.Body != nil {
  138350. res.Body.Close()
  138351. }
  138352. return nil, &googleapi.Error{
  138353. Code: res.StatusCode,
  138354. Header: res.Header,
  138355. }
  138356. }
  138357. if err != nil {
  138358. return nil, err
  138359. }
  138360. defer googleapi.CloseBody(res)
  138361. if err := googleapi.CheckResponse(res); err != nil {
  138362. return nil, err
  138363. }
  138364. ret := &TargetVpnGatewayAggregatedList{
  138365. ServerResponse: googleapi.ServerResponse{
  138366. Header: res.Header,
  138367. HTTPStatusCode: res.StatusCode,
  138368. },
  138369. }
  138370. target := &ret
  138371. if err := gensupport.DecodeResponse(target, res); err != nil {
  138372. return nil, err
  138373. }
  138374. return ret, nil
  138375. // {
  138376. // "description": "Retrieves an aggregated list of target VPN gateways.",
  138377. // "httpMethod": "GET",
  138378. // "id": "compute.targetVpnGateways.aggregatedList",
  138379. // "parameterOrder": [
  138380. // "project"
  138381. // ],
  138382. // "parameters": {
  138383. // "filter": {
  138384. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  138385. // "location": "query",
  138386. // "type": "string"
  138387. // },
  138388. // "maxResults": {
  138389. // "default": "500",
  138390. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  138391. // "format": "uint32",
  138392. // "location": "query",
  138393. // "minimum": "0",
  138394. // "type": "integer"
  138395. // },
  138396. // "orderBy": {
  138397. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  138398. // "location": "query",
  138399. // "type": "string"
  138400. // },
  138401. // "pageToken": {
  138402. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  138403. // "location": "query",
  138404. // "type": "string"
  138405. // },
  138406. // "project": {
  138407. // "description": "Project ID for this request.",
  138408. // "location": "path",
  138409. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138410. // "required": true,
  138411. // "type": "string"
  138412. // }
  138413. // },
  138414. // "path": "{project}/aggregated/targetVpnGateways",
  138415. // "response": {
  138416. // "$ref": "TargetVpnGatewayAggregatedList"
  138417. // },
  138418. // "scopes": [
  138419. // "https://www.googleapis.com/auth/cloud-platform",
  138420. // "https://www.googleapis.com/auth/compute",
  138421. // "https://www.googleapis.com/auth/compute.readonly"
  138422. // ]
  138423. // }
  138424. }
  138425. // Pages invokes f for each page of results.
  138426. // A non-nil error returned from f will halt the iteration.
  138427. // The provided context supersedes any context provided to the Context method.
  138428. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  138429. c.ctx_ = ctx
  138430. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  138431. for {
  138432. x, err := c.Do()
  138433. if err != nil {
  138434. return err
  138435. }
  138436. if err := f(x); err != nil {
  138437. return err
  138438. }
  138439. if x.NextPageToken == "" {
  138440. return nil
  138441. }
  138442. c.PageToken(x.NextPageToken)
  138443. }
  138444. }
  138445. // method id "compute.targetVpnGateways.delete":
  138446. type TargetVpnGatewaysDeleteCall struct {
  138447. s *Service
  138448. project string
  138449. region string
  138450. targetVpnGateway string
  138451. urlParams_ gensupport.URLParams
  138452. ctx_ context.Context
  138453. header_ http.Header
  138454. }
  138455. // Delete: Deletes the specified target VPN gateway.
  138456. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  138457. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138458. c.project = project
  138459. c.region = region
  138460. c.targetVpnGateway = targetVpnGateway
  138461. return c
  138462. }
  138463. // RequestId sets the optional parameter "requestId": An optional
  138464. // request ID to identify requests. Specify a unique request ID so that
  138465. // if you must retry your request, the server will know to ignore the
  138466. // request if it has already been completed.
  138467. //
  138468. // For example, consider a situation where you make an initial request
  138469. // and the request times out. If you make the request again with the
  138470. // same request ID, the server can check if original operation with the
  138471. // same request ID was received, and if so, will ignore the second
  138472. // request. This prevents clients from accidentally creating duplicate
  138473. // commitments.
  138474. //
  138475. // The request ID must be a valid UUID with the exception that zero UUID
  138476. // is not supported (00000000-0000-0000-0000-000000000000).
  138477. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  138478. c.urlParams_.Set("requestId", requestId)
  138479. return c
  138480. }
  138481. // Fields allows partial responses to be retrieved. See
  138482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138483. // for more information.
  138484. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  138485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138486. return c
  138487. }
  138488. // Context sets the context to be used in this call's Do method. Any
  138489. // pending HTTP request will be aborted if the provided context is
  138490. // canceled.
  138491. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  138492. c.ctx_ = ctx
  138493. return c
  138494. }
  138495. // Header returns an http.Header that can be modified by the caller to
  138496. // add HTTP headers to the request.
  138497. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  138498. if c.header_ == nil {
  138499. c.header_ = make(http.Header)
  138500. }
  138501. return c.header_
  138502. }
  138503. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  138504. reqHeaders := make(http.Header)
  138505. for k, v := range c.header_ {
  138506. reqHeaders[k] = v
  138507. }
  138508. reqHeaders.Set("User-Agent", c.s.userAgent())
  138509. var body io.Reader = nil
  138510. c.urlParams_.Set("alt", alt)
  138511. c.urlParams_.Set("prettyPrint", "false")
  138512. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  138513. urls += "?" + c.urlParams_.Encode()
  138514. req, err := http.NewRequest("DELETE", urls, body)
  138515. if err != nil {
  138516. return nil, err
  138517. }
  138518. req.Header = reqHeaders
  138519. googleapi.Expand(req.URL, map[string]string{
  138520. "project": c.project,
  138521. "region": c.region,
  138522. "targetVpnGateway": c.targetVpnGateway,
  138523. })
  138524. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138525. }
  138526. // Do executes the "compute.targetVpnGateways.delete" call.
  138527. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  138528. // status code is an error. Response headers are in either
  138529. // *Operation.ServerResponse.Header or (if a response was returned at
  138530. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  138531. // to check whether the returned error was because
  138532. // http.StatusNotModified was returned.
  138533. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  138534. gensupport.SetOptions(c.urlParams_, opts...)
  138535. res, err := c.doRequest("json")
  138536. if res != nil && res.StatusCode == http.StatusNotModified {
  138537. if res.Body != nil {
  138538. res.Body.Close()
  138539. }
  138540. return nil, &googleapi.Error{
  138541. Code: res.StatusCode,
  138542. Header: res.Header,
  138543. }
  138544. }
  138545. if err != nil {
  138546. return nil, err
  138547. }
  138548. defer googleapi.CloseBody(res)
  138549. if err := googleapi.CheckResponse(res); err != nil {
  138550. return nil, err
  138551. }
  138552. ret := &Operation{
  138553. ServerResponse: googleapi.ServerResponse{
  138554. Header: res.Header,
  138555. HTTPStatusCode: res.StatusCode,
  138556. },
  138557. }
  138558. target := &ret
  138559. if err := gensupport.DecodeResponse(target, res); err != nil {
  138560. return nil, err
  138561. }
  138562. return ret, nil
  138563. // {
  138564. // "description": "Deletes the specified target VPN gateway.",
  138565. // "httpMethod": "DELETE",
  138566. // "id": "compute.targetVpnGateways.delete",
  138567. // "parameterOrder": [
  138568. // "project",
  138569. // "region",
  138570. // "targetVpnGateway"
  138571. // ],
  138572. // "parameters": {
  138573. // "project": {
  138574. // "description": "Project ID for this request.",
  138575. // "location": "path",
  138576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138577. // "required": true,
  138578. // "type": "string"
  138579. // },
  138580. // "region": {
  138581. // "description": "Name of the region for this request.",
  138582. // "location": "path",
  138583. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  138584. // "required": true,
  138585. // "type": "string"
  138586. // },
  138587. // "requestId": {
  138588. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  138589. // "location": "query",
  138590. // "type": "string"
  138591. // },
  138592. // "targetVpnGateway": {
  138593. // "description": "Name of the target VPN gateway to delete.",
  138594. // "location": "path",
  138595. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138596. // "required": true,
  138597. // "type": "string"
  138598. // }
  138599. // },
  138600. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  138601. // "response": {
  138602. // "$ref": "Operation"
  138603. // },
  138604. // "scopes": [
  138605. // "https://www.googleapis.com/auth/cloud-platform",
  138606. // "https://www.googleapis.com/auth/compute"
  138607. // ]
  138608. // }
  138609. }
  138610. // method id "compute.targetVpnGateways.get":
  138611. type TargetVpnGatewaysGetCall struct {
  138612. s *Service
  138613. project string
  138614. region string
  138615. targetVpnGateway string
  138616. urlParams_ gensupport.URLParams
  138617. ifNoneMatch_ string
  138618. ctx_ context.Context
  138619. header_ http.Header
  138620. }
  138621. // Get: Returns the specified target VPN gateway. Gets a list of
  138622. // available target VPN gateways by making a list() request.
  138623. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  138624. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138625. c.project = project
  138626. c.region = region
  138627. c.targetVpnGateway = targetVpnGateway
  138628. return c
  138629. }
  138630. // Fields allows partial responses to be retrieved. See
  138631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138632. // for more information.
  138633. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  138634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138635. return c
  138636. }
  138637. // IfNoneMatch sets the optional parameter which makes the operation
  138638. // fail if the object's ETag matches the given value. This is useful for
  138639. // getting updates only after the object has changed since the last
  138640. // request. Use googleapi.IsNotModified to check whether the response
  138641. // error from Do is the result of In-None-Match.
  138642. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  138643. c.ifNoneMatch_ = entityTag
  138644. return c
  138645. }
  138646. // Context sets the context to be used in this call's Do method. Any
  138647. // pending HTTP request will be aborted if the provided context is
  138648. // canceled.
  138649. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  138650. c.ctx_ = ctx
  138651. return c
  138652. }
  138653. // Header returns an http.Header that can be modified by the caller to
  138654. // add HTTP headers to the request.
  138655. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  138656. if c.header_ == nil {
  138657. c.header_ = make(http.Header)
  138658. }
  138659. return c.header_
  138660. }
  138661. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  138662. reqHeaders := make(http.Header)
  138663. for k, v := range c.header_ {
  138664. reqHeaders[k] = v
  138665. }
  138666. reqHeaders.Set("User-Agent", c.s.userAgent())
  138667. if c.ifNoneMatch_ != "" {
  138668. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  138669. }
  138670. var body io.Reader = nil
  138671. c.urlParams_.Set("alt", alt)
  138672. c.urlParams_.Set("prettyPrint", "false")
  138673. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  138674. urls += "?" + c.urlParams_.Encode()
  138675. req, err := http.NewRequest("GET", urls, body)
  138676. if err != nil {
  138677. return nil, err
  138678. }
  138679. req.Header = reqHeaders
  138680. googleapi.Expand(req.URL, map[string]string{
  138681. "project": c.project,
  138682. "region": c.region,
  138683. "targetVpnGateway": c.targetVpnGateway,
  138684. })
  138685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138686. }
  138687. // Do executes the "compute.targetVpnGateways.get" call.
  138688. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  138689. // non-2xx status code is an error. Response headers are in either
  138690. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  138691. // returned at all) in error.(*googleapi.Error).Header. Use
  138692. // googleapi.IsNotModified to check whether the returned error was
  138693. // because http.StatusNotModified was returned.
  138694. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  138695. gensupport.SetOptions(c.urlParams_, opts...)
  138696. res, err := c.doRequest("json")
  138697. if res != nil && res.StatusCode == http.StatusNotModified {
  138698. if res.Body != nil {
  138699. res.Body.Close()
  138700. }
  138701. return nil, &googleapi.Error{
  138702. Code: res.StatusCode,
  138703. Header: res.Header,
  138704. }
  138705. }
  138706. if err != nil {
  138707. return nil, err
  138708. }
  138709. defer googleapi.CloseBody(res)
  138710. if err := googleapi.CheckResponse(res); err != nil {
  138711. return nil, err
  138712. }
  138713. ret := &TargetVpnGateway{
  138714. ServerResponse: googleapi.ServerResponse{
  138715. Header: res.Header,
  138716. HTTPStatusCode: res.StatusCode,
  138717. },
  138718. }
  138719. target := &ret
  138720. if err := gensupport.DecodeResponse(target, res); err != nil {
  138721. return nil, err
  138722. }
  138723. return ret, nil
  138724. // {
  138725. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  138726. // "httpMethod": "GET",
  138727. // "id": "compute.targetVpnGateways.get",
  138728. // "parameterOrder": [
  138729. // "project",
  138730. // "region",
  138731. // "targetVpnGateway"
  138732. // ],
  138733. // "parameters": {
  138734. // "project": {
  138735. // "description": "Project ID for this request.",
  138736. // "location": "path",
  138737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138738. // "required": true,
  138739. // "type": "string"
  138740. // },
  138741. // "region": {
  138742. // "description": "Name of the region for this request.",
  138743. // "location": "path",
  138744. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  138745. // "required": true,
  138746. // "type": "string"
  138747. // },
  138748. // "targetVpnGateway": {
  138749. // "description": "Name of the target VPN gateway to return.",
  138750. // "location": "path",
  138751. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  138752. // "required": true,
  138753. // "type": "string"
  138754. // }
  138755. // },
  138756. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  138757. // "response": {
  138758. // "$ref": "TargetVpnGateway"
  138759. // },
  138760. // "scopes": [
  138761. // "https://www.googleapis.com/auth/cloud-platform",
  138762. // "https://www.googleapis.com/auth/compute",
  138763. // "https://www.googleapis.com/auth/compute.readonly"
  138764. // ]
  138765. // }
  138766. }
  138767. // method id "compute.targetVpnGateways.insert":
  138768. type TargetVpnGatewaysInsertCall struct {
  138769. s *Service
  138770. project string
  138771. region string
  138772. targetvpngateway *TargetVpnGateway
  138773. urlParams_ gensupport.URLParams
  138774. ctx_ context.Context
  138775. header_ http.Header
  138776. }
  138777. // Insert: Creates a target VPN gateway in the specified project and
  138778. // region using the data included in the request.
  138779. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  138780. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138781. c.project = project
  138782. c.region = region
  138783. c.targetvpngateway = targetvpngateway
  138784. return c
  138785. }
  138786. // RequestId sets the optional parameter "requestId": An optional
  138787. // request ID to identify requests. Specify a unique request ID so that
  138788. // if you must retry your request, the server will know to ignore the
  138789. // request if it has already been completed.
  138790. //
  138791. // For example, consider a situation where you make an initial request
  138792. // and the request times out. If you make the request again with the
  138793. // same request ID, the server can check if original operation with the
  138794. // same request ID was received, and if so, will ignore the second
  138795. // request. This prevents clients from accidentally creating duplicate
  138796. // commitments.
  138797. //
  138798. // The request ID must be a valid UUID with the exception that zero UUID
  138799. // is not supported (00000000-0000-0000-0000-000000000000).
  138800. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  138801. c.urlParams_.Set("requestId", requestId)
  138802. return c
  138803. }
  138804. // Fields allows partial responses to be retrieved. See
  138805. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  138806. // for more information.
  138807. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  138808. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  138809. return c
  138810. }
  138811. // Context sets the context to be used in this call's Do method. Any
  138812. // pending HTTP request will be aborted if the provided context is
  138813. // canceled.
  138814. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  138815. c.ctx_ = ctx
  138816. return c
  138817. }
  138818. // Header returns an http.Header that can be modified by the caller to
  138819. // add HTTP headers to the request.
  138820. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  138821. if c.header_ == nil {
  138822. c.header_ = make(http.Header)
  138823. }
  138824. return c.header_
  138825. }
  138826. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  138827. reqHeaders := make(http.Header)
  138828. for k, v := range c.header_ {
  138829. reqHeaders[k] = v
  138830. }
  138831. reqHeaders.Set("User-Agent", c.s.userAgent())
  138832. var body io.Reader = nil
  138833. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  138834. if err != nil {
  138835. return nil, err
  138836. }
  138837. reqHeaders.Set("Content-Type", "application/json")
  138838. c.urlParams_.Set("alt", alt)
  138839. c.urlParams_.Set("prettyPrint", "false")
  138840. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  138841. urls += "?" + c.urlParams_.Encode()
  138842. req, err := http.NewRequest("POST", urls, body)
  138843. if err != nil {
  138844. return nil, err
  138845. }
  138846. req.Header = reqHeaders
  138847. googleapi.Expand(req.URL, map[string]string{
  138848. "project": c.project,
  138849. "region": c.region,
  138850. })
  138851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  138852. }
  138853. // Do executes the "compute.targetVpnGateways.insert" call.
  138854. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  138855. // status code is an error. Response headers are in either
  138856. // *Operation.ServerResponse.Header or (if a response was returned at
  138857. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  138858. // to check whether the returned error was because
  138859. // http.StatusNotModified was returned.
  138860. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  138861. gensupport.SetOptions(c.urlParams_, opts...)
  138862. res, err := c.doRequest("json")
  138863. if res != nil && res.StatusCode == http.StatusNotModified {
  138864. if res.Body != nil {
  138865. res.Body.Close()
  138866. }
  138867. return nil, &googleapi.Error{
  138868. Code: res.StatusCode,
  138869. Header: res.Header,
  138870. }
  138871. }
  138872. if err != nil {
  138873. return nil, err
  138874. }
  138875. defer googleapi.CloseBody(res)
  138876. if err := googleapi.CheckResponse(res); err != nil {
  138877. return nil, err
  138878. }
  138879. ret := &Operation{
  138880. ServerResponse: googleapi.ServerResponse{
  138881. Header: res.Header,
  138882. HTTPStatusCode: res.StatusCode,
  138883. },
  138884. }
  138885. target := &ret
  138886. if err := gensupport.DecodeResponse(target, res); err != nil {
  138887. return nil, err
  138888. }
  138889. return ret, nil
  138890. // {
  138891. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  138892. // "httpMethod": "POST",
  138893. // "id": "compute.targetVpnGateways.insert",
  138894. // "parameterOrder": [
  138895. // "project",
  138896. // "region"
  138897. // ],
  138898. // "parameters": {
  138899. // "project": {
  138900. // "description": "Project ID for this request.",
  138901. // "location": "path",
  138902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  138903. // "required": true,
  138904. // "type": "string"
  138905. // },
  138906. // "region": {
  138907. // "description": "Name of the region for this request.",
  138908. // "location": "path",
  138909. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  138910. // "required": true,
  138911. // "type": "string"
  138912. // },
  138913. // "requestId": {
  138914. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  138915. // "location": "query",
  138916. // "type": "string"
  138917. // }
  138918. // },
  138919. // "path": "{project}/regions/{region}/targetVpnGateways",
  138920. // "request": {
  138921. // "$ref": "TargetVpnGateway"
  138922. // },
  138923. // "response": {
  138924. // "$ref": "Operation"
  138925. // },
  138926. // "scopes": [
  138927. // "https://www.googleapis.com/auth/cloud-platform",
  138928. // "https://www.googleapis.com/auth/compute"
  138929. // ]
  138930. // }
  138931. }
  138932. // method id "compute.targetVpnGateways.list":
  138933. type TargetVpnGatewaysListCall struct {
  138934. s *Service
  138935. project string
  138936. region string
  138937. urlParams_ gensupport.URLParams
  138938. ifNoneMatch_ string
  138939. ctx_ context.Context
  138940. header_ http.Header
  138941. }
  138942. // List: Retrieves a list of target VPN gateways available to the
  138943. // specified project and region.
  138944. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  138945. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  138946. c.project = project
  138947. c.region = region
  138948. return c
  138949. }
  138950. // Filter sets the optional parameter "filter": A filter expression that
  138951. // filters resources listed in the response. The expression must specify
  138952. // the field name, a comparison operator, and the value that you want to
  138953. // use for filtering. The value must be a string, a number, or a
  138954. // boolean. The comparison operator must be either =, !=, >, or <.
  138955. //
  138956. // For example, if you are filtering Compute Engine instances, you can
  138957. // exclude instances named example-instance by specifying name !=
  138958. // example-instance.
  138959. //
  138960. // You can also filter nested fields. For example, you could specify
  138961. // scheduling.automaticRestart = false to include instances only if they
  138962. // are not scheduled for automatic restarts. You can use filtering on
  138963. // nested fields to filter based on resource labels.
  138964. //
  138965. // To filter on multiple expressions, provide each separate expression
  138966. // within parentheses. For example, (scheduling.automaticRestart = true)
  138967. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  138968. // AND expression. However, you can include AND and OR expressions
  138969. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  138970. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  138971. // true).
  138972. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  138973. c.urlParams_.Set("filter", filter)
  138974. return c
  138975. }
  138976. // MaxResults sets the optional parameter "maxResults": The maximum
  138977. // number of results per page that should be returned. If the number of
  138978. // available results is larger than maxResults, Compute Engine returns a
  138979. // nextPageToken that can be used to get the next page of results in
  138980. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  138981. // (Default: 500)
  138982. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  138983. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  138984. return c
  138985. }
  138986. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  138987. // a certain order. By default, results are returned in alphanumerical
  138988. // order based on the resource name.
  138989. //
  138990. // You can also sort results in descending order based on the creation
  138991. // timestamp using orderBy="creationTimestamp desc". This sorts results
  138992. // based on the creationTimestamp field in reverse chronological order
  138993. // (newest result first). Use this to sort resources like operations so
  138994. // that the newest operation is returned first.
  138995. //
  138996. // Currently, only sorting by name or creationTimestamp desc is
  138997. // supported.
  138998. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  138999. c.urlParams_.Set("orderBy", orderBy)
  139000. return c
  139001. }
  139002. // PageToken sets the optional parameter "pageToken": Specifies a page
  139003. // token to use. Set pageToken to the nextPageToken returned by a
  139004. // previous list request to get the next page of results.
  139005. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  139006. c.urlParams_.Set("pageToken", pageToken)
  139007. return c
  139008. }
  139009. // Fields allows partial responses to be retrieved. See
  139010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139011. // for more information.
  139012. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  139013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139014. return c
  139015. }
  139016. // IfNoneMatch sets the optional parameter which makes the operation
  139017. // fail if the object's ETag matches the given value. This is useful for
  139018. // getting updates only after the object has changed since the last
  139019. // request. Use googleapi.IsNotModified to check whether the response
  139020. // error from Do is the result of In-None-Match.
  139021. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  139022. c.ifNoneMatch_ = entityTag
  139023. return c
  139024. }
  139025. // Context sets the context to be used in this call's Do method. Any
  139026. // pending HTTP request will be aborted if the provided context is
  139027. // canceled.
  139028. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  139029. c.ctx_ = ctx
  139030. return c
  139031. }
  139032. // Header returns an http.Header that can be modified by the caller to
  139033. // add HTTP headers to the request.
  139034. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  139035. if c.header_ == nil {
  139036. c.header_ = make(http.Header)
  139037. }
  139038. return c.header_
  139039. }
  139040. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  139041. reqHeaders := make(http.Header)
  139042. for k, v := range c.header_ {
  139043. reqHeaders[k] = v
  139044. }
  139045. reqHeaders.Set("User-Agent", c.s.userAgent())
  139046. if c.ifNoneMatch_ != "" {
  139047. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  139048. }
  139049. var body io.Reader = nil
  139050. c.urlParams_.Set("alt", alt)
  139051. c.urlParams_.Set("prettyPrint", "false")
  139052. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  139053. urls += "?" + c.urlParams_.Encode()
  139054. req, err := http.NewRequest("GET", urls, body)
  139055. if err != nil {
  139056. return nil, err
  139057. }
  139058. req.Header = reqHeaders
  139059. googleapi.Expand(req.URL, map[string]string{
  139060. "project": c.project,
  139061. "region": c.region,
  139062. })
  139063. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139064. }
  139065. // Do executes the "compute.targetVpnGateways.list" call.
  139066. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  139067. // non-2xx status code is an error. Response headers are in either
  139068. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  139069. // returned at all) in error.(*googleapi.Error).Header. Use
  139070. // googleapi.IsNotModified to check whether the returned error was
  139071. // because http.StatusNotModified was returned.
  139072. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  139073. gensupport.SetOptions(c.urlParams_, opts...)
  139074. res, err := c.doRequest("json")
  139075. if res != nil && res.StatusCode == http.StatusNotModified {
  139076. if res.Body != nil {
  139077. res.Body.Close()
  139078. }
  139079. return nil, &googleapi.Error{
  139080. Code: res.StatusCode,
  139081. Header: res.Header,
  139082. }
  139083. }
  139084. if err != nil {
  139085. return nil, err
  139086. }
  139087. defer googleapi.CloseBody(res)
  139088. if err := googleapi.CheckResponse(res); err != nil {
  139089. return nil, err
  139090. }
  139091. ret := &TargetVpnGatewayList{
  139092. ServerResponse: googleapi.ServerResponse{
  139093. Header: res.Header,
  139094. HTTPStatusCode: res.StatusCode,
  139095. },
  139096. }
  139097. target := &ret
  139098. if err := gensupport.DecodeResponse(target, res); err != nil {
  139099. return nil, err
  139100. }
  139101. return ret, nil
  139102. // {
  139103. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  139104. // "httpMethod": "GET",
  139105. // "id": "compute.targetVpnGateways.list",
  139106. // "parameterOrder": [
  139107. // "project",
  139108. // "region"
  139109. // ],
  139110. // "parameters": {
  139111. // "filter": {
  139112. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  139113. // "location": "query",
  139114. // "type": "string"
  139115. // },
  139116. // "maxResults": {
  139117. // "default": "500",
  139118. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  139119. // "format": "uint32",
  139120. // "location": "query",
  139121. // "minimum": "0",
  139122. // "type": "integer"
  139123. // },
  139124. // "orderBy": {
  139125. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  139126. // "location": "query",
  139127. // "type": "string"
  139128. // },
  139129. // "pageToken": {
  139130. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  139131. // "location": "query",
  139132. // "type": "string"
  139133. // },
  139134. // "project": {
  139135. // "description": "Project ID for this request.",
  139136. // "location": "path",
  139137. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139138. // "required": true,
  139139. // "type": "string"
  139140. // },
  139141. // "region": {
  139142. // "description": "Name of the region for this request.",
  139143. // "location": "path",
  139144. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  139145. // "required": true,
  139146. // "type": "string"
  139147. // }
  139148. // },
  139149. // "path": "{project}/regions/{region}/targetVpnGateways",
  139150. // "response": {
  139151. // "$ref": "TargetVpnGatewayList"
  139152. // },
  139153. // "scopes": [
  139154. // "https://www.googleapis.com/auth/cloud-platform",
  139155. // "https://www.googleapis.com/auth/compute",
  139156. // "https://www.googleapis.com/auth/compute.readonly"
  139157. // ]
  139158. // }
  139159. }
  139160. // Pages invokes f for each page of results.
  139161. // A non-nil error returned from f will halt the iteration.
  139162. // The provided context supersedes any context provided to the Context method.
  139163. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  139164. c.ctx_ = ctx
  139165. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  139166. for {
  139167. x, err := c.Do()
  139168. if err != nil {
  139169. return err
  139170. }
  139171. if err := f(x); err != nil {
  139172. return err
  139173. }
  139174. if x.NextPageToken == "" {
  139175. return nil
  139176. }
  139177. c.PageToken(x.NextPageToken)
  139178. }
  139179. }
  139180. // method id "compute.targetVpnGateways.setLabels":
  139181. type TargetVpnGatewaysSetLabelsCall struct {
  139182. s *Service
  139183. project string
  139184. region string
  139185. resource string
  139186. regionsetlabelsrequest *RegionSetLabelsRequest
  139187. urlParams_ gensupport.URLParams
  139188. ctx_ context.Context
  139189. header_ http.Header
  139190. }
  139191. // SetLabels: Sets the labels on a TargetVpnGateway. To learn more about
  139192. // labels, read the Labeling Resources documentation.
  139193. func (r *TargetVpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *TargetVpnGatewaysSetLabelsCall {
  139194. c := &TargetVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139195. c.project = project
  139196. c.region = region
  139197. c.resource = resource
  139198. c.regionsetlabelsrequest = regionsetlabelsrequest
  139199. return c
  139200. }
  139201. // RequestId sets the optional parameter "requestId": An optional
  139202. // request ID to identify requests. Specify a unique request ID so that
  139203. // if you must retry your request, the server will know to ignore the
  139204. // request if it has already been completed.
  139205. //
  139206. // For example, consider a situation where you make an initial request
  139207. // and the request times out. If you make the request again with the
  139208. // same request ID, the server can check if original operation with the
  139209. // same request ID was received, and if so, will ignore the second
  139210. // request. This prevents clients from accidentally creating duplicate
  139211. // commitments.
  139212. //
  139213. // The request ID must be a valid UUID with the exception that zero UUID
  139214. // is not supported (00000000-0000-0000-0000-000000000000).
  139215. func (c *TargetVpnGatewaysSetLabelsCall) RequestId(requestId string) *TargetVpnGatewaysSetLabelsCall {
  139216. c.urlParams_.Set("requestId", requestId)
  139217. return c
  139218. }
  139219. // Fields allows partial responses to be retrieved. See
  139220. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139221. // for more information.
  139222. func (c *TargetVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysSetLabelsCall {
  139223. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139224. return c
  139225. }
  139226. // Context sets the context to be used in this call's Do method. Any
  139227. // pending HTTP request will be aborted if the provided context is
  139228. // canceled.
  139229. func (c *TargetVpnGatewaysSetLabelsCall) Context(ctx context.Context) *TargetVpnGatewaysSetLabelsCall {
  139230. c.ctx_ = ctx
  139231. return c
  139232. }
  139233. // Header returns an http.Header that can be modified by the caller to
  139234. // add HTTP headers to the request.
  139235. func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header {
  139236. if c.header_ == nil {
  139237. c.header_ = make(http.Header)
  139238. }
  139239. return c.header_
  139240. }
  139241. func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  139242. reqHeaders := make(http.Header)
  139243. for k, v := range c.header_ {
  139244. reqHeaders[k] = v
  139245. }
  139246. reqHeaders.Set("User-Agent", c.s.userAgent())
  139247. var body io.Reader = nil
  139248. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  139249. if err != nil {
  139250. return nil, err
  139251. }
  139252. reqHeaders.Set("Content-Type", "application/json")
  139253. c.urlParams_.Set("alt", alt)
  139254. c.urlParams_.Set("prettyPrint", "false")
  139255. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels")
  139256. urls += "?" + c.urlParams_.Encode()
  139257. req, err := http.NewRequest("POST", urls, body)
  139258. if err != nil {
  139259. return nil, err
  139260. }
  139261. req.Header = reqHeaders
  139262. googleapi.Expand(req.URL, map[string]string{
  139263. "project": c.project,
  139264. "region": c.region,
  139265. "resource": c.resource,
  139266. })
  139267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139268. }
  139269. // Do executes the "compute.targetVpnGateways.setLabels" call.
  139270. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  139271. // status code is an error. Response headers are in either
  139272. // *Operation.ServerResponse.Header or (if a response was returned at
  139273. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  139274. // to check whether the returned error was because
  139275. // http.StatusNotModified was returned.
  139276. func (c *TargetVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  139277. gensupport.SetOptions(c.urlParams_, opts...)
  139278. res, err := c.doRequest("json")
  139279. if res != nil && res.StatusCode == http.StatusNotModified {
  139280. if res.Body != nil {
  139281. res.Body.Close()
  139282. }
  139283. return nil, &googleapi.Error{
  139284. Code: res.StatusCode,
  139285. Header: res.Header,
  139286. }
  139287. }
  139288. if err != nil {
  139289. return nil, err
  139290. }
  139291. defer googleapi.CloseBody(res)
  139292. if err := googleapi.CheckResponse(res); err != nil {
  139293. return nil, err
  139294. }
  139295. ret := &Operation{
  139296. ServerResponse: googleapi.ServerResponse{
  139297. Header: res.Header,
  139298. HTTPStatusCode: res.StatusCode,
  139299. },
  139300. }
  139301. target := &ret
  139302. if err := gensupport.DecodeResponse(target, res); err != nil {
  139303. return nil, err
  139304. }
  139305. return ret, nil
  139306. // {
  139307. // "description": "Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  139308. // "httpMethod": "POST",
  139309. // "id": "compute.targetVpnGateways.setLabels",
  139310. // "parameterOrder": [
  139311. // "project",
  139312. // "region",
  139313. // "resource"
  139314. // ],
  139315. // "parameters": {
  139316. // "project": {
  139317. // "description": "Project ID for this request.",
  139318. // "location": "path",
  139319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139320. // "required": true,
  139321. // "type": "string"
  139322. // },
  139323. // "region": {
  139324. // "description": "The region for this request.",
  139325. // "location": "path",
  139326. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  139327. // "required": true,
  139328. // "type": "string"
  139329. // },
  139330. // "requestId": {
  139331. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  139332. // "location": "query",
  139333. // "type": "string"
  139334. // },
  139335. // "resource": {
  139336. // "description": "Name or id of the resource for this request.",
  139337. // "location": "path",
  139338. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  139339. // "required": true,
  139340. // "type": "string"
  139341. // }
  139342. // },
  139343. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
  139344. // "request": {
  139345. // "$ref": "RegionSetLabelsRequest"
  139346. // },
  139347. // "response": {
  139348. // "$ref": "Operation"
  139349. // },
  139350. // "scopes": [
  139351. // "https://www.googleapis.com/auth/cloud-platform",
  139352. // "https://www.googleapis.com/auth/compute"
  139353. // ]
  139354. // }
  139355. }
  139356. // method id "compute.targetVpnGateways.testIamPermissions":
  139357. type TargetVpnGatewaysTestIamPermissionsCall struct {
  139358. s *Service
  139359. project string
  139360. region string
  139361. resource string
  139362. testpermissionsrequest *TestPermissionsRequest
  139363. urlParams_ gensupport.URLParams
  139364. ctx_ context.Context
  139365. header_ http.Header
  139366. }
  139367. // TestIamPermissions: Returns permissions that a caller has on the
  139368. // specified resource.
  139369. func (r *TargetVpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetVpnGatewaysTestIamPermissionsCall {
  139370. c := &TargetVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139371. c.project = project
  139372. c.region = region
  139373. c.resource = resource
  139374. c.testpermissionsrequest = testpermissionsrequest
  139375. return c
  139376. }
  139377. // Fields allows partial responses to be retrieved. See
  139378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139379. // for more information.
  139380. func (c *TargetVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysTestIamPermissionsCall {
  139381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139382. return c
  139383. }
  139384. // Context sets the context to be used in this call's Do method. Any
  139385. // pending HTTP request will be aborted if the provided context is
  139386. // canceled.
  139387. func (c *TargetVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *TargetVpnGatewaysTestIamPermissionsCall {
  139388. c.ctx_ = ctx
  139389. return c
  139390. }
  139391. // Header returns an http.Header that can be modified by the caller to
  139392. // add HTTP headers to the request.
  139393. func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  139394. if c.header_ == nil {
  139395. c.header_ = make(http.Header)
  139396. }
  139397. return c.header_
  139398. }
  139399. func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  139400. reqHeaders := make(http.Header)
  139401. for k, v := range c.header_ {
  139402. reqHeaders[k] = v
  139403. }
  139404. reqHeaders.Set("User-Agent", c.s.userAgent())
  139405. var body io.Reader = nil
  139406. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  139407. if err != nil {
  139408. return nil, err
  139409. }
  139410. reqHeaders.Set("Content-Type", "application/json")
  139411. c.urlParams_.Set("alt", alt)
  139412. c.urlParams_.Set("prettyPrint", "false")
  139413. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions")
  139414. urls += "?" + c.urlParams_.Encode()
  139415. req, err := http.NewRequest("POST", urls, body)
  139416. if err != nil {
  139417. return nil, err
  139418. }
  139419. req.Header = reqHeaders
  139420. googleapi.Expand(req.URL, map[string]string{
  139421. "project": c.project,
  139422. "region": c.region,
  139423. "resource": c.resource,
  139424. })
  139425. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139426. }
  139427. // Do executes the "compute.targetVpnGateways.testIamPermissions" call.
  139428. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  139429. // non-2xx status code is an error. Response headers are in either
  139430. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  139431. // returned at all) in error.(*googleapi.Error).Header. Use
  139432. // googleapi.IsNotModified to check whether the returned error was
  139433. // because http.StatusNotModified was returned.
  139434. func (c *TargetVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  139435. gensupport.SetOptions(c.urlParams_, opts...)
  139436. res, err := c.doRequest("json")
  139437. if res != nil && res.StatusCode == http.StatusNotModified {
  139438. if res.Body != nil {
  139439. res.Body.Close()
  139440. }
  139441. return nil, &googleapi.Error{
  139442. Code: res.StatusCode,
  139443. Header: res.Header,
  139444. }
  139445. }
  139446. if err != nil {
  139447. return nil, err
  139448. }
  139449. defer googleapi.CloseBody(res)
  139450. if err := googleapi.CheckResponse(res); err != nil {
  139451. return nil, err
  139452. }
  139453. ret := &TestPermissionsResponse{
  139454. ServerResponse: googleapi.ServerResponse{
  139455. Header: res.Header,
  139456. HTTPStatusCode: res.StatusCode,
  139457. },
  139458. }
  139459. target := &ret
  139460. if err := gensupport.DecodeResponse(target, res); err != nil {
  139461. return nil, err
  139462. }
  139463. return ret, nil
  139464. // {
  139465. // "description": "Returns permissions that a caller has on the specified resource.",
  139466. // "httpMethod": "POST",
  139467. // "id": "compute.targetVpnGateways.testIamPermissions",
  139468. // "parameterOrder": [
  139469. // "project",
  139470. // "region",
  139471. // "resource"
  139472. // ],
  139473. // "parameters": {
  139474. // "project": {
  139475. // "description": "Project ID for this request.",
  139476. // "location": "path",
  139477. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139478. // "required": true,
  139479. // "type": "string"
  139480. // },
  139481. // "region": {
  139482. // "description": "The name of the region for this request.",
  139483. // "location": "path",
  139484. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  139485. // "required": true,
  139486. // "type": "string"
  139487. // },
  139488. // "resource": {
  139489. // "description": "Name or id of the resource for this request.",
  139490. // "location": "path",
  139491. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  139492. // "required": true,
  139493. // "type": "string"
  139494. // }
  139495. // },
  139496. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions",
  139497. // "request": {
  139498. // "$ref": "TestPermissionsRequest"
  139499. // },
  139500. // "response": {
  139501. // "$ref": "TestPermissionsResponse"
  139502. // },
  139503. // "scopes": [
  139504. // "https://www.googleapis.com/auth/cloud-platform",
  139505. // "https://www.googleapis.com/auth/compute",
  139506. // "https://www.googleapis.com/auth/compute.readonly"
  139507. // ]
  139508. // }
  139509. }
  139510. // method id "compute.urlMaps.aggregatedList":
  139511. type UrlMapsAggregatedListCall struct {
  139512. s *Service
  139513. project string
  139514. urlParams_ gensupport.URLParams
  139515. ifNoneMatch_ string
  139516. ctx_ context.Context
  139517. header_ http.Header
  139518. }
  139519. // AggregatedList: Retrieves the list of all UrlMap resources, regional
  139520. // and global, available to the specified project.
  139521. func (r *UrlMapsService) AggregatedList(project string) *UrlMapsAggregatedListCall {
  139522. c := &UrlMapsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139523. c.project = project
  139524. return c
  139525. }
  139526. // Filter sets the optional parameter "filter": A filter expression that
  139527. // filters resources listed in the response. The expression must specify
  139528. // the field name, a comparison operator, and the value that you want to
  139529. // use for filtering. The value must be a string, a number, or a
  139530. // boolean. The comparison operator must be either =, !=, >, or <.
  139531. //
  139532. // For example, if you are filtering Compute Engine instances, you can
  139533. // exclude instances named example-instance by specifying name !=
  139534. // example-instance.
  139535. //
  139536. // You can also filter nested fields. For example, you could specify
  139537. // scheduling.automaticRestart = false to include instances only if they
  139538. // are not scheduled for automatic restarts. You can use filtering on
  139539. // nested fields to filter based on resource labels.
  139540. //
  139541. // To filter on multiple expressions, provide each separate expression
  139542. // within parentheses. For example, (scheduling.automaticRestart = true)
  139543. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  139544. // AND expression. However, you can include AND and OR expressions
  139545. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  139546. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  139547. // true).
  139548. func (c *UrlMapsAggregatedListCall) Filter(filter string) *UrlMapsAggregatedListCall {
  139549. c.urlParams_.Set("filter", filter)
  139550. return c
  139551. }
  139552. // MaxResults sets the optional parameter "maxResults": The maximum
  139553. // number of results per page that should be returned. If the number of
  139554. // available results is larger than maxResults, Compute Engine returns a
  139555. // nextPageToken that can be used to get the next page of results in
  139556. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  139557. // (Default: 500)
  139558. func (c *UrlMapsAggregatedListCall) MaxResults(maxResults int64) *UrlMapsAggregatedListCall {
  139559. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  139560. return c
  139561. }
  139562. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  139563. // a certain order. By default, results are returned in alphanumerical
  139564. // order based on the resource name.
  139565. //
  139566. // You can also sort results in descending order based on the creation
  139567. // timestamp using orderBy="creationTimestamp desc". This sorts results
  139568. // based on the creationTimestamp field in reverse chronological order
  139569. // (newest result first). Use this to sort resources like operations so
  139570. // that the newest operation is returned first.
  139571. //
  139572. // Currently, only sorting by name or creationTimestamp desc is
  139573. // supported.
  139574. func (c *UrlMapsAggregatedListCall) OrderBy(orderBy string) *UrlMapsAggregatedListCall {
  139575. c.urlParams_.Set("orderBy", orderBy)
  139576. return c
  139577. }
  139578. // PageToken sets the optional parameter "pageToken": Specifies a page
  139579. // token to use. Set pageToken to the nextPageToken returned by a
  139580. // previous list request to get the next page of results.
  139581. func (c *UrlMapsAggregatedListCall) PageToken(pageToken string) *UrlMapsAggregatedListCall {
  139582. c.urlParams_.Set("pageToken", pageToken)
  139583. return c
  139584. }
  139585. // Fields allows partial responses to be retrieved. See
  139586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139587. // for more information.
  139588. func (c *UrlMapsAggregatedListCall) Fields(s ...googleapi.Field) *UrlMapsAggregatedListCall {
  139589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139590. return c
  139591. }
  139592. // IfNoneMatch sets the optional parameter which makes the operation
  139593. // fail if the object's ETag matches the given value. This is useful for
  139594. // getting updates only after the object has changed since the last
  139595. // request. Use googleapi.IsNotModified to check whether the response
  139596. // error from Do is the result of In-None-Match.
  139597. func (c *UrlMapsAggregatedListCall) IfNoneMatch(entityTag string) *UrlMapsAggregatedListCall {
  139598. c.ifNoneMatch_ = entityTag
  139599. return c
  139600. }
  139601. // Context sets the context to be used in this call's Do method. Any
  139602. // pending HTTP request will be aborted if the provided context is
  139603. // canceled.
  139604. func (c *UrlMapsAggregatedListCall) Context(ctx context.Context) *UrlMapsAggregatedListCall {
  139605. c.ctx_ = ctx
  139606. return c
  139607. }
  139608. // Header returns an http.Header that can be modified by the caller to
  139609. // add HTTP headers to the request.
  139610. func (c *UrlMapsAggregatedListCall) Header() http.Header {
  139611. if c.header_ == nil {
  139612. c.header_ = make(http.Header)
  139613. }
  139614. return c.header_
  139615. }
  139616. func (c *UrlMapsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  139617. reqHeaders := make(http.Header)
  139618. for k, v := range c.header_ {
  139619. reqHeaders[k] = v
  139620. }
  139621. reqHeaders.Set("User-Agent", c.s.userAgent())
  139622. if c.ifNoneMatch_ != "" {
  139623. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  139624. }
  139625. var body io.Reader = nil
  139626. c.urlParams_.Set("alt", alt)
  139627. c.urlParams_.Set("prettyPrint", "false")
  139628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/urlMaps")
  139629. urls += "?" + c.urlParams_.Encode()
  139630. req, err := http.NewRequest("GET", urls, body)
  139631. if err != nil {
  139632. return nil, err
  139633. }
  139634. req.Header = reqHeaders
  139635. googleapi.Expand(req.URL, map[string]string{
  139636. "project": c.project,
  139637. })
  139638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139639. }
  139640. // Do executes the "compute.urlMaps.aggregatedList" call.
  139641. // Exactly one of *UrlMapsAggregatedList or error will be non-nil. Any
  139642. // non-2xx status code is an error. Response headers are in either
  139643. // *UrlMapsAggregatedList.ServerResponse.Header or (if a response was
  139644. // returned at all) in error.(*googleapi.Error).Header. Use
  139645. // googleapi.IsNotModified to check whether the returned error was
  139646. // because http.StatusNotModified was returned.
  139647. func (c *UrlMapsAggregatedListCall) Do(opts ...googleapi.CallOption) (*UrlMapsAggregatedList, error) {
  139648. gensupport.SetOptions(c.urlParams_, opts...)
  139649. res, err := c.doRequest("json")
  139650. if res != nil && res.StatusCode == http.StatusNotModified {
  139651. if res.Body != nil {
  139652. res.Body.Close()
  139653. }
  139654. return nil, &googleapi.Error{
  139655. Code: res.StatusCode,
  139656. Header: res.Header,
  139657. }
  139658. }
  139659. if err != nil {
  139660. return nil, err
  139661. }
  139662. defer googleapi.CloseBody(res)
  139663. if err := googleapi.CheckResponse(res); err != nil {
  139664. return nil, err
  139665. }
  139666. ret := &UrlMapsAggregatedList{
  139667. ServerResponse: googleapi.ServerResponse{
  139668. Header: res.Header,
  139669. HTTPStatusCode: res.StatusCode,
  139670. },
  139671. }
  139672. target := &ret
  139673. if err := gensupport.DecodeResponse(target, res); err != nil {
  139674. return nil, err
  139675. }
  139676. return ret, nil
  139677. // {
  139678. // "description": "Retrieves the list of all UrlMap resources, regional and global, available to the specified project.",
  139679. // "httpMethod": "GET",
  139680. // "id": "compute.urlMaps.aggregatedList",
  139681. // "parameterOrder": [
  139682. // "project"
  139683. // ],
  139684. // "parameters": {
  139685. // "filter": {
  139686. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  139687. // "location": "query",
  139688. // "type": "string"
  139689. // },
  139690. // "maxResults": {
  139691. // "default": "500",
  139692. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  139693. // "format": "uint32",
  139694. // "location": "query",
  139695. // "minimum": "0",
  139696. // "type": "integer"
  139697. // },
  139698. // "orderBy": {
  139699. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  139700. // "location": "query",
  139701. // "type": "string"
  139702. // },
  139703. // "pageToken": {
  139704. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  139705. // "location": "query",
  139706. // "type": "string"
  139707. // },
  139708. // "project": {
  139709. // "description": "Name of the project scoping this request.",
  139710. // "location": "path",
  139711. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139712. // "required": true,
  139713. // "type": "string"
  139714. // }
  139715. // },
  139716. // "path": "{project}/aggregated/urlMaps",
  139717. // "response": {
  139718. // "$ref": "UrlMapsAggregatedList"
  139719. // },
  139720. // "scopes": [
  139721. // "https://www.googleapis.com/auth/cloud-platform",
  139722. // "https://www.googleapis.com/auth/compute",
  139723. // "https://www.googleapis.com/auth/compute.readonly"
  139724. // ]
  139725. // }
  139726. }
  139727. // Pages invokes f for each page of results.
  139728. // A non-nil error returned from f will halt the iteration.
  139729. // The provided context supersedes any context provided to the Context method.
  139730. func (c *UrlMapsAggregatedListCall) Pages(ctx context.Context, f func(*UrlMapsAggregatedList) error) error {
  139731. c.ctx_ = ctx
  139732. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  139733. for {
  139734. x, err := c.Do()
  139735. if err != nil {
  139736. return err
  139737. }
  139738. if err := f(x); err != nil {
  139739. return err
  139740. }
  139741. if x.NextPageToken == "" {
  139742. return nil
  139743. }
  139744. c.PageToken(x.NextPageToken)
  139745. }
  139746. }
  139747. // method id "compute.urlMaps.delete":
  139748. type UrlMapsDeleteCall struct {
  139749. s *Service
  139750. project string
  139751. urlMap string
  139752. urlParams_ gensupport.URLParams
  139753. ctx_ context.Context
  139754. header_ http.Header
  139755. }
  139756. // Delete: Deletes the specified UrlMap resource.
  139757. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  139758. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  139759. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139760. c.project = project
  139761. c.urlMap = urlMap
  139762. return c
  139763. }
  139764. // RequestId sets the optional parameter "requestId": An optional
  139765. // request ID to identify requests. Specify a unique request ID so that
  139766. // if you must retry your request, the server will know to ignore the
  139767. // request if it has already been completed.
  139768. //
  139769. // For example, consider a situation where you make an initial request
  139770. // and the request times out. If you make the request again with the
  139771. // same request ID, the server can check if original operation with the
  139772. // same request ID was received, and if so, will ignore the second
  139773. // request. This prevents clients from accidentally creating duplicate
  139774. // commitments.
  139775. //
  139776. // The request ID must be a valid UUID with the exception that zero UUID
  139777. // is not supported (00000000-0000-0000-0000-000000000000).
  139778. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  139779. c.urlParams_.Set("requestId", requestId)
  139780. return c
  139781. }
  139782. // Fields allows partial responses to be retrieved. See
  139783. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139784. // for more information.
  139785. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  139786. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139787. return c
  139788. }
  139789. // Context sets the context to be used in this call's Do method. Any
  139790. // pending HTTP request will be aborted if the provided context is
  139791. // canceled.
  139792. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  139793. c.ctx_ = ctx
  139794. return c
  139795. }
  139796. // Header returns an http.Header that can be modified by the caller to
  139797. // add HTTP headers to the request.
  139798. func (c *UrlMapsDeleteCall) Header() http.Header {
  139799. if c.header_ == nil {
  139800. c.header_ = make(http.Header)
  139801. }
  139802. return c.header_
  139803. }
  139804. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  139805. reqHeaders := make(http.Header)
  139806. for k, v := range c.header_ {
  139807. reqHeaders[k] = v
  139808. }
  139809. reqHeaders.Set("User-Agent", c.s.userAgent())
  139810. var body io.Reader = nil
  139811. c.urlParams_.Set("alt", alt)
  139812. c.urlParams_.Set("prettyPrint", "false")
  139813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  139814. urls += "?" + c.urlParams_.Encode()
  139815. req, err := http.NewRequest("DELETE", urls, body)
  139816. if err != nil {
  139817. return nil, err
  139818. }
  139819. req.Header = reqHeaders
  139820. googleapi.Expand(req.URL, map[string]string{
  139821. "project": c.project,
  139822. "urlMap": c.urlMap,
  139823. })
  139824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139825. }
  139826. // Do executes the "compute.urlMaps.delete" call.
  139827. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  139828. // status code is an error. Response headers are in either
  139829. // *Operation.ServerResponse.Header or (if a response was returned at
  139830. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  139831. // to check whether the returned error was because
  139832. // http.StatusNotModified was returned.
  139833. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  139834. gensupport.SetOptions(c.urlParams_, opts...)
  139835. res, err := c.doRequest("json")
  139836. if res != nil && res.StatusCode == http.StatusNotModified {
  139837. if res.Body != nil {
  139838. res.Body.Close()
  139839. }
  139840. return nil, &googleapi.Error{
  139841. Code: res.StatusCode,
  139842. Header: res.Header,
  139843. }
  139844. }
  139845. if err != nil {
  139846. return nil, err
  139847. }
  139848. defer googleapi.CloseBody(res)
  139849. if err := googleapi.CheckResponse(res); err != nil {
  139850. return nil, err
  139851. }
  139852. ret := &Operation{
  139853. ServerResponse: googleapi.ServerResponse{
  139854. Header: res.Header,
  139855. HTTPStatusCode: res.StatusCode,
  139856. },
  139857. }
  139858. target := &ret
  139859. if err := gensupport.DecodeResponse(target, res); err != nil {
  139860. return nil, err
  139861. }
  139862. return ret, nil
  139863. // {
  139864. // "description": "Deletes the specified UrlMap resource.",
  139865. // "httpMethod": "DELETE",
  139866. // "id": "compute.urlMaps.delete",
  139867. // "parameterOrder": [
  139868. // "project",
  139869. // "urlMap"
  139870. // ],
  139871. // "parameters": {
  139872. // "project": {
  139873. // "description": "Project ID for this request.",
  139874. // "location": "path",
  139875. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  139876. // "required": true,
  139877. // "type": "string"
  139878. // },
  139879. // "requestId": {
  139880. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  139881. // "location": "query",
  139882. // "type": "string"
  139883. // },
  139884. // "urlMap": {
  139885. // "description": "Name of the UrlMap resource to delete.",
  139886. // "location": "path",
  139887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  139888. // "required": true,
  139889. // "type": "string"
  139890. // }
  139891. // },
  139892. // "path": "{project}/global/urlMaps/{urlMap}",
  139893. // "response": {
  139894. // "$ref": "Operation"
  139895. // },
  139896. // "scopes": [
  139897. // "https://www.googleapis.com/auth/cloud-platform",
  139898. // "https://www.googleapis.com/auth/compute"
  139899. // ]
  139900. // }
  139901. }
  139902. // method id "compute.urlMaps.get":
  139903. type UrlMapsGetCall struct {
  139904. s *Service
  139905. project string
  139906. urlMap string
  139907. urlParams_ gensupport.URLParams
  139908. ifNoneMatch_ string
  139909. ctx_ context.Context
  139910. header_ http.Header
  139911. }
  139912. // Get: Returns the specified UrlMap resource. Gets a list of available
  139913. // URL maps by making a list() request.
  139914. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  139915. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  139916. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  139917. c.project = project
  139918. c.urlMap = urlMap
  139919. return c
  139920. }
  139921. // Fields allows partial responses to be retrieved. See
  139922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  139923. // for more information.
  139924. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  139925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  139926. return c
  139927. }
  139928. // IfNoneMatch sets the optional parameter which makes the operation
  139929. // fail if the object's ETag matches the given value. This is useful for
  139930. // getting updates only after the object has changed since the last
  139931. // request. Use googleapi.IsNotModified to check whether the response
  139932. // error from Do is the result of In-None-Match.
  139933. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  139934. c.ifNoneMatch_ = entityTag
  139935. return c
  139936. }
  139937. // Context sets the context to be used in this call's Do method. Any
  139938. // pending HTTP request will be aborted if the provided context is
  139939. // canceled.
  139940. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  139941. c.ctx_ = ctx
  139942. return c
  139943. }
  139944. // Header returns an http.Header that can be modified by the caller to
  139945. // add HTTP headers to the request.
  139946. func (c *UrlMapsGetCall) Header() http.Header {
  139947. if c.header_ == nil {
  139948. c.header_ = make(http.Header)
  139949. }
  139950. return c.header_
  139951. }
  139952. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  139953. reqHeaders := make(http.Header)
  139954. for k, v := range c.header_ {
  139955. reqHeaders[k] = v
  139956. }
  139957. reqHeaders.Set("User-Agent", c.s.userAgent())
  139958. if c.ifNoneMatch_ != "" {
  139959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  139960. }
  139961. var body io.Reader = nil
  139962. c.urlParams_.Set("alt", alt)
  139963. c.urlParams_.Set("prettyPrint", "false")
  139964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  139965. urls += "?" + c.urlParams_.Encode()
  139966. req, err := http.NewRequest("GET", urls, body)
  139967. if err != nil {
  139968. return nil, err
  139969. }
  139970. req.Header = reqHeaders
  139971. googleapi.Expand(req.URL, map[string]string{
  139972. "project": c.project,
  139973. "urlMap": c.urlMap,
  139974. })
  139975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  139976. }
  139977. // Do executes the "compute.urlMaps.get" call.
  139978. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  139979. // code is an error. Response headers are in either
  139980. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  139981. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  139982. // check whether the returned error was because http.StatusNotModified
  139983. // was returned.
  139984. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  139985. gensupport.SetOptions(c.urlParams_, opts...)
  139986. res, err := c.doRequest("json")
  139987. if res != nil && res.StatusCode == http.StatusNotModified {
  139988. if res.Body != nil {
  139989. res.Body.Close()
  139990. }
  139991. return nil, &googleapi.Error{
  139992. Code: res.StatusCode,
  139993. Header: res.Header,
  139994. }
  139995. }
  139996. if err != nil {
  139997. return nil, err
  139998. }
  139999. defer googleapi.CloseBody(res)
  140000. if err := googleapi.CheckResponse(res); err != nil {
  140001. return nil, err
  140002. }
  140003. ret := &UrlMap{
  140004. ServerResponse: googleapi.ServerResponse{
  140005. Header: res.Header,
  140006. HTTPStatusCode: res.StatusCode,
  140007. },
  140008. }
  140009. target := &ret
  140010. if err := gensupport.DecodeResponse(target, res); err != nil {
  140011. return nil, err
  140012. }
  140013. return ret, nil
  140014. // {
  140015. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  140016. // "httpMethod": "GET",
  140017. // "id": "compute.urlMaps.get",
  140018. // "parameterOrder": [
  140019. // "project",
  140020. // "urlMap"
  140021. // ],
  140022. // "parameters": {
  140023. // "project": {
  140024. // "description": "Project ID for this request.",
  140025. // "location": "path",
  140026. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140027. // "required": true,
  140028. // "type": "string"
  140029. // },
  140030. // "urlMap": {
  140031. // "description": "Name of the UrlMap resource to return.",
  140032. // "location": "path",
  140033. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  140034. // "required": true,
  140035. // "type": "string"
  140036. // }
  140037. // },
  140038. // "path": "{project}/global/urlMaps/{urlMap}",
  140039. // "response": {
  140040. // "$ref": "UrlMap"
  140041. // },
  140042. // "scopes": [
  140043. // "https://www.googleapis.com/auth/cloud-platform",
  140044. // "https://www.googleapis.com/auth/compute",
  140045. // "https://www.googleapis.com/auth/compute.readonly"
  140046. // ]
  140047. // }
  140048. }
  140049. // method id "compute.urlMaps.insert":
  140050. type UrlMapsInsertCall struct {
  140051. s *Service
  140052. project string
  140053. urlmap *UrlMap
  140054. urlParams_ gensupport.URLParams
  140055. ctx_ context.Context
  140056. header_ http.Header
  140057. }
  140058. // Insert: Creates a UrlMap resource in the specified project using the
  140059. // data included in the request.
  140060. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  140061. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  140062. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140063. c.project = project
  140064. c.urlmap = urlmap
  140065. return c
  140066. }
  140067. // RequestId sets the optional parameter "requestId": An optional
  140068. // request ID to identify requests. Specify a unique request ID so that
  140069. // if you must retry your request, the server will know to ignore the
  140070. // request if it has already been completed.
  140071. //
  140072. // For example, consider a situation where you make an initial request
  140073. // and the request times out. If you make the request again with the
  140074. // same request ID, the server can check if original operation with the
  140075. // same request ID was received, and if so, will ignore the second
  140076. // request. This prevents clients from accidentally creating duplicate
  140077. // commitments.
  140078. //
  140079. // The request ID must be a valid UUID with the exception that zero UUID
  140080. // is not supported (00000000-0000-0000-0000-000000000000).
  140081. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  140082. c.urlParams_.Set("requestId", requestId)
  140083. return c
  140084. }
  140085. // Fields allows partial responses to be retrieved. See
  140086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140087. // for more information.
  140088. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  140089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140090. return c
  140091. }
  140092. // Context sets the context to be used in this call's Do method. Any
  140093. // pending HTTP request will be aborted if the provided context is
  140094. // canceled.
  140095. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  140096. c.ctx_ = ctx
  140097. return c
  140098. }
  140099. // Header returns an http.Header that can be modified by the caller to
  140100. // add HTTP headers to the request.
  140101. func (c *UrlMapsInsertCall) Header() http.Header {
  140102. if c.header_ == nil {
  140103. c.header_ = make(http.Header)
  140104. }
  140105. return c.header_
  140106. }
  140107. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  140108. reqHeaders := make(http.Header)
  140109. for k, v := range c.header_ {
  140110. reqHeaders[k] = v
  140111. }
  140112. reqHeaders.Set("User-Agent", c.s.userAgent())
  140113. var body io.Reader = nil
  140114. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  140115. if err != nil {
  140116. return nil, err
  140117. }
  140118. reqHeaders.Set("Content-Type", "application/json")
  140119. c.urlParams_.Set("alt", alt)
  140120. c.urlParams_.Set("prettyPrint", "false")
  140121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  140122. urls += "?" + c.urlParams_.Encode()
  140123. req, err := http.NewRequest("POST", urls, body)
  140124. if err != nil {
  140125. return nil, err
  140126. }
  140127. req.Header = reqHeaders
  140128. googleapi.Expand(req.URL, map[string]string{
  140129. "project": c.project,
  140130. })
  140131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140132. }
  140133. // Do executes the "compute.urlMaps.insert" call.
  140134. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  140135. // status code is an error. Response headers are in either
  140136. // *Operation.ServerResponse.Header or (if a response was returned at
  140137. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  140138. // to check whether the returned error was because
  140139. // http.StatusNotModified was returned.
  140140. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  140141. gensupport.SetOptions(c.urlParams_, opts...)
  140142. res, err := c.doRequest("json")
  140143. if res != nil && res.StatusCode == http.StatusNotModified {
  140144. if res.Body != nil {
  140145. res.Body.Close()
  140146. }
  140147. return nil, &googleapi.Error{
  140148. Code: res.StatusCode,
  140149. Header: res.Header,
  140150. }
  140151. }
  140152. if err != nil {
  140153. return nil, err
  140154. }
  140155. defer googleapi.CloseBody(res)
  140156. if err := googleapi.CheckResponse(res); err != nil {
  140157. return nil, err
  140158. }
  140159. ret := &Operation{
  140160. ServerResponse: googleapi.ServerResponse{
  140161. Header: res.Header,
  140162. HTTPStatusCode: res.StatusCode,
  140163. },
  140164. }
  140165. target := &ret
  140166. if err := gensupport.DecodeResponse(target, res); err != nil {
  140167. return nil, err
  140168. }
  140169. return ret, nil
  140170. // {
  140171. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  140172. // "httpMethod": "POST",
  140173. // "id": "compute.urlMaps.insert",
  140174. // "parameterOrder": [
  140175. // "project"
  140176. // ],
  140177. // "parameters": {
  140178. // "project": {
  140179. // "description": "Project ID for this request.",
  140180. // "location": "path",
  140181. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140182. // "required": true,
  140183. // "type": "string"
  140184. // },
  140185. // "requestId": {
  140186. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  140187. // "location": "query",
  140188. // "type": "string"
  140189. // }
  140190. // },
  140191. // "path": "{project}/global/urlMaps",
  140192. // "request": {
  140193. // "$ref": "UrlMap"
  140194. // },
  140195. // "response": {
  140196. // "$ref": "Operation"
  140197. // },
  140198. // "scopes": [
  140199. // "https://www.googleapis.com/auth/cloud-platform",
  140200. // "https://www.googleapis.com/auth/compute"
  140201. // ]
  140202. // }
  140203. }
  140204. // method id "compute.urlMaps.invalidateCache":
  140205. type UrlMapsInvalidateCacheCall struct {
  140206. s *Service
  140207. project string
  140208. urlMap string
  140209. cacheinvalidationrule *CacheInvalidationRule
  140210. urlParams_ gensupport.URLParams
  140211. ctx_ context.Context
  140212. header_ http.Header
  140213. }
  140214. // InvalidateCache: Initiates a cache invalidation operation,
  140215. // invalidating the specified path, scoped to the specified UrlMap.
  140216. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  140217. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140218. c.project = project
  140219. c.urlMap = urlMap
  140220. c.cacheinvalidationrule = cacheinvalidationrule
  140221. return c
  140222. }
  140223. // RequestId sets the optional parameter "requestId": An optional
  140224. // request ID to identify requests. Specify a unique request ID so that
  140225. // if you must retry your request, the server will know to ignore the
  140226. // request if it has already been completed.
  140227. //
  140228. // For example, consider a situation where you make an initial request
  140229. // and the request times out. If you make the request again with the
  140230. // same request ID, the server can check if original operation with the
  140231. // same request ID was received, and if so, will ignore the second
  140232. // request. This prevents clients from accidentally creating duplicate
  140233. // commitments.
  140234. //
  140235. // The request ID must be a valid UUID with the exception that zero UUID
  140236. // is not supported (00000000-0000-0000-0000-000000000000).
  140237. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  140238. c.urlParams_.Set("requestId", requestId)
  140239. return c
  140240. }
  140241. // Fields allows partial responses to be retrieved. See
  140242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140243. // for more information.
  140244. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  140245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140246. return c
  140247. }
  140248. // Context sets the context to be used in this call's Do method. Any
  140249. // pending HTTP request will be aborted if the provided context is
  140250. // canceled.
  140251. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  140252. c.ctx_ = ctx
  140253. return c
  140254. }
  140255. // Header returns an http.Header that can be modified by the caller to
  140256. // add HTTP headers to the request.
  140257. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  140258. if c.header_ == nil {
  140259. c.header_ = make(http.Header)
  140260. }
  140261. return c.header_
  140262. }
  140263. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  140264. reqHeaders := make(http.Header)
  140265. for k, v := range c.header_ {
  140266. reqHeaders[k] = v
  140267. }
  140268. reqHeaders.Set("User-Agent", c.s.userAgent())
  140269. var body io.Reader = nil
  140270. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  140271. if err != nil {
  140272. return nil, err
  140273. }
  140274. reqHeaders.Set("Content-Type", "application/json")
  140275. c.urlParams_.Set("alt", alt)
  140276. c.urlParams_.Set("prettyPrint", "false")
  140277. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  140278. urls += "?" + c.urlParams_.Encode()
  140279. req, err := http.NewRequest("POST", urls, body)
  140280. if err != nil {
  140281. return nil, err
  140282. }
  140283. req.Header = reqHeaders
  140284. googleapi.Expand(req.URL, map[string]string{
  140285. "project": c.project,
  140286. "urlMap": c.urlMap,
  140287. })
  140288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140289. }
  140290. // Do executes the "compute.urlMaps.invalidateCache" call.
  140291. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  140292. // status code is an error. Response headers are in either
  140293. // *Operation.ServerResponse.Header or (if a response was returned at
  140294. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  140295. // to check whether the returned error was because
  140296. // http.StatusNotModified was returned.
  140297. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  140298. gensupport.SetOptions(c.urlParams_, opts...)
  140299. res, err := c.doRequest("json")
  140300. if res != nil && res.StatusCode == http.StatusNotModified {
  140301. if res.Body != nil {
  140302. res.Body.Close()
  140303. }
  140304. return nil, &googleapi.Error{
  140305. Code: res.StatusCode,
  140306. Header: res.Header,
  140307. }
  140308. }
  140309. if err != nil {
  140310. return nil, err
  140311. }
  140312. defer googleapi.CloseBody(res)
  140313. if err := googleapi.CheckResponse(res); err != nil {
  140314. return nil, err
  140315. }
  140316. ret := &Operation{
  140317. ServerResponse: googleapi.ServerResponse{
  140318. Header: res.Header,
  140319. HTTPStatusCode: res.StatusCode,
  140320. },
  140321. }
  140322. target := &ret
  140323. if err := gensupport.DecodeResponse(target, res); err != nil {
  140324. return nil, err
  140325. }
  140326. return ret, nil
  140327. // {
  140328. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  140329. // "httpMethod": "POST",
  140330. // "id": "compute.urlMaps.invalidateCache",
  140331. // "parameterOrder": [
  140332. // "project",
  140333. // "urlMap"
  140334. // ],
  140335. // "parameters": {
  140336. // "project": {
  140337. // "description": "Project ID for this request.",
  140338. // "location": "path",
  140339. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140340. // "required": true,
  140341. // "type": "string"
  140342. // },
  140343. // "requestId": {
  140344. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  140345. // "location": "query",
  140346. // "type": "string"
  140347. // },
  140348. // "urlMap": {
  140349. // "description": "Name of the UrlMap scoping this request.",
  140350. // "location": "path",
  140351. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  140352. // "required": true,
  140353. // "type": "string"
  140354. // }
  140355. // },
  140356. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  140357. // "request": {
  140358. // "$ref": "CacheInvalidationRule"
  140359. // },
  140360. // "response": {
  140361. // "$ref": "Operation"
  140362. // },
  140363. // "scopes": [
  140364. // "https://www.googleapis.com/auth/cloud-platform",
  140365. // "https://www.googleapis.com/auth/compute"
  140366. // ]
  140367. // }
  140368. }
  140369. // method id "compute.urlMaps.list":
  140370. type UrlMapsListCall struct {
  140371. s *Service
  140372. project string
  140373. urlParams_ gensupport.URLParams
  140374. ifNoneMatch_ string
  140375. ctx_ context.Context
  140376. header_ http.Header
  140377. }
  140378. // List: Retrieves the list of UrlMap resources available to the
  140379. // specified project.
  140380. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  140381. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  140382. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140383. c.project = project
  140384. return c
  140385. }
  140386. // Filter sets the optional parameter "filter": A filter expression that
  140387. // filters resources listed in the response. The expression must specify
  140388. // the field name, a comparison operator, and the value that you want to
  140389. // use for filtering. The value must be a string, a number, or a
  140390. // boolean. The comparison operator must be either =, !=, >, or <.
  140391. //
  140392. // For example, if you are filtering Compute Engine instances, you can
  140393. // exclude instances named example-instance by specifying name !=
  140394. // example-instance.
  140395. //
  140396. // You can also filter nested fields. For example, you could specify
  140397. // scheduling.automaticRestart = false to include instances only if they
  140398. // are not scheduled for automatic restarts. You can use filtering on
  140399. // nested fields to filter based on resource labels.
  140400. //
  140401. // To filter on multiple expressions, provide each separate expression
  140402. // within parentheses. For example, (scheduling.automaticRestart = true)
  140403. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  140404. // AND expression. However, you can include AND and OR expressions
  140405. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  140406. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  140407. // true).
  140408. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  140409. c.urlParams_.Set("filter", filter)
  140410. return c
  140411. }
  140412. // MaxResults sets the optional parameter "maxResults": The maximum
  140413. // number of results per page that should be returned. If the number of
  140414. // available results is larger than maxResults, Compute Engine returns a
  140415. // nextPageToken that can be used to get the next page of results in
  140416. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  140417. // (Default: 500)
  140418. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  140419. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  140420. return c
  140421. }
  140422. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  140423. // a certain order. By default, results are returned in alphanumerical
  140424. // order based on the resource name.
  140425. //
  140426. // You can also sort results in descending order based on the creation
  140427. // timestamp using orderBy="creationTimestamp desc". This sorts results
  140428. // based on the creationTimestamp field in reverse chronological order
  140429. // (newest result first). Use this to sort resources like operations so
  140430. // that the newest operation is returned first.
  140431. //
  140432. // Currently, only sorting by name or creationTimestamp desc is
  140433. // supported.
  140434. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  140435. c.urlParams_.Set("orderBy", orderBy)
  140436. return c
  140437. }
  140438. // PageToken sets the optional parameter "pageToken": Specifies a page
  140439. // token to use. Set pageToken to the nextPageToken returned by a
  140440. // previous list request to get the next page of results.
  140441. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  140442. c.urlParams_.Set("pageToken", pageToken)
  140443. return c
  140444. }
  140445. // Fields allows partial responses to be retrieved. See
  140446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140447. // for more information.
  140448. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  140449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140450. return c
  140451. }
  140452. // IfNoneMatch sets the optional parameter which makes the operation
  140453. // fail if the object's ETag matches the given value. This is useful for
  140454. // getting updates only after the object has changed since the last
  140455. // request. Use googleapi.IsNotModified to check whether the response
  140456. // error from Do is the result of In-None-Match.
  140457. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  140458. c.ifNoneMatch_ = entityTag
  140459. return c
  140460. }
  140461. // Context sets the context to be used in this call's Do method. Any
  140462. // pending HTTP request will be aborted if the provided context is
  140463. // canceled.
  140464. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  140465. c.ctx_ = ctx
  140466. return c
  140467. }
  140468. // Header returns an http.Header that can be modified by the caller to
  140469. // add HTTP headers to the request.
  140470. func (c *UrlMapsListCall) Header() http.Header {
  140471. if c.header_ == nil {
  140472. c.header_ = make(http.Header)
  140473. }
  140474. return c.header_
  140475. }
  140476. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  140477. reqHeaders := make(http.Header)
  140478. for k, v := range c.header_ {
  140479. reqHeaders[k] = v
  140480. }
  140481. reqHeaders.Set("User-Agent", c.s.userAgent())
  140482. if c.ifNoneMatch_ != "" {
  140483. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  140484. }
  140485. var body io.Reader = nil
  140486. c.urlParams_.Set("alt", alt)
  140487. c.urlParams_.Set("prettyPrint", "false")
  140488. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  140489. urls += "?" + c.urlParams_.Encode()
  140490. req, err := http.NewRequest("GET", urls, body)
  140491. if err != nil {
  140492. return nil, err
  140493. }
  140494. req.Header = reqHeaders
  140495. googleapi.Expand(req.URL, map[string]string{
  140496. "project": c.project,
  140497. })
  140498. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140499. }
  140500. // Do executes the "compute.urlMaps.list" call.
  140501. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  140502. // status code is an error. Response headers are in either
  140503. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  140504. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  140505. // to check whether the returned error was because
  140506. // http.StatusNotModified was returned.
  140507. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  140508. gensupport.SetOptions(c.urlParams_, opts...)
  140509. res, err := c.doRequest("json")
  140510. if res != nil && res.StatusCode == http.StatusNotModified {
  140511. if res.Body != nil {
  140512. res.Body.Close()
  140513. }
  140514. return nil, &googleapi.Error{
  140515. Code: res.StatusCode,
  140516. Header: res.Header,
  140517. }
  140518. }
  140519. if err != nil {
  140520. return nil, err
  140521. }
  140522. defer googleapi.CloseBody(res)
  140523. if err := googleapi.CheckResponse(res); err != nil {
  140524. return nil, err
  140525. }
  140526. ret := &UrlMapList{
  140527. ServerResponse: googleapi.ServerResponse{
  140528. Header: res.Header,
  140529. HTTPStatusCode: res.StatusCode,
  140530. },
  140531. }
  140532. target := &ret
  140533. if err := gensupport.DecodeResponse(target, res); err != nil {
  140534. return nil, err
  140535. }
  140536. return ret, nil
  140537. // {
  140538. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  140539. // "httpMethod": "GET",
  140540. // "id": "compute.urlMaps.list",
  140541. // "parameterOrder": [
  140542. // "project"
  140543. // ],
  140544. // "parameters": {
  140545. // "filter": {
  140546. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  140547. // "location": "query",
  140548. // "type": "string"
  140549. // },
  140550. // "maxResults": {
  140551. // "default": "500",
  140552. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  140553. // "format": "uint32",
  140554. // "location": "query",
  140555. // "minimum": "0",
  140556. // "type": "integer"
  140557. // },
  140558. // "orderBy": {
  140559. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  140560. // "location": "query",
  140561. // "type": "string"
  140562. // },
  140563. // "pageToken": {
  140564. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  140565. // "location": "query",
  140566. // "type": "string"
  140567. // },
  140568. // "project": {
  140569. // "description": "Project ID for this request.",
  140570. // "location": "path",
  140571. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140572. // "required": true,
  140573. // "type": "string"
  140574. // }
  140575. // },
  140576. // "path": "{project}/global/urlMaps",
  140577. // "response": {
  140578. // "$ref": "UrlMapList"
  140579. // },
  140580. // "scopes": [
  140581. // "https://www.googleapis.com/auth/cloud-platform",
  140582. // "https://www.googleapis.com/auth/compute",
  140583. // "https://www.googleapis.com/auth/compute.readonly"
  140584. // ]
  140585. // }
  140586. }
  140587. // Pages invokes f for each page of results.
  140588. // A non-nil error returned from f will halt the iteration.
  140589. // The provided context supersedes any context provided to the Context method.
  140590. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  140591. c.ctx_ = ctx
  140592. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  140593. for {
  140594. x, err := c.Do()
  140595. if err != nil {
  140596. return err
  140597. }
  140598. if err := f(x); err != nil {
  140599. return err
  140600. }
  140601. if x.NextPageToken == "" {
  140602. return nil
  140603. }
  140604. c.PageToken(x.NextPageToken)
  140605. }
  140606. }
  140607. // method id "compute.urlMaps.patch":
  140608. type UrlMapsPatchCall struct {
  140609. s *Service
  140610. project string
  140611. urlMap string
  140612. urlmap *UrlMap
  140613. urlParams_ gensupport.URLParams
  140614. ctx_ context.Context
  140615. header_ http.Header
  140616. }
  140617. // Patch: Patches the specified UrlMap resource with the data included
  140618. // in the request. This method supports PATCH semantics and uses the
  140619. // JSON merge patch format and processing rules.
  140620. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  140621. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  140622. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140623. c.project = project
  140624. c.urlMap = urlMap
  140625. c.urlmap = urlmap
  140626. return c
  140627. }
  140628. // RequestId sets the optional parameter "requestId": An optional
  140629. // request ID to identify requests. Specify a unique request ID so that
  140630. // if you must retry your request, the server will know to ignore the
  140631. // request if it has already been completed.
  140632. //
  140633. // For example, consider a situation where you make an initial request
  140634. // and the request times out. If you make the request again with the
  140635. // same request ID, the server can check if original operation with the
  140636. // same request ID was received, and if so, will ignore the second
  140637. // request. This prevents clients from accidentally creating duplicate
  140638. // commitments.
  140639. //
  140640. // The request ID must be a valid UUID with the exception that zero UUID
  140641. // is not supported (00000000-0000-0000-0000-000000000000).
  140642. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  140643. c.urlParams_.Set("requestId", requestId)
  140644. return c
  140645. }
  140646. // Fields allows partial responses to be retrieved. See
  140647. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140648. // for more information.
  140649. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  140650. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140651. return c
  140652. }
  140653. // Context sets the context to be used in this call's Do method. Any
  140654. // pending HTTP request will be aborted if the provided context is
  140655. // canceled.
  140656. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  140657. c.ctx_ = ctx
  140658. return c
  140659. }
  140660. // Header returns an http.Header that can be modified by the caller to
  140661. // add HTTP headers to the request.
  140662. func (c *UrlMapsPatchCall) Header() http.Header {
  140663. if c.header_ == nil {
  140664. c.header_ = make(http.Header)
  140665. }
  140666. return c.header_
  140667. }
  140668. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  140669. reqHeaders := make(http.Header)
  140670. for k, v := range c.header_ {
  140671. reqHeaders[k] = v
  140672. }
  140673. reqHeaders.Set("User-Agent", c.s.userAgent())
  140674. var body io.Reader = nil
  140675. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  140676. if err != nil {
  140677. return nil, err
  140678. }
  140679. reqHeaders.Set("Content-Type", "application/json")
  140680. c.urlParams_.Set("alt", alt)
  140681. c.urlParams_.Set("prettyPrint", "false")
  140682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  140683. urls += "?" + c.urlParams_.Encode()
  140684. req, err := http.NewRequest("PATCH", urls, body)
  140685. if err != nil {
  140686. return nil, err
  140687. }
  140688. req.Header = reqHeaders
  140689. googleapi.Expand(req.URL, map[string]string{
  140690. "project": c.project,
  140691. "urlMap": c.urlMap,
  140692. })
  140693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140694. }
  140695. // Do executes the "compute.urlMaps.patch" call.
  140696. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  140697. // status code is an error. Response headers are in either
  140698. // *Operation.ServerResponse.Header or (if a response was returned at
  140699. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  140700. // to check whether the returned error was because
  140701. // http.StatusNotModified was returned.
  140702. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  140703. gensupport.SetOptions(c.urlParams_, opts...)
  140704. res, err := c.doRequest("json")
  140705. if res != nil && res.StatusCode == http.StatusNotModified {
  140706. if res.Body != nil {
  140707. res.Body.Close()
  140708. }
  140709. return nil, &googleapi.Error{
  140710. Code: res.StatusCode,
  140711. Header: res.Header,
  140712. }
  140713. }
  140714. if err != nil {
  140715. return nil, err
  140716. }
  140717. defer googleapi.CloseBody(res)
  140718. if err := googleapi.CheckResponse(res); err != nil {
  140719. return nil, err
  140720. }
  140721. ret := &Operation{
  140722. ServerResponse: googleapi.ServerResponse{
  140723. Header: res.Header,
  140724. HTTPStatusCode: res.StatusCode,
  140725. },
  140726. }
  140727. target := &ret
  140728. if err := gensupport.DecodeResponse(target, res); err != nil {
  140729. return nil, err
  140730. }
  140731. return ret, nil
  140732. // {
  140733. // "description": "Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  140734. // "httpMethod": "PATCH",
  140735. // "id": "compute.urlMaps.patch",
  140736. // "parameterOrder": [
  140737. // "project",
  140738. // "urlMap"
  140739. // ],
  140740. // "parameters": {
  140741. // "project": {
  140742. // "description": "Project ID for this request.",
  140743. // "location": "path",
  140744. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140745. // "required": true,
  140746. // "type": "string"
  140747. // },
  140748. // "requestId": {
  140749. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  140750. // "location": "query",
  140751. // "type": "string"
  140752. // },
  140753. // "urlMap": {
  140754. // "description": "Name of the UrlMap resource to patch.",
  140755. // "location": "path",
  140756. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  140757. // "required": true,
  140758. // "type": "string"
  140759. // }
  140760. // },
  140761. // "path": "{project}/global/urlMaps/{urlMap}",
  140762. // "request": {
  140763. // "$ref": "UrlMap"
  140764. // },
  140765. // "response": {
  140766. // "$ref": "Operation"
  140767. // },
  140768. // "scopes": [
  140769. // "https://www.googleapis.com/auth/cloud-platform",
  140770. // "https://www.googleapis.com/auth/compute"
  140771. // ]
  140772. // }
  140773. }
  140774. // method id "compute.urlMaps.testIamPermissions":
  140775. type UrlMapsTestIamPermissionsCall struct {
  140776. s *Service
  140777. project string
  140778. resource string
  140779. testpermissionsrequest *TestPermissionsRequest
  140780. urlParams_ gensupport.URLParams
  140781. ctx_ context.Context
  140782. header_ http.Header
  140783. }
  140784. // TestIamPermissions: Returns permissions that a caller has on the
  140785. // specified resource.
  140786. func (r *UrlMapsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UrlMapsTestIamPermissionsCall {
  140787. c := &UrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140788. c.project = project
  140789. c.resource = resource
  140790. c.testpermissionsrequest = testpermissionsrequest
  140791. return c
  140792. }
  140793. // Fields allows partial responses to be retrieved. See
  140794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140795. // for more information.
  140796. func (c *UrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *UrlMapsTestIamPermissionsCall {
  140797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140798. return c
  140799. }
  140800. // Context sets the context to be used in this call's Do method. Any
  140801. // pending HTTP request will be aborted if the provided context is
  140802. // canceled.
  140803. func (c *UrlMapsTestIamPermissionsCall) Context(ctx context.Context) *UrlMapsTestIamPermissionsCall {
  140804. c.ctx_ = ctx
  140805. return c
  140806. }
  140807. // Header returns an http.Header that can be modified by the caller to
  140808. // add HTTP headers to the request.
  140809. func (c *UrlMapsTestIamPermissionsCall) Header() http.Header {
  140810. if c.header_ == nil {
  140811. c.header_ = make(http.Header)
  140812. }
  140813. return c.header_
  140814. }
  140815. func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  140816. reqHeaders := make(http.Header)
  140817. for k, v := range c.header_ {
  140818. reqHeaders[k] = v
  140819. }
  140820. reqHeaders.Set("User-Agent", c.s.userAgent())
  140821. var body io.Reader = nil
  140822. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  140823. if err != nil {
  140824. return nil, err
  140825. }
  140826. reqHeaders.Set("Content-Type", "application/json")
  140827. c.urlParams_.Set("alt", alt)
  140828. c.urlParams_.Set("prettyPrint", "false")
  140829. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{resource}/testIamPermissions")
  140830. urls += "?" + c.urlParams_.Encode()
  140831. req, err := http.NewRequest("POST", urls, body)
  140832. if err != nil {
  140833. return nil, err
  140834. }
  140835. req.Header = reqHeaders
  140836. googleapi.Expand(req.URL, map[string]string{
  140837. "project": c.project,
  140838. "resource": c.resource,
  140839. })
  140840. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  140841. }
  140842. // Do executes the "compute.urlMaps.testIamPermissions" call.
  140843. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  140844. // non-2xx status code is an error. Response headers are in either
  140845. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  140846. // returned at all) in error.(*googleapi.Error).Header. Use
  140847. // googleapi.IsNotModified to check whether the returned error was
  140848. // because http.StatusNotModified was returned.
  140849. func (c *UrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  140850. gensupport.SetOptions(c.urlParams_, opts...)
  140851. res, err := c.doRequest("json")
  140852. if res != nil && res.StatusCode == http.StatusNotModified {
  140853. if res.Body != nil {
  140854. res.Body.Close()
  140855. }
  140856. return nil, &googleapi.Error{
  140857. Code: res.StatusCode,
  140858. Header: res.Header,
  140859. }
  140860. }
  140861. if err != nil {
  140862. return nil, err
  140863. }
  140864. defer googleapi.CloseBody(res)
  140865. if err := googleapi.CheckResponse(res); err != nil {
  140866. return nil, err
  140867. }
  140868. ret := &TestPermissionsResponse{
  140869. ServerResponse: googleapi.ServerResponse{
  140870. Header: res.Header,
  140871. HTTPStatusCode: res.StatusCode,
  140872. },
  140873. }
  140874. target := &ret
  140875. if err := gensupport.DecodeResponse(target, res); err != nil {
  140876. return nil, err
  140877. }
  140878. return ret, nil
  140879. // {
  140880. // "description": "Returns permissions that a caller has on the specified resource.",
  140881. // "httpMethod": "POST",
  140882. // "id": "compute.urlMaps.testIamPermissions",
  140883. // "parameterOrder": [
  140884. // "project",
  140885. // "resource"
  140886. // ],
  140887. // "parameters": {
  140888. // "project": {
  140889. // "description": "Project ID for this request.",
  140890. // "location": "path",
  140891. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  140892. // "required": true,
  140893. // "type": "string"
  140894. // },
  140895. // "resource": {
  140896. // "description": "Name or id of the resource for this request.",
  140897. // "location": "path",
  140898. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  140899. // "required": true,
  140900. // "type": "string"
  140901. // }
  140902. // },
  140903. // "path": "{project}/global/urlMaps/{resource}/testIamPermissions",
  140904. // "request": {
  140905. // "$ref": "TestPermissionsRequest"
  140906. // },
  140907. // "response": {
  140908. // "$ref": "TestPermissionsResponse"
  140909. // },
  140910. // "scopes": [
  140911. // "https://www.googleapis.com/auth/cloud-platform",
  140912. // "https://www.googleapis.com/auth/compute",
  140913. // "https://www.googleapis.com/auth/compute.readonly"
  140914. // ]
  140915. // }
  140916. }
  140917. // method id "compute.urlMaps.update":
  140918. type UrlMapsUpdateCall struct {
  140919. s *Service
  140920. project string
  140921. urlMap string
  140922. urlmap *UrlMap
  140923. urlParams_ gensupport.URLParams
  140924. ctx_ context.Context
  140925. header_ http.Header
  140926. }
  140927. // Update: Updates the specified UrlMap resource with the data included
  140928. // in the request.
  140929. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  140930. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  140931. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  140932. c.project = project
  140933. c.urlMap = urlMap
  140934. c.urlmap = urlmap
  140935. return c
  140936. }
  140937. // RequestId sets the optional parameter "requestId": An optional
  140938. // request ID to identify requests. Specify a unique request ID so that
  140939. // if you must retry your request, the server will know to ignore the
  140940. // request if it has already been completed.
  140941. //
  140942. // For example, consider a situation where you make an initial request
  140943. // and the request times out. If you make the request again with the
  140944. // same request ID, the server can check if original operation with the
  140945. // same request ID was received, and if so, will ignore the second
  140946. // request. This prevents clients from accidentally creating duplicate
  140947. // commitments.
  140948. //
  140949. // The request ID must be a valid UUID with the exception that zero UUID
  140950. // is not supported (00000000-0000-0000-0000-000000000000).
  140951. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  140952. c.urlParams_.Set("requestId", requestId)
  140953. return c
  140954. }
  140955. // Fields allows partial responses to be retrieved. See
  140956. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  140957. // for more information.
  140958. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  140959. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  140960. return c
  140961. }
  140962. // Context sets the context to be used in this call's Do method. Any
  140963. // pending HTTP request will be aborted if the provided context is
  140964. // canceled.
  140965. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  140966. c.ctx_ = ctx
  140967. return c
  140968. }
  140969. // Header returns an http.Header that can be modified by the caller to
  140970. // add HTTP headers to the request.
  140971. func (c *UrlMapsUpdateCall) Header() http.Header {
  140972. if c.header_ == nil {
  140973. c.header_ = make(http.Header)
  140974. }
  140975. return c.header_
  140976. }
  140977. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  140978. reqHeaders := make(http.Header)
  140979. for k, v := range c.header_ {
  140980. reqHeaders[k] = v
  140981. }
  140982. reqHeaders.Set("User-Agent", c.s.userAgent())
  140983. var body io.Reader = nil
  140984. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  140985. if err != nil {
  140986. return nil, err
  140987. }
  140988. reqHeaders.Set("Content-Type", "application/json")
  140989. c.urlParams_.Set("alt", alt)
  140990. c.urlParams_.Set("prettyPrint", "false")
  140991. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  140992. urls += "?" + c.urlParams_.Encode()
  140993. req, err := http.NewRequest("PUT", urls, body)
  140994. if err != nil {
  140995. return nil, err
  140996. }
  140997. req.Header = reqHeaders
  140998. googleapi.Expand(req.URL, map[string]string{
  140999. "project": c.project,
  141000. "urlMap": c.urlMap,
  141001. })
  141002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141003. }
  141004. // Do executes the "compute.urlMaps.update" call.
  141005. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  141006. // status code is an error. Response headers are in either
  141007. // *Operation.ServerResponse.Header or (if a response was returned at
  141008. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  141009. // to check whether the returned error was because
  141010. // http.StatusNotModified was returned.
  141011. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  141012. gensupport.SetOptions(c.urlParams_, opts...)
  141013. res, err := c.doRequest("json")
  141014. if res != nil && res.StatusCode == http.StatusNotModified {
  141015. if res.Body != nil {
  141016. res.Body.Close()
  141017. }
  141018. return nil, &googleapi.Error{
  141019. Code: res.StatusCode,
  141020. Header: res.Header,
  141021. }
  141022. }
  141023. if err != nil {
  141024. return nil, err
  141025. }
  141026. defer googleapi.CloseBody(res)
  141027. if err := googleapi.CheckResponse(res); err != nil {
  141028. return nil, err
  141029. }
  141030. ret := &Operation{
  141031. ServerResponse: googleapi.ServerResponse{
  141032. Header: res.Header,
  141033. HTTPStatusCode: res.StatusCode,
  141034. },
  141035. }
  141036. target := &ret
  141037. if err := gensupport.DecodeResponse(target, res); err != nil {
  141038. return nil, err
  141039. }
  141040. return ret, nil
  141041. // {
  141042. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  141043. // "httpMethod": "PUT",
  141044. // "id": "compute.urlMaps.update",
  141045. // "parameterOrder": [
  141046. // "project",
  141047. // "urlMap"
  141048. // ],
  141049. // "parameters": {
  141050. // "project": {
  141051. // "description": "Project ID for this request.",
  141052. // "location": "path",
  141053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141054. // "required": true,
  141055. // "type": "string"
  141056. // },
  141057. // "requestId": {
  141058. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  141059. // "location": "query",
  141060. // "type": "string"
  141061. // },
  141062. // "urlMap": {
  141063. // "description": "Name of the UrlMap resource to update.",
  141064. // "location": "path",
  141065. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  141066. // "required": true,
  141067. // "type": "string"
  141068. // }
  141069. // },
  141070. // "path": "{project}/global/urlMaps/{urlMap}",
  141071. // "request": {
  141072. // "$ref": "UrlMap"
  141073. // },
  141074. // "response": {
  141075. // "$ref": "Operation"
  141076. // },
  141077. // "scopes": [
  141078. // "https://www.googleapis.com/auth/cloud-platform",
  141079. // "https://www.googleapis.com/auth/compute"
  141080. // ]
  141081. // }
  141082. }
  141083. // method id "compute.urlMaps.validate":
  141084. type UrlMapsValidateCall struct {
  141085. s *Service
  141086. project string
  141087. urlMap string
  141088. urlmapsvalidaterequest *UrlMapsValidateRequest
  141089. urlParams_ gensupport.URLParams
  141090. ctx_ context.Context
  141091. header_ http.Header
  141092. }
  141093. // Validate: Runs static validation for the UrlMap. In particular, the
  141094. // tests of the provided UrlMap will be run. Calling this method does
  141095. // NOT create the UrlMap.
  141096. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  141097. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  141098. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141099. c.project = project
  141100. c.urlMap = urlMap
  141101. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  141102. return c
  141103. }
  141104. // Fields allows partial responses to be retrieved. See
  141105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141106. // for more information.
  141107. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  141108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141109. return c
  141110. }
  141111. // Context sets the context to be used in this call's Do method. Any
  141112. // pending HTTP request will be aborted if the provided context is
  141113. // canceled.
  141114. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  141115. c.ctx_ = ctx
  141116. return c
  141117. }
  141118. // Header returns an http.Header that can be modified by the caller to
  141119. // add HTTP headers to the request.
  141120. func (c *UrlMapsValidateCall) Header() http.Header {
  141121. if c.header_ == nil {
  141122. c.header_ = make(http.Header)
  141123. }
  141124. return c.header_
  141125. }
  141126. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  141127. reqHeaders := make(http.Header)
  141128. for k, v := range c.header_ {
  141129. reqHeaders[k] = v
  141130. }
  141131. reqHeaders.Set("User-Agent", c.s.userAgent())
  141132. var body io.Reader = nil
  141133. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  141134. if err != nil {
  141135. return nil, err
  141136. }
  141137. reqHeaders.Set("Content-Type", "application/json")
  141138. c.urlParams_.Set("alt", alt)
  141139. c.urlParams_.Set("prettyPrint", "false")
  141140. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  141141. urls += "?" + c.urlParams_.Encode()
  141142. req, err := http.NewRequest("POST", urls, body)
  141143. if err != nil {
  141144. return nil, err
  141145. }
  141146. req.Header = reqHeaders
  141147. googleapi.Expand(req.URL, map[string]string{
  141148. "project": c.project,
  141149. "urlMap": c.urlMap,
  141150. })
  141151. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141152. }
  141153. // Do executes the "compute.urlMaps.validate" call.
  141154. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  141155. // non-2xx status code is an error. Response headers are in either
  141156. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  141157. // returned at all) in error.(*googleapi.Error).Header. Use
  141158. // googleapi.IsNotModified to check whether the returned error was
  141159. // because http.StatusNotModified was returned.
  141160. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  141161. gensupport.SetOptions(c.urlParams_, opts...)
  141162. res, err := c.doRequest("json")
  141163. if res != nil && res.StatusCode == http.StatusNotModified {
  141164. if res.Body != nil {
  141165. res.Body.Close()
  141166. }
  141167. return nil, &googleapi.Error{
  141168. Code: res.StatusCode,
  141169. Header: res.Header,
  141170. }
  141171. }
  141172. if err != nil {
  141173. return nil, err
  141174. }
  141175. defer googleapi.CloseBody(res)
  141176. if err := googleapi.CheckResponse(res); err != nil {
  141177. return nil, err
  141178. }
  141179. ret := &UrlMapsValidateResponse{
  141180. ServerResponse: googleapi.ServerResponse{
  141181. Header: res.Header,
  141182. HTTPStatusCode: res.StatusCode,
  141183. },
  141184. }
  141185. target := &ret
  141186. if err := gensupport.DecodeResponse(target, res); err != nil {
  141187. return nil, err
  141188. }
  141189. return ret, nil
  141190. // {
  141191. // "description": "Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.",
  141192. // "httpMethod": "POST",
  141193. // "id": "compute.urlMaps.validate",
  141194. // "parameterOrder": [
  141195. // "project",
  141196. // "urlMap"
  141197. // ],
  141198. // "parameters": {
  141199. // "project": {
  141200. // "description": "Project ID for this request.",
  141201. // "location": "path",
  141202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141203. // "required": true,
  141204. // "type": "string"
  141205. // },
  141206. // "urlMap": {
  141207. // "description": "Name of the UrlMap resource to be validated as.",
  141208. // "location": "path",
  141209. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  141210. // "required": true,
  141211. // "type": "string"
  141212. // }
  141213. // },
  141214. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  141215. // "request": {
  141216. // "$ref": "UrlMapsValidateRequest"
  141217. // },
  141218. // "response": {
  141219. // "$ref": "UrlMapsValidateResponse"
  141220. // },
  141221. // "scopes": [
  141222. // "https://www.googleapis.com/auth/cloud-platform",
  141223. // "https://www.googleapis.com/auth/compute"
  141224. // ]
  141225. // }
  141226. }
  141227. // method id "compute.vpnGateways.aggregatedList":
  141228. type VpnGatewaysAggregatedListCall struct {
  141229. s *Service
  141230. project string
  141231. urlParams_ gensupport.URLParams
  141232. ifNoneMatch_ string
  141233. ctx_ context.Context
  141234. header_ http.Header
  141235. }
  141236. // AggregatedList: Retrieves an aggregated list of VPN gateways.
  141237. func (r *VpnGatewaysService) AggregatedList(project string) *VpnGatewaysAggregatedListCall {
  141238. c := &VpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141239. c.project = project
  141240. return c
  141241. }
  141242. // Filter sets the optional parameter "filter": A filter expression that
  141243. // filters resources listed in the response. The expression must specify
  141244. // the field name, a comparison operator, and the value that you want to
  141245. // use for filtering. The value must be a string, a number, or a
  141246. // boolean. The comparison operator must be either =, !=, >, or <.
  141247. //
  141248. // For example, if you are filtering Compute Engine instances, you can
  141249. // exclude instances named example-instance by specifying name !=
  141250. // example-instance.
  141251. //
  141252. // You can also filter nested fields. For example, you could specify
  141253. // scheduling.automaticRestart = false to include instances only if they
  141254. // are not scheduled for automatic restarts. You can use filtering on
  141255. // nested fields to filter based on resource labels.
  141256. //
  141257. // To filter on multiple expressions, provide each separate expression
  141258. // within parentheses. For example, (scheduling.automaticRestart = true)
  141259. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  141260. // AND expression. However, you can include AND and OR expressions
  141261. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  141262. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  141263. // true).
  141264. func (c *VpnGatewaysAggregatedListCall) Filter(filter string) *VpnGatewaysAggregatedListCall {
  141265. c.urlParams_.Set("filter", filter)
  141266. return c
  141267. }
  141268. // MaxResults sets the optional parameter "maxResults": The maximum
  141269. // number of results per page that should be returned. If the number of
  141270. // available results is larger than maxResults, Compute Engine returns a
  141271. // nextPageToken that can be used to get the next page of results in
  141272. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  141273. // (Default: 500)
  141274. func (c *VpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *VpnGatewaysAggregatedListCall {
  141275. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  141276. return c
  141277. }
  141278. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  141279. // a certain order. By default, results are returned in alphanumerical
  141280. // order based on the resource name.
  141281. //
  141282. // You can also sort results in descending order based on the creation
  141283. // timestamp using orderBy="creationTimestamp desc". This sorts results
  141284. // based on the creationTimestamp field in reverse chronological order
  141285. // (newest result first). Use this to sort resources like operations so
  141286. // that the newest operation is returned first.
  141287. //
  141288. // Currently, only sorting by name or creationTimestamp desc is
  141289. // supported.
  141290. func (c *VpnGatewaysAggregatedListCall) OrderBy(orderBy string) *VpnGatewaysAggregatedListCall {
  141291. c.urlParams_.Set("orderBy", orderBy)
  141292. return c
  141293. }
  141294. // PageToken sets the optional parameter "pageToken": Specifies a page
  141295. // token to use. Set pageToken to the nextPageToken returned by a
  141296. // previous list request to get the next page of results.
  141297. func (c *VpnGatewaysAggregatedListCall) PageToken(pageToken string) *VpnGatewaysAggregatedListCall {
  141298. c.urlParams_.Set("pageToken", pageToken)
  141299. return c
  141300. }
  141301. // Fields allows partial responses to be retrieved. See
  141302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141303. // for more information.
  141304. func (c *VpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *VpnGatewaysAggregatedListCall {
  141305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141306. return c
  141307. }
  141308. // IfNoneMatch sets the optional parameter which makes the operation
  141309. // fail if the object's ETag matches the given value. This is useful for
  141310. // getting updates only after the object has changed since the last
  141311. // request. Use googleapi.IsNotModified to check whether the response
  141312. // error from Do is the result of In-None-Match.
  141313. func (c *VpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *VpnGatewaysAggregatedListCall {
  141314. c.ifNoneMatch_ = entityTag
  141315. return c
  141316. }
  141317. // Context sets the context to be used in this call's Do method. Any
  141318. // pending HTTP request will be aborted if the provided context is
  141319. // canceled.
  141320. func (c *VpnGatewaysAggregatedListCall) Context(ctx context.Context) *VpnGatewaysAggregatedListCall {
  141321. c.ctx_ = ctx
  141322. return c
  141323. }
  141324. // Header returns an http.Header that can be modified by the caller to
  141325. // add HTTP headers to the request.
  141326. func (c *VpnGatewaysAggregatedListCall) Header() http.Header {
  141327. if c.header_ == nil {
  141328. c.header_ = make(http.Header)
  141329. }
  141330. return c.header_
  141331. }
  141332. func (c *VpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  141333. reqHeaders := make(http.Header)
  141334. for k, v := range c.header_ {
  141335. reqHeaders[k] = v
  141336. }
  141337. reqHeaders.Set("User-Agent", c.s.userAgent())
  141338. if c.ifNoneMatch_ != "" {
  141339. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  141340. }
  141341. var body io.Reader = nil
  141342. c.urlParams_.Set("alt", alt)
  141343. c.urlParams_.Set("prettyPrint", "false")
  141344. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnGateways")
  141345. urls += "?" + c.urlParams_.Encode()
  141346. req, err := http.NewRequest("GET", urls, body)
  141347. if err != nil {
  141348. return nil, err
  141349. }
  141350. req.Header = reqHeaders
  141351. googleapi.Expand(req.URL, map[string]string{
  141352. "project": c.project,
  141353. })
  141354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141355. }
  141356. // Do executes the "compute.vpnGateways.aggregatedList" call.
  141357. // Exactly one of *VpnGatewayAggregatedList or error will be non-nil.
  141358. // Any non-2xx status code is an error. Response headers are in either
  141359. // *VpnGatewayAggregatedList.ServerResponse.Header or (if a response was
  141360. // returned at all) in error.(*googleapi.Error).Header. Use
  141361. // googleapi.IsNotModified to check whether the returned error was
  141362. // because http.StatusNotModified was returned.
  141363. func (c *VpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayAggregatedList, error) {
  141364. gensupport.SetOptions(c.urlParams_, opts...)
  141365. res, err := c.doRequest("json")
  141366. if res != nil && res.StatusCode == http.StatusNotModified {
  141367. if res.Body != nil {
  141368. res.Body.Close()
  141369. }
  141370. return nil, &googleapi.Error{
  141371. Code: res.StatusCode,
  141372. Header: res.Header,
  141373. }
  141374. }
  141375. if err != nil {
  141376. return nil, err
  141377. }
  141378. defer googleapi.CloseBody(res)
  141379. if err := googleapi.CheckResponse(res); err != nil {
  141380. return nil, err
  141381. }
  141382. ret := &VpnGatewayAggregatedList{
  141383. ServerResponse: googleapi.ServerResponse{
  141384. Header: res.Header,
  141385. HTTPStatusCode: res.StatusCode,
  141386. },
  141387. }
  141388. target := &ret
  141389. if err := gensupport.DecodeResponse(target, res); err != nil {
  141390. return nil, err
  141391. }
  141392. return ret, nil
  141393. // {
  141394. // "description": "Retrieves an aggregated list of VPN gateways.",
  141395. // "httpMethod": "GET",
  141396. // "id": "compute.vpnGateways.aggregatedList",
  141397. // "parameterOrder": [
  141398. // "project"
  141399. // ],
  141400. // "parameters": {
  141401. // "filter": {
  141402. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  141403. // "location": "query",
  141404. // "type": "string"
  141405. // },
  141406. // "maxResults": {
  141407. // "default": "500",
  141408. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  141409. // "format": "uint32",
  141410. // "location": "query",
  141411. // "minimum": "0",
  141412. // "type": "integer"
  141413. // },
  141414. // "orderBy": {
  141415. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  141416. // "location": "query",
  141417. // "type": "string"
  141418. // },
  141419. // "pageToken": {
  141420. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  141421. // "location": "query",
  141422. // "type": "string"
  141423. // },
  141424. // "project": {
  141425. // "description": "Project ID for this request.",
  141426. // "location": "path",
  141427. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141428. // "required": true,
  141429. // "type": "string"
  141430. // }
  141431. // },
  141432. // "path": "{project}/aggregated/vpnGateways",
  141433. // "response": {
  141434. // "$ref": "VpnGatewayAggregatedList"
  141435. // },
  141436. // "scopes": [
  141437. // "https://www.googleapis.com/auth/cloud-platform",
  141438. // "https://www.googleapis.com/auth/compute",
  141439. // "https://www.googleapis.com/auth/compute.readonly"
  141440. // ]
  141441. // }
  141442. }
  141443. // Pages invokes f for each page of results.
  141444. // A non-nil error returned from f will halt the iteration.
  141445. // The provided context supersedes any context provided to the Context method.
  141446. func (c *VpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*VpnGatewayAggregatedList) error) error {
  141447. c.ctx_ = ctx
  141448. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  141449. for {
  141450. x, err := c.Do()
  141451. if err != nil {
  141452. return err
  141453. }
  141454. if err := f(x); err != nil {
  141455. return err
  141456. }
  141457. if x.NextPageToken == "" {
  141458. return nil
  141459. }
  141460. c.PageToken(x.NextPageToken)
  141461. }
  141462. }
  141463. // method id "compute.vpnGateways.delete":
  141464. type VpnGatewaysDeleteCall struct {
  141465. s *Service
  141466. project string
  141467. region string
  141468. vpnGateway string
  141469. urlParams_ gensupport.URLParams
  141470. ctx_ context.Context
  141471. header_ http.Header
  141472. }
  141473. // Delete: Deletes the specified VPN gateway.
  141474. func (r *VpnGatewaysService) Delete(project string, region string, vpnGateway string) *VpnGatewaysDeleteCall {
  141475. c := &VpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141476. c.project = project
  141477. c.region = region
  141478. c.vpnGateway = vpnGateway
  141479. return c
  141480. }
  141481. // RequestId sets the optional parameter "requestId": An optional
  141482. // request ID to identify requests. Specify a unique request ID so that
  141483. // if you must retry your request, the server will know to ignore the
  141484. // request if it has already been completed.
  141485. //
  141486. // For example, consider a situation where you make an initial request
  141487. // and the request times out. If you make the request again with the
  141488. // same request ID, the server can check if original operation with the
  141489. // same request ID was received, and if so, will ignore the second
  141490. // request. This prevents clients from accidentally creating duplicate
  141491. // commitments.
  141492. //
  141493. // The request ID must be a valid UUID with the exception that zero UUID
  141494. // is not supported (00000000-0000-0000-0000-000000000000).
  141495. func (c *VpnGatewaysDeleteCall) RequestId(requestId string) *VpnGatewaysDeleteCall {
  141496. c.urlParams_.Set("requestId", requestId)
  141497. return c
  141498. }
  141499. // Fields allows partial responses to be retrieved. See
  141500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141501. // for more information.
  141502. func (c *VpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *VpnGatewaysDeleteCall {
  141503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141504. return c
  141505. }
  141506. // Context sets the context to be used in this call's Do method. Any
  141507. // pending HTTP request will be aborted if the provided context is
  141508. // canceled.
  141509. func (c *VpnGatewaysDeleteCall) Context(ctx context.Context) *VpnGatewaysDeleteCall {
  141510. c.ctx_ = ctx
  141511. return c
  141512. }
  141513. // Header returns an http.Header that can be modified by the caller to
  141514. // add HTTP headers to the request.
  141515. func (c *VpnGatewaysDeleteCall) Header() http.Header {
  141516. if c.header_ == nil {
  141517. c.header_ = make(http.Header)
  141518. }
  141519. return c.header_
  141520. }
  141521. func (c *VpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  141522. reqHeaders := make(http.Header)
  141523. for k, v := range c.header_ {
  141524. reqHeaders[k] = v
  141525. }
  141526. reqHeaders.Set("User-Agent", c.s.userAgent())
  141527. var body io.Reader = nil
  141528. c.urlParams_.Set("alt", alt)
  141529. c.urlParams_.Set("prettyPrint", "false")
  141530. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  141531. urls += "?" + c.urlParams_.Encode()
  141532. req, err := http.NewRequest("DELETE", urls, body)
  141533. if err != nil {
  141534. return nil, err
  141535. }
  141536. req.Header = reqHeaders
  141537. googleapi.Expand(req.URL, map[string]string{
  141538. "project": c.project,
  141539. "region": c.region,
  141540. "vpnGateway": c.vpnGateway,
  141541. })
  141542. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141543. }
  141544. // Do executes the "compute.vpnGateways.delete" call.
  141545. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  141546. // status code is an error. Response headers are in either
  141547. // *Operation.ServerResponse.Header or (if a response was returned at
  141548. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  141549. // to check whether the returned error was because
  141550. // http.StatusNotModified was returned.
  141551. func (c *VpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  141552. gensupport.SetOptions(c.urlParams_, opts...)
  141553. res, err := c.doRequest("json")
  141554. if res != nil && res.StatusCode == http.StatusNotModified {
  141555. if res.Body != nil {
  141556. res.Body.Close()
  141557. }
  141558. return nil, &googleapi.Error{
  141559. Code: res.StatusCode,
  141560. Header: res.Header,
  141561. }
  141562. }
  141563. if err != nil {
  141564. return nil, err
  141565. }
  141566. defer googleapi.CloseBody(res)
  141567. if err := googleapi.CheckResponse(res); err != nil {
  141568. return nil, err
  141569. }
  141570. ret := &Operation{
  141571. ServerResponse: googleapi.ServerResponse{
  141572. Header: res.Header,
  141573. HTTPStatusCode: res.StatusCode,
  141574. },
  141575. }
  141576. target := &ret
  141577. if err := gensupport.DecodeResponse(target, res); err != nil {
  141578. return nil, err
  141579. }
  141580. return ret, nil
  141581. // {
  141582. // "description": "Deletes the specified VPN gateway.",
  141583. // "httpMethod": "DELETE",
  141584. // "id": "compute.vpnGateways.delete",
  141585. // "parameterOrder": [
  141586. // "project",
  141587. // "region",
  141588. // "vpnGateway"
  141589. // ],
  141590. // "parameters": {
  141591. // "project": {
  141592. // "description": "Project ID for this request.",
  141593. // "location": "path",
  141594. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141595. // "required": true,
  141596. // "type": "string"
  141597. // },
  141598. // "region": {
  141599. // "description": "Name of the region for this request.",
  141600. // "location": "path",
  141601. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  141602. // "required": true,
  141603. // "type": "string"
  141604. // },
  141605. // "requestId": {
  141606. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  141607. // "location": "query",
  141608. // "type": "string"
  141609. // },
  141610. // "vpnGateway": {
  141611. // "description": "Name of the VPN gateway to delete.",
  141612. // "location": "path",
  141613. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  141614. // "required": true,
  141615. // "type": "string"
  141616. // }
  141617. // },
  141618. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  141619. // "response": {
  141620. // "$ref": "Operation"
  141621. // },
  141622. // "scopes": [
  141623. // "https://www.googleapis.com/auth/cloud-platform",
  141624. // "https://www.googleapis.com/auth/compute"
  141625. // ]
  141626. // }
  141627. }
  141628. // method id "compute.vpnGateways.get":
  141629. type VpnGatewaysGetCall struct {
  141630. s *Service
  141631. project string
  141632. region string
  141633. vpnGateway string
  141634. urlParams_ gensupport.URLParams
  141635. ifNoneMatch_ string
  141636. ctx_ context.Context
  141637. header_ http.Header
  141638. }
  141639. // Get: Returns the specified VPN gateway. Gets a list of available VPN
  141640. // gateways by making a list() request.
  141641. func (r *VpnGatewaysService) Get(project string, region string, vpnGateway string) *VpnGatewaysGetCall {
  141642. c := &VpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141643. c.project = project
  141644. c.region = region
  141645. c.vpnGateway = vpnGateway
  141646. return c
  141647. }
  141648. // Fields allows partial responses to be retrieved. See
  141649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141650. // for more information.
  141651. func (c *VpnGatewaysGetCall) Fields(s ...googleapi.Field) *VpnGatewaysGetCall {
  141652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141653. return c
  141654. }
  141655. // IfNoneMatch sets the optional parameter which makes the operation
  141656. // fail if the object's ETag matches the given value. This is useful for
  141657. // getting updates only after the object has changed since the last
  141658. // request. Use googleapi.IsNotModified to check whether the response
  141659. // error from Do is the result of In-None-Match.
  141660. func (c *VpnGatewaysGetCall) IfNoneMatch(entityTag string) *VpnGatewaysGetCall {
  141661. c.ifNoneMatch_ = entityTag
  141662. return c
  141663. }
  141664. // Context sets the context to be used in this call's Do method. Any
  141665. // pending HTTP request will be aborted if the provided context is
  141666. // canceled.
  141667. func (c *VpnGatewaysGetCall) Context(ctx context.Context) *VpnGatewaysGetCall {
  141668. c.ctx_ = ctx
  141669. return c
  141670. }
  141671. // Header returns an http.Header that can be modified by the caller to
  141672. // add HTTP headers to the request.
  141673. func (c *VpnGatewaysGetCall) Header() http.Header {
  141674. if c.header_ == nil {
  141675. c.header_ = make(http.Header)
  141676. }
  141677. return c.header_
  141678. }
  141679. func (c *VpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  141680. reqHeaders := make(http.Header)
  141681. for k, v := range c.header_ {
  141682. reqHeaders[k] = v
  141683. }
  141684. reqHeaders.Set("User-Agent", c.s.userAgent())
  141685. if c.ifNoneMatch_ != "" {
  141686. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  141687. }
  141688. var body io.Reader = nil
  141689. c.urlParams_.Set("alt", alt)
  141690. c.urlParams_.Set("prettyPrint", "false")
  141691. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{vpnGateway}")
  141692. urls += "?" + c.urlParams_.Encode()
  141693. req, err := http.NewRequest("GET", urls, body)
  141694. if err != nil {
  141695. return nil, err
  141696. }
  141697. req.Header = reqHeaders
  141698. googleapi.Expand(req.URL, map[string]string{
  141699. "project": c.project,
  141700. "region": c.region,
  141701. "vpnGateway": c.vpnGateway,
  141702. })
  141703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141704. }
  141705. // Do executes the "compute.vpnGateways.get" call.
  141706. // Exactly one of *VpnGateway or error will be non-nil. Any non-2xx
  141707. // status code is an error. Response headers are in either
  141708. // *VpnGateway.ServerResponse.Header or (if a response was returned at
  141709. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  141710. // to check whether the returned error was because
  141711. // http.StatusNotModified was returned.
  141712. func (c *VpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*VpnGateway, error) {
  141713. gensupport.SetOptions(c.urlParams_, opts...)
  141714. res, err := c.doRequest("json")
  141715. if res != nil && res.StatusCode == http.StatusNotModified {
  141716. if res.Body != nil {
  141717. res.Body.Close()
  141718. }
  141719. return nil, &googleapi.Error{
  141720. Code: res.StatusCode,
  141721. Header: res.Header,
  141722. }
  141723. }
  141724. if err != nil {
  141725. return nil, err
  141726. }
  141727. defer googleapi.CloseBody(res)
  141728. if err := googleapi.CheckResponse(res); err != nil {
  141729. return nil, err
  141730. }
  141731. ret := &VpnGateway{
  141732. ServerResponse: googleapi.ServerResponse{
  141733. Header: res.Header,
  141734. HTTPStatusCode: res.StatusCode,
  141735. },
  141736. }
  141737. target := &ret
  141738. if err := gensupport.DecodeResponse(target, res); err != nil {
  141739. return nil, err
  141740. }
  141741. return ret, nil
  141742. // {
  141743. // "description": "Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request.",
  141744. // "httpMethod": "GET",
  141745. // "id": "compute.vpnGateways.get",
  141746. // "parameterOrder": [
  141747. // "project",
  141748. // "region",
  141749. // "vpnGateway"
  141750. // ],
  141751. // "parameters": {
  141752. // "project": {
  141753. // "description": "Project ID for this request.",
  141754. // "location": "path",
  141755. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141756. // "required": true,
  141757. // "type": "string"
  141758. // },
  141759. // "region": {
  141760. // "description": "Name of the region for this request.",
  141761. // "location": "path",
  141762. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  141763. // "required": true,
  141764. // "type": "string"
  141765. // },
  141766. // "vpnGateway": {
  141767. // "description": "Name of the VPN gateway to return.",
  141768. // "location": "path",
  141769. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  141770. // "required": true,
  141771. // "type": "string"
  141772. // }
  141773. // },
  141774. // "path": "{project}/regions/{region}/vpnGateways/{vpnGateway}",
  141775. // "response": {
  141776. // "$ref": "VpnGateway"
  141777. // },
  141778. // "scopes": [
  141779. // "https://www.googleapis.com/auth/cloud-platform",
  141780. // "https://www.googleapis.com/auth/compute",
  141781. // "https://www.googleapis.com/auth/compute.readonly"
  141782. // ]
  141783. // }
  141784. }
  141785. // method id "compute.vpnGateways.insert":
  141786. type VpnGatewaysInsertCall struct {
  141787. s *Service
  141788. project string
  141789. region string
  141790. vpngateway *VpnGateway
  141791. urlParams_ gensupport.URLParams
  141792. ctx_ context.Context
  141793. header_ http.Header
  141794. }
  141795. // Insert: Creates a VPN gateway in the specified project and region
  141796. // using the data included in the request.
  141797. func (r *VpnGatewaysService) Insert(project string, region string, vpngateway *VpnGateway) *VpnGatewaysInsertCall {
  141798. c := &VpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141799. c.project = project
  141800. c.region = region
  141801. c.vpngateway = vpngateway
  141802. return c
  141803. }
  141804. // RequestId sets the optional parameter "requestId": An optional
  141805. // request ID to identify requests. Specify a unique request ID so that
  141806. // if you must retry your request, the server will know to ignore the
  141807. // request if it has already been completed.
  141808. //
  141809. // For example, consider a situation where you make an initial request
  141810. // and the request times out. If you make the request again with the
  141811. // same request ID, the server can check if original operation with the
  141812. // same request ID was received, and if so, will ignore the second
  141813. // request. This prevents clients from accidentally creating duplicate
  141814. // commitments.
  141815. //
  141816. // The request ID must be a valid UUID with the exception that zero UUID
  141817. // is not supported (00000000-0000-0000-0000-000000000000).
  141818. func (c *VpnGatewaysInsertCall) RequestId(requestId string) *VpnGatewaysInsertCall {
  141819. c.urlParams_.Set("requestId", requestId)
  141820. return c
  141821. }
  141822. // Fields allows partial responses to be retrieved. See
  141823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  141824. // for more information.
  141825. func (c *VpnGatewaysInsertCall) Fields(s ...googleapi.Field) *VpnGatewaysInsertCall {
  141826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  141827. return c
  141828. }
  141829. // Context sets the context to be used in this call's Do method. Any
  141830. // pending HTTP request will be aborted if the provided context is
  141831. // canceled.
  141832. func (c *VpnGatewaysInsertCall) Context(ctx context.Context) *VpnGatewaysInsertCall {
  141833. c.ctx_ = ctx
  141834. return c
  141835. }
  141836. // Header returns an http.Header that can be modified by the caller to
  141837. // add HTTP headers to the request.
  141838. func (c *VpnGatewaysInsertCall) Header() http.Header {
  141839. if c.header_ == nil {
  141840. c.header_ = make(http.Header)
  141841. }
  141842. return c.header_
  141843. }
  141844. func (c *VpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  141845. reqHeaders := make(http.Header)
  141846. for k, v := range c.header_ {
  141847. reqHeaders[k] = v
  141848. }
  141849. reqHeaders.Set("User-Agent", c.s.userAgent())
  141850. var body io.Reader = nil
  141851. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpngateway)
  141852. if err != nil {
  141853. return nil, err
  141854. }
  141855. reqHeaders.Set("Content-Type", "application/json")
  141856. c.urlParams_.Set("alt", alt)
  141857. c.urlParams_.Set("prettyPrint", "false")
  141858. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  141859. urls += "?" + c.urlParams_.Encode()
  141860. req, err := http.NewRequest("POST", urls, body)
  141861. if err != nil {
  141862. return nil, err
  141863. }
  141864. req.Header = reqHeaders
  141865. googleapi.Expand(req.URL, map[string]string{
  141866. "project": c.project,
  141867. "region": c.region,
  141868. })
  141869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  141870. }
  141871. // Do executes the "compute.vpnGateways.insert" call.
  141872. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  141873. // status code is an error. Response headers are in either
  141874. // *Operation.ServerResponse.Header or (if a response was returned at
  141875. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  141876. // to check whether the returned error was because
  141877. // http.StatusNotModified was returned.
  141878. func (c *VpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  141879. gensupport.SetOptions(c.urlParams_, opts...)
  141880. res, err := c.doRequest("json")
  141881. if res != nil && res.StatusCode == http.StatusNotModified {
  141882. if res.Body != nil {
  141883. res.Body.Close()
  141884. }
  141885. return nil, &googleapi.Error{
  141886. Code: res.StatusCode,
  141887. Header: res.Header,
  141888. }
  141889. }
  141890. if err != nil {
  141891. return nil, err
  141892. }
  141893. defer googleapi.CloseBody(res)
  141894. if err := googleapi.CheckResponse(res); err != nil {
  141895. return nil, err
  141896. }
  141897. ret := &Operation{
  141898. ServerResponse: googleapi.ServerResponse{
  141899. Header: res.Header,
  141900. HTTPStatusCode: res.StatusCode,
  141901. },
  141902. }
  141903. target := &ret
  141904. if err := gensupport.DecodeResponse(target, res); err != nil {
  141905. return nil, err
  141906. }
  141907. return ret, nil
  141908. // {
  141909. // "description": "Creates a VPN gateway in the specified project and region using the data included in the request.",
  141910. // "httpMethod": "POST",
  141911. // "id": "compute.vpnGateways.insert",
  141912. // "parameterOrder": [
  141913. // "project",
  141914. // "region"
  141915. // ],
  141916. // "parameters": {
  141917. // "project": {
  141918. // "description": "Project ID for this request.",
  141919. // "location": "path",
  141920. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  141921. // "required": true,
  141922. // "type": "string"
  141923. // },
  141924. // "region": {
  141925. // "description": "Name of the region for this request.",
  141926. // "location": "path",
  141927. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  141928. // "required": true,
  141929. // "type": "string"
  141930. // },
  141931. // "requestId": {
  141932. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  141933. // "location": "query",
  141934. // "type": "string"
  141935. // }
  141936. // },
  141937. // "path": "{project}/regions/{region}/vpnGateways",
  141938. // "request": {
  141939. // "$ref": "VpnGateway"
  141940. // },
  141941. // "response": {
  141942. // "$ref": "Operation"
  141943. // },
  141944. // "scopes": [
  141945. // "https://www.googleapis.com/auth/cloud-platform",
  141946. // "https://www.googleapis.com/auth/compute"
  141947. // ]
  141948. // }
  141949. }
  141950. // method id "compute.vpnGateways.list":
  141951. type VpnGatewaysListCall struct {
  141952. s *Service
  141953. project string
  141954. region string
  141955. urlParams_ gensupport.URLParams
  141956. ifNoneMatch_ string
  141957. ctx_ context.Context
  141958. header_ http.Header
  141959. }
  141960. // List: Retrieves a list of VPN gateways available to the specified
  141961. // project and region.
  141962. func (r *VpnGatewaysService) List(project string, region string) *VpnGatewaysListCall {
  141963. c := &VpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  141964. c.project = project
  141965. c.region = region
  141966. return c
  141967. }
  141968. // Filter sets the optional parameter "filter": A filter expression that
  141969. // filters resources listed in the response. The expression must specify
  141970. // the field name, a comparison operator, and the value that you want to
  141971. // use for filtering. The value must be a string, a number, or a
  141972. // boolean. The comparison operator must be either =, !=, >, or <.
  141973. //
  141974. // For example, if you are filtering Compute Engine instances, you can
  141975. // exclude instances named example-instance by specifying name !=
  141976. // example-instance.
  141977. //
  141978. // You can also filter nested fields. For example, you could specify
  141979. // scheduling.automaticRestart = false to include instances only if they
  141980. // are not scheduled for automatic restarts. You can use filtering on
  141981. // nested fields to filter based on resource labels.
  141982. //
  141983. // To filter on multiple expressions, provide each separate expression
  141984. // within parentheses. For example, (scheduling.automaticRestart = true)
  141985. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  141986. // AND expression. However, you can include AND and OR expressions
  141987. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  141988. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  141989. // true).
  141990. func (c *VpnGatewaysListCall) Filter(filter string) *VpnGatewaysListCall {
  141991. c.urlParams_.Set("filter", filter)
  141992. return c
  141993. }
  141994. // MaxResults sets the optional parameter "maxResults": The maximum
  141995. // number of results per page that should be returned. If the number of
  141996. // available results is larger than maxResults, Compute Engine returns a
  141997. // nextPageToken that can be used to get the next page of results in
  141998. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  141999. // (Default: 500)
  142000. func (c *VpnGatewaysListCall) MaxResults(maxResults int64) *VpnGatewaysListCall {
  142001. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  142002. return c
  142003. }
  142004. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  142005. // a certain order. By default, results are returned in alphanumerical
  142006. // order based on the resource name.
  142007. //
  142008. // You can also sort results in descending order based on the creation
  142009. // timestamp using orderBy="creationTimestamp desc". This sorts results
  142010. // based on the creationTimestamp field in reverse chronological order
  142011. // (newest result first). Use this to sort resources like operations so
  142012. // that the newest operation is returned first.
  142013. //
  142014. // Currently, only sorting by name or creationTimestamp desc is
  142015. // supported.
  142016. func (c *VpnGatewaysListCall) OrderBy(orderBy string) *VpnGatewaysListCall {
  142017. c.urlParams_.Set("orderBy", orderBy)
  142018. return c
  142019. }
  142020. // PageToken sets the optional parameter "pageToken": Specifies a page
  142021. // token to use. Set pageToken to the nextPageToken returned by a
  142022. // previous list request to get the next page of results.
  142023. func (c *VpnGatewaysListCall) PageToken(pageToken string) *VpnGatewaysListCall {
  142024. c.urlParams_.Set("pageToken", pageToken)
  142025. return c
  142026. }
  142027. // Fields allows partial responses to be retrieved. See
  142028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142029. // for more information.
  142030. func (c *VpnGatewaysListCall) Fields(s ...googleapi.Field) *VpnGatewaysListCall {
  142031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142032. return c
  142033. }
  142034. // IfNoneMatch sets the optional parameter which makes the operation
  142035. // fail if the object's ETag matches the given value. This is useful for
  142036. // getting updates only after the object has changed since the last
  142037. // request. Use googleapi.IsNotModified to check whether the response
  142038. // error from Do is the result of In-None-Match.
  142039. func (c *VpnGatewaysListCall) IfNoneMatch(entityTag string) *VpnGatewaysListCall {
  142040. c.ifNoneMatch_ = entityTag
  142041. return c
  142042. }
  142043. // Context sets the context to be used in this call's Do method. Any
  142044. // pending HTTP request will be aborted if the provided context is
  142045. // canceled.
  142046. func (c *VpnGatewaysListCall) Context(ctx context.Context) *VpnGatewaysListCall {
  142047. c.ctx_ = ctx
  142048. return c
  142049. }
  142050. // Header returns an http.Header that can be modified by the caller to
  142051. // add HTTP headers to the request.
  142052. func (c *VpnGatewaysListCall) Header() http.Header {
  142053. if c.header_ == nil {
  142054. c.header_ = make(http.Header)
  142055. }
  142056. return c.header_
  142057. }
  142058. func (c *VpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  142059. reqHeaders := make(http.Header)
  142060. for k, v := range c.header_ {
  142061. reqHeaders[k] = v
  142062. }
  142063. reqHeaders.Set("User-Agent", c.s.userAgent())
  142064. if c.ifNoneMatch_ != "" {
  142065. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  142066. }
  142067. var body io.Reader = nil
  142068. c.urlParams_.Set("alt", alt)
  142069. c.urlParams_.Set("prettyPrint", "false")
  142070. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways")
  142071. urls += "?" + c.urlParams_.Encode()
  142072. req, err := http.NewRequest("GET", urls, body)
  142073. if err != nil {
  142074. return nil, err
  142075. }
  142076. req.Header = reqHeaders
  142077. googleapi.Expand(req.URL, map[string]string{
  142078. "project": c.project,
  142079. "region": c.region,
  142080. })
  142081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142082. }
  142083. // Do executes the "compute.vpnGateways.list" call.
  142084. // Exactly one of *VpnGatewayList or error will be non-nil. Any non-2xx
  142085. // status code is an error. Response headers are in either
  142086. // *VpnGatewayList.ServerResponse.Header or (if a response was returned
  142087. // at all) in error.(*googleapi.Error).Header. Use
  142088. // googleapi.IsNotModified to check whether the returned error was
  142089. // because http.StatusNotModified was returned.
  142090. func (c *VpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*VpnGatewayList, error) {
  142091. gensupport.SetOptions(c.urlParams_, opts...)
  142092. res, err := c.doRequest("json")
  142093. if res != nil && res.StatusCode == http.StatusNotModified {
  142094. if res.Body != nil {
  142095. res.Body.Close()
  142096. }
  142097. return nil, &googleapi.Error{
  142098. Code: res.StatusCode,
  142099. Header: res.Header,
  142100. }
  142101. }
  142102. if err != nil {
  142103. return nil, err
  142104. }
  142105. defer googleapi.CloseBody(res)
  142106. if err := googleapi.CheckResponse(res); err != nil {
  142107. return nil, err
  142108. }
  142109. ret := &VpnGatewayList{
  142110. ServerResponse: googleapi.ServerResponse{
  142111. Header: res.Header,
  142112. HTTPStatusCode: res.StatusCode,
  142113. },
  142114. }
  142115. target := &ret
  142116. if err := gensupport.DecodeResponse(target, res); err != nil {
  142117. return nil, err
  142118. }
  142119. return ret, nil
  142120. // {
  142121. // "description": "Retrieves a list of VPN gateways available to the specified project and region.",
  142122. // "httpMethod": "GET",
  142123. // "id": "compute.vpnGateways.list",
  142124. // "parameterOrder": [
  142125. // "project",
  142126. // "region"
  142127. // ],
  142128. // "parameters": {
  142129. // "filter": {
  142130. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  142131. // "location": "query",
  142132. // "type": "string"
  142133. // },
  142134. // "maxResults": {
  142135. // "default": "500",
  142136. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  142137. // "format": "uint32",
  142138. // "location": "query",
  142139. // "minimum": "0",
  142140. // "type": "integer"
  142141. // },
  142142. // "orderBy": {
  142143. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  142144. // "location": "query",
  142145. // "type": "string"
  142146. // },
  142147. // "pageToken": {
  142148. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  142149. // "location": "query",
  142150. // "type": "string"
  142151. // },
  142152. // "project": {
  142153. // "description": "Project ID for this request.",
  142154. // "location": "path",
  142155. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142156. // "required": true,
  142157. // "type": "string"
  142158. // },
  142159. // "region": {
  142160. // "description": "Name of the region for this request.",
  142161. // "location": "path",
  142162. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  142163. // "required": true,
  142164. // "type": "string"
  142165. // }
  142166. // },
  142167. // "path": "{project}/regions/{region}/vpnGateways",
  142168. // "response": {
  142169. // "$ref": "VpnGatewayList"
  142170. // },
  142171. // "scopes": [
  142172. // "https://www.googleapis.com/auth/cloud-platform",
  142173. // "https://www.googleapis.com/auth/compute",
  142174. // "https://www.googleapis.com/auth/compute.readonly"
  142175. // ]
  142176. // }
  142177. }
  142178. // Pages invokes f for each page of results.
  142179. // A non-nil error returned from f will halt the iteration.
  142180. // The provided context supersedes any context provided to the Context method.
  142181. func (c *VpnGatewaysListCall) Pages(ctx context.Context, f func(*VpnGatewayList) error) error {
  142182. c.ctx_ = ctx
  142183. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  142184. for {
  142185. x, err := c.Do()
  142186. if err != nil {
  142187. return err
  142188. }
  142189. if err := f(x); err != nil {
  142190. return err
  142191. }
  142192. if x.NextPageToken == "" {
  142193. return nil
  142194. }
  142195. c.PageToken(x.NextPageToken)
  142196. }
  142197. }
  142198. // method id "compute.vpnGateways.setLabels":
  142199. type VpnGatewaysSetLabelsCall struct {
  142200. s *Service
  142201. project string
  142202. region string
  142203. resource string
  142204. regionsetlabelsrequest *RegionSetLabelsRequest
  142205. urlParams_ gensupport.URLParams
  142206. ctx_ context.Context
  142207. header_ http.Header
  142208. }
  142209. // SetLabels: Sets the labels on a VpnGateway. To learn more about
  142210. // labels, read the Labeling Resources documentation.
  142211. func (r *VpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnGatewaysSetLabelsCall {
  142212. c := &VpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142213. c.project = project
  142214. c.region = region
  142215. c.resource = resource
  142216. c.regionsetlabelsrequest = regionsetlabelsrequest
  142217. return c
  142218. }
  142219. // RequestId sets the optional parameter "requestId": An optional
  142220. // request ID to identify requests. Specify a unique request ID so that
  142221. // if you must retry your request, the server will know to ignore the
  142222. // request if it has already been completed.
  142223. //
  142224. // For example, consider a situation where you make an initial request
  142225. // and the request times out. If you make the request again with the
  142226. // same request ID, the server can check if original operation with the
  142227. // same request ID was received, and if so, will ignore the second
  142228. // request. This prevents clients from accidentally creating duplicate
  142229. // commitments.
  142230. //
  142231. // The request ID must be a valid UUID with the exception that zero UUID
  142232. // is not supported (00000000-0000-0000-0000-000000000000).
  142233. func (c *VpnGatewaysSetLabelsCall) RequestId(requestId string) *VpnGatewaysSetLabelsCall {
  142234. c.urlParams_.Set("requestId", requestId)
  142235. return c
  142236. }
  142237. // Fields allows partial responses to be retrieved. See
  142238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142239. // for more information.
  142240. func (c *VpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *VpnGatewaysSetLabelsCall {
  142241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142242. return c
  142243. }
  142244. // Context sets the context to be used in this call's Do method. Any
  142245. // pending HTTP request will be aborted if the provided context is
  142246. // canceled.
  142247. func (c *VpnGatewaysSetLabelsCall) Context(ctx context.Context) *VpnGatewaysSetLabelsCall {
  142248. c.ctx_ = ctx
  142249. return c
  142250. }
  142251. // Header returns an http.Header that can be modified by the caller to
  142252. // add HTTP headers to the request.
  142253. func (c *VpnGatewaysSetLabelsCall) Header() http.Header {
  142254. if c.header_ == nil {
  142255. c.header_ = make(http.Header)
  142256. }
  142257. return c.header_
  142258. }
  142259. func (c *VpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  142260. reqHeaders := make(http.Header)
  142261. for k, v := range c.header_ {
  142262. reqHeaders[k] = v
  142263. }
  142264. reqHeaders.Set("User-Agent", c.s.userAgent())
  142265. var body io.Reader = nil
  142266. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  142267. if err != nil {
  142268. return nil, err
  142269. }
  142270. reqHeaders.Set("Content-Type", "application/json")
  142271. c.urlParams_.Set("alt", alt)
  142272. c.urlParams_.Set("prettyPrint", "false")
  142273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/setLabels")
  142274. urls += "?" + c.urlParams_.Encode()
  142275. req, err := http.NewRequest("POST", urls, body)
  142276. if err != nil {
  142277. return nil, err
  142278. }
  142279. req.Header = reqHeaders
  142280. googleapi.Expand(req.URL, map[string]string{
  142281. "project": c.project,
  142282. "region": c.region,
  142283. "resource": c.resource,
  142284. })
  142285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142286. }
  142287. // Do executes the "compute.vpnGateways.setLabels" call.
  142288. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  142289. // status code is an error. Response headers are in either
  142290. // *Operation.ServerResponse.Header or (if a response was returned at
  142291. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  142292. // to check whether the returned error was because
  142293. // http.StatusNotModified was returned.
  142294. func (c *VpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  142295. gensupport.SetOptions(c.urlParams_, opts...)
  142296. res, err := c.doRequest("json")
  142297. if res != nil && res.StatusCode == http.StatusNotModified {
  142298. if res.Body != nil {
  142299. res.Body.Close()
  142300. }
  142301. return nil, &googleapi.Error{
  142302. Code: res.StatusCode,
  142303. Header: res.Header,
  142304. }
  142305. }
  142306. if err != nil {
  142307. return nil, err
  142308. }
  142309. defer googleapi.CloseBody(res)
  142310. if err := googleapi.CheckResponse(res); err != nil {
  142311. return nil, err
  142312. }
  142313. ret := &Operation{
  142314. ServerResponse: googleapi.ServerResponse{
  142315. Header: res.Header,
  142316. HTTPStatusCode: res.StatusCode,
  142317. },
  142318. }
  142319. target := &ret
  142320. if err := gensupport.DecodeResponse(target, res); err != nil {
  142321. return nil, err
  142322. }
  142323. return ret, nil
  142324. // {
  142325. // "description": "Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  142326. // "httpMethod": "POST",
  142327. // "id": "compute.vpnGateways.setLabels",
  142328. // "parameterOrder": [
  142329. // "project",
  142330. // "region",
  142331. // "resource"
  142332. // ],
  142333. // "parameters": {
  142334. // "project": {
  142335. // "description": "Project ID for this request.",
  142336. // "location": "path",
  142337. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142338. // "required": true,
  142339. // "type": "string"
  142340. // },
  142341. // "region": {
  142342. // "description": "The region for this request.",
  142343. // "location": "path",
  142344. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  142345. // "required": true,
  142346. // "type": "string"
  142347. // },
  142348. // "requestId": {
  142349. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  142350. // "location": "query",
  142351. // "type": "string"
  142352. // },
  142353. // "resource": {
  142354. // "description": "Name or id of the resource for this request.",
  142355. // "location": "path",
  142356. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  142357. // "required": true,
  142358. // "type": "string"
  142359. // }
  142360. // },
  142361. // "path": "{project}/regions/{region}/vpnGateways/{resource}/setLabels",
  142362. // "request": {
  142363. // "$ref": "RegionSetLabelsRequest"
  142364. // },
  142365. // "response": {
  142366. // "$ref": "Operation"
  142367. // },
  142368. // "scopes": [
  142369. // "https://www.googleapis.com/auth/cloud-platform",
  142370. // "https://www.googleapis.com/auth/compute"
  142371. // ]
  142372. // }
  142373. }
  142374. // method id "compute.vpnGateways.testIamPermissions":
  142375. type VpnGatewaysTestIamPermissionsCall struct {
  142376. s *Service
  142377. project string
  142378. region string
  142379. resource string
  142380. testpermissionsrequest *TestPermissionsRequest
  142381. urlParams_ gensupport.URLParams
  142382. ctx_ context.Context
  142383. header_ http.Header
  142384. }
  142385. // TestIamPermissions: Returns permissions that a caller has on the
  142386. // specified resource.
  142387. func (r *VpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnGatewaysTestIamPermissionsCall {
  142388. c := &VpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142389. c.project = project
  142390. c.region = region
  142391. c.resource = resource
  142392. c.testpermissionsrequest = testpermissionsrequest
  142393. return c
  142394. }
  142395. // Fields allows partial responses to be retrieved. See
  142396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142397. // for more information.
  142398. func (c *VpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnGatewaysTestIamPermissionsCall {
  142399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142400. return c
  142401. }
  142402. // Context sets the context to be used in this call's Do method. Any
  142403. // pending HTTP request will be aborted if the provided context is
  142404. // canceled.
  142405. func (c *VpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *VpnGatewaysTestIamPermissionsCall {
  142406. c.ctx_ = ctx
  142407. return c
  142408. }
  142409. // Header returns an http.Header that can be modified by the caller to
  142410. // add HTTP headers to the request.
  142411. func (c *VpnGatewaysTestIamPermissionsCall) Header() http.Header {
  142412. if c.header_ == nil {
  142413. c.header_ = make(http.Header)
  142414. }
  142415. return c.header_
  142416. }
  142417. func (c *VpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  142418. reqHeaders := make(http.Header)
  142419. for k, v := range c.header_ {
  142420. reqHeaders[k] = v
  142421. }
  142422. reqHeaders.Set("User-Agent", c.s.userAgent())
  142423. var body io.Reader = nil
  142424. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  142425. if err != nil {
  142426. return nil, err
  142427. }
  142428. reqHeaders.Set("Content-Type", "application/json")
  142429. c.urlParams_.Set("alt", alt)
  142430. c.urlParams_.Set("prettyPrint", "false")
  142431. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions")
  142432. urls += "?" + c.urlParams_.Encode()
  142433. req, err := http.NewRequest("POST", urls, body)
  142434. if err != nil {
  142435. return nil, err
  142436. }
  142437. req.Header = reqHeaders
  142438. googleapi.Expand(req.URL, map[string]string{
  142439. "project": c.project,
  142440. "region": c.region,
  142441. "resource": c.resource,
  142442. })
  142443. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142444. }
  142445. // Do executes the "compute.vpnGateways.testIamPermissions" call.
  142446. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  142447. // non-2xx status code is an error. Response headers are in either
  142448. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  142449. // returned at all) in error.(*googleapi.Error).Header. Use
  142450. // googleapi.IsNotModified to check whether the returned error was
  142451. // because http.StatusNotModified was returned.
  142452. func (c *VpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  142453. gensupport.SetOptions(c.urlParams_, opts...)
  142454. res, err := c.doRequest("json")
  142455. if res != nil && res.StatusCode == http.StatusNotModified {
  142456. if res.Body != nil {
  142457. res.Body.Close()
  142458. }
  142459. return nil, &googleapi.Error{
  142460. Code: res.StatusCode,
  142461. Header: res.Header,
  142462. }
  142463. }
  142464. if err != nil {
  142465. return nil, err
  142466. }
  142467. defer googleapi.CloseBody(res)
  142468. if err := googleapi.CheckResponse(res); err != nil {
  142469. return nil, err
  142470. }
  142471. ret := &TestPermissionsResponse{
  142472. ServerResponse: googleapi.ServerResponse{
  142473. Header: res.Header,
  142474. HTTPStatusCode: res.StatusCode,
  142475. },
  142476. }
  142477. target := &ret
  142478. if err := gensupport.DecodeResponse(target, res); err != nil {
  142479. return nil, err
  142480. }
  142481. return ret, nil
  142482. // {
  142483. // "description": "Returns permissions that a caller has on the specified resource.",
  142484. // "httpMethod": "POST",
  142485. // "id": "compute.vpnGateways.testIamPermissions",
  142486. // "parameterOrder": [
  142487. // "project",
  142488. // "region",
  142489. // "resource"
  142490. // ],
  142491. // "parameters": {
  142492. // "project": {
  142493. // "description": "Project ID for this request.",
  142494. // "location": "path",
  142495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142496. // "required": true,
  142497. // "type": "string"
  142498. // },
  142499. // "region": {
  142500. // "description": "The name of the region for this request.",
  142501. // "location": "path",
  142502. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  142503. // "required": true,
  142504. // "type": "string"
  142505. // },
  142506. // "resource": {
  142507. // "description": "Name or id of the resource for this request.",
  142508. // "location": "path",
  142509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  142510. // "required": true,
  142511. // "type": "string"
  142512. // }
  142513. // },
  142514. // "path": "{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions",
  142515. // "request": {
  142516. // "$ref": "TestPermissionsRequest"
  142517. // },
  142518. // "response": {
  142519. // "$ref": "TestPermissionsResponse"
  142520. // },
  142521. // "scopes": [
  142522. // "https://www.googleapis.com/auth/cloud-platform",
  142523. // "https://www.googleapis.com/auth/compute",
  142524. // "https://www.googleapis.com/auth/compute.readonly"
  142525. // ]
  142526. // }
  142527. }
  142528. // method id "compute.vpnTunnels.aggregatedList":
  142529. type VpnTunnelsAggregatedListCall struct {
  142530. s *Service
  142531. project string
  142532. urlParams_ gensupport.URLParams
  142533. ifNoneMatch_ string
  142534. ctx_ context.Context
  142535. header_ http.Header
  142536. }
  142537. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  142538. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  142539. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142540. c.project = project
  142541. return c
  142542. }
  142543. // Filter sets the optional parameter "filter": A filter expression that
  142544. // filters resources listed in the response. The expression must specify
  142545. // the field name, a comparison operator, and the value that you want to
  142546. // use for filtering. The value must be a string, a number, or a
  142547. // boolean. The comparison operator must be either =, !=, >, or <.
  142548. //
  142549. // For example, if you are filtering Compute Engine instances, you can
  142550. // exclude instances named example-instance by specifying name !=
  142551. // example-instance.
  142552. //
  142553. // You can also filter nested fields. For example, you could specify
  142554. // scheduling.automaticRestart = false to include instances only if they
  142555. // are not scheduled for automatic restarts. You can use filtering on
  142556. // nested fields to filter based on resource labels.
  142557. //
  142558. // To filter on multiple expressions, provide each separate expression
  142559. // within parentheses. For example, (scheduling.automaticRestart = true)
  142560. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  142561. // AND expression. However, you can include AND and OR expressions
  142562. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  142563. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  142564. // true).
  142565. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  142566. c.urlParams_.Set("filter", filter)
  142567. return c
  142568. }
  142569. // MaxResults sets the optional parameter "maxResults": The maximum
  142570. // number of results per page that should be returned. If the number of
  142571. // available results is larger than maxResults, Compute Engine returns a
  142572. // nextPageToken that can be used to get the next page of results in
  142573. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  142574. // (Default: 500)
  142575. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  142576. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  142577. return c
  142578. }
  142579. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  142580. // a certain order. By default, results are returned in alphanumerical
  142581. // order based on the resource name.
  142582. //
  142583. // You can also sort results in descending order based on the creation
  142584. // timestamp using orderBy="creationTimestamp desc". This sorts results
  142585. // based on the creationTimestamp field in reverse chronological order
  142586. // (newest result first). Use this to sort resources like operations so
  142587. // that the newest operation is returned first.
  142588. //
  142589. // Currently, only sorting by name or creationTimestamp desc is
  142590. // supported.
  142591. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  142592. c.urlParams_.Set("orderBy", orderBy)
  142593. return c
  142594. }
  142595. // PageToken sets the optional parameter "pageToken": Specifies a page
  142596. // token to use. Set pageToken to the nextPageToken returned by a
  142597. // previous list request to get the next page of results.
  142598. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  142599. c.urlParams_.Set("pageToken", pageToken)
  142600. return c
  142601. }
  142602. // Fields allows partial responses to be retrieved. See
  142603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142604. // for more information.
  142605. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  142606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142607. return c
  142608. }
  142609. // IfNoneMatch sets the optional parameter which makes the operation
  142610. // fail if the object's ETag matches the given value. This is useful for
  142611. // getting updates only after the object has changed since the last
  142612. // request. Use googleapi.IsNotModified to check whether the response
  142613. // error from Do is the result of In-None-Match.
  142614. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  142615. c.ifNoneMatch_ = entityTag
  142616. return c
  142617. }
  142618. // Context sets the context to be used in this call's Do method. Any
  142619. // pending HTTP request will be aborted if the provided context is
  142620. // canceled.
  142621. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  142622. c.ctx_ = ctx
  142623. return c
  142624. }
  142625. // Header returns an http.Header that can be modified by the caller to
  142626. // add HTTP headers to the request.
  142627. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  142628. if c.header_ == nil {
  142629. c.header_ = make(http.Header)
  142630. }
  142631. return c.header_
  142632. }
  142633. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  142634. reqHeaders := make(http.Header)
  142635. for k, v := range c.header_ {
  142636. reqHeaders[k] = v
  142637. }
  142638. reqHeaders.Set("User-Agent", c.s.userAgent())
  142639. if c.ifNoneMatch_ != "" {
  142640. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  142641. }
  142642. var body io.Reader = nil
  142643. c.urlParams_.Set("alt", alt)
  142644. c.urlParams_.Set("prettyPrint", "false")
  142645. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  142646. urls += "?" + c.urlParams_.Encode()
  142647. req, err := http.NewRequest("GET", urls, body)
  142648. if err != nil {
  142649. return nil, err
  142650. }
  142651. req.Header = reqHeaders
  142652. googleapi.Expand(req.URL, map[string]string{
  142653. "project": c.project,
  142654. })
  142655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142656. }
  142657. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  142658. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  142659. // non-2xx status code is an error. Response headers are in either
  142660. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  142661. // returned at all) in error.(*googleapi.Error).Header. Use
  142662. // googleapi.IsNotModified to check whether the returned error was
  142663. // because http.StatusNotModified was returned.
  142664. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  142665. gensupport.SetOptions(c.urlParams_, opts...)
  142666. res, err := c.doRequest("json")
  142667. if res != nil && res.StatusCode == http.StatusNotModified {
  142668. if res.Body != nil {
  142669. res.Body.Close()
  142670. }
  142671. return nil, &googleapi.Error{
  142672. Code: res.StatusCode,
  142673. Header: res.Header,
  142674. }
  142675. }
  142676. if err != nil {
  142677. return nil, err
  142678. }
  142679. defer googleapi.CloseBody(res)
  142680. if err := googleapi.CheckResponse(res); err != nil {
  142681. return nil, err
  142682. }
  142683. ret := &VpnTunnelAggregatedList{
  142684. ServerResponse: googleapi.ServerResponse{
  142685. Header: res.Header,
  142686. HTTPStatusCode: res.StatusCode,
  142687. },
  142688. }
  142689. target := &ret
  142690. if err := gensupport.DecodeResponse(target, res); err != nil {
  142691. return nil, err
  142692. }
  142693. return ret, nil
  142694. // {
  142695. // "description": "Retrieves an aggregated list of VPN tunnels.",
  142696. // "httpMethod": "GET",
  142697. // "id": "compute.vpnTunnels.aggregatedList",
  142698. // "parameterOrder": [
  142699. // "project"
  142700. // ],
  142701. // "parameters": {
  142702. // "filter": {
  142703. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  142704. // "location": "query",
  142705. // "type": "string"
  142706. // },
  142707. // "maxResults": {
  142708. // "default": "500",
  142709. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  142710. // "format": "uint32",
  142711. // "location": "query",
  142712. // "minimum": "0",
  142713. // "type": "integer"
  142714. // },
  142715. // "orderBy": {
  142716. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  142717. // "location": "query",
  142718. // "type": "string"
  142719. // },
  142720. // "pageToken": {
  142721. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  142722. // "location": "query",
  142723. // "type": "string"
  142724. // },
  142725. // "project": {
  142726. // "description": "Project ID for this request.",
  142727. // "location": "path",
  142728. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142729. // "required": true,
  142730. // "type": "string"
  142731. // }
  142732. // },
  142733. // "path": "{project}/aggregated/vpnTunnels",
  142734. // "response": {
  142735. // "$ref": "VpnTunnelAggregatedList"
  142736. // },
  142737. // "scopes": [
  142738. // "https://www.googleapis.com/auth/cloud-platform",
  142739. // "https://www.googleapis.com/auth/compute",
  142740. // "https://www.googleapis.com/auth/compute.readonly"
  142741. // ]
  142742. // }
  142743. }
  142744. // Pages invokes f for each page of results.
  142745. // A non-nil error returned from f will halt the iteration.
  142746. // The provided context supersedes any context provided to the Context method.
  142747. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  142748. c.ctx_ = ctx
  142749. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  142750. for {
  142751. x, err := c.Do()
  142752. if err != nil {
  142753. return err
  142754. }
  142755. if err := f(x); err != nil {
  142756. return err
  142757. }
  142758. if x.NextPageToken == "" {
  142759. return nil
  142760. }
  142761. c.PageToken(x.NextPageToken)
  142762. }
  142763. }
  142764. // method id "compute.vpnTunnels.delete":
  142765. type VpnTunnelsDeleteCall struct {
  142766. s *Service
  142767. project string
  142768. region string
  142769. vpnTunnel string
  142770. urlParams_ gensupport.URLParams
  142771. ctx_ context.Context
  142772. header_ http.Header
  142773. }
  142774. // Delete: Deletes the specified VpnTunnel resource.
  142775. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  142776. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142777. c.project = project
  142778. c.region = region
  142779. c.vpnTunnel = vpnTunnel
  142780. return c
  142781. }
  142782. // RequestId sets the optional parameter "requestId": An optional
  142783. // request ID to identify requests. Specify a unique request ID so that
  142784. // if you must retry your request, the server will know to ignore the
  142785. // request if it has already been completed.
  142786. //
  142787. // For example, consider a situation where you make an initial request
  142788. // and the request times out. If you make the request again with the
  142789. // same request ID, the server can check if original operation with the
  142790. // same request ID was received, and if so, will ignore the second
  142791. // request. This prevents clients from accidentally creating duplicate
  142792. // commitments.
  142793. //
  142794. // The request ID must be a valid UUID with the exception that zero UUID
  142795. // is not supported (00000000-0000-0000-0000-000000000000).
  142796. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  142797. c.urlParams_.Set("requestId", requestId)
  142798. return c
  142799. }
  142800. // Fields allows partial responses to be retrieved. See
  142801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142802. // for more information.
  142803. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  142804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142805. return c
  142806. }
  142807. // Context sets the context to be used in this call's Do method. Any
  142808. // pending HTTP request will be aborted if the provided context is
  142809. // canceled.
  142810. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  142811. c.ctx_ = ctx
  142812. return c
  142813. }
  142814. // Header returns an http.Header that can be modified by the caller to
  142815. // add HTTP headers to the request.
  142816. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  142817. if c.header_ == nil {
  142818. c.header_ = make(http.Header)
  142819. }
  142820. return c.header_
  142821. }
  142822. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  142823. reqHeaders := make(http.Header)
  142824. for k, v := range c.header_ {
  142825. reqHeaders[k] = v
  142826. }
  142827. reqHeaders.Set("User-Agent", c.s.userAgent())
  142828. var body io.Reader = nil
  142829. c.urlParams_.Set("alt", alt)
  142830. c.urlParams_.Set("prettyPrint", "false")
  142831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  142832. urls += "?" + c.urlParams_.Encode()
  142833. req, err := http.NewRequest("DELETE", urls, body)
  142834. if err != nil {
  142835. return nil, err
  142836. }
  142837. req.Header = reqHeaders
  142838. googleapi.Expand(req.URL, map[string]string{
  142839. "project": c.project,
  142840. "region": c.region,
  142841. "vpnTunnel": c.vpnTunnel,
  142842. })
  142843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  142844. }
  142845. // Do executes the "compute.vpnTunnels.delete" call.
  142846. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  142847. // status code is an error. Response headers are in either
  142848. // *Operation.ServerResponse.Header or (if a response was returned at
  142849. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  142850. // to check whether the returned error was because
  142851. // http.StatusNotModified was returned.
  142852. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  142853. gensupport.SetOptions(c.urlParams_, opts...)
  142854. res, err := c.doRequest("json")
  142855. if res != nil && res.StatusCode == http.StatusNotModified {
  142856. if res.Body != nil {
  142857. res.Body.Close()
  142858. }
  142859. return nil, &googleapi.Error{
  142860. Code: res.StatusCode,
  142861. Header: res.Header,
  142862. }
  142863. }
  142864. if err != nil {
  142865. return nil, err
  142866. }
  142867. defer googleapi.CloseBody(res)
  142868. if err := googleapi.CheckResponse(res); err != nil {
  142869. return nil, err
  142870. }
  142871. ret := &Operation{
  142872. ServerResponse: googleapi.ServerResponse{
  142873. Header: res.Header,
  142874. HTTPStatusCode: res.StatusCode,
  142875. },
  142876. }
  142877. target := &ret
  142878. if err := gensupport.DecodeResponse(target, res); err != nil {
  142879. return nil, err
  142880. }
  142881. return ret, nil
  142882. // {
  142883. // "description": "Deletes the specified VpnTunnel resource.",
  142884. // "httpMethod": "DELETE",
  142885. // "id": "compute.vpnTunnels.delete",
  142886. // "parameterOrder": [
  142887. // "project",
  142888. // "region",
  142889. // "vpnTunnel"
  142890. // ],
  142891. // "parameters": {
  142892. // "project": {
  142893. // "description": "Project ID for this request.",
  142894. // "location": "path",
  142895. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  142896. // "required": true,
  142897. // "type": "string"
  142898. // },
  142899. // "region": {
  142900. // "description": "Name of the region for this request.",
  142901. // "location": "path",
  142902. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  142903. // "required": true,
  142904. // "type": "string"
  142905. // },
  142906. // "requestId": {
  142907. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  142908. // "location": "query",
  142909. // "type": "string"
  142910. // },
  142911. // "vpnTunnel": {
  142912. // "description": "Name of the VpnTunnel resource to delete.",
  142913. // "location": "path",
  142914. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  142915. // "required": true,
  142916. // "type": "string"
  142917. // }
  142918. // },
  142919. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  142920. // "response": {
  142921. // "$ref": "Operation"
  142922. // },
  142923. // "scopes": [
  142924. // "https://www.googleapis.com/auth/cloud-platform",
  142925. // "https://www.googleapis.com/auth/compute"
  142926. // ]
  142927. // }
  142928. }
  142929. // method id "compute.vpnTunnels.get":
  142930. type VpnTunnelsGetCall struct {
  142931. s *Service
  142932. project string
  142933. region string
  142934. vpnTunnel string
  142935. urlParams_ gensupport.URLParams
  142936. ifNoneMatch_ string
  142937. ctx_ context.Context
  142938. header_ http.Header
  142939. }
  142940. // Get: Returns the specified VpnTunnel resource. Gets a list of
  142941. // available VPN tunnels by making a list() request.
  142942. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  142943. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  142944. c.project = project
  142945. c.region = region
  142946. c.vpnTunnel = vpnTunnel
  142947. return c
  142948. }
  142949. // Fields allows partial responses to be retrieved. See
  142950. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  142951. // for more information.
  142952. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  142953. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  142954. return c
  142955. }
  142956. // IfNoneMatch sets the optional parameter which makes the operation
  142957. // fail if the object's ETag matches the given value. This is useful for
  142958. // getting updates only after the object has changed since the last
  142959. // request. Use googleapi.IsNotModified to check whether the response
  142960. // error from Do is the result of In-None-Match.
  142961. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  142962. c.ifNoneMatch_ = entityTag
  142963. return c
  142964. }
  142965. // Context sets the context to be used in this call's Do method. Any
  142966. // pending HTTP request will be aborted if the provided context is
  142967. // canceled.
  142968. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  142969. c.ctx_ = ctx
  142970. return c
  142971. }
  142972. // Header returns an http.Header that can be modified by the caller to
  142973. // add HTTP headers to the request.
  142974. func (c *VpnTunnelsGetCall) Header() http.Header {
  142975. if c.header_ == nil {
  142976. c.header_ = make(http.Header)
  142977. }
  142978. return c.header_
  142979. }
  142980. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  142981. reqHeaders := make(http.Header)
  142982. for k, v := range c.header_ {
  142983. reqHeaders[k] = v
  142984. }
  142985. reqHeaders.Set("User-Agent", c.s.userAgent())
  142986. if c.ifNoneMatch_ != "" {
  142987. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  142988. }
  142989. var body io.Reader = nil
  142990. c.urlParams_.Set("alt", alt)
  142991. c.urlParams_.Set("prettyPrint", "false")
  142992. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  142993. urls += "?" + c.urlParams_.Encode()
  142994. req, err := http.NewRequest("GET", urls, body)
  142995. if err != nil {
  142996. return nil, err
  142997. }
  142998. req.Header = reqHeaders
  142999. googleapi.Expand(req.URL, map[string]string{
  143000. "project": c.project,
  143001. "region": c.region,
  143002. "vpnTunnel": c.vpnTunnel,
  143003. })
  143004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143005. }
  143006. // Do executes the "compute.vpnTunnels.get" call.
  143007. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  143008. // status code is an error. Response headers are in either
  143009. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  143010. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  143011. // to check whether the returned error was because
  143012. // http.StatusNotModified was returned.
  143013. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  143014. gensupport.SetOptions(c.urlParams_, opts...)
  143015. res, err := c.doRequest("json")
  143016. if res != nil && res.StatusCode == http.StatusNotModified {
  143017. if res.Body != nil {
  143018. res.Body.Close()
  143019. }
  143020. return nil, &googleapi.Error{
  143021. Code: res.StatusCode,
  143022. Header: res.Header,
  143023. }
  143024. }
  143025. if err != nil {
  143026. return nil, err
  143027. }
  143028. defer googleapi.CloseBody(res)
  143029. if err := googleapi.CheckResponse(res); err != nil {
  143030. return nil, err
  143031. }
  143032. ret := &VpnTunnel{
  143033. ServerResponse: googleapi.ServerResponse{
  143034. Header: res.Header,
  143035. HTTPStatusCode: res.StatusCode,
  143036. },
  143037. }
  143038. target := &ret
  143039. if err := gensupport.DecodeResponse(target, res); err != nil {
  143040. return nil, err
  143041. }
  143042. return ret, nil
  143043. // {
  143044. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  143045. // "httpMethod": "GET",
  143046. // "id": "compute.vpnTunnels.get",
  143047. // "parameterOrder": [
  143048. // "project",
  143049. // "region",
  143050. // "vpnTunnel"
  143051. // ],
  143052. // "parameters": {
  143053. // "project": {
  143054. // "description": "Project ID for this request.",
  143055. // "location": "path",
  143056. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143057. // "required": true,
  143058. // "type": "string"
  143059. // },
  143060. // "region": {
  143061. // "description": "Name of the region for this request.",
  143062. // "location": "path",
  143063. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  143064. // "required": true,
  143065. // "type": "string"
  143066. // },
  143067. // "vpnTunnel": {
  143068. // "description": "Name of the VpnTunnel resource to return.",
  143069. // "location": "path",
  143070. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  143071. // "required": true,
  143072. // "type": "string"
  143073. // }
  143074. // },
  143075. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  143076. // "response": {
  143077. // "$ref": "VpnTunnel"
  143078. // },
  143079. // "scopes": [
  143080. // "https://www.googleapis.com/auth/cloud-platform",
  143081. // "https://www.googleapis.com/auth/compute",
  143082. // "https://www.googleapis.com/auth/compute.readonly"
  143083. // ]
  143084. // }
  143085. }
  143086. // method id "compute.vpnTunnels.insert":
  143087. type VpnTunnelsInsertCall struct {
  143088. s *Service
  143089. project string
  143090. region string
  143091. vpntunnel *VpnTunnel
  143092. urlParams_ gensupport.URLParams
  143093. ctx_ context.Context
  143094. header_ http.Header
  143095. }
  143096. // Insert: Creates a VpnTunnel resource in the specified project and
  143097. // region using the data included in the request.
  143098. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  143099. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143100. c.project = project
  143101. c.region = region
  143102. c.vpntunnel = vpntunnel
  143103. return c
  143104. }
  143105. // RequestId sets the optional parameter "requestId": An optional
  143106. // request ID to identify requests. Specify a unique request ID so that
  143107. // if you must retry your request, the server will know to ignore the
  143108. // request if it has already been completed.
  143109. //
  143110. // For example, consider a situation where you make an initial request
  143111. // and the request times out. If you make the request again with the
  143112. // same request ID, the server can check if original operation with the
  143113. // same request ID was received, and if so, will ignore the second
  143114. // request. This prevents clients from accidentally creating duplicate
  143115. // commitments.
  143116. //
  143117. // The request ID must be a valid UUID with the exception that zero UUID
  143118. // is not supported (00000000-0000-0000-0000-000000000000).
  143119. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  143120. c.urlParams_.Set("requestId", requestId)
  143121. return c
  143122. }
  143123. // Fields allows partial responses to be retrieved. See
  143124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143125. // for more information.
  143126. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  143127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143128. return c
  143129. }
  143130. // Context sets the context to be used in this call's Do method. Any
  143131. // pending HTTP request will be aborted if the provided context is
  143132. // canceled.
  143133. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  143134. c.ctx_ = ctx
  143135. return c
  143136. }
  143137. // Header returns an http.Header that can be modified by the caller to
  143138. // add HTTP headers to the request.
  143139. func (c *VpnTunnelsInsertCall) Header() http.Header {
  143140. if c.header_ == nil {
  143141. c.header_ = make(http.Header)
  143142. }
  143143. return c.header_
  143144. }
  143145. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  143146. reqHeaders := make(http.Header)
  143147. for k, v := range c.header_ {
  143148. reqHeaders[k] = v
  143149. }
  143150. reqHeaders.Set("User-Agent", c.s.userAgent())
  143151. var body io.Reader = nil
  143152. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  143153. if err != nil {
  143154. return nil, err
  143155. }
  143156. reqHeaders.Set("Content-Type", "application/json")
  143157. c.urlParams_.Set("alt", alt)
  143158. c.urlParams_.Set("prettyPrint", "false")
  143159. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  143160. urls += "?" + c.urlParams_.Encode()
  143161. req, err := http.NewRequest("POST", urls, body)
  143162. if err != nil {
  143163. return nil, err
  143164. }
  143165. req.Header = reqHeaders
  143166. googleapi.Expand(req.URL, map[string]string{
  143167. "project": c.project,
  143168. "region": c.region,
  143169. })
  143170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143171. }
  143172. // Do executes the "compute.vpnTunnels.insert" call.
  143173. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  143174. // status code is an error. Response headers are in either
  143175. // *Operation.ServerResponse.Header or (if a response was returned at
  143176. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  143177. // to check whether the returned error was because
  143178. // http.StatusNotModified was returned.
  143179. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  143180. gensupport.SetOptions(c.urlParams_, opts...)
  143181. res, err := c.doRequest("json")
  143182. if res != nil && res.StatusCode == http.StatusNotModified {
  143183. if res.Body != nil {
  143184. res.Body.Close()
  143185. }
  143186. return nil, &googleapi.Error{
  143187. Code: res.StatusCode,
  143188. Header: res.Header,
  143189. }
  143190. }
  143191. if err != nil {
  143192. return nil, err
  143193. }
  143194. defer googleapi.CloseBody(res)
  143195. if err := googleapi.CheckResponse(res); err != nil {
  143196. return nil, err
  143197. }
  143198. ret := &Operation{
  143199. ServerResponse: googleapi.ServerResponse{
  143200. Header: res.Header,
  143201. HTTPStatusCode: res.StatusCode,
  143202. },
  143203. }
  143204. target := &ret
  143205. if err := gensupport.DecodeResponse(target, res); err != nil {
  143206. return nil, err
  143207. }
  143208. return ret, nil
  143209. // {
  143210. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  143211. // "httpMethod": "POST",
  143212. // "id": "compute.vpnTunnels.insert",
  143213. // "parameterOrder": [
  143214. // "project",
  143215. // "region"
  143216. // ],
  143217. // "parameters": {
  143218. // "project": {
  143219. // "description": "Project ID for this request.",
  143220. // "location": "path",
  143221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143222. // "required": true,
  143223. // "type": "string"
  143224. // },
  143225. // "region": {
  143226. // "description": "Name of the region for this request.",
  143227. // "location": "path",
  143228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  143229. // "required": true,
  143230. // "type": "string"
  143231. // },
  143232. // "requestId": {
  143233. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  143234. // "location": "query",
  143235. // "type": "string"
  143236. // }
  143237. // },
  143238. // "path": "{project}/regions/{region}/vpnTunnels",
  143239. // "request": {
  143240. // "$ref": "VpnTunnel"
  143241. // },
  143242. // "response": {
  143243. // "$ref": "Operation"
  143244. // },
  143245. // "scopes": [
  143246. // "https://www.googleapis.com/auth/cloud-platform",
  143247. // "https://www.googleapis.com/auth/compute"
  143248. // ]
  143249. // }
  143250. }
  143251. // method id "compute.vpnTunnels.list":
  143252. type VpnTunnelsListCall struct {
  143253. s *Service
  143254. project string
  143255. region string
  143256. urlParams_ gensupport.URLParams
  143257. ifNoneMatch_ string
  143258. ctx_ context.Context
  143259. header_ http.Header
  143260. }
  143261. // List: Retrieves a list of VpnTunnel resources contained in the
  143262. // specified project and region.
  143263. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  143264. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143265. c.project = project
  143266. c.region = region
  143267. return c
  143268. }
  143269. // Filter sets the optional parameter "filter": A filter expression that
  143270. // filters resources listed in the response. The expression must specify
  143271. // the field name, a comparison operator, and the value that you want to
  143272. // use for filtering. The value must be a string, a number, or a
  143273. // boolean. The comparison operator must be either =, !=, >, or <.
  143274. //
  143275. // For example, if you are filtering Compute Engine instances, you can
  143276. // exclude instances named example-instance by specifying name !=
  143277. // example-instance.
  143278. //
  143279. // You can also filter nested fields. For example, you could specify
  143280. // scheduling.automaticRestart = false to include instances only if they
  143281. // are not scheduled for automatic restarts. You can use filtering on
  143282. // nested fields to filter based on resource labels.
  143283. //
  143284. // To filter on multiple expressions, provide each separate expression
  143285. // within parentheses. For example, (scheduling.automaticRestart = true)
  143286. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  143287. // AND expression. However, you can include AND and OR expressions
  143288. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  143289. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  143290. // true).
  143291. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  143292. c.urlParams_.Set("filter", filter)
  143293. return c
  143294. }
  143295. // MaxResults sets the optional parameter "maxResults": The maximum
  143296. // number of results per page that should be returned. If the number of
  143297. // available results is larger than maxResults, Compute Engine returns a
  143298. // nextPageToken that can be used to get the next page of results in
  143299. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  143300. // (Default: 500)
  143301. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  143302. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  143303. return c
  143304. }
  143305. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  143306. // a certain order. By default, results are returned in alphanumerical
  143307. // order based on the resource name.
  143308. //
  143309. // You can also sort results in descending order based on the creation
  143310. // timestamp using orderBy="creationTimestamp desc". This sorts results
  143311. // based on the creationTimestamp field in reverse chronological order
  143312. // (newest result first). Use this to sort resources like operations so
  143313. // that the newest operation is returned first.
  143314. //
  143315. // Currently, only sorting by name or creationTimestamp desc is
  143316. // supported.
  143317. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  143318. c.urlParams_.Set("orderBy", orderBy)
  143319. return c
  143320. }
  143321. // PageToken sets the optional parameter "pageToken": Specifies a page
  143322. // token to use. Set pageToken to the nextPageToken returned by a
  143323. // previous list request to get the next page of results.
  143324. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  143325. c.urlParams_.Set("pageToken", pageToken)
  143326. return c
  143327. }
  143328. // Fields allows partial responses to be retrieved. See
  143329. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143330. // for more information.
  143331. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  143332. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143333. return c
  143334. }
  143335. // IfNoneMatch sets the optional parameter which makes the operation
  143336. // fail if the object's ETag matches the given value. This is useful for
  143337. // getting updates only after the object has changed since the last
  143338. // request. Use googleapi.IsNotModified to check whether the response
  143339. // error from Do is the result of In-None-Match.
  143340. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  143341. c.ifNoneMatch_ = entityTag
  143342. return c
  143343. }
  143344. // Context sets the context to be used in this call's Do method. Any
  143345. // pending HTTP request will be aborted if the provided context is
  143346. // canceled.
  143347. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  143348. c.ctx_ = ctx
  143349. return c
  143350. }
  143351. // Header returns an http.Header that can be modified by the caller to
  143352. // add HTTP headers to the request.
  143353. func (c *VpnTunnelsListCall) Header() http.Header {
  143354. if c.header_ == nil {
  143355. c.header_ = make(http.Header)
  143356. }
  143357. return c.header_
  143358. }
  143359. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  143360. reqHeaders := make(http.Header)
  143361. for k, v := range c.header_ {
  143362. reqHeaders[k] = v
  143363. }
  143364. reqHeaders.Set("User-Agent", c.s.userAgent())
  143365. if c.ifNoneMatch_ != "" {
  143366. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  143367. }
  143368. var body io.Reader = nil
  143369. c.urlParams_.Set("alt", alt)
  143370. c.urlParams_.Set("prettyPrint", "false")
  143371. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  143372. urls += "?" + c.urlParams_.Encode()
  143373. req, err := http.NewRequest("GET", urls, body)
  143374. if err != nil {
  143375. return nil, err
  143376. }
  143377. req.Header = reqHeaders
  143378. googleapi.Expand(req.URL, map[string]string{
  143379. "project": c.project,
  143380. "region": c.region,
  143381. })
  143382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143383. }
  143384. // Do executes the "compute.vpnTunnels.list" call.
  143385. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  143386. // status code is an error. Response headers are in either
  143387. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  143388. // at all) in error.(*googleapi.Error).Header. Use
  143389. // googleapi.IsNotModified to check whether the returned error was
  143390. // because http.StatusNotModified was returned.
  143391. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  143392. gensupport.SetOptions(c.urlParams_, opts...)
  143393. res, err := c.doRequest("json")
  143394. if res != nil && res.StatusCode == http.StatusNotModified {
  143395. if res.Body != nil {
  143396. res.Body.Close()
  143397. }
  143398. return nil, &googleapi.Error{
  143399. Code: res.StatusCode,
  143400. Header: res.Header,
  143401. }
  143402. }
  143403. if err != nil {
  143404. return nil, err
  143405. }
  143406. defer googleapi.CloseBody(res)
  143407. if err := googleapi.CheckResponse(res); err != nil {
  143408. return nil, err
  143409. }
  143410. ret := &VpnTunnelList{
  143411. ServerResponse: googleapi.ServerResponse{
  143412. Header: res.Header,
  143413. HTTPStatusCode: res.StatusCode,
  143414. },
  143415. }
  143416. target := &ret
  143417. if err := gensupport.DecodeResponse(target, res); err != nil {
  143418. return nil, err
  143419. }
  143420. return ret, nil
  143421. // {
  143422. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  143423. // "httpMethod": "GET",
  143424. // "id": "compute.vpnTunnels.list",
  143425. // "parameterOrder": [
  143426. // "project",
  143427. // "region"
  143428. // ],
  143429. // "parameters": {
  143430. // "filter": {
  143431. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  143432. // "location": "query",
  143433. // "type": "string"
  143434. // },
  143435. // "maxResults": {
  143436. // "default": "500",
  143437. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  143438. // "format": "uint32",
  143439. // "location": "query",
  143440. // "minimum": "0",
  143441. // "type": "integer"
  143442. // },
  143443. // "orderBy": {
  143444. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  143445. // "location": "query",
  143446. // "type": "string"
  143447. // },
  143448. // "pageToken": {
  143449. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  143450. // "location": "query",
  143451. // "type": "string"
  143452. // },
  143453. // "project": {
  143454. // "description": "Project ID for this request.",
  143455. // "location": "path",
  143456. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143457. // "required": true,
  143458. // "type": "string"
  143459. // },
  143460. // "region": {
  143461. // "description": "Name of the region for this request.",
  143462. // "location": "path",
  143463. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  143464. // "required": true,
  143465. // "type": "string"
  143466. // }
  143467. // },
  143468. // "path": "{project}/regions/{region}/vpnTunnels",
  143469. // "response": {
  143470. // "$ref": "VpnTunnelList"
  143471. // },
  143472. // "scopes": [
  143473. // "https://www.googleapis.com/auth/cloud-platform",
  143474. // "https://www.googleapis.com/auth/compute",
  143475. // "https://www.googleapis.com/auth/compute.readonly"
  143476. // ]
  143477. // }
  143478. }
  143479. // Pages invokes f for each page of results.
  143480. // A non-nil error returned from f will halt the iteration.
  143481. // The provided context supersedes any context provided to the Context method.
  143482. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  143483. c.ctx_ = ctx
  143484. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  143485. for {
  143486. x, err := c.Do()
  143487. if err != nil {
  143488. return err
  143489. }
  143490. if err := f(x); err != nil {
  143491. return err
  143492. }
  143493. if x.NextPageToken == "" {
  143494. return nil
  143495. }
  143496. c.PageToken(x.NextPageToken)
  143497. }
  143498. }
  143499. // method id "compute.vpnTunnels.setLabels":
  143500. type VpnTunnelsSetLabelsCall struct {
  143501. s *Service
  143502. project string
  143503. region string
  143504. resource string
  143505. regionsetlabelsrequest *RegionSetLabelsRequest
  143506. urlParams_ gensupport.URLParams
  143507. ctx_ context.Context
  143508. header_ http.Header
  143509. }
  143510. // SetLabels: Sets the labels on a VpnTunnel. To learn more about
  143511. // labels, read the Labeling Resources documentation.
  143512. func (r *VpnTunnelsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnTunnelsSetLabelsCall {
  143513. c := &VpnTunnelsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143514. c.project = project
  143515. c.region = region
  143516. c.resource = resource
  143517. c.regionsetlabelsrequest = regionsetlabelsrequest
  143518. return c
  143519. }
  143520. // RequestId sets the optional parameter "requestId": An optional
  143521. // request ID to identify requests. Specify a unique request ID so that
  143522. // if you must retry your request, the server will know to ignore the
  143523. // request if it has already been completed.
  143524. //
  143525. // For example, consider a situation where you make an initial request
  143526. // and the request times out. If you make the request again with the
  143527. // same request ID, the server can check if original operation with the
  143528. // same request ID was received, and if so, will ignore the second
  143529. // request. This prevents clients from accidentally creating duplicate
  143530. // commitments.
  143531. //
  143532. // The request ID must be a valid UUID with the exception that zero UUID
  143533. // is not supported (00000000-0000-0000-0000-000000000000).
  143534. func (c *VpnTunnelsSetLabelsCall) RequestId(requestId string) *VpnTunnelsSetLabelsCall {
  143535. c.urlParams_.Set("requestId", requestId)
  143536. return c
  143537. }
  143538. // Fields allows partial responses to be retrieved. See
  143539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143540. // for more information.
  143541. func (c *VpnTunnelsSetLabelsCall) Fields(s ...googleapi.Field) *VpnTunnelsSetLabelsCall {
  143542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143543. return c
  143544. }
  143545. // Context sets the context to be used in this call's Do method. Any
  143546. // pending HTTP request will be aborted if the provided context is
  143547. // canceled.
  143548. func (c *VpnTunnelsSetLabelsCall) Context(ctx context.Context) *VpnTunnelsSetLabelsCall {
  143549. c.ctx_ = ctx
  143550. return c
  143551. }
  143552. // Header returns an http.Header that can be modified by the caller to
  143553. // add HTTP headers to the request.
  143554. func (c *VpnTunnelsSetLabelsCall) Header() http.Header {
  143555. if c.header_ == nil {
  143556. c.header_ = make(http.Header)
  143557. }
  143558. return c.header_
  143559. }
  143560. func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  143561. reqHeaders := make(http.Header)
  143562. for k, v := range c.header_ {
  143563. reqHeaders[k] = v
  143564. }
  143565. reqHeaders.Set("User-Agent", c.s.userAgent())
  143566. var body io.Reader = nil
  143567. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  143568. if err != nil {
  143569. return nil, err
  143570. }
  143571. reqHeaders.Set("Content-Type", "application/json")
  143572. c.urlParams_.Set("alt", alt)
  143573. c.urlParams_.Set("prettyPrint", "false")
  143574. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/setLabels")
  143575. urls += "?" + c.urlParams_.Encode()
  143576. req, err := http.NewRequest("POST", urls, body)
  143577. if err != nil {
  143578. return nil, err
  143579. }
  143580. req.Header = reqHeaders
  143581. googleapi.Expand(req.URL, map[string]string{
  143582. "project": c.project,
  143583. "region": c.region,
  143584. "resource": c.resource,
  143585. })
  143586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143587. }
  143588. // Do executes the "compute.vpnTunnels.setLabels" call.
  143589. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  143590. // status code is an error. Response headers are in either
  143591. // *Operation.ServerResponse.Header or (if a response was returned at
  143592. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  143593. // to check whether the returned error was because
  143594. // http.StatusNotModified was returned.
  143595. func (c *VpnTunnelsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  143596. gensupport.SetOptions(c.urlParams_, opts...)
  143597. res, err := c.doRequest("json")
  143598. if res != nil && res.StatusCode == http.StatusNotModified {
  143599. if res.Body != nil {
  143600. res.Body.Close()
  143601. }
  143602. return nil, &googleapi.Error{
  143603. Code: res.StatusCode,
  143604. Header: res.Header,
  143605. }
  143606. }
  143607. if err != nil {
  143608. return nil, err
  143609. }
  143610. defer googleapi.CloseBody(res)
  143611. if err := googleapi.CheckResponse(res); err != nil {
  143612. return nil, err
  143613. }
  143614. ret := &Operation{
  143615. ServerResponse: googleapi.ServerResponse{
  143616. Header: res.Header,
  143617. HTTPStatusCode: res.StatusCode,
  143618. },
  143619. }
  143620. target := &ret
  143621. if err := gensupport.DecodeResponse(target, res); err != nil {
  143622. return nil, err
  143623. }
  143624. return ret, nil
  143625. // {
  143626. // "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.",
  143627. // "httpMethod": "POST",
  143628. // "id": "compute.vpnTunnels.setLabels",
  143629. // "parameterOrder": [
  143630. // "project",
  143631. // "region",
  143632. // "resource"
  143633. // ],
  143634. // "parameters": {
  143635. // "project": {
  143636. // "description": "Project ID for this request.",
  143637. // "location": "path",
  143638. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143639. // "required": true,
  143640. // "type": "string"
  143641. // },
  143642. // "region": {
  143643. // "description": "The region for this request.",
  143644. // "location": "path",
  143645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  143646. // "required": true,
  143647. // "type": "string"
  143648. // },
  143649. // "requestId": {
  143650. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  143651. // "location": "query",
  143652. // "type": "string"
  143653. // },
  143654. // "resource": {
  143655. // "description": "Name or id of the resource for this request.",
  143656. // "location": "path",
  143657. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  143658. // "required": true,
  143659. // "type": "string"
  143660. // }
  143661. // },
  143662. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
  143663. // "request": {
  143664. // "$ref": "RegionSetLabelsRequest"
  143665. // },
  143666. // "response": {
  143667. // "$ref": "Operation"
  143668. // },
  143669. // "scopes": [
  143670. // "https://www.googleapis.com/auth/cloud-platform",
  143671. // "https://www.googleapis.com/auth/compute"
  143672. // ]
  143673. // }
  143674. }
  143675. // method id "compute.vpnTunnels.testIamPermissions":
  143676. type VpnTunnelsTestIamPermissionsCall struct {
  143677. s *Service
  143678. project string
  143679. region string
  143680. resource string
  143681. testpermissionsrequest *TestPermissionsRequest
  143682. urlParams_ gensupport.URLParams
  143683. ctx_ context.Context
  143684. header_ http.Header
  143685. }
  143686. // TestIamPermissions: Returns permissions that a caller has on the
  143687. // specified resource.
  143688. func (r *VpnTunnelsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnTunnelsTestIamPermissionsCall {
  143689. c := &VpnTunnelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143690. c.project = project
  143691. c.region = region
  143692. c.resource = resource
  143693. c.testpermissionsrequest = testpermissionsrequest
  143694. return c
  143695. }
  143696. // Fields allows partial responses to be retrieved. See
  143697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143698. // for more information.
  143699. func (c *VpnTunnelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnTunnelsTestIamPermissionsCall {
  143700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143701. return c
  143702. }
  143703. // Context sets the context to be used in this call's Do method. Any
  143704. // pending HTTP request will be aborted if the provided context is
  143705. // canceled.
  143706. func (c *VpnTunnelsTestIamPermissionsCall) Context(ctx context.Context) *VpnTunnelsTestIamPermissionsCall {
  143707. c.ctx_ = ctx
  143708. return c
  143709. }
  143710. // Header returns an http.Header that can be modified by the caller to
  143711. // add HTTP headers to the request.
  143712. func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header {
  143713. if c.header_ == nil {
  143714. c.header_ = make(http.Header)
  143715. }
  143716. return c.header_
  143717. }
  143718. func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  143719. reqHeaders := make(http.Header)
  143720. for k, v := range c.header_ {
  143721. reqHeaders[k] = v
  143722. }
  143723. reqHeaders.Set("User-Agent", c.s.userAgent())
  143724. var body io.Reader = nil
  143725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  143726. if err != nil {
  143727. return nil, err
  143728. }
  143729. reqHeaders.Set("Content-Type", "application/json")
  143730. c.urlParams_.Set("alt", alt)
  143731. c.urlParams_.Set("prettyPrint", "false")
  143732. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions")
  143733. urls += "?" + c.urlParams_.Encode()
  143734. req, err := http.NewRequest("POST", urls, body)
  143735. if err != nil {
  143736. return nil, err
  143737. }
  143738. req.Header = reqHeaders
  143739. googleapi.Expand(req.URL, map[string]string{
  143740. "project": c.project,
  143741. "region": c.region,
  143742. "resource": c.resource,
  143743. })
  143744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143745. }
  143746. // Do executes the "compute.vpnTunnels.testIamPermissions" call.
  143747. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  143748. // non-2xx status code is an error. Response headers are in either
  143749. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  143750. // returned at all) in error.(*googleapi.Error).Header. Use
  143751. // googleapi.IsNotModified to check whether the returned error was
  143752. // because http.StatusNotModified was returned.
  143753. func (c *VpnTunnelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  143754. gensupport.SetOptions(c.urlParams_, opts...)
  143755. res, err := c.doRequest("json")
  143756. if res != nil && res.StatusCode == http.StatusNotModified {
  143757. if res.Body != nil {
  143758. res.Body.Close()
  143759. }
  143760. return nil, &googleapi.Error{
  143761. Code: res.StatusCode,
  143762. Header: res.Header,
  143763. }
  143764. }
  143765. if err != nil {
  143766. return nil, err
  143767. }
  143768. defer googleapi.CloseBody(res)
  143769. if err := googleapi.CheckResponse(res); err != nil {
  143770. return nil, err
  143771. }
  143772. ret := &TestPermissionsResponse{
  143773. ServerResponse: googleapi.ServerResponse{
  143774. Header: res.Header,
  143775. HTTPStatusCode: res.StatusCode,
  143776. },
  143777. }
  143778. target := &ret
  143779. if err := gensupport.DecodeResponse(target, res); err != nil {
  143780. return nil, err
  143781. }
  143782. return ret, nil
  143783. // {
  143784. // "description": "Returns permissions that a caller has on the specified resource.",
  143785. // "httpMethod": "POST",
  143786. // "id": "compute.vpnTunnels.testIamPermissions",
  143787. // "parameterOrder": [
  143788. // "project",
  143789. // "region",
  143790. // "resource"
  143791. // ],
  143792. // "parameters": {
  143793. // "project": {
  143794. // "description": "Project ID for this request.",
  143795. // "location": "path",
  143796. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143797. // "required": true,
  143798. // "type": "string"
  143799. // },
  143800. // "region": {
  143801. // "description": "The name of the region for this request.",
  143802. // "location": "path",
  143803. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  143804. // "required": true,
  143805. // "type": "string"
  143806. // },
  143807. // "resource": {
  143808. // "description": "Name or id of the resource for this request.",
  143809. // "location": "path",
  143810. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  143811. // "required": true,
  143812. // "type": "string"
  143813. // }
  143814. // },
  143815. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions",
  143816. // "request": {
  143817. // "$ref": "TestPermissionsRequest"
  143818. // },
  143819. // "response": {
  143820. // "$ref": "TestPermissionsResponse"
  143821. // },
  143822. // "scopes": [
  143823. // "https://www.googleapis.com/auth/cloud-platform",
  143824. // "https://www.googleapis.com/auth/compute",
  143825. // "https://www.googleapis.com/auth/compute.readonly"
  143826. // ]
  143827. // }
  143828. }
  143829. // method id "compute.zoneOperations.delete":
  143830. type ZoneOperationsDeleteCall struct {
  143831. s *Service
  143832. project string
  143833. zone string
  143834. operation string
  143835. urlParams_ gensupport.URLParams
  143836. ctx_ context.Context
  143837. header_ http.Header
  143838. }
  143839. // Delete: Deletes the specified zone-specific Operations resource.
  143840. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  143841. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  143842. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143843. c.project = project
  143844. c.zone = zone
  143845. c.operation = operation
  143846. return c
  143847. }
  143848. // Fields allows partial responses to be retrieved. See
  143849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143850. // for more information.
  143851. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  143852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143853. return c
  143854. }
  143855. // Context sets the context to be used in this call's Do method. Any
  143856. // pending HTTP request will be aborted if the provided context is
  143857. // canceled.
  143858. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  143859. c.ctx_ = ctx
  143860. return c
  143861. }
  143862. // Header returns an http.Header that can be modified by the caller to
  143863. // add HTTP headers to the request.
  143864. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  143865. if c.header_ == nil {
  143866. c.header_ = make(http.Header)
  143867. }
  143868. return c.header_
  143869. }
  143870. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  143871. reqHeaders := make(http.Header)
  143872. for k, v := range c.header_ {
  143873. reqHeaders[k] = v
  143874. }
  143875. reqHeaders.Set("User-Agent", c.s.userAgent())
  143876. var body io.Reader = nil
  143877. c.urlParams_.Set("alt", alt)
  143878. c.urlParams_.Set("prettyPrint", "false")
  143879. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  143880. urls += "?" + c.urlParams_.Encode()
  143881. req, err := http.NewRequest("DELETE", urls, body)
  143882. if err != nil {
  143883. return nil, err
  143884. }
  143885. req.Header = reqHeaders
  143886. googleapi.Expand(req.URL, map[string]string{
  143887. "project": c.project,
  143888. "zone": c.zone,
  143889. "operation": c.operation,
  143890. })
  143891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  143892. }
  143893. // Do executes the "compute.zoneOperations.delete" call.
  143894. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  143895. gensupport.SetOptions(c.urlParams_, opts...)
  143896. res, err := c.doRequest("json")
  143897. if err != nil {
  143898. return err
  143899. }
  143900. defer googleapi.CloseBody(res)
  143901. if err := googleapi.CheckResponse(res); err != nil {
  143902. return err
  143903. }
  143904. return nil
  143905. // {
  143906. // "description": "Deletes the specified zone-specific Operations resource.",
  143907. // "httpMethod": "DELETE",
  143908. // "id": "compute.zoneOperations.delete",
  143909. // "parameterOrder": [
  143910. // "project",
  143911. // "zone",
  143912. // "operation"
  143913. // ],
  143914. // "parameters": {
  143915. // "operation": {
  143916. // "description": "Name of the Operations resource to delete.",
  143917. // "location": "path",
  143918. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  143919. // "required": true,
  143920. // "type": "string"
  143921. // },
  143922. // "project": {
  143923. // "description": "Project ID for this request.",
  143924. // "location": "path",
  143925. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  143926. // "required": true,
  143927. // "type": "string"
  143928. // },
  143929. // "zone": {
  143930. // "description": "Name of the zone for this request.",
  143931. // "location": "path",
  143932. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  143933. // "required": true,
  143934. // "type": "string"
  143935. // }
  143936. // },
  143937. // "path": "{project}/zones/{zone}/operations/{operation}",
  143938. // "scopes": [
  143939. // "https://www.googleapis.com/auth/cloud-platform",
  143940. // "https://www.googleapis.com/auth/compute"
  143941. // ]
  143942. // }
  143943. }
  143944. // method id "compute.zoneOperations.get":
  143945. type ZoneOperationsGetCall struct {
  143946. s *Service
  143947. project string
  143948. zone string
  143949. operation string
  143950. urlParams_ gensupport.URLParams
  143951. ifNoneMatch_ string
  143952. ctx_ context.Context
  143953. header_ http.Header
  143954. }
  143955. // Get: Retrieves the specified zone-specific Operations resource.
  143956. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  143957. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  143958. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  143959. c.project = project
  143960. c.zone = zone
  143961. c.operation = operation
  143962. return c
  143963. }
  143964. // Fields allows partial responses to be retrieved. See
  143965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  143966. // for more information.
  143967. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  143968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  143969. return c
  143970. }
  143971. // IfNoneMatch sets the optional parameter which makes the operation
  143972. // fail if the object's ETag matches the given value. This is useful for
  143973. // getting updates only after the object has changed since the last
  143974. // request. Use googleapi.IsNotModified to check whether the response
  143975. // error from Do is the result of In-None-Match.
  143976. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  143977. c.ifNoneMatch_ = entityTag
  143978. return c
  143979. }
  143980. // Context sets the context to be used in this call's Do method. Any
  143981. // pending HTTP request will be aborted if the provided context is
  143982. // canceled.
  143983. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  143984. c.ctx_ = ctx
  143985. return c
  143986. }
  143987. // Header returns an http.Header that can be modified by the caller to
  143988. // add HTTP headers to the request.
  143989. func (c *ZoneOperationsGetCall) Header() http.Header {
  143990. if c.header_ == nil {
  143991. c.header_ = make(http.Header)
  143992. }
  143993. return c.header_
  143994. }
  143995. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  143996. reqHeaders := make(http.Header)
  143997. for k, v := range c.header_ {
  143998. reqHeaders[k] = v
  143999. }
  144000. reqHeaders.Set("User-Agent", c.s.userAgent())
  144001. if c.ifNoneMatch_ != "" {
  144002. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  144003. }
  144004. var body io.Reader = nil
  144005. c.urlParams_.Set("alt", alt)
  144006. c.urlParams_.Set("prettyPrint", "false")
  144007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  144008. urls += "?" + c.urlParams_.Encode()
  144009. req, err := http.NewRequest("GET", urls, body)
  144010. if err != nil {
  144011. return nil, err
  144012. }
  144013. req.Header = reqHeaders
  144014. googleapi.Expand(req.URL, map[string]string{
  144015. "project": c.project,
  144016. "zone": c.zone,
  144017. "operation": c.operation,
  144018. })
  144019. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144020. }
  144021. // Do executes the "compute.zoneOperations.get" call.
  144022. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  144023. // status code is an error. Response headers are in either
  144024. // *Operation.ServerResponse.Header or (if a response was returned at
  144025. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  144026. // to check whether the returned error was because
  144027. // http.StatusNotModified was returned.
  144028. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  144029. gensupport.SetOptions(c.urlParams_, opts...)
  144030. res, err := c.doRequest("json")
  144031. if res != nil && res.StatusCode == http.StatusNotModified {
  144032. if res.Body != nil {
  144033. res.Body.Close()
  144034. }
  144035. return nil, &googleapi.Error{
  144036. Code: res.StatusCode,
  144037. Header: res.Header,
  144038. }
  144039. }
  144040. if err != nil {
  144041. return nil, err
  144042. }
  144043. defer googleapi.CloseBody(res)
  144044. if err := googleapi.CheckResponse(res); err != nil {
  144045. return nil, err
  144046. }
  144047. ret := &Operation{
  144048. ServerResponse: googleapi.ServerResponse{
  144049. Header: res.Header,
  144050. HTTPStatusCode: res.StatusCode,
  144051. },
  144052. }
  144053. target := &ret
  144054. if err := gensupport.DecodeResponse(target, res); err != nil {
  144055. return nil, err
  144056. }
  144057. return ret, nil
  144058. // {
  144059. // "description": "Retrieves the specified zone-specific Operations resource.",
  144060. // "httpMethod": "GET",
  144061. // "id": "compute.zoneOperations.get",
  144062. // "parameterOrder": [
  144063. // "project",
  144064. // "zone",
  144065. // "operation"
  144066. // ],
  144067. // "parameters": {
  144068. // "operation": {
  144069. // "description": "Name of the Operations resource to return.",
  144070. // "location": "path",
  144071. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  144072. // "required": true,
  144073. // "type": "string"
  144074. // },
  144075. // "project": {
  144076. // "description": "Project ID for this request.",
  144077. // "location": "path",
  144078. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144079. // "required": true,
  144080. // "type": "string"
  144081. // },
  144082. // "zone": {
  144083. // "description": "Name of the zone for this request.",
  144084. // "location": "path",
  144085. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  144086. // "required": true,
  144087. // "type": "string"
  144088. // }
  144089. // },
  144090. // "path": "{project}/zones/{zone}/operations/{operation}",
  144091. // "response": {
  144092. // "$ref": "Operation"
  144093. // },
  144094. // "scopes": [
  144095. // "https://www.googleapis.com/auth/cloud-platform",
  144096. // "https://www.googleapis.com/auth/compute",
  144097. // "https://www.googleapis.com/auth/compute.readonly"
  144098. // ]
  144099. // }
  144100. }
  144101. // method id "compute.zoneOperations.list":
  144102. type ZoneOperationsListCall struct {
  144103. s *Service
  144104. project string
  144105. zone string
  144106. urlParams_ gensupport.URLParams
  144107. ifNoneMatch_ string
  144108. ctx_ context.Context
  144109. header_ http.Header
  144110. }
  144111. // List: Retrieves a list of Operation resources contained within the
  144112. // specified zone.
  144113. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  144114. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  144115. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144116. c.project = project
  144117. c.zone = zone
  144118. return c
  144119. }
  144120. // Filter sets the optional parameter "filter": A filter expression that
  144121. // filters resources listed in the response. The expression must specify
  144122. // the field name, a comparison operator, and the value that you want to
  144123. // use for filtering. The value must be a string, a number, or a
  144124. // boolean. The comparison operator must be either =, !=, >, or <.
  144125. //
  144126. // For example, if you are filtering Compute Engine instances, you can
  144127. // exclude instances named example-instance by specifying name !=
  144128. // example-instance.
  144129. //
  144130. // You can also filter nested fields. For example, you could specify
  144131. // scheduling.automaticRestart = false to include instances only if they
  144132. // are not scheduled for automatic restarts. You can use filtering on
  144133. // nested fields to filter based on resource labels.
  144134. //
  144135. // To filter on multiple expressions, provide each separate expression
  144136. // within parentheses. For example, (scheduling.automaticRestart = true)
  144137. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  144138. // AND expression. However, you can include AND and OR expressions
  144139. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  144140. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  144141. // true).
  144142. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  144143. c.urlParams_.Set("filter", filter)
  144144. return c
  144145. }
  144146. // MaxResults sets the optional parameter "maxResults": The maximum
  144147. // number of results per page that should be returned. If the number of
  144148. // available results is larger than maxResults, Compute Engine returns a
  144149. // nextPageToken that can be used to get the next page of results in
  144150. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  144151. // (Default: 500)
  144152. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  144153. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  144154. return c
  144155. }
  144156. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  144157. // a certain order. By default, results are returned in alphanumerical
  144158. // order based on the resource name.
  144159. //
  144160. // You can also sort results in descending order based on the creation
  144161. // timestamp using orderBy="creationTimestamp desc". This sorts results
  144162. // based on the creationTimestamp field in reverse chronological order
  144163. // (newest result first). Use this to sort resources like operations so
  144164. // that the newest operation is returned first.
  144165. //
  144166. // Currently, only sorting by name or creationTimestamp desc is
  144167. // supported.
  144168. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  144169. c.urlParams_.Set("orderBy", orderBy)
  144170. return c
  144171. }
  144172. // PageToken sets the optional parameter "pageToken": Specifies a page
  144173. // token to use. Set pageToken to the nextPageToken returned by a
  144174. // previous list request to get the next page of results.
  144175. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  144176. c.urlParams_.Set("pageToken", pageToken)
  144177. return c
  144178. }
  144179. // Fields allows partial responses to be retrieved. See
  144180. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144181. // for more information.
  144182. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  144183. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144184. return c
  144185. }
  144186. // IfNoneMatch sets the optional parameter which makes the operation
  144187. // fail if the object's ETag matches the given value. This is useful for
  144188. // getting updates only after the object has changed since the last
  144189. // request. Use googleapi.IsNotModified to check whether the response
  144190. // error from Do is the result of In-None-Match.
  144191. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  144192. c.ifNoneMatch_ = entityTag
  144193. return c
  144194. }
  144195. // Context sets the context to be used in this call's Do method. Any
  144196. // pending HTTP request will be aborted if the provided context is
  144197. // canceled.
  144198. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  144199. c.ctx_ = ctx
  144200. return c
  144201. }
  144202. // Header returns an http.Header that can be modified by the caller to
  144203. // add HTTP headers to the request.
  144204. func (c *ZoneOperationsListCall) Header() http.Header {
  144205. if c.header_ == nil {
  144206. c.header_ = make(http.Header)
  144207. }
  144208. return c.header_
  144209. }
  144210. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  144211. reqHeaders := make(http.Header)
  144212. for k, v := range c.header_ {
  144213. reqHeaders[k] = v
  144214. }
  144215. reqHeaders.Set("User-Agent", c.s.userAgent())
  144216. if c.ifNoneMatch_ != "" {
  144217. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  144218. }
  144219. var body io.Reader = nil
  144220. c.urlParams_.Set("alt", alt)
  144221. c.urlParams_.Set("prettyPrint", "false")
  144222. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  144223. urls += "?" + c.urlParams_.Encode()
  144224. req, err := http.NewRequest("GET", urls, body)
  144225. if err != nil {
  144226. return nil, err
  144227. }
  144228. req.Header = reqHeaders
  144229. googleapi.Expand(req.URL, map[string]string{
  144230. "project": c.project,
  144231. "zone": c.zone,
  144232. })
  144233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144234. }
  144235. // Do executes the "compute.zoneOperations.list" call.
  144236. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  144237. // status code is an error. Response headers are in either
  144238. // *OperationList.ServerResponse.Header or (if a response was returned
  144239. // at all) in error.(*googleapi.Error).Header. Use
  144240. // googleapi.IsNotModified to check whether the returned error was
  144241. // because http.StatusNotModified was returned.
  144242. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  144243. gensupport.SetOptions(c.urlParams_, opts...)
  144244. res, err := c.doRequest("json")
  144245. if res != nil && res.StatusCode == http.StatusNotModified {
  144246. if res.Body != nil {
  144247. res.Body.Close()
  144248. }
  144249. return nil, &googleapi.Error{
  144250. Code: res.StatusCode,
  144251. Header: res.Header,
  144252. }
  144253. }
  144254. if err != nil {
  144255. return nil, err
  144256. }
  144257. defer googleapi.CloseBody(res)
  144258. if err := googleapi.CheckResponse(res); err != nil {
  144259. return nil, err
  144260. }
  144261. ret := &OperationList{
  144262. ServerResponse: googleapi.ServerResponse{
  144263. Header: res.Header,
  144264. HTTPStatusCode: res.StatusCode,
  144265. },
  144266. }
  144267. target := &ret
  144268. if err := gensupport.DecodeResponse(target, res); err != nil {
  144269. return nil, err
  144270. }
  144271. return ret, nil
  144272. // {
  144273. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  144274. // "httpMethod": "GET",
  144275. // "id": "compute.zoneOperations.list",
  144276. // "parameterOrder": [
  144277. // "project",
  144278. // "zone"
  144279. // ],
  144280. // "parameters": {
  144281. // "filter": {
  144282. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  144283. // "location": "query",
  144284. // "type": "string"
  144285. // },
  144286. // "maxResults": {
  144287. // "default": "500",
  144288. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  144289. // "format": "uint32",
  144290. // "location": "query",
  144291. // "minimum": "0",
  144292. // "type": "integer"
  144293. // },
  144294. // "orderBy": {
  144295. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  144296. // "location": "query",
  144297. // "type": "string"
  144298. // },
  144299. // "pageToken": {
  144300. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  144301. // "location": "query",
  144302. // "type": "string"
  144303. // },
  144304. // "project": {
  144305. // "description": "Project ID for this request.",
  144306. // "location": "path",
  144307. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144308. // "required": true,
  144309. // "type": "string"
  144310. // },
  144311. // "zone": {
  144312. // "description": "Name of the zone for request.",
  144313. // "location": "path",
  144314. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  144315. // "required": true,
  144316. // "type": "string"
  144317. // }
  144318. // },
  144319. // "path": "{project}/zones/{zone}/operations",
  144320. // "response": {
  144321. // "$ref": "OperationList"
  144322. // },
  144323. // "scopes": [
  144324. // "https://www.googleapis.com/auth/cloud-platform",
  144325. // "https://www.googleapis.com/auth/compute",
  144326. // "https://www.googleapis.com/auth/compute.readonly"
  144327. // ]
  144328. // }
  144329. }
  144330. // Pages invokes f for each page of results.
  144331. // A non-nil error returned from f will halt the iteration.
  144332. // The provided context supersedes any context provided to the Context method.
  144333. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  144334. c.ctx_ = ctx
  144335. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  144336. for {
  144337. x, err := c.Do()
  144338. if err != nil {
  144339. return err
  144340. }
  144341. if err := f(x); err != nil {
  144342. return err
  144343. }
  144344. if x.NextPageToken == "" {
  144345. return nil
  144346. }
  144347. c.PageToken(x.NextPageToken)
  144348. }
  144349. }
  144350. // method id "compute.zoneOperations.wait":
  144351. type ZoneOperationsWaitCall struct {
  144352. s *Service
  144353. project string
  144354. zone string
  144355. operation string
  144356. urlParams_ gensupport.URLParams
  144357. ctx_ context.Context
  144358. header_ http.Header
  144359. }
  144360. // Wait: Waits for the specified zone-specific Operations resource until
  144361. // it is done or timeout, and retrieves the specified Operations
  144362. // resource. 1. Immediately returns when the operation is already done.
  144363. // 2. Waits for no more than the default deadline (2 minutes, subject to
  144364. // change) and then returns the current state of the operation, which
  144365. // may be DONE or still in progress. 3. Is best-effort: a. The server
  144366. // can wait less than the default deadline or zero seconds, in overload
  144367. // situations. b. There is no guarantee that the operation is actually
  144368. // done when returns. 4. User should be prepared to retry if the
  144369. // operation is not DONE.
  144370. func (r *ZoneOperationsService) Wait(project string, zone string, operation string) *ZoneOperationsWaitCall {
  144371. c := &ZoneOperationsWaitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144372. c.project = project
  144373. c.zone = zone
  144374. c.operation = operation
  144375. return c
  144376. }
  144377. // Fields allows partial responses to be retrieved. See
  144378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144379. // for more information.
  144380. func (c *ZoneOperationsWaitCall) Fields(s ...googleapi.Field) *ZoneOperationsWaitCall {
  144381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144382. return c
  144383. }
  144384. // Context sets the context to be used in this call's Do method. Any
  144385. // pending HTTP request will be aborted if the provided context is
  144386. // canceled.
  144387. func (c *ZoneOperationsWaitCall) Context(ctx context.Context) *ZoneOperationsWaitCall {
  144388. c.ctx_ = ctx
  144389. return c
  144390. }
  144391. // Header returns an http.Header that can be modified by the caller to
  144392. // add HTTP headers to the request.
  144393. func (c *ZoneOperationsWaitCall) Header() http.Header {
  144394. if c.header_ == nil {
  144395. c.header_ = make(http.Header)
  144396. }
  144397. return c.header_
  144398. }
  144399. func (c *ZoneOperationsWaitCall) doRequest(alt string) (*http.Response, error) {
  144400. reqHeaders := make(http.Header)
  144401. for k, v := range c.header_ {
  144402. reqHeaders[k] = v
  144403. }
  144404. reqHeaders.Set("User-Agent", c.s.userAgent())
  144405. var body io.Reader = nil
  144406. c.urlParams_.Set("alt", alt)
  144407. c.urlParams_.Set("prettyPrint", "false")
  144408. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}/wait")
  144409. urls += "?" + c.urlParams_.Encode()
  144410. req, err := http.NewRequest("POST", urls, body)
  144411. if err != nil {
  144412. return nil, err
  144413. }
  144414. req.Header = reqHeaders
  144415. googleapi.Expand(req.URL, map[string]string{
  144416. "project": c.project,
  144417. "zone": c.zone,
  144418. "operation": c.operation,
  144419. })
  144420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144421. }
  144422. // Do executes the "compute.zoneOperations.wait" call.
  144423. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  144424. // status code is an error. Response headers are in either
  144425. // *Operation.ServerResponse.Header or (if a response was returned at
  144426. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  144427. // to check whether the returned error was because
  144428. // http.StatusNotModified was returned.
  144429. func (c *ZoneOperationsWaitCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  144430. gensupport.SetOptions(c.urlParams_, opts...)
  144431. res, err := c.doRequest("json")
  144432. if res != nil && res.StatusCode == http.StatusNotModified {
  144433. if res.Body != nil {
  144434. res.Body.Close()
  144435. }
  144436. return nil, &googleapi.Error{
  144437. Code: res.StatusCode,
  144438. Header: res.Header,
  144439. }
  144440. }
  144441. if err != nil {
  144442. return nil, err
  144443. }
  144444. defer googleapi.CloseBody(res)
  144445. if err := googleapi.CheckResponse(res); err != nil {
  144446. return nil, err
  144447. }
  144448. ret := &Operation{
  144449. ServerResponse: googleapi.ServerResponse{
  144450. Header: res.Header,
  144451. HTTPStatusCode: res.StatusCode,
  144452. },
  144453. }
  144454. target := &ret
  144455. if err := gensupport.DecodeResponse(target, res); err != nil {
  144456. return nil, err
  144457. }
  144458. return ret, nil
  144459. // {
  144460. // "description": "Waits for the specified zone-specific Operations resource until it is done or timeout, and retrieves the specified Operations resource. 1. Immediately returns when the operation is already done. 2. Waits for no more than the default deadline (2 minutes, subject to change) and then returns the current state of the operation, which may be DONE or still in progress. 3. Is best-effort: a. The server can wait less than the default deadline or zero seconds, in overload situations. b. There is no guarantee that the operation is actually done when returns. 4. User should be prepared to retry if the operation is not DONE.",
  144461. // "httpMethod": "POST",
  144462. // "id": "compute.zoneOperations.wait",
  144463. // "parameterOrder": [
  144464. // "project",
  144465. // "zone",
  144466. // "operation"
  144467. // ],
  144468. // "parameters": {
  144469. // "operation": {
  144470. // "description": "Name of the Operations resource to return.",
  144471. // "location": "path",
  144472. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  144473. // "required": true,
  144474. // "type": "string"
  144475. // },
  144476. // "project": {
  144477. // "description": "Project ID for this request.",
  144478. // "location": "path",
  144479. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144480. // "required": true,
  144481. // "type": "string"
  144482. // },
  144483. // "zone": {
  144484. // "description": "Name of the zone for this request.",
  144485. // "location": "path",
  144486. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  144487. // "required": true,
  144488. // "type": "string"
  144489. // }
  144490. // },
  144491. // "path": "{project}/zones/{zone}/operations/{operation}/wait",
  144492. // "response": {
  144493. // "$ref": "Operation"
  144494. // },
  144495. // "scopes": [
  144496. // "https://www.googleapis.com/auth/cloud-platform",
  144497. // "https://www.googleapis.com/auth/compute",
  144498. // "https://www.googleapis.com/auth/compute.readonly"
  144499. // ]
  144500. // }
  144501. }
  144502. // method id "compute.zones.get":
  144503. type ZonesGetCall struct {
  144504. s *Service
  144505. project string
  144506. zone string
  144507. urlParams_ gensupport.URLParams
  144508. ifNoneMatch_ string
  144509. ctx_ context.Context
  144510. header_ http.Header
  144511. }
  144512. // Get: Returns the specified Zone resource. Gets a list of available
  144513. // zones by making a list() request.
  144514. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  144515. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  144516. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144517. c.project = project
  144518. c.zone = zone
  144519. return c
  144520. }
  144521. // Fields allows partial responses to be retrieved. See
  144522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144523. // for more information.
  144524. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  144525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144526. return c
  144527. }
  144528. // IfNoneMatch sets the optional parameter which makes the operation
  144529. // fail if the object's ETag matches the given value. This is useful for
  144530. // getting updates only after the object has changed since the last
  144531. // request. Use googleapi.IsNotModified to check whether the response
  144532. // error from Do is the result of In-None-Match.
  144533. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  144534. c.ifNoneMatch_ = entityTag
  144535. return c
  144536. }
  144537. // Context sets the context to be used in this call's Do method. Any
  144538. // pending HTTP request will be aborted if the provided context is
  144539. // canceled.
  144540. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  144541. c.ctx_ = ctx
  144542. return c
  144543. }
  144544. // Header returns an http.Header that can be modified by the caller to
  144545. // add HTTP headers to the request.
  144546. func (c *ZonesGetCall) Header() http.Header {
  144547. if c.header_ == nil {
  144548. c.header_ = make(http.Header)
  144549. }
  144550. return c.header_
  144551. }
  144552. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  144553. reqHeaders := make(http.Header)
  144554. for k, v := range c.header_ {
  144555. reqHeaders[k] = v
  144556. }
  144557. reqHeaders.Set("User-Agent", c.s.userAgent())
  144558. if c.ifNoneMatch_ != "" {
  144559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  144560. }
  144561. var body io.Reader = nil
  144562. c.urlParams_.Set("alt", alt)
  144563. c.urlParams_.Set("prettyPrint", "false")
  144564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  144565. urls += "?" + c.urlParams_.Encode()
  144566. req, err := http.NewRequest("GET", urls, body)
  144567. if err != nil {
  144568. return nil, err
  144569. }
  144570. req.Header = reqHeaders
  144571. googleapi.Expand(req.URL, map[string]string{
  144572. "project": c.project,
  144573. "zone": c.zone,
  144574. })
  144575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144576. }
  144577. // Do executes the "compute.zones.get" call.
  144578. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  144579. // code is an error. Response headers are in either
  144580. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  144581. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  144582. // whether the returned error was because http.StatusNotModified was
  144583. // returned.
  144584. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  144585. gensupport.SetOptions(c.urlParams_, opts...)
  144586. res, err := c.doRequest("json")
  144587. if res != nil && res.StatusCode == http.StatusNotModified {
  144588. if res.Body != nil {
  144589. res.Body.Close()
  144590. }
  144591. return nil, &googleapi.Error{
  144592. Code: res.StatusCode,
  144593. Header: res.Header,
  144594. }
  144595. }
  144596. if err != nil {
  144597. return nil, err
  144598. }
  144599. defer googleapi.CloseBody(res)
  144600. if err := googleapi.CheckResponse(res); err != nil {
  144601. return nil, err
  144602. }
  144603. ret := &Zone{
  144604. ServerResponse: googleapi.ServerResponse{
  144605. Header: res.Header,
  144606. HTTPStatusCode: res.StatusCode,
  144607. },
  144608. }
  144609. target := &ret
  144610. if err := gensupport.DecodeResponse(target, res); err != nil {
  144611. return nil, err
  144612. }
  144613. return ret, nil
  144614. // {
  144615. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  144616. // "httpMethod": "GET",
  144617. // "id": "compute.zones.get",
  144618. // "parameterOrder": [
  144619. // "project",
  144620. // "zone"
  144621. // ],
  144622. // "parameters": {
  144623. // "project": {
  144624. // "description": "Project ID for this request.",
  144625. // "location": "path",
  144626. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144627. // "required": true,
  144628. // "type": "string"
  144629. // },
  144630. // "zone": {
  144631. // "description": "Name of the zone resource to return.",
  144632. // "location": "path",
  144633. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  144634. // "required": true,
  144635. // "type": "string"
  144636. // }
  144637. // },
  144638. // "path": "{project}/zones/{zone}",
  144639. // "response": {
  144640. // "$ref": "Zone"
  144641. // },
  144642. // "scopes": [
  144643. // "https://www.googleapis.com/auth/cloud-platform",
  144644. // "https://www.googleapis.com/auth/compute",
  144645. // "https://www.googleapis.com/auth/compute.readonly"
  144646. // ]
  144647. // }
  144648. }
  144649. // method id "compute.zones.list":
  144650. type ZonesListCall struct {
  144651. s *Service
  144652. project string
  144653. urlParams_ gensupport.URLParams
  144654. ifNoneMatch_ string
  144655. ctx_ context.Context
  144656. header_ http.Header
  144657. }
  144658. // List: Retrieves the list of Zone resources available to the specified
  144659. // project.
  144660. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  144661. func (r *ZonesService) List(project string) *ZonesListCall {
  144662. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  144663. c.project = project
  144664. return c
  144665. }
  144666. // Filter sets the optional parameter "filter": A filter expression that
  144667. // filters resources listed in the response. The expression must specify
  144668. // the field name, a comparison operator, and the value that you want to
  144669. // use for filtering. The value must be a string, a number, or a
  144670. // boolean. The comparison operator must be either =, !=, >, or <.
  144671. //
  144672. // For example, if you are filtering Compute Engine instances, you can
  144673. // exclude instances named example-instance by specifying name !=
  144674. // example-instance.
  144675. //
  144676. // You can also filter nested fields. For example, you could specify
  144677. // scheduling.automaticRestart = false to include instances only if they
  144678. // are not scheduled for automatic restarts. You can use filtering on
  144679. // nested fields to filter based on resource labels.
  144680. //
  144681. // To filter on multiple expressions, provide each separate expression
  144682. // within parentheses. For example, (scheduling.automaticRestart = true)
  144683. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  144684. // AND expression. However, you can include AND and OR expressions
  144685. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  144686. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  144687. // true).
  144688. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  144689. c.urlParams_.Set("filter", filter)
  144690. return c
  144691. }
  144692. // MaxResults sets the optional parameter "maxResults": The maximum
  144693. // number of results per page that should be returned. If the number of
  144694. // available results is larger than maxResults, Compute Engine returns a
  144695. // nextPageToken that can be used to get the next page of results in
  144696. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  144697. // (Default: 500)
  144698. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  144699. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  144700. return c
  144701. }
  144702. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  144703. // a certain order. By default, results are returned in alphanumerical
  144704. // order based on the resource name.
  144705. //
  144706. // You can also sort results in descending order based on the creation
  144707. // timestamp using orderBy="creationTimestamp desc". This sorts results
  144708. // based on the creationTimestamp field in reverse chronological order
  144709. // (newest result first). Use this to sort resources like operations so
  144710. // that the newest operation is returned first.
  144711. //
  144712. // Currently, only sorting by name or creationTimestamp desc is
  144713. // supported.
  144714. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  144715. c.urlParams_.Set("orderBy", orderBy)
  144716. return c
  144717. }
  144718. // PageToken sets the optional parameter "pageToken": Specifies a page
  144719. // token to use. Set pageToken to the nextPageToken returned by a
  144720. // previous list request to get the next page of results.
  144721. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  144722. c.urlParams_.Set("pageToken", pageToken)
  144723. return c
  144724. }
  144725. // Fields allows partial responses to be retrieved. See
  144726. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  144727. // for more information.
  144728. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  144729. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  144730. return c
  144731. }
  144732. // IfNoneMatch sets the optional parameter which makes the operation
  144733. // fail if the object's ETag matches the given value. This is useful for
  144734. // getting updates only after the object has changed since the last
  144735. // request. Use googleapi.IsNotModified to check whether the response
  144736. // error from Do is the result of In-None-Match.
  144737. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  144738. c.ifNoneMatch_ = entityTag
  144739. return c
  144740. }
  144741. // Context sets the context to be used in this call's Do method. Any
  144742. // pending HTTP request will be aborted if the provided context is
  144743. // canceled.
  144744. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  144745. c.ctx_ = ctx
  144746. return c
  144747. }
  144748. // Header returns an http.Header that can be modified by the caller to
  144749. // add HTTP headers to the request.
  144750. func (c *ZonesListCall) Header() http.Header {
  144751. if c.header_ == nil {
  144752. c.header_ = make(http.Header)
  144753. }
  144754. return c.header_
  144755. }
  144756. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  144757. reqHeaders := make(http.Header)
  144758. for k, v := range c.header_ {
  144759. reqHeaders[k] = v
  144760. }
  144761. reqHeaders.Set("User-Agent", c.s.userAgent())
  144762. if c.ifNoneMatch_ != "" {
  144763. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  144764. }
  144765. var body io.Reader = nil
  144766. c.urlParams_.Set("alt", alt)
  144767. c.urlParams_.Set("prettyPrint", "false")
  144768. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  144769. urls += "?" + c.urlParams_.Encode()
  144770. req, err := http.NewRequest("GET", urls, body)
  144771. if err != nil {
  144772. return nil, err
  144773. }
  144774. req.Header = reqHeaders
  144775. googleapi.Expand(req.URL, map[string]string{
  144776. "project": c.project,
  144777. })
  144778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  144779. }
  144780. // Do executes the "compute.zones.list" call.
  144781. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  144782. // code is an error. Response headers are in either
  144783. // *ZoneList.ServerResponse.Header or (if a response was returned at
  144784. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  144785. // to check whether the returned error was because
  144786. // http.StatusNotModified was returned.
  144787. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  144788. gensupport.SetOptions(c.urlParams_, opts...)
  144789. res, err := c.doRequest("json")
  144790. if res != nil && res.StatusCode == http.StatusNotModified {
  144791. if res.Body != nil {
  144792. res.Body.Close()
  144793. }
  144794. return nil, &googleapi.Error{
  144795. Code: res.StatusCode,
  144796. Header: res.Header,
  144797. }
  144798. }
  144799. if err != nil {
  144800. return nil, err
  144801. }
  144802. defer googleapi.CloseBody(res)
  144803. if err := googleapi.CheckResponse(res); err != nil {
  144804. return nil, err
  144805. }
  144806. ret := &ZoneList{
  144807. ServerResponse: googleapi.ServerResponse{
  144808. Header: res.Header,
  144809. HTTPStatusCode: res.StatusCode,
  144810. },
  144811. }
  144812. target := &ret
  144813. if err := gensupport.DecodeResponse(target, res); err != nil {
  144814. return nil, err
  144815. }
  144816. return ret, nil
  144817. // {
  144818. // "description": "Retrieves the list of Zone resources available to the specified project.",
  144819. // "httpMethod": "GET",
  144820. // "id": "compute.zones.list",
  144821. // "parameterOrder": [
  144822. // "project"
  144823. // ],
  144824. // "parameters": {
  144825. // "filter": {
  144826. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  144827. // "location": "query",
  144828. // "type": "string"
  144829. // },
  144830. // "maxResults": {
  144831. // "default": "500",
  144832. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  144833. // "format": "uint32",
  144834. // "location": "query",
  144835. // "minimum": "0",
  144836. // "type": "integer"
  144837. // },
  144838. // "orderBy": {
  144839. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  144840. // "location": "query",
  144841. // "type": "string"
  144842. // },
  144843. // "pageToken": {
  144844. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  144845. // "location": "query",
  144846. // "type": "string"
  144847. // },
  144848. // "project": {
  144849. // "description": "Project ID for this request.",
  144850. // "location": "path",
  144851. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  144852. // "required": true,
  144853. // "type": "string"
  144854. // }
  144855. // },
  144856. // "path": "{project}/zones",
  144857. // "response": {
  144858. // "$ref": "ZoneList"
  144859. // },
  144860. // "scopes": [
  144861. // "https://www.googleapis.com/auth/cloud-platform",
  144862. // "https://www.googleapis.com/auth/compute",
  144863. // "https://www.googleapis.com/auth/compute.readonly"
  144864. // ]
  144865. // }
  144866. }
  144867. // Pages invokes f for each page of results.
  144868. // A non-nil error returned from f will halt the iteration.
  144869. // The provided context supersedes any context provided to the Context method.
  144870. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  144871. c.ctx_ = ctx
  144872. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  144873. for {
  144874. x, err := c.Do()
  144875. if err != nil {
  144876. return err
  144877. }
  144878. if err := f(x); err != nil {
  144879. return err
  144880. }
  144881. if x.NextPageToken == "" {
  144882. return nil
  144883. }
  144884. c.PageToken(x.NextPageToken)
  144885. }
  144886. }